[BUG] Inspection Gadgets in 3326

I'm not sure why this happened but it happened after I added a comment line
like: /* comment */

Exception happened in local inspection tool: Unnecessary 'return' statement
java.lang.NullPointerException
at com.intellij.psi.util.PsiTreeUtil.getParentOfType(PsiTreeUtil.java:138)
at com.intellij.psi.util.PsiTreeUtil.getParentOfType(PsiTreeUtil.java:133)
at
com.siyeh.ig.psiutils.ControlFlowUtils.getContainingStatementOrBlock(ControlFlowUtils.java:336)
at
com.siyeh.ig.psiutils.ControlFlowUtils.blockCompletesWithStatement(ControlFlowUtils.java:303)
at
com.siyeh.ig.verbose.UnnecessaryReturnInspection$UnnecessaryReturnVisitor.visitReturnStatement(UnnecessaryReturnInspection.java:90)
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.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.visitBlockStatement(JavaElementVisitor.java:46)
at
com.intellij.psi.impl.source.tree.java.PsiBlockStatementImpl.accept(PsiBlockStatementImpl.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.visitCodeBlock(JavaElementVisitor.java:66)
at
com.intellij.psi.impl.source.tree.java.PsiCodeBlockImpl.accept(PsiCodeBlockImpl.java:66)
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.siyeh.ig.StatementInspection.doCheckMethod(StatementInspection.java:35)
at com.siyeh.ig.BaseInspection.checkMethod(BaseInspection.java:56)
at
com.intellij.codeInsight.daemon.impl.LocalInspectionsPass.doCollectInformation(LocalInspectionsPass.java:8)
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)


3 comments
Comment actions Permalink


In general, submit issues with InspectionGadgets to either the JIRA, or use the automated error-reporting tool to submit stack traces. For this one, don't bother. I've just submitted a fix. Should be in the next EAP.

--Dave Griffith

0
Comment actions Permalink

Will do. Thanks for the quick response!!

--Grant

"Dave Griffith" <dave.griffith@cnn.com> wrote in message
news:15345096.1115746630327.JavaMail.itn@is.intellij.net...
>

In general, submit issues with InspectionGadgets to either the JIRA, or
use the automated error-reporting tool to submit stack traces. For this
one, don't bother. I've just submitted a fix. Should be in the next EAP.

>

--Dave Griffith



0
Comment actions Permalink

But with a sprinkling of the magic dust that are the @Nullable/@NotNull
annotations, the next version won't have any NPEs, right? ;)
R

0

Please sign in to leave a comment.