|
68 | 68 | import org.eclipse.jdt.internal.corext.fix.UnimplementedCodeFixCore.MakeTypeAbstractOperation; |
69 | 69 | import org.eclipse.jdt.internal.corext.util.JavaModelUtil; |
70 | 70 | import org.eclipse.jdt.internal.corext.util.JdtFlags; |
71 | | -import org.eclipse.jdt.ui.text.java.IInvocationContext; |
72 | | -import org.eclipse.jdt.ui.text.java.IProblemLocation; |
73 | 71 | import org.eclipse.jdt.internal.ui.text.correction.IProposalRelevance; |
74 | 72 | import org.eclipse.jdt.internal.ui.text.correction.proposals.FixCorrectionProposalCore; |
75 | 73 | import org.eclipse.jdt.internal.ui.text.correction.proposals.ModifierChangeCorrectionProposalCore; |
|
79 | 77 | import org.eclipse.jdt.ls.core.internal.corrections.ProposalKindWrapper; |
80 | 78 | import org.eclipse.jdt.ls.core.internal.corrections.proposals.UnresolvedElementsSubProcessor; |
81 | 79 | import org.eclipse.jdt.ls.core.internal.handlers.CodeActionHandler; |
| 80 | +import org.eclipse.jdt.ui.text.java.IInvocationContext; |
| 81 | +import org.eclipse.jdt.ui.text.java.IProblemLocation; |
82 | 82 | import org.eclipse.jdt.ui.text.java.correction.ASTRewriteCorrectionProposalCore; |
83 | 83 | import org.eclipse.jface.text.BadLocationException; |
84 | 84 | import org.eclipse.jface.text.IDocument; |
@@ -541,7 +541,7 @@ public static void addAbstractMethodProposals(IInvocationContext context, IProbl |
541 | 541 | boolean hasNoBody = decl.getBody() == null; |
542 | 542 |
|
543 | 543 | int id = problem.getProblemId(); |
544 | | - if (id == IProblem.AbstractMethodInAbstractClass || id == IProblem.EnumAbstractMethodMustBeImplemented || id == IProblem.AbstractMethodInEnum || parentIsAbstractClass) { |
| 544 | + if (id == IProblem.AbstractMethodInAbstractClass || id == IProblem.EnumAbstractMethodMustBeImplemented || id == IProblem.AbstractMethodInEnum || id == IProblem.BodyForAbstractMethod || parentIsAbstractClass) { |
545 | 545 | AST ast = astRoot.getAST(); |
546 | 546 | ASTRewrite rewrite = ASTRewrite.create(ast); |
547 | 547 |
|
@@ -981,10 +981,10 @@ public static void addSealedMissingModifierProposal(IInvocationContext context, |
981 | 981 | if (!(selectedNode instanceof SimpleName)) { |
982 | 982 | return; |
983 | 983 | } |
984 | | - if (!(((SimpleName) selectedNode).getParent() instanceof TypeDeclaration)) { |
| 984 | + if (!(selectedNode.getParent() instanceof TypeDeclaration)) { |
985 | 985 | return; |
986 | 986 | } |
987 | | - TypeDeclaration typeDecl = (TypeDeclaration) ((SimpleName) selectedNode).getParent(); |
| 987 | + TypeDeclaration typeDecl = (TypeDeclaration) selectedNode.getParent(); |
988 | 988 | boolean isInterface = typeDecl.isInterface(); |
989 | 989 |
|
990 | 990 | ICompilationUnit cu = context.getCompilationUnit(); |
|
0 commit comments