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 2022/05/08 07:56:42 UTC

[GitHub] [netbeans] vieiro commented on a diff in pull request #4080: code and test cleaning

vieiro commented on code in PR #4080:
URL: https://github.com/apache/netbeans/pull/4080#discussion_r867450893


##########
platform/openide.util/src/org/openide/util/NbCollections.java:
##########
@@ -34,9 +33,9 @@
 import java.util.NoSuchElementException;
 import java.util.RandomAccess;
 import java.util.Set;
-import java.util.logging.Level;
+import static java.util.logging.Level.WARNING;

Review Comment:
   We use `import static` sparingly. Not really requierd this change, right?



##########
platform/openide.util/src/org/openide/util/ChangeSupport.java:
##########
@@ -119,6 +108,7 @@ private void fireChange(ChangeEvent event) {
      *         false otherwise.
      */
     public boolean hasListeners() {
-        return !listeners.isEmpty();
+        
+        return !this.listeners.isEmpty();

Review Comment:
   `this` is unnecessary here, right? Why add it then?



##########
platform/openide.util/src/org/openide/util/ChangeSupport.java:
##########
@@ -21,7 +21,7 @@
 
 import java.util.List;
 import java.util.concurrent.CopyOnWriteArrayList;
-import java.util.logging.Level;
+import static java.util.logging.Level.*;

Review Comment:
   This is a cosmetic unrequired change that makes code less legible and complicates review. Please revert it.



##########
platform/openide.util/src/org/openide/util/ChangeSupport.java:
##########
@@ -38,15 +38,16 @@ public final class ChangeSupport {
     private static final Logger LOG = Logger.getLogger(ChangeSupport.class.getName());
 
     // not private because used in unit tests
-    final List<ChangeListener> listeners = new CopyOnWriteArrayList<ChangeListener>();
+    final List<ChangeListener> listeners = new CopyOnWriteArrayList<>();
     private final Object source;
 
     /**
      * Creates a new <code>ChangeSupport</code>
      *
      * @param  source the instance to be given as the source for events.
      */
-    public ChangeSupport(Object source) {
+    public ChangeSupport(final Object source) {

Review Comment:
   This is a cosmetic unrequired change that makes code less legible and complicates review. Please revert it.



##########
platform/openide.util/src/org/openide/util/NbCollections.java:
##########
@@ -34,9 +33,9 @@
 import java.util.NoSuchElementException;
 import java.util.RandomAccess;
 import java.util.Set;
-import java.util.logging.Level;
+import static java.util.logging.Level.WARNING;
 import java.util.logging.Logger;
-import org.openide.util.Enumerations;
+import static java.util.Objects.requireNonNull;

Review Comment:
   Again another cosmetic change.



-- 
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: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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