IPP exception
Hi there,
The code looked something like this, initially:
ClassX x = new ClassX("test", "test").
I was about to replace the constructor call with a factory call, so I
started typing. When the code looked like this:
ClassX x = new ClassX.createClassX("test", "test")
an intention popped up, offering to replace fully qualified name with
import. I gave it a try (to see what's gonna happen) and I got the
exception.
The ipp should not have offered the replace in the first place, as far as I
can tell.
Thx,
Andrei
java.lang.NullPointerException
at com.intellij.psi.impl.r.createImportStatement(r.java:192)
at
com.siyeh.ipp.fqnames.ReplaceFullyQualifiedNameWithImportIntention.addImport
IfNecessary(ReplaceFullyQualifiedNameWithImportIntention.java:82)
at
com.siyeh.ipp.fqnames.ReplaceFullyQualifiedNameWithImportIntention.invoke(Re
placeFullyQualifiedNameWithImportIntention.java:54)
at com.intellij.codeInsight.intention.a.v$8.run(v$8.java:4)
at com.intellij.openapi.application.a.b.runWriteAction(b.java:85)
at com.intellij.codeInsight.intention.a.v$11.run(v$11.java:2)
at com.intellij.openapi.command.impl.a.executeCommand(a.java:73)
at com.intellij.codeInsight.intention.a.v$0.run(v$0.java:3)
at com.intellij.util.LaterInvocator$FlushQueue.run(LaterInvocator.java:15)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:178)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:454)
at com.intellij.ide.q.b(q.java:50)
at com.intellij.ide.q.a(q.java:138)
at com.intellij.ide.q.dispatchEvent(q.java:71)
at
java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.ja
va:201)
at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java
:151)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:145)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:137)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:100)
请先登录再写评论。
I also had problems with IG's detection of FQN, because it suggested to
rename "new OuterClass.InnerClass()" with "new InnerClass()", which
caused compiler errors.
--
Lars Köhler