Bug 131750 - CCE in 'Introduce Indirection'
Summary: CCE in 'Introduce Indirection'
Status: RESOLVED WORKSFORME
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.2   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.1 RC1   Edit
Assignee: Markus Keller CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on: 86293
Blocks:
  Show dependency tree
 
Reported: 2006-03-14 12:43 EST by Martin Aeschlimann CLA
Modified: 2006-04-10 06:28 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 Martin Aeschlimann CLA 2006-03-14 12:43:31 EST
20060314

- use 'Introduce Indirection' on the following 'run' with a JRE 1.5.

public class ThreadRunner {

	private static class MyThread extends Thread {
		public void run() {
		}
	}
	
	public void startInBackground() {
		MyThread thread= new MyThread();
		thread.run();
	}
}


Caused by: java.lang.ClassCastException: org/eclipse/jdt/internal/core/BinaryField incompatible with org/eclipse/jdt/core/IMethod
	at org.eclipse.jdt.internal.corext.refactoring.rename.RippleMethodFinder2.findAllDeclarations(RippleMethodFinder2.java:299)
	at org.eclipse.jdt.internal.corext.refactoring.rename.RippleMethodFinder2.getAllRippleMethods(RippleMethodFinder2.java:144)
	at org.eclipse.jdt.internal.corext.refactoring.rename.RippleMethodFinder2.getRelatedMethods(RippleMethodFinder2.java:132)
	at org.eclipse.jdt.internal.corext.refactoring.code.IntroduceIndirectionRefactoring.updateReferences(IntroduceIndirectionRefactoring.java:626)
	at org.eclipse.jdt.internal.corext.refactoring.code.IntroduceIndirectionRefactoring.checkFinalConditions(IntroduceIndirectionRefactoring.java:520)
	at org.eclipse.ltk.core.refactoring.CheckConditionsOperation.run(CheckConditionsOperation.java:83)
	at org.eclipse.ltk.core.refactoring.CreateChangeOperation.run(CreateChangeOperation.java:118)
	at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1736)
	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.ClassCastException: org/eclipse/jdt/internal/core/BinaryField incompatible with org/eclipse/jdt/core/IMethod
	at org.eclipse.jdt.internal.corext.refactoring.rename.RippleMethodFinder2.findAllDeclarations(RippleMethodFinder2.java:299)
	at org.eclipse.jdt.internal.corext.refactoring.rename.RippleMethodFinder2.getAllRippleMethods(RippleMethodFinder2.java:144)
	at org.eclipse.jdt.internal.corext.refactoring.rename.RippleMethodFinder2.getRelatedMethods(RippleMethodFinder2.java:132)
	at org.eclipse.jdt.internal.corext.refactoring.code.IntroduceIndirectionRefactoring.updateReferences(IntroduceIndirectionRefactoring.java:626)
	at org.eclipse.jdt.internal.corext.refactoring.code.IntroduceIndirectionRefactoring.checkFinalConditions(IntroduceIndirectionRefactoring.java:520)
	at org.eclipse.ltk.core.refactoring.CheckConditionsOperation.run(CheckConditionsOperation.java:83)
	at org.eclipse.ltk.core.refactoring.CreateChangeOperation.run(CreateChangeOperation.java:118)
	at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1736)
	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 Martin Aeschlimann CLA 2006-03-15 03:52:14 EST
if bug 86293 doesn't make it for 3.2 we should add code that detects and skips the wrong matches.
Comment 2 Markus Keller CLA 2006-04-10 06:28:41 EDT
The fix for bug 86293 has fixed this problem in N20060410-0010.