IG: Anonymous inner class may be a named static inner class

Dave - I've been seeing this exception trigger alot over the last few EAPs
and have submitted an exception tracker for it once or twice. Any chance
this will dissapear in the next EAP? Seems to be one of the most frequent
of exceptions I'm seeing lately....



Exception happened in local inspection tool: Anonymous inner class may be
a named static inner class:
com.intellij.psi.impl.source.tree.java.PsiNewExpressionImpl
java.lang.ClassCastException:
com.intellij.psi.impl.source.tree.java.PsiNewExpressionImpl
at
com.siyeh.ig.performance.InnerClassReferenceVisitor.isClassStaticallyAccessible(InnerClassReferenceVisitor.java:28)
at
com.siyeh.ig.performance.InnerClassReferenceVisitor.visitReferenceExpression(InnerClassReferenceVisitor.java:101)
at
com.intellij.psi.impl.source.tree.java.PsiReferenceExpressionImpl.accept(PsiReferenceExpressionImpl.java:11)
at
com.intellij.psi.impl.source.tree.CompositePsiElement.acceptChildren(CompositePsiElement.java:42)
at
com.intellij.psi.PsiRecursiveElementVisitor.visitElement(PsiRecursiveElementVisitor.java:21)
at
com.intellij.psi.JavaElementVisitor.visitExpression(JavaElementVisitor.java:110)
at
com.intellij.psi.JavaElementVisitor.visitCallExpression(JavaElementVisitor.java:198)
at
com.intellij.psi.JavaElementVisitor.visitMethodCallExpression(JavaElementVisitor.java:194)
at
com.intellij.psi.impl.source.tree.java.PsiMethodCallExpressionImpl.accept(PsiMethodCallExpressionImpl.java:1)
at
com.intellij.psi.impl.source.tree.CompositePsiElement.acceptChildren(CompositePsiElement.java:42)
at
com.intellij.psi.PsiRecursiveElementVisitor.visitElement(PsiRecursiveElementVisitor.java:21)
at
com.intellij.psi.JavaElementVisitor.visitStatement(JavaElementVisitor.java:282)
at
com.intellij.psi.JavaElementVisitor.visitReturnStatement(JavaElementVisitor.java:278)
at
com.intellij.psi.impl.source.tree.java.PsiReturnStatementImpl.accept(PsiReturnStatementImpl.java:14)
at
com.intellij.psi.impl.source.tree.CompositePsiElement.acceptChildren(CompositePsiElement.java:42)
at
com.intellij.psi.PsiRecursiveElementVisitor.visitElement(PsiRecursiveElementVisitor.java:21)
at
com.intellij.psi.JavaElementVisitor.visitCodeBlock(JavaElementVisitor.java:66)
at
com.intellij.psi.impl.source.tree.java.PsiCodeBlockImpl.accept(PsiCodeBlockImpl.java:66)
at
com.intellij.psi.impl.source.TreeWrapperPsiElement.acceptChildren(TreeWrapperPsiElement.java:51)
at
com.intellij.psi.PsiRecursiveElementVisitor.visitElement(PsiRecursiveElementVisitor.java:21)
at
com.intellij.psi.JavaElementVisitor.visitMethod(JavaElementVisitor.java:190)
at
com.intellij.psi.impl.source.PsiMethodImpl.accept(PsiMethodImpl.java:9)
at
com.intellij.psi.impl.source.TreeWrapperPsiElement.acceptChildren(TreeWrapperPsiElement.java:51)
at
com.intellij.psi.PsiRecursiveElementVisitor.visitElement(PsiRecursiveElementVisitor.java:21)
at
com.intellij.psi.JavaElementVisitor.visitClass(JavaElementVisitor.java:54)
at
com.intellij.psi.JavaElementVisitor.visitAnonymousClass(JavaElementVisitor.java:18)
at
com.intellij.psi.impl.source.PsiAnonymousClassImpl.accept(PsiAnonymousClassImpl.java:41)
at
com.siyeh.ig.performance.AnonymousInnerClassMayBeStaticInspection$AnonymousInnerClassCanBeStaticVisitor.visitClass(AnonymousInnerClassMayBeStaticInspection.java:47)
at
com.intellij.psi.JavaElementVisitor.visitAnonymousClass(JavaElementVisitor.java:18)
at
com.intellij.psi.impl.source.PsiAnonymousClassImpl.accept(PsiAnonymousClassImpl.java:41)
at com.siyeh.ig.ClassInspection.doCheckClass(ClassInspection.java:15) at
com.siyeh.ig.BaseInspection.checkClass(BaseInspection.java:79) at
com.intellij.codeInsight.daemon.impl.LocalInspectionsPass.doCollectInformation(LocalInspectionsPass.java:93)
at
com.intellij.codeInsight.daemon.impl.TextEditorHighlightingPass.collectInformation(TextEditorHighlightingPass.java:9)
at
com.intellij.codeInsight.daemon.impl.UpdateThread$2.run(UpdateThread.java:8)
at
com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:377)
at
com.intellij.codeInsight.daemon.impl.UpdateThread.a(UpdateThread.java:10)
at
com.intellij.codeInsight.daemon.impl.UpdateThread.access$100(UpdateThread.java:43)
at
com.intellij.codeInsight.daemon.impl.UpdateThread$1.run(UpdateThread.java:0)
at
com.intellij.openapi.progress.impl.ProgressManagerImpl.runProcess(ProgressManagerImpl.java:2)
at
com.intellij.codeInsight.daemon.impl.UpdateThread.run(UpdateThread.java:19)

2 comments
Comment actions Permalink

Fixed in the next build. Sorry for the inconvenience.

--Dave Griffith

0
Comment actions Permalink

Dave Griffith wrote:

Fixed in the next build. Sorry for the inconvenience.


Cheers - now if the text formatting issues get resolved, this next EAP
will be something to behold and love...

Looking forward to it :)

0

Please sign in to leave a comment.