Bug 6674 - Cannot add unimplemented methods
Summary: Cannot add unimplemented methods
Status: RESOLVED DUPLICATE of bug 6670
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 2.0   Edit
Hardware: PC Windows 2000
: P3 normal (vote)
Target Milestone: 2.0 M1   Edit
Assignee: Philipe Mulet CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2001-12-07 09:54 EST by John Wiegand CLA
Modified: 2002-01-14 10:37 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description John Wiegand CLA 2001-12-07 09:54:57 EST
build 1206.

1. Use the plugin importer to create projects for all of the 1206 drop.
2. Create a project test; add boot, runtime, resources to the classpath
3. Create a compilation unit

import org.eclipse.core.resources.IFileModificationValidator;

public class MyClass implements IFileModificationValidator {
	
}

4.  When I select MyClass in the outliner, and choose add unimplemented
methods, a message box comes up declaring "No unimplemented methods found for 
this type."

Related: the type hierarchy shows no supertypes.

NOTE: The task list reports that I must implement two inherited abstract 
methods.

NOTE: This may be related to bug 6670
Comment 1 Erich Gamma CLA 2001-12-07 10:23:44 EST
When the type hierarchy is empty then it isn't a code gen problem.
This would be explainable if the CU wasn't saved after step 3.

Need to reproduce it.
Comment 2 Erich Gamma CLA 2001-12-07 10:30:07 EST
The plugin importer was used, if the build class path is incorrect then this 
would explain the problem. Need to create a workspace with the contents manually
once with exported and once with JARs directly.
Comment 3 Erich Gamma CLA 2001-12-07 12:02:55 EST
Could not reproduce problem with the steps below.

I could reproduce the problem when the name of the CU and the top level type do 
not match.

File MyClass.java
import org.eclipse.core.resources.IFileModificationValidator;

public class MyClass2 implements IFileModificationValidator {
	
}

Could this have been the scenario
Comment 4 Erich Gamma CLA 2001-12-07 12:13:32 EST
Philippe had a walkback when doing the scenario:

If saving the compilation unit before adding unimplemented methods, then it 
works fine for me (running on Standard VM 1.4beta3).

If not saving the CU before I get an IllegalArgumentException:

java.lang.reflect.InvocationTargetException
        at org.eclipse.jface.operation.ModalContext.runInCurrentThread
(ModalContext.java:307)
        at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:249)
        at org.eclipse.jface.dialogs.ProgressMonitorDialog.run
(ProgressMonitorDialog.java:335)
        at org.eclipse.jdt.internal.ui.actions.AddUnimplementedMethodsAction.run
(AddUnimplementedMethodsAction.java:75)
        at org.eclipse.jface.action.Action.runWithEvent(Action.java:452)
        at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection
(ActionContributionItem.java:407)
        at org.eclipse.jface.action.ActionContributionItem.handleWidgetEvent
(ActionContributionItem.java:361)
        at org.eclipse.jface.action.ActionContributionItem.access$0
(ActionContributionItem.java:352)
        at 
org.eclipse.jface.action.ActionContributionItem$ActionListener.handleEvent
(ActionContributionItem.java:47)
        at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:54)
        at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:635)
        at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:1368)
        at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:1170)
        at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:775)
        at org.eclipse.ui.internal.Workbench.run(Workbench.java:758)
        at org.eclipse.core.internal.boot.InternalBootLoader.run
(InternalBootLoader.java:820)
        at org.eclipse.core.boot.BootLoader.run(BootLoader.java:285)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke
(NativeMethodAccessorImpl.java:42)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke
(DelegatingMethodAccessorImpl.java:28)
        at java.lang.reflect.Method.invoke(Method.java:327)
        at org.eclipse.core.launcher.Main.basicRun(Main.java:151)
        at org.eclipse.core.launcher.Main.run(Main.java:502)
        at org.eclipse.core.launcher.UIMain.main(UIMain.java:52)
Caused by: java.lang.IllegalArgumentException: Argument not valid
        at org.eclipse.swt.SWT.error(SWT.java:1873)
        at org.eclipse.swt.SWT.error(SWT.java:1819)
        at org.eclipse.jface.text.DocumentAdapter.getLine
(DocumentAdapter.java:155)
        at org.eclipse.swt.custom.StyledText$ContentWidthCache.calculate
(StyledText.java:630)
        at org.eclipse.swt.custom.StyledText$ContentWidthCache.calculateVisible
(StyledText.java:664)
        at org.eclipse.swt.custom.StyledText$ContentWidthCache.textChanged
(StyledText.java:830)
        at org.eclipse.swt.custom.StyledText.handleTextChanged
(StyledText.java:4690)
        at org.eclipse.swt.custom.StyledText$6.textChanged(StyledText.java:4313)
        at org.eclipse.jface.text.DocumentAdapter.fireTextChanged
(DocumentAdapter.java:294)
        at org.eclipse.jface.text.DocumentAdapter.documentChanged
(DocumentAdapter.java:273)
        at org.eclipse.jface.text.AbstractDocument.fireDocumentChanged
(AbstractDocument.java:482)
        at org.eclipse.jface.text.AbstractDocument.replace
(AbstractDocument.java:777)
        at 
org.eclipse.jdt.internal.ui.javaeditor.CompilationUnitDocumentProvider$BufferSyn
chronizer.bufferChanged(CompilationUnitDocumen
ovider.java:116)
        at org.eclipse.jdt.internal.core.Buffer.notifyChanged(Buffer.java:421)
        at org.eclipse.jdt.internal.core.Buffer.replace(Buffer.java:480)
        at 
org.eclipse.jdt.internal.core.CreateElementInCUOperation.executeOperation
(CreateElementInCUOperation.java:131)
        at org.eclipse.jdt.internal.core.JavaModelOperation.execute
(JavaModelOperation.java:257)
        at org.eclipse.jdt.internal.core.JavaModelOperation.run
(JavaModelOperation.java:454)
        at org.eclipse.core.internal.resources.Workspace.run
(Workspace.java:1231)
        at org.eclipse.jdt.internal.core.JavaModelManager.runOperation
(JavaModelManager.java:1167)
        at org.eclipse.jdt.internal.core.JavaElement.runOperation
(JavaElement.java:516)
        at org.eclipse.jdt.internal.core.SourceType.createMethod
(SourceType.java:66)
        at 
org.eclipse.jdt.internal.corext.codegeneration.AddUnimplementedMethodsOperation.
run(AddUnimplementedMethodsOperation.java:71)
        at org.eclipse.core.internal.resources.Workspace.run
(Workspace.java:1231)
        at org.eclipse.jdt.internal.ui.actions.WorkbenchRunnableWrapper.run
(WorkbenchRunnableWrapper.java:32)
        at org.eclipse.jface.operation.ModalContext.runInCurrentThread
(ModalContext.java:296)
        ... 23 more
Log: Fri Dec 07 17:54:26 CET 2001
4 org.eclipse.core.runtime 0 Unhandled exception caught in event loop.
java.lang.IllegalArgumentException: Argument not valid
        at org.eclipse.swt.SWT.error(SWT.java:1873)
        at org.eclipse.swt.SWT.error(SWT.java:1819)
        at org.eclipse.jface.text.DocumentAdapter.getLine
(DocumentAdapter.java:155)
        at org.eclipse.swt.custom.StyledText.handlePaint(StyledText.java:4649)
        at org.eclipse.swt.custom.StyledText$13.handleEvent
(StyledText.java:4379)
        at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:54)
        at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:839)
        at org.eclipse.swt.widgets.Composite.WM_PAINT(Composite.java:640)
        at org.eclipse.swt.widgets.Control.windowProc(Control.java:2633)
        at org.eclipse.swt.widgets.Display.windowProc(Display.java:1712)
        at org.eclipse.swt.internal.win32.OS.DispatchMessageW(Native Method)
        at org.eclipse.swt.internal.win32.OS.DispatchMessage(OS.java:1151)
        at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:1168)
        at org.eclipse.jface.window.Window.runEventLoop(Window.java:536)
        at org.eclipse.jface.window.Window.open(Window.java:523)
        at org.eclipse.jface.dialogs.MessageDialog.openError
(MessageDialog.java:318)
        at org.eclipse.jdt.internal.ui.actions.AddUnimplementedMethodsAction.run
(AddUnimplementedMethodsAction.java:84)
        at org.eclipse.jface.action.Action.runWithEvent(Action.java:452)
        at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection
(ActionContributionItem.java:407)
        at org.eclipse.jface.action.ActionContributionItem.handleWidgetEvent
(ActionContributionItem.java:361)
        at org.eclipse.jface.action.ActionContributionItem.access$0
(ActionContributionItem.java:352)
        at 
org.eclipse.jface.action.ActionContributionItem$ActionListener.handleEvent
(ActionContributionItem.java:47)
        at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:54)
        at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:635)
        at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:1368)
        at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:1170)
        at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:775)
        at org.eclipse.ui.internal.Workbench.run(Workbench.java:758)
        at org.eclipse.core.internal.boot.InternalBootLoader.run
(InternalBootLoader.java:820)
        at org.eclipse.core.boot.BootLoader.run(BootLoader.java:285)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke
(NativeMethodAccessorImpl.java:42)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke
(DelegatingMethodAccessorImpl.java:28)
        at java.lang.reflect.Method.invoke(Method.java:327)
        at org.eclipse.core.launcher.Main.basicRun(Main.java:151)
        at org.eclipse.core.launcher.Main.run(Main.java:502)
        at org.eclipse.core.launcher.UIMain.main(UIMain.java:52)
Log: Fri Dec 07 17:54:26 CET 2001
4 org.eclipse.core.runtime 0 Argument not valid
java.lang.IllegalArgumentException: Argument not valid
        at org.eclipse.swt.SWT.error(SWT.java:1873)
        at org.eclipse.swt.SWT.error(SWT.java:1819)
        at org.eclipse.jface.text.DocumentAdapter.getLine
(DocumentAdapter.java:155)
        at org.eclipse.swt.custom.StyledText.handlePaint(StyledText.java:4649)
        at org.eclipse.swt.custom.StyledText$13.handleEvent
(StyledText.java:4379)
        at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:54)
        at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:839)
        at org.eclipse.swt.widgets.Composite.WM_PAINT(Composite.java:640)
        at org.eclipse.swt.widgets.Control.windowProc(Control.java:2633)
        at org.eclipse.swt.widgets.Display.windowProc(Display.java:1712)
        at org.eclipse.swt.internal.win32.OS.DispatchMessageW(Native Method)
        at org.eclipse.swt.internal.win32.OS.DispatchMessage(OS.java:1151)
        at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:1168)
        at org.eclipse.jface.window.Window.runEventLoop(Window.java:536)
        at org.eclipse.jface.window.Window.open(Window.java:523)
        at org.eclipse.jface.dialogs.MessageDialog.openError
(MessageDialog.java:318)
        at org.eclipse.jdt.internal.ui.actions.AddUnimplementedMethodsAction.run
(AddUnimplementedMethodsAction.java:84)
        at org.eclipse.jface.action.Action.runWithEvent(Action.java:452)
        at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection
(ActionContributionItem.java:407)
        at org.eclipse.jface.action.ActionContributionItem.handleWidgetEvent
(ActionContributionItem.java:361)
        at org.eclipse.jface.action.ActionContributionItem.access$0
(ActionContributionItem.java:352)
        at 
org.eclipse.jface.action.ActionContributionItem$ActionListener.handleEvent
(ActionContributionItem.java:47)
        at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:54)
        at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:635)
        at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:1368)
        at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:1170)
        at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:775)
        at org.eclipse.ui.internal.Workbench.run(Workbench.java:758)
        at org.eclipse.core.internal.boot.InternalBootLoader.run
(InternalBootLoader.java:820)
        at org.eclipse.core.boot.BootLoader.run(BootLoader.java:285)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke
(NativeMethodAccessorImpl.java:42)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke
(DelegatingMethodAccessorImpl.java:28)
        at java.lang.reflect.Method.invoke(Method.java:327)
        at org.eclipse.core.launcher.Main.basicRun(Main.java:151)
        at org.eclipse.core.launcher.Main.run(Main.java:502)
        at org.eclipse.core.launcher.UIMain.main(UIMain.java:52)
Log: Fri Dec 07 17:54:42 CET 2001
4 org.eclipse.core.runtime 0 Unhandled exception caught in event loop.
java.lang.IllegalArgumentException: Argument not valid
        at org.eclipse.swt.SWT.error(SWT.java:1873)
        at org.eclipse.swt.SWT.error(SWT.java:1819)
        at org.eclipse.jface.text.DocumentAdapter.getLine
(DocumentAdapter.java:155)
        at org.eclipse.swt.custom.StyledText.handlePaint(StyledText.java:4649)
        at org.eclipse.swt.custom.StyledText$13.handleEvent
(StyledText.java:4379)
        at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:54)
        at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:839)
        at org.eclipse.swt.widgets.Composite.WM_PAINT(Composite.java:640)
        at org.eclipse.swt.widgets.Control.windowProc(Control.java:2633)
        at org.eclipse.swt.widgets.Display.windowProc(Display.java:1712)
        at org.eclipse.swt.internal.win32.OS.DispatchMessageW(Native Method)
        at org.eclipse.swt.internal.win32.OS.DispatchMessage(OS.java:1151)
        at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:1168)
        at org.eclipse.jface.window.Window.runEventLoop(Window.java:536)
        at org.eclipse.jface.window.Window.open(Window.java:523)
        at org.eclipse.jface.dialogs.MessageDialog.openError
(MessageDialog.java:318)
        at org.eclipse.jface.window.Window.handleExceptionInEventLoop
(Window.java:436)
        at org.eclipse.jface.window.Window.runEventLoop(Window.java:539)
        at org.eclipse.jface.window.Window.open(Window.java:523)
        at org.eclipse.jface.dialogs.MessageDialog.openError
(MessageDialog.java:318)
        at org.eclipse.jdt.internal.ui.actions.AddUnimplementedMethodsAction.run
(AddUnimplementedMethodsAction.java:84)
        at org.eclipse.jface.action.Action.runWithEvent(Action.java:452)
        at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection
(ActionContributionItem.java:407)
        at org.eclipse.jface.action.ActionContributionItem.handleWidgetEvent
(ActionContributionItem.java:361)
        at org.eclipse.jface.action.ActionContributionItem.access$0
(ActionContributionItem.java:352)
        at 
org.eclipse.jface.action.ActionContributionItem$ActionListener.handleEvent
(ActionContributionItem.java:47)
        at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:54)
        at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:635)
        at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:1368)
        at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:1170)
        at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:775)
        at org.eclipse.ui.internal.Workbench.run(Workbench.java:758)
        at org.eclipse.core.internal.boot.InternalBootLoader.run
(InternalBootLoader.java:820)
        at org.eclipse.core.boot.BootLoader.run(BootLoader.java:285)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke
(NativeMethodAccessorImpl.java:42)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke
(DelegatingMethodAccessorImpl.java:28)
        at java.lang.reflect.Method.invoke(Method.java:327)
        at org.eclipse.core.launcher.Main.basicRun(Main.java:151)
        at org.eclipse.core.launcher.Main.run(Main.java:502)
        at org.eclipse.core.launcher.UIMain.main(UIMain.java:52)
Log: Fri Dec 07 17:54:43 CET 2001
4 org.eclipse.core.runtime 0 Argument not valid
java.lang.IllegalArgumentException: Argument not valid
        at org.eclipse.swt.SWT.error(SWT.java:1873)
        at org.eclipse.swt.SWT.error(SWT.java:1819)
        at org.eclipse.jface.text.DocumentAdapter.getLine
(DocumentAdapter.java:155)
        at org.eclipse.swt.custom.StyledText.handlePaint(StyledText.java:4649)
        at org.eclipse.swt.custom.StyledText$13.handleEvent
(StyledText.java:4379)
        at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:54)
        at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:839)
        at org.eclipse.swt.widgets.Composite.WM_PAINT(Composite.java:640)
        at org.eclipse.swt.widgets.Control.windowProc(Control.java:2633)
        at org.eclipse.swt.widgets.Display.windowProc(Display.java:1712)
        at org.eclipse.swt.internal.win32.OS.DispatchMessageW(Native Method)
        at org.eclipse.swt.internal.win32.OS.DispatchMessage(OS.java:1151)
        at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:1168)
        at org.eclipse.jface.window.Window.runEventLoop(Window.java:536)
        at org.eclipse.jface.window.Window.open(Window.java:523)
        at org.eclipse.jface.dialogs.MessageDialog.openError
(MessageDialog.java:318)
        at org.eclipse.jface.window.Window.handleExceptionInEventLoop
(Window.java:436)
        at org.eclipse.jface.window.Window.runEventLoop(Window.java:539)
        at org.eclipse.jface.window.Window.open(Window.java:523)
        at org.eclipse.jface.dialogs.MessageDialog.openError
(MessageDialog.java:318)
        at org.eclipse.jdt.internal.ui.actions.AddUnimplementedMethodsAction.run
(AddUnimplementedMethodsAction.java:84)
        at org.eclipse.jface.action.Action.runWithEvent(Action.java:452)
        at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection
(ActionContributionItem.java:407)
        at org.eclipse.jface.action.ActionContributionItem.handleWidgetEvent
(ActionContributionItem.java:361)
        at org.eclipse.jface.action.ActionContributionItem.access$0
(ActionContributionItem.java:352)
        at 
org.eclipse.jface.action.ActionContributionItem$ActionListener.handleEvent
(ActionContributionItem.java:47)
        at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:54)
        at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:635)
        at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:1368)
        at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:1170)
        at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:775)
        at org.eclipse.ui.internal.Workbench.run(Workbench.java:758)
        at org.eclipse.core.internal.boot.InternalBootLoader.run
(InternalBootLoader.java:820)
        at org.eclipse.core.boot.BootLoader.run(BootLoader.java:285)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke
(NativeMethodAccessorImpl.java:42)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke
(DelegatingMethodAccessorImpl.java:28)
        at java.lang.reflect.Method.invoke(Method.java:327)
        at org.eclipse.core.launcher.Main.basicRun(Main.java:151)
        at org.eclipse.core.launcher.Main.run(Main.java:502)
        at org.eclipse.core.launcher.UIMain.main(UIMain.java:52)
Comment 5 John Wiegand CLA 2001-12-07 12:34:12 EST
This bug is actually the same as bug 6670.

Here are improved steps:
1. Use the plugin importer to create projects for all of the 1206 drop.
2. Create a project test; DO NOT update the classpath.
3. Create a compilation unit

public class MyClass implements IFileM {
	
}
4. Code assist on this to attempt to get IFileModificationValidator.
This fails.
5. add boot, runtime, resources to the classpath.
6. Code assist again - this time it works.
7.  When I select MyClass in the outliner, and choose add unimplemented
methods, a message box comes up declaring "No unimplemented methods found for 
this type."

  
Comment 6 Philipe Mulet CLA 2001-12-07 17:47:16 EST

*** This bug has been marked as a duplicate of 6670 ***