]> source.dussan.org Git - vaadin-framework.git/commitdiff
Use final modifier where appropriate
authorPer-Åke Minborg <minborg@speedment.com>
Fri, 28 Oct 2016 17:24:51 +0000 (10:24 -0700)
committerDenis Anisimov <denis@vaadin.com>
Wed, 9 Nov 2016 13:32:57 +0000 (15:32 +0200)
Change-Id: I80b73b653e97904605dc62484a7448f3bfbf7226

98 files changed:
server/src/main/java/com/vaadin/data/Binder.java
server/src/main/java/com/vaadin/data/validator/AbstractValidator.java
server/src/main/java/com/vaadin/data/validator/RangeValidator.java
server/src/main/java/com/vaadin/data/validator/StringLengthValidator.java
server/src/main/java/com/vaadin/event/FieldEvents.java
server/src/main/java/com/vaadin/event/MouseEvents.java
server/src/main/java/com/vaadin/event/TransferableImpl.java
server/src/main/java/com/vaadin/event/dd/DragAndDropEvent.java
server/src/main/java/com/vaadin/event/dd/acceptcriteria/AcceptAll.java
server/src/main/java/com/vaadin/event/dd/acceptcriteria/ContainsDataFlavor.java
server/src/main/java/com/vaadin/event/dd/acceptcriteria/Not.java
server/src/main/java/com/vaadin/event/dd/acceptcriteria/Or.java
server/src/main/java/com/vaadin/event/dd/acceptcriteria/SourceIs.java
server/src/main/java/com/vaadin/event/dd/acceptcriteria/SourceIsTarget.java
server/src/main/java/com/vaadin/server/AbstractClientConnector.java
server/src/main/java/com/vaadin/server/AbstractErrorMessage.java
server/src/main/java/com/vaadin/server/ClientConnector.java
server/src/main/java/com/vaadin/server/ClientMethodInvocation.java
server/src/main/java/com/vaadin/server/ComponentSizeValidator.java
server/src/main/java/com/vaadin/server/FontAwesome.java
server/src/main/java/com/vaadin/server/JavaScriptCallbackHelper.java
server/src/main/java/com/vaadin/server/JsonCodec.java
server/src/main/java/com/vaadin/server/LegacyApplication.java
server/src/main/java/com/vaadin/server/LegacyCommunicationManager.java
server/src/main/java/com/vaadin/server/LocaleService.java
server/src/main/java/com/vaadin/server/Page.java
server/src/main/java/com/vaadin/server/RestrictedRenderResponse.java
server/src/main/java/com/vaadin/server/SizeWithUnit.java
server/src/main/java/com/vaadin/server/Sizeable.java
server/src/main/java/com/vaadin/server/VaadinPortletResponse.java
server/src/main/java/com/vaadin/server/VaadinServletResponse.java
server/src/main/java/com/vaadin/server/VaadinSession.java
server/src/main/java/com/vaadin/server/communication/AtmospherePushConnection.java
server/src/main/java/com/vaadin/server/communication/JSR356WebsocketInitializer.java
server/src/main/java/com/vaadin/server/communication/PushHandler.java
server/src/main/java/com/vaadin/server/communication/UidlRequestHandler.java
server/src/main/java/com/vaadin/server/data/BackEndDataSource.java
server/src/main/java/com/vaadin/server/data/DataCommunicator.java
server/src/main/java/com/vaadin/server/widgetsetutils/ClassPathExplorer.java
server/src/main/java/com/vaadin/ui/AbsoluteLayout.java
server/src/main/java/com/vaadin/ui/AbstractColorPicker.java
server/src/main/java/com/vaadin/ui/AbstractJavaScriptComponent.java
server/src/main/java/com/vaadin/ui/AbstractOrderedLayout.java
server/src/main/java/com/vaadin/ui/AbstractSplitPanel.java
server/src/main/java/com/vaadin/ui/ConnectorTracker.java
server/src/main/java/com/vaadin/ui/DragAndDropWrapper.java
server/src/main/java/com/vaadin/ui/Grid.java
server/src/main/java/com/vaadin/ui/Html5File.java
server/src/main/java/com/vaadin/ui/LoadingIndicatorConfiguration.java
server/src/main/java/com/vaadin/ui/LoginForm.java
server/src/main/java/com/vaadin/ui/Notification.java
server/src/main/java/com/vaadin/ui/NotificationConfiguration.java
server/src/main/java/com/vaadin/ui/PushConfiguration.java
server/src/main/java/com/vaadin/ui/ReconnectDialogConfiguration.java
server/src/main/java/com/vaadin/ui/TabSheet.java
server/src/main/java/com/vaadin/ui/TooltipConfiguration.java
server/src/main/java/com/vaadin/ui/components/colorpicker/ColorPickerHistory.java
server/src/main/java/com/vaadin/ui/components/colorpicker/ColorPickerSelect.java
server/src/main/java/com/vaadin/ui/components/grid/StaticSection.java
server/src/main/java/com/vaadin/ui/declarative/DesignAttributeHandler.java
server/src/main/java/com/vaadin/ui/declarative/DesignContext.java
server/src/main/java/com/vaadin/ui/declarative/converters/DesignEnumConverter.java
server/src/main/java/com/vaadin/ui/declarative/converters/DesignResourceConverter.java
server/src/main/java/com/vaadin/ui/renderers/ClickableRenderer.java
server/src/main/java/com/vaadin/util/CurrentInstance.java
server/src/main/java/com/vaadin/util/FileTypeResolver.java
server/src/main/java/com/vaadin/util/SerializerHelper.java
server/src/test/java/com/vaadin/data/BinderMultiSelectTest.java
server/src/test/java/com/vaadin/data/Jsr303Test.java
server/src/test/java/com/vaadin/data/validator/StringLengthValidatorTest.java
server/src/test/java/com/vaadin/server/AbstractDeploymentConfigurationTest.java
server/src/test/java/com/vaadin/server/DownloadStreamTest.java
server/src/test/java/com/vaadin/server/MockVaadinSession.java
server/src/test/java/com/vaadin/server/communication/FileUploadHandlerTest.java
server/src/test/java/com/vaadin/server/data/DataCommunicatorTest.java
server/src/test/java/com/vaadin/server/data/datasource/StrBean.java
server/src/test/java/com/vaadin/tests/data/bean/AnotherTestEnum.java
server/src/test/java/com/vaadin/tests/data/bean/BeanToValidate.java
server/src/test/java/com/vaadin/tests/data/bean/Country.java
server/src/test/java/com/vaadin/tests/data/bean/Sex.java
server/src/test/java/com/vaadin/tests/data/bean/TestEnum.java
server/src/test/java/com/vaadin/tests/data/converter/StringToBooleanConverterTest.java
server/src/test/java/com/vaadin/tests/design/DeclarativeTestBase.java
server/src/test/java/com/vaadin/tests/design/designroot/ExtendedDesignWithAnnotation.java
server/src/test/java/com/vaadin/tests/design/designroot/ExtendedDesignWithEmptyAnnotation.java
server/src/test/java/com/vaadin/tests/design/nested/NestedCustomLayoutsTest.java
server/src/test/java/com/vaadin/tests/server/ClassesSerializableTest.java
server/src/test/java/com/vaadin/tests/server/CsrfTokenMissingTest.java
server/src/test/java/com/vaadin/tests/server/clientconnector/AttachDetachListenersTest.java
server/src/test/java/com/vaadin/tests/server/component/StateGetDoesNotMarkDirtyTest.java
server/src/test/java/com/vaadin/tests/server/component/csslayout/AddComponentsTest.java
server/src/test/java/com/vaadin/tests/server/component/customlayout/CustomLayoutTest.java
server/src/test/java/com/vaadin/tests/server/component/menubar/MenuBarIdsTest.java
server/src/test/java/com/vaadin/tests/server/component/ui/CustomUIClassLoaderTest.java
server/src/test/java/com/vaadin/tests/server/component/window/AttachDetachWindowTest.java
server/src/test/java/com/vaadin/tests/server/navigator/NavigatorTest.java
server/src/test/java/com/vaadin/tests/util/MockDeploymentConfiguration.java
server/src/test/java/com/vaadin/ui/declarative/DesignTest.java

index 7912a55d7208c7ed1d3fe56f5791adcca0ec2bb9..2763c7f7887d9ee6e3d6b4c01e4c4563a0f8845c 100644 (file)
@@ -794,7 +794,7 @@ public class Binder<BEAN> implements Serializable {
      */
     private static class ValidatorAsConverter<T> implements Converter<T, T> {
 
-        private Validator<? super T> validator;
+        private final Validator<? super T> validator;
 
         /**
          * Creates a new converter wrapping the given validator.
index 793797ee3f1fce33cb5396cedb4be3609ca078d0..b6467b07b9857e04da8e021ebe06f15cc4563db7 100644 (file)
@@ -31,7 +31,7 @@ import com.vaadin.server.SerializableFunction;
  */
 public abstract class AbstractValidator<T> implements Validator<T> {
 
-    private SerializableFunction<T, String> messageProvider;
+    private final SerializableFunction<T, String> messageProvider;
 
     /**
      * Constructs a validator with the given error message. The substring "{0}"
index b8ad38730807313fc48a671de075f4ab96c8b781..2f966f81ee598854571ee69415a0c37d370c67cc 100644 (file)
@@ -35,7 +35,7 @@ public class RangeValidator<T> extends AbstractValidator<T> {
     private T maxValue = null;
     private boolean minValueIncluded = true;
     private boolean maxValueIncluded = true;
-    private Comparator<? super T> comparator;
+    private final Comparator<? super T> comparator;
 
     /**
      * Creates a new range validator of the given type. Passing null to either
index b3e1da18eb51098406069d51223d8aa4eb556b1e..f207e618eed3e11aaaab080bc617c3a20ebffa26 100644 (file)
@@ -28,7 +28,7 @@ import com.vaadin.data.util.converter.ValueContext;
 @SuppressWarnings("serial")
 public class StringLengthValidator extends AbstractValidator<String> {
 
-    private RangeValidator<Integer> validator;
+    private final RangeValidator<Integer> validator;
 
     /**
      * Creates a new StringLengthValidator with a given error message and
index bb14cc73398341a338612ef3b37def8970946574..b0e539961b757419d93b0e5c1f655b86768a720c 100644 (file)
@@ -194,7 +194,7 @@ public interface FieldEvents {
     public static abstract class FocusAndBlurServerRpcImpl
             implements FocusAndBlurServerRpc {
 
-        private Component component;
+        private final Component component;
 
         public FocusAndBlurServerRpcImpl(Component component) {
             this.component = component;
index d76759343a41bb87e45b48f32dca8f6dce3fc791..e391ade401e6574c6f0a7ddd67333de39ca538e9 100644 (file)
@@ -60,7 +60,7 @@ public interface MouseEvents {
          */
         @Deprecated
         public static final MouseButton BUTTON_RIGHT = MouseButton.RIGHT;
-        private MouseEventDetails details;
+        private final MouseEventDetails details;
 
         public ClickEvent(Component source,
                 MouseEventDetails mouseEventDetails) {
index 4da28176fc8d3afe01eb7a9d25cb5d1365f563a6..7ea9ef7b238f307fa2084bf4bb0a81b3c9395a94 100644 (file)
@@ -28,7 +28,7 @@ import com.vaadin.ui.Component;
  */
 public class TransferableImpl implements Transferable {
     private Map<String, Object> rawVariables = new HashMap<>();
-    private Component sourceComponent;
+    private final Component sourceComponent;
 
     public TransferableImpl(Component sourceComponent,
             Map<String, Object> rawVariables) {
index 062f8aff29779fe5b05cb391ad4e2be17026f504..93491b427431d4ccea0ab5b0ad4b176568969ef6 100644 (file)
@@ -34,8 +34,8 @@ import com.vaadin.event.dd.acceptcriteria.AcceptCriterion;
  *
  */
 public class DragAndDropEvent implements Serializable {
-    private Transferable transferable;
-    private TargetDetails dropTargetDetails;
+    private final Transferable transferable;
+    private final TargetDetails dropTargetDetails;
 
     public DragAndDropEvent(Transferable transferable,
             TargetDetails dropTargetDetails) {
index 9694f6525b30f59d784fcba7e6b9889ab133244a..b42d2b4684442b0a1da35ef9e2000a6d0cd49ed4 100644 (file)
@@ -32,7 +32,7 @@ import com.vaadin.event.dd.DragAndDropEvent;
 public final class AcceptAll extends ClientSideCriterion {
 
     private static final long serialVersionUID = 7406683402153141461L;
-    private static AcceptCriterion singleton = new AcceptAll();
+    private static final AcceptCriterion singleton = new AcceptAll();
 
     private AcceptAll() {
     }
index 42d666a4ceb4f1f421ddb8577b2367506d4b1eb3..c4fc645fec145dfe7f2e274f43acc1df41106fb7 100644 (file)
@@ -32,7 +32,7 @@ import com.vaadin.server.PaintTarget;
  */
 public class ContainsDataFlavor extends ClientSideCriterion {
 
-    private String dataFlavorId;
+    private final String dataFlavorId;
 
     /**
      * Constructs a new instance of {@link ContainsDataFlavor}.
index 057e032d465cc65984d97f725d16e5afb57ea360..f194be763401642acaaf9c0f1d8c83f66efb20c0 100644 (file)
@@ -31,7 +31,7 @@ import com.vaadin.server.PaintTarget;
 public class Not extends ClientSideCriterion {
 
     private static final long serialVersionUID = 1131422338558613244L;
-    private AcceptCriterion acceptCriterion;
+    private final AcceptCriterion acceptCriterion;
 
     public Not(ClientSideCriterion acceptCriterion) {
         this.acceptCriterion = acceptCriterion;
index 20bf507bbe6529365295fad81727148ee9fdf522..81ef37631f9a27df834ca5cb9525fd8f32506fd5 100644 (file)
@@ -33,7 +33,7 @@ import com.vaadin.server.PaintTarget;
  */
 public class Or extends ClientSideCriterion {
     private static final long serialVersionUID = 1L;
-    private AcceptCriterion criteria[];
+    private final AcceptCriterion criteria[];
 
     /**
      * @param criteria
index eaccceaca2ab73dfb562eaa40bc485229dded365..49ea24e5cbd202196a80172741b7650363f6bd84 100644 (file)
@@ -36,7 +36,7 @@ import com.vaadin.ui.Component;
 @SuppressWarnings("serial")
 public class SourceIs extends ClientSideCriterion {
 
-    private Component[] components;
+    private final Component[] components;
 
     public SourceIs(Component... component) {
         components = component;
index 95fbaab85e598cf7134c77f437c3ae363480df67..8cb16e43130cef72b172189c8653a0659362ba9e 100644 (file)
@@ -38,7 +38,7 @@ import com.vaadin.ui.Component;
 public class SourceIsTarget extends ClientSideCriterion {
 
     private static final long serialVersionUID = -451399314705532584L;
-    private static SourceIsTarget instance = new SourceIsTarget();
+    private static final SourceIsTarget instance = new SourceIsTarget();
 
     private SourceIsTarget() {
     }
index f3e79d6579bde2e6c02c3dc12c164eaaff9ab8c8..01222a07ddb68055247b08510245a82f40cbd5d4 100644 (file)
@@ -61,13 +61,13 @@ public abstract class AbstractClientConnector
      * A map from client to server RPC interface class name to the RPC call
      * manager that handles incoming RPC calls for that interface.
      */
-    private Map<String, ServerRpcManager<?>> rpcManagerMap = new HashMap<>();
+    private final Map<String, ServerRpcManager<?>> rpcManagerMap = new HashMap<>();
 
     /**
      * A map from server to client RPC interface class to the RPC proxy that
      * sends ourgoing RPC calls for that interface.
      */
-    private Map<Class<?>, ClientRpc> rpcProxyMap = new HashMap<>();
+    private final Map<Class<?>, ClientRpc> rpcProxyMap = new HashMap<>();
 
     /**
      * Shared state object to be communicated from the server to the client when
@@ -84,7 +84,7 @@ public abstract class AbstractClientConnector
 
     private String connectorId;
 
-    private ArrayList<Extension> extensions = new ArrayList<>();
+    private final ArrayList<Extension> extensions = new ArrayList<>();
 
     /**
      * The EventRouter used for the event model.
@@ -378,7 +378,7 @@ public abstract class AbstractClientConnector
     private class RpcInvocationHandler
             implements InvocationHandler, Serializable {
 
-        private String rpcInterfaceName;
+        private final String rpcInterfaceName;
 
         public RpcInvocationHandler(Class<?> rpcInterface) {
             rpcInterfaceName = rpcInterface.getName().replaceAll("\\$", ".");
index 491462b53d0174715d34d6354fdf26397b566cff..6ffbf6063e2a797880b0412d1fd5118b752cd226 100644 (file)
@@ -63,7 +63,7 @@ public abstract class AbstractErrorMessage implements ErrorMessage {
      */
     private ErrorLevel level = ErrorLevel.ERROR;
 
-    private List<ErrorMessage> causes = new ArrayList<>();
+    private final List<ErrorMessage> causes = new ArrayList<>();
 
     protected AbstractErrorMessage(String message) {
         this.message = message;
index 80453d4733a169478cf0f8e81e007f58c9220729..b54a85029bcc8e2403fbfb931f463f8dde9f816a 100644 (file)
@@ -114,7 +114,7 @@ public interface ClientConnector extends Connector {
     public static class ConnectorErrorEvent
             extends com.vaadin.server.ErrorEvent {
 
-        private Connector connector;
+        private final Connector connector;
 
         public ConnectorErrorEvent(Connector connector, Throwable t) {
             super(t);
index 28d5d2778d9f8778c4249ee726b6932d4a0759a5..acf5f3568f3fab32a3b6e8cee2862c8609d1ef93 100644 (file)
@@ -39,7 +39,7 @@ public class ClientMethodInvocation
     private final String interfaceName;
     private final String methodName;
     private transient Object[] parameters;
-    private Type[] parameterTypes;
+    private final Type[] parameterTypes;
 
     // used for sorting calls between different connectors in the same UI
     private final long sequenceNumber;
index da8231eec9eac3a88cb1049b5e31fa2d2815a519..a9068495dcc27b92549255fcb384b81e4ebbd750 100644 (file)
@@ -631,9 +631,9 @@ public class ComponentSizeValidator implements Serializable {
 
     }
 
-    private static Map<Object, FileLocation> creationLocations = new HashMap<>();
-    private static Map<Object, FileLocation> widthLocations = new HashMap<>();
-    private static Map<Object, FileLocation> heightLocations = new HashMap<>();
+    private static final Map<Object, FileLocation> creationLocations = new HashMap<>();
+    private static final Map<Object, FileLocation> widthLocations = new HashMap<>();
+    private static final Map<Object, FileLocation> heightLocations = new HashMap<>();
 
     public static class FileLocation implements Serializable {
         public String method;
index 2bb4a9abc803bd5093b171eada6b80678e1a8be8..2ce35328f6df5448d909496fe8fdbc37528786a4 100644 (file)
@@ -731,7 +731,7 @@ public enum FontAwesome implements FontIcon {
     ;
 
     public static final String FONT_FAMILY = "FontAwesome";
-    private int codepoint;
+    private final int codepoint;
 
     FontAwesome(int codepoint) {
         this.codepoint = codepoint;
index 9b066a4ff8903fd34ddab9806adc680a8ed755d6..7e228bb7ca4d2bb2e900920c6b186a485f1883f2 100644 (file)
@@ -47,9 +47,9 @@ public class JavaScriptCallbackHelper implements Serializable {
 
     private static final Method CALL_METHOD = ReflectTools.findMethod(
             JavaScriptCallbackRpc.class, "call", String.class, JsonArray.class);
-    private AbstractClientConnector connector;
+    private final AbstractClientConnector connector;
 
-    private Map<String, JavaScriptFunction> callbacks = new HashMap<>();
+    private final Map<String, JavaScriptFunction> callbacks = new HashMap<>();
     private JavaScriptCallbackRpc javascriptCallbackRpc;
 
     public JavaScriptCallbackHelper(AbstractClientConnector connector) {
index 588443d55bb3cf5b78fb50e1dcee7f4279a238f1..a5725e3d457faeda38cecb0685fca83209169495 100644 (file)
@@ -204,17 +204,17 @@ public class JsonCodec implements Serializable {
      * happens to process Vaadin requests, so it must be protected from
      * corruption caused by concurrent access.
      */
-    private static ConcurrentMap<Class<?>, Collection<BeanProperty>> typePropertyCache = new ConcurrentHashMap<>();
+    private static final ConcurrentMap<Class<?>, Collection<BeanProperty>> typePropertyCache = new ConcurrentHashMap<>();
 
-    private static Map<Class<?>, String> typeToTransportType = new HashMap<>();
+    private static final Map<Class<?>, String> typeToTransportType = new HashMap<>();
 
     /**
      * Note! This does not contain primitives.
      * <p>
      */
-    private static Map<String, Class<?>> transportTypeToType = new HashMap<>();
+    private static final Map<String, Class<?>> transportTypeToType = new HashMap<>();
 
-    private static Map<Class<?>, JSONSerializer<?>> customSerializers = new HashMap<>();
+    private static final Map<Class<?>, JSONSerializer<?>> customSerializers = new HashMap<>();
     static {
         customSerializers.put(Date.class, new DateSerializer());
     }
index b417c0f9eebb2ed4655753b050f5bf49a3280f3c..599d9bb3851548709aabed717fa468e33aacfee2 100644 (file)
@@ -42,7 +42,7 @@ public abstract class LegacyApplication implements ErrorHandler {
     private LegacyWindow mainWindow;
     private String theme = "reindeer";
 
-    private Map<String, LegacyWindow> legacyUINames = new HashMap<>();
+    private final Map<String, LegacyWindow> legacyUINames = new HashMap<>();
 
     private boolean isRunning = true;
 
index 7c438ca999f1940b5960a3db8b8dc2f0fb663afb..3ef17b618a20bd1beeaf423ac736055e28ebcaff 100644 (file)
@@ -69,7 +69,7 @@ public class LegacyCommunicationManager implements Serializable {
     private String requestThemeName;
 
     // TODO Refactor (#11413)
-    private Map<String, Class<?>> publishedFileContexts = new HashMap<>();
+    private final Map<String, Class<?>> publishedFileContexts = new HashMap<>();
 
     /**
      * TODO New constructor - document me!
index 98bbc8275a1b66114b700a8f8de28d38ff8bb558..c2b28d1cab5de11dc3587de66cb58db9829c1362 100644 (file)
@@ -41,9 +41,9 @@ import com.vaadin.ui.UI;
  */
 public class LocaleService implements Serializable {
 
-    private UI ui;
+    private final UI ui;
 
-    private LocaleServiceState state;
+    private final LocaleServiceState state;
 
     /**
      * Creates a LocaleService bound to the given UI
index d4eb2432f0fd625fa3795d8ab0d6302a71c3a814..d067ffc7dce8f28b573159c8dc4ca87b439d1984 100644 (file)
@@ -333,7 +333,7 @@ public class Page implements Serializable {
 
     private static class InjectedStyleString implements InjectedStyle {
 
-        private String css;
+        private final String css;
 
         public InjectedStyleString(String css) {
             this.css = css;
index 587bf0ae69e91921d2e7752d8ffb7e70cd18fbd6..d62acfa8c0636c0fb78fb882a025afbddb610e0d 100644 (file)
@@ -40,7 +40,7 @@ import org.w3c.dom.Element;
  */
 class RestrictedRenderResponse implements RenderResponse, Serializable {
 
-    private RenderResponse response;
+    private final RenderResponse response;
 
     RestrictedRenderResponse(RenderResponse response) {
         this.response = response;
index 17624b471221d35cd0964627037d4d4e83d6fab8..b53e4533f42da96655a5b3ff232df1666c0c705b 100644 (file)
@@ -30,8 +30,8 @@ import com.vaadin.shared.util.SharedUtil;
  * @author Vaadin Ltd
  */
 public class SizeWithUnit implements Serializable {
-    private float size;
-    private Unit unit;
+    private final float size;
+    private final Unit unit;
     private static final Pattern sizePattern = Pattern
             .compile(SharedUtil.SIZE_PATTERN);
 
index d731908e3177091c35fc582224aed29a22aea334..f3fa8ed0cc25ae54fc95823b92f3bd34c3c57509 100644 (file)
@@ -132,7 +132,7 @@ public interface Sizeable extends Serializable {
          */
         PERCENTAGE("%");
 
-        private String symbol;
+        private final String symbol;
 
         private Unit(String symbol) {
             this.symbol = symbol;
index 4a739760f4a65c9d3c3659fb256fff5fc68f0fa4..f7a5abadffb1d5fbad61f925d66531c4ccd77769 100644 (file)
@@ -47,7 +47,7 @@ public class VaadinPortletResponse implements VaadinResponse {
     }
 
     private final PortletResponse response;
-    private VaadinPortletService vaadinService;
+    private final VaadinPortletService vaadinService;
 
     /**
      * Wraps a portlet response and an associated vaadin service
index 07c3964f5d19082e547de21e3b4ded2881727bce..7513dd4d9755f1f283e1ff07b9f4dceb68e675e7 100644 (file)
@@ -31,7 +31,7 @@ import javax.servlet.http.HttpServletResponseWrapper;
 public class VaadinServletResponse extends HttpServletResponseWrapper
         implements VaadinResponse {
 
-    private VaadinServletService vaadinService;
+    private final VaadinServletService vaadinService;
 
     /**
      * Wraps a http servlet response and an associated vaadin service
index d2cf4e740a26706241c171799b9acd4918df373c..ebda81b9c7eb2bd665f5704d689552a3499e0bde 100644 (file)
@@ -85,7 +85,7 @@ public class VaadinSession implements HttpSessionBindingListener, Serializable {
         private final Map<Class<?>, CurrentInstance> instances = CurrentInstance
                 .getInstances(true);
         private final VaadinSession session;
-        private Runnable runnable;
+        private final Runnable runnable;
 
         /**
          * Creates an instance for the given runnable
index 60ab1d0651f259b3cef871393632a242331440c8..1189ff602368bbff35afd2fe1ff5530b36ea3fca 100644 (file)
@@ -131,7 +131,7 @@ public class AtmospherePushConnection implements PushConnection {
         CONNECTED;
     }
 
-    private UI ui;
+    private final UI ui;
     private transient State state = State.DISCONNECTED;
     private transient AtmosphereResource resource;
     private transient FragmentedMessage incomingMessage;
index 95b796a2c70488300129933c5377b68420e27285..2119de6f37975d2706279a22a4d4c569b59597a0 100644 (file)
@@ -65,8 +65,8 @@ public class JSR356WebsocketInitializer implements ServletContextListener {
      */
     public static class FakeServletConfig implements ServletConfig {
 
-        private ServletRegistration servletRegistration;
-        private ServletContext servletContext;
+        private final ServletRegistration servletRegistration;
+        private final ServletContext servletContext;
 
         public FakeServletConfig(ServletRegistration servletRegistration,
                 ServletContext servletContext) {
index 5423226e6ad5d4faa73fd478719629682cbd0cfa..75a5c9d94f0fd12a4b1eacae1de6b970a128cc72 100644 (file)
@@ -156,7 +156,7 @@ public class PushHandler {
         }
     };
 
-    private VaadinServletService service;
+    private final VaadinServletService service;
 
     public PushHandler(VaadinServletService service) {
         this.service = service;
index 0f5ce37fa96691e3f7a2004ab6548f2d8d6f7261..6afb6434a4c378462f9830cb10daba4b1d2adaac 100644 (file)
@@ -51,7 +51,7 @@ public class UidlRequestHandler extends SynchronizedRequestHandler
 
     public static final String UIDL_PATH = "UIDL/";
 
-    private ServerRpcHandler rpcHandler;
+    private final ServerRpcHandler rpcHandler;
 
     public UidlRequestHandler() {
         rpcHandler = createRpcHandler();
index 2eedeb6839656eaaf5356d9f3a23b082b0530242..3ca31de15a39a1699b0d75cfc0f1a62fa0fd4a19 100644 (file)
@@ -30,8 +30,8 @@ import com.vaadin.server.SerializableFunction;
  */
 public class BackEndDataSource<T> extends AbstractDataSource<T> {
 
-    private SerializableFunction<Query, Stream<T>> request;
-    private SerializableFunction<Query, Integer> sizeCallback;
+    private final SerializableFunction<Query, Stream<T>> request;
+    private final SerializableFunction<Query, Integer> sizeCallback;
 
     /**
      * Constructs a new DataSource to request data from an arbitrary back end
index a0ce85989282a58ad0c155b18b5137924708c1c4..24bb464722e95f5dbba94c5ca1c1df13549509a4 100644 (file)
@@ -177,11 +177,11 @@ public class DataCommunicator<T> extends AbstractExtension {
         }
     }
 
-    private Collection<DataGenerator<T>> generators = new LinkedHashSet<>();
-    private ActiveDataHandler handler = new ActiveDataHandler();
+    private final Collection<DataGenerator<T>> generators = new LinkedHashSet<>();
+    private final ActiveDataHandler handler = new ActiveDataHandler();
 
     private DataSource<T> dataSource = DataSource.create();
-    private DataKeyMapper<T> keyMapper;
+    private final DataKeyMapper<T> keyMapper;
 
     private boolean reset = false;
     private final Set<T> updatedData = new HashSet<>();
@@ -189,8 +189,8 @@ public class DataCommunicator<T> extends AbstractExtension {
 
     private Comparator<T> inMemorySorting;
     private SerializablePredicate<T> inMemoryFilter;
-    private List<SortOrder<String>> backEndSorting = new ArrayList<>();
-    private DataCommunicatorClientRpc rpc;
+    private final List<SortOrder<String>> backEndSorting = new ArrayList<>();
+    private final DataCommunicatorClientRpc rpc;
 
     public DataCommunicator() {
         addDataGenerator(handler);
index b5e377fffcabf1d375cf479f22b2b0dbad1e0227..7e7539b865c4eaed9682dcaaf2aa801a03e9ca71 100644 (file)
@@ -98,14 +98,14 @@ public class ClassPathExplorer {
      * entries that could include widgets/widgetsets are listed (primarily
      * directories, Vaadin JARs and add-on JARs).
      */
-    private static List<String> rawClasspathEntries = getRawClasspathEntries();
+    private static final List<String> rawClasspathEntries = getRawClasspathEntries();
 
     /**
      * Map from identifiers (either a package name preceded by the path and a
      * slash, or a URL for a JAR file) to the corresponding URLs. This is
      * constructed from the class path.
      */
-    private static Map<String, URL> classpathLocations = getClasspathLocations(
+    private static final Map<String, URL> classpathLocations = getClasspathLocations(
             rawClasspathEntries);
 
     private static boolean debug = false;
index e968568a09f53f2606dd0f328fe86e3f11d85ad8..49d020d32fb1edbe3f6b9a817ebbe2abc89278db 100644 (file)
@@ -55,12 +55,11 @@ public class AbsoluteLayout extends AbstractLayout
     private static final String ATTR_Z_INDEX = ":z-index";
 
     private final AbsoluteLayoutServerRpc rpc = (MouseEventDetails mouseDetails,
-            Connector clickedConnector) -> {
-        fireEvent(LayoutClickEvent.createEvent(AbsoluteLayout.this,
-                mouseDetails, clickedConnector));
-    };
+            Connector clickedConnector) -> fireEvent(
+                    LayoutClickEvent.createEvent(AbsoluteLayout.this,
+                            mouseDetails, clickedConnector));
     // Maps each component to a position
-    private LinkedHashMap<Component, ComponentPosition> componentToCoordinates = new LinkedHashMap<>();
+    private final LinkedHashMap<Component, ComponentPosition> componentToCoordinates = new LinkedHashMap<>();
 
     /**
      * Creates an AbsoluteLayout with full size.
index 7f79cecf551512273a0443ce9b2de6e42c1d0639..7a40798815686267fb6904271bd8d3d1c18bb74b 100644 (file)
@@ -75,7 +75,7 @@ public abstract class AbstractColorPicker extends AbstractField<Color> {
         /** A simple popup with only the swatches (palette) tab. */
         POPUP_SIMPLE("simple");
 
-        private String style;
+        private final String style;
 
         PopupStyle(String styleName) {
             style = styleName;
index 580754be01355807d79a9e665e3b292c1230d949..8e70e9cb039a09e9d2b260e0c3fcfcffd2c15c21 100644 (file)
@@ -149,7 +149,7 @@ import elemental.json.JsonValue;
  * @since 7.0.0
  */
 public abstract class AbstractJavaScriptComponent extends AbstractComponent {
-    private JavaScriptCallbackHelper callbackHelper = new JavaScriptCallbackHelper(
+    private final JavaScriptCallbackHelper callbackHelper = new JavaScriptCallbackHelper(
             this);
 
     @Override
index 6c995611fbec323785be70e019963d3e17c78a28..6858a18999a32c10f98d32de4c8253e9413033fc 100644 (file)
@@ -45,10 +45,10 @@ public abstract class AbstractOrderedLayout extends AbstractLayout
         LayoutClickNotifier, Layout.MarginHandler {
 
     private final AbstractOrderedLayoutServerRpc rpc = (
-            MouseEventDetails mouseDetails, Connector clickedConnector) -> {
-        fireEvent(LayoutClickEvent.createEvent(AbstractOrderedLayout.this,
-                mouseDetails, clickedConnector));
-    };
+            MouseEventDetails mouseDetails,
+            Connector clickedConnector) -> fireEvent(
+                    LayoutClickEvent.createEvent(AbstractOrderedLayout.this,
+                            mouseDetails, clickedConnector));
 
     public static final Alignment ALIGNMENT_DEFAULT = Alignment.TOP_LEFT;
 
index 73bedc8470377cfbffefdef88353406ae4983c0f..e7a66cebe53ea08bb33f15930e13b9ff6cc2caae 100644 (file)
@@ -54,7 +54,7 @@ public abstract class AbstractSplitPanel extends AbstractComponentContainer {
     private Unit posMinUnit;
     private Unit posMaxUnit;
 
-    private AbstractSplitPanelRpc rpc = new AbstractSplitPanelRpc() {
+    private final AbstractSplitPanelRpc rpc = new AbstractSplitPanelRpc() {
 
         @Override
         public void splitterClick(MouseEventDetails mouseDetails) {
index fd2c0029d15593f8f6d9921824987e87cf38e719..2ba6f5e89591866421537dc82ef2431300827f98 100644 (file)
@@ -68,8 +68,8 @@ import elemental.json.JsonObject;
 public class ConnectorTracker implements Serializable {
 
     private final HashMap<String, ClientConnector> connectorIdToConnector = new HashMap<>();
-    private Set<ClientConnector> dirtyConnectors = new HashSet<>();
-    private Set<ClientConnector> uninitializedConnectors = new HashSet<>();
+    private final Set<ClientConnector> dirtyConnectors = new HashSet<>();
+    private final Set<ClientConnector> uninitializedConnectors = new HashSet<>();
 
     /**
      * Connectors that have been unregistered and should be cleaned up the next
@@ -80,7 +80,7 @@ public class ConnectorTracker implements Serializable {
 
     private boolean writingResponse = false;
 
-    private UI uI;
+    private final UI uI;
     private transient Map<ClientConnector, JsonObject> diffStates = new HashMap<>();
 
     /** Maps connectorIds to a map of named StreamVariables */
@@ -96,7 +96,7 @@ public class ConnectorTracker implements Serializable {
      * @see #getCurrentSyncId()
      * @see #cleanConcurrentlyRemovedConnectorIds(long)
      */
-    private TreeMap<Integer, Set<String>> syncIdToUnregisteredConnectorIds = new TreeMap<>();
+    private final TreeMap<Integer, Set<String>> syncIdToUnregisteredConnectorIds = new TreeMap<>();
 
     /**
      * Gets a logger for this class
index 7f2e5582200a32885796735bbce3b1e7035f2b43..4b9a7afbfbf4614cda71af7c50b404888489440e 100644 (file)
@@ -351,7 +351,7 @@ public class DragAndDropWrapper extends CustomComponent
 
     final class ProxyReceiver implements StreamVariable {
 
-        private String id;
+        private final String id;
         private Html5File file;
 
         public ProxyReceiver(String id, Html5File file) {
@@ -425,7 +425,7 @@ public class DragAndDropWrapper extends CustomComponent
         class ReceivingEventWrapper implements StreamingErrorEvent,
                 StreamingEndEvent, StreamingStartEvent, StreamingProgressEvent {
 
-            private StreamingEvent wrappedEvent;
+            private final StreamingEvent wrappedEvent;
 
             ReceivingEventWrapper(StreamingEvent e) {
                 wrappedEvent = e;
index b738b713234759fc115985b3f750cf2f54c7ac08..63c8fe3e6f2c8fa52526d16114f1550b63aabf95 100644 (file)
@@ -650,8 +650,8 @@ public class Grid<T> extends AbstractSingleSelect<T> implements HasComponents {
      */
     public static class DetailsManager<T> extends AbstractGridExtension<T> {
 
-        private Set<T> visibleDetails = new HashSet<>();
-        private Map<T, Component> components = new HashMap<>();
+        private final Set<T> visibleDetails = new HashSet<>();
+        private final Map<T, Component> components = new HashMap<>();
         private DetailsGenerator<T> generator;
 
         /**
@@ -1821,17 +1821,17 @@ public class Grid<T> extends AbstractSingleSelect<T> implements HasComponents {
         }
     };
 
-    private Set<Column<T, ?>> columnSet = new LinkedHashSet<>();
-    private Map<String, Column<T, ?>> columnKeys = new HashMap<>();
+    private final Set<Column<T, ?>> columnSet = new LinkedHashSet<>();
+    private final Map<String, Column<T, ?>> columnKeys = new HashMap<>();
 
-    private List<SortOrder<Column<T, ?>>> sortOrder = new ArrayList<>();
-    private DetailsManager<T> detailsManager;
-    private Set<Component> extensionComponents = new HashSet<>();
+    private final List<SortOrder<Column<T, ?>>> sortOrder = new ArrayList<>();
+    private final DetailsManager<T> detailsManager;
+    private final Set<Component> extensionComponents = new HashSet<>();
     private StyleGenerator<T> styleGenerator = item -> null;
     private DescriptionGenerator<T> descriptionGenerator;
 
-    private Header header = new HeaderImpl();
-    private Footer footer = new FooterImpl();
+    private final Header header = new HeaderImpl();
+    private final Footer footer = new FooterImpl();
 
     private int counter = 0;
 
index b3fcdb826f4dcff84bf7f6fe5603e94820562e0d..b4434e75c920cc254c3bd4822b717cf73ef78136 100644 (file)
@@ -27,10 +27,10 @@ import com.vaadin.server.StreamVariable;
  */
 public class Html5File implements Serializable {
 
-    private String name;
-    private long size;
+    private final String name;
+    private final long size;
     private StreamVariable streamVariable;
-    private String type;
+    private final String type;
 
     Html5File(String name, long size, String mimeType) {
         this.name = name;
index 32b9356d76e7b46d7b867965f9b1165c2611fab2..bd56036aee922bce3799bba354f67fd56b4be77b 100644 (file)
@@ -83,7 +83,7 @@ public interface LoadingIndicatorConfiguration extends Serializable {
 
 class LoadingIndicatorConfigurationImpl
         implements LoadingIndicatorConfiguration {
-    private UI ui;
+    private final UI ui;
 
     public LoadingIndicatorConfigurationImpl(UI ui) {
         this.ui = ui;
index 74432d001a1e21e07e5de285a0bb0cf7b761cc21..9acd0735b181fe5be00719570cf0f7bda6ca5591 100644 (file)
@@ -62,7 +62,7 @@ public class LoginForm extends AbstractSingleComponentContainer {
      */
     public static class LoginEvent extends Component.Event {
 
-        private Map<String, String> params;
+        private final Map<String, String> params;
 
         /**
          * Creates a login event using the given source and the given
index 536598448bd533d0f8b1b57a1cfa549c430d87b3..7ee78fb8077d29f562085b952939d2754f32e38d 100644 (file)
@@ -70,7 +70,7 @@ public class Notification implements Serializable {
          */
         ASSISTIVE_NOTIFICATION("assistive");
 
-        private String style;
+        private final String style;
 
         Type(String style) {
             this.style = style;
index f7591af13c18f48565289f2862662ee81c9ef04d..0062bb969fc7e18554da37bbf6edf12d818601a3 100644 (file)
@@ -118,7 +118,7 @@ public interface NotificationConfiguration extends Serializable {
 
 class NotificationConfigurationImpl implements NotificationConfiguration {
 
-    private UI ui;
+    private final UI ui;
 
     public NotificationConfigurationImpl(UI ui) {
         this.ui = ui;
index cad96a5952a4b892d2f0d0b6842b1932c1986707..bb722ec2d2ec394376d4332711abe57a963db5f7 100644 (file)
@@ -165,7 +165,7 @@ public interface PushConfiguration extends Serializable {
 }
 
 class PushConfigurationImpl implements PushConfiguration {
-    private UI ui;
+    private final UI ui;
 
     public PushConfigurationImpl(UI ui) {
         this.ui = ui;
index d4df9fdf2815d1efc67118f54569e4f6f02b7417..8a36de3510c96d84ee738b8e50a268b05a27971f 100644 (file)
@@ -132,7 +132,7 @@ public interface ReconnectDialogConfiguration extends Serializable {
 }
 
 class ReconnectDialogConfigurationImpl implements ReconnectDialogConfiguration {
-    private UI ui;
+    private final UI ui;
 
     public ReconnectDialogConfigurationImpl(UI ui) {
         this.ui = ui;
index 562316635788b887e9dbc6fc531fae0865ba360e..7ad40c2771ad4c57ffb5238ba4c676b5f6236af7 100644 (file)
@@ -1101,7 +1101,7 @@ public class TabSheet extends AbstractComponentContainer
      */
     public class TabSheetTabImpl implements Tab {
 
-        private TabState tabState;
+        private final TabState tabState;
 
         private Focusable defaultFocus;
 
index b5af10961becf2d4ff3ca7c6d89007cf22cfa104..1bf9fd7b81243161b9ae0422f9c1824723f6abb4 100644 (file)
@@ -123,7 +123,7 @@ public interface TooltipConfiguration extends Serializable {
 }
 
 class TooltipConfigurationImpl implements TooltipConfiguration {
-    private UI ui;
+    private final UI ui;
 
     public TooltipConfigurationImpl(UI ui) {
         this.ui = ui;
index a32378aeaf22df2ebc570559032d5d08f3737f93..ae1c304fd29b1a41eed9a75cc2310fab4969e197 100644 (file)
@@ -40,7 +40,7 @@ public class ColorPickerHistory extends CustomField<Color> {
     private static final int COLUMNS = 15;
 
     /** Temporary color history for when the component is detached. */
-    private ArrayBlockingQueue<Color> tempHistory = new ArrayBlockingQueue<>(
+    private final ArrayBlockingQueue<Color> tempHistory = new ArrayBlockingQueue<>(
             ROWS * COLUMNS);
 
     @Override
index 20d68da0fa79906ddd0f4367d02df34a9a8d5987..ec200082ab835e4d7fac92482b4a117caa3a84be 100644 (file)
@@ -38,7 +38,7 @@ public class ColorPickerSelect extends CustomField<Color> {
         ALL("All colors"), RED("Red colors"), GREEN("Green colors"), BLUE(
                 "Blue colors");
 
-        private String caption;
+        private final String caption;
 
         ColorRange(String caption) {
             this.caption = caption;
index eb02be2bbc3df4963a7d86c00d2fa74170a885f8..678ab2a9356b90b9efda49fb549c15bc06b8c4ed 100644 (file)
@@ -150,8 +150,8 @@ public abstract class StaticSection<ROW extends StaticSection.StaticRow<?>>
      */
     abstract static class StaticCell implements Serializable {
 
-        private CellState cellState = new CellState();
-        private StaticRow<?> row;
+        private final CellState cellState = new CellState();
+        private final StaticRow<?> row;
 
         protected StaticCell(StaticRow<?> row) {
             this.row = row;
index 00fb32392c02f20cbbc86afdaa1ffced20254752..5b0968bae63109717d1961843abd5019b5932a1b 100644 (file)
@@ -430,7 +430,7 @@ public class DesignAttributeHandler implements Serializable {
      * @author Vaadin Ltd
      */
     private static class AttributeCacheEntry implements Serializable {
-        private Map<String, Method[]> accessMethods = new ConcurrentHashMap<>();
+        private final Map<String, Method[]> accessMethods = new ConcurrentHashMap<>();
 
         private void addAttribute(String attribute, Method getter,
                 Method setter) {
index c8e794c46adfe946fa43dc5b24520990bb562a41..761c7edd0450d1874b3adafede66d10064114cd1 100644 (file)
@@ -686,9 +686,9 @@ public class DesignContext implements Serializable {
      * @author Vaadin Ltd
      */
     public class ComponentCreatedEvent implements Serializable {
-        private String localId;
-        private Component component;
-        private DesignContext context;
+        private final String localId;
+        private final Component component;
+        private final DesignContext context;
 
         /**
          * Creates a new instance of ComponentCreatedEvent
index 93ccee3f374702c748fe83edd7765439a8b151ba..a32c68998f2a86262b7a398e4f4d7bad04d89d83 100644 (file)
@@ -33,7 +33,7 @@ import com.vaadin.ui.declarative.DesignAttributeHandler;
 public class DesignEnumConverter<T extends Enum>
         implements Converter<String, T> {
 
-    private Class<T> type;
+    private final Class<T> type;
 
     /**
      * Creates a converter for the given enum type.
index ef6e10ef5c57031f206b6f310a758d8ce2314ace..c03d3750d10eb4d99ace19542dff64e87e130f3f 100644 (file)
@@ -170,7 +170,7 @@ public class DesignResourceConverter implements Converter<String, Resource> {
             return ((ExternalResource) value).getURL();
         }
 
-        private static Map<Class<? extends Resource>, ResourceConverterByProtocol> typeToConverter = new HashMap<>();
+        private static final Map<Class<? extends Resource>, ResourceConverterByProtocol> typeToConverter = new HashMap<>();
         static {
             typeToConverter.put(ExternalResource.class, HTTP);
             // ^ any of non-specialized would actually work
index 3073517b6584fcb04975d0ec1f1003e371c8e4a9..8686c391c5487a4127596cca3ae7ef15fdd6f83a 100644 (file)
@@ -70,8 +70,8 @@ public abstract class ClickableRenderer<T, V> extends AbstractRenderer<T, V> {
      */
     public static class RendererClickEvent<T> extends ClickEvent {
 
-        private T item;
-        private Column column;
+        private final T item;
+        private final Column column;
 
         protected RendererClickEvent(Grid<T> source, T item, Column column,
                 MouseEventDetails mouseEventDetails) {
index f8d6af2a4c5ce61526f0333431ce97a6b5d4dd59..43b158a4ff978a98469095bc15f66c890a0fc684 100644 (file)
@@ -64,7 +64,7 @@ public class CurrentInstance implements Serializable {
     private final WeakReference<Object> instance;
     private final boolean inheritable;
 
-    private static InheritableThreadLocal<Map<Class<?>, CurrentInstance>> instances = new InheritableThreadLocal<Map<Class<?>, CurrentInstance>>() {
+    private static final InheritableThreadLocal<Map<Class<?>, CurrentInstance>> instances = new InheritableThreadLocal<Map<Class<?>, CurrentInstance>>() {
         @Override
         protected Map<Class<?>, CurrentInstance> childValue(
                 Map<Class<?>, CurrentInstance> parentValue) {
index 4df2785ce8260dd14455b886ad69049efc298d52..4cbac69df5d3dcd6a1d4a68b6a53f0bb145a0c19 100644 (file)
@@ -53,7 +53,7 @@ public class FileTypeResolver implements Serializable {
     /**
      * Initial file extension to mime-type mapping.
      */
-    static private String initialExtToMIMEMap = "application/cu-seeme                            csm cu,"
+    private static final String initialExtToMIMEMap = "application/cu-seeme                            csm cu,"
             + "application/dsptype                             tsp,"
             + "application/futuresplash                        spl,"
             + "application/mac-binhex40                        hqx,"
index 5b6b06c0c18807ef42a6c11d4901c85e8c4e9ab9..41ef150d519d8183e3d997ca57b4a15368795562 100644 (file)
@@ -105,7 +105,7 @@ public class SerializerHelper {
      * List of primitive classes. Google App Engine has problems
      * serializing/deserializing these (#3064).
      */
-    private static Class<?>[] primitiveClasses = new Class<?>[] { byte.class,
+    private static final Class<?>[] primitiveClasses = new Class<?>[] { byte.class,
             short.class, int.class, long.class, float.class, double.class,
             boolean.class, char.class };
 
index 3b35f86144a6fe73c392d8665afb86aa4c65d388..f59c89e1d84507a418346cc2cb4ee6184972725c 100644 (file)
@@ -54,7 +54,7 @@ public class BinderMultiSelectTest
         }
     }
 
-    private Binder<AtomicReference<String>> converterBinder = new Binder<>();
+    private final Binder<AtomicReference<String>> converterBinder = new Binder<>();
 
     private CheckBoxGroup<TestEnum> select;
 
index da30f56743c50811872f8ab4a9e3e08ab0fea730..016018a6b3bc8aa20c9bd4927c126ddbab107aaf 100644 (file)
@@ -78,7 +78,7 @@ public class Jsr303Test {
 
     public static class Jsr303UnitTest implements UnitTest {
 
-        private TextField nameField = new TextField();
+        private final TextField nameField = new TextField();
 
         @Override
         public void execute() {
index dd2b1be50bf89157d553893ddcac8b3c3fdd0106..7fb1c2ff7605889569e5ef93d9342a181bfbade3 100644 (file)
@@ -7,7 +7,7 @@ import org.junit.Test;
 
 public class StringLengthValidatorTest extends ValidatorTestBase {
 
-    private static String LONG_STRING = Stream.generate(() -> "x").limit(1000)
+    private static final String LONG_STRING = Stream.generate(() -> "x").limit(1000)
             .collect(Collectors.joining());
 
     @Test
index c274bf35c3473fa756a098e35f914e54121f679b..2d4e7fad0a5997e3158f4e8ee710d75991518d85 100644 (file)
@@ -95,7 +95,7 @@ public class AbstractDeploymentConfigurationTest {
     private static class DeploymentConfigImpl
             extends AbstractDeploymentConfiguration {
 
-        private Properties properties;
+        private final Properties properties;
 
         DeploymentConfigImpl(Properties props) {
             properties = props;
index f302163ef7f191217017dbb48e505d66cac99dbf..81f45f6173c43d70102b0681c9edbd48c3cafacd 100644 (file)
@@ -13,7 +13,7 @@ import org.junit.Before;
 import org.junit.Test;
 
 public class DownloadStreamTest {
-    private String filename = "日本語.png";
+    private final String filename = "日本語.png";
     private DownloadStream stream;
 
     @Before
index 04d516ecb4d62c44795743221934491ebb29691f..07854560b39eaae321832289678bb4f146f70cba 100644 (file)
@@ -66,5 +66,5 @@ public class MockVaadinSession extends VaadinSession {
 
     private int closeCount;
 
-    private ReentrantLock lock = new ReentrantLock();
+    private final ReentrantLock lock = new ReentrantLock();
 }
index 3726ed7cea7020a10e0ca87cd0f969892b2b9795..60b2b2a02d6e6de17b42344d80b3cb27e8fdfc11 100644 (file)
@@ -58,7 +58,7 @@ public class FileUploadHandlerTest {
     @Mock
     private OutputStream responseOutput;
 
-    private int uiId = 123;
+    private final int uiId = 123;
     private final String connectorId = "connectorId";
     private final String variableName = "name";
     private final String expectedSecurityKey = "key";
index b82d571f9b319a283ff56cc5ff8ec14552db032a..c9a30fa517964bc4140b558f397bb39acd117c38 100644 (file)
@@ -85,7 +85,7 @@ public class DataCommunicatorTest {
         }
     }
 
-    private MockVaadinSession session = new MockVaadinSession(
+    private final MockVaadinSession session = new MockVaadinSession(
             Mockito.mock(VaadinService.class));
 
     @Test
index 24f478ad47ad24c130db11f85617c384a0a46a1d..44650d63bbf3029f6dc93c48f758502bce317edd 100644 (file)
@@ -7,7 +7,7 @@ import java.util.Random;
 
 class StrBean implements Serializable {
 
-    private static String[] values = new String[] { "Foo", "Bar", "Baz" };
+    private static final String[] values = new String[] { "Foo", "Bar", "Baz" };
 
     private String value;
     private final int id;
index fc8f22a9477fee526990dd8ad938fdda8c610098..934a2ce696389a35663abc9176445c6d83f56425 100644 (file)
@@ -3,7 +3,7 @@ package com.vaadin.tests.data.bean;
 public enum AnotherTestEnum {
     ONE("ONE"), TWO("TWO");
 
-    private String id;
+    private final String id;
 
     private AnotherTestEnum(String id) {
         this.id = id;
index 9f0b244360940904f0acbae30218381a23d77dfe..23270cab5e89c8175fb33e45f72a1ade15d3102b 100644 (file)
@@ -42,7 +42,7 @@ public class BeanToValidate {
     @Valid
     private Address address;
 
-    private String readOnlyProperty = "READONLY DATA";
+    private final String readOnlyProperty = "READONLY DATA";
 
     private String writeOnlyProperty;
 
index 159333212f175541d334b12952b72008484f9b28..c7795d5f6dd0fb3c1952fe5faae350db718e35fa 100644 (file)
@@ -5,7 +5,7 @@ public enum Country {
     FINLAND("Finland"), SWEDEN("Sweden"), USA("USA"), RUSSIA(
             "Russia"), NETHERLANDS("Netherlands"), SOUTH_AFRICA("South Africa");
 
-    private String name;
+    private final String name;
 
     private Country(String name) {
         this.name = name;
index a4e3f20a111ba4a67186cbc0fd78b6ae26a424db..489588c64093d5d459242a59dd2958f3d22efc8d 100644 (file)
@@ -3,7 +3,7 @@ package com.vaadin.tests.data.bean;
 public enum Sex {
     MALE("Male"), FEMALE("Female"), UNKNOWN("Unknown");
 
-    private String stringRepresentation;
+    private final String stringRepresentation;
 
     private Sex(String stringRepresentation) {
         this.stringRepresentation = stringRepresentation;
index bf6f721052ff3e6bc405bb7e41cd018a721fac4c..f79298b6ad3d71fa589f7ef4c4c090d80f65a210 100644 (file)
@@ -3,7 +3,7 @@ package com.vaadin.tests.data.bean;
 public enum TestEnum {
     ONE("1"), TWO("2");
 
-    private String id;
+    private final String id;
 
     private TestEnum(String id) {
         this.id = id;
index 4de05b9f091a3aa3b9628880cea4781e3b02209d..d3d539ae8fc19f166a37d080f938eefbe1a80f38 100644 (file)
@@ -21,7 +21,7 @@ public class StringToBooleanConverterTest extends AbstractStringConverterTest {
             getErrorMessage(), "yes", "no");
     private StringToBooleanConverter emptyTrueConverter = new StringToBooleanConverter(
             getErrorMessage(), "", "ABSENT");
-    private StringToBooleanConverter localeConverter = new StringToBooleanConverter(
+    private final StringToBooleanConverter localeConverter = new StringToBooleanConverter(
             getErrorMessage()) {
         @Override
         public String getFalseString(Locale locale) {
index 2b73408abc42035b476e9e4b8ed936dbec53391b..3e8e4dccd6b4830ac377eb2d769f49f785f9ef91 100644 (file)
@@ -31,7 +31,7 @@ import com.vaadin.ui.Flash;
 public abstract class DeclarativeTestBase<T extends Component>
         extends DeclarativeTestBaseBase<T> {
 
-    private static boolean debug = false;
+    private static final boolean debug = false;
 
     private final Map<Class<?>, EqualsAsserter<?>> comparators = new HashMap<>();
     private static final EqualsAsserter standardEqualsComparator = (EqualsAsserter<Object>) Assert::assertEquals;
index 28d419b27edce5e3b79d22945e7d386ab03d0b8a..b1f6297d9e0dd6f8410889c482547e477a03c585 100644 (file)
@@ -18,7 +18,7 @@ package com.vaadin.tests.design.designroot;
 import com.vaadin.ui.TextField;
 
 public class ExtendedDesignWithAnnotation extends DesignWithAnnotation {
-    private TextField customField = new TextField();
+    private final TextField customField = new TextField();
 
     public ExtendedDesignWithAnnotation() {
         customField.setPlaceholder("Something");
index ea23f847cf8c3f7a5866b802030c0dc7c6492276..cfea7a6fdab72561982ecd3d889de24da793679c 100644 (file)
@@ -23,7 +23,7 @@ import com.vaadin.ui.TextField;
 public class ExtendedDesignWithEmptyAnnotation
         extends DesignWithEmptyAnnotation {
 
-    private TextField customField = new TextField();
+    private final TextField customField = new TextField();
 
     public ExtendedDesignWithEmptyAnnotation() {
         super();
index 6479e1995acd50819e73336949e41352a0fa0ee9..341397ff814e7d2f49aee049e293cf5fa6a9a2a4 100644 (file)
@@ -49,7 +49,7 @@ import com.vaadin.ui.declarative.Design;
  */
 public class NestedCustomLayoutsTest {
 
-    private static String PACKAGE_MAPPING = "com_vaadin_tests_design_nested_customlayouts:com.vaadin.tests.design.nested.customlayouts";
+    private static final String PACKAGE_MAPPING = "com_vaadin_tests_design_nested_customlayouts:com.vaadin.tests.design.nested.customlayouts";
 
     @Test
     public void testNestedLayouts() throws IOException {
index 865856f79cb734c197e611a8f36c97a1e65328d0..e33f8373cea2c1f2b392502b53ace8c68b5c7e44 100644 (file)
@@ -38,11 +38,11 @@ public class ClassesSerializableTest {
      * JARs that will be scanned for classes to test, in addition to classpath
      * directories.
      */
-    private static String JAR_PATTERN = ".*vaadin.*\\.jar";
+    private static final String JAR_PATTERN = ".*vaadin.*\\.jar";
 
-    private static String[] BASE_PACKAGES = { "com.vaadin" };
+    private static final String[] BASE_PACKAGES = { "com.vaadin" };
 
-    private static String[] EXCLUDED_PATTERNS = { "com\\.vaadin\\.demo\\..*", //
+    private static final String[] EXCLUDED_PATTERNS = { "com\\.vaadin\\.demo\\..*", //
             "com\\.vaadin\\.external\\.org\\.apache\\.commons\\.fileupload\\..*", //
             "com\\.vaadin\\.launcher\\..*", //
             "com\\.vaadin\\.client\\..*", //
index 22d2fb283bcb349b7f6ef32ea5df54ceae972875..2f4ba832d3b64b081215532cedd940821c29e820 100644 (file)
@@ -184,7 +184,7 @@ public class CsrfTokenMissingTest {
                 rpcRequest.getCsrfToken());
     }
 
-    private static Logger LOGGER = Logger
+    private static final Logger LOGGER = Logger
             .getLogger(CsrfTokenMissingTest.class.getName());
     static {
         LOGGER.setLevel(Level.ALL);
index b870e0ab4f155f2ad52989f1df3b916769259814..7a44e861da1bbca67ead22892edd6f51208a2323 100644 (file)
@@ -151,7 +151,7 @@ public class AttachDetachListenersTest {
     public static class EventEquals<E extends ConnectorEvent>
             implements IArgumentMatcher {
 
-        private E expected;
+        private final E expected;
 
         public EventEquals(E expected) {
             this.expected = expected;
index 57647f1e6a0818b837aa60ee503962b019272071..70b7b0b77ced203f3521dd3493e7d3ffdcc3580e 100644 (file)
@@ -19,7 +19,7 @@ import com.vaadin.ui.UI;
 
 public class StateGetDoesNotMarkDirtyTest {
 
-    private Set<String> excludedMethods = new HashSet<>();
+    private final Set<String> excludedMethods = new HashSet<>();
 
     @Before
     public void setUp() {
index 4da1b1380afe374cea6145b1eae4960d81f599d2..9fe1e4210ae474029191545f8c352d5771d5c66a 100644 (file)
@@ -16,7 +16,7 @@ import com.vaadin.ui.Layout;
 
 public class AddComponentsTest {
 
-    private Component[] children = new Component[] { new Label("A"),
+    private final Component[] children = new Component[] { new Label("A"),
             new Label("B"), new Label("C"), new Label("D") };
 
     @Test
index d4880a3d2e50f257b528192f9b013fb9c9d6e9df..9d60628e127134e7c4fd56a3f57f348bb3d868fd 100644 (file)
@@ -142,6 +142,6 @@ public class CustomLayoutTest {
 
         private int readCount;
         private boolean isClosed;
-        private int maxArrayLength;
+        private final int maxArrayLength;
     }
 }
index f42b9a5683ef3ac342d578c06f3a842bd189073b..bd8c2dd4436313df8506d38aca56900a57b2f5d7 100644 (file)
@@ -23,7 +23,7 @@ public class MenuBarIdsTest implements Command {
     private MenuItem menuFileOpen;
     private MenuItem menuFileSave;
     private MenuItem menuFileExit;
-    private Set<MenuItem> menuItems = new HashSet<>();
+    private final Set<MenuItem> menuItems = new HashSet<>();
 
     private MenuBar menuBar;
 
index f7a78b34ec5c14ad0ad7780b051e347ff886e6fe..4e4f5160bae2dfa69414541039e0eee692596642 100644 (file)
@@ -37,7 +37,7 @@ public class CustomUIClassLoaderTest {
      */
     public class LoggingClassLoader extends ClassLoader {
 
-        private List<String> requestedClasses = new ArrayList<>();
+        private final List<String> requestedClasses = new ArrayList<>();
 
         @Override
         protected synchronized Class<?> loadClass(String name, boolean resolve)
index 5d0c0cc55d027cf0d0b4a84f80d27b64576ee67b..872683cec32a4e7cb01c0908c4741a492155e3a9 100644 (file)
@@ -21,7 +21,7 @@ import com.vaadin.ui.Window;
 
 public class AttachDetachWindowTest {
 
-    private VaadinSession testApp = new AlwaysLockedVaadinSession(null);
+    private final VaadinSession testApp = new AlwaysLockedVaadinSession(null);
 
     private interface TestContainer {
         public boolean attachCalled();
@@ -36,7 +36,7 @@ public class AttachDetachWindowTest {
     private class TestWindow extends Window implements TestContainer {
         boolean windowAttachCalled = false;
         boolean windowDetachCalled = false;
-        private TestContent testContent = new TestContent();
+        private final TestContent testContent = new TestContent();
 
         TestWindow() {
             setContent(testContent);
@@ -81,7 +81,7 @@ public class AttachDetachWindowTest {
         boolean contentAttachCalled = false;
         boolean childAttachCalled = false;
 
-        private Label child = new Label() {
+        private final Label child = new Label() {
             @Override
             public void attach() {
                 super.attach();
@@ -115,7 +115,7 @@ public class AttachDetachWindowTest {
     private class TestUI extends UI implements TestContainer {
         boolean rootAttachCalled = false;
         boolean rootDetachCalled = false;
-        private TestContent testContent = new TestContent();
+        private final TestContent testContent = new TestContent();
 
         public TestUI() {
             setContent(testContent);
index be3f402e168cce573d390e9da87d78e66c681a78..20271defe51b6045be39b81c97b4fec1c917e48a 100644 (file)
@@ -217,7 +217,7 @@ public class NavigatorTest {
             return page;
         }
 
-        private Page page;
+        private final Page page;
     }
 
     private static class TestPage extends Page {
index e4665adf522d2d5c58cbd139bf57440f8245ceeb..4f6ea6625d61373b8afe87cc09571a2c00323342 100644 (file)
@@ -17,10 +17,10 @@ public class MockDeploymentConfiguration
     private int heartbeatInterval = 300;
     private boolean closeIdleSessions = false;
     private PushMode pushMode = PushMode.DISABLED;
-    private Properties initParameters = new Properties();
-    private Map<String, String> applicationOrSystemProperty = new HashMap<>();
+    private final Properties initParameters = new Properties();
+    private final Map<String, String> applicationOrSystemProperty = new HashMap<>();
     private boolean syncIdCheckEnabled = true;
-    private boolean sendUrlsAsParameters = true;
+    private final boolean sendUrlsAsParameters = true;
 
     @Override
     public boolean isProductionMode() {
index 2b39cc7c514875b4caec31f9dcdb2c03643de621..769a02dedcd5d0965176b37da4b86b269080a997 100644 (file)
@@ -43,9 +43,9 @@ public class DesignTest {
     private static final Charset CP1251_CHARSET = Charset.forName("cp1251");
     private static final Charset UTF8_CHARSET = StandardCharsets.UTF_8;
 
-    private static String NON_ASCII_STRING = "\u043C";
+    private static final String NON_ASCII_STRING = "\u043C";
 
-    private static Charset DEFAULT_CHARSET = Charset.defaultCharset();
+    private static final Charset DEFAULT_CHARSET = Charset.defaultCharset();
 
     @AfterClass
     public static void restoreCharset()