Bug 91542 - [1.5][search] JavaModelException on ResolvedSourceMethod during refactoring
Summary: [1.5][search] JavaModelException on ResolvedSourceMethod during refactoring
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.1   Edit
Hardware: PC All
: P3 normal (vote)
Target Milestone: 3.1 M7   Edit
Assignee: Frederic Fusier CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-04-15 10:44 EDT by Tobias Widmer CLA
Modified: 2005-05-12 10:16 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 Tobias Widmer CLA 2005-04-15 10:44:16 EDT
I20050414-1107 + JDT Core HEAD

Steps to reproduce:
- Create cu A.java
package p;

class A<T> {
	void a(A<T> a){}
}

class B<T> extends A<T> {
	protected void m() { 
		a(this);
	}
}

- Invoke pull up on m()
-> Stacktrace when executing testcase PullUpTests#testGenerics7

Java Model Exception: Java Model Status [a(A) {key=Lp/A<TT;>;.a(Lp/A<TT;>;)V} 
[in A [in A.java [in p [in src [in TestProject1113575897462]]]]] does not 
exist]
	at org.eclipse.jdt.internal.core.JavaElement.newNotPresentException
(JavaElement.java:468)
	at org.eclipse.jdt.internal.core.JavaElement.openWhenClosed
(JavaElement.java:499)
	at org.eclipse.jdt.internal.core.JavaElement.getElementInfo
(JavaElement.java:232)
	at org.eclipse.jdt.internal.core.JavaElement.getElementInfo
(JavaElement.java:218)
	at org.eclipse.jdt.internal.core.Member.getFlags(Member.java:147)
	at 
org.eclipse.jdt.internal.corext.refactoring.structure.MemberVisibilityAdjustor.
adjustOutgoingVisibility(MemberVisibilityAdjustor.java:671)
	at 
org.eclipse.jdt.internal.corext.refactoring.structure.MemberVisibilityAdjustor.
adjustOutgoingVisibility(MemberVisibilityAdjustor.java:690)
	at 
org.eclipse.jdt.internal.corext.refactoring.structure.MemberVisibilityAdjustor.
adjustOutgoingVisibility(MemberVisibilityAdjustor.java:722)
	at 
org.eclipse.jdt.internal.corext.refactoring.structure.MemberVisibilityAdjustor.
adjustVisibility(MemberVisibilityAdjustor.java:763)
	at 
org.eclipse.jdt.internal.corext.refactoring.structure.PullUpRefactoring.createC
hangeManager(PullUpRefactoring.java:951)
	at 
org.eclipse.jdt.internal.corext.refactoring.structure.PullUpRefactoring.checkFi
nalConditions(PullUpRefactoring.java:617)
	at org.eclipse.jdt.ui.tests.refactoring.PullUpTests.helper1
(PullUpTests.java:284)
	at org.eclipse.jdt.ui.tests.refactoring.PullUpTests.testGenerics7
(PullUpTests.java:1730)
	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 junit.framework.TestCase.runTest(TestCase.java:154)
	at junit.framework.TestCase.runBare(TestCase.java:127)
	at junit.framework.TestResult$1.protect(TestResult.java:106)
	at junit.framework.TestResult.runProtected(TestResult.java:124)
	at junit.framework.TestResult.run(TestResult.java:109)
	at junit.framework.TestCase.run(TestCase.java:118)
	at junit.framework.TestSuite.runTest(TestSuite.java:208)
	at junit.framework.TestSuite.run(TestSuite.java:203)
	at junit.extensions.TestDecorator.basicRun(TestDecorator.java:22)
	at junit.extensions.TestSetup$1.protect(TestSetup.java:19)
	at junit.framework.TestResult.runProtected(TestResult.java:124)
	at junit.extensions.TestSetup.run(TestSetup.java:23)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests
(RemoteTestRunner.java:474)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run
(RemoteTestRunner.java:342)
	at org.eclipse.pde.internal.junit.runtime.RemotePluginTestRunner.main
(RemotePluginTestRunner.java:57)
	at org.eclipse.pde.internal.junit.runtime.UITestApplication$1.run
(UITestApplication.java:99)
	at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
	at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages
(Synchronizer.java:118)
	at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:2871)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2530)
	at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1570)
	at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1534)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench
(Workbench.java:306)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:143)
	at org.eclipse.ui.internal.ide.IDEApplication.run
(IDEApplication.java:103)
	at org.eclipse.pde.internal.junit.runtime.UITestApplication.run
(UITestApplication.java:39)
	at org.eclipse.core.internal.runtime.PlatformActivator$1.run
(PlatformActivator.java:228)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run
(EclipseStarter.java:344)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run
(EclipseStarter.java:156)
	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:316)
	at org.eclipse.core.launcher.Main.basicRun(Main.java:269)
	at org.eclipse.core.launcher.Main.run(Main.java:948)
	at org.eclipse.core.launcher.Main.main(Main.java:932)
Comment 1 Jerome Lanneluc CLA 2005-04-18 08:01:34 EDT
The parameter type of a(...) is A when it should be A<T>.

Moving to Frederic who now owns search.
Comment 2 Frederic Fusier CLA 2005-04-28 09:14:49 EDT
Fixed and released in HEAD.

While reporting match for declarations of sent messages, parameter types
signature were created with source name instead of short readable name which
includes type parameter...

[jdt-core-internal]
Change done in MethodLocator.reportDeclaration(...).

Test case added in JavaSearchBugsTests
Comment 3 Maxime Daniel CLA 2005-05-12 10:05:54 EDT
Verified for 3.1 M7 using build I20050509-2010 + jdt.core HEAD.