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/03/17 16:07:37 UTC

[GitHub] sdedic commented on a change in pull request #457: [NETBEANS 470] Var shows as keyword in jdk8, 9

sdedic commented on a change in pull request #457: [NETBEANS 470] Var shows as keyword in jdk8, 9
URL: https://github.com/apache/incubator-netbeans/pull/457#discussion_r175262185
 
 

 ##########
 File path: java.lexer/src/org/netbeans/lib/java/lexer/JavaLexer.java
 ##########
 @@ -1297,6 +1306,25 @@ private int translateSurrogates(int c) {
             JavaTokenId.LINE_COMMENT, JavaTokenId.WHITESPACE
     );
 
+    private Integer getVersionAsInt(String version) {
+        Integer ver = null;
+        if (version != null) {
+            try {
+                // expect format 1.x or x
+                if (version.startsWith("1.")) { //NOI18N
+                    ver = Integer.parseInt(version.substring(version.indexOf(".") + 1)); //NOI18N
 
 Review comment:
   Why version.indexOf(".") + 1, when you know the 1st "." is at index 1 ?

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