natural / java2python

Simple but effective library to translate Java source code to Python.
GNU Lesser General Public License v2.1
564 stars 243 forks source link

Couple of issues #44

Open maksym3d opened 8 years ago

maksym3d commented 8 years ago

I was trying to convert some old Java class to python using your utility and for the most part it worked awesome!

However, these were a couple of issues:

  1. Conversion lost some lines of code along with most of the comments. For example, see assignment to the 'name' variable in the constructor. This made me go and compare every single line just to make I have not lost anything. This is probably my main issue with tool.
  2. Some of the member functions got the 'self' pointer, while others for some reason got 'cls'. Not sure why, but this was completely unnecessary.
  3. The tool did not prepend the calls to member functions with .self.
  4. For loops got replaced with 'while'.

My Java file

Output Python file

Thanks very much for your efforts!

Maksym