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


##########
platform/openide.util/src/org/openide/util/RequestProcessor.java:
##########
@@ -825,14 +820,11 @@ public Future<?> submit(Runnable task) {
     @Override
     public <T> List<Future<T>> invokeAll(Collection<? extends Callable<T>> 
tasks) throws InterruptedException {
         Parameters.notNull("tasks", tasks); //NOI18N
-        List<Future<T>> result = new ArrayList<Future<T>>(tasks.size());
+        List<Future<T>> result = new ArrayList<>(tasks.size());
         CountDownLatch wait = new CountDownLatch(tasks.size());
         for (Callable<T> c : tasks) {
-            if (c == null) {
-                    throw new NullPointerException ("Contains null tasks: " +  
//NOI18N
-                            tasks);
-            }
-            Callable<T> delegate = new WaitableCallable<T>(c, wait);
+            Objects.requireNonNull(c, "Contains null tasks: " + tasks); 
//NOI18N
+            Callable<T> delegate = new WaitableCallable<>(c, wait);

Review Comment:
   `requireNonNull()` was not a good idea since it will concat the string every 
time now. Will revert those changes and check the diff again. Those where from 
a jackpot script where I didn't check if the right hand side was constant.



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