@Override public int computeNumberOfFixes(CompilationUnit compilationUnit) { if (!isEnabled(CleanUpConstants.ADD_MISSING_METHODES) && !isEnabled(MAKE_TYPE_ABSTRACT)) return 0; IProblemLocation[] locations= filter(convertProblems(compilationUnit.getProblems()), new int[] { IProblem.AbstractMethodMustBeImplemented, IProblem.EnumConstantMustImplementAbstractMethod }); HashSet<ASTNode> types= new HashSet<>(); for (int i= 0; i < locations.length; i++) { ASTNode type= UnimplementedCodeFix.getSelectedTypeNode(compilationUnit, locations[i]); if (type != null) { types.add(type); } } return types.size(); }
@Override public int computeNumberOfFixes(CompilationUnit compilationUnit) { if (!isEnabled(CleanUpConstants.ADD_MISSING_METHODES) && !isEnabled(MAKE_TYPE_ABSTRACT)) return 0; IProblemLocation[] locations= filter(convertProblems(compilationUnit.getProblems()), new int[] { IProblem.AbstractMethodMustBeImplemented, IProblem.EnumConstantMustImplementAbstractMethod }); HashSet<ASTNode> types= new HashSet<>(); for (int i= 0; i < locations.length; i++) { ASTNode type= UnimplementedCodeFix.getSelectedTypeNode(compilationUnit, locations[i]); if (type != null) { types.add(type); } } return types.size(); }
@Override protected ICleanUpFix createFix(CompilationUnit unit) throws CoreException { IProblemLocation[] problemLocations= convertProblems(unit.getProblems()); problemLocations= filter(problemLocations, new int[] { IProblem.AbstractMethodMustBeImplemented, IProblem.EnumConstantMustImplementAbstractMethod }); return UnimplementedCodeFix.createCleanUp(unit, isEnabled(CleanUpConstants.ADD_MISSING_METHODES), isEnabled(MAKE_TYPE_ABSTRACT), problemLocations); }
@Override protected ICleanUpFix createFix(CompilationUnit unit) throws CoreException { IProblemLocation[] problemLocations= convertProblems(unit.getProblems()); problemLocations= filter(problemLocations, new int[] { IProblem.AbstractMethodMustBeImplemented, IProblem.EnumConstantMustImplementAbstractMethod }); return UnimplementedCodeFix.createCleanUp(unit, isEnabled(CleanUpConstants.ADD_MISSING_METHODES), isEnabled(MAKE_TYPE_ABSTRACT), problemLocations); }