mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
PrivateMemberAccessBetweenOuterAndInnerClassInspection: switch off for Java 11+
Thanks to nestmates accessors are not generated since Java 11
This commit is contained in:
+2
-1
@@ -20,6 +20,7 @@ import com.intellij.openapi.project.Project;
|
||||
import com.intellij.psi.*;
|
||||
import com.intellij.psi.util.FileTypeUtils;
|
||||
import com.intellij.psi.util.PsiTreeUtil;
|
||||
import com.intellij.psi.util.PsiUtil;
|
||||
import com.siyeh.InspectionGadgetsBundle;
|
||||
import com.siyeh.ig.BaseInspection;
|
||||
import com.siyeh.ig.BaseInspectionVisitor;
|
||||
@@ -176,7 +177,7 @@ public class PrivateMemberAccessBetweenOuterAndInnerClassInspection extends Base
|
||||
// disable for jsp files IDEADEV-12957
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
return !PsiUtil.isLanguageLevel11OrHigher(file);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+4
-2
@@ -12,8 +12,10 @@ another class. To enable access from an inner class to private members of a
|
||||
containing class or the other way around javac creates a package-private
|
||||
synthetic accessor method. Less use of memory and greater performance may be achieved by making the
|
||||
member package-private, thus allowing direct access without the creation of a synthetic accessor method.
|
||||
<!-- tooltip end -->
|
||||
<p>
|
||||
|
||||
This inspection does not report anything if language level is set to Java 11 or higher
|
||||
as thanks to nest-based access control (JEP 181), accessor methods are not generated anymore.
|
||||
</p>
|
||||
<!-- tooltip end -->
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user