Exception in Inspection Gadgets

Dave,

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.c.d.b.a.bc.accept(bc.java:2)

at com.intellij.psi.c.d.b.d.acceptChildren(d.java:43)

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.c.d.b.a.t.accept(t.java:12)

at com.intellij.psi.c.d.b.d.acceptChildren(d.java:43)

at com.intellij.psi.PsiRecursiveElementVisitor.visitElement(PsiRecursiveElementVisitor.java:38)

at com.intellij.psi.JavaElementVisitor.visitCodeBlock(JavaElementVisitor.java:93)

at com.intellij.psi.c.d.b.a.bv.accept(bv.java:26)

at com.intellij.psi.c.d.n.acceptChildren(n.java:69)

at com.intellij.psi.PsiRecursiveElementVisitor.visitElement(PsiRecursiveElementVisitor.java:38)

at com.intellij.psi.JavaElementVisitor.visitMethod(JavaElementVisitor.java:217)

at com.intellij.psi.c.d.be.accept(be.java:43)

at com.intellij.psi.c.d.n.acceptChildren(n.java:69)

at com.intellij.psi.PsiRecursiveElementVisitor.visitElement(PsiRecursiveElementVisitor.java:38)

at com.intellij.psi.JavaElementVisitor.visitClass(JavaElementVisitor.java:81)

at com.intellij.psi.c.d.q.accept(q.java:137)

at com.siyeh.ig.ClassInspection.checkClass(ClassInspection.java:21)

at com.intellij.codeInsight.d.a.j.b(j.java:6)

at com.intellij.codeInsight.d.a.bl$1.run(bl$1.java:9)

at com.intellij.openapi.i.a.c.runReadAction(c.java:311)

at com.intellij.codeInsight.d.a.bl.b(bl.java:14)

at com.intellij.codeInsight.d.a.bl.access$100(bl.java:9)

at com.intellij.codeInsight.d.a.bl$0.run(bl$0.java:3)

at com.intellij.openapi.progress.a.a.runProcess(a.java:50)

at com.intellij.codeInsight.d.a.bl.run(bl.java:28)


With Release 4.5 of idea (not sure if the version included is the most recent one or not).

Code that causes it is:

protected AbstractTextComponent( Object name, BinaryPropertyServerIF bg, GUIComponentIF peer, GUIResource[] resources )
{
super(name, bg, peer);

initTextComponentResources();
initAllGUIResources(resources);
constructTextComponent();
prepareWidgetStyleCommands();

applyAllResources();

myTextComponent.getDocument().addDocumentListener( this );
}

The class is abstract as well. I realize this isn't a good coding practice, but I was hoping to leave the rule turned on in IG.

Mike

1 comment
Comment actions Permalink


A fix has been submitted for this, and should be in the first 5.0 EAP.

--Dave Griffith

0

Please sign in to leave a comment.