[ANN] AutoBoxingPlugin ver 0.7

Changes in 0.7

- Intentions are available in array initializer expressions.

- "Converts wrapper classes to primitive types" intention is extended
to do an appropriate cast. For example,
int i = anObject; => int i = (Integer)anObject).intValue();

- Intentions are available in some binary expressions like <, >, !=.
For example,
if(i != "12") => if(i != Integer.parse("12"))

Plugin URL: http://www.intellij.org/twiki/bin/view/Main/AutoBoxingPlugin

/kesh

2 comments
Comment actions Permalink

- "Converts wrapper classes to primitive types" intention is extended
to do an appropriate cast. For example,
int i = anObject; => int i = (Integer)anObject).intValue();


Maybe i do not understand correctly (currently i do not use this plugin),
but why dont you do a cast to "Number"?

int i = anObject; => int i = ((Number) anObject).intValue();

So "anObject" could be of any number type.

Just an idea.
Mario


0
Comment actions Permalink

Mario Ivankovits wrote:
>> - "Converts wrapper classes to primitive types" intention is extended
>>to do an appropriate cast. For example,
>> int i = anObject; => int i = (Integer)anObject).intValue();


Maybe i do not understand correctly (currently i do not use this plugin),
but why dont you do a cast to "Number"?

int i = anObject; => int i = ((Number) anObject).intValue();

So "anObject" could be of any number type.

Just an idea.
Mario


Yes, you are right. You can download a new version of the plugin.

Thanks,
/kesh

0

Please sign in to leave a comment.