94
94
import org .eclipse .jdt .internal .ui .fix .AbstractCleanUpCore ;
95
95
import org .eclipse .jdt .internal .ui .fix .LambdaExpressionsCleanUpCore ;
96
96
import org .eclipse .jdt .internal .ui .fix .MultiFixMessages ;
97
- import org .eclipse .jdt .internal . ui .text .correction . IInvocationContextCore ;
98
- import org .eclipse .jdt .internal . ui .text .correction . IProblemLocationCore ;
97
+ import org .eclipse .jdt .ui .text .java . IInvocationContext ;
98
+ import org .eclipse .jdt .ui .text .java . IProblemLocation ;
99
99
import org .eclipse .jdt .internal .ui .text .correction .IProposalRelevance ;
100
100
import org .eclipse .jdt .internal .ui .text .correction .proposals .ASTRewriteRemoveImportsCorrectionProposalCore ;
101
101
import org .eclipse .jdt .internal .ui .text .correction .proposals .FixCorrectionProposalCore ;
@@ -125,7 +125,7 @@ public RefactorProcessor(PreferenceManager preferenceManager) {
125
125
this .preferenceManager = preferenceManager ;
126
126
}
127
127
128
- public List <ProposalKindWrapper > getProposals (CodeActionParams params , IInvocationContextCore context , IProblemLocationCore [] locations ) throws CoreException {
128
+ public List <ProposalKindWrapper > getProposals (CodeActionParams params , IInvocationContext context , IProblemLocation [] locations ) throws CoreException {
129
129
ASTNode coveringNode = context .getCoveringNode ();
130
130
if (coveringNode != null ) {
131
131
ArrayList <ProposalKindWrapper > proposals = new ArrayList <>();
@@ -164,7 +164,7 @@ public List<ProposalKindWrapper> getProposals(CodeActionParams params, IInvocati
164
164
return Collections .emptyList ();
165
165
}
166
166
167
- private boolean getIntroduceParameterProposals (CodeActionParams params , IInvocationContextCore context , ASTNode coveringNode , IProblemLocationCore [] locations , ArrayList <ProposalKindWrapper > resultingCollections ) throws CoreException {
167
+ private boolean getIntroduceParameterProposals (CodeActionParams params , IInvocationContext context , ASTNode coveringNode , IProblemLocation [] locations , ArrayList <ProposalKindWrapper > resultingCollections ) throws CoreException {
168
168
if (resultingCollections == null ) {
169
169
return false ;
170
170
}
@@ -176,7 +176,7 @@ private boolean getIntroduceParameterProposals(CodeActionParams params, IInvocat
176
176
return false ;
177
177
}
178
178
179
- private boolean getInverseLocalVariableProposals (CodeActionParams params , IInvocationContextCore context , ASTNode covering , Collection <ProposalKindWrapper > proposals ) {
179
+ private boolean getInverseLocalVariableProposals (CodeActionParams params , IInvocationContext context , ASTNode covering , Collection <ProposalKindWrapper > proposals ) {
180
180
if (proposals == null ) {
181
181
return false ;
182
182
}
@@ -196,7 +196,7 @@ private boolean getInverseLocalVariableProposals(CodeActionParams params, IInvoc
196
196
return true ;
197
197
}
198
198
199
- private boolean getMoveRefactoringProposals (CodeActionParams params , IInvocationContextCore context , ASTNode coveringNode , ArrayList <ProposalKindWrapper > resultingCollections ) {
199
+ private boolean getMoveRefactoringProposals (CodeActionParams params , IInvocationContext context , ASTNode coveringNode , ArrayList <ProposalKindWrapper > resultingCollections ) {
200
200
if (resultingCollections == null ) {
201
201
return false ;
202
202
}
@@ -213,12 +213,12 @@ private boolean getMoveRefactoringProposals(CodeActionParams params, IInvocation
213
213
214
214
}
215
215
216
- static boolean noErrorsAtLocation (IProblemLocationCore [] locations , ASTNode coveringNode ) {
216
+ static boolean noErrorsAtLocation (IProblemLocation [] locations , ASTNode coveringNode ) {
217
217
if (locations != null ) {
218
218
int start = coveringNode .getStartPosition ();
219
219
int length = coveringNode .getLength ();
220
220
for (int i = 0 ; i < locations .length ; i ++) {
221
- IProblemLocationCore location = locations [i ];
221
+ IProblemLocation location = locations [i ];
222
222
if (location .getOffset () > start + length || (location .getOffset () + location .getLength ()) < start ) {
223
223
continue ;
224
224
}
@@ -235,7 +235,7 @@ static boolean noErrorsAtLocation(IProblemLocationCore[] locations, ASTNode cove
235
235
}
236
236
237
237
238
- private boolean getExtractVariableProposal (CodeActionParams params , IInvocationContextCore context , boolean problemsAtLocation , Collection <ProposalKindWrapper > proposals ) throws CoreException {
238
+ private boolean getExtractVariableProposal (CodeActionParams params , IInvocationContext context , boolean problemsAtLocation , Collection <ProposalKindWrapper > proposals ) throws CoreException {
239
239
if (proposals == null ) {
240
240
return false ;
241
241
}
@@ -255,7 +255,7 @@ private boolean getExtractVariableProposal(CodeActionParams params, IInvocationC
255
255
return true ;
256
256
}
257
257
258
- private boolean getAssignToVariableProposals (IInvocationContextCore context , ASTNode node , IProblemLocationCore [] locations , Collection <ProposalKindWrapper > resultingCollections , CodeActionParams params ) {
258
+ private boolean getAssignToVariableProposals (IInvocationContext context , ASTNode node , IProblemLocation [] locations , Collection <ProposalKindWrapper > resultingCollections , CodeActionParams params ) {
259
259
try {
260
260
Map formatterOptions = null ;
261
261
ProposalKindWrapper proposal = RefactorProposalUtility .getAssignVariableProposal (params , context , locations != null && locations .length != 0 , formatterOptions ,
@@ -274,7 +274,7 @@ private boolean getAssignToVariableProposals(IInvocationContextCore context, AST
274
274
return true ;
275
275
}
276
276
277
- private boolean getExtractMethodProposal (CodeActionParams params , IInvocationContextCore context , ASTNode coveringNode , boolean problemsAtLocation , Collection <ProposalKindWrapper > proposals ) throws CoreException {
277
+ private boolean getExtractMethodProposal (CodeActionParams params , IInvocationContext context , ASTNode coveringNode , boolean problemsAtLocation , Collection <ProposalKindWrapper > proposals ) throws CoreException {
278
278
if (proposals == null ) {
279
279
return false ;
280
280
}
@@ -294,7 +294,7 @@ private boolean getExtractMethodProposal(CodeActionParams params, IInvocationCon
294
294
return true ;
295
295
}
296
296
297
- private boolean getExtractFieldProposal (CodeActionParams params , IInvocationContextCore context , boolean problemsAtLocation , Collection <ProposalKindWrapper > proposals ) throws CoreException {
297
+ private boolean getExtractFieldProposal (CodeActionParams params , IInvocationContext context , boolean problemsAtLocation , Collection <ProposalKindWrapper > proposals ) throws CoreException {
298
298
if (proposals == null ) {
299
299
return false ;
300
300
}
@@ -311,7 +311,7 @@ private boolean getExtractFieldProposal(CodeActionParams params, IInvocationCont
311
311
}
312
312
313
313
314
- private boolean getInlineProposal (IInvocationContextCore context , ASTNode node , Collection <ProposalKindWrapper > resultingCollections ) {
314
+ private boolean getInlineProposal (IInvocationContext context , ASTNode node , Collection <ProposalKindWrapper > resultingCollections ) {
315
315
if (resultingCollections == null ) {
316
316
return false ;
317
317
}
@@ -396,7 +396,7 @@ private boolean getInlineProposal(IInvocationContextCore context, ASTNode node,
396
396
}
397
397
398
398
399
- private boolean getConvertAnonymousToNestedProposals (CodeActionParams params , IInvocationContextCore context , ASTNode node , Collection <ProposalKindWrapper > proposals ) throws CoreException {
399
+ private boolean getConvertAnonymousToNestedProposals (CodeActionParams params , IInvocationContext context , ASTNode node , Collection <ProposalKindWrapper > proposals ) throws CoreException {
400
400
if (proposals == null ) {
401
401
return false ;
402
402
}
@@ -416,7 +416,7 @@ private boolean getConvertAnonymousToNestedProposals(CodeActionParams params, II
416
416
return true ;
417
417
}
418
418
419
- public static ProposalKindWrapper getConvertAnonymousToNestedProposal (CodeActionParams params , IInvocationContextCore context , final ASTNode node , boolean returnAsCommand ) throws CoreException {
419
+ public static ProposalKindWrapper getConvertAnonymousToNestedProposal (CodeActionParams params , IInvocationContext context , final ASTNode node , boolean returnAsCommand ) throws CoreException {
420
420
String label = CorrectionMessages .QuickAssistProcessor_convert_anonym_to_nested ;
421
421
ClassInstanceCreation cic = getClassInstanceCreation (node );
422
422
if (cic == null ) {
@@ -478,7 +478,7 @@ private static ClassInstanceCreation getClassInstanceCreation(ASTNode node) {
478
478
}
479
479
}
480
480
481
- private static boolean getConvertAnonymousClassCreationsToLambdaProposals (IInvocationContextCore context , ASTNode covering , Collection <ProposalKindWrapper > resultingCollections ) {
481
+ private static boolean getConvertAnonymousClassCreationsToLambdaProposals (IInvocationContext context , ASTNode covering , Collection <ProposalKindWrapper > resultingCollections ) {
482
482
ClassInstanceCreation cic = getClassInstanceCreation (covering );
483
483
if (cic == null ) {
484
484
return false ;
@@ -501,7 +501,7 @@ private static boolean getConvertAnonymousClassCreationsToLambdaProposals(IInvoc
501
501
return true ;
502
502
}
503
503
504
- private static boolean getConvertLambdaToAnonymousClassCreationsProposals (IInvocationContextCore context , ASTNode covering , Collection <ProposalKindWrapper > resultingCollections ) {
504
+ private static boolean getConvertLambdaToAnonymousClassCreationsProposals (IInvocationContext context , ASTNode covering , Collection <ProposalKindWrapper > resultingCollections ) {
505
505
if (resultingCollections == null ) {
506
506
return true ;
507
507
}
@@ -529,7 +529,7 @@ private static boolean getConvertLambdaToAnonymousClassCreationsProposals(IInvoc
529
529
return true ;
530
530
}
531
531
532
- private static boolean getConvertVarTypeToResolvedTypeProposal (IInvocationContextCore context , ASTNode node , Collection <ProposalKindWrapper > proposals ) {
532
+ private static boolean getConvertVarTypeToResolvedTypeProposal (IInvocationContext context , ASTNode node , Collection <ProposalKindWrapper > proposals ) {
533
533
CompilationUnit astRoot = context .getASTRoot ();
534
534
IJavaElement root = astRoot .getJavaElement ();
535
535
if (root == null ) {
@@ -607,7 +607,7 @@ private static SimpleName getSimpleNameForVariable(ASTNode node) {
607
607
return name ;
608
608
}
609
609
610
- private static boolean getConvertResolvedTypeToVarTypeProposal (IInvocationContextCore context , ASTNode node , Collection <ProposalKindWrapper > proposals ) {
610
+ private static boolean getConvertResolvedTypeToVarTypeProposal (IInvocationContext context , ASTNode node , Collection <ProposalKindWrapper > proposals ) {
611
611
CompilationUnit astRoot = context .getASTRoot ();
612
612
IJavaElement root = astRoot .getJavaElement ();
613
613
if (root == null ) {
@@ -722,7 +722,7 @@ private static boolean getConvertResolvedTypeToVarTypeProposal(IInvocationContex
722
722
* @return {@code true} if the operation could or has been performed,
723
723
* {@code false otherwise}
724
724
*/
725
- private static boolean getAddStaticImportProposals (IInvocationContextCore context , ASTNode node , Collection <ProposalKindWrapper > proposals ) {
725
+ private static boolean getAddStaticImportProposals (IInvocationContext context , ASTNode node , Collection <ProposalKindWrapper > proposals ) {
726
726
if (!(node instanceof SimpleName )) {
727
727
return false ;
728
728
}
@@ -894,7 +894,7 @@ private static boolean isDirectlyAccessible(ASTNode nameNode, ITypeBinding decla
894
894
return false ;
895
895
}
896
896
897
- private static boolean getConvertForLoopProposal (IInvocationContextCore context , ASTNode node , Collection <ProposalKindWrapper > resultingCollections ) {
897
+ private static boolean getConvertForLoopProposal (IInvocationContext context , ASTNode node , Collection <ProposalKindWrapper > resultingCollections ) {
898
898
ForStatement forStatement = getEnclosingForStatementHeader (node );
899
899
if (forStatement == null ) {
900
900
return false ;
@@ -994,7 +994,7 @@ private static <T extends ASTNode> T getEnclosingHeader(ASTNode node, Class<T> h
994
994
return null ;
995
995
}
996
996
997
- private boolean getExtractInterfaceProposal (CodeActionParams params , IInvocationContextCore context , Collection <ProposalKindWrapper > proposals ) {
997
+ private boolean getExtractInterfaceProposal (CodeActionParams params , IInvocationContext context , Collection <ProposalKindWrapper > proposals ) {
998
998
if (proposals == null ) {
999
999
return false ;
1000
1000
}
@@ -1013,7 +1013,7 @@ private boolean getExtractInterfaceProposal(CodeActionParams params, IInvocation
1013
1013
return true ;
1014
1014
}
1015
1015
1016
- private boolean getChangeSignatureProposal (CodeActionParams params , IInvocationContextCore context , Collection <ProposalKindWrapper > proposals ) {
1016
+ private boolean getChangeSignatureProposal (CodeActionParams params , IInvocationContext context , Collection <ProposalKindWrapper > proposals ) {
1017
1017
if (proposals == null ) {
1018
1018
return false ;
1019
1019
}
@@ -1028,7 +1028,7 @@ private boolean getChangeSignatureProposal(CodeActionParams params, IInvocationC
1028
1028
return true ;
1029
1029
}
1030
1030
1031
- private boolean getSurroundWithTryCatchProposal (IInvocationContextCore context , Collection <ProposalKindWrapper > proposals ) {
1031
+ private boolean getSurroundWithTryCatchProposal (IInvocationContext context , Collection <ProposalKindWrapper > proposals ) {
1032
1032
if (proposals == null ) {
1033
1033
return false ;
1034
1034
}
0 commit comments