I'm trying to rename all the methods of a large project.
RenameNonVirtualMethodProcessor processor = new RenameNonVirtualMethodProcessor(method); processor.setNewElementName(method.getElementName()+"_2");
processor.setUpdateReferences(true);
processor.checkNewElementName(method.getElementName()+"_2");
RenameRefactoring refactoring = new RenameRefactoring(processor);
final CreateChangeOperation create = new CreateChangeOperation(
new CheckConditionsOperation(refactoring,
CheckConditionsOperation.ALL_CONDITIONS),
RefactoringStatus.FATAL);
PerformChangeOperation perform = new PerformChangeOperation(create);
perform.run(pm);
The code actually succeeds until this error pops out. I Was checking, and i saw that the method that were having errors were open (exists on Java Model), and the newly refactored method don't.
java.lang.IllegalArgumentException: Invalid java element: =aima-core/src\/main\/java<aima.core.logic.fol.parsing.ast{TermEquality.java[TermEquality~equals_2~QObject;
equals_2(Object) (not open) [in TermEquality [in [Working copy] TermEquality.java [in aima.core.logic.fol.parsing.ast [in src/main/java [in aima-core]]]]]
at org.eclipse.jdt.internal.corext.refactoring.RefactoringSearchEngine.createOrPattern(RefactoringSearchEngine.java:203)
Any clues on how can i solve it?