Bug 88167 - AFE in ChangeMethodSignature on anonymous class declaration of enum constant [refactoring]
Summary: AFE in ChangeMethodSignature on anonymous class declaration of enum constant ...
Status: RESOLVED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.1   Edit
Hardware: PC All
: P3 normal (vote)
Target Milestone: 3.1 M7   Edit
Assignee: Markus Keller CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on: 83083 88174
Blocks:
  Show dependency tree
 
Reported: 2005-03-16 08:59 EST by Tobias Widmer CLA
Modified: 2005-05-04 06:53 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-03-16 08:59:35 EST
I20050315-1100:

Steps to reproduce:
- Create the following snippet:

public class Test {
}
enum TestEnum {
  a {
    @Override
    int getValue() {
      return 0;
    }
  };
  abstract int getValue();
}

- Invoke CMS on getValue(), introduce additional parameter
-> org.eclipse.jface.util.Assert$AssertionFailedException: Assertion failed: 
Search for method declaration did not find original element
at org.eclipse.jface.util.Assert.isTrue(Assert.java:180)
at 
org.eclipse.jdt.internal.corext.refactoring.rename.RippleMethodFinder2.getAllRi
ppleMethods(RippleMethodFinder2.java:136)
at 
org.eclipse.jdt.internal.corext.refactoring.rename.RippleMethodFinder2.getRelat
edMethods(RippleMethodFinder2.java:123)
at 
org.eclipse.jdt.internal.corext.refactoring.structure.ChangeSignatureRefactorin
g.checkFinalConditions(ChangeSignatureRefactoring.java:722)
at org.eclipse.ltk.core.refactoring.CheckConditionsOperation.run
(CheckConditionsOperation.java:84)
at org.eclipse.ltk.core.refactoring.CreateChangeOperation.run
(CreateChangeOperation.java:114)
at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1702)
at org.eclipse.ltk.internal.ui.refactoring.WorkbenchRunnableAdapter.run
(WorkbenchRunnableAdapter.java:86)
at org.eclipse.jface.operation.ModalContext$ModalContextThread.run
(ModalContext.java:111)

Same also happens for toString() and the like...
Comment 1 Markus Keller CLA 2005-03-16 09:47:50 EST
Two problems here: 
- declaration search misses method in anonymous enum (bug 88174)
- compiler throws NPEs for some binary methods (bug 83083)
Comment 2 Markus Keller CLA 2005-05-04 06:53:48 EDT
Fixed.