Skip to content

Commit

Permalink
Minor tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
jjohnstn committed Sep 25, 2024
1 parent a30b50d commit 2843350
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -233,24 +233,6 @@ public void getRemoveUnusedSuppressWarningProposals(IInvocationContext context,
}

ASTNode parent= coveringNode.getParent();
//
// ASTRewrite rewrite= ASTRewrite.create(coveringNode.getAST());
// if (parent instanceof SingleMemberAnnotation) {
// rewrite.remove(parent, null);
// } else if (parent instanceof NormalAnnotation) {
// NormalAnnotation annot= (NormalAnnotation) parent;
// if (annot.values().size() == 1) {
// rewrite.remove(annot, null);
// } else {
// rewrite.remove(coveringNode, null);
// }
// } else if (parent instanceof ArrayInitializer) {
// rewrite.remove(coveringNode, null);
// } else {
// return;
// }
// String label= Messages.format(CorrectionMessages.SuppressWarningsSubProcessor_remove_annotation_label, literal.getLiteralValue());
// T proposal= createASTRewriteCorrectionProposal(label, context.getCompilationUnit(), rewrite, IProposalRelevance.REMOVE_ANNOTATION);
if (!(parent instanceof SingleMemberAnnotation) && !(parent instanceof NormalAnnotation) && !(parent instanceof ArrayInitializer)) {
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,7 @@ protected ICommandAccess createASTRewriteCorrectionProposal(String name, ICompil
protected ICommandAccess createFixCorrectionProposal(IProposableFix fix, ICleanUp cleanUp, int relevance, IInvocationContext context) {
// Initialize as default image, though it should always trigger one of the two if statements below
Image image = JavaPluginImages.get(JavaPluginImages.IMG_CORRECTION_CHANGE);
if(relevance == IProposalRelevance.FIX_SUPPRESS_TOKEN) {
image = JavaPluginImages.get(JavaPluginImages.IMG_CORRECTION_CHANGE);
} else if (relevance == IProposalRelevance.REMOVE_ANNOTATION) {
if (relevance == IProposalRelevance.REMOVE_ANNOTATION) {
image = PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_TOOL_DELETE);
}
FixCorrectionProposal proposal= new FixCorrectionProposal(fix, cleanUp, relevance, image, context);
Expand Down

0 comments on commit 2843350

Please sign in to comment.