/* The Remove Unused Method microrefactoring removes a method if it can never be invoked and * is never statically bound to, and makes it abstract if it may be statically bound to but * can actually never be invoked. */ aspect RemoveUnusedMethod { public void MethodDecl.removeUnused(boolean leaveAbstract) { final MethodDecl md_ = this; if (leaveAbstract) Or.or(new Or.Refactoring() { public void refactor() throws RefactoringException { md_.makeAbstract(); } }/*, Or.ID*/); else Or.or(new Or.Refactoring() { public void refactor() throws RefactoringException { md_.removeMethod(); } }, new Or.Refactoring() { public void refactor() throws RefactoringException { md_.makeAbstract(); } }/*, Or.ID*/); } }