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/07/18 06:28:30 UTC

[GitHub] vikasprabhakar commented on a change in pull request #596: [NETBEANS-860] Hints: Convert Lambda to Use 'var' Parameter Types

vikasprabhakar commented on a change in pull request #596: [NETBEANS-860] Hints: Convert Lambda to Use 'var' Parameter Types
URL: https://github.com/apache/incubator-netbeans/pull/596#discussion_r203263454
 
 

 ##########
 File path: java.hints/src/org/netbeans/modules/java/hints/suggestions/Lambda.java
 ##########
 @@ -238,6 +243,34 @@ public static ErrorDescription explicitParameterTypes(HintContext ctx) {
         return ErrorDescriptionFactory.forName(ctx, ctx.getPath(), Bundle.ERR_addExplicitLambdaParameters(), new AddExplicitLambdaParameterTypes(ctx.getInfo(), ctx.getPath()).toEditorFix());
     }
     
+    @Hint(displayName = "#DN_addVarLambdaParameters", description = "#DESC_addVarLambdaParameters", category = "suggestions", hintKind = Hint.Kind.ACTION, minSourceVersion = "11")
+    @Messages({
+        "DN_addVarLambdaParameters=Convert Lambda to Var Parameter Types",
+        "DESC_addVarLambdaParameters=Converts lambdas to var parameter types",
+        "ERR_addVarLambdaParameters=",
+        "FIX_addVarLambdaParameters=Use var parameter types"
+    })
+    @TriggerTreeKind(Kind.LAMBDA_EXPRESSION)
+    public static ErrorDescription implicitVarParameterTypes(HintContext ctx) {
+        // hint will be enable only for JDK-11 or above.
+        if (ctx.getInfo().getSourceVersion().compareTo(SourceVersion.RELEASE_9) < 2) {
 
 Review comment:
   It is giving build error while trying to build with JDK8. To make compatible with JDK8, need to use RELEASE_9 in place of RELEASE_10.
   Build Error in JDK8:
   if(SourceVersion.RELEASE_10.compareTo(ctx.getInfo().getSourceVersion()) >= 0){
                               ^
         symbol:   variable RELEASE_10
         location: class SourceVersion
         1 error

----------------------------------------------------------------
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