diff options
author | Per-Åke Minborg <minborg@speedment.com> | 2016-10-28 10:24:51 -0700 |
---|---|---|
committer | Denis Anisimov <denis@vaadin.com> | 2016-11-09 15:32:57 +0200 |
commit | 0f42869ce1f81270141e94f169f1447febaff446 (patch) | |
tree | ca6ea02cdd637cc533572a19312041d8804c1525 /server/src/test | |
parent | b85f6e4bdc49d9ea8693239fa15d1f2f239f85cf (diff) | |
download | vaadin-framework-0f42869ce1f81270141e94f169f1447febaff446.tar.gz vaadin-framework-0f42869ce1f81270141e94f169f1447febaff446.zip |
Use final modifier where appropriate
Change-Id: I80b73b653e97904605dc62484a7448f3bfbf7226
Diffstat (limited to 'server/src/test')
31 files changed, 39 insertions, 39 deletions
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() |