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