Bug 130927 - InvocationTargetException when running source->clean up
Summary: InvocationTargetException when running source->clean up
Status: RESOLVED INVALID
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.2   Edit
Hardware: Macintosh Mac OS X - Carbon (unsup.)
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: needinfo
: 149895 (view as bug list)
Depends on:
Blocks:
 
Reported: 2006-03-08 11:22 EST by Kaj Hejer CLA
Modified: 2009-08-30 02:04 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Kaj Hejer CLA 2006-03-08 11:22:16 EST
I get a InvocationTargetException when running source->clean up with the default values selected on eclipse 3.2M5, osx 10.4.5 and 1.5.0_05-83.

After selecting source->clean up I get the dialogbox where I can change the settings for the clean up, and when I press next I get this exception after a few seconds.

See full stacktrace bellow:

!ENTRY org.eclipse.ltk.ui.refactoring 4 10000 2006-03-08 17:13:48.912
!MESSAGE Internal Error
!STACK 0
java.lang.reflect.InvocationTargetException
	at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:341)
	at org.eclipse.jface.wizard.WizardDialog.run(WizardDialog.java:833)
	at org.eclipse.ltk.ui.refactoring.RefactoringWizard.createChange(RefactoringWizard.java:571)
	at org.eclipse.ltk.ui.refactoring.RefactoringWizard.computeUserInputSuccessorPage(RefactoringWizard.java:414)
	at org.eclipse.ltk.ui.refactoring.UserInputWizardPage.computeSuccessorPage(UserInputWizardPage.java:75)
	at org.eclipse.ltk.ui.refactoring.UserInputWizardPage.getNextPage(UserInputWizardPage.java:115)
	at org.eclipse.jdt.internal.ui.fix.CleanUpRefactoringWizard$SelectCleanUpPage.getNextPage(CleanUpRefactoringWizard.java:457)
	at org.eclipse.jface.wizard.WizardDialog.nextPressed(WizardDialog.java:737)
	at org.eclipse.jface.wizard.WizardDialog.buttonPressed(WizardDialog.java:345)
	at org.eclipse.jface.dialogs.Dialog$3.widgetSelected(Dialog.java:645)
	at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:90)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1450)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1474)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1459)
	at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:1236)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3259)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2897)
	at org.eclipse.jface.window.Window.runEventLoop(Window.java:811)
	at org.eclipse.jface.window.Window.open(Window.java:789)
	at org.eclipse.ltk.ui.refactoring.RefactoringWizardOpenOperation$1.run(RefactoringWizardOpenOperation.java:132)
	at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:69)
	at org.eclipse.ltk.ui.refactoring.RefactoringWizardOpenOperation.run(RefactoringWizardOpenOperation.java:145)
	at org.eclipse.jdt.internal.ui.refactoring.actions.RefactoringStarter.activate(RefactoringStarter.java:40)
	at org.eclipse.jdt.internal.ui.actions.CleanUpAction.runOnMultiple(CleanUpAction.java:227)
	at org.eclipse.jdt.internal.ui.actions.CleanUpAction.run(CleanUpAction.java:96)
	at org.eclipse.jdt.ui.actions.SelectionDispatchAction.dispatchRun(SelectionDispatchAction.java:267)
	at org.eclipse.jdt.ui.actions.SelectionDispatchAction.run(SelectionDispatchAction.java:243)
	at org.eclipse.jface.action.Action.runWithEvent(Action.java:492)
	at org.eclipse.ui.actions.RetargetAction.runWithEvent(RetargetAction.java:222)
	at org.eclipse.ui.internal.WWinPluginAction.runWithEvent(WWinPluginAction.java:228)
	at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:530)
	at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:480)
	at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:392)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1450)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1474)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1459)
	at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:1236)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3259)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2897)
	at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1899)
	at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1863)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:417)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:143)
	at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:106)
	at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:99)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:92)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:68)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:374)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:169)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:585)
	at org.eclipse.core.launcher.Main.invokeFramework(Main.java:338)
	at org.eclipse.core.launcher.Main.basicRun(Main.java:282)
	at org.eclipse.core.launcher.Main.run(Main.java:977)
	at org.eclipse.core.launcher.Main.main(Main.java:952)
Caused by: java.lang.NullPointerException
	at org.eclipse.jdt.internal.compiler.lookup.SourceTypeBinding.storedAnnotations(SourceTypeBinding.java:1285)
	at org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding.storeAnnotationHolder(ReferenceBinding.java:1011)
	at org.eclipse.jdt.internal.compiler.lookup.MethodBinding.<init>(MethodBinding.java:61)
	at org.eclipse.jdt.internal.compiler.lookup.SourceTypeBinding.getUpdatedMethodBinding(SourceTypeBinding.java:961)
	at org.eclipse.jdt.internal.compiler.ast.MessageSend.manageSyntheticAccessIfNecessary(MessageSend.java:226)
	at org.eclipse.jdt.internal.compiler.ast.MessageSend.analyseCode(MessageSend.java:63)
	at org.eclipse.jdt.internal.compiler.ast.LocalDeclaration.analyseCode(LocalDeclaration.java:47)
	at org.eclipse.jdt.internal.compiler.ast.MethodDeclaration.analyseCode(MethodDeclaration.java:84)
	at org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.internalAnalyseCode(TypeDeclaration.java:718)
	at org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.analyseCode(TypeDeclaration.java:269)
	at org.eclipse.jdt.internal.compiler.ast.CompilationUnitDeclaration.analyseCode(CompilationUnitDeclaration.java:106)
	at org.eclipse.jdt.internal.compiler.Compiler.process(Compiler.java:634)
	at org.eclipse.jdt.core.dom.CompilationUnitResolver.resolve(CompilationUnitResolver.java:685)
	at org.eclipse.jdt.core.dom.CompilationUnitResolver.resolve(CompilationUnitResolver.java:461)
	at org.eclipse.jdt.core.dom.ASTParser.createASTs(ASTParser.java:693)
	at org.eclipse.jdt.internal.corext.fix.CleanUpRefactoring.parse(CleanUpRefactoring.java:454)
	at org.eclipse.jdt.internal.corext.fix.CleanUpRefactoring.cleanUpProject(CleanUpRefactoring.java:384)
	at org.eclipse.jdt.internal.corext.fix.CleanUpRefactoring.checkFinalConditions(CleanUpRefactoring.java:336)
	at org.eclipse.ltk.core.refactoring.CheckConditionsOperation.run(CheckConditionsOperation.java:83)
	at org.eclipse.ltk.core.refactoring.CreateChangeOperation.run(CreateChangeOperation.java:117)
	at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1733)
	at org.eclipse.ltk.internal.ui.refactoring.WorkbenchRunnableAdapter.run(WorkbenchRunnableAdapter.java:87)
	at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:113)
Root exception:
java.lang.NullPointerException
	at org.eclipse.jdt.internal.compiler.lookup.SourceTypeBinding.storedAnnotations(SourceTypeBinding.java:1285)
	at org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding.storeAnnotationHolder(ReferenceBinding.java:1011)
	at org.eclipse.jdt.internal.compiler.lookup.MethodBinding.<init>(MethodBinding.java:61)
	at org.eclipse.jdt.internal.compiler.lookup.SourceTypeBinding.getUpdatedMethodBinding(SourceTypeBinding.java:961)
	at org.eclipse.jdt.internal.compiler.ast.MessageSend.manageSyntheticAccessIfNecessary(MessageSend.java:226)
	at org.eclipse.jdt.internal.compiler.ast.MessageSend.analyseCode(MessageSend.java:63)
	at org.eclipse.jdt.internal.compiler.ast.LocalDeclaration.analyseCode(LocalDeclaration.java:47)
	at org.eclipse.jdt.internal.compiler.ast.MethodDeclaration.analyseCode(MethodDeclaration.java:84)
	at org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.internalAnalyseCode(TypeDeclaration.java:718)
	at org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.analyseCode(TypeDeclaration.java:269)
	at org.eclipse.jdt.internal.compiler.ast.CompilationUnitDeclaration.analyseCode(CompilationUnitDeclaration.java:106)
	at org.eclipse.jdt.internal.compiler.Compiler.process(Compiler.java:634)
	at org.eclipse.jdt.core.dom.CompilationUnitResolver.resolve(CompilationUnitResolver.java:685)
	at org.eclipse.jdt.core.dom.CompilationUnitResolver.resolve(CompilationUnitResolver.java:461)
	at org.eclipse.jdt.core.dom.ASTParser.createASTs(ASTParser.java:693)
	at org.eclipse.jdt.internal.corext.fix.CleanUpRefactoring.parse(CleanUpRefactoring.java:454)
	at org.eclipse.jdt.internal.corext.fix.CleanUpRefactoring.cleanUpProject(CleanUpRefactoring.java:384)
	at org.eclipse.jdt.internal.corext.fix.CleanUpRefactoring.checkFinalConditions(CleanUpRefactoring.java:336)
	at org.eclipse.ltk.core.refactoring.CheckConditionsOperation.run(CheckConditionsOperation.java:83)
	at org.eclipse.ltk.core.refactoring.CreateChangeOperation.run(CreateChangeOperation.java:117)
	at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1733)
	at org.eclipse.ltk.internal.ui.refactoring.WorkbenchRunnableAdapter.run(WorkbenchRunnableAdapter.java:87)
	at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:113)
Comment 1 Kaj Hejer CLA 2006-03-08 11:24:56 EST
I forgot some important information: 

This just happends when I select the top of the project. If I select one of the sourcefolders the clean up works just fine.
Comment 2 Steve Northover CLA 2006-03-08 14:24:17 EST
The InvocationTargetException might be because something changed in SWT and you are being fed wrongly.  Please move back if this is the case.
Comment 3 Martin Aeschlimann CLA 2006-03-12 18:00:41 EST
Looks like a problem in the AST
Comment 4 Olivier Thomann CLA 2006-03-12 20:12:56 EST
Would it be possible to get a reproducable test case?
Comment 5 Kaj Hejer CLA 2006-03-21 10:27:41 EST
Sorry for not getting back to you about this issue. I haven't managed to reproduce this issue. The reason might be that I did a source->clean up and this clean up changed something in my code that triggered this issue.

I will let you know if I find a reproducable test case.
Comment 6 Olivier Thomann CLA 2006-03-21 10:36:32 EST
Closing as REMIND.
Please reopen once you provide a test case.
The line on which you got the NPE didn't change since M5. So potentially the bug is still there.
As soon as we get your test case, we will investigate.
Comment 7 Olivier Thomann CLA 2006-03-21 10:36:59 EST
Close as REMIND.
Comment 8 Benno Baumgartner CLA 2006-07-07 04:25:23 EDT
*** Bug 149895 has been marked as a duplicate of this bug. ***
Comment 9 Benno Baumgartner CLA 2006-07-07 04:27:36 EDT
I'm copying steps to reproduce from dup bug 149895 and reopen this bug:

>
I'm selecting a few files for the refactor cleanup. So I started to remove them
one at a time, and suddenly it stopped failing. It fails when I remove a class
that is practically empty. If I select a small set including that class, it
sometimes works. If I select a large set of files, it fails almost everytime
till I deselect the empty class.

The empty class is useless, it is a legacy piece that is hanging around.
public abstract class StructureDetailBean extends AbstractBean {
    public StructureDetailBean(){ //happy empty constructor
    }
}

If I just do a souce->cleanup on this file, it says nothing to be done. 

When I select this empty class in a selection of 12 files, it has no problems,
and selects a set of things to fix. At 13 in the list with this one, it fails.
I can "cleanup" the whole package of 100 files if I exclude that one file.

I put an unused import in the barren StructureDetailBean class. Attempted a
cleanup of the file alone, it had no problem. Still fails if I include the file
in the list of more than 12

If I make the class non-abstract, implement the one method required, it worked
w/ no errors.

The subclasses of this abstract class were included in the 12-works/13-nowork
test. 

<

HTH
Comment 10 Jerome Lanneluc CLA 2006-07-07 06:13:42 EDT
Unfortunately these steps are not accurate enough to reproduce the problem.
Comment 11 Robert Macaulay CLA 2006-07-10 11:49:33 EDT
The source tree I have reproduces regularly, attempting to recreate simply has no effect. Is there additional logging/debugging that I can enable?
Comment 12 Jerome Lanneluc CLA 2006-07-11 03:53:14 EDT
Sorry, there is no tracing that could in this area. If this is possible, can you attach your workspace to this bug ?
Comment 13 Olivier Thomann CLA 2006-10-10 16:58:42 EDT
Robert,

Is it possible to get a reproducable test case? Your workspace for example?
Thanks.
Closing as REMIND.
Please reopen once information is avaiable.
Comment 14 Denis Roy CLA 2009-08-30 02:04:56 EDT
As of now 'LATER' and 'REMIND' resolutions are no longer supported.
Please reopen this bug if it is still valid for you.