Repository: wicket
Updated Branches:
  refs/heads/wicket-6.x 353aa4e8b -> d0a29b0e5


Make members final when there is no need to modify them later


Project: http://git-wip-us.apache.org/repos/asf/wicket/repo
Commit: http://git-wip-us.apache.org/repos/asf/wicket/commit/a969f599
Tree: http://git-wip-us.apache.org/repos/asf/wicket/tree/a969f599
Diff: http://git-wip-us.apache.org/repos/asf/wicket/diff/a969f599

Branch: refs/heads/wicket-6.x
Commit: a969f5999d9b25c867ff0dc904186cd66de6b76b
Parents: 353aa4e
Author: Martin Tzvetanov Grigorov <mgrigo...@apache.org>
Authored: Tue Aug 12 14:08:25 2014 +0200
Committer: Martin Tzvetanov Grigorov <mgrigo...@apache.org>
Committed: Tue Aug 12 14:08:25 2014 +0200

----------------------------------------------------------------------
 .../wicket/atmosphere/AtmosphereRequestHandler.java  |  5 +++--
 .../wicket/atmosphere/AtmosphereRequestMapper.java   |  7 +++----
 .../wicket/atmosphere/AtmosphereWebRequest.java      |  8 ++++----
 .../wicket/atmosphere/AtmosphereWebResponse.java     |  2 +-
 .../java/org/apache/wicket/atmosphere/EventBus.java  | 15 +++++++--------
 .../apache/wicket/atmosphere/EventSubscription.java  | 10 +++++-----
 .../java/org/apache/wicket/atmosphere/PageKey.java   |  7 ++++---
 7 files changed, 27 insertions(+), 27 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/wicket/blob/a969f599/wicket-experimental/wicket-atmosphere/src/main/java/org/apache/wicket/atmosphere/AtmosphereRequestHandler.java
----------------------------------------------------------------------
diff --git 
a/wicket-experimental/wicket-atmosphere/src/main/java/org/apache/wicket/atmosphere/AtmosphereRequestHandler.java
 
b/wicket-experimental/wicket-atmosphere/src/main/java/org/apache/wicket/atmosphere/AtmosphereRequestHandler.java
index a76f440..48bd5e2e 100644
--- 
a/wicket-experimental/wicket-atmosphere/src/main/java/org/apache/wicket/atmosphere/AtmosphereRequestHandler.java
+++ 
b/wicket-experimental/wicket-atmosphere/src/main/java/org/apache/wicket/atmosphere/AtmosphereRequestHandler.java
@@ -18,14 +18,15 @@ package org.apache.wicket.atmosphere;
 
 import java.util.Collection;
 
-import org.apache.wicket.Application;
 import org.apache.wicket.Component;
 import org.apache.wicket.Page;
 import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.behavior.Behavior;
 import org.apache.wicket.protocol.http.WebApplication;
 import org.apache.wicket.request.IRequestCycle;
 import org.apache.wicket.request.IRequestHandler;
 import org.apache.wicket.request.cycle.RequestCycle;
+import org.apache.wicket.util.lang.Args;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -63,7 +64,7 @@ public class AtmosphereRequestHandler implements 
IRequestHandler
                this.pageKey = pageKey;
                this.subscriptions = subscriptions;
                this.event = event;
-               this.eventSubscriptionInvoker = eventSubscriptionInvoker;
+               this.eventSubscriptionInvoker = 
Args.notNull(eventSubscriptionInvoker, "eventSubscriptionInvoker");
        }
 
        @Override

http://git-wip-us.apache.org/repos/asf/wicket/blob/a969f599/wicket-experimental/wicket-atmosphere/src/main/java/org/apache/wicket/atmosphere/AtmosphereRequestMapper.java
----------------------------------------------------------------------
diff --git 
a/wicket-experimental/wicket-atmosphere/src/main/java/org/apache/wicket/atmosphere/AtmosphereRequestMapper.java
 
b/wicket-experimental/wicket-atmosphere/src/main/java/org/apache/wicket/atmosphere/AtmosphereRequestMapper.java
index 2b6b8c9..0f427e2 100644
--- 
a/wicket-experimental/wicket-atmosphere/src/main/java/org/apache/wicket/atmosphere/AtmosphereRequestMapper.java
+++ 
b/wicket-experimental/wicket-atmosphere/src/main/java/org/apache/wicket/atmosphere/AtmosphereRequestMapper.java
@@ -20,6 +20,7 @@ import org.apache.wicket.request.IRequestHandler;
 import org.apache.wicket.request.IRequestMapper;
 import org.apache.wicket.request.Request;
 import org.apache.wicket.request.Url;
+import org.apache.wicket.util.lang.Args;
 
 /**
  * Internal {@link IRequestMapper} to map {@link AtmosphereWebRequest} to
@@ -29,10 +30,9 @@ import org.apache.wicket.request.Url;
  */
 public class AtmosphereRequestMapper implements IRequestMapper
 {
-       private EventSubscriptionInvoker eventSubscriptionInvoker;
+       private final EventSubscriptionInvoker eventSubscriptionInvoker;
 
        /**
-        * 
         * Construct with {@link SubscribeAnnotationEventSubscriptionInvoker}
         */
        public AtmosphereRequestMapper()
@@ -41,14 +41,13 @@ public class AtmosphereRequestMapper implements 
IRequestMapper
        }
 
        /**
-        * 
         * Construct.
         * 
         * @param eventSubscriptionInvoker
         */
        public AtmosphereRequestMapper(EventSubscriptionInvoker 
eventSubscriptionInvoker)
        {
-               this.eventSubscriptionInvoker = eventSubscriptionInvoker;
+               this.eventSubscriptionInvoker = 
Args.notNull(eventSubscriptionInvoker, "eventSubscriptionInvoker");
        }
 
        @Override

http://git-wip-us.apache.org/repos/asf/wicket/blob/a969f599/wicket-experimental/wicket-atmosphere/src/main/java/org/apache/wicket/atmosphere/AtmosphereWebRequest.java
----------------------------------------------------------------------
diff --git 
a/wicket-experimental/wicket-atmosphere/src/main/java/org/apache/wicket/atmosphere/AtmosphereWebRequest.java
 
b/wicket-experimental/wicket-atmosphere/src/main/java/org/apache/wicket/atmosphere/AtmosphereWebRequest.java
index 18556de..eb8f5c1 100644
--- 
a/wicket-experimental/wicket-atmosphere/src/main/java/org/apache/wicket/atmosphere/AtmosphereWebRequest.java
+++ 
b/wicket-experimental/wicket-atmosphere/src/main/java/org/apache/wicket/atmosphere/AtmosphereWebRequest.java
@@ -43,13 +43,13 @@ import org.apache.wicket.util.upload.FileUploadException;
  */
 class AtmosphereWebRequest extends ServletWebRequest
 {
-       private ServletWebRequest wrappedRequest;
+       private final ServletWebRequest wrappedRequest;
 
-       private PageKey pageKey;
+       private final PageKey pageKey;
 
-       private Collection<EventSubscription> subscriptions;
+       private final Collection<EventSubscription> subscriptions;
 
-       private AtmosphereEvent event;
+       private final AtmosphereEvent event;
 
        AtmosphereWebRequest(ServletWebRequest wrappedRequest, PageKey pageKey,
                Collection<EventSubscription> subscriptions, AtmosphereEvent 
event)

http://git-wip-us.apache.org/repos/asf/wicket/blob/a969f599/wicket-experimental/wicket-atmosphere/src/main/java/org/apache/wicket/atmosphere/AtmosphereWebResponse.java
----------------------------------------------------------------------
diff --git 
a/wicket-experimental/wicket-atmosphere/src/main/java/org/apache/wicket/atmosphere/AtmosphereWebResponse.java
 
b/wicket-experimental/wicket-atmosphere/src/main/java/org/apache/wicket/atmosphere/AtmosphereWebResponse.java
index 6a86e97..de09ed8 100644
--- 
a/wicket-experimental/wicket-atmosphere/src/main/java/org/apache/wicket/atmosphere/AtmosphereWebResponse.java
+++ 
b/wicket-experimental/wicket-atmosphere/src/main/java/org/apache/wicket/atmosphere/AtmosphereWebResponse.java
@@ -30,7 +30,7 @@ import org.atmosphere.cpr.AtmosphereResponse;
  */
 class AtmosphereWebResponse extends WebResponse
 {
-       private AtmosphereResponse response;
+       private final AtmosphereResponse response;
        private final AppendingStringBuffer out;
        private boolean redirect;
 

http://git-wip-us.apache.org/repos/asf/wicket/blob/a969f599/wicket-experimental/wicket-atmosphere/src/main/java/org/apache/wicket/atmosphere/EventBus.java
----------------------------------------------------------------------
diff --git 
a/wicket-experimental/wicket-atmosphere/src/main/java/org/apache/wicket/atmosphere/EventBus.java
 
b/wicket-experimental/wicket-atmosphere/src/main/java/org/apache/wicket/atmosphere/EventBus.java
index 7790f83..b93849b 100644
--- 
a/wicket-experimental/wicket-atmosphere/src/main/java/org/apache/wicket/atmosphere/EventBus.java
+++ 
b/wicket-experimental/wicket-atmosphere/src/main/java/org/apache/wicket/atmosphere/EventBus.java
@@ -102,17 +102,17 @@ public class EventBus implements UnboundListener
                return eventBus;
        }
 
-       private WebApplication application;
+       private final WebApplication application;
 
-       private Broadcaster broadcaster;
+       private final Broadcaster broadcaster;
 
-       private Multimap<PageKey, EventSubscription> subscriptions = 
HashMultimap.create();
+       private final Multimap<PageKey, EventSubscription> subscriptions = 
HashMultimap.create();
 
-       private Map<String, PageKey> trackedPages = Maps.newHashMap();
+       private final Map<String, PageKey> trackedPages = Maps.newHashMap();
 
-       private List<ResourceRegistrationListener> registrationListeners = new 
CopyOnWriteArrayList<ResourceRegistrationListener>();
+       private final List<ResourceRegistrationListener> registrationListeners 
= new CopyOnWriteArrayList<ResourceRegistrationListener>();
 
-       private AtmosphereParameters parameters = new AtmosphereParameters();
+       private final AtmosphereParameters parameters = new 
AtmosphereParameters();
 
        /**
         * Creates and registers an {@code EventBus} for the given application. 
The first broadcaster
@@ -278,8 +278,7 @@ public class EventBus implements UnboundListener
         * Unregisters all {@link EventSubscription}s for the given component, 
including the
         * subscriptions for its behaviors.
         *
-        * @param page
-        * @param subscription
+        * @param component
         */
        public synchronized void unregister(Component component)
        {

http://git-wip-us.apache.org/repos/asf/wicket/blob/a969f599/wicket-experimental/wicket-atmosphere/src/main/java/org/apache/wicket/atmosphere/EventSubscription.java
----------------------------------------------------------------------
diff --git 
a/wicket-experimental/wicket-atmosphere/src/main/java/org/apache/wicket/atmosphere/EventSubscription.java
 
b/wicket-experimental/wicket-atmosphere/src/main/java/org/apache/wicket/atmosphere/EventSubscription.java
index dfd8912..f7080bd 100644
--- 
a/wicket-experimental/wicket-atmosphere/src/main/java/org/apache/wicket/atmosphere/EventSubscription.java
+++ 
b/wicket-experimental/wicket-atmosphere/src/main/java/org/apache/wicket/atmosphere/EventSubscription.java
@@ -34,15 +34,15 @@ import com.google.common.base.Predicates;
  */
 public class EventSubscription
 {
-       private String componentPath;
+       private final String componentPath;
 
-       private Integer behaviorIndex;
+       private final Integer behaviorIndex;
 
-       private String methodName;
+       private final String methodName;
 
-       private Predicate<AtmosphereEvent> filter;
+       private final Predicate<AtmosphereEvent> filter;
 
-       private Predicate<AtmosphereEvent> contextAwareFilter;
+       private final Predicate<AtmosphereEvent> contextAwareFilter;
 
        /**
         * Construct.

http://git-wip-us.apache.org/repos/asf/wicket/blob/a969f599/wicket-experimental/wicket-atmosphere/src/main/java/org/apache/wicket/atmosphere/PageKey.java
----------------------------------------------------------------------
diff --git 
a/wicket-experimental/wicket-atmosphere/src/main/java/org/apache/wicket/atmosphere/PageKey.java
 
b/wicket-experimental/wicket-atmosphere/src/main/java/org/apache/wicket/atmosphere/PageKey.java
index 61586a9..c875f8e 100644
--- 
a/wicket-experimental/wicket-atmosphere/src/main/java/org/apache/wicket/atmosphere/PageKey.java
+++ 
b/wicket-experimental/wicket-atmosphere/src/main/java/org/apache/wicket/atmosphere/PageKey.java
@@ -17,6 +17,7 @@
 package org.apache.wicket.atmosphere;
 
 import com.google.common.base.Objects;
+import org.apache.wicket.util.lang.Args;
 
 /**
  * Identifies a page by its id and the session it belongs to.
@@ -25,9 +26,9 @@ import com.google.common.base.Objects;
  */
 public class PageKey
 {
-       private Integer pageId;
+       private final Integer pageId;
 
-       private String sessionId;
+       private final String sessionId;
 
        /**
         * Construct.
@@ -37,7 +38,7 @@ public class PageKey
         */
        public PageKey(Integer pageId, String sessionId)
        {
-               this.pageId = pageId;
+               this.pageId = Args.notNull(pageId, "pageId");
                this.sessionId = sessionId;
        }
 

Reply via email to