tmysik commented on code in PR #8673:
URL: https://github.com/apache/netbeans/pull/8673#discussion_r2251986071
##########
php/php.editor/src/org/netbeans/modules/php/editor/verification/IncorrectNonAbstractMethodHintError.java:
##########
@@ -107,17 +111,26 @@ private void addHint(ASTNode node, String description,
List<Hint> hints, List<Hi
//~ Inner classes
private static final class CheckVisitor extends DefaultVisitor {
+ private final Model model;
+
private final Set<MethodDeclaration> incorrectNonAbstractMethods = new
HashSet<>();
+ public CheckVisitor(Model model) {
+ super();
+ this.model = model;
+ }
+
@Override
public void visit(MethodDeclaration node) {
if (CancelSupport.getDefault().isCancelled()) {
return;
}
if (!Modifier.isAbstract(node.getModifier())) {
FunctionDeclaration function = node.getFunction();
- Block body = function.getBody();
- if (body == null) {
+ final VariableScope variableScope =
model.getVariableScope(function.getEndOffset() - 1);
Review Comment:
I am not sure here - is calling of the model in visitors OK? I am sorry, I
already forgot... could you please check the performance and validate that it
is still OK? Thank you.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists