mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
service to detect java version;
highlight access to private class members according to java version used (IDEA-83045)
This commit is contained in:
+9
@@ -0,0 +1,9 @@
|
||||
class A {
|
||||
private int value = 1;
|
||||
|
||||
static class B<T extends A> {
|
||||
void print(T t) {
|
||||
System.out.println(t.<error descr="'value' has private access in 'A'">value</error>);
|
||||
}
|
||||
}
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
class A {
|
||||
private int value = 1;
|
||||
|
||||
static class B<T extends A> {
|
||||
void print(T t) {
|
||||
System.out.println(t.value);
|
||||
}
|
||||
}
|
||||
}
|
||||
+12
-1
@@ -32,7 +32,16 @@ public class GenericsHighlightingTest extends LightDaemonAnalyzerTestCase {
|
||||
@Override
|
||||
protected void setUp() throws Exception {
|
||||
super.setUp();
|
||||
LanguageLevel level = getTestName(false).contains("Level6") ? LanguageLevel.JDK_1_6 : LanguageLevel.JDK_1_5;
|
||||
LanguageLevel level;
|
||||
final String testName = getTestName(false);
|
||||
if (testName.contains("Level17")) {
|
||||
level = LanguageLevel.JDK_1_7;
|
||||
} else if (testName.contains("Level6")) {
|
||||
level = LanguageLevel.JDK_1_6;
|
||||
}
|
||||
else {
|
||||
level = LanguageLevel.JDK_1_5;
|
||||
}
|
||||
LanguageLevelProjectExtension.getInstance(getJavaFacade().getProject()).setLanguageLevel(level);
|
||||
}
|
||||
|
||||
@@ -107,6 +116,8 @@ public class GenericsHighlightingTest extends LightDaemonAnalyzerTestCase {
|
||||
public void testPrivateInnerClassRef() throws Exception { doTest(false); }
|
||||
public void testWideningCastToTypeParam() throws Exception { doTest(false); }
|
||||
public void testCapturedWildcardAssignments() throws Exception { doTest(false);}
|
||||
public void testTypeParameterBoundVisibility() throws Exception { doTest(false);}
|
||||
public void testTypeParameterBoundVisibilityJdk14() throws Exception { doTest(false);}
|
||||
|
||||
public void testJavaUtilCollections_NoVerify() throws Exception {
|
||||
PsiClass collectionsClass = getJavaFacade().findClass("java.util.Collections", GlobalSearchScope.moduleWithLibrariesScope(getModule()));
|
||||
|
||||
Reference in New Issue
Block a user