10 comments

Hi Alexy,

Alexey Efimov wrote:

Why this one replace code by:


instead of simply Boolean.valueOf(value)
?


It should replace to Boolean.valueOf(value) if your language level is
greater than 1.3 since Boolean.valueOf was introduced in jdk 1.4.
Do you have the language level of your project set to 1.3? If not, which
build are you using?

Bas

0

Ops, fixed :)

But, Language level is not Language :) It should be depended on JDK, not on Language level (keywords support and highlighting). I'm wrong? :)

0

Alexey Efimov wrote:

But, Language level is not Language :) It should be depended on JDK,
not on Language level (keywords support and highlighting). I'm wrong?
:)


I guess it's debatable. InspectionGadgets and IntentionPowerPack go by
the principle that if you develop using language level 1.3, you want the
final code to be able to run on 1.3. If the reason is you want to avoid
certain language constructs, you should probably use the inspections in
the category "Java language level issues".

Bas

0

Language level is not the same as Target JDK, i guess.

So, for example, i have language level below 1.5, but IG highlight me Unnessary Unboxing on Boolean.valueOf(value).

0


Alexey Efimov wrote:

Language level is not the same as Target JDK, i guess.

So, for example, i have language level below 1.5, but IG highlight me
Unnessary Unboxing on Boolean.valueOf(value).


That would be a bug. Do you have an example?

Bas

0

Hmm,
Since i'm switch language level, i can't this reproduce... :)

0

I think this behavior sucks because it makes the IDE distinction between
language level and JDK much less useful.

Bas Leijdekkers wrote:

Alexey Efimov wrote:

>> But, Language level is not Language :) It should be depended on JDK,
>> not on Language level (keywords support and highlighting). I'm wrong?
>> :)


I guess it's debatable. InspectionGadgets and IntentionPowerPack go by
the principle that if you develop using language level 1.3, you want the
final code to be able to run on 1.3. If the reason is you want to avoid
certain language constructs, you should probably use the inspections in
the category "Java language level issues".

Bas

0

A very eloquent and nuanced opinion. How would you improve it?
This way it's possible to develop on java 5 and deploy on 1.4 (like IDEA itself) or vice versa avoid java 5 features but still deploy on a 5.0 vm. Is this possible any other way?

Bas

0

I think you're talking about that expression of my opinion. I think
there should be a setting "Target JDK" which is different than "Compile
JDK." Of course this might wait for
http://jetbrains.net/jira/browse/IDEADEV-2853 when there's some unified
UI for compile vs run (vs test) libraries.

Bas Leijdekkers wrote:

A very eloquent and nuanced opinion. How would you improve it? This
way it's possible to develop on java 5 and deploy on 1.4 (like IDEA
itself) or vice versa avoid java 5 features but still deploy on a 5.0
vm. Is this possible any other way?

Bas

0

Keith Lea wrote:

I think
there should be a setting "Target JDK" which is different than "Compile
JDK."


Ah, now I understand, and that makes sense. Is there a JIRA request I
can vote for?

Bas

0

Please sign in to leave a comment.