mbien commented on a change in pull request #3166:
URL: https://github.com/apache/netbeans/pull/3166#discussion_r720146617



##########
File path: java/java.hints/src/org/netbeans/modules/java/hints/perf/Tiny.java
##########
@@ -337,11 +353,24 @@ public static ErrorDescription 
collectionsToArray(HintContext ctx) {
         Fix[] fixes;
 
         if (pureMemberSelect) {
-            String fixDisplayName = NbBundle.getMessage(Tiny.class, 
"FIX_Tiny_collectionsToArray");
 
-            fixes = new Fix[] {
-                JavaFixUtilities.rewriteFix(ctx, fixDisplayName, 
ctx.getPath(), "$collection.toArray(new $clazz[$collection.size()])")
-            };
+            SourceVersion version = ctx.getInfo().getSourceVersion();
+            TreePath type = ctx.getVariables().get("$clazz");
+            String typeName = type.getLeaf().toString();
+            
+            if 
(Integer.parseInt(version.name().substring(version.name().indexOf('_')+1)) >= 
11) {

Review comment:
       can i compare against 11 if NB is running on <11 without nb-javac? 
SourceVersion is part of the JDK if i see this correctly - the enum would not 
be there.




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