The Java wrapper classes (`Integer`, `Boolean`, `Byte`, `Char`, `Short`, `Long`, `Float`, `Double` [and `String`]) should be handled consistently. At the moment `Integer`, `Boolean` and `String` are translated into primitive types in Python and the rest are treated as common objects. I think that the same rule should apply to all of them. A big problem here are the (pretty useful) static methods inside them.
Activity
natural commentedon Apr 24, 2012
I wrote a test for this:
https://github.com/natural/java2python/blob/master/test/BasicTypes2.java
And after the bug fix in 940a4ff, it passes. All of the types you mention are translated into Python builtin types.
| A big problem here are the (pretty useful) static methods inside them.
Could you explain what this means?
iuliux commentedon Apr 24, 2012
I was referring to methods like:
But never mind. I just tried it out and it looks good.
Sorry, my bad, speaking before testing.
But it is still inconsistent, and I mean by this:
turns into:
Maybe just adding some more rules in
config/default.pyfor the rest of the types would be a good solution?Extends typeSubs map with types listed in #9.
natural commentedon Apr 25, 2012
Commit 0d1e103 should address your concerns. Please review and advise, and if everything is ok, close the ticket.
Thanks again for all of your feedback!
iuliux commentedon Apr 25, 2012
It's ok, only skipped the Float from there. I fixed it quickly in Pull Req #10