From f592993d9fe3dd337cccda59899b8b924309d292 Mon Sep 17 00:00:00 2001 From: Roland Grunberg Date: Thu, 12 Sep 2024 15:53:00 -0400 Subject: [PATCH] Migrate away from deprecated ICleanUpFixCore & CleanUpContextCore. - Use ICleanUpFix & CleanUpContext Signed-off-by: Roland Grunberg --- .../cleanup/AddDeprecatedAnnotationCleanUp.java | 6 +++--- .../cleanup/AddOverrideAnnotationCleanUp.java | 6 +++--- .../ls/core/internal/cleanup/CleanUpRegistry.java | 4 ++-- .../jdt/ls/core/internal/cleanup/CleanUpUtils.java | 14 +++++++------- .../ls/core/internal/cleanup/ISimpleCleanUp.java | 6 +++--- .../internal/cleanup/InstanceofPatternMatch.java | 6 +++--- .../core/internal/cleanup/InvertEqualsCleanUp.java | 6 +++--- .../LambdaExpressionAndMethodRefCleanUp.java | 6 +++--- .../internal/cleanup/LambdaExpressionCleanup.java | 6 +++--- .../cleanup/MemberAccessUsesThisCleanUp.java | 6 +++--- .../cleanup/StaticAccessUsesClassNameCleanUp.java | 6 +++--- .../cleanup/StringConcatToTextBlockCleanUp.java | 6 +++--- .../internal/cleanup/SwitchExpressionCleanup.java | 6 +++--- .../internal/cleanup/TryWithResourceCleanUp.java | 6 +++--- .../cleanup/VariableDeclarationFixCleanup.java | 6 +++--- .../proposals/ReorgCorrectionsSubProcessor.java | 4 ++-- 16 files changed, 50 insertions(+), 50 deletions(-) diff --git a/org.eclipse.jdt.ls.core/src/org/eclipse/jdt/ls/core/internal/cleanup/AddDeprecatedAnnotationCleanUp.java b/org.eclipse.jdt.ls.core/src/org/eclipse/jdt/ls/core/internal/cleanup/AddDeprecatedAnnotationCleanUp.java index 4c0d848fdf..458e549f48 100644 --- a/org.eclipse.jdt.ls.core/src/org/eclipse/jdt/ls/core/internal/cleanup/AddDeprecatedAnnotationCleanUp.java +++ b/org.eclipse.jdt.ls.core/src/org/eclipse/jdt/ls/core/internal/cleanup/AddDeprecatedAnnotationCleanUp.java @@ -17,10 +17,10 @@ import java.util.List; import org.eclipse.jdt.core.JavaCore; -import org.eclipse.jdt.core.manipulation.CleanUpContextCore; -import org.eclipse.jdt.core.manipulation.ICleanUpFixCore; import org.eclipse.jdt.internal.corext.fix.CleanUpConstants; import org.eclipse.jdt.internal.corext.fix.Java50FixCore; +import org.eclipse.jdt.ui.cleanup.CleanUpContext; +import org.eclipse.jdt.ui.cleanup.ICleanUpFix; /** * A cleanup that adds the deprecated annotation to classes/fields/methods that @@ -36,7 +36,7 @@ public Collection getIdentifiers() { } @Override - public ICleanUpFixCore createFix(CleanUpContextCore context) { + public ICleanUpFix createFix(CleanUpContext context) { return Java50FixCore.createCleanUp(context.getAST(), false, false, true, false); } diff --git a/org.eclipse.jdt.ls.core/src/org/eclipse/jdt/ls/core/internal/cleanup/AddOverrideAnnotationCleanUp.java b/org.eclipse.jdt.ls.core/src/org/eclipse/jdt/ls/core/internal/cleanup/AddOverrideAnnotationCleanUp.java index 7845140393..67d6c36dee 100644 --- a/org.eclipse.jdt.ls.core/src/org/eclipse/jdt/ls/core/internal/cleanup/AddOverrideAnnotationCleanUp.java +++ b/org.eclipse.jdt.ls.core/src/org/eclipse/jdt/ls/core/internal/cleanup/AddOverrideAnnotationCleanUp.java @@ -17,10 +17,10 @@ import java.util.List; import org.eclipse.jdt.core.JavaCore; -import org.eclipse.jdt.core.manipulation.CleanUpContextCore; -import org.eclipse.jdt.core.manipulation.ICleanUpFixCore; import org.eclipse.jdt.internal.corext.fix.CleanUpConstants; import org.eclipse.jdt.internal.corext.fix.Java50FixCore; +import org.eclipse.jdt.ui.cleanup.CleanUpContext; +import org.eclipse.jdt.ui.cleanup.ICleanUpFix; /** * A cleanup that adds the override annotation to all methods that override any @@ -36,7 +36,7 @@ public Collection getIdentifiers() { } @Override - public ICleanUpFixCore createFix(CleanUpContextCore context) { + public ICleanUpFix createFix(CleanUpContext context) { return Java50FixCore.createCleanUp(context.getAST(), true, true, false, false); } diff --git a/org.eclipse.jdt.ls.core/src/org/eclipse/jdt/ls/core/internal/cleanup/CleanUpRegistry.java b/org.eclipse.jdt.ls.core/src/org/eclipse/jdt/ls/core/internal/cleanup/CleanUpRegistry.java index 1f3216fb31..aad72c7679 100644 --- a/org.eclipse.jdt.ls.core/src/org/eclipse/jdt/ls/core/internal/cleanup/CleanUpRegistry.java +++ b/org.eclipse.jdt.ls.core/src/org/eclipse/jdt/ls/core/internal/cleanup/CleanUpRegistry.java @@ -27,9 +27,9 @@ import org.eclipse.jdt.core.IJavaProject; import org.eclipse.jdt.core.JavaCore; import org.eclipse.jdt.core.JavaModelException; -import org.eclipse.jdt.core.manipulation.CleanUpContextCore; import org.eclipse.jdt.ls.core.internal.JDTUtils; import org.eclipse.jdt.ls.core.internal.JavaLanguageServerPlugin; +import org.eclipse.jdt.ui.cleanup.CleanUpContext; import org.eclipse.lsp4j.TextDocumentIdentifier; import org.eclipse.lsp4j.TextEdit; @@ -111,7 +111,7 @@ public List getEditsForAllActiveCleanUps(TextDocumentIdentifier textDo } // build the context after setting the compiler options so that the built AST has all the required markers - CleanUpContextCore context = CleanUpUtils.getCleanUpContext(textDocumentId, opts, monitor); + CleanUpContext context = CleanUpUtils.getCleanUpContext(textDocumentId, opts, monitor); List textEdits = new ArrayList<>(); ICompilationUnit cu = context.getCompilationUnit(); diff --git a/org.eclipse.jdt.ls.core/src/org/eclipse/jdt/ls/core/internal/cleanup/CleanUpUtils.java b/org.eclipse.jdt.ls.core/src/org/eclipse/jdt/ls/core/internal/cleanup/CleanUpUtils.java index 107d5b3f75..a5b6bdfd2d 100644 --- a/org.eclipse.jdt.ls.core/src/org/eclipse/jdt/ls/core/internal/cleanup/CleanUpUtils.java +++ b/org.eclipse.jdt.ls.core/src/org/eclipse/jdt/ls/core/internal/cleanup/CleanUpUtils.java @@ -19,12 +19,12 @@ import org.eclipse.jdt.core.ICompilationUnit; import org.eclipse.jdt.core.dom.ASTParser; import org.eclipse.jdt.core.dom.CompilationUnit; -import org.eclipse.jdt.core.manipulation.CleanUpContextCore; -import org.eclipse.jdt.core.manipulation.ICleanUpFixCore; import org.eclipse.jdt.core.refactoring.CompilationUnitChange; import org.eclipse.jdt.internal.corext.dom.IASTSharedValues; import org.eclipse.jdt.ls.core.internal.JDTUtils; import org.eclipse.jdt.ls.core.internal.JavaLanguageServerPlugin; +import org.eclipse.jdt.ui.cleanup.CleanUpContext; +import org.eclipse.jdt.ui.cleanup.ICleanUpFix; import org.eclipse.lsp4j.TextDocumentIdentifier; import org.eclipse.text.edits.TextEdit; @@ -44,14 +44,14 @@ public class CleanUpUtils { * the progress monitor * @return the clean up context for the given text document */ - public static CleanUpContextCore getCleanUpContext(TextDocumentIdentifier textDocumentId, Map compilerOpts, IProgressMonitor monitor) { + public static CleanUpContext getCleanUpContext(TextDocumentIdentifier textDocumentId, Map compilerOpts, IProgressMonitor monitor) { ICompilationUnit unit = JDTUtils.resolveCompilationUnit(textDocumentId.getUri()); return getCleanUpContext(unit, compilerOpts, monitor); } - public static CleanUpContextCore getCleanUpContext(ICompilationUnit unit, Map compilerOpts, IProgressMonitor monitor) { + public static CleanUpContext getCleanUpContext(ICompilationUnit unit, Map compilerOpts, IProgressMonitor monitor) { CompilationUnit ast = createASTWithOpts(unit, compilerOpts, monitor); - return new CleanUpContextCore(unit, ast); + return new CleanUpContext(unit, ast); } /** @@ -65,10 +65,10 @@ public static CleanUpContextCore getCleanUpContext(ICompilationUnit unit, Map getIdentifiers() { } @Override - public ICleanUpFixCore createFix(CleanUpContextCore context) throws CoreException { + public ICleanUpFix createFix(CleanUpContext context) throws CoreException { CompilationUnit unit = context.getAST(); if (unit == null) { return null; diff --git a/org.eclipse.jdt.ls.core/src/org/eclipse/jdt/ls/core/internal/cleanup/InvertEqualsCleanUp.java b/org.eclipse.jdt.ls.core/src/org/eclipse/jdt/ls/core/internal/cleanup/InvertEqualsCleanUp.java index 492cb9d460..40beb4ceeb 100644 --- a/org.eclipse.jdt.ls.core/src/org/eclipse/jdt/ls/core/internal/cleanup/InvertEqualsCleanUp.java +++ b/org.eclipse.jdt.ls.core/src/org/eclipse/jdt/ls/core/internal/cleanup/InvertEqualsCleanUp.java @@ -17,10 +17,10 @@ import org.eclipse.core.runtime.CoreException; import org.eclipse.jdt.core.dom.CompilationUnit; -import org.eclipse.jdt.core.manipulation.CleanUpContextCore; -import org.eclipse.jdt.core.manipulation.ICleanUpFixCore; import org.eclipse.jdt.internal.corext.fix.CleanUpConstants; import org.eclipse.jdt.internal.corext.fix.InvertEqualsFixCore; +import org.eclipse.jdt.ui.cleanup.CleanUpContext; +import org.eclipse.jdt.ui.cleanup.ICleanUpFix; /** * Represents a clean up that inverts calls to Object.equals(Object) and @@ -34,7 +34,7 @@ public List getIdentifiers() { } @Override - public ICleanUpFixCore createFix(CleanUpContextCore context) throws CoreException { + public ICleanUpFix createFix(CleanUpContext context) throws CoreException { CompilationUnit unit = context.getAST(); if (unit == null) { return null; diff --git a/org.eclipse.jdt.ls.core/src/org/eclipse/jdt/ls/core/internal/cleanup/LambdaExpressionAndMethodRefCleanUp.java b/org.eclipse.jdt.ls.core/src/org/eclipse/jdt/ls/core/internal/cleanup/LambdaExpressionAndMethodRefCleanUp.java index dc188ad67c..1b26e698ba 100644 --- a/org.eclipse.jdt.ls.core/src/org/eclipse/jdt/ls/core/internal/cleanup/LambdaExpressionAndMethodRefCleanUp.java +++ b/org.eclipse.jdt.ls.core/src/org/eclipse/jdt/ls/core/internal/cleanup/LambdaExpressionAndMethodRefCleanUp.java @@ -18,10 +18,10 @@ import org.eclipse.core.runtime.CoreException; import org.eclipse.jdt.core.dom.CompilationUnit; -import org.eclipse.jdt.core.manipulation.CleanUpContextCore; -import org.eclipse.jdt.core.manipulation.ICleanUpFixCore; import org.eclipse.jdt.internal.corext.fix.CleanUpConstants; import org.eclipse.jdt.internal.corext.fix.LambdaExpressionAndMethodRefFixCore; +import org.eclipse.jdt.ui.cleanup.CleanUpContext; +import org.eclipse.jdt.ui.cleanup.ICleanUpFix; /** * Represents a cleanup that does several actions to clean up lambda expression @@ -34,7 +34,7 @@ public Collection getIdentifiers() { } @Override - public ICleanUpFixCore createFix(CleanUpContextCore context) throws CoreException { + public ICleanUpFix createFix(CleanUpContext context) throws CoreException { CompilationUnit unit = context.getAST(); if (unit == null) { return null; diff --git a/org.eclipse.jdt.ls.core/src/org/eclipse/jdt/ls/core/internal/cleanup/LambdaExpressionCleanup.java b/org.eclipse.jdt.ls.core/src/org/eclipse/jdt/ls/core/internal/cleanup/LambdaExpressionCleanup.java index 6ede52dc1a..c87bf51150 100644 --- a/org.eclipse.jdt.ls.core/src/org/eclipse/jdt/ls/core/internal/cleanup/LambdaExpressionCleanup.java +++ b/org.eclipse.jdt.ls.core/src/org/eclipse/jdt/ls/core/internal/cleanup/LambdaExpressionCleanup.java @@ -18,10 +18,10 @@ import org.eclipse.core.runtime.CoreException; import org.eclipse.jdt.core.dom.CompilationUnit; -import org.eclipse.jdt.core.manipulation.CleanUpContextCore; -import org.eclipse.jdt.core.manipulation.ICleanUpFixCore; import org.eclipse.jdt.internal.corext.fix.CleanUpConstants; import org.eclipse.jdt.internal.corext.fix.LambdaExpressionsFixCore; +import org.eclipse.jdt.ui.cleanup.CleanUpContext; +import org.eclipse.jdt.ui.cleanup.ICleanUpFix; /** * Represents a cleanup that converts an anonymous class creation to a lambda expression @@ -34,7 +34,7 @@ public Collection getIdentifiers() { } @Override - public ICleanUpFixCore createFix(CleanUpContextCore context) throws CoreException { + public ICleanUpFix createFix(CleanUpContext context) throws CoreException { CompilationUnit unit = context.getAST(); if (unit == null) { return null; diff --git a/org.eclipse.jdt.ls.core/src/org/eclipse/jdt/ls/core/internal/cleanup/MemberAccessUsesThisCleanUp.java b/org.eclipse.jdt.ls.core/src/org/eclipse/jdt/ls/core/internal/cleanup/MemberAccessUsesThisCleanUp.java index 82e56452dd..083a6d4716 100644 --- a/org.eclipse.jdt.ls.core/src/org/eclipse/jdt/ls/core/internal/cleanup/MemberAccessUsesThisCleanUp.java +++ b/org.eclipse.jdt.ls.core/src/org/eclipse/jdt/ls/core/internal/cleanup/MemberAccessUsesThisCleanUp.java @@ -18,9 +18,9 @@ import org.eclipse.core.runtime.CoreException; import org.eclipse.jdt.core.dom.CompilationUnit; -import org.eclipse.jdt.core.manipulation.CleanUpContextCore; -import org.eclipse.jdt.core.manipulation.ICleanUpFixCore; import org.eclipse.jdt.internal.corext.fix.CodeStyleFixCore; +import org.eclipse.jdt.ui.cleanup.CleanUpContext; +import org.eclipse.jdt.ui.cleanup.ICleanUpFix; /** * Represents a clean up that prefixes all (non-static) field and method @@ -34,7 +34,7 @@ public Collection getIdentifiers() { } @Override - public ICleanUpFixCore createFix(CleanUpContextCore context) throws CoreException { + public ICleanUpFix createFix(CleanUpContext context) throws CoreException { CompilationUnit unit = context.getAST(); if (unit == null) { return null; diff --git a/org.eclipse.jdt.ls.core/src/org/eclipse/jdt/ls/core/internal/cleanup/StaticAccessUsesClassNameCleanUp.java b/org.eclipse.jdt.ls.core/src/org/eclipse/jdt/ls/core/internal/cleanup/StaticAccessUsesClassNameCleanUp.java index 8bb81a37a4..2bc71686e3 100644 --- a/org.eclipse.jdt.ls.core/src/org/eclipse/jdt/ls/core/internal/cleanup/StaticAccessUsesClassNameCleanUp.java +++ b/org.eclipse.jdt.ls.core/src/org/eclipse/jdt/ls/core/internal/cleanup/StaticAccessUsesClassNameCleanUp.java @@ -18,9 +18,9 @@ import org.eclipse.core.runtime.CoreException; import org.eclipse.jdt.core.dom.CompilationUnit; -import org.eclipse.jdt.core.manipulation.CleanUpContextCore; -import org.eclipse.jdt.core.manipulation.ICleanUpFixCore; import org.eclipse.jdt.internal.corext.fix.CodeStyleFixCore; +import org.eclipse.jdt.ui.cleanup.CleanUpContext; +import org.eclipse.jdt.ui.cleanup.ICleanUpFix; /** * Represents a clean up that prefixes all static member accesses with the @@ -34,7 +34,7 @@ public Collection getIdentifiers() { } @Override - public ICleanUpFixCore createFix(CleanUpContextCore context) throws CoreException { + public ICleanUpFix createFix(CleanUpContext context) throws CoreException { CompilationUnit unit = context.getAST(); if (unit == null) { return null; diff --git a/org.eclipse.jdt.ls.core/src/org/eclipse/jdt/ls/core/internal/cleanup/StringConcatToTextBlockCleanUp.java b/org.eclipse.jdt.ls.core/src/org/eclipse/jdt/ls/core/internal/cleanup/StringConcatToTextBlockCleanUp.java index 860265af55..9e1e4063a0 100644 --- a/org.eclipse.jdt.ls.core/src/org/eclipse/jdt/ls/core/internal/cleanup/StringConcatToTextBlockCleanUp.java +++ b/org.eclipse.jdt.ls.core/src/org/eclipse/jdt/ls/core/internal/cleanup/StringConcatToTextBlockCleanUp.java @@ -18,10 +18,10 @@ import org.eclipse.core.runtime.CoreException; import org.eclipse.jdt.core.dom.CompilationUnit; -import org.eclipse.jdt.core.manipulation.CleanUpContextCore; -import org.eclipse.jdt.core.manipulation.ICleanUpFixCore; import org.eclipse.jdt.internal.corext.fix.CleanUpConstants; import org.eclipse.jdt.internal.corext.fix.StringConcatToTextBlockFixCore; +import org.eclipse.jdt.ui.cleanup.CleanUpContext; +import org.eclipse.jdt.ui.cleanup.ICleanUpFix; /** * Represents a clean up that converts string concatenaton to Text Blocks @@ -34,7 +34,7 @@ public Collection getIdentifiers() { } @Override - public ICleanUpFixCore createFix(CleanUpContextCore context) throws CoreException { + public ICleanUpFix createFix(CleanUpContext context) throws CoreException { CompilationUnit unit = context.getAST(); if (unit == null) { return null; diff --git a/org.eclipse.jdt.ls.core/src/org/eclipse/jdt/ls/core/internal/cleanup/SwitchExpressionCleanup.java b/org.eclipse.jdt.ls.core/src/org/eclipse/jdt/ls/core/internal/cleanup/SwitchExpressionCleanup.java index 7163e60594..c7fad4e2cd 100644 --- a/org.eclipse.jdt.ls.core/src/org/eclipse/jdt/ls/core/internal/cleanup/SwitchExpressionCleanup.java +++ b/org.eclipse.jdt.ls.core/src/org/eclipse/jdt/ls/core/internal/cleanup/SwitchExpressionCleanup.java @@ -18,10 +18,10 @@ import org.eclipse.core.runtime.CoreException; import org.eclipse.jdt.core.dom.CompilationUnit; -import org.eclipse.jdt.core.manipulation.CleanUpContextCore; -import org.eclipse.jdt.core.manipulation.ICleanUpFixCore; import org.eclipse.jdt.internal.corext.fix.CleanUpConstants; import org.eclipse.jdt.internal.corext.fix.SwitchExpressionsFixCore; +import org.eclipse.jdt.ui.cleanup.CleanUpContext; +import org.eclipse.jdt.ui.cleanup.ICleanUpFix; /** * Represents a cleanup that converts a switch statement to a switch expression @@ -34,7 +34,7 @@ public Collection getIdentifiers() { } @Override - public ICleanUpFixCore createFix(CleanUpContextCore context) throws CoreException { + public ICleanUpFix createFix(CleanUpContext context) throws CoreException { CompilationUnit unit = context.getAST(); if (unit == null) { return null; diff --git a/org.eclipse.jdt.ls.core/src/org/eclipse/jdt/ls/core/internal/cleanup/TryWithResourceCleanUp.java b/org.eclipse.jdt.ls.core/src/org/eclipse/jdt/ls/core/internal/cleanup/TryWithResourceCleanUp.java index 9f88745a48..1250df7024 100644 --- a/org.eclipse.jdt.ls.core/src/org/eclipse/jdt/ls/core/internal/cleanup/TryWithResourceCleanUp.java +++ b/org.eclipse.jdt.ls.core/src/org/eclipse/jdt/ls/core/internal/cleanup/TryWithResourceCleanUp.java @@ -18,10 +18,10 @@ import org.eclipse.core.runtime.CoreException; import org.eclipse.jdt.core.dom.CompilationUnit; -import org.eclipse.jdt.core.manipulation.CleanUpContextCore; -import org.eclipse.jdt.core.manipulation.ICleanUpFixCore; import org.eclipse.jdt.internal.corext.fix.CleanUpConstants; import org.eclipse.jdt.internal.corext.fix.TryWithResourceFixCore; +import org.eclipse.jdt.ui.cleanup.CleanUpContext; +import org.eclipse.jdt.ui.cleanup.ICleanUpFix; /** * Represents a clean up that simplifies the finally block to using a @@ -35,7 +35,7 @@ public Collection getIdentifiers() { } @Override - public ICleanUpFixCore createFix(CleanUpContextCore context) throws CoreException { + public ICleanUpFix createFix(CleanUpContext context) throws CoreException { CompilationUnit unit = context.getAST(); if (unit == null) { return null; diff --git a/org.eclipse.jdt.ls.core/src/org/eclipse/jdt/ls/core/internal/cleanup/VariableDeclarationFixCleanup.java b/org.eclipse.jdt.ls.core/src/org/eclipse/jdt/ls/core/internal/cleanup/VariableDeclarationFixCleanup.java index cc06dd7b5d..b2e2fe3012 100644 --- a/org.eclipse.jdt.ls.core/src/org/eclipse/jdt/ls/core/internal/cleanup/VariableDeclarationFixCleanup.java +++ b/org.eclipse.jdt.ls.core/src/org/eclipse/jdt/ls/core/internal/cleanup/VariableDeclarationFixCleanup.java @@ -18,10 +18,10 @@ import org.eclipse.core.runtime.CoreException; import org.eclipse.jdt.core.dom.CompilationUnit; -import org.eclipse.jdt.core.manipulation.CleanUpContextCore; -import org.eclipse.jdt.core.manipulation.ICleanUpFixCore; import org.eclipse.jdt.internal.corext.fix.CleanUpConstants; import org.eclipse.jdt.internal.corext.fix.VariableDeclarationFixCore; +import org.eclipse.jdt.ui.cleanup.CleanUpContext; +import org.eclipse.jdt.ui.cleanup.ICleanUpFix; /** * Represents a cleanup that adds the 'final' modifier where possible @@ -34,7 +34,7 @@ public Collection getIdentifiers() { } @Override - public ICleanUpFixCore createFix(CleanUpContextCore context) throws CoreException { + public ICleanUpFix createFix(CleanUpContext context) throws CoreException { CompilationUnit unit = context.getAST(); if (unit == null) { return null; diff --git a/org.eclipse.jdt.ls.core/src/org/eclipse/jdt/ls/core/internal/corrections/proposals/ReorgCorrectionsSubProcessor.java b/org.eclipse.jdt.ls.core/src/org/eclipse/jdt/ls/core/internal/corrections/proposals/ReorgCorrectionsSubProcessor.java index c3d991e537..968fa07366 100644 --- a/org.eclipse.jdt.ls.core/src/org/eclipse/jdt/ls/core/internal/corrections/proposals/ReorgCorrectionsSubProcessor.java +++ b/org.eclipse.jdt.ls.core/src/org/eclipse/jdt/ls/core/internal/corrections/proposals/ReorgCorrectionsSubProcessor.java @@ -24,7 +24,6 @@ import org.eclipse.jdt.core.dom.IBinding; import org.eclipse.jdt.core.manipulation.CUCorrectionProposalCore; import org.eclipse.jdt.core.manipulation.ChangeCorrectionProposalCore; -import org.eclipse.jdt.core.manipulation.ICleanUpFixCore; import org.eclipse.jdt.core.refactoring.CompilationUnitChange; import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; import org.eclipse.jdt.internal.corext.fix.IProposableFix; @@ -41,6 +40,7 @@ import org.eclipse.jdt.ls.core.internal.corrections.CorrectionMessages; import org.eclipse.jdt.ls.core.internal.corrections.ProposalKindWrapper; import org.eclipse.jdt.ls.core.internal.handlers.CodeActionHandler; +import org.eclipse.jdt.ui.cleanup.ICleanUpFix; import org.eclipse.jdt.ui.text.java.IInvocationContext; import org.eclipse.jdt.ui.text.java.IProblemLocation; import org.eclipse.lsp4j.CodeActionKind; @@ -112,7 +112,7 @@ protected ProposalKindWrapper createOrganizeImportsProposal(String name, Change @Override public void addRemoveImportStatementProposals(IInvocationContext context, IProblemLocation problem, Collection proposals) { super.addRemoveImportStatementProposals(context, problem, proposals); - ICleanUpFixCore removeAllUnusedImportsFix = UnusedCodeFixCore.createCleanUp(context.getASTRoot(), false, false, false, false, false, true, false, false); + ICleanUpFix removeAllUnusedImportsFix = UnusedCodeFixCore.createCleanUp(context.getASTRoot(), false, false, false, false, false, true, false, false); if (removeAllUnusedImportsFix != null) { try { CompilationUnitChange change = removeAllUnusedImportsFix.createChange(null);