diff --git a/org.eclipse.jdt.core.manipulation/common/org/eclipse/jdt/internal/ui/fix/AbstractCleanUpCore.java b/org.eclipse.jdt.core.manipulation/common/org/eclipse/jdt/internal/ui/fix/AbstractCleanUpCore.java deleted file mode 100644 index 029588b765c..00000000000 --- a/org.eclipse.jdt.core.manipulation/common/org/eclipse/jdt/internal/ui/fix/AbstractCleanUpCore.java +++ /dev/null @@ -1,113 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2019 IBM Corporation and others. - * - * This program and the accompanying materials - * are made available under the terms of the Eclipse Public License 2.0 - * which accompanies this distribution, and is available at - * https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * IBM Corporation - initial API and implementation - * Red Hat Inc. - copied and modified from AbstractCleanUp - *******************************************************************************/ -package org.eclipse.jdt.internal.ui.fix; - -import java.util.Map; - -import org.eclipse.core.runtime.Assert; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IProgressMonitor; - -import org.eclipse.ltk.core.refactoring.RefactoringStatus; - -import org.eclipse.jdt.core.ICompilationUnit; -import org.eclipse.jdt.core.IJavaProject; -import org.eclipse.jdt.core.manipulation.CleanUpOptionsCore; - -import org.eclipse.jdt.ui.cleanup.CleanUpContext; -import org.eclipse.jdt.ui.cleanup.CleanUpOptions; -import org.eclipse.jdt.ui.cleanup.CleanUpRequirements; -import org.eclipse.jdt.ui.cleanup.ICleanUp; -import org.eclipse.jdt.ui.cleanup.ICleanUpFix; - -public abstract class AbstractCleanUpCore implements ICleanUp { - - private CleanUpOptionsCore fOptions; - - public AbstractCleanUpCore() { - } - - public AbstractCleanUpCore(Map settings) { - setOptions(new MapCleanUpOptions(settings)); - } - - /* - * @see org.eclipse.jdt.internal.corext.fix.ICleanUp#setOptions(org.eclipse.jdt.ui.cleanup.CleanUpOptions) - */ - @Override - public void setOptions(CleanUpOptions options) { - Assert.isLegal(options != null); - fOptions= options; - } - - - /* - * @see org.eclipse.jdt.internal.corext.fix.ICleanUpCore#getStepDescriptions() - */ - @Override - public String[] getStepDescriptions() { - return new String[0]; - } - - /** - * @return code snippet complying to current options - */ - public String getPreview() { - return ""; //$NON-NLS-1$ - } - - /* - * @see org.eclipse.jdt.internal.corext.fix.ICleanUpCore#getRequirementsCore() - */ - @Override - public CleanUpRequirements getRequirements() { - return new CleanUpRequirements(false, false, false, null); - } - - /* - * @see org.eclipse.jdt.internal.corext.fix.ICleanUpCore#checkPreConditions(org.eclipse.jdt.core.IJavaProject, org.eclipse.jdt.core.ICompilationUnit[], org.eclipse.core.runtime.IProgressMonitor) - */ - @Override - public RefactoringStatus checkPreConditions(IJavaProject project, ICompilationUnit[] compilationUnits, IProgressMonitor monitor) throws CoreException { - return new RefactoringStatus(); - } - - /* - * @see org.eclipse.jdt.internal.corext.fix.ICleanUp#createFixCore(org.eclipse.jdt.ui.cleanup.CleanUpContext) - */ - @Override - public ICleanUpFix createFix(CleanUpContext context) throws CoreException { - return null; - } - - /* - * @see org.eclipse.jdt.internal.corext.fix.ICleanUpCore#checkPostConditions(org.eclipse.core.runtime.IProgressMonitor) - */ - @Override - public RefactoringStatus checkPostConditions(IProgressMonitor monitor) throws CoreException { - return new RefactoringStatus(); - } - - /** - * @param key the name of the option - * @return true if option with key is enabled - */ - protected boolean isEnabled(String key) { - Assert.isNotNull(fOptions); - Assert.isLegal(key != null); - return fOptions.isEnabled(key); - } - -} diff --git a/org.eclipse.jdt.core.manipulation/common/org/eclipse/jdt/internal/ui/fix/AbstractCleanUpCoreWrapper.java b/org.eclipse.jdt.core.manipulation/common/org/eclipse/jdt/internal/ui/fix/AbstractCleanUpCoreWrapper.java index 15c7074fa4f..a244f763c66 100644 --- a/org.eclipse.jdt.core.manipulation/common/org/eclipse/jdt/internal/ui/fix/AbstractCleanUpCoreWrapper.java +++ b/org.eclipse.jdt.core.manipulation/common/org/eclipse/jdt/internal/ui/fix/AbstractCleanUpCoreWrapper.java @@ -34,7 +34,7 @@ * * @param The type of the cleanup this class forwards to. */ -public class AbstractCleanUpCoreWrapper extends AbstractCleanUp { +public class AbstractCleanUpCoreWrapper extends AbstractCleanUp { protected final T cleanUpCore; protected AbstractCleanUpCoreWrapper(Map settings, T wrapped) { diff --git a/org.eclipse.jdt.core.manipulation/common/org/eclipse/jdt/internal/ui/fix/AbstractMultiFixCore.java b/org.eclipse.jdt.core.manipulation/common/org/eclipse/jdt/internal/ui/fix/AbstractMultiFixCore.java deleted file mode 100644 index f44f21db3b5..00000000000 --- a/org.eclipse.jdt.core.manipulation/common/org/eclipse/jdt/internal/ui/fix/AbstractMultiFixCore.java +++ /dev/null @@ -1,130 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2019 IBM Corporation and others. - * - * This program and the accompanying materials - * are made available under the terms of the Eclipse Public License 2.0 - * which accompanies this distribution, and is available at - * https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * IBM Corporation - initial API and implementation - * Red Hat Inc. - copied from AbstractMultiFix and modified for jdt.core.manipulation - *******************************************************************************/ -package org.eclipse.jdt.internal.ui.fix; - -import java.util.ArrayList; -import java.util.Map; - -import org.eclipse.core.runtime.CoreException; - -import org.eclipse.jdt.core.compiler.IProblem; -import org.eclipse.jdt.core.dom.CompilationUnit; - -import org.eclipse.jdt.ui.cleanup.CleanUpContext; -import org.eclipse.jdt.ui.cleanup.ICleanUpFix; -import org.eclipse.jdt.ui.text.java.IProblemLocation; - -import org.eclipse.jdt.internal.ui.text.correction.ProblemLocation; - - -public abstract class AbstractMultiFixCore extends AbstractCleanUpCore implements IMultiFixCore { - - protected AbstractMultiFixCore() { - } - - protected AbstractMultiFixCore(Map settings) { - super(settings); - } - - @Override - public final ICleanUpFix createFix(CleanUpContext context) throws CoreException { - CompilationUnit unit= context.getAST(); - if (unit == null) - return null; - - if (context instanceof MultiFixContext) { - return createFix(unit, ((MultiFixContext)context).getProblemLocations()); - } else { - return createFix(unit); - } - } - - protected abstract ICleanUpFix createFix(CompilationUnit unit) throws CoreException; - - protected abstract ICleanUpFix createFix(CompilationUnit unit, IProblemLocation[] problems) throws CoreException; - - @Override - public int computeNumberOfFixes(CompilationUnit compilationUnit) { - return -1; - } - - /** - * Utility method to: count number of problems in problems with problemId - * @param problems the set of problems - * @param problemId the problem id to look for - * @return number of problems with problem id - */ - protected static int getNumberOfProblems(IProblem[] problems, int problemId) { - int result= 0; - for (IProblem problem : problems) { - if (problem.getID() == problemId) - result++; - } - return result; - } - - /** - * Convert set of IProblems to IProblemLocation - * @param problems the problems to convert - * @return the converted set - */ - protected static IProblemLocation[] convertProblems(IProblem[] problems) { - IProblemLocation[] result= new IProblemLocation[problems.length]; - - for (int i= 0; i < problems.length; i++) { - result[i]= new ProblemLocation(problems[i]); - } - - return result; - } - - /** - * Returns unique problem locations. All locations in result - * have an id element problemIds. - * - * @param problems the problems to filter - * @param problemIds the ids of the resulting problem locations - * @return problem locations - */ - protected static IProblemLocation[] filter(IProblemLocation[] problems, int[] problemIds) { - ArrayList result= new ArrayList<>(); - - for (IProblemLocation problem : problems) { - if (contains(problemIds, problem.getProblemId()) && !contains(result, problem)) { - result.add(problem); - } - } - - return result.toArray(new IProblemLocation[result.size()]); - } - - private static boolean contains(ArrayList problems, IProblemLocation problem) { - for (IProblemLocation existing : problems) { - if (existing.getProblemId() == problem.getProblemId() && existing.getOffset() == problem.getOffset() && existing.getLength() == problem.getLength()) { - return true; - } - } - - return false; - } - - private static boolean contains(int[] ids, int id) { - for (int id2 : ids) { - if (id2 == id) - return true; - } - return false; - } -} diff --git a/org.eclipse.jdt.core.manipulation/common/org/eclipse/jdt/internal/ui/fix/AbstractMultiFixCoreWrapper.java b/org.eclipse.jdt.core.manipulation/common/org/eclipse/jdt/internal/ui/fix/AbstractMultiFixCoreWrapper.java index 8650112c774..fc8df1446a5 100644 --- a/org.eclipse.jdt.core.manipulation/common/org/eclipse/jdt/internal/ui/fix/AbstractMultiFixCoreWrapper.java +++ b/org.eclipse.jdt.core.manipulation/common/org/eclipse/jdt/internal/ui/fix/AbstractMultiFixCoreWrapper.java @@ -22,11 +22,11 @@ /** * An extension of {@link AbstractCleanUpCoreWrapper} for cases where the wrapped - * cleanup extends {@link AbstractMultiFixCore} + * cleanup extends {@link AbstractMultiFix} * * @param The type of the cleanup this class forwards to. */ -public class AbstractMultiFixCoreWrapper extends AbstractCleanUpCoreWrapper implements IMultiFix { +public class AbstractMultiFixCoreWrapper extends AbstractCleanUpCoreWrapper implements IMultiFix { protected AbstractMultiFixCoreWrapper(Map settings, T wrapped) { super(settings, wrapped); diff --git a/org.eclipse.jdt.core.manipulation/common/org/eclipse/jdt/internal/ui/fix/ArrayWithCurlyCleanUpCore.java b/org.eclipse.jdt.core.manipulation/common/org/eclipse/jdt/internal/ui/fix/ArrayWithCurlyCleanUpCore.java index 501ccb93a33..f1832c4a017 100644 --- a/org.eclipse.jdt.core.manipulation/common/org/eclipse/jdt/internal/ui/fix/ArrayWithCurlyCleanUpCore.java +++ b/org.eclipse.jdt.core.manipulation/common/org/eclipse/jdt/internal/ui/fix/ArrayWithCurlyCleanUpCore.java @@ -28,7 +28,7 @@ import org.eclipse.jdt.ui.cleanup.CleanUpRequirements; import org.eclipse.jdt.ui.cleanup.ICleanUpFix; -public class ArrayWithCurlyCleanUpCore extends AbstractCleanUpCore { +public class ArrayWithCurlyCleanUpCore extends AbstractCleanUp { public ArrayWithCurlyCleanUpCore(final Map options) { super(options); } diff --git a/org.eclipse.jdt.core.manipulation/common/org/eclipse/jdt/internal/ui/fix/BooleanValueRatherThanComparisonCleanUpCore.java b/org.eclipse.jdt.core.manipulation/common/org/eclipse/jdt/internal/ui/fix/BooleanValueRatherThanComparisonCleanUpCore.java index 7d3bdb7877d..dbbf7e48447 100644 --- a/org.eclipse.jdt.core.manipulation/common/org/eclipse/jdt/internal/ui/fix/BooleanValueRatherThanComparisonCleanUpCore.java +++ b/org.eclipse.jdt.core.manipulation/common/org/eclipse/jdt/internal/ui/fix/BooleanValueRatherThanComparisonCleanUpCore.java @@ -26,7 +26,7 @@ import org.eclipse.jdt.ui.cleanup.CleanUpRequirements; import org.eclipse.jdt.ui.cleanup.ICleanUpFix; -public class BooleanValueRatherThanComparisonCleanUpCore extends AbstractCleanUpCore { +public class BooleanValueRatherThanComparisonCleanUpCore extends AbstractCleanUp { public BooleanValueRatherThanComparisonCleanUpCore(final Map options) { super(options); } diff --git a/org.eclipse.jdt.core.manipulation/common/org/eclipse/jdt/internal/ui/fix/CodeStyleCleanUpCore.java b/org.eclipse.jdt.core.manipulation/common/org/eclipse/jdt/internal/ui/fix/CodeStyleCleanUpCore.java index d5b9a4ce09f..4026217f0c6 100644 --- a/org.eclipse.jdt.core.manipulation/common/org/eclipse/jdt/internal/ui/fix/CodeStyleCleanUpCore.java +++ b/org.eclipse.jdt.core.manipulation/common/org/eclipse/jdt/internal/ui/fix/CodeStyleCleanUpCore.java @@ -37,7 +37,7 @@ * Creates fixes which can resolve code style issues * @see org.eclipse.jdt.internal.corext.fix.CodeStyleFixCore */ -public class CodeStyleCleanUpCore extends AbstractMultiFixCore { +public class CodeStyleCleanUpCore extends AbstractMultiFix { public CodeStyleCleanUpCore() { } diff --git a/org.eclipse.jdt.core.manipulation/common/org/eclipse/jdt/internal/ui/fix/ConstantsForSystemPropertiesCleanUpCore.java b/org.eclipse.jdt.core.manipulation/common/org/eclipse/jdt/internal/ui/fix/ConstantsForSystemPropertiesCleanUpCore.java index da9bb9092a3..183d9978789 100644 --- a/org.eclipse.jdt.core.manipulation/common/org/eclipse/jdt/internal/ui/fix/ConstantsForSystemPropertiesCleanUpCore.java +++ b/org.eclipse.jdt.core.manipulation/common/org/eclipse/jdt/internal/ui/fix/ConstantsForSystemPropertiesCleanUpCore.java @@ -52,7 +52,7 @@ import org.eclipse.jdt.ui.cleanup.CleanUpRequirements; import org.eclipse.jdt.ui.cleanup.ICleanUpFix; -public class ConstantsForSystemPropertiesCleanUpCore extends AbstractCleanUpCore { +public class ConstantsForSystemPropertiesCleanUpCore extends AbstractCleanUp { public ConstantsForSystemPropertiesCleanUpCore(final Map options) { super(options); } diff --git a/org.eclipse.jdt.core.manipulation/common/org/eclipse/jdt/internal/ui/fix/DoWhileRatherThanWhileCleanUpCore.java b/org.eclipse.jdt.core.manipulation/common/org/eclipse/jdt/internal/ui/fix/DoWhileRatherThanWhileCleanUpCore.java index e8335df587c..3a605286d66 100644 --- a/org.eclipse.jdt.core.manipulation/common/org/eclipse/jdt/internal/ui/fix/DoWhileRatherThanWhileCleanUpCore.java +++ b/org.eclipse.jdt.core.manipulation/common/org/eclipse/jdt/internal/ui/fix/DoWhileRatherThanWhileCleanUpCore.java @@ -26,7 +26,7 @@ import org.eclipse.jdt.ui.cleanup.CleanUpRequirements; import org.eclipse.jdt.ui.cleanup.ICleanUpFix; -public class DoWhileRatherThanWhileCleanUpCore extends AbstractCleanUpCore { +public class DoWhileRatherThanWhileCleanUpCore extends AbstractCleanUp { public DoWhileRatherThanWhileCleanUpCore(final Map options) { super(options); } diff --git a/org.eclipse.jdt.core.manipulation/common/org/eclipse/jdt/internal/ui/fix/InlineDeprecatedMethodCleanUpCore.java b/org.eclipse.jdt.core.manipulation/common/org/eclipse/jdt/internal/ui/fix/InlineDeprecatedMethodCleanUpCore.java index 45c3aaba9cc..b954828047f 100644 --- a/org.eclipse.jdt.core.manipulation/common/org/eclipse/jdt/internal/ui/fix/InlineDeprecatedMethodCleanUpCore.java +++ b/org.eclipse.jdt.core.manipulation/common/org/eclipse/jdt/internal/ui/fix/InlineDeprecatedMethodCleanUpCore.java @@ -34,7 +34,7 @@ import org.eclipse.jdt.internal.ui.text.correction.QuickAssistProcessorUtil; -public class InlineDeprecatedMethodCleanUpCore extends AbstractMultiFixCore { +public class InlineDeprecatedMethodCleanUpCore extends AbstractMultiFix { public InlineDeprecatedMethodCleanUpCore() { this(Collections.emptyMap()); diff --git a/org.eclipse.jdt.core.manipulation/common/org/eclipse/jdt/internal/ui/fix/InvertEqualsCleanUpCore.java b/org.eclipse.jdt.core.manipulation/common/org/eclipse/jdt/internal/ui/fix/InvertEqualsCleanUpCore.java index 1722ea748f7..6bc5095ea0d 100644 --- a/org.eclipse.jdt.core.manipulation/common/org/eclipse/jdt/internal/ui/fix/InvertEqualsCleanUpCore.java +++ b/org.eclipse.jdt.core.manipulation/common/org/eclipse/jdt/internal/ui/fix/InvertEqualsCleanUpCore.java @@ -28,7 +28,7 @@ import org.eclipse.jdt.ui.cleanup.CleanUpRequirements; import org.eclipse.jdt.ui.cleanup.ICleanUpFix; -public class InvertEqualsCleanUpCore extends AbstractCleanUpCore { +public class InvertEqualsCleanUpCore extends AbstractCleanUp { public InvertEqualsCleanUpCore(final Map options) { super(options); } diff --git a/org.eclipse.jdt.core.manipulation/common/org/eclipse/jdt/internal/ui/fix/LambdaExpressionsCleanUpCore.java b/org.eclipse.jdt.core.manipulation/common/org/eclipse/jdt/internal/ui/fix/LambdaExpressionsCleanUpCore.java index 2037ff80e7e..029f83342cb 100644 --- a/org.eclipse.jdt.core.manipulation/common/org/eclipse/jdt/internal/ui/fix/LambdaExpressionsCleanUpCore.java +++ b/org.eclipse.jdt.core.manipulation/common/org/eclipse/jdt/internal/ui/fix/LambdaExpressionsCleanUpCore.java @@ -28,7 +28,7 @@ import org.eclipse.jdt.ui.cleanup.CleanUpRequirements; import org.eclipse.jdt.ui.cleanup.ICleanUpFix; -public class LambdaExpressionsCleanUpCore extends AbstractCleanUpCore { +public class LambdaExpressionsCleanUpCore extends AbstractCleanUp { public LambdaExpressionsCleanUpCore(Map options) { super(options); diff --git a/org.eclipse.jdt.core.manipulation/common/org/eclipse/jdt/internal/ui/fix/NoStringCreationCleanUpCore.java b/org.eclipse.jdt.core.manipulation/common/org/eclipse/jdt/internal/ui/fix/NoStringCreationCleanUpCore.java index d23b0a1d750..8a49f7df1ee 100644 --- a/org.eclipse.jdt.core.manipulation/common/org/eclipse/jdt/internal/ui/fix/NoStringCreationCleanUpCore.java +++ b/org.eclipse.jdt.core.manipulation/common/org/eclipse/jdt/internal/ui/fix/NoStringCreationCleanUpCore.java @@ -55,7 +55,7 @@ /** * A fix that removes a String instance from a String literal. */ -public class NoStringCreationCleanUpCore extends AbstractMultiFixCore { +public class NoStringCreationCleanUpCore extends AbstractMultiFix { public NoStringCreationCleanUpCore() { this(Collections.emptyMap()); } diff --git a/org.eclipse.jdt.core.manipulation/common/org/eclipse/jdt/internal/ui/fix/OneIfRatherThanDuplicateBlocksThatFallThroughCleanUpCore.java b/org.eclipse.jdt.core.manipulation/common/org/eclipse/jdt/internal/ui/fix/OneIfRatherThanDuplicateBlocksThatFallThroughCleanUpCore.java index 14fe64a7f2c..d022fe28f48 100644 --- a/org.eclipse.jdt.core.manipulation/common/org/eclipse/jdt/internal/ui/fix/OneIfRatherThanDuplicateBlocksThatFallThroughCleanUpCore.java +++ b/org.eclipse.jdt.core.manipulation/common/org/eclipse/jdt/internal/ui/fix/OneIfRatherThanDuplicateBlocksThatFallThroughCleanUpCore.java @@ -26,7 +26,7 @@ import org.eclipse.jdt.ui.cleanup.CleanUpRequirements; import org.eclipse.jdt.ui.cleanup.ICleanUpFix; -public class OneIfRatherThanDuplicateBlocksThatFallThroughCleanUpCore extends AbstractCleanUpCore { +public class OneIfRatherThanDuplicateBlocksThatFallThroughCleanUpCore extends AbstractCleanUp { public OneIfRatherThanDuplicateBlocksThatFallThroughCleanUpCore(final Map options) { super(options); } diff --git a/org.eclipse.jdt.core.manipulation/common/org/eclipse/jdt/internal/ui/fix/PatternMatchingForInstanceofCleanUpCore.java b/org.eclipse.jdt.core.manipulation/common/org/eclipse/jdt/internal/ui/fix/PatternMatchingForInstanceofCleanUpCore.java index 2324b482ed2..292be750473 100644 --- a/org.eclipse.jdt.core.manipulation/common/org/eclipse/jdt/internal/ui/fix/PatternMatchingForInstanceofCleanUpCore.java +++ b/org.eclipse.jdt.core.manipulation/common/org/eclipse/jdt/internal/ui/fix/PatternMatchingForInstanceofCleanUpCore.java @@ -29,7 +29,7 @@ import org.eclipse.jdt.ui.cleanup.CleanUpRequirements; import org.eclipse.jdt.ui.cleanup.ICleanUpFix; -public class PatternMatchingForInstanceofCleanUpCore extends AbstractCleanUpCore { +public class PatternMatchingForInstanceofCleanUpCore extends AbstractCleanUp { public PatternMatchingForInstanceofCleanUpCore(final Map options) { super(options); } diff --git a/org.eclipse.jdt.core.manipulation/common/org/eclipse/jdt/internal/ui/fix/PlainReplacementCleanUpCore.java b/org.eclipse.jdt.core.manipulation/common/org/eclipse/jdt/internal/ui/fix/PlainReplacementCleanUpCore.java index 0fd451a20f4..9e94c9dff49 100644 --- a/org.eclipse.jdt.core.manipulation/common/org/eclipse/jdt/internal/ui/fix/PlainReplacementCleanUpCore.java +++ b/org.eclipse.jdt.core.manipulation/common/org/eclipse/jdt/internal/ui/fix/PlainReplacementCleanUpCore.java @@ -28,7 +28,7 @@ import org.eclipse.jdt.ui.cleanup.CleanUpRequirements; import org.eclipse.jdt.ui.cleanup.ICleanUpFix; -public class PlainReplacementCleanUpCore extends AbstractCleanUpCore { +public class PlainReplacementCleanUpCore extends AbstractCleanUp { public PlainReplacementCleanUpCore(final Map options) { super(options); } diff --git a/org.eclipse.jdt.core.manipulation/common/org/eclipse/jdt/internal/ui/fix/PotentialProgrammingProblemsCleanUpCore.java b/org.eclipse.jdt.core.manipulation/common/org/eclipse/jdt/internal/ui/fix/PotentialProgrammingProblemsCleanUpCore.java index 60b739bf0a7..e6816cad6b6 100644 --- a/org.eclipse.jdt.core.manipulation/common/org/eclipse/jdt/internal/ui/fix/PotentialProgrammingProblemsCleanUpCore.java +++ b/org.eclipse.jdt.core.manipulation/common/org/eclipse/jdt/internal/ui/fix/PotentialProgrammingProblemsCleanUpCore.java @@ -37,7 +37,7 @@ import org.eclipse.jdt.ui.cleanup.ICleanUpFix; import org.eclipse.jdt.ui.text.java.IProblemLocation; -public class PotentialProgrammingProblemsCleanUpCore extends AbstractMultiFixCore { +public class PotentialProgrammingProblemsCleanUpCore extends AbstractMultiFix { public PotentialProgrammingProblemsCleanUpCore(Map options) { super(options); diff --git a/org.eclipse.jdt.core.manipulation/common/org/eclipse/jdt/internal/ui/fix/PrimitiveComparisonCleanUpCore.java b/org.eclipse.jdt.core.manipulation/common/org/eclipse/jdt/internal/ui/fix/PrimitiveComparisonCleanUpCore.java index da376e6e3e3..77ddcbb7749 100644 --- a/org.eclipse.jdt.core.manipulation/common/org/eclipse/jdt/internal/ui/fix/PrimitiveComparisonCleanUpCore.java +++ b/org.eclipse.jdt.core.manipulation/common/org/eclipse/jdt/internal/ui/fix/PrimitiveComparisonCleanUpCore.java @@ -28,7 +28,7 @@ import org.eclipse.jdt.ui.cleanup.CleanUpRequirements; import org.eclipse.jdt.ui.cleanup.ICleanUpFix; -public class PrimitiveComparisonCleanUpCore extends AbstractCleanUpCore { +public class PrimitiveComparisonCleanUpCore extends AbstractCleanUp { public PrimitiveComparisonCleanUpCore(final Map options) { super(options); } diff --git a/org.eclipse.jdt.core.manipulation/common/org/eclipse/jdt/internal/ui/fix/PrimitiveRatherThanWrapperCleanUpCore.java b/org.eclipse.jdt.core.manipulation/common/org/eclipse/jdt/internal/ui/fix/PrimitiveRatherThanWrapperCleanUpCore.java index 19406a29e6a..f42e66696cc 100644 --- a/org.eclipse.jdt.core.manipulation/common/org/eclipse/jdt/internal/ui/fix/PrimitiveRatherThanWrapperCleanUpCore.java +++ b/org.eclipse.jdt.core.manipulation/common/org/eclipse/jdt/internal/ui/fix/PrimitiveRatherThanWrapperCleanUpCore.java @@ -26,7 +26,7 @@ import org.eclipse.jdt.ui.cleanup.CleanUpRequirements; import org.eclipse.jdt.ui.cleanup.ICleanUpFix; -public class PrimitiveRatherThanWrapperCleanUpCore extends AbstractCleanUpCore { +public class PrimitiveRatherThanWrapperCleanUpCore extends AbstractCleanUp { public PrimitiveRatherThanWrapperCleanUpCore(final Map options) { super(options); } diff --git a/org.eclipse.jdt.core.manipulation/common/org/eclipse/jdt/internal/ui/fix/PullOutIfFromIfElseCleanUpCore.java b/org.eclipse.jdt.core.manipulation/common/org/eclipse/jdt/internal/ui/fix/PullOutIfFromIfElseCleanUpCore.java index 8f0ece26c3d..a1748961a5f 100644 --- a/org.eclipse.jdt.core.manipulation/common/org/eclipse/jdt/internal/ui/fix/PullOutIfFromIfElseCleanUpCore.java +++ b/org.eclipse.jdt.core.manipulation/common/org/eclipse/jdt/internal/ui/fix/PullOutIfFromIfElseCleanUpCore.java @@ -26,7 +26,7 @@ import org.eclipse.jdt.ui.cleanup.CleanUpRequirements; import org.eclipse.jdt.ui.cleanup.ICleanUpFix; -public class PullOutIfFromIfElseCleanUpCore extends AbstractCleanUpCore { +public class PullOutIfFromIfElseCleanUpCore extends AbstractCleanUp { public PullOutIfFromIfElseCleanUpCore(final Map options) { super(options); } diff --git a/org.eclipse.jdt.core.manipulation/common/org/eclipse/jdt/internal/ui/fix/RedundantComparatorCleanUpCore.java b/org.eclipse.jdt.core.manipulation/common/org/eclipse/jdt/internal/ui/fix/RedundantComparatorCleanUpCore.java index 2a5a13af058..6f96b4e162f 100644 --- a/org.eclipse.jdt.core.manipulation/common/org/eclipse/jdt/internal/ui/fix/RedundantComparatorCleanUpCore.java +++ b/org.eclipse.jdt.core.manipulation/common/org/eclipse/jdt/internal/ui/fix/RedundantComparatorCleanUpCore.java @@ -28,7 +28,7 @@ import org.eclipse.jdt.ui.cleanup.CleanUpRequirements; import org.eclipse.jdt.ui.cleanup.ICleanUpFix; -public class RedundantComparatorCleanUpCore extends AbstractCleanUpCore { +public class RedundantComparatorCleanUpCore extends AbstractCleanUp { public RedundantComparatorCleanUpCore(final Map options) { super(options); } diff --git a/org.eclipse.jdt.core.manipulation/common/org/eclipse/jdt/internal/ui/fix/ReturnExpressionCleanUpCore.java b/org.eclipse.jdt.core.manipulation/common/org/eclipse/jdt/internal/ui/fix/ReturnExpressionCleanUpCore.java index a643c65f86b..9f6c2785d4e 100644 --- a/org.eclipse.jdt.core.manipulation/common/org/eclipse/jdt/internal/ui/fix/ReturnExpressionCleanUpCore.java +++ b/org.eclipse.jdt.core.manipulation/common/org/eclipse/jdt/internal/ui/fix/ReturnExpressionCleanUpCore.java @@ -28,7 +28,7 @@ import org.eclipse.jdt.ui.cleanup.CleanUpRequirements; import org.eclipse.jdt.ui.cleanup.ICleanUpFix; -public class ReturnExpressionCleanUpCore extends AbstractCleanUpCore { +public class ReturnExpressionCleanUpCore extends AbstractCleanUp { public ReturnExpressionCleanUpCore(final Map options) { super(options); } diff --git a/org.eclipse.jdt.core.manipulation/common/org/eclipse/jdt/internal/ui/fix/StandardComparisonCleanUpCore.java b/org.eclipse.jdt.core.manipulation/common/org/eclipse/jdt/internal/ui/fix/StandardComparisonCleanUpCore.java index 496a4839d2c..1e9fc4ed54f 100644 --- a/org.eclipse.jdt.core.manipulation/common/org/eclipse/jdt/internal/ui/fix/StandardComparisonCleanUpCore.java +++ b/org.eclipse.jdt.core.manipulation/common/org/eclipse/jdt/internal/ui/fix/StandardComparisonCleanUpCore.java @@ -28,7 +28,7 @@ import org.eclipse.jdt.ui.cleanup.CleanUpRequirements; import org.eclipse.jdt.ui.cleanup.ICleanUpFix; -public class StandardComparisonCleanUpCore extends AbstractCleanUpCore { +public class StandardComparisonCleanUpCore extends AbstractCleanUp { public StandardComparisonCleanUpCore(final Map options) { super(options); } diff --git a/org.eclipse.jdt.core.manipulation/common/org/eclipse/jdt/internal/ui/fix/StringBufferToStringBuilderCleanUpCore.java b/org.eclipse.jdt.core.manipulation/common/org/eclipse/jdt/internal/ui/fix/StringBufferToStringBuilderCleanUpCore.java index dab992f98bb..b8fcbcd0880 100644 --- a/org.eclipse.jdt.core.manipulation/common/org/eclipse/jdt/internal/ui/fix/StringBufferToStringBuilderCleanUpCore.java +++ b/org.eclipse.jdt.core.manipulation/common/org/eclipse/jdt/internal/ui/fix/StringBufferToStringBuilderCleanUpCore.java @@ -26,7 +26,7 @@ import org.eclipse.jdt.ui.cleanup.CleanUpRequirements; import org.eclipse.jdt.ui.cleanup.ICleanUpFix; -public class StringBufferToStringBuilderCleanUpCore extends AbstractCleanUpCore { +public class StringBufferToStringBuilderCleanUpCore extends AbstractCleanUp { public StringBufferToStringBuilderCleanUpCore(final Map options) { super(options); diff --git a/org.eclipse.jdt.core.manipulation/common/org/eclipse/jdt/internal/ui/fix/StringConcatToTextBlockCleanUpCore.java b/org.eclipse.jdt.core.manipulation/common/org/eclipse/jdt/internal/ui/fix/StringConcatToTextBlockCleanUpCore.java index 32d3b7ce7f2..e378123217b 100644 --- a/org.eclipse.jdt.core.manipulation/common/org/eclipse/jdt/internal/ui/fix/StringConcatToTextBlockCleanUpCore.java +++ b/org.eclipse.jdt.core.manipulation/common/org/eclipse/jdt/internal/ui/fix/StringConcatToTextBlockCleanUpCore.java @@ -26,7 +26,7 @@ import org.eclipse.jdt.ui.cleanup.CleanUpRequirements; import org.eclipse.jdt.ui.cleanup.ICleanUpFix; -public class StringConcatToTextBlockCleanUpCore extends AbstractCleanUpCore { +public class StringConcatToTextBlockCleanUpCore extends AbstractCleanUp { public StringConcatToTextBlockCleanUpCore(final Map options) { super(options); diff --git a/org.eclipse.jdt.core.manipulation/common/org/eclipse/jdt/internal/ui/fix/SubstringCleanUpCore.java b/org.eclipse.jdt.core.manipulation/common/org/eclipse/jdt/internal/ui/fix/SubstringCleanUpCore.java index 9be393e7c69..1cc96456b05 100644 --- a/org.eclipse.jdt.core.manipulation/common/org/eclipse/jdt/internal/ui/fix/SubstringCleanUpCore.java +++ b/org.eclipse.jdt.core.manipulation/common/org/eclipse/jdt/internal/ui/fix/SubstringCleanUpCore.java @@ -49,7 +49,7 @@ *
  • The expression must be passive.
  • * */ -public class SubstringCleanUpCore extends AbstractMultiFixCore { +public class SubstringCleanUpCore extends AbstractMultiFix { public SubstringCleanUpCore() { this(Collections.emptyMap()); } diff --git a/org.eclipse.jdt.core.manipulation/common/org/eclipse/jdt/internal/ui/fix/SwitchCleanUpCore.java b/org.eclipse.jdt.core.manipulation/common/org/eclipse/jdt/internal/ui/fix/SwitchCleanUpCore.java index 84143436bcf..15ea46385db 100644 --- a/org.eclipse.jdt.core.manipulation/common/org/eclipse/jdt/internal/ui/fix/SwitchCleanUpCore.java +++ b/org.eclipse.jdt.core.manipulation/common/org/eclipse/jdt/internal/ui/fix/SwitchCleanUpCore.java @@ -28,7 +28,7 @@ import org.eclipse.jdt.ui.cleanup.CleanUpRequirements; import org.eclipse.jdt.ui.cleanup.ICleanUpFix; -public class SwitchCleanUpCore extends AbstractCleanUpCore { +public class SwitchCleanUpCore extends AbstractCleanUp { public SwitchCleanUpCore(final Map options) { super(options); } diff --git a/org.eclipse.jdt.core.manipulation/common/org/eclipse/jdt/internal/ui/fix/SwitchExpressionsCleanUpCore.java b/org.eclipse.jdt.core.manipulation/common/org/eclipse/jdt/internal/ui/fix/SwitchExpressionsCleanUpCore.java index b97a422efed..ef2473921c2 100644 --- a/org.eclipse.jdt.core.manipulation/common/org/eclipse/jdt/internal/ui/fix/SwitchExpressionsCleanUpCore.java +++ b/org.eclipse.jdt.core.manipulation/common/org/eclipse/jdt/internal/ui/fix/SwitchExpressionsCleanUpCore.java @@ -29,7 +29,7 @@ import org.eclipse.jdt.ui.cleanup.CleanUpRequirements; import org.eclipse.jdt.ui.cleanup.ICleanUpFix; -public class SwitchExpressionsCleanUpCore extends AbstractCleanUpCore { +public class SwitchExpressionsCleanUpCore extends AbstractCleanUp { public SwitchExpressionsCleanUpCore(Map options) { super(options); } diff --git a/org.eclipse.jdt.core.manipulation/common/org/eclipse/jdt/internal/ui/fix/UnnecessaryCodeCleanUpCore.java b/org.eclipse.jdt.core.manipulation/common/org/eclipse/jdt/internal/ui/fix/UnnecessaryCodeCleanUpCore.java index 43b77b9f4ab..a1c7a99b2ce 100644 --- a/org.eclipse.jdt.core.manipulation/common/org/eclipse/jdt/internal/ui/fix/UnnecessaryCodeCleanUpCore.java +++ b/org.eclipse.jdt.core.manipulation/common/org/eclipse/jdt/internal/ui/fix/UnnecessaryCodeCleanUpCore.java @@ -33,7 +33,7 @@ import org.eclipse.jdt.ui.cleanup.ICleanUpFix; import org.eclipse.jdt.ui.text.java.IProblemLocation; -public class UnnecessaryCodeCleanUpCore extends AbstractMultiFixCore { +public class UnnecessaryCodeCleanUpCore extends AbstractMultiFix { public UnnecessaryCodeCleanUpCore(Map options) { super(options); diff --git a/org.eclipse.jdt.core.manipulation/common/org/eclipse/jdt/internal/ui/fix/UnusedCodeCleanUpCore.java b/org.eclipse.jdt.core.manipulation/common/org/eclipse/jdt/internal/ui/fix/UnusedCodeCleanUpCore.java index 9dc29111ff1..a896171951f 100644 --- a/org.eclipse.jdt.core.manipulation/common/org/eclipse/jdt/internal/ui/fix/UnusedCodeCleanUpCore.java +++ b/org.eclipse.jdt.core.manipulation/common/org/eclipse/jdt/internal/ui/fix/UnusedCodeCleanUpCore.java @@ -38,7 +38,7 @@ * Create fixes which can remove unused code * see org.eclipse.jdt.internal.corext.fix.UnusedCodeFix */ -public class UnusedCodeCleanUpCore extends AbstractMultiFixCore { +public class UnusedCodeCleanUpCore extends AbstractMultiFix { public UnusedCodeCleanUpCore(Map options) { super(options); diff --git a/org.eclipse.jdt.core.manipulation/common/org/eclipse/jdt/internal/ui/fix/ValueOfRatherThanInstantiationCleanUpCore.java b/org.eclipse.jdt.core.manipulation/common/org/eclipse/jdt/internal/ui/fix/ValueOfRatherThanInstantiationCleanUpCore.java index 8da7b3f3497..f6406648789 100644 --- a/org.eclipse.jdt.core.manipulation/common/org/eclipse/jdt/internal/ui/fix/ValueOfRatherThanInstantiationCleanUpCore.java +++ b/org.eclipse.jdt.core.manipulation/common/org/eclipse/jdt/internal/ui/fix/ValueOfRatherThanInstantiationCleanUpCore.java @@ -28,7 +28,7 @@ import org.eclipse.jdt.ui.cleanup.CleanUpRequirements; import org.eclipse.jdt.ui.cleanup.ICleanUpFix; -public class ValueOfRatherThanInstantiationCleanUpCore extends AbstractCleanUpCore { +public class ValueOfRatherThanInstantiationCleanUpCore extends AbstractCleanUp { public ValueOfRatherThanInstantiationCleanUpCore(final Map options) { super(options); } diff --git a/org.eclipse.jdt.core.manipulation/common/org/eclipse/jdt/internal/ui/fix/VarCleanUpCore.java b/org.eclipse.jdt.core.manipulation/common/org/eclipse/jdt/internal/ui/fix/VarCleanUpCore.java index 3b770c2b9bb..2acfe405b1c 100644 --- a/org.eclipse.jdt.core.manipulation/common/org/eclipse/jdt/internal/ui/fix/VarCleanUpCore.java +++ b/org.eclipse.jdt.core.manipulation/common/org/eclipse/jdt/internal/ui/fix/VarCleanUpCore.java @@ -72,7 +72,7 @@ * using the var keyword. * */ -public class VarCleanUpCore extends AbstractMultiFixCore { +public class VarCleanUpCore extends AbstractMultiFix { public VarCleanUpCore() { this(Collections.emptyMap()); } diff --git a/org.eclipse.jdt.core.manipulation/common/org/eclipse/jdt/internal/ui/fix/VariableDeclarationCleanUpCore.java b/org.eclipse.jdt.core.manipulation/common/org/eclipse/jdt/internal/ui/fix/VariableDeclarationCleanUpCore.java index ba9730fb94e..a0c2bcefada 100644 --- a/org.eclipse.jdt.core.manipulation/common/org/eclipse/jdt/internal/ui/fix/VariableDeclarationCleanUpCore.java +++ b/org.eclipse.jdt.core.manipulation/common/org/eclipse/jdt/internal/ui/fix/VariableDeclarationCleanUpCore.java @@ -29,7 +29,7 @@ import org.eclipse.jdt.ui.cleanup.CleanUpRequirements; import org.eclipse.jdt.ui.cleanup.ICleanUpFix; -public class VariableDeclarationCleanUpCore extends AbstractCleanUpCore { +public class VariableDeclarationCleanUpCore extends AbstractCleanUp { public VariableDeclarationCleanUpCore(Map options) { super(options); diff --git a/org.eclipse.jdt.core.manipulation/core extension/org/eclipse/jdt/internal/ui/fix/UseIteratorToForLoopCleanUpCore.java b/org.eclipse.jdt.core.manipulation/core extension/org/eclipse/jdt/internal/ui/fix/UseIteratorToForLoopCleanUpCore.java index 92fb59a82e4..427f5f54c63 100644 --- a/org.eclipse.jdt.core.manipulation/core extension/org/eclipse/jdt/internal/ui/fix/UseIteratorToForLoopCleanUpCore.java +++ b/org.eclipse.jdt.core.manipulation/core extension/org/eclipse/jdt/internal/ui/fix/UseIteratorToForLoopCleanUpCore.java @@ -39,7 +39,7 @@ import org.eclipse.jdt.ui.cleanup.CleanUpRequirements; import org.eclipse.jdt.ui.cleanup.ICleanUpFix; -public class UseIteratorToForLoopCleanUpCore extends AbstractCleanUpCore { +public class UseIteratorToForLoopCleanUpCore extends AbstractCleanUp { public UseIteratorToForLoopCleanUpCore(final Map options) { super(options); } diff --git a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/CleanUpTest.java b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/CleanUpTest.java index 03ad3e3ec92..cf99a4ae96a 100644 --- a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/CleanUpTest.java +++ b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/CleanUpTest.java @@ -31,9 +31,20 @@ import java.util.Hashtable; import java.util.Map; +import org.junit.Before; +import org.junit.Rule; +import org.junit.Test; + +import org.eclipse.jdt.testplugin.JavaProjectHelper; +import org.eclipse.jdt.testplugin.TestOptions; + import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IPath; import org.eclipse.core.runtime.Path; + +import org.eclipse.ltk.core.refactoring.RefactoringStatus; +import org.eclipse.ltk.core.refactoring.RefactoringStatusEntry; + import org.eclipse.jdt.core.IClasspathEntry; import org.eclipse.jdt.core.ICompilationUnit; import org.eclipse.jdt.core.IJavaProject; @@ -47,14 +58,22 @@ import org.eclipse.jdt.core.dom.CompilationUnit; import org.eclipse.jdt.core.formatter.DefaultCodeFormatterConstants; import org.eclipse.jdt.core.manipulation.CleanUpOptionsCore; + import org.eclipse.jdt.internal.corext.dom.IASTSharedValues; import org.eclipse.jdt.internal.corext.fix.CleanUpConstants; import org.eclipse.jdt.internal.corext.fix.FixMessages; import org.eclipse.jdt.internal.corext.fix.UpdateProperty; import org.eclipse.jdt.internal.corext.refactoring.util.RefactoringASTParser; import org.eclipse.jdt.internal.corext.util.Messages; + +import org.eclipse.jdt.ui.PreferenceConstants; +import org.eclipse.jdt.ui.cleanup.CleanUpOptions; +import org.eclipse.jdt.ui.cleanup.ICleanUpFix; +import org.eclipse.jdt.ui.tests.core.rules.Java13ProjectTestSetup; +import org.eclipse.jdt.ui.tests.core.rules.ProjectTestSetup; + import org.eclipse.jdt.internal.ui.JavaPlugin; -import org.eclipse.jdt.internal.ui.fix.AbstractCleanUpCore; +import org.eclipse.jdt.internal.ui.fix.AbstractCleanUp; import org.eclipse.jdt.internal.ui.fix.Java50CleanUp; import org.eclipse.jdt.internal.ui.fix.MultiFixMessages; import org.eclipse.jdt.internal.ui.fix.PlainReplacementCleanUpCore; @@ -62,18 +81,6 @@ import org.eclipse.jdt.internal.ui.fix.RedundantModifiersCleanUp; import org.eclipse.jdt.internal.ui.fix.UnimplementedCodeCleanUp; import org.eclipse.jdt.internal.ui.text.correction.ProblemLocation; -import org.eclipse.jdt.testplugin.JavaProjectHelper; -import org.eclipse.jdt.testplugin.TestOptions; -import org.eclipse.jdt.ui.PreferenceConstants; -import org.eclipse.jdt.ui.cleanup.CleanUpOptions; -import org.eclipse.jdt.ui.cleanup.ICleanUpFix; -import org.eclipse.jdt.ui.tests.core.rules.Java13ProjectTestSetup; -import org.eclipse.jdt.ui.tests.core.rules.ProjectTestSetup; -import org.eclipse.ltk.core.refactoring.RefactoringStatus; -import org.eclipse.ltk.core.refactoring.RefactoringStatusEntry; -import org.junit.Before; -import org.junit.Rule; -import org.junit.Test; public class CleanUpTest extends CleanUpTestCase { @Rule @@ -10597,16 +10604,16 @@ public void testPrimitiveRatherThanWrapperPreview() throws Exception { String previewFooter= "" // + " }\n" // + "}\n"; - AbstractCleanUpCore cleanUp= new PrimitiveRatherThanWrapperCleanUpCore() { + AbstractCleanUp cleanUp= new PrimitiveRatherThanWrapperCleanUpCore() { @Override - protected boolean isEnabled(String key) { + public boolean isEnabled(String key) { return false; } }; String given= previewHeader + cleanUp.getPreview() + previewFooter; cleanUp= new PrimitiveRatherThanWrapperCleanUpCore() { @Override - protected boolean isEnabled(String key) { + public boolean isEnabled(String key) { return true; } }; @@ -23816,16 +23823,16 @@ public void testPlainReplacementPreview() throws Exception { String previewFooter= "" // + " }\n" // + "}\n"; - AbstractCleanUpCore cleanUp= new PlainReplacementCleanUpCore() { + AbstractCleanUp cleanUp= new PlainReplacementCleanUpCore() { @Override - protected boolean isEnabled(String key) { + public boolean isEnabled(String key) { return false; } }; String given= previewHeader + cleanUp.getPreview() + previewFooter; cleanUp= new PlainReplacementCleanUpCore() { @Override - protected boolean isEnabled(String key) { + public boolean isEnabled(String key) { return true; } }; diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/fix/NoStringCreationCleanUp.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/fix/NoStringCreationCleanUp.java index d612d7888e0..66a059bf0f3 100644 --- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/fix/NoStringCreationCleanUp.java +++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/fix/NoStringCreationCleanUp.java @@ -10,7 +10,7 @@ * * Contributors: * Fabrice TIERCELIN - initial API and implementation - * Red Hat Inc. - use AbstractCleanUpCoreWrapper to access core cleanup + * Red Hat Inc. - use AbstractCleanUpWrapper to access core cleanup *******************************************************************************/ package org.eclipse.jdt.internal.ui.fix;