コード例 #1
0
 @Override
 public ICleanUpFix createFix(final CleanUpContext context) throws CoreException {
   if (context.getAST() == null) return null;
   if (context.getCompilationUnit() == null) return null;
   // return new SorterCleanUpFix(context);
   return null;
 }
コード例 #2
0
  /** {@inheritDoc} */
  public ICleanUpFix createFix(CleanUpContext context) throws CoreException {
    CompilationUnit compilationUnit = context.getAST();
    if (compilationUnit == null) return null;

    boolean usePrentheses = isEnabled(CleanUpConstants.EXPRESSIONS_USE_PARENTHESES);
    if (!usePrentheses) return null;

    return ExpressionsFix.createCleanUp(
        compilationUnit,
        isEnabled(CleanUpConstants.EXPRESSIONS_USE_PARENTHESES_ALWAYS),
        isEnabled(CleanUpConstants.EXPRESSIONS_USE_PARENTHESES_NEVER));
  }
コード例 #3
0
  /** {@inheritDoc} */
  @Override
  public ICleanUpFix createFix(CleanUpContext context) throws CoreException {
    CompilationUnit compilationUnit = context.getAST();
    if (compilationUnit == null) return null;

    boolean convertForLoops =
        isEnabled(CleanUpConstants.CONTROL_STATMENTS_CONVERT_FOR_LOOP_TO_ENHANCED);

    return ConvertLoopFix.createCleanUp(
        compilationUnit,
        convertForLoops,
        convertForLoops,
        isEnabled(CleanUpConstants.VARIABLE_DECLARATIONS_USE_FINAL)
            && isEnabled(CleanUpConstants.VARIABLE_DECLARATIONS_USE_FINAL_LOCAL_VARIABLES));
  }