From: Per-Åke Minborg Date: Fri, 28 Oct 2016 22:23:52 +0000 (-0700) Subject: Replace EMPTY_SET and EMPTY_LIST with emptySet() and emptyList() X-Git-Tag: 8.0.0.alpha7~7 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=efbcb4e7b0017cf030060276ca912863cd922890;p=vaadin-framework.git Replace EMPTY_SET and EMPTY_LIST with emptySet() and emptyList() Change-Id: I80b73b653e97904605dc62484a7448f3bfbf722c --- diff --git a/server/src/main/java/com/vaadin/server/AbstractClientConnector.java b/server/src/main/java/com/vaadin/server/AbstractClientConnector.java index b1c543b46e..f3e79d6579 100644 --- a/server/src/main/java/com/vaadin/server/AbstractClientConnector.java +++ b/server/src/main/java/com/vaadin/server/AbstractClientConnector.java @@ -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); diff --git a/server/src/main/java/com/vaadin/ui/Upload.java b/server/src/main/java/com/vaadin/ui/Upload.java index 11eb553018..2ab409f9d3 100644 --- a/server/src/main/java/com/vaadin/ui/Upload.java +++ b/server/src/main/java/com/vaadin/ui/Upload.java @@ -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); } diff --git a/server/src/test/java/com/vaadin/server/MockServletContext.java b/server/src/test/java/com/vaadin/server/MockServletContext.java index 65d294d3ae..e00d142fc0 100644 --- a/server/src/test/java/com/vaadin/server/MockServletContext.java +++ b/server/src/test/java/com/vaadin/server/MockServletContext.java @@ -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()); } /*