Lineage-bug: NPE while invoking "Convert interface to class"

Sketched example:

public class Foo {

private static final Bar B1 = new Bar() {
}

private static final Bar B2 = new Bar() {
}

private interface Bar {
}
}

Exception:

java.lang.NullPointerException
at
net.intellij.plugins.lineage.ConvertInterfaceToClassIntention.removeReference(ConvertInterfaceToClassIntention.java:108)
at
net.intellij.plugins.lineage.ConvertInterfaceToClassIntention.moveSubClassImplementsToExtends(ConvertInterfaceToClassIntention.java:98)
at
net.intellij.plugins.lineage.ConvertInterfaceToClassIntention.invoke(ConvertInterfaceToClassIntention.java:60)
at
com.intellij.codeInsight.intention.impl.IntentionHintComponent$10.run(IntentionHintComponent.java:3)
at
com.intellij.openapi.application.impl.ApplicationImpl.runWriteAction(ApplicationImpl.java:97)
at
com.intellij.codeInsight.intention.impl.IntentionHintComponent$11.run(IntentionHintComponent.java:2)
at
com.intellij.openapi.command.impl.CommandProcessorImpl.executeCommand(CommandProcessorImpl.java:13)
at
com.intellij.openapi.command.impl.CommandProcessorImpl.executeCommand(CommandProcessorImpl.java:5)
at
com.intellij.codeInsight.intention.impl.IntentionHintComponent$9.run(IntentionHintComponent.java:4)
at
com.intellij.openapi.application.impl.LaterInvocatorEx$FlushQueue.run(LaterInvocatorEx.java:0)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:178)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:454)
at
com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:18)
at com.intellij.ide.IdeEventQueue.a(IdeEventQueue.java:19)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:141)
at
java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java: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)

Tom

2 comments
Comment actions Permalink

Thanks for reporting Tom. I have uploaded a new version to the plugin
repository, which should fix this.

Bas

Thomas Singer (MoTJ) wrote:

Sketched example:

public class Foo {

private static final Bar B1 = new Bar() {
}

private static final Bar B2 = new Bar() {
}

private interface Bar {
}
}

Exception:

java.lang.NullPointerException
at
net.intellij.plugins.lineage.ConvertInterfaceToClassIntention.removeReference(ConvertInterfaceToClassIntention.java:108)
at
net.intellij.plugins.lineage.ConvertInterfaceToClassIntention.moveSubClassImplementsToExtends(ConvertInterfaceToClassIntention.java:98)
at
net.intellij.plugins.lineage.ConvertInterfaceToClassIntention.invoke(ConvertInterfaceToClassIntention.java:60)
at
com.intellij.codeInsight.intention.impl.IntentionHintComponent$10.run(IntentionHintComponent.java:3)
at
com.intellij.openapi.application.impl.ApplicationImpl.runWriteAction(ApplicationImpl.java:97)
at
com.intellij.codeInsight.intention.impl.IntentionHintComponent$11.run(IntentionHintComponent.java:2)
at
com.intellij.openapi.command.impl.CommandProcessorImpl.executeCommand(CommandProcessorImpl.java:13)
at
com.intellij.openapi.command.impl.CommandProcessorImpl.executeCommand(CommandProcessorImpl.java:5)
at
com.intellij.codeInsight.intention.impl.IntentionHintComponent$9.run(IntentionHintComponent.java:4)
at
com.intellij.openapi.application.impl.LaterInvocatorEx$FlushQueue.run(LaterInvocatorEx.java:0)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:178)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:454)
at
com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:18)
at com.intellij.ide.IdeEventQueue.a(IdeEventQueue.java:19)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:141)
at
java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java: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)

Tom

0
Comment actions Permalink

Thanks for the fast response.

Tom

0

Please sign in to leave a comment.