]> source.dussan.org Git - vaadin-framework.git/commitdiff
Replace EMPTY_SET and EMPTY_LIST with emptySet() and emptyList()
authorPer-Åke Minborg <minborg@speedment.com>
Fri, 28 Oct 2016 22:23:52 +0000 (15:23 -0700)
committerHenri Sara <hesara@vaadin.com>
Mon, 7 Nov 2016 07:04:38 +0000 (09:04 +0200)
Change-Id: I80b73b653e97904605dc62484a7448f3bfbf722c

server/src/main/java/com/vaadin/server/AbstractClientConnector.java
server/src/main/java/com/vaadin/ui/Upload.java
server/src/test/java/com/vaadin/server/MockServletContext.java

index b1c543b46e2f6bc220d89a46a94c3f293d584147..f3e79d6579bde2e6c02c3dc12c164eaaff9ab8c8 100644 (file)
@@ -30,7 +30,6 @@ import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
 import java.util.NoSuchElementException;
-import java.util.Objects;
 import java.util.concurrent.ConcurrentHashMap;
 import java.util.logging.Logger;
 
@@ -998,7 +997,7 @@ public abstract class AbstractClientConnector
      */
     public Collection<?> getListeners(Class<?> eventType) {
         if (eventRouter == null) {
-            return Collections.EMPTY_LIST;
+            return Collections.emptyList();
         }
 
         return eventRouter.getListeners(eventType);
index 11eb553018085515e6b8cc598d3b135dd8f1f537..2ab409f9d34104176f4721103e9725c2f1967bba 100644 (file)
@@ -229,14 +229,14 @@ public class Upload extends AbstractComponent
 
     static {
         try {
-            UPLOAD_FINISHED_METHOD = FinishedListener.class.getDeclaredMethod(
-                    "uploadFinished", FinishedEvent.class);
-            UPLOAD_FAILED_METHOD = FailedListener.class.getDeclaredMethod(
-                    "uploadFailed", FailedEvent.class);
-            UPLOAD_STARTED_METHOD = StartedListener.class.getDeclaredMethod(
-                    "uploadStarted", StartedEvent.class);
-            UPLOAD_SUCCEEDED_METHOD = SucceededListener.class.getDeclaredMethod(
-                    "uploadSucceeded", SucceededEvent.class);
+            UPLOAD_FINISHED_METHOD = FinishedListener.class
+                    .getDeclaredMethod("uploadFinished", FinishedEvent.class);
+            UPLOAD_FAILED_METHOD = FailedListener.class
+                    .getDeclaredMethod("uploadFailed", FailedEvent.class);
+            UPLOAD_STARTED_METHOD = StartedListener.class
+                    .getDeclaredMethod("uploadStarted", StartedEvent.class);
+            UPLOAD_SUCCEEDED_METHOD = SucceededListener.class
+                    .getDeclaredMethod("uploadSucceeded", SucceededEvent.class);
         } catch (final java.lang.NoSuchMethodException e) {
             // This should never happen
             throw new java.lang.RuntimeException(
@@ -1118,7 +1118,7 @@ public class Upload extends AbstractComponent
     public java.util.Collection<?> getListeners(java.lang.Class<?> eventType) {
         if (StreamingProgressEvent.class.isAssignableFrom(eventType)) {
             if (progressListeners == null) {
-                return Collections.EMPTY_LIST;
+                return Collections.emptyList();
             } else {
                 return Collections.unmodifiableCollection(progressListeners);
             }
index 65d294d3ae1879144168a25fecb0defc380fbb0e..e00d142fc01de8d4c7e36e9482f9c51d0ba0e9c1 100644 (file)
@@ -154,7 +154,7 @@ public class MockServletContext implements ServletContext {
      */
     @Override
     public Enumeration getServlets() {
-        return Collections.enumeration(Collections.EMPTY_SET);
+        return Collections.enumeration(Collections.emptySet());
     }
 
     /*
@@ -233,7 +233,7 @@ public class MockServletContext implements ServletContext {
      */
     @Override
     public Enumeration getInitParameterNames() {
-        return Collections.enumeration(Collections.EMPTY_LIST);
+        return Collections.enumeration(Collections.emptyList());
     }
 
     /*