aboutsummaryrefslogtreecommitdiffstats
path: root/server
diff options
context:
space:
mode:
authorPer-Åke Minborg <minborg@speedment.com>2016-10-28 10:24:51 -0700
committerDenis Anisimov <denis@vaadin.com>2016-11-09 15:32:57 +0200
commit0f42869ce1f81270141e94f169f1447febaff446 (patch)
treeca6ea02cdd637cc533572a19312041d8804c1525 /server
parentb85f6e4bdc49d9ea8693239fa15d1f2f239f85cf (diff)
downloadvaadin-framework-0f42869ce1f81270141e94f169f1447febaff446.tar.gz
vaadin-framework-0f42869ce1f81270141e94f169f1447febaff446.zip
Use final modifier where appropriate
Change-Id: I80b73b653e97904605dc62484a7448f3bfbf7226
Diffstat (limited to 'server')
-rw-r--r--server/src/main/java/com/vaadin/data/Binder.java2
-rw-r--r--server/src/main/java/com/vaadin/data/validator/AbstractValidator.java2
-rw-r--r--server/src/main/java/com/vaadin/data/validator/RangeValidator.java2
-rw-r--r--server/src/main/java/com/vaadin/data/validator/StringLengthValidator.java2
-rw-r--r--server/src/main/java/com/vaadin/event/FieldEvents.java2
-rw-r--r--server/src/main/java/com/vaadin/event/MouseEvents.java2
-rw-r--r--server/src/main/java/com/vaadin/event/TransferableImpl.java2
-rw-r--r--server/src/main/java/com/vaadin/event/dd/DragAndDropEvent.java4
-rw-r--r--server/src/main/java/com/vaadin/event/dd/acceptcriteria/AcceptAll.java2
-rw-r--r--server/src/main/java/com/vaadin/event/dd/acceptcriteria/ContainsDataFlavor.java2
-rw-r--r--server/src/main/java/com/vaadin/event/dd/acceptcriteria/Not.java2
-rw-r--r--server/src/main/java/com/vaadin/event/dd/acceptcriteria/Or.java2
-rw-r--r--server/src/main/java/com/vaadin/event/dd/acceptcriteria/SourceIs.java2
-rw-r--r--server/src/main/java/com/vaadin/event/dd/acceptcriteria/SourceIsTarget.java2
-rw-r--r--server/src/main/java/com/vaadin/server/AbstractClientConnector.java8
-rw-r--r--server/src/main/java/com/vaadin/server/AbstractErrorMessage.java2
-rw-r--r--server/src/main/java/com/vaadin/server/ClientConnector.java2
-rw-r--r--server/src/main/java/com/vaadin/server/ClientMethodInvocation.java2
-rw-r--r--server/src/main/java/com/vaadin/server/ComponentSizeValidator.java6
-rw-r--r--server/src/main/java/com/vaadin/server/FontAwesome.java2
-rw-r--r--server/src/main/java/com/vaadin/server/JavaScriptCallbackHelper.java4
-rw-r--r--server/src/main/java/com/vaadin/server/JsonCodec.java8
-rw-r--r--server/src/main/java/com/vaadin/server/LegacyApplication.java2
-rw-r--r--server/src/main/java/com/vaadin/server/LegacyCommunicationManager.java2
-rw-r--r--server/src/main/java/com/vaadin/server/LocaleService.java4
-rw-r--r--server/src/main/java/com/vaadin/server/Page.java2
-rw-r--r--server/src/main/java/com/vaadin/server/RestrictedRenderResponse.java2
-rw-r--r--server/src/main/java/com/vaadin/server/SizeWithUnit.java4
-rw-r--r--server/src/main/java/com/vaadin/server/Sizeable.java2
-rw-r--r--server/src/main/java/com/vaadin/server/VaadinPortletResponse.java2
-rw-r--r--server/src/main/java/com/vaadin/server/VaadinServletResponse.java2
-rw-r--r--server/src/main/java/com/vaadin/server/VaadinSession.java2
-rw-r--r--server/src/main/java/com/vaadin/server/communication/AtmospherePushConnection.java2
-rw-r--r--server/src/main/java/com/vaadin/server/communication/JSR356WebsocketInitializer.java4
-rw-r--r--server/src/main/java/com/vaadin/server/communication/PushHandler.java2
-rw-r--r--server/src/main/java/com/vaadin/server/communication/UidlRequestHandler.java2
-rw-r--r--server/src/main/java/com/vaadin/server/data/BackEndDataSource.java4
-rw-r--r--server/src/main/java/com/vaadin/server/data/DataCommunicator.java10
-rw-r--r--server/src/main/java/com/vaadin/server/widgetsetutils/ClassPathExplorer.java4
-rw-r--r--server/src/main/java/com/vaadin/ui/AbsoluteLayout.java9
-rw-r--r--server/src/main/java/com/vaadin/ui/AbstractColorPicker.java2
-rw-r--r--server/src/main/java/com/vaadin/ui/AbstractJavaScriptComponent.java2
-rw-r--r--server/src/main/java/com/vaadin/ui/AbstractOrderedLayout.java8
-rw-r--r--server/src/main/java/com/vaadin/ui/AbstractSplitPanel.java2
-rw-r--r--server/src/main/java/com/vaadin/ui/ConnectorTracker.java8
-rw-r--r--server/src/main/java/com/vaadin/ui/DragAndDropWrapper.java4
-rw-r--r--server/src/main/java/com/vaadin/ui/Grid.java18
-rw-r--r--server/src/main/java/com/vaadin/ui/Html5File.java6
-rw-r--r--server/src/main/java/com/vaadin/ui/LoadingIndicatorConfiguration.java2
-rw-r--r--server/src/main/java/com/vaadin/ui/LoginForm.java2
-rw-r--r--server/src/main/java/com/vaadin/ui/Notification.java2
-rw-r--r--server/src/main/java/com/vaadin/ui/NotificationConfiguration.java2
-rw-r--r--server/src/main/java/com/vaadin/ui/PushConfiguration.java2
-rw-r--r--server/src/main/java/com/vaadin/ui/ReconnectDialogConfiguration.java2
-rw-r--r--server/src/main/java/com/vaadin/ui/TabSheet.java2
-rw-r--r--server/src/main/java/com/vaadin/ui/TooltipConfiguration.java2
-rw-r--r--server/src/main/java/com/vaadin/ui/components/colorpicker/ColorPickerHistory.java2
-rw-r--r--server/src/main/java/com/vaadin/ui/components/colorpicker/ColorPickerSelect.java2
-rw-r--r--server/src/main/java/com/vaadin/ui/components/grid/StaticSection.java4
-rw-r--r--server/src/main/java/com/vaadin/ui/declarative/DesignAttributeHandler.java2
-rw-r--r--server/src/main/java/com/vaadin/ui/declarative/DesignContext.java6
-rw-r--r--server/src/main/java/com/vaadin/ui/declarative/converters/DesignEnumConverter.java2
-rw-r--r--server/src/main/java/com/vaadin/ui/declarative/converters/DesignResourceConverter.java2
-rw-r--r--server/src/main/java/com/vaadin/ui/renderers/ClickableRenderer.java4
-rw-r--r--server/src/main/java/com/vaadin/util/CurrentInstance.java2
-rw-r--r--server/src/main/java/com/vaadin/util/FileTypeResolver.java2
-rw-r--r--server/src/main/java/com/vaadin/util/SerializerHelper.java2
-rw-r--r--server/src/test/java/com/vaadin/data/BinderMultiSelectTest.java2
-rw-r--r--server/src/test/java/com/vaadin/data/Jsr303Test.java2
-rw-r--r--server/src/test/java/com/vaadin/data/validator/StringLengthValidatorTest.java2
-rw-r--r--server/src/test/java/com/vaadin/server/AbstractDeploymentConfigurationTest.java2
-rw-r--r--server/src/test/java/com/vaadin/server/DownloadStreamTest.java2
-rw-r--r--server/src/test/java/com/vaadin/server/MockVaadinSession.java2
-rw-r--r--server/src/test/java/com/vaadin/server/communication/FileUploadHandlerTest.java2
-rw-r--r--server/src/test/java/com/vaadin/server/data/DataCommunicatorTest.java2
-rw-r--r--server/src/test/java/com/vaadin/server/data/datasource/StrBean.java2
-rw-r--r--server/src/test/java/com/vaadin/tests/data/bean/AnotherTestEnum.java2
-rw-r--r--server/src/test/java/com/vaadin/tests/data/bean/BeanToValidate.java2
-rw-r--r--server/src/test/java/com/vaadin/tests/data/bean/Country.java2
-rw-r--r--server/src/test/java/com/vaadin/tests/data/bean/Sex.java2
-rw-r--r--server/src/test/java/com/vaadin/tests/data/bean/TestEnum.java2
-rw-r--r--server/src/test/java/com/vaadin/tests/data/converter/StringToBooleanConverterTest.java2
-rw-r--r--server/src/test/java/com/vaadin/tests/design/DeclarativeTestBase.java2
-rw-r--r--server/src/test/java/com/vaadin/tests/design/designroot/ExtendedDesignWithAnnotation.java2
-rw-r--r--server/src/test/java/com/vaadin/tests/design/designroot/ExtendedDesignWithEmptyAnnotation.java2
-rw-r--r--server/src/test/java/com/vaadin/tests/design/nested/NestedCustomLayoutsTest.java2
-rw-r--r--server/src/test/java/com/vaadin/tests/server/ClassesSerializableTest.java6
-rw-r--r--server/src/test/java/com/vaadin/tests/server/CsrfTokenMissingTest.java2
-rw-r--r--server/src/test/java/com/vaadin/tests/server/clientconnector/AttachDetachListenersTest.java2
-rw-r--r--server/src/test/java/com/vaadin/tests/server/component/StateGetDoesNotMarkDirtyTest.java2
-rw-r--r--server/src/test/java/com/vaadin/tests/server/component/csslayout/AddComponentsTest.java2
-rw-r--r--server/src/test/java/com/vaadin/tests/server/component/customlayout/CustomLayoutTest.java2
-rw-r--r--server/src/test/java/com/vaadin/tests/server/component/menubar/MenuBarIdsTest.java2
-rw-r--r--server/src/test/java/com/vaadin/tests/server/component/ui/CustomUIClassLoaderTest.java2
-rw-r--r--server/src/test/java/com/vaadin/tests/server/component/window/AttachDetachWindowTest.java8
-rw-r--r--server/src/test/java/com/vaadin/tests/server/navigator/NavigatorTest.java2
-rw-r--r--server/src/test/java/com/vaadin/tests/util/MockDeploymentConfiguration.java6
-rw-r--r--server/src/test/java/com/vaadin/ui/declarative/DesignTest.java4
98 files changed, 149 insertions, 150 deletions
diff --git a/server/src/main/java/com/vaadin/data/Binder.java b/server/src/main/java/com/vaadin/data/Binder.java
index 7912a55d72..2763c7f788 100644
--- a/server/src/main/java/com/vaadin/data/Binder.java
+++ b/server/src/main/java/com/vaadin/data/Binder.java
@@ -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.
diff --git a/server/src/main/java/com/vaadin/data/validator/AbstractValidator.java b/server/src/main/java/com/vaadin/data/validator/AbstractValidator.java
index 793797ee3f..b6467b07b9 100644
--- a/server/src/main/java/com/vaadin/data/validator/AbstractValidator.java
+++ b/server/src/main/java/com/vaadin/data/validator/AbstractValidator.java
@@ -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}"
diff --git a/server/src/main/java/com/vaadin/data/validator/RangeValidator.java b/server/src/main/java/com/vaadin/data/validator/RangeValidator.java
index b8ad387308..2f966f81ee 100644
--- a/server/src/main/java/com/vaadin/data/validator/RangeValidator.java
+++ b/server/src/main/java/com/vaadin/data/validator/RangeValidator.java
@@ -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
diff --git a/server/src/main/java/com/vaadin/data/validator/StringLengthValidator.java b/server/src/main/java/com/vaadin/data/validator/StringLengthValidator.java
index b3e1da18eb..f207e618ee 100644
--- a/server/src/main/java/com/vaadin/data/validator/StringLengthValidator.java
+++ b/server/src/main/java/com/vaadin/data/validator/StringLengthValidator.java
@@ -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
diff --git a/server/src/main/java/com/vaadin/event/FieldEvents.java b/server/src/main/java/com/vaadin/event/FieldEvents.java
index bb14cc7339..b0e539961b 100644
--- a/server/src/main/java/com/vaadin/event/FieldEvents.java
+++ b/server/src/main/java/com/vaadin/event/FieldEvents.java
@@ -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;
diff --git a/server/src/main/java/com/vaadin/event/MouseEvents.java b/server/src/main/java/com/vaadin/event/MouseEvents.java
index d76759343a..e391ade401 100644
--- a/server/src/main/java/com/vaadin/event/MouseEvents.java
+++ b/server/src/main/java/com/vaadin/event/MouseEvents.java
@@ -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) {
diff --git a/server/src/main/java/com/vaadin/event/TransferableImpl.java b/server/src/main/java/com/vaadin/event/TransferableImpl.java
index 4da28176fc..7ea9ef7b23 100644
--- a/server/src/main/java/com/vaadin/event/TransferableImpl.java
+++ b/server/src/main/java/com/vaadin/event/TransferableImpl.java
@@ -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) {
diff --git a/server/src/main/java/com/vaadin/event/dd/DragAndDropEvent.java b/server/src/main/java/com/vaadin/event/dd/DragAndDropEvent.java
index 062f8aff29..93491b4274 100644
--- a/server/src/main/java/com/vaadin/event/dd/DragAndDropEvent.java
+++ b/server/src/main/java/com/vaadin/event/dd/DragAndDropEvent.java
@@ -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) {
diff --git a/server/src/main/java/com/vaadin/event/dd/acceptcriteria/AcceptAll.java b/server/src/main/java/com/vaadin/event/dd/acceptcriteria/AcceptAll.java
index 9694f6525b..b42d2b4684 100644
--- a/server/src/main/java/com/vaadin/event/dd/acceptcriteria/AcceptAll.java
+++ b/server/src/main/java/com/vaadin/event/dd/acceptcriteria/AcceptAll.java
@@ -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() {
}
diff --git a/server/src/main/java/com/vaadin/event/dd/acceptcriteria/ContainsDataFlavor.java b/server/src/main/java/com/vaadin/event/dd/acceptcriteria/ContainsDataFlavor.java
index 42d666a4ce..c4fc645fec 100644
--- a/server/src/main/java/com/vaadin/event/dd/acceptcriteria/ContainsDataFlavor.java
+++ b/server/src/main/java/com/vaadin/event/dd/acceptcriteria/ContainsDataFlavor.java
@@ -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}.
diff --git a/server/src/main/java/com/vaadin/event/dd/acceptcriteria/Not.java b/server/src/main/java/com/vaadin/event/dd/acceptcriteria/Not.java
index 057e032d46..f194be7634 100644
--- a/server/src/main/java/com/vaadin/event/dd/acceptcriteria/Not.java
+++ b/server/src/main/java/com/vaadin/event/dd/acceptcriteria/Not.java
@@ -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;
diff --git a/server/src/main/java/com/vaadin/event/dd/acceptcriteria/Or.java b/server/src/main/java/com/vaadin/event/dd/acceptcriteria/Or.java
index 20bf507bbe..81ef37631f 100644
--- a/server/src/main/java/com/vaadin/event/dd/acceptcriteria/Or.java
+++ b/server/src/main/java/com/vaadin/event/dd/acceptcriteria/Or.java
@@ -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
diff --git a/server/src/main/java/com/vaadin/event/dd/acceptcriteria/SourceIs.java b/server/src/main/java/com/vaadin/event/dd/acceptcriteria/SourceIs.java
index eaccceaca2..49ea24e5cb 100644
--- a/server/src/main/java/com/vaadin/event/dd/acceptcriteria/SourceIs.java
+++ b/server/src/main/java/com/vaadin/event/dd/acceptcriteria/SourceIs.java
@@ -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;
diff --git a/server/src/main/java/com/vaadin/event/dd/acceptcriteria/SourceIsTarget.java b/server/src/main/java/com/vaadin/event/dd/acceptcriteria/SourceIsTarget.java
index 95fbaab85e..8cb16e4313 100644
--- a/server/src/main/java/com/vaadin/event/dd/acceptcriteria/SourceIsTarget.java
+++ b/server/src/main/java/com/vaadin/event/dd/acceptcriteria/SourceIsTarget.java
@@ -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() {
}
diff --git a/server/src/main/java/com/vaadin/server/AbstractClientConnector.java b/server/src/main/java/com/vaadin/server/AbstractClientConnector.java
index f3e79d6579..01222a07dd 100644
--- a/server/src/main/java/com/vaadin/server/AbstractClientConnector.java
+++ b/server/src/main/java/com/vaadin/server/AbstractClientConnector.java
@@ -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("\\$", ".");
diff --git a/server/src/main/java/com/vaadin/server/AbstractErrorMessage.java b/server/src/main/java/com/vaadin/server/AbstractErrorMessage.java
index 491462b53d..6ffbf6063e 100644
--- a/server/src/main/java/com/vaadin/server/AbstractErrorMessage.java
+++ b/server/src/main/java/com/vaadin/server/AbstractErrorMessage.java
@@ -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;
diff --git a/server/src/main/java/com/vaadin/server/ClientConnector.java b/server/src/main/java/com/vaadin/server/ClientConnector.java
index 80453d4733..b54a85029b 100644
--- a/server/src/main/java/com/vaadin/server/ClientConnector.java
+++ b/server/src/main/java/com/vaadin/server/ClientConnector.java
@@ -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);
diff --git a/server/src/main/java/com/vaadin/server/ClientMethodInvocation.java b/server/src/main/java/com/vaadin/server/ClientMethodInvocation.java
index 28d5d2778d..acf5f3568f 100644
--- a/server/src/main/java/com/vaadin/server/ClientMethodInvocation.java
+++ b/server/src/main/java/com/vaadin/server/ClientMethodInvocation.java
@@ -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;
diff --git a/server/src/main/java/com/vaadin/server/ComponentSizeValidator.java b/server/src/main/java/com/vaadin/server/ComponentSizeValidator.java
index da8231eec9..a9068495dc 100644
--- a/server/src/main/java/com/vaadin/server/ComponentSizeValidator.java
+++ b/server/src/main/java/com/vaadin/server/ComponentSizeValidator.java
@@ -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;
diff --git a/server/src/main/java/com/vaadin/server/FontAwesome.java b/server/src/main/java/com/vaadin/server/FontAwesome.java
index 2bb4a9abc8..2ce35328f6 100644
--- a/server/src/main/java/com/vaadin/server/FontAwesome.java
+++ b/server/src/main/java/com/vaadin/server/FontAwesome.java
@@ -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;
diff --git a/server/src/main/java/com/vaadin/server/JavaScriptCallbackHelper.java b/server/src/main/java/com/vaadin/server/JavaScriptCallbackHelper.java
index 9b066a4ff8..7e228bb7ca 100644
--- a/server/src/main/java/com/vaadin/server/JavaScriptCallbackHelper.java
+++ b/server/src/main/java/com/vaadin/server/JavaScriptCallbackHelper.java
@@ -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) {
diff --git a/server/src/main/java/com/vaadin/server/JsonCodec.java b/server/src/main/java/com/vaadin/server/JsonCodec.java
index 588443d55b..a5725e3d45 100644
--- a/server/src/main/java/com/vaadin/server/JsonCodec.java
+++ b/server/src/main/java/com/vaadin/server/JsonCodec.java
@@ -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());
}
diff --git a/server/src/main/java/com/vaadin/server/LegacyApplication.java b/server/src/main/java/com/vaadin/server/LegacyApplication.java
index b417c0f9ee..599d9bb385 100644
--- a/server/src/main/java/com/vaadin/server/LegacyApplication.java
+++ b/server/src/main/java/com/vaadin/server/LegacyApplication.java
@@ -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;
diff --git a/server/src/main/java/com/vaadin/server/LegacyCommunicationManager.java b/server/src/main/java/com/vaadin/server/LegacyCommunicationManager.java
index 7c438ca999..3ef17b618a 100644
--- a/server/src/main/java/com/vaadin/server/LegacyCommunicationManager.java
+++ b/server/src/main/java/com/vaadin/server/LegacyCommunicationManager.java
@@ -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!
diff --git a/server/src/main/java/com/vaadin/server/LocaleService.java b/server/src/main/java/com/vaadin/server/LocaleService.java
index 98bbc8275a..c2b28d1cab 100644
--- a/server/src/main/java/com/vaadin/server/LocaleService.java
+++ b/server/src/main/java/com/vaadin/server/LocaleService.java
@@ -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
diff --git a/server/src/main/java/com/vaadin/server/Page.java b/server/src/main/java/com/vaadin/server/Page.java
index d4eb2432f0..d067ffc7dc 100644
--- a/server/src/main/java/com/vaadin/server/Page.java
+++ b/server/src/main/java/com/vaadin/server/Page.java
@@ -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;
diff --git a/server/src/main/java/com/vaadin/server/RestrictedRenderResponse.java b/server/src/main/java/com/vaadin/server/RestrictedRenderResponse.java
index 587bf0ae69..d62acfa8c0 100644
--- a/server/src/main/java/com/vaadin/server/RestrictedRenderResponse.java
+++ b/server/src/main/java/com/vaadin/server/RestrictedRenderResponse.java
@@ -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;
diff --git a/server/src/main/java/com/vaadin/server/SizeWithUnit.java b/server/src/main/java/com/vaadin/server/SizeWithUnit.java
index 17624b4712..b53e4533f4 100644
--- a/server/src/main/java/com/vaadin/server/SizeWithUnit.java
+++ b/server/src/main/java/com/vaadin/server/SizeWithUnit.java
@@ -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);
diff --git a/server/src/main/java/com/vaadin/server/Sizeable.java b/server/src/main/java/com/vaadin/server/Sizeable.java
index d731908e31..f3fa8ed0cc 100644
--- a/server/src/main/java/com/vaadin/server/Sizeable.java
+++ b/server/src/main/java/com/vaadin/server/Sizeable.java
@@ -132,7 +132,7 @@ public interface Sizeable extends Serializable {
*/
PERCENTAGE("%");
- private String symbol;
+ private final String symbol;
private Unit(String symbol) {
this.symbol = symbol;
diff --git a/server/src/main/java/com/vaadin/server/VaadinPortletResponse.java b/server/src/main/java/com/vaadin/server/VaadinPortletResponse.java
index 4a739760f4..f7a5abadff 100644
--- a/server/src/main/java/com/vaadin/server/VaadinPortletResponse.java
+++ b/server/src/main/java/com/vaadin/server/VaadinPortletResponse.java
@@ -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
diff --git a/server/src/main/java/com/vaadin/server/VaadinServletResponse.java b/server/src/main/java/com/vaadin/server/VaadinServletResponse.java
index 07c3964f5d..7513dd4d97 100644
--- a/server/src/main/java/com/vaadin/server/VaadinServletResponse.java
+++ b/server/src/main/java/com/vaadin/server/VaadinServletResponse.java
@@ -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
diff --git a/server/src/main/java/com/vaadin/server/VaadinSession.java b/server/src/main/java/com/vaadin/server/VaadinSession.java
index d2cf4e740a..ebda81b9c7 100644
--- a/server/src/main/java/com/vaadin/server/VaadinSession.java
+++ b/server/src/main/java/com/vaadin/server/VaadinSession.java
@@ -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
diff --git a/server/src/main/java/com/vaadin/server/communication/AtmospherePushConnection.java b/server/src/main/java/com/vaadin/server/communication/AtmospherePushConnection.java
index 60ab1d0651..1189ff6023 100644
--- a/server/src/main/java/com/vaadin/server/communication/AtmospherePushConnection.java
+++ b/server/src/main/java/com/vaadin/server/communication/AtmospherePushConnection.java
@@ -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;
diff --git a/server/src/main/java/com/vaadin/server/communication/JSR356WebsocketInitializer.java b/server/src/main/java/com/vaadin/server/communication/JSR356WebsocketInitializer.java
index 95b796a2c7..2119de6f37 100644
--- a/server/src/main/java/com/vaadin/server/communication/JSR356WebsocketInitializer.java
+++ b/server/src/main/java/com/vaadin/server/communication/JSR356WebsocketInitializer.java
@@ -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) {
diff --git a/server/src/main/java/com/vaadin/server/communication/PushHandler.java b/server/src/main/java/com/vaadin/server/communication/PushHandler.java
index 5423226e6a..75a5c9d94f 100644
--- a/server/src/main/java/com/vaadin/server/communication/PushHandler.java
+++ b/server/src/main/java/com/vaadin/server/communication/PushHandler.java
@@ -156,7 +156,7 @@ public class PushHandler {
}
};
- private VaadinServletService service;
+ private final VaadinServletService service;
public PushHandler(VaadinServletService service) {
this.service = service;
diff --git a/server/src/main/java/com/vaadin/server/communication/UidlRequestHandler.java b/server/src/main/java/com/vaadin/server/communication/UidlRequestHandler.java
index 0f5ce37fa9..6afb6434a4 100644
--- a/server/src/main/java/com/vaadin/server/communication/UidlRequestHandler.java
+++ b/server/src/main/java/com/vaadin/server/communication/UidlRequestHandler.java
@@ -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();
diff --git a/server/src/main/java/com/vaadin/server/data/BackEndDataSource.java b/server/src/main/java/com/vaadin/server/data/BackEndDataSource.java
index 2eedeb6839..3ca31de15a 100644
--- a/server/src/main/java/com/vaadin/server/data/BackEndDataSource.java
+++ b/server/src/main/java/com/vaadin/server/data/BackEndDataSource.java
@@ -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
diff --git a/server/src/main/java/com/vaadin/server/data/DataCommunicator.java b/server/src/main/java/com/vaadin/server/data/DataCommunicator.java
index a0ce859892..24bb464722 100644
--- a/server/src/main/java/com/vaadin/server/data/DataCommunicator.java
+++ b/server/src/main/java/com/vaadin/server/data/DataCommunicator.java
@@ -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);
diff --git a/server/src/main/java/com/vaadin/server/widgetsetutils/ClassPathExplorer.java b/server/src/main/java/com/vaadin/server/widgetsetutils/ClassPathExplorer.java
index b5e377fffc..7e7539b865 100644
--- a/server/src/main/java/com/vaadin/server/widgetsetutils/ClassPathExplorer.java
+++ b/server/src/main/java/com/vaadin/server/widgetsetutils/ClassPathExplorer.java
@@ -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;
diff --git a/server/src/main/java/com/vaadin/ui/AbsoluteLayout.java b/server/src/main/java/com/vaadin/ui/AbsoluteLayout.java
index e968568a09..49d020d32f 100644
--- a/server/src/main/java/com/vaadin/ui/AbsoluteLayout.java
+++ b/server/src/main/java/com/vaadin/ui/AbsoluteLayout.java
@@ -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.
diff --git a/server/src/main/java/com/vaadin/ui/AbstractColorPicker.java b/server/src/main/java/com/vaadin/ui/AbstractColorPicker.java
index 7f79cecf55..7a40798815 100644
--- a/server/src/main/java/com/vaadin/ui/AbstractColorPicker.java
+++ b/server/src/main/java/com/vaadin/ui/AbstractColorPicker.java
@@ -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;
diff --git a/server/src/main/java/com/vaadin/ui/AbstractJavaScriptComponent.java b/server/src/main/java/com/vaadin/ui/AbstractJavaScriptComponent.java
index 580754be01..8e70e9cb03 100644
--- a/server/src/main/java/com/vaadin/ui/AbstractJavaScriptComponent.java
+++ b/server/src/main/java/com/vaadin/ui/AbstractJavaScriptComponent.java
@@ -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
diff --git a/server/src/main/java/com/vaadin/ui/AbstractOrderedLayout.java b/server/src/main/java/com/vaadin/ui/AbstractOrderedLayout.java
index 6c995611fb..6858a18999 100644
--- a/server/src/main/java/com/vaadin/ui/AbstractOrderedLayout.java
+++ b/server/src/main/java/com/vaadin/ui/AbstractOrderedLayout.java
@@ -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;
diff --git a/server/src/main/java/com/vaadin/ui/AbstractSplitPanel.java b/server/src/main/java/com/vaadin/ui/AbstractSplitPanel.java
index 73bedc8470..e7a66cebe5 100644
--- a/server/src/main/java/com/vaadin/ui/AbstractSplitPanel.java
+++ b/server/src/main/java/com/vaadin/ui/AbstractSplitPanel.java
@@ -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) {
diff --git a/server/src/main/java/com/vaadin/ui/ConnectorTracker.java b/server/src/main/java/com/vaadin/ui/ConnectorTracker.java
index fd2c0029d1..2ba6f5e895 100644
--- a/server/src/main/java/com/vaadin/ui/ConnectorTracker.java
+++ b/server/src/main/java/com/vaadin/ui/ConnectorTracker.java
@@ -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
diff --git a/server/src/main/java/com/vaadin/ui/DragAndDropWrapper.java b/server/src/main/java/com/vaadin/ui/DragAndDropWrapper.java
index 7f2e558220..4b9a7afbfb 100644
--- a/server/src/main/java/com/vaadin/ui/DragAndDropWrapper.java
+++ b/server/src/main/java/com/vaadin/ui/DragAndDropWrapper.java
@@ -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;
diff --git a/server/src/main/java/com/vaadin/ui/Grid.java b/server/src/main/java/com/vaadin/ui/Grid.java
index b738b71323..63c8fe3e6f 100644
--- a/server/src/main/java/com/vaadin/ui/Grid.java
+++ b/server/src/main/java/com/vaadin/ui/Grid.java
@@ -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;
diff --git a/server/src/main/java/com/vaadin/ui/Html5File.java b/server/src/main/java/com/vaadin/ui/Html5File.java
index b3fcdb826f..b4434e75c9 100644
--- a/server/src/main/java/com/vaadin/ui/Html5File.java
+++ b/server/src/main/java/com/vaadin/ui/Html5File.java
@@ -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;
diff --git a/server/src/main/java/com/vaadin/ui/LoadingIndicatorConfiguration.java b/server/src/main/java/com/vaadin/ui/LoadingIndicatorConfiguration.java
index 32b9356d76..bd56036aee 100644
--- a/server/src/main/java/com/vaadin/ui/LoadingIndicatorConfiguration.java
+++ b/server/src/main/java/com/vaadin/ui/LoadingIndicatorConfiguration.java
@@ -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;
diff --git a/server/src/main/java/com/vaadin/ui/LoginForm.java b/server/src/main/java/com/vaadin/ui/LoginForm.java
index 74432d001a..9acd0735b1 100644
--- a/server/src/main/java/com/vaadin/ui/LoginForm.java
+++ b/server/src/main/java/com/vaadin/ui/LoginForm.java
@@ -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
diff --git a/server/src/main/java/com/vaadin/ui/Notification.java b/server/src/main/java/com/vaadin/ui/Notification.java
index 536598448b..7ee78fb807 100644
--- a/server/src/main/java/com/vaadin/ui/Notification.java
+++ b/server/src/main/java/com/vaadin/ui/Notification.java
@@ -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;
diff --git a/server/src/main/java/com/vaadin/ui/NotificationConfiguration.java b/server/src/main/java/com/vaadin/ui/NotificationConfiguration.java
index f7591af13c..0062bb969f 100644
--- a/server/src/main/java/com/vaadin/ui/NotificationConfiguration.java
+++ b/server/src/main/java/com/vaadin/ui/NotificationConfiguration.java
@@ -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;
diff --git a/server/src/main/java/com/vaadin/ui/PushConfiguration.java b/server/src/main/java/com/vaadin/ui/PushConfiguration.java
index cad96a5952..bb722ec2d2 100644
--- a/server/src/main/java/com/vaadin/ui/PushConfiguration.java
+++ b/server/src/main/java/com/vaadin/ui/PushConfiguration.java
@@ -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;
diff --git a/server/src/main/java/com/vaadin/ui/ReconnectDialogConfiguration.java b/server/src/main/java/com/vaadin/ui/ReconnectDialogConfiguration.java
index d4df9fdf28..8a36de3510 100644
--- a/server/src/main/java/com/vaadin/ui/ReconnectDialogConfiguration.java
+++ b/server/src/main/java/com/vaadin/ui/ReconnectDialogConfiguration.java
@@ -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;
diff --git a/server/src/main/java/com/vaadin/ui/TabSheet.java b/server/src/main/java/com/vaadin/ui/TabSheet.java
index 5623166357..7ad40c2771 100644
--- a/server/src/main/java/com/vaadin/ui/TabSheet.java
+++ b/server/src/main/java/com/vaadin/ui/TabSheet.java
@@ -1101,7 +1101,7 @@ public class TabSheet extends AbstractComponentContainer
*/
public class TabSheetTabImpl implements Tab {
- private TabState tabState;
+ private final TabState tabState;
private Focusable defaultFocus;
diff --git a/server/src/main/java/com/vaadin/ui/TooltipConfiguration.java b/server/src/main/java/com/vaadin/ui/TooltipConfiguration.java
index b5af10961b..1bf9fd7b81 100644
--- a/server/src/main/java/com/vaadin/ui/TooltipConfiguration.java
+++ b/server/src/main/java/com/vaadin/ui/TooltipConfiguration.java
@@ -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;
diff --git a/server/src/main/java/com/vaadin/ui/components/colorpicker/ColorPickerHistory.java b/server/src/main/java/com/vaadin/ui/components/colorpicker/ColorPickerHistory.java
index a32378aeaf..ae1c304fd2 100644
--- a/server/src/main/java/com/vaadin/ui/components/colorpicker/ColorPickerHistory.java
+++ b/server/src/main/java/com/vaadin/ui/components/colorpicker/ColorPickerHistory.java
@@ -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
diff --git a/server/src/main/java/com/vaadin/ui/components/colorpicker/ColorPickerSelect.java b/server/src/main/java/com/vaadin/ui/components/colorpicker/ColorPickerSelect.java
index 20d68da0fa..ec200082ab 100644
--- a/server/src/main/java/com/vaadin/ui/components/colorpicker/ColorPickerSelect.java
+++ b/server/src/main/java/com/vaadin/ui/components/colorpicker/ColorPickerSelect.java
@@ -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;
diff --git a/server/src/main/java/com/vaadin/ui/components/grid/StaticSection.java b/server/src/main/java/com/vaadin/ui/components/grid/StaticSection.java
index eb02be2bbc..678ab2a935 100644
--- a/server/src/main/java/com/vaadin/ui/components/grid/StaticSection.java
+++ b/server/src/main/java/com/vaadin/ui/components/grid/StaticSection.java
@@ -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;
diff --git a/server/src/main/java/com/vaadin/ui/declarative/DesignAttributeHandler.java b/server/src/main/java/com/vaadin/ui/declarative/DesignAttributeHandler.java
index 00fb32392c..5b0968bae6 100644
--- a/server/src/main/java/com/vaadin/ui/declarative/DesignAttributeHandler.java
+++ b/server/src/main/java/com/vaadin/ui/declarative/DesignAttributeHandler.java
@@ -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) {
diff --git a/server/src/main/java/com/vaadin/ui/declarative/DesignContext.java b/server/src/main/java/com/vaadin/ui/declarative/DesignContext.java
index c8e794c46a..761c7edd04 100644
--- a/server/src/main/java/com/vaadin/ui/declarative/DesignContext.java
+++ b/server/src/main/java/com/vaadin/ui/declarative/DesignContext.java
@@ -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
diff --git a/server/src/main/java/com/vaadin/ui/declarative/converters/DesignEnumConverter.java b/server/src/main/java/com/vaadin/ui/declarative/converters/DesignEnumConverter.java
index 93ccee3f37..a32c68998f 100644
--- a/server/src/main/java/com/vaadin/ui/declarative/converters/DesignEnumConverter.java
+++ b/server/src/main/java/com/vaadin/ui/declarative/converters/DesignEnumConverter.java
@@ -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.
diff --git a/server/src/main/java/com/vaadin/ui/declarative/converters/DesignResourceConverter.java b/server/src/main/java/com/vaadin/ui/declarative/converters/DesignResourceConverter.java
index ef6e10ef5c..c03d3750d1 100644
--- a/server/src/main/java/com/vaadin/ui/declarative/converters/DesignResourceConverter.java
+++ b/server/src/main/java/com/vaadin/ui/declarative/converters/DesignResourceConverter.java
@@ -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
diff --git a/server/src/main/java/com/vaadin/ui/renderers/ClickableRenderer.java b/server/src/main/java/com/vaadin/ui/renderers/ClickableRenderer.java
index 3073517b65..8686c391c5 100644
--- a/server/src/main/java/com/vaadin/ui/renderers/ClickableRenderer.java
+++ b/server/src/main/java/com/vaadin/ui/renderers/ClickableRenderer.java
@@ -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) {
diff --git a/server/src/main/java/com/vaadin/util/CurrentInstance.java b/server/src/main/java/com/vaadin/util/CurrentInstance.java
index f8d6af2a4c..43b158a4ff 100644
--- a/server/src/main/java/com/vaadin/util/CurrentInstance.java
+++ b/server/src/main/java/com/vaadin/util/CurrentInstance.java
@@ -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) {
diff --git a/server/src/main/java/com/vaadin/util/FileTypeResolver.java b/server/src/main/java/com/vaadin/util/FileTypeResolver.java
index 4df2785ce8..4cbac69df5 100644
--- a/server/src/main/java/com/vaadin/util/FileTypeResolver.java
+++ b/server/src/main/java/com/vaadin/util/FileTypeResolver.java
@@ -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,"
diff --git a/server/src/main/java/com/vaadin/util/SerializerHelper.java b/server/src/main/java/com/vaadin/util/SerializerHelper.java
index 5b6b06c0c1..41ef150d51 100644
--- a/server/src/main/java/com/vaadin/util/SerializerHelper.java
+++ b/server/src/main/java/com/vaadin/util/SerializerHelper.java
@@ -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 };
diff --git a/server/src/test/java/com/vaadin/data/BinderMultiSelectTest.java b/server/src/test/java/com/vaadin/data/BinderMultiSelectTest.java
index 3b35f86144..f59c89e1d8 100644
--- a/server/src/test/java/com/vaadin/data/BinderMultiSelectTest.java
+++ b/server/src/test/java/com/vaadin/data/BinderMultiSelectTest.java
@@ -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;
diff --git a/server/src/test/java/com/vaadin/data/Jsr303Test.java b/server/src/test/java/com/vaadin/data/Jsr303Test.java
index da30f56743..016018a6b3 100644
--- a/server/src/test/java/com/vaadin/data/Jsr303Test.java
+++ b/server/src/test/java/com/vaadin/data/Jsr303Test.java
@@ -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() {
diff --git a/server/src/test/java/com/vaadin/data/validator/StringLengthValidatorTest.java b/server/src/test/java/com/vaadin/data/validator/StringLengthValidatorTest.java
index dd2b1be50b..7fb1c2ff76 100644
--- a/server/src/test/java/com/vaadin/data/validator/StringLengthValidatorTest.java
+++ b/server/src/test/java/com/vaadin/data/validator/StringLengthValidatorTest.java
@@ -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
diff --git a/server/src/test/java/com/vaadin/server/AbstractDeploymentConfigurationTest.java b/server/src/test/java/com/vaadin/server/AbstractDeploymentConfigurationTest.java
index c274bf35c3..2d4e7fad0a 100644
--- a/server/src/test/java/com/vaadin/server/AbstractDeploymentConfigurationTest.java
+++ b/server/src/test/java/com/vaadin/server/AbstractDeploymentConfigurationTest.java
@@ -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;
diff --git a/server/src/test/java/com/vaadin/server/DownloadStreamTest.java b/server/src/test/java/com/vaadin/server/DownloadStreamTest.java
index f302163ef7..81f45f6173 100644
--- a/server/src/test/java/com/vaadin/server/DownloadStreamTest.java
+++ b/server/src/test/java/com/vaadin/server/DownloadStreamTest.java
@@ -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
diff --git a/server/src/test/java/com/vaadin/server/MockVaadinSession.java b/server/src/test/java/com/vaadin/server/MockVaadinSession.java
index 04d516ecb4..07854560b3 100644
--- a/server/src/test/java/com/vaadin/server/MockVaadinSession.java
+++ b/server/src/test/java/com/vaadin/server/MockVaadinSession.java
@@ -66,5 +66,5 @@ public class MockVaadinSession extends VaadinSession {
private int closeCount;
- private ReentrantLock lock = new ReentrantLock();
+ private final ReentrantLock lock = new ReentrantLock();
}
diff --git a/server/src/test/java/com/vaadin/server/communication/FileUploadHandlerTest.java b/server/src/test/java/com/vaadin/server/communication/FileUploadHandlerTest.java
index 3726ed7cea..60b2b2a02d 100644
--- a/server/src/test/java/com/vaadin/server/communication/FileUploadHandlerTest.java
+++ b/server/src/test/java/com/vaadin/server/communication/FileUploadHandlerTest.java
@@ -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";
diff --git a/server/src/test/java/com/vaadin/server/data/DataCommunicatorTest.java b/server/src/test/java/com/vaadin/server/data/DataCommunicatorTest.java
index b82d571f9b..c9a30fa517 100644
--- a/server/src/test/java/com/vaadin/server/data/DataCommunicatorTest.java
+++ b/server/src/test/java/com/vaadin/server/data/DataCommunicatorTest.java
@@ -85,7 +85,7 @@ public class DataCommunicatorTest {
}
}
- private MockVaadinSession session = new MockVaadinSession(
+ private final MockVaadinSession session = new MockVaadinSession(
Mockito.mock(VaadinService.class));
@Test
diff --git a/server/src/test/java/com/vaadin/server/data/datasource/StrBean.java b/server/src/test/java/com/vaadin/server/data/datasource/StrBean.java
index 24f478ad47..44650d63bb 100644
--- a/server/src/test/java/com/vaadin/server/data/datasource/StrBean.java
+++ b/server/src/test/java/com/vaadin/server/data/datasource/StrBean.java
@@ -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;
diff --git a/server/src/test/java/com/vaadin/tests/data/bean/AnotherTestEnum.java b/server/src/test/java/com/vaadin/tests/data/bean/AnotherTestEnum.java
index fc8f22a947..934a2ce696 100644
--- a/server/src/test/java/com/vaadin/tests/data/bean/AnotherTestEnum.java
+++ b/server/src/test/java/com/vaadin/tests/data/bean/AnotherTestEnum.java
@@ -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;
diff --git a/server/src/test/java/com/vaadin/tests/data/bean/BeanToValidate.java b/server/src/test/java/com/vaadin/tests/data/bean/BeanToValidate.java
index 9f0b244360..23270cab5e 100644
--- a/server/src/test/java/com/vaadin/tests/data/bean/BeanToValidate.java
+++ b/server/src/test/java/com/vaadin/tests/data/bean/BeanToValidate.java
@@ -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;
diff --git a/server/src/test/java/com/vaadin/tests/data/bean/Country.java b/server/src/test/java/com/vaadin/tests/data/bean/Country.java
index 159333212f..c7795d5f6d 100644
--- a/server/src/test/java/com/vaadin/tests/data/bean/Country.java
+++ b/server/src/test/java/com/vaadin/tests/data/bean/Country.java
@@ -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;
diff --git a/server/src/test/java/com/vaadin/tests/data/bean/Sex.java b/server/src/test/java/com/vaadin/tests/data/bean/Sex.java
index a4e3f20a11..489588c640 100644
--- a/server/src/test/java/com/vaadin/tests/data/bean/Sex.java
+++ b/server/src/test/java/com/vaadin/tests/data/bean/Sex.java
@@ -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;
diff --git a/server/src/test/java/com/vaadin/tests/data/bean/TestEnum.java b/server/src/test/java/com/vaadin/tests/data/bean/TestEnum.java
index bf6f721052..f79298b6ad 100644
--- a/server/src/test/java/com/vaadin/tests/data/bean/TestEnum.java
+++ b/server/src/test/java/com/vaadin/tests/data/bean/TestEnum.java
@@ -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;
diff --git a/server/src/test/java/com/vaadin/tests/data/converter/StringToBooleanConverterTest.java b/server/src/test/java/com/vaadin/tests/data/converter/StringToBooleanConverterTest.java
index 4de05b9f09..d3d539ae8f 100644
--- a/server/src/test/java/com/vaadin/tests/data/converter/StringToBooleanConverterTest.java
+++ b/server/src/test/java/com/vaadin/tests/data/converter/StringToBooleanConverterTest.java
@@ -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) {
diff --git a/server/src/test/java/com/vaadin/tests/design/DeclarativeTestBase.java b/server/src/test/java/com/vaadin/tests/design/DeclarativeTestBase.java
index 2b73408abc..3e8e4dccd6 100644
--- a/server/src/test/java/com/vaadin/tests/design/DeclarativeTestBase.java
+++ b/server/src/test/java/com/vaadin/tests/design/DeclarativeTestBase.java
@@ -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;
diff --git a/server/src/test/java/com/vaadin/tests/design/designroot/ExtendedDesignWithAnnotation.java b/server/src/test/java/com/vaadin/tests/design/designroot/ExtendedDesignWithAnnotation.java
index 28d419b27e..b1f6297d9e 100644
--- a/server/src/test/java/com/vaadin/tests/design/designroot/ExtendedDesignWithAnnotation.java
+++ b/server/src/test/java/com/vaadin/tests/design/designroot/ExtendedDesignWithAnnotation.java
@@ -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");
diff --git a/server/src/test/java/com/vaadin/tests/design/designroot/ExtendedDesignWithEmptyAnnotation.java b/server/src/test/java/com/vaadin/tests/design/designroot/ExtendedDesignWithEmptyAnnotation.java
index ea23f847cf..cfea7a6fda 100644
--- a/server/src/test/java/com/vaadin/tests/design/designroot/ExtendedDesignWithEmptyAnnotation.java
+++ b/server/src/test/java/com/vaadin/tests/design/designroot/ExtendedDesignWithEmptyAnnotation.java
@@ -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();
diff --git a/server/src/test/java/com/vaadin/tests/design/nested/NestedCustomLayoutsTest.java b/server/src/test/java/com/vaadin/tests/design/nested/NestedCustomLayoutsTest.java
index 6479e1995a..341397ff81 100644
--- a/server/src/test/java/com/vaadin/tests/design/nested/NestedCustomLayoutsTest.java
+++ b/server/src/test/java/com/vaadin/tests/design/nested/NestedCustomLayoutsTest.java
@@ -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 {
diff --git a/server/src/test/java/com/vaadin/tests/server/ClassesSerializableTest.java b/server/src/test/java/com/vaadin/tests/server/ClassesSerializableTest.java
index 865856f79c..e33f8373ce 100644
--- a/server/src/test/java/com/vaadin/tests/server/ClassesSerializableTest.java
+++ b/server/src/test/java/com/vaadin/tests/server/ClassesSerializableTest.java
@@ -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\\..*", //
diff --git a/server/src/test/java/com/vaadin/tests/server/CsrfTokenMissingTest.java b/server/src/test/java/com/vaadin/tests/server/CsrfTokenMissingTest.java
index 22d2fb283b..2f4ba832d3 100644
--- a/server/src/test/java/com/vaadin/tests/server/CsrfTokenMissingTest.java
+++ b/server/src/test/java/com/vaadin/tests/server/CsrfTokenMissingTest.java
@@ -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);
diff --git a/server/src/test/java/com/vaadin/tests/server/clientconnector/AttachDetachListenersTest.java b/server/src/test/java/com/vaadin/tests/server/clientconnector/AttachDetachListenersTest.java
index b870e0ab4f..7a44e861da 100644
--- a/server/src/test/java/com/vaadin/tests/server/clientconnector/AttachDetachListenersTest.java
+++ b/server/src/test/java/com/vaadin/tests/server/clientconnector/AttachDetachListenersTest.java
@@ -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;
diff --git a/server/src/test/java/com/vaadin/tests/server/component/StateGetDoesNotMarkDirtyTest.java b/server/src/test/java/com/vaadin/tests/server/component/StateGetDoesNotMarkDirtyTest.java
index 57647f1e6a..70b7b0b77c 100644
--- a/server/src/test/java/com/vaadin/tests/server/component/StateGetDoesNotMarkDirtyTest.java
+++ b/server/src/test/java/com/vaadin/tests/server/component/StateGetDoesNotMarkDirtyTest.java
@@ -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() {
diff --git a/server/src/test/java/com/vaadin/tests/server/component/csslayout/AddComponentsTest.java b/server/src/test/java/com/vaadin/tests/server/component/csslayout/AddComponentsTest.java
index 4da1b1380a..9fe1e4210a 100644
--- a/server/src/test/java/com/vaadin/tests/server/component/csslayout/AddComponentsTest.java
+++ b/server/src/test/java/com/vaadin/tests/server/component/csslayout/AddComponentsTest.java
@@ -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
diff --git a/server/src/test/java/com/vaadin/tests/server/component/customlayout/CustomLayoutTest.java b/server/src/test/java/com/vaadin/tests/server/component/customlayout/CustomLayoutTest.java
index d4880a3d2e..9d60628e12 100644
--- a/server/src/test/java/com/vaadin/tests/server/component/customlayout/CustomLayoutTest.java
+++ b/server/src/test/java/com/vaadin/tests/server/component/customlayout/CustomLayoutTest.java
@@ -142,6 +142,6 @@ public class CustomLayoutTest {
private int readCount;
private boolean isClosed;
- private int maxArrayLength;
+ private final int maxArrayLength;
}
}
diff --git a/server/src/test/java/com/vaadin/tests/server/component/menubar/MenuBarIdsTest.java b/server/src/test/java/com/vaadin/tests/server/component/menubar/MenuBarIdsTest.java
index f42b9a5683..bd8c2dd443 100644
--- a/server/src/test/java/com/vaadin/tests/server/component/menubar/MenuBarIdsTest.java
+++ b/server/src/test/java/com/vaadin/tests/server/component/menubar/MenuBarIdsTest.java
@@ -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;
diff --git a/server/src/test/java/com/vaadin/tests/server/component/ui/CustomUIClassLoaderTest.java b/server/src/test/java/com/vaadin/tests/server/component/ui/CustomUIClassLoaderTest.java
index f7a78b34ec..4e4f5160ba 100644
--- a/server/src/test/java/com/vaadin/tests/server/component/ui/CustomUIClassLoaderTest.java
+++ b/server/src/test/java/com/vaadin/tests/server/component/ui/CustomUIClassLoaderTest.java
@@ -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)
diff --git a/server/src/test/java/com/vaadin/tests/server/component/window/AttachDetachWindowTest.java b/server/src/test/java/com/vaadin/tests/server/component/window/AttachDetachWindowTest.java
index 5d0c0cc55d..872683cec3 100644
--- a/server/src/test/java/com/vaadin/tests/server/component/window/AttachDetachWindowTest.java
+++ b/server/src/test/java/com/vaadin/tests/server/component/window/AttachDetachWindowTest.java
@@ -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);
diff --git a/server/src/test/java/com/vaadin/tests/server/navigator/NavigatorTest.java b/server/src/test/java/com/vaadin/tests/server/navigator/NavigatorTest.java
index be3f402e16..20271defe5 100644
--- a/server/src/test/java/com/vaadin/tests/server/navigator/NavigatorTest.java
+++ b/server/src/test/java/com/vaadin/tests/server/navigator/NavigatorTest.java
@@ -217,7 +217,7 @@ public class NavigatorTest {
return page;
}
- private Page page;
+ private final Page page;
}
private static class TestPage extends Page {
diff --git a/server/src/test/java/com/vaadin/tests/util/MockDeploymentConfiguration.java b/server/src/test/java/com/vaadin/tests/util/MockDeploymentConfiguration.java
index e4665adf52..4f6ea6625d 100644
--- a/server/src/test/java/com/vaadin/tests/util/MockDeploymentConfiguration.java
+++ b/server/src/test/java/com/vaadin/tests/util/MockDeploymentConfiguration.java
@@ -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() {
diff --git a/server/src/test/java/com/vaadin/ui/declarative/DesignTest.java b/server/src/test/java/com/vaadin/ui/declarative/DesignTest.java
index 2b39cc7c51..769a02dedc 100644
--- a/server/src/test/java/com/vaadin/ui/declarative/DesignTest.java
+++ b/server/src/test/java/com/vaadin/ui/declarative/DesignTest.java
@@ -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()