mbien commented on code in PR #7333:
URL: https://github.com/apache/netbeans/pull/7333#discussion_r1581534107


##########
java/java.hints.declarative/src/org/netbeans/modules/java/hints/declarative/test/TestParser.java:
##########
@@ -180,37 +187,42 @@ public static TestCase[] parse(String tests) {
             endIndicesArr[c++] = codeIndex + i;
         }
         
-        SourceVersion sourceLevel = DEFAULT_SOURCE_LEVEL;
+        SourceVersion sourceLevel = null;
         
         for (String option : options.split("[ \t]+")) {
             option = option.trim();
             
             if (option.startsWith(SOURCE_LEVEL)) {
                 option = option.substring(SOURCE_LEVEL.length());
-                
-                //XXX: log if not found!
-                
+                if (option.startsWith("1.")) {
+                    option = option.substring(2);
+                }
                 for (SourceVersion v : SourceVersion.values()) {
-                    if (option.equals("1." + 
v.name().substring("RELEASE_".length()))) {
+                    if 
(option.equals(v.name().substring("RELEASE_".length()))) {
                         sourceLevel = v;
                         break;
                     }
                 }
-            }
-
-            if (DISABLED.equals(option)) {
+                if (sourceLevel == null) {
+                    LOG.warning("unsupported source version: " + option);

Review Comment:
   well the old version didn't even log anything. There was a `// TODO logging` 
which I implemented.
   
   But I agree that it should probably fail - I just didn't want to let it fail 
too hard given that it is used in two ways:
    1) from the editor in realtime, it will update the green font into red if 
it fails
    2) from unit tests as you would expect
    
    changing things would risk breaking 1), I want to get a bit more experience 
first with that feature. This PR is mostly so that it becomes useful for me. I 
want to add tests for https://github.com/mbien/jackpot-inspections



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

Reply via email to