/* * some utility methods for dealing with named entities */ aspect Names { interface Named { String getID(); void setID(String id); void changeID(String id) throws RefactoringException; } // in file LocalDeclaration.jadd: LocalDeclaration extends Named FieldDeclaration implements Named; ConstructorDecl implements Named; MethodDecl implements Named; TypeDecl implements Named; CompilationUnit implements Named; public void VariableDeclaration.changeID(String id) throws RefactoringException { setID(id); } public void ParameterDeclaration.changeID(String id) throws RefactoringException { setID(id); } public void FieldDeclaration.changeID(String id) throws RefactoringException { setID(id); } public void ConstructorDecl.changeID(String id) throws RefactoringException { setID(id); } public void MethodDecl.changeID(String id) throws RefactoringException { setID(id); } // when we change the ID of a class, we also need to rename its constructors public void TypeDecl.changeID(String id) throws RefactoringException { setID(id); for(int i=0;i