Getting NPE while refactoring in IDEA

Hi,
I have a folder structure as follows:
TestProject->src->src1->src2-src3->files

I have project in TestProject folder, and then another project in src3
folder.
I have opened the project under src3 folder and the directory structure
under src3 is as follows:
src3->com.test.common.xml->src>com->test->common->xml and then files under
this package and few in another sub-package under it.

I have another package at the level of com.test.common.xml as
src3->test->test1

I have refactoring (move) the files
undersrc3->com.test.common.xml->src>com->test->common->xml ->sub-package to
src3->test->test1.
I am getting Null pointer expecption while doing this.
Can someone provide me with more information on why does IDEA throw NPE
while refactoring and also if it is because of my project hierarchy?

I have attached the stack trace file.

java.lang.NullPointerException
at
com.intellij.psi.search.GlobalSearchScope$PackageScope.]]>(GlobalSearchScope.java:291)
at
com.intellij.psi.search.GlobalSearchScope.packageScopeWithoutLibraries(GlobalSearchScope.java:127)
at
com.intellij.refactoring.move.moveClassesOrPackages.MoveClassesOrPackagesProcessor.a(MoveClassesOrPackagesProcessor.java:140)
at
com.intellij.refactoring.move.moveClassesOrPackages.MoveClassesOrPackagesProcessor.a(MoveClassesOrPackagesProcessor.java:61)
at
com.intellij.refactoring.move.moveClassesOrPackages.MoveClassesOrPackagesProcessor.findUsages(MoveClassesOrPackagesProcessor.java:134)
at
com.intellij.refactoring.BaseRefactoringProcessor$1$1.run(BaseRefactoringProcessor.java)
at
com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:310)
at
com.intellij.refactoring.BaseRefactoringProcessor$1.run(BaseRefactoringProcessor.java)
at
com.intellij.openapi.progress.impl.ProgressManagerImpl.runProcess(ProgressManagerImpl.java:28)
at
com.intellij.openapi.application.impl.ApplicationImpl$1MyThread.run(ApplicationImpl.java:13)
2006-06-23 15:12:50,886 ERROR - oring.BaseRefactoringProcessor -
Assertion failed
2006-06-23 15:12:50,886 ERROR - oring.BaseRefactoringProcessor -
IntelliJ IDEA 5.1 Build #4155
2006-06-23 15:12:50,886 ERROR - oring.BaseRefactoringProcessor -
JDK: 1.5.0_06
2006-06-23 15:12:50,886 ERROR - oring.BaseRefactoringProcessor -
VM: Java HotSpot(TM) Client VM
2006-06-23 15:12:50,886 ERROR - oring.BaseRefactoringProcessor -
Vendor: Sun Microsystems Inc.
2006-06-23 15:12:50,886 ERROR - oring.BaseRefactoringProcessor -
OS: Windows XP
2006-06-23 15:12:50,886 ERROR - oring.BaseRefactoringProcessor -
Last Action: Move
2006-06-23 15:12:50,886 ERROR - oring.BaseRefactoringProcessor -
Assertion failed
java.lang.Throwable
at com.intellij.openapi.diagnostic.Logger.assertTrue(Logger.java:78)
at com.intellij.openapi.diagnostic.Logger.assertTrue(Logger.java:86)
at
com.intellij.refactoring.BaseRefactoringProcessor.doRun(BaseRefactoringProcessor.java:130)
at
com.intellij.refactoring.BaseRefactoringProcessor.run(BaseRefactoringProcessor.java:10)
at
com.intellij.refactoring.ui.RefactoringDialog.invokeRefactoring(RefactoringDialog.java:0)
at
com.intellij.refactoring.move.moveClassesOrPackages.MoveClassesOrPackagesDialog.doAction(MoveClassesOrPackagesDialog.java:110)
at
com.intellij.refactoring.ui.RefactoringDialog.doRefactorAction(RefactoringDialog.java:19)
at
com.intellij.refactoring.ui.RefactoringDialog$RefactorAction.actionPerformed(RefactoringDialog.java:1)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1849)
at
javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2169)
at
javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:420)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:258)
at
javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:234)
at java.awt.Component.processMouseEvent(Component.java:5488)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3126)
at java.awt.Component.processEvent(Component.java:5253)
at java.awt.Container.processEvent(Container.java:1966)
at java.awt.Component.dispatchEventImpl(Component.java:3955)
at java.awt.Container.dispatchEventImpl(Container.java:2024)
at java.awt.Component.dispatchEvent(Component.java:3803)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4212)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3892)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3822)
at java.awt.Container.dispatchEventImpl(Container.java:2010)
at java.awt.Window.dispatchEventImpl(Window.java:1774)
at java.awt.Component.dispatchEvent(Component.java:3803)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:463)
at
com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:94)
at com.intellij.ide.IdeEventQueue.a(IdeEventQueue.java:120)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:25)
at
java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:153)
at java.awt.Dialog$1.run(Dialog.java:515)
at java.awt.Dialog.show(Dialog.java:536)
at
com.intellij.openapi.ui.impl.DialogWrapperPeerImpl$MyDialog.show(DialogWrapperPeerImpl.java:47)
at
com.intellij.openapi.ui.impl.DialogWrapperPeerImpl.show(DialogWrapperPeerImpl.java:142)
at com.intellij.openapi.ui.DialogWrapper.show(DialogWrapper.java:730)
at
com.intellij.refactoring.move.moveClassesOrPackages.MoveClassesOrPackagesImpl.doMove(MoveClassesOrPackagesImpl.java:216)
at com.intellij.refactoring.move.MoveHandler.doMove(MoveHandler.java:111)
at com.intellij.refactoring.move.MoveHandler.invoke(MoveHandler.java:122)
at
com.intellij.refactoring.actions.BaseRefactoringAction.actionPerformed(BaseRefactoringAction.java:22)
at
com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher.a(IdeKeyEventDispatcher.java:33)
at
com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher.b(IdeKeyEventDispatcher.java:176)
at
com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher.dispatchKeyEvent(IdeKeyEventDispatcher.java:77)
at com.intellij.ide.IdeEventQueue.a(IdeEventQueue.java:6)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:25)
at
java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
2006-06-23 15:12:50,886 ERROR - com.intellij.ide.IdeEventQueue -
Error during dispatching of
java.awt.event.MouseEvent[MOUSE_RELEASED,(62,174),button=1,modifiers=Button1,clickCount=1]
on dialog8
2006-06-23 15:12:50,886 ERROR - com.intellij.ide.IdeEventQueue -
IntelliJ IDEA 5.1 Build #4155
2006-06-23 15:12:50,886 ERROR - com.intellij.ide.IdeEventQueue -
JDK: 1.5.0_06
2006-06-23 15:12:50,886 ERROR - com.intellij.ide.IdeEventQueue -
VM: Java HotSpot(TM) Client VM
2006-06-23 15:12:50,886 ERROR - com.intellij.ide.IdeEventQueue -
Vendor: Sun Microsystems Inc.
2006-06-23 15:12:50,886 ERROR - com.intellij.ide.IdeEventQueue -
OS: Windows XP
2006-06-23 15:12:50,902 ERROR - com.intellij.ide.IdeEventQueue -
Last Action: Move
2006-06-23 15:12:50,902 ERROR - com.intellij.ide.IdeEventQueue -
Error during dispatching of
java.awt.event.MouseEvent[MOUSE_RELEASED,(62,174),button=1,modifiers=Button1,clickCount=1]
on dialog8
java.lang.NullPointerException
at
com.intellij.refactoring.move.moveClassesOrPackages.MoveClassesOrPackagesProcessor.preprocessUsages(MoveClassesOrPackagesProcessor.java:67)
at
com.intellij.refactoring.BaseRefactoringProcessor.doRun(BaseRefactoringProcessor.java:60)
at
com.intellij.refactoring.BaseRefactoringProcessor.run(BaseRefactoringProcessor.java:10)
at
com.intellij.refactoring.ui.RefactoringDialog.invokeRefactoring(RefactoringDialog.java:0)
at
com.intellij.refactoring.move.moveClassesOrPackages.MoveClassesOrPackagesDialog.doAction(MoveClassesOrPackagesDialog.java:110)
at
com.intellij.refactoring.ui.RefactoringDialog.doRefactorAction(RefactoringDialog.java:19)
at
com.intellij.refactoring.ui.RefactoringDialog$RefactorAction.actionPerformed(RefactoringDialog.java:1)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1849)
at
javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2169)
at
javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:420)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:258)
at
javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:234)
at java.awt.Component.processMouseEvent(Component.java:5488)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3126)
at java.awt.Component.processEvent(Component.java:5253)
at java.awt.Container.processEvent(Container.java:1966)
at java.awt.Component.dispatchEventImpl(Component.java:3955)
at java.awt.Container.dispatchEventImpl(Container.java:2024)
at java.awt.Component.dispatchEvent(Component.java:3803)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4212)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3892)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3822)
at java.awt.Container.dispatchEventImpl(Container.java:2010)
at java.awt.Window.dispatchEventImpl(Window.java:1774)
at java.awt.Component.dispatchEvent(Component.java:3803)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:463)
at
com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:94)
at com.intellij.ide.IdeEventQueue.a(IdeEventQueue.java:120)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:25)
at
java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:153)
at java.awt.Dialog$1.run(Dialog.java:515)
at java.awt.Dialog.show(Dialog.java:536)
at
com.intellij.openapi.ui.impl.DialogWrapperPeerImpl$MyDialog.show(DialogWrapperPeerImpl.java:47)
at
com.intellij.openapi.ui.impl.DialogWrapperPeerImpl.show(DialogWrapperPeerImpl.java:142)
at com.intellij.openapi.ui.DialogWrapper.show(DialogWrapper.java:730)
at
com.intellij.refactoring.move.moveClassesOrPackages.MoveClassesOrPackagesImpl.doMove(MoveClassesOrPackagesImpl.java:216)
at com.intellij.refactoring.move.MoveHandler.doMove(MoveHandler.java:111)
at com.intellij.refactoring.move.MoveHandler.invoke(MoveHandler.java:122)
at
com.intellij.refactoring.actions.BaseRefactoringAction.actionPerformed(BaseRefactoringAction.java:22)
at
com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher.a(IdeKeyEventDispatcher.java:33)
at
com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher.b(IdeKeyEventDispatcher.java:176)
at
com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher.dispatchKeyEvent(IdeKeyEventDispatcher.java:77)
at com.intellij.ide.IdeEventQueue.a(IdeEventQueue.java:6)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:25)
at
java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
2006-06-23 15:12:50,902 INFO - lication.impl.LaterInvocatorEx -
leaveModal:com.intellij.openapi.progress.util.SmoothProgressAdapter@bdcfd3

Priya Kothari


Please sign in to leave a comment.