Bug 108615 - Unable to inherit abstract methods from jarred interface
Summary: Unable to inherit abstract methods from jarred interface
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.1   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 3.2 M2   Edit
Assignee: Jerome Lanneluc CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-09-01 14:08 EDT by Eric Andresen CLA
Modified: 2005-09-20 13:14 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Eric Andresen CLA 2005-09-01 14:08:29 EDT
I am unable to utilize any form of the "AddUnimplementedMethodsOperation" when
the interface/superclass I implement/extend is located within a .jar file.

This occurs both from the "New Class" wizard, and the Code Assist "add
unimplemented abstract methods" option.

The relevent messages from the eclipse log file are as follows:

!ENTRY org.eclipse.ui 4 4 2005-09-01 10:20:14.234
!MESSAGE Unhandled event loop exception

!ENTRY org.eclipse.ui 4 0 2005-09-01 10:20:14.235
!MESSAGE Failed to execute runnable (java.lang.NullPointerException)
!STACK 0
org.eclipse.swt.SWTException: Failed to execute runnable
(java.lang.NullPointerException)
    at org.eclipse.swt.SWT.error(SWT.java:2942)
    at org.eclipse.swt.SWT.error(SWT.java:2865)
    at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:126)
    at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:2844)
    at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2575)
    at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1699)
    at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1663)
    at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:367)
    at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:143)
    at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:103)
    at
org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:226)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:376)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:163)
    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:324)
    at org.eclipse.core.launcher.Main.invokeFramework(Main.java:334)
    at org.eclipse.core.launcher.Main.basicRun(Main.java:278)
    at org.eclipse.core.launcher.Main.run(Main.java:973)
    at org.eclipse.core.launcher.Main.main(Main.java:948)
Caused by: java.lang.NullPointerException
    at org.eclipse.jdt.core.dom.TypeBinding.getPackageFragment(TypeBinding.java:599)
    at org.eclipse.jdt.core.dom.TypeBinding.getClassFile(TypeBinding.java:111)
    at
org.eclipse.jdt.core.dom.TypeBinding.getUnresolvedJavaElement(TypeBinding.java:400)
    at
org.eclipse.jdt.core.dom.TypeBinding.getUnresolvedJavaElement(TypeBinding.java:377)
    at org.eclipse.jdt.core.dom.TypeBinding.getJavaElement(TypeBinding.java:370)
    at
org.eclipse.jdt.core.dom.MethodBinding.getUnresolvedJavaElement(MethodBinding.java:168)
    at org.eclipse.jdt.core.dom.MethodBinding.getJavaElement(MethodBinding.java:161)
    at
org.eclipse.jdt.internal.corext.codemanipulation.StubUtility2.suggestArgumentNames(StubUtility2.java:930)
    at
org.eclipse.jdt.internal.corext.codemanipulation.StubUtility2.createParameters(StubUtility2.java:534)
    at
org.eclipse.jdt.internal.corext.codemanipulation.StubUtility2.createImplementationStub(StubUtility2.java:380)
    at
org.eclipse.jdt.internal.ui.text.correction.UnimplementedMethodsCompletionProposal.getRewrite(UnimplementedMethodsCompletionProposal.java:
78)
    at
org.eclipse.jdt.internal.ui.text.correction.ASTRewriteCorrectionProposal.addEdits(ASTRewriteCorrectionProposal.java:61)
    at
org.eclipse.jdt.internal.ui.text.correction.CUCorrectionProposal.initializeTextChange(CUCorrectionProposal.java:141)
    at
org.eclipse.jdt.internal.ui.text.correction.UnimplementedMethodsCompletionProposal.getAdditionalProposalInfo(UnimplementedMethodsCompletio
nProposal.java:89)
    at
org.eclipse.jface.text.contentassist.AdditionalInfoController.computeInformation(AdditionalInfoController.java:221)
    at
org.eclipse.jface.text.AbstractInformationControlManager.doShowInformation(AbstractInformationControlManager.java:820)
    at
org.eclipse.jface.text.AbstractInformationControlManager.showInformation(AbstractInformationControlManager.java:810)
    at
org.eclipse.jface.text.contentassist.AdditionalInfoController$1.run(AdditionalInfoController.java:173)
    at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
    at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:123)
    ... 18 more
Comment 1 Eric Andresen CLA 2005-09-01 14:10:16 EDT
As an aside, this problem does *not* occur if I copy the actual .java file into
the project I am working in. It only occurs when referencing a .class file in a
.jar.

I have also tried removing my .metadata directory and re-importing the project,
to no avail.
Comment 2 Olivier Thomann CLA 2005-09-01 14:19:05 EDT
Could you please provide steps to reproduce?
Also we need the build id.

I tried with java.lang.Runnable and it works fine.
Comment 3 Eric Andresen CLA 2005-09-02 14:42:44 EDT
I've just figured out what the problem was:

  The project I was having the problem in had a name containing '[]' characters,
whereas all other projects did not. Renaming the project without [] characters
causes eclipse to behaviour normally in seemingly all cases now.

Version: 3.1.0
Build id: I20050627-1435
Comment 4 Jerome Lanneluc CLA 2005-09-06 09:56:17 EDT
Thanks for the report.

Problem was the ']' character. It is used as a separator for type parameters in
the memento.

Fixed by adding this character to be escaped in JavaElement#escapeMementoName(...).
Added regression test MementoTests#testProjectMemento3().
Comment 5 Olivier Thomann CLA 2005-09-20 13:14:38 EDT
Verified in I20050920-0010 for 3.2M2