java2python icon indicating copy to clipboard operation
java2python copied to clipboard

Suggestions for little improvements

Open tweeze opened this issue 11 years ago • 0 comments

Hello,

I tried your tool and had some problems which you might like to know for future improvement. I tell you every point so you can decide which are useful for you.

  1. The tool coudn't convert sourcecode with German Umlauts, even if the Umlauts where only in comments.
  2. Java import statements where left in which where useless in Python.
  3. The converter inserted cls as self-reference. It added cls. before variables, but not before functions, so the functions wheren't found when running.
  4. Javas functions from librarys are left untouched. It would be possible to exchange "Math.abs(Random().nextInt()) % 6" by Pythons "random.randint(0, 6)"
  5. stdin = BufferedReader(InputStreamReader(System.in_)) is left in and not useful anymore. (Only "BufferedReader" before stdin was thrown out.)
  6. String eing = stdin.readLine(); was completly thrown out by the tool. I would like it to be exchanged by eing = raw_input("")
  7. If a variable is declared as something else as a string and is concatenated with a string, it would be nice to put str() around it. For example: int counter = 0; System.out.println("The counter is: " + counter); should become counter = 0 print "The counter is: " + str(counter)

Thanks for the great work, I like your tool as it is. Please take this points as suggestions, without need to accept.

tweeze avatar Feb 19 '14 10:02 tweeze