mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-13 21:55:01 +07:00
primitive/class conversions are available since language level 1.5 (IDEA-111451)
This commit is contained in:
@@ -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)) {
|
||||
|
||||
+7
@@ -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) {}
|
||||
}
|
||||
}
|
||||
-7
@@ -1,7 +0,0 @@
|
||||
class Test {
|
||||
public static void main(String[] args) {
|
||||
Object o = null;
|
||||
if (o == 1) {}
|
||||
if (1 == o) {}
|
||||
}
|
||||
}
|
||||
+1
@@ -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); }
|
||||
}
|
||||
|
||||
-1
@@ -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); }
|
||||
|
||||
Reference in New Issue
Block a user