*/
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.
*/
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}"
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
@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
public static abstract class FocusAndBlurServerRpcImpl
implements FocusAndBlurServerRpc {
- private Component component;
+ private final Component component;
public FocusAndBlurServerRpcImpl(Component component) {
this.component = component;
*/
@Deprecated
public static final MouseButton BUTTON_RIGHT = MouseButton.RIGHT;
- private MouseEventDetails details;
+ private final MouseEventDetails details;
public ClickEvent(Component source,
MouseEventDetails mouseEventDetails) {
*/
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) {
*
*/
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) {
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() {
}
*/
public class ContainsDataFlavor extends ClientSideCriterion {
- private String dataFlavorId;
+ private final String dataFlavorId;
/**
* Constructs a new instance of {@link ContainsDataFlavor}.
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;
*/
public class Or extends ClientSideCriterion {
private static final long serialVersionUID = 1L;
- private AcceptCriterion criteria[];
+ private final AcceptCriterion criteria[];
/**
* @param criteria
@SuppressWarnings("serial")
public class SourceIs extends ClientSideCriterion {
- private Component[] components;
+ private final Component[] components;
public SourceIs(Component... component) {
components = 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() {
}
* 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
private String connectorId;
- private ArrayList<Extension> extensions = new ArrayList<>();
+ private final ArrayList<Extension> extensions = new ArrayList<>();
/**
* The EventRouter used for the event model.
private class RpcInvocationHandler
implements InvocationHandler, Serializable {
- private String rpcInterfaceName;
+ private final String rpcInterfaceName;
public RpcInvocationHandler(Class<?> rpcInterface) {
rpcInterfaceName = rpcInterface.getName().replaceAll("\\$", ".");
*/
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;
public static class ConnectorErrorEvent
extends com.vaadin.server.ErrorEvent {
- private Connector connector;
+ private final Connector connector;
public ConnectorErrorEvent(Connector connector, Throwable t) {
super(t);
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;
}
- 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;
;
public static final String FONT_FAMILY = "FontAwesome";
- private int codepoint;
+ private final int codepoint;
FontAwesome(int codepoint) {
this.codepoint = codepoint;
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) {
* 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());
}
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;
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!
*/
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
private static class InjectedStyleString implements InjectedStyle {
- private String css;
+ private final String css;
public InjectedStyleString(String css) {
this.css = css;
*/
class RestrictedRenderResponse implements RenderResponse, Serializable {
- private RenderResponse response;
+ private final RenderResponse response;
RestrictedRenderResponse(RenderResponse response) {
this.response = response;
* @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);
*/
PERCENTAGE("%");
- private String symbol;
+ private final String symbol;
private Unit(String symbol) {
this.symbol = symbol;
}
private final PortletResponse response;
- private VaadinPortletService vaadinService;
+ private final VaadinPortletService vaadinService;
/**
* Wraps a portlet response and an associated vaadin service
public class VaadinServletResponse extends HttpServletResponseWrapper
implements VaadinResponse {
- private VaadinServletService vaadinService;
+ private final VaadinServletService vaadinService;
/**
* Wraps a http servlet response and an associated vaadin service
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
CONNECTED;
}
- private UI ui;
+ private final UI ui;
private transient State state = State.DISCONNECTED;
private transient AtmosphereResource resource;
private transient FragmentedMessage incomingMessage;
*/
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) {
}
};
- private VaadinServletService service;
+ private final VaadinServletService service;
public PushHandler(VaadinServletService service) {
this.service = service;
public static final String UIDL_PATH = "UIDL/";
- private ServerRpcHandler rpcHandler;
+ private final ServerRpcHandler rpcHandler;
public UidlRequestHandler() {
rpcHandler = createRpcHandler();
*/
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
}
}
- 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<>();
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);
* 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;
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.
/** A simple popup with only the swatches (palette) tab. */
POPUP_SIMPLE("simple");
- private String style;
+ private final String style;
PopupStyle(String styleName) {
style = styleName;
* @since 7.0.0
*/
public abstract class AbstractJavaScriptComponent extends AbstractComponent {
- private JavaScriptCallbackHelper callbackHelper = new JavaScriptCallbackHelper(
+ private final JavaScriptCallbackHelper callbackHelper = new JavaScriptCallbackHelper(
this);
@Override
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;
private Unit posMinUnit;
private Unit posMaxUnit;
- private AbstractSplitPanelRpc rpc = new AbstractSplitPanelRpc() {
+ private final AbstractSplitPanelRpc rpc = new AbstractSplitPanelRpc() {
@Override
public void splitterClick(MouseEventDetails mouseDetails) {
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
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 */
* @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
final class ProxyReceiver implements StreamVariable {
- private String id;
+ private final String id;
private Html5File file;
public ProxyReceiver(String id, Html5File file) {
class ReceivingEventWrapper implements StreamingErrorEvent,
StreamingEndEvent, StreamingStartEvent, StreamingProgressEvent {
- private StreamingEvent wrappedEvent;
+ private final StreamingEvent wrappedEvent;
ReceivingEventWrapper(StreamingEvent e) {
wrappedEvent = e;
*/
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;
/**
}
};
- 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;
*/
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;
class LoadingIndicatorConfigurationImpl
implements LoadingIndicatorConfiguration {
- private UI ui;
+ private final UI ui;
public LoadingIndicatorConfigurationImpl(UI ui) {
this.ui = ui;
*/
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
*/
ASSISTIVE_NOTIFICATION("assistive");
- private String style;
+ private final String style;
Type(String style) {
this.style = style;
class NotificationConfigurationImpl implements NotificationConfiguration {
- private UI ui;
+ private final UI ui;
public NotificationConfigurationImpl(UI ui) {
this.ui = ui;
}
class PushConfigurationImpl implements PushConfiguration {
- private UI ui;
+ private final UI ui;
public PushConfigurationImpl(UI ui) {
this.ui = ui;
}
class ReconnectDialogConfigurationImpl implements ReconnectDialogConfiguration {
- private UI ui;
+ private final UI ui;
public ReconnectDialogConfigurationImpl(UI ui) {
this.ui = ui;
*/
public class TabSheetTabImpl implements Tab {
- private TabState tabState;
+ private final TabState tabState;
private Focusable defaultFocus;
}
class TooltipConfigurationImpl implements TooltipConfiguration {
- private UI ui;
+ private final UI ui;
public TooltipConfigurationImpl(UI ui) {
this.ui = ui;
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
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;
*/
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;
* @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) {
* @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
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.
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
*/
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) {
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) {
/**
* 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,"
* 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 };
}
}
- private Binder<AtomicReference<String>> converterBinder = new Binder<>();
+ private final Binder<AtomicReference<String>> converterBinder = new Binder<>();
private CheckBoxGroup<TestEnum> select;
public static class Jsr303UnitTest implements UnitTest {
- private TextField nameField = new TextField();
+ private final TextField nameField = new TextField();
@Override
public void execute() {
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
private static class DeploymentConfigImpl
extends AbstractDeploymentConfiguration {
- private Properties properties;
+ private final Properties properties;
DeploymentConfigImpl(Properties props) {
properties = props;
import org.junit.Test;
public class DownloadStreamTest {
- private String filename = "日本語.png";
+ private final String filename = "日本語.png";
private DownloadStream stream;
@Before
private int closeCount;
- private ReentrantLock lock = new ReentrantLock();
+ private final ReentrantLock lock = new ReentrantLock();
}
@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";
}
}
- private MockVaadinSession session = new MockVaadinSession(
+ private final MockVaadinSession session = new MockVaadinSession(
Mockito.mock(VaadinService.class));
@Test
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;
public enum AnotherTestEnum {
ONE("ONE"), TWO("TWO");
- private String id;
+ private final String id;
private AnotherTestEnum(String id) {
this.id = id;
@Valid
private Address address;
- private String readOnlyProperty = "READONLY DATA";
+ private final String readOnlyProperty = "READONLY DATA";
private String writeOnlyProperty;
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;
public enum Sex {
MALE("Male"), FEMALE("Female"), UNKNOWN("Unknown");
- private String stringRepresentation;
+ private final String stringRepresentation;
private Sex(String stringRepresentation) {
this.stringRepresentation = stringRepresentation;
public enum TestEnum {
ONE("1"), TWO("2");
- private String id;
+ private final String id;
private TestEnum(String id) {
this.id = id;
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) {
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;
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");
public class ExtendedDesignWithEmptyAnnotation
extends DesignWithEmptyAnnotation {
- private TextField customField = new TextField();
+ private final TextField customField = new TextField();
public ExtendedDesignWithEmptyAnnotation() {
super();
*/
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 {
* 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\\..*", //
rpcRequest.getCsrfToken());
}
- private static Logger LOGGER = Logger
+ private static final Logger LOGGER = Logger
.getLogger(CsrfTokenMissingTest.class.getName());
static {
LOGGER.setLevel(Level.ALL);
public static class EventEquals<E extends ConnectorEvent>
implements IArgumentMatcher {
- private E expected;
+ private final E expected;
public EventEquals(E expected) {
this.expected = expected;
public class StateGetDoesNotMarkDirtyTest {
- private Set<String> excludedMethods = new HashSet<>();
+ private final Set<String> excludedMethods = new HashSet<>();
@Before
public void setUp() {
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
private int readCount;
private boolean isClosed;
- private int maxArrayLength;
+ private final int maxArrayLength;
}
}
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;
*/
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)
public class AttachDetachWindowTest {
- private VaadinSession testApp = new AlwaysLockedVaadinSession(null);
+ private final VaadinSession testApp = new AlwaysLockedVaadinSession(null);
private interface TestContainer {
public boolean attachCalled();
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);
boolean contentAttachCalled = false;
boolean childAttachCalled = false;
- private Label child = new Label() {
+ private final Label child = new Label() {
@Override
public void attach() {
super.attach();
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);
return page;
}
- private Page page;
+ private final Page page;
}
private static class TestPage extends Page {
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() {
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()