IG: Exception for Escaped Constructor
While running IG, I get the following:
Error message: Exception happened in local inspection tool: 'this' reference escaped in constructor
java.lang.ClassCastException
at com.siyeh.ig.initialization.ThisEscapedInConstructorInspection$ThisExposedInConstructorInspectionVisitor.visitMethodCallExpression(ThisEscapedInConstructorInspection.java:152)
at com.intellij.psi.a.a.g.a.bc.accept(bc.java:5)
at com.intellij.psi.a.a.g.d.acceptChildren(d.java:82)
at com.intellij.psi.PsiRecursiveElementVisitor.visitElement(PsiRecursiveElementVisitor.java:38)
at com.intellij.psi.JavaElementVisitor.visitStatement(JavaElementVisitor.java:295)
at com.intellij.psi.JavaElementVisitor.visitExpressionStatement(JavaElementVisitor.java:149)
at com.intellij.psi.a.a.g.a.t.accept(t.java:10)
at com.intellij.psi.a.a.g.d.acceptChildren(d.java:82)
at com.intellij.psi.PsiRecursiveElementVisitor.visitElement(PsiRecursiveElementVisitor.java:38)
at com.intellij.psi.JavaElementVisitor.visitCodeBlock(JavaElementVisitor.java:93)
at com.intellij.psi.a.a.g.a.bv.accept(bv.java:15)
at com.intellij.psi.a.a.n.acceptChildren(n.java:2)
at com.intellij.psi.PsiRecursiveElementVisitor.visitElement(PsiRecursiveElementVisitor.java:38)
at com.intellij.psi.JavaElementVisitor.visitMethod(JavaElementVisitor.java:217)
at com.intellij.psi.a.a.be.accept(be.java:20)
at com.intellij.psi.a.a.n.acceptChildren(n.java:2)
at com.intellij.psi.PsiRecursiveElementVisitor.visitElement(PsiRecursiveElementVisitor.java:38)
at com.intellij.psi.JavaElementVisitor.visitClass(JavaElementVisitor.java:81)
at com.intellij.psi.a.a.q.accept(q.java:166)
at com.siyeh.ig.ClassInspection.checkClass(ClassInspection.java:21)
at com.intellij.codeInsight.h.a.j.b(j.java:35)
at com.intellij.codeInsight.h.a.bl$1.run(bl$1.java:12)
at com.intellij.openapi.b.b.c.runReadAction(c.java:382)
at com.intellij.codeInsight.h.a.bl.b(bl.java:3)
at com.intellij.codeInsight.h.a.bl.access$100(bl.java:7)
at com.intellij.codeInsight.h.a.bl$0.run(bl$0.java:1)
at com.intellij.openapi.progress.a.a.runProcess(a.java:39)
at com.intellij.codeInsight.h.a.bl.run(bl.java:0)
Is this known, or should I post a tracker item?
Mike
请先登录再写评论。
It's already reported:
http://www.intellij.net/tracker/idea/viewSCR?publicId=37312
Michael Kirby wrote:
Any chance of this being fixed soon? It's killing me. We have a lot of "escaped reference in constructors", and I'm inclined to leave the inspection on, to prevent future people from doing this kind of development, but the exceptions get in the way.
Mike
The one big downside of moving InspectionGadgets into the main IDEA build is that it means my ship times become tied to IDEA's. (The big upside is that my stuff gets uses by 10x-20x more people, so I'm not complaining). The fix for this bug should ship in an early Irida EAP release. Sorry I can't manage anything sooner.
--Dave Griffith
Just tried iridia, and now none of my inspection gadgets seem to be working (and no exceptions, either).
Is IG considered one of the plugins that ships? I upgraded settings. Does it copy over the new one and replace the old one perhaps?
Mike
Check your settings. Things might have gotten lost in your install. It worked fine for me.
--Dave Griffith