Bug 473341 - [extract interface] NullPointerException in SuperTypeConstraintsModel.createMethodParameterVariable (409)
Summary: [extract interface] NullPointerException in SuperTypeConstraintsModel.createM...
Status: CLOSED WONTFIX
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.5   Edit
Hardware: All All
: P3 normal with 1 vote (vote)
Target Milestone: ---   Edit
Assignee: JDT-UI-Inbox CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords: needinfo
Depends on:
Blocks:
 
Reported: 2015-07-23 02:37 EDT by EPP Error Reports CLA
Modified: 2019-09-03 04:16 EDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description EPP Error Reports CLA 2015-07-23 02:37:07 EDT
The following incident was reported via the automated error reporting:


    code:                   10.000
    plugin:                 org.eclipse.ltk.ui.refactoring_3.7.200.v20140625-1835
    message:                Internal Error
    fingerprint:            31134f4d
    exception class:        java.lang.reflect.InvocationTargetException
    exception message:      -
    number of children:     0
    
    java.lang.reflect.InvocationTargetException: null
    at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:420)
    at org.eclipse.ltk.internal.ui.refactoring.RefactoringWizardDialog2.run(RefactoringWizardDialog2.java:331)
    at org.eclipse.ltk.ui.refactoring.RefactoringWizard.internalPerformFinish(RefactoringWizard.java:637)
    at org.eclipse.ltk.ui.refactoring.UserInputWizardPage.performFinish(UserInputWizardPage.java:153)
    at org.eclipse.jdt.internal.ui.refactoring.ExtractInterfaceWizard$ExtractInterfaceInputPage.performFinish(ExtractInterfaceWizard.java:359)
    at org.eclipse.ltk.ui.refactoring.RefactoringWizard.performFinish(RefactoringWizard.java:710)
    at org.eclipse.ltk.internal.ui.refactoring.RefactoringWizardDialog2.okPressed(RefactoringWizardDialog2.java:455)
    at org.eclipse.jface.dialogs.Dialog.buttonPressed(Dialog.java:466)
    at org.eclipse.jface.dialogs.Dialog$2.widgetSelected(Dialog.java:619)
    at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:248)
    at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
    at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4362)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1113)
    at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4180)
    at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3769)
    at org.eclipse.jface.window.Window.runEventLoop(Window.java:827)
    at org.eclipse.jface.window.Window.open(Window.java:803)
    at org.eclipse.ltk.ui.refactoring.RefactoringWizardOpenOperation$1.run(RefactoringWizardOpenOperation.java:187)
    at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
    at org.eclipse.ltk.ui.refactoring.RefactoringWizardOpenOperation.run(RefactoringWizardOpenOperation.java:202)
    at org.eclipse.ltk.ui.refactoring.RefactoringWizardOpenOperation.run(RefactoringWizardOpenOperation.java:122)
    at org.eclipse.jdt.internal.ui.refactoring.actions.RefactoringStarter.activate(RefactoringStarter.java:38)
    at org.eclipse.jdt.internal.corext.refactoring.RefactoringExecutionStarter.startExtractInterfaceRefactoring(RefactoringExecutionStarter.java:290)
    at org.eclipse.jdt.ui.actions.ExtractInterfaceAction.run(ExtractInterfaceAction.java:147)
    at org.eclipse.jdt.ui.actions.SelectionDispatchAction.dispatchRun(SelectionDispatchAction.java:279)
    at org.eclipse.jdt.ui.actions.SelectionDispatchAction.run(SelectionDispatchAction.java:251)
    at org.eclipse.jface.action.Action.runWithEvent(Action.java:473)
    at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:595)
    at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:511)
    at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:420)
    at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
    at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4362)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1113)
    at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4180)
    at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3769)
    at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$4.run(PartRenderingEngine.java:1127)
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:337)
    at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1018)
    at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:156)
    at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:654)
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:337)
    at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:598)
    at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150)
    at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:139)
    at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(null:-2)
    at sun.reflect.NativeMethodAccessorImpl.invoke(null:-1)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(null:-1)
    at java.lang.reflect.Method.invoke(null:-1)
    at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:669)
    at org.eclipse.equinox.launcher.Main.basicRun(Main.java:608)
    at org.eclipse.equinox.launcher.Main.run(Main.java:1515)
caused by: java.lang.NullPointerException: null
    at org.eclipse.jdt.internal.corext.refactoring.structure.constraints.SuperTypeConstraintsModel.createMethodParameterVariable(SuperTypeConstraintsModel.java:409)
    at org.eclipse.jdt.internal.corext.refactoring.structure.constraints.SuperTypeConstraintsCreator.endVisit(SuperTypeConstraintsCreator.java:419)
    at org.eclipse.jdt.internal.corext.refactoring.structure.constraints.SuperTypeConstraintsCreator.endVisit(SuperTypeConstraintsCreator.java:533)
    at org.eclipse.jdt.core.dom.MethodInvocation.accept0(MethodInvocation.java:241)
    at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2711)
    at org.eclipse.jdt.core.dom.ASTNode.acceptChild(ASTNode.java:2759)
    at org.eclipse.jdt.core.dom.ExpressionStatement.accept0(ExpressionStatement.java:145)
    at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2711)
    at org.eclipse.jdt.core.dom.ASTNode.acceptChildren(ASTNode.java:2782)
    at org.eclipse.jdt.core.dom.Block.accept0(Block.java:137)
    at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2711)
    at org.eclipse.jdt.core.dom.ASTNode.acceptChild(ASTNode.java:2759)
    at org.eclipse.jdt.core.dom.MethodDeclaration.accept0(MethodDeclaration.java:635)
    at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2711)
    at org.eclipse.jdt.core.dom.ASTNode.acceptChildren(ASTNode.java:2782)
    at org.eclipse.jdt.core.dom.TypeDeclaration.accept0(TypeDeclaration.java:470)
    at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2711)
    at org.eclipse.jdt.core.dom.ASTNode.acceptChildren(ASTNode.java:2782)
    at org.eclipse.jdt.core.dom.CompilationUnit.accept0(CompilationUnit.java:212)
    at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2711)
    at org.eclipse.jdt.internal.corext.refactoring.structure.constraints.SuperTypeRefactoringProcessor.performFirstPass(SuperTypeRefactoringProcessor.java:742)
    at org.eclipse.jdt.internal.corext.refactoring.structure.constraints.SuperTypeRefactoringProcessor$3.acceptAST(SuperTypeRefactoringProcessor.java:1221)
    at org.eclipse.jdt.core.dom.CompilationUnitResolver.resolve(CompilationUnitResolver.java:907)
    at org.eclipse.jdt.core.dom.CompilationUnitResolver.resolve(CompilationUnitResolver.java:588)
    at org.eclipse.jdt.core.dom.ASTParser.createASTs(ASTParser.java:899)
    at org.eclipse.jdt.internal.corext.refactoring.structure.constraints.SuperTypeRefactoringProcessor.solveSuperTypeConstraints(SuperTypeRefactoringProcessor.java:1216)
    at org.eclipse.jdt.internal.corext.refactoring.structure.ExtractInterfaceProcessor.access$2(ExtractInterfaceProcessor.java:1)
    at org.eclipse.jdt.internal.corext.refactoring.structure.ExtractInterfaceProcessor$2.acceptAST(ExtractInterfaceProcessor.java:1097)
    at org.eclipse.jdt.core.dom.CompilationUnitResolver.resolve(CompilationUnitResolver.java:907)
    at org.eclipse.jdt.core.dom.CompilationUnitResolver.resolve(CompilationUnitResolver.java:588)
    at org.eclipse.jdt.core.dom.ASTParser.createASTs(ASTParser.java:899)
    at org.eclipse.jdt.internal.corext.refactoring.structure.ExtractInterfaceProcessor.rewriteTypeOccurrences(ExtractInterfaceProcessor.java:1078)
    at org.eclipse.jdt.internal.corext.refactoring.structure.ExtractInterfaceProcessor.createChangeManager(ExtractInterfaceProcessor.java:422)
    at org.eclipse.jdt.internal.corext.refactoring.structure.ExtractInterfaceProcessor.checkFinalConditions(ExtractInterfaceProcessor.java:245)
    at org.eclipse.ltk.core.refactoring.participants.ProcessorBasedRefactoring.checkFinalConditions(ProcessorBasedRefactoring.java:224)
    at org.eclipse.ltk.core.refactoring.CheckConditionsOperation.run(CheckConditionsOperation.java:85)
    at org.eclipse.ltk.core.refactoring.CreateChangeOperation.run(CreateChangeOperation.java:121)
    at org.eclipse.ltk.core.refactoring.PerformChangeOperation.run(PerformChangeOperation.java:209)
    at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2241)
    at org.eclipse.ltk.internal.ui.refactoring.WorkbenchRunnableAdapter.run(WorkbenchRunnableAdapter.java:87)
    at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:119)
   
  

General Information:

    reported-by:      Bruno M
    anonymous-id:     e7461b45-d894-4cd5-a112-ff71f2a3b1ad
    eclipse-build-id: 4.5.0.I20150603-2000
    eclipse-product:  org.eclipse.epp.package.committers.product
    operating system: Windows7 6.1.0 (x86_64) - win32
    jre-version:      1.8.0_45-b14

The following plug-ins were present on the execution stack (*):
    1. org.eclipse.core.databinding.observable_1.5.0.v20150422-0725
    2. org.eclipse.core.databinding_1.5.0.v20150422-0725
    3. org.eclipse.core.resources_3.10.0.v20150423-0755
    4. org.eclipse.core.runtime_3.11.0.v20150405-1723
    5. org.eclipse.e4.ui.workbench_1.3.0.v20150531-1948
    6. org.eclipse.e4.ui.workbench.swt_0.13.0.v20150504-0621
    7. org.eclipse.equinox.app_1.3.300.v20150423-1356
    8. org.eclipse.equinox.launcher_1.3.100.v20150511-1540
    9. org.eclipse.jdt.core_3.11.0.v20150602-1242
    10. org.eclipse.jdt_3.11.0.v20150603-2000
    11. org.eclipse.jdt.ui_3.11.0.v20150527-0925
    12. org.eclipse.jface_3.11.0.v20150602-1400
    13. org.eclipse.ltk.core.refactoring_3.6.200.v20140826-0859
    14. org.eclipse.ltk.ui.refactoring_3.7.200.v20140625-1835
    15. org.eclipse.swt_3.104.0.v20150528-0211
    16. org.eclipse.ui_3.107.0.v20150507-1945
    17. org.eclipse.ui.ide.application_1.1.0.v20150422-0725
    18. org.eclipse.ui.ide_3.11.0.v20150510-1749

Please note that:
* Messages, stacktraces, and nested status objects may be shortened.
* Bug fields like status, resolution, and whiteboard are sent
  back to reporters.
* The list of present bundles and their respective versions was
  calculated by package naming heuristics. This may or may not reflect reality.

Other Resources:
* Report: https://dev.eclipse.org/recommenders/committers/confess/#/problems/558c0295e4b08735226ac886  
* Manual: https://dev.eclipse.org/recommenders/community/confess/#/guide


Thank you for your assistance.
Your friendly error-reports-inbox.
Comment 1 Richard Steiger CLA 2015-07-26 20:49:57 EDT
I voted on this bug, since it's impact is rather high, as it breaks well over 50% of attempts to refactor, and nearly 100% of such attempts that span numerous classes and projects. Personally, I use refactoring several times an hour, so this is painful.
Comment 2 Dani Megert CLA 2015-07-27 07:34:39 EDT
(In reply to Richard Steiger from comment #1)
> I voted on this bug, since it's impact is rather high, as it breaks well
> over 50% of attempts to refactor, and nearly 100% of such attempts that span
> numerous classes and projects. Personally, I use refactoring several times
> an hour, so this is painful.

Can you provide steps to reproduce the problem?
Comment 3 Richard Steiger CLA 2015-07-27 14:22:35 EDT
I have yet to find a scenario that reliably repros this bug. It appears that changing a method name is reasonably likely to fail when the method is called from methods declared in multiple types, where these other types include ones related by inheritance, and others not related by inheritance, as well as types in the same and other projects.   While I'll endeavor to discern a more precise pattern, I will say that the MTBF has shrunk as the number of projects in my workspace has grown into the dozens, and number of classes approaching 10K.
Comment 4 Richard Steiger CLA 2015-07-30 02:11:46 EDT
Based on recent recurrences of this bug, the typical case involved renaming a method M defined in some class A in project P, extended by class B in project Q that defines a method that overrides M. Am reporting before attempting a full repo case, just in case it's a useful hint to someone experienced in the refactoring machinery.
Comment 5 Dani Megert CLA 2015-07-30 05:23:50 EDT
(In reply to Richard Steiger from comment #4)
> Based on recent recurrences of this bug, the typical case involved renaming
> a method M defined in some class A in project P, extended by class B in
> project Q that defines a method that overrides M.

Noopur, please try that.
Comment 6 Noopur Gupta CLA 2015-08-04 08:49:21 EDT
(In reply to Richard Steiger from comment #4)
> Based on recent recurrences of this bug, the typical case involved renaming
> a method M defined in some class A in project P, extended by class B in
> project Q that defines a method that overrides M. Am reporting before
> attempting a full repo case, just in case it's a useful hint to someone
> experienced in the refactoring machinery.

I cannot reproduce it using these steps.

The stacktrace shows that it happens during Extract Interface refactoring (not Rename refactoring).

The code at NPE location (SuperTypeConstraintsModel.java:409) indicates that IMethodBinding.getDeclaringClass() returns null. So it could be that there is some compile error in the code while applying Extract interface refactoring and hence the bindings are not created properly.

Please try to provide a code snippet that can reproduce this error.
Comment 7 Eclipse Genie CLA 2019-09-03 04:16:13 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.