PrivateMemberAccessBetweenOuterAndInnerClassInspection: switch off for Java 11+

Thanks to nestmates accessors are not generated since Java 11
This commit is contained in:
Tagir Valeev
2018-09-27 10:28:42 +07:00
parent 625c1cc676
commit 28dd742dcd
2 changed files with 6 additions and 3 deletions
@@ -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
@@ -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>