You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@netbeans.apache.org by GitBox <gi...@apache.org> on 2018/09/04 09:59:59 UTC

[GitHub] rtaneja1 closed pull request #831: [NetBeans-1181]Disable hint 'Use var parameter types' for empty param…

rtaneja1 closed pull request #831: [NetBeans-1181]Disable hint 'Use var parameter types' for empty param…
URL: https://github.com/apache/incubator-netbeans/pull/831
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/java/java.hints/src/org/netbeans/modules/java/hints/suggestions/Lambda.java b/java/java.hints/src/org/netbeans/modules/java/hints/suggestions/Lambda.java
index 41f4df58a6..7d086d54f5 100644
--- a/java/java.hints/src/org/netbeans/modules/java/hints/suggestions/Lambda.java
+++ b/java/java.hints/src/org/netbeans/modules/java/hints/suggestions/Lambda.java
@@ -246,16 +246,17 @@ public static ErrorDescription implicitVarParameterTypes(HintContext ctx) {
             return null;
         }
         // Check invalid lambda parameter declaration
-        if (ctx.getInfo().getTreeUtilities().hasError(ctx.getPath().getLeaf(), LAMBDA_PARAMETER_ERROR_CODES)) {
+        if (ctx.getInfo().getTreeUtilities().hasError(ctx.getPath().getLeaf())) {
             return null;
         }
         // Check var parameter types
         LambdaExpressionTree let = (LambdaExpressionTree) ctx.getPath().getLeaf();
-        if (let.getParameters() != null && let.getParameters().size() > 0) {
-            VariableTree var = let.getParameters().get(0);
-            if (ctx.getInfo().getTreeUtilities().isVarType(new TreePath(ctx.getPath(), var))) {
-                return null;
-            }
+        if (let.getParameters() == null || let.getParameters().isEmpty()) {
+            return null;
+        }
+        VariableTree var = let.getParameters().get(0);
+        if (ctx.getInfo().getTreeUtilities().isVarType(new TreePath(ctx.getPath(), var))) {
+            return null;
         }
 
         return ErrorDescriptionFactory.forName(ctx, ctx.getPath(), NbBundle.getMessage(Lambda.class, "ERR_ConvertVarLambdaParameters"), new AddVarLambdaParameterTypes(ctx.getInfo(), ctx.getPath()).toEditorFix());


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists