primitive/class conversions are available since language level 1.5 (IDEA-111451)

This commit is contained in:
anna
2013-08-05 18:16:24 +02:00
parent 5934fd50c6
commit 30dce02dfc
5 changed files with 9 additions and 9 deletions
@@ -480,7 +480,7 @@ public class TypeConversionUtil {
else {
if (isPrimitiveAndNotNull(ltype)) {
return rtype instanceof PsiClassType &&
((PsiClassType)rtype).getLanguageLevel().isAtLeast(LanguageLevel.JDK_1_7) &&
((PsiClassType)rtype).getLanguageLevel().isAtLeast(LanguageLevel.JDK_1_5) &&
areTypesConvertible(ltype, rtype);
}
if (isPrimitiveAndNotNull(rtype)) {
@@ -0,0 +1,7 @@
class Test {
public static void main(String[] args) {
Object o = null;
if (<error descr="Operator '==' cannot be applied to 'java.lang.Object', 'int'">o == 1</error>) {}
if (1 == o) {}
}
}
@@ -1,7 +0,0 @@
class Test {
public static void main(String[] args) {
Object o = null;
if (o == 1) {}
if (1 == o) {}
}
}
@@ -57,4 +57,5 @@ public class LightAdvHighlightingJdk6Test extends LightDaemonAnalyzerTestCase {
public void testIDEA108285() throws Exception { setLanguageLevel(LanguageLevel.JDK_1_6); doTest(false, false); }
public void testClassObjectAccessibility() throws Exception { setLanguageLevel(LanguageLevel.JDK_1_6); doTest(false, false); }
public void testRedundantCastInConditionalExpression() throws Exception { setLanguageLevel(LanguageLevel.JDK_1_6); doTest(true, false); }
public void testJava5CastConventions() { setLanguageLevel(LanguageLevel.JDK_1_5); doTest(true, false); }
}
@@ -156,7 +156,6 @@ public class LightAdvHighlightingJdk7Test extends LightDaemonAnalyzerTestCase {
public void testMethodReferences() { doTest(false, true, false); }
public void testUsedMethodsByMethodReferences() { doTest(true, true, false); }
public void testLambdaExpressions() { doTest(false, true, false); }
public void testJava7CastConventions() { doTest(false, true, false); }
public void testUncheckedWarning() { doTest(true, false); }
public void testUncheckedWarningIDEA59290() { doTest(true, false); }
public void testUncheckedWarningIDEA70620() { doTest(true, false); }