diff options
Diffstat (limited to 'server/src')
113 files changed, 412 insertions, 431 deletions
diff --git a/server/src/main/java/com/vaadin/data/BeanBinder.java b/server/src/main/java/com/vaadin/data/BeanBinder.java index 07bc40b1dd..8f79ff4f88 100644 --- a/server/src/main/java/com/vaadin/data/BeanBinder.java +++ b/server/src/main/java/com/vaadin/data/BeanBinder.java @@ -36,9 +36,9 @@ import com.googlecode.gentyref.GenericTypeReflector; import com.vaadin.annotations.PropertyId; import com.vaadin.data.util.BeanUtil; import com.vaadin.data.validator.BeanValidator; -import com.vaadin.server.Setter; import com.vaadin.server.SerializableFunction; import com.vaadin.server.SerializablePredicate; +import com.vaadin.server.Setter; import com.vaadin.ui.Label; import com.vaadin.util.ReflectTools; @@ -160,8 +160,7 @@ public class BeanBinder<BEAN> extends Binder<BEAN> { * @throws IllegalArgumentException * if the property has no accessible getter * - * @see BindingBuilder#bind(ValueProvider, - * Setter) + * @see BindingBuilder#bind(ValueProvider, Setter) */ public Binding<BEAN, TARGET> bind(String propertyName); } diff --git a/server/src/main/java/com/vaadin/data/Binder.java b/server/src/main/java/com/vaadin/data/Binder.java index 94a16d9da9..5cde210189 100644 --- a/server/src/main/java/com/vaadin/data/Binder.java +++ b/server/src/main/java/com/vaadin/data/Binder.java @@ -34,9 +34,9 @@ import com.vaadin.data.HasValue.ValueChangeEvent; import com.vaadin.data.converter.StringToIntegerConverter; import com.vaadin.event.EventRouter; import com.vaadin.server.ErrorMessage; -import com.vaadin.server.Setter; import com.vaadin.server.SerializableFunction; import com.vaadin.server.SerializablePredicate; +import com.vaadin.server.Setter; import com.vaadin.server.UserError; import com.vaadin.shared.Registration; import com.vaadin.ui.AbstractComponent; @@ -171,8 +171,7 @@ public class Binder<BEAN> implements Serializable { * @throws IllegalStateException * if {@code bind} has already been called on this binding */ - public Binding<BEAN, TARGET> bind( - ValueProvider<BEAN, TARGET> getter, + public Binding<BEAN, TARGET> bind(ValueProvider<BEAN, TARGET> getter, Setter<BEAN, TARGET> setter); /** @@ -255,8 +254,8 @@ public class Binder<BEAN> implements Serializable { * which must match the current target data type of the binding, and a * model type, which can be any data type and becomes the new target * type of the binding. When invoking - * {@link #bind(ValueProvider, Setter)}, the - * target type of the binding must match the getter/setter types. + * {@link #bind(ValueProvider, Setter)}, the target type of the binding + * must match the getter/setter types. * <p> * For instance, a {@code TextField} can be bound to an integer-typed * property using an appropriate converter such as a @@ -281,8 +280,8 @@ public class Binder<BEAN> implements Serializable { * type, which must match the current target data type of the binding, * and a model type, which can be any data type and becomes the new * target type of the binding. When invoking - * {@link #bind(ValueProvider, Setter)}, the - * target type of the binding must match the getter/setter types. + * {@link #bind(ValueProvider, Setter)}, the target type of the binding + * must match the getter/setter types. * <p> * For instance, a {@code TextField} can be bound to an integer-typed * property using appropriate functions such as: @@ -316,8 +315,8 @@ public class Binder<BEAN> implements Serializable { * type, which must match the current target data type of the binding, * and a model type, which can be any data type and becomes the new * target type of the binding. When invoking - * {@link #bind(ValueProvider, Setter)}, the - * target type of the binding must match the getter/setter types. + * {@link #bind(ValueProvider, Setter)}, the target type of the binding + * must match the getter/setter types. * <p> * For instance, a {@code TextField} can be bound to an integer-typed * property using appropriate functions such as: @@ -381,12 +380,13 @@ public class Binder<BEAN> implements Serializable { * default behavior). * <p> * This is just a shorthand for - * {@link #withValidationStatusHandler(BindingValidationStatusHandler)} method - * where the handler instance hides the {@code label} if there is no - * error and shows it with validation error message if validation fails. - * It means that it cannot be called after - * {@link #withValidationStatusHandler(BindingValidationStatusHandler)} method - * call or {@link #withValidationStatusHandler(BindingValidationStatusHandler)} + * {@link #withValidationStatusHandler(BindingValidationStatusHandler)} + * method where the handler instance hides the {@code label} if there is + * no error and shows it with validation error message if validation + * fails. It means that it cannot be called after + * {@link #withValidationStatusHandler(BindingValidationStatusHandler)} + * method call or + * {@link #withValidationStatusHandler(BindingValidationStatusHandler)} * after this method call. * * @see #withValidationStatusHandler(BindingValidationStatusHandler) @@ -405,8 +405,8 @@ public class Binder<BEAN> implements Serializable { } /** - * Sets a {@link BindingValidationStatusHandler} to track validation status - * changes. + * Sets a {@link BindingValidationStatusHandler} to track validation + * status changes. * <p> * The validation state of each field is updated whenever the user * modifies the value of that field. The validation state is by default @@ -532,8 +532,7 @@ public class Binder<BEAN> implements Serializable { } @Override - public Binding<BEAN, TARGET> bind( - ValueProvider<BEAN, TARGET> getter, + public Binding<BEAN, TARGET> bind(ValueProvider<BEAN, TARGET> getter, Setter<BEAN, TARGET> setter) { checkUnbound(); Objects.requireNonNull(getter, "getter cannot be null"); @@ -575,9 +574,9 @@ public class Binder<BEAN> implements Serializable { checkUnbound(); Objects.requireNonNull(handler, "handler cannot be null"); if (isStatusHandlerChanged) { - throw new IllegalStateException( - "A " + BindingValidationStatusHandler.class.getSimpleName() - + " has already been set"); + throw new IllegalStateException("A " + + BindingValidationStatusHandler.class.getSimpleName() + + " has already been set"); } isStatusHandlerChanged = true; statusHandler = handler; @@ -735,7 +734,8 @@ public class Binder<BEAN> implements Serializable { /** * Returns the field value run through all converters and validators, - * but doesn't pass the {@link BindingValidationStatus} to any status handler. + * but doesn't pass the {@link BindingValidationStatus} to any status + * handler. * * @return the result of the conversion */ @@ -755,7 +755,8 @@ public class Binder<BEAN> implements Serializable { /** * Returns the field value run through all converters and validators, - * but doesn't pass the {@link BindingValidationStatus} to any status handler. + * but doesn't pass the {@link BindingValidationStatus} to any status + * handler. * * @return the validation status */ @@ -976,9 +977,8 @@ public class Binder<BEAN> implements Serializable { /** * Creates a new binding for the given field. The returned builder may be * further configured before invoking - * {@link BindingBuilder#bind(ValueProvider, Setter)} - * which completes the binding. Until {@code Binding.bind} is called, the - * binding has no effect. + * {@link BindingBuilder#bind(ValueProvider, Setter)} which completes the + * binding. Until {@code Binding.bind} is called, the binding has no effect. * <p> * <strong>Note:</strong> Not all {@link HasValue} implementations support * passing {@code null} as the value. For these the Binder will @@ -1059,8 +1059,7 @@ public class Binder<BEAN> implements Serializable { * @return the newly created binding */ public <FIELDVALUE> Binding<BEAN, FIELDVALUE> bind( - HasValue<FIELDVALUE> field, - ValueProvider<BEAN, FIELDVALUE> getter, + HasValue<FIELDVALUE> field, ValueProvider<BEAN, FIELDVALUE> getter, Setter<BEAN, FIELDVALUE> setter) { return forField(field).bind(getter, setter); } @@ -1133,8 +1132,8 @@ public class Binder<BEAN> implements Serializable { setHasChanges(false); bindings.forEach(binding -> binding.initFieldValue(bean)); - getValidationStatusHandler() - .statusChange(BinderValidationStatus.createUnresolvedStatus(this)); + getValidationStatusHandler().statusChange( + BinderValidationStatus.createUnresolvedStatus(this)); fireStatusChangeEvent(false); } @@ -1208,8 +1207,8 @@ public class Binder<BEAN> implements Serializable { // First run fields level validation List<BindingValidationStatus<?>> bindingStatuses = validateBindings(); // If no validation errors then update bean - if (bindingStatuses.stream().filter(BindingValidationStatus::isError).findAny() - .isPresent()) { + if (bindingStatuses.stream().filter(BindingValidationStatus::isError) + .findAny().isPresent()) { fireStatusChangeEvent(true); return new BinderValidationStatus<>(this, bindingStatuses, Collections.emptyList()); @@ -1325,8 +1324,8 @@ public class Binder<BEAN> implements Serializable { List<BindingValidationStatus<?>> bindingStatuses = validateBindings(); BinderValidationStatus<BEAN> validationStatus; - if (bindingStatuses.stream().filter(BindingValidationStatus::isError).findAny() - .isPresent() || bean == null) { + if (bindingStatuses.stream().filter(BindingValidationStatus::isError) + .findAny().isPresent() || bean == null) { validationStatus = new BinderValidationStatus<>(this, bindingStatuses, Collections.emptyList()); } else { @@ -1371,11 +1370,10 @@ public class Binder<BEAN> implements Serializable { */ private List<ValidationResult> validateBean(BEAN bean) { Objects.requireNonNull(bean, "bean cannot be null"); - List<ValidationResult> results = Collections - .unmodifiableList(validators.stream() - .map(validator -> validator.apply(bean, - new ValueContext())) - .collect(Collectors.toList())); + List<ValidationResult> results = Collections.unmodifiableList(validators + .stream() + .map(validator -> validator.apply(bean, new ValueContext())) + .collect(Collectors.toList())); return results; } @@ -1472,9 +1470,7 @@ public class Binder<BEAN> implements Serializable { * <li>{@link #readBean(Object)} is called * <li>{@link #setBean(Object)} is called * <li>{@link #removeBean()} is called - * <li> - * {@link BindingBuilder#bind(ValueProvider, Setter)} - * is called + * <li>{@link BindingBuilder#bind(ValueProvider, Setter)} is called * <li>{@link Binder#validate()} or {@link Binding#validate()} is called * </ul> * @@ -1552,7 +1548,8 @@ public class Binder<BEAN> implements Serializable { } /** - * Default {@link BindingValidationStatusHandler} functional method implementation. + * Default {@link BindingValidationStatusHandler} functional method + * implementation. * * @param status * the validation status @@ -1673,8 +1670,8 @@ public class Binder<BEAN> implements Serializable { if (bean != null) { bean = null; } - getValidationStatusHandler() - .statusChange(BinderValidationStatus.createUnresolvedStatus(this)); + getValidationStatusHandler().statusChange( + BinderValidationStatus.createUnresolvedStatus(this)); if (fireStatusEvent) { fireStatusChangeEvent(false); } diff --git a/server/src/main/java/com/vaadin/data/BinderValidationStatus.java b/server/src/main/java/com/vaadin/data/BinderValidationStatus.java index c95a93f074..f89b743258 100644 --- a/server/src/main/java/com/vaadin/data/BinderValidationStatus.java +++ b/server/src/main/java/com/vaadin/data/BinderValidationStatus.java @@ -71,8 +71,8 @@ public class BinderValidationStatus<BEAN> implements Serializable { public static <BEAN> BinderValidationStatus<BEAN> createUnresolvedStatus( Binder<BEAN> source) { return new BinderValidationStatus<>(source, - source.getBindings().stream() - .map(b -> BindingValidationStatus.createUnresolvedStatus(b)) + source.getBindings().stream().map( + b -> BindingValidationStatus.createUnresolvedStatus(b)) .collect(Collectors.toList()), Collections.emptyList()); } @@ -118,8 +118,9 @@ public class BinderValidationStatus<BEAN> implements Serializable { public boolean hasErrors() { return binderStatuses.stream().filter(ValidationResult::isError) .findAny().isPresent() - || bindingStatuses.stream().filter(BindingValidationStatus::isError) - .findAny().isPresent(); + || bindingStatuses.stream() + .filter(BindingValidationStatus::isError).findAny() + .isPresent(); } /** diff --git a/server/src/main/java/com/vaadin/data/Converter.java b/server/src/main/java/com/vaadin/data/Converter.java index cf59a0fc0c..5f1094141c 100644 --- a/server/src/main/java/com/vaadin/data/Converter.java +++ b/server/src/main/java/com/vaadin/data/Converter.java @@ -19,6 +19,7 @@ package com.vaadin.data; import java.io.Serializable; import java.util.function.Function; +import com.vaadin.data.Binder.BindingBuilder; import com.vaadin.server.SerializableFunction; /** diff --git a/server/src/main/java/com/vaadin/data/Result.java b/server/src/main/java/com/vaadin/data/Result.java index 312701584f..cf4b88adf0 100644 --- a/server/src/main/java/com/vaadin/data/Result.java +++ b/server/src/main/java/com/vaadin/data/Result.java @@ -16,14 +16,14 @@ package com.vaadin.data; -import com.vaadin.server.SerializableConsumer; -import com.vaadin.server.SerializableFunction; -import com.vaadin.server.SerializableSupplier; - import java.io.Serializable; import java.util.Objects; import java.util.Optional; +import com.vaadin.server.SerializableConsumer; +import com.vaadin.server.SerializableFunction; +import com.vaadin.server.SerializableSupplier; + /** * Represents the result of an operation that might fail, such as type * conversion. A result may contain either a value, signifying a successful @@ -131,7 +131,8 @@ public interface Result<R> extends Serializable { * @param ifError * the function to call if failure */ - public void handle(SerializableConsumer<R> ifOk, SerializableConsumer<String> ifError); + public void handle(SerializableConsumer<R> ifOk, + SerializableConsumer<String> ifError); /** * Applies the {@code consumer} if result is not an error. @@ -184,5 +185,6 @@ public interface Result<R> extends Serializable { * if this result denotes an error */ public <X extends Throwable> R getOrThrow( - SerializableFunction<String, ? extends X> exceptionProvider) throws X; + SerializableFunction<String, ? extends X> exceptionProvider) + throws X; } diff --git a/server/src/main/java/com/vaadin/data/SimpleResult.java b/server/src/main/java/com/vaadin/data/SimpleResult.java index 61df0ca6f9..85dee60c8f 100644 --- a/server/src/main/java/com/vaadin/data/SimpleResult.java +++ b/server/src/main/java/com/vaadin/data/SimpleResult.java @@ -15,12 +15,12 @@ */ package com.vaadin.data; -import com.vaadin.server.SerializableConsumer; -import com.vaadin.server.SerializableFunction; - import java.util.Objects; import java.util.Optional; +import com.vaadin.server.SerializableConsumer; +import com.vaadin.server.SerializableFunction; + /** * An internal implementation of {@code Result}. * @@ -66,7 +66,8 @@ class SimpleResult<R> implements Result<R> { } @Override - public void handle(SerializableConsumer<R> ifOk, SerializableConsumer<String> ifError) { + public void handle(SerializableConsumer<R> ifOk, + SerializableConsumer<String> ifError) { Objects.requireNonNull(ifOk, "ifOk cannot be null"); Objects.requireNonNull(ifError, "ifError cannot be null"); if (isError()) { @@ -97,7 +98,8 @@ class SimpleResult<R> implements Result<R> { @Override public <X extends Throwable> R getOrThrow( - SerializableFunction<String, ? extends X> exceptionSupplier) throws X { + SerializableFunction<String, ? extends X> exceptionSupplier) + throws X { Objects.requireNonNull(exceptionSupplier, "Exception supplier cannot be null"); if (isError()) { diff --git a/server/src/main/java/com/vaadin/data/StatusChangeEvent.java b/server/src/main/java/com/vaadin/data/StatusChangeEvent.java index 42f92e654c..e4db2b8868 100644 --- a/server/src/main/java/com/vaadin/data/StatusChangeEvent.java +++ b/server/src/main/java/com/vaadin/data/StatusChangeEvent.java @@ -32,8 +32,7 @@ import com.vaadin.server.Setter; * <li>{@link Binder#readBean(Object)} is called * <li>{@link Binder#setBean(Object)} is called * <li>{@link Binder#removeBean()} is called - * <li>{@link BindingBuilder#bind(ValueProvider, Setter)} - * is called + * <li>{@link BindingBuilder#bind(ValueProvider, Setter)} is called * <li>{@link Binder#validate()} or {@link Binding#validate()} is called * </ul> * diff --git a/server/src/main/java/com/vaadin/data/ValidationException.java b/server/src/main/java/com/vaadin/data/ValidationException.java index fe515ad56d..3122614b36 100644 --- a/server/src/main/java/com/vaadin/data/ValidationException.java +++ b/server/src/main/java/com/vaadin/data/ValidationException.java @@ -44,7 +44,8 @@ public class ValidationException extends Exception { * @param beanValidationErrors * binder validation errors list */ - public ValidationException(List<BindingValidationStatus<?>> fieldValidationErrors, + public ValidationException( + List<BindingValidationStatus<?>> fieldValidationErrors, List<ValidationResult> beanValidationErrors) { super("Validation has failed for some fields"); this.fieldValidationErrors = Collections diff --git a/server/src/main/java/com/vaadin/data/ValidationResult.java b/server/src/main/java/com/vaadin/data/ValidationResult.java index 489631005f..d458911ba1 100644 --- a/server/src/main/java/com/vaadin/data/ValidationResult.java +++ b/server/src/main/java/com/vaadin/data/ValidationResult.java @@ -78,7 +78,7 @@ public interface ValidationResult extends Serializable { /** * Returns a successful result. - * + * * @return the successful result */ public static ValidationResult ok() { @@ -88,7 +88,7 @@ public interface ValidationResult extends Serializable { /** * Creates the validation result which represent an error with the given * {@code errorMessage}. - * + * * @param errorMessage * error message, not {@code null} * @return validation result which represent an error with the given diff --git a/server/src/main/java/com/vaadin/data/ValueContext.java b/server/src/main/java/com/vaadin/data/ValueContext.java index 98aef181dc..07857d34af 100644 --- a/server/src/main/java/com/vaadin/data/ValueContext.java +++ b/server/src/main/java/com/vaadin/data/ValueContext.java @@ -39,8 +39,8 @@ public class ValueContext implements Serializable { * Constructor for {@code ValueContext} without a {@code Locale}. */ public ValueContext() { - this.component = null; - this.locale = findLocale(); + component = null; + locale = findLocale(); } /** @@ -50,7 +50,7 @@ public class ValueContext implements Serializable { * The locale used with conversion. Can be null. */ public ValueContext(Locale locale) { - this.component = null; + component = null; this.locale = locale; } @@ -64,7 +64,7 @@ public class ValueContext implements Serializable { Objects.requireNonNull(component, "Component can't be null in ValueContext construction"); this.component = component; - this.locale = findLocale(); + locale = findLocale(); } private Locale findLocale() { diff --git a/server/src/main/java/com/vaadin/data/ValueProvider.java b/server/src/main/java/com/vaadin/data/ValueProvider.java index 9e4acc466f..9617cc559f 100644 --- a/server/src/main/java/com/vaadin/data/ValueProvider.java +++ b/server/src/main/java/com/vaadin/data/ValueProvider.java @@ -23,7 +23,7 @@ import com.vaadin.server.SerializableFunction; * For example this interface can be implemented to simply extract a value with * a getter, or to create a composite value based on the fields of the source * object. - * + * * @author Vaadin Ltd. * @since 8.0 * @@ -49,7 +49,7 @@ public interface ValueProvider<SOURCE, TARGET> /** * Provides a value from the given source object. - * + * * @param source * the source to retrieve the value from * @return the value provided by the source diff --git a/server/src/main/java/com/vaadin/data/provider/DataGenerator.java b/server/src/main/java/com/vaadin/data/provider/DataGenerator.java index 32c41473ed..f7ffa78ab6 100644 --- a/server/src/main/java/com/vaadin/data/provider/DataGenerator.java +++ b/server/src/main/java/com/vaadin/data/provider/DataGenerator.java @@ -35,7 +35,8 @@ public interface DataGenerator<T> extends Serializable { /** * Adds custom data for the given item to its serialized {@code JsonObject} - * representation. This JSON object will be sent to client-side DataProvider. + * representation. This JSON object will be sent to client-side + * DataProvider. * * @param item * the data item being serialized diff --git a/server/src/main/java/com/vaadin/data/provider/DataProviderListener.java b/server/src/main/java/com/vaadin/data/provider/DataProviderListener.java index 99693a2c1b..582bdc1d86 100644 --- a/server/src/main/java/com/vaadin/data/provider/DataProviderListener.java +++ b/server/src/main/java/com/vaadin/data/provider/DataProviderListener.java @@ -20,7 +20,7 @@ import java.io.Serializable; /** * Interface for listening for a data change events fired by a * {@link DataProvider}. - * + * * @author Vaadin Ltd * @since 8.0 */ diff --git a/server/src/main/java/com/vaadin/event/ActionManager.java b/server/src/main/java/com/vaadin/event/ActionManager.java index 5d9a92e000..1056106b16 100644 --- a/server/src/main/java/com/vaadin/event/ActionManager.java +++ b/server/src/main/java/com/vaadin/event/ActionManager.java @@ -15,6 +15,7 @@ */ package com.vaadin.event; +import java.util.Arrays; import java.util.HashSet; import java.util.LinkedHashSet; import java.util.Map; @@ -26,7 +27,6 @@ import com.vaadin.server.PaintException; import com.vaadin.server.PaintTarget; import com.vaadin.server.VariableOwner; import com.vaadin.ui.Component; -import java.util.Arrays; /** * Javadoc TODO diff --git a/server/src/main/java/com/vaadin/event/FieldEvents.java b/server/src/main/java/com/vaadin/event/FieldEvents.java index b5c45732f9..fec20f8d6f 100644 --- a/server/src/main/java/com/vaadin/event/FieldEvents.java +++ b/server/src/main/java/com/vaadin/event/FieldEvents.java @@ -190,7 +190,7 @@ public interface FieldEvents { /** * Focus and blur server RPC implementation which fires focus or blur event * using a provided event handler. - * + * * @author Vaadin Ltd * */ @@ -201,7 +201,7 @@ public interface FieldEvents { /** * Create a new decorator instance. - * + * * @param component * the source events component * @param eventHandler diff --git a/server/src/main/java/com/vaadin/event/SortEvent.java b/server/src/main/java/com/vaadin/event/SortEvent.java index 496e5863f9..23182fcfb0 100644 --- a/server/src/main/java/com/vaadin/event/SortEvent.java +++ b/server/src/main/java/com/vaadin/event/SortEvent.java @@ -78,7 +78,7 @@ public class SortEvent<T> extends Component.Event { /** * Listener for sort order change events. - * + * * @param <T> * the type of the sorting information, usually a String (field * id) or a {@link java.util.Comparator}. @@ -97,7 +97,7 @@ public class SortEvent<T> extends Component.Event { /** * The interface for adding and removing listeners for {@link SortEvent * SortEvents}. - * + * * @param <T> * the type of the sorting information, usually a String (field * id) or a {@link java.util.Comparator}. 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 49ea24e5cb..23b82c4def 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 @@ -63,8 +63,8 @@ public class SourceIs extends ClientSideCriterion { @Override public boolean accept(DragAndDropEvent dragEvent) { if (dragEvent.getTransferable() instanceof TransferableImpl) { - Component sourceComponent = dragEvent - .getTransferable().getSourceComponent(); + Component sourceComponent = dragEvent.getTransferable() + .getSourceComponent(); for (Component c : components) { if (c == sourceComponent) { return true; 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 8cb16e4313..2a0fd25662 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 @@ -46,8 +46,8 @@ public class SourceIsTarget extends ClientSideCriterion { @Override public boolean accept(DragAndDropEvent dragEvent) { if (dragEvent.getTransferable() instanceof TransferableImpl) { - Component sourceComponent = dragEvent - .getTransferable().getSourceComponent(); + Component sourceComponent = dragEvent.getTransferable() + .getSourceComponent(); DropTarget target = dragEvent.getTargetDetails().getTarget(); return sourceComponent == target; } diff --git a/server/src/main/java/com/vaadin/server/AbstractClientConnector.java b/server/src/main/java/com/vaadin/server/AbstractClientConnector.java index a9709f3826..baab7a04da 100644 --- a/server/src/main/java/com/vaadin/server/AbstractClientConnector.java +++ b/server/src/main/java/com/vaadin/server/AbstractClientConnector.java @@ -878,8 +878,7 @@ public abstract class AbstractClientConnector * <p> * Note: Using this method is discouraged because it cannot be checked * during compilation. Use {@link #addListener(Class, Object, Method)} or - * {@link #addListener(String, Class, Object, Method) instead. - * </p> + * {@link #addListener(String, Class, Object, Method) instead. </p> * * @param eventType * the type of the listened event. Events of this type or its @@ -920,9 +919,8 @@ public abstract class AbstractClientConnector * @param target * the target object that has registered to listen to events of * type <code>eventType</code> with one or more methods. - * @deprecated use a {@link Registration} from - * {@link #addListener} to remove a - * listener + * @deprecated use a {@link Registration} from {@link #addListener} to + * remove a listener */ @Deprecated @Override diff --git a/server/src/main/java/com/vaadin/server/BootstrapHandler.java b/server/src/main/java/com/vaadin/server/BootstrapHandler.java index 3cb1dc9097..895598ae6f 100644 --- a/server/src/main/java/com/vaadin/server/BootstrapHandler.java +++ b/server/src/main/java/com/vaadin/server/BootstrapHandler.java @@ -354,7 +354,7 @@ public abstract class BootstrapHandler extends SynchronizedRequestHandler { throws IOException { response.setContentType("text/html"); try (BufferedWriter writer = new BufferedWriter( - new OutputStreamWriter(response.getOutputStream(), "UTF-8"))) { + new OutputStreamWriter(response.getOutputStream(), "UTF-8"))) { writer.append(html); } } diff --git a/server/src/main/java/com/vaadin/server/BrowserWindowOpener.java b/server/src/main/java/com/vaadin/server/BrowserWindowOpener.java index 8d597f45e0..70af410e5c 100644 --- a/server/src/main/java/com/vaadin/server/BrowserWindowOpener.java +++ b/server/src/main/java/com/vaadin/server/BrowserWindowOpener.java @@ -209,7 +209,7 @@ public class BrowserWindowOpener extends AbstractExtension { } // Avoid breaking url to multiple lines - // @formatter:off + // @formatter:off /** * Sets the features for opening the window. See e.g. * {@link https://developer.mozilla.org/en-US/docs/DOM/window.open#Position_and_size_features} diff --git a/server/src/main/java/com/vaadin/server/ComponentSizeValidator.java b/server/src/main/java/com/vaadin/server/ComponentSizeValidator.java index a9068495dc..20100e0e5a 100644 --- a/server/src/main/java/com/vaadin/server/ComponentSizeValidator.java +++ b/server/src/main/java/com/vaadin/server/ComponentSizeValidator.java @@ -17,7 +17,9 @@ package com.vaadin.server; import java.io.PrintStream; import java.io.Serializable; +import java.util.ArrayDeque; import java.util.ArrayList; +import java.util.Deque; import java.util.HashMap; import java.util.Iterator; import java.util.LinkedList; @@ -40,8 +42,6 @@ import com.vaadin.ui.TabSheet; import com.vaadin.ui.UI; import com.vaadin.ui.VerticalLayout; import com.vaadin.ui.Window; -import java.util.ArrayDeque; -import java.util.Deque; @SuppressWarnings({ "serial", "deprecation" }) public class ComponentSizeValidator implements Serializable { @@ -104,7 +104,7 @@ public class ComponentSizeValidator implements Serializable { /** * Comparability form component which is defined in the different jar. - * + * * TODO : Normally this logic shouldn't be here. But it means that the whole * this class has wrong design and implementation and should be refactored. */ @@ -402,7 +402,8 @@ public class ComponentSizeValidator implements Serializable { } if (createLoc != null) { - err.append(", created at (").append(createLoc.file).append(":").append(createLoc.lineNumber).append(")"); + err.append(", created at (").append(createLoc.file).append(":") + .append(createLoc.lineNumber).append(")"); } @@ -410,7 +411,8 @@ public class ComponentSizeValidator implements Serializable { err.append(" ("); err.append(attribute); if (sizeLoc != null) { - err.append(", set at (").append(sizeLoc.file).append(":").append(sizeLoc.lineNumber).append(")"); + err.append(", set at (").append(sizeLoc.file).append(":") + .append(sizeLoc.lineNumber).append(")"); } err.append(")"); @@ -512,7 +514,7 @@ public class ComponentSizeValidator implements Serializable { /** * Comparability form component which is defined in the different jar. - * + * * TODO : Normally this logic shouldn't be here. But it means that the whole * this class has wrong design and impementation and should be refactored. */ @@ -713,8 +715,7 @@ public class ComponentSizeValidator implements Serializable { public static List<InvalidLayout> validateLayouts(UI ui) { List<InvalidLayout> invalidRelativeSizes = ComponentSizeValidator .validateComponentRelativeSizes(ui.getContent(), - new ArrayList<>(), - null); + new ArrayList<>(), null); // Also check any existing subwindows if (ui.getWindows() != null) { diff --git a/server/src/main/java/com/vaadin/server/JsonCodec.java b/server/src/main/java/com/vaadin/server/JsonCodec.java index a5725e3d45..001961ca37 100644 --- a/server/src/main/java/com/vaadin/server/JsonCodec.java +++ b/server/src/main/java/com/vaadin/server/JsonCodec.java @@ -499,8 +499,7 @@ public class JsonCodec implements Serializable { assert (keys.length() == values.length()); - Map<Object, Object> map = new HashMap<>( - keys.length() * 2); + Map<Object, Object> map = new HashMap<>(keys.length() * 2); for (int i = 0; i < keys.length(); i++) { Object key = decodeInternalOrCustomType(keyType, keys.get(i), connectorTracker); diff --git a/server/src/main/java/com/vaadin/server/JsonPaintTarget.java b/server/src/main/java/com/vaadin/server/JsonPaintTarget.java index 69a9889c30..905dc03246 100644 --- a/server/src/main/java/com/vaadin/server/JsonPaintTarget.java +++ b/server/src/main/java/com/vaadin/server/JsonPaintTarget.java @@ -19,9 +19,13 @@ package com.vaadin.server; import java.io.PrintWriter; import java.io.Serializable; import java.io.Writer; +import java.util.ArrayDeque; +import java.util.ArrayList; import java.util.Collection; +import java.util.Deque; import java.util.HashSet; import java.util.Iterator; +import java.util.List; import java.util.Map; import java.util.Set; import java.util.logging.Level; @@ -30,10 +34,6 @@ import java.util.logging.Logger; import com.vaadin.ui.Alignment; import com.vaadin.ui.Component; import com.vaadin.ui.CustomLayout; -import java.util.ArrayDeque; -import java.util.ArrayList; -import java.util.Deque; -import java.util.List; /** * User Interface Description Language Target. diff --git a/server/src/main/java/com/vaadin/server/LegacyCommunicationManager.java b/server/src/main/java/com/vaadin/server/LegacyCommunicationManager.java index 98193d2613..8d79da672b 100644 --- a/server/src/main/java/com/vaadin/server/LegacyCommunicationManager.java +++ b/server/src/main/java/com/vaadin/server/LegacyCommunicationManager.java @@ -299,7 +299,6 @@ public class LegacyCommunicationManager implements Serializable { } } - /** * @deprecated As of 7.1. In 7.2 and later, use * {@link ConnectorTracker#getConnector(String) diff --git a/server/src/main/java/com/vaadin/server/LegacyVaadinPortlet.java b/server/src/main/java/com/vaadin/server/LegacyVaadinPortlet.java index 4553f577a2..9f22905664 100644 --- a/server/src/main/java/com/vaadin/server/LegacyVaadinPortlet.java +++ b/server/src/main/java/com/vaadin/server/LegacyVaadinPortlet.java @@ -49,8 +49,8 @@ public class LegacyVaadinPortlet extends VaadinPortlet { getService().addSessionInitListener((SessionInitEvent event) -> { try { onVaadinSessionStarted( - (VaadinPortletRequest) event.getRequest(), - (VaadinPortletSession) event.getSession()); + (VaadinPortletRequest) event.getRequest(), + (VaadinPortletSession) event.getSession()); } catch (PortletException e) { throw new ServiceException(e); } diff --git a/server/src/main/java/com/vaadin/server/LegacyVaadinServlet.java b/server/src/main/java/com/vaadin/server/LegacyVaadinServlet.java index 06628d644a..40f76ebd1a 100644 --- a/server/src/main/java/com/vaadin/server/LegacyVaadinServlet.java +++ b/server/src/main/java/com/vaadin/server/LegacyVaadinServlet.java @@ -49,8 +49,7 @@ public class LegacyVaadinServlet extends VaadinServlet { getService().addSessionInitListener((SessionInitEvent event) -> { try { - onVaadinSessionStarted(event.getRequest(), - event.getSession()); + onVaadinSessionStarted(event.getRequest(), event.getSession()); } catch (ServletException e) { throw new ServiceException(e); } diff --git a/server/src/main/java/com/vaadin/server/LocaleService.java b/server/src/main/java/com/vaadin/server/LocaleService.java index c2b28d1cab..4398864c90 100644 --- a/server/src/main/java/com/vaadin/server/LocaleService.java +++ b/server/src/main/java/com/vaadin/server/LocaleService.java @@ -206,8 +206,7 @@ public class LocaleService implements Serializable { final boolean twelve_hour_clock = timeformat.contains("a"); // TODO there are other possibilities as well, like 'h' in french // (ignore them, too complicated) - final String hour_min_delimiter = timeformat.contains(".") ? "." - : ":"; + final String hour_min_delimiter = timeformat.contains(".") ? "." : ":"; // outWriter.print("\"tf\":\"" + timeformat + "\","); localeData.twelveHourClock = twelve_hour_clock; localeData.hourMinuteDelimiter = hour_min_delimiter; diff --git a/server/src/main/java/com/vaadin/server/SerializableComparator.java b/server/src/main/java/com/vaadin/server/SerializableComparator.java index 213cc5cc49..448d2e09ba 100644 --- a/server/src/main/java/com/vaadin/server/SerializableComparator.java +++ b/server/src/main/java/com/vaadin/server/SerializableComparator.java @@ -20,7 +20,7 @@ import java.util.Comparator; /** * A {@link Comparator} that is also {@link Serializable}. - * + * * @author Vaadin Ltd * @param <T> * the type of objects that may be compared by this comparator @@ -33,7 +33,7 @@ public interface SerializableComparator<T> extends Comparator<T>, Serializable { /** * Returns a {@link SerializableComparator} instance which delegates its * logic to the provided {@code comparator}. - * + * * @param comparator * comparator to convert * @param <T> diff --git a/server/src/main/java/com/vaadin/server/SerializableConsumer.java b/server/src/main/java/com/vaadin/server/SerializableConsumer.java index e8b0a7adca..1680bc7c4c 100644 --- a/server/src/main/java/com/vaadin/server/SerializableConsumer.java +++ b/server/src/main/java/com/vaadin/server/SerializableConsumer.java @@ -20,11 +20,11 @@ import java.util.function.Consumer; /** * A {@link Consumer} that is also {@link Serializable}. - * + * * @see Consumer * @param <T> * the type of the first argument to the operation - * + * * @since 8.0 * @author Vaadin Ltd * diff --git a/server/src/main/java/com/vaadin/server/SerializablePredicate.java b/server/src/main/java/com/vaadin/server/SerializablePredicate.java index 5172aebe70..ae7dcdef5e 100644 --- a/server/src/main/java/com/vaadin/server/SerializablePredicate.java +++ b/server/src/main/java/com/vaadin/server/SerializablePredicate.java @@ -20,7 +20,7 @@ import java.util.function.Predicate; /** * A {@link Predicate} that is also {@link Serializable}. - * + * * @author Vaadin Ltd * @since 8.0 * @param <T> diff --git a/server/src/main/java/com/vaadin/server/SerializableSupplier.java b/server/src/main/java/com/vaadin/server/SerializableSupplier.java index 4b7cfa1305..195f0a60d8 100644 --- a/server/src/main/java/com/vaadin/server/SerializableSupplier.java +++ b/server/src/main/java/com/vaadin/server/SerializableSupplier.java @@ -16,7 +16,6 @@ package com.vaadin.server; import java.io.Serializable; -import java.util.function.Function; import java.util.function.Supplier; /** @@ -29,7 +28,6 @@ import java.util.function.Supplier; * the type of the input to the function */ @FunctionalInterface -public interface SerializableSupplier<T> - extends Supplier<T>, Serializable { +public interface SerializableSupplier<T> extends Supplier<T>, Serializable { // Only method inherited from Supplier } diff --git a/server/src/main/java/com/vaadin/server/Setter.java b/server/src/main/java/com/vaadin/server/Setter.java index 87eb9ecd44..056979b8f5 100644 --- a/server/src/main/java/com/vaadin/server/Setter.java +++ b/server/src/main/java/com/vaadin/server/Setter.java @@ -15,22 +15,22 @@ */ package com.vaadin.server; -import com.vaadin.data.Binder; -import com.vaadin.data.HasValue; - import java.io.Serializable; import java.util.function.BiConsumer; +import com.vaadin.data.Binder; +import com.vaadin.data.HasValue; + /** * The function to write the field value to the bean property - * + * * @see BiConsumer * @see Binder#bind(HasValue, SerializableFunction, Setter) * @param <BEAN> * the type of the target bean * @param <FIELDVALUE> * the field value type to be written to the bean - * + * * @since 8.0 * @author Vaadin Ltd * @@ -39,12 +39,13 @@ import java.util.function.BiConsumer; public interface Setter<BEAN, FIELDVALUE> extends BiConsumer<BEAN, FIELDVALUE>, Serializable { - /** Save value to the bean property + /** + * Save value to the bean property * * @param bean - * the target bean + * the target bean * @param fieldvalue - * the field value to be written to the bean + * the field value to be written to the bean */ @Override void accept(BEAN bean, FIELDVALUE fieldvalue); diff --git a/server/src/main/java/com/vaadin/server/UnsupportedBrowserHandler.java b/server/src/main/java/com/vaadin/server/UnsupportedBrowserHandler.java index fa1f48b790..7dd7e5ce59 100644 --- a/server/src/main/java/com/vaadin/server/UnsupportedBrowserHandler.java +++ b/server/src/main/java/com/vaadin/server/UnsupportedBrowserHandler.java @@ -63,31 +63,31 @@ public class UnsupportedBrowserHandler extends SynchronizedRequestHandler { VaadinResponse response) throws IOException { try (Writer page = response.getWriter()) { WebBrowser b = VaadinSession.getCurrent().getBrowser(); - + page.write( - "<html><body><h1>I'm sorry, but your browser is not supported</h1>" - + "<p>The version (" + b.getBrowserMajorVersion() + "." - + b.getBrowserMinorVersion() - + ") of the browser you are using " - + " is outdated and not supported.</p>" - + "<p>You should <b>consider upgrading</b> to a more up-to-date browser.</p> " - + "<p>The most popular browsers are <b>" - + " <a href=\"https://www.google.com/chrome\">Chrome</a>," - + " <a href=\"http://www.mozilla.com/firefox\">Firefox</a>," - + (b.isWindows() - ? " <a href=\"http://windows.microsoft.com/en-US/internet-explorer/downloads/ie\">Internet Explorer</a>," - : "") - + " <a href=\"http://www.opera.com/browser\">Opera</a>" - + " and <a href=\"http://www.apple.com/safari\">Safari</a>.</b><br/>" - + "Upgrading to the latest version of one of these <b>will make the web safer, faster and better looking.</b></p>" - + (b.isIE() - ? "<script type=\"text/javascript\" src=\"http://ajax.googleapis.com/ajax/libs/chrome-frame/1/CFInstall.min.js\"></script>" - + "<p>If you can not upgrade your browser, please consider trying <a onclick=\"CFInstall.check({mode:'overlay'});return false;\" href=\"http://www.google.com/chromeframe\">Chrome Frame</a>.</p>" - : "") // - + "<p><sub><a onclick=\"document.cookie='" - + FORCE_LOAD_COOKIE - + "';window.location.reload();return false;\" href=\"#\">Continue without updating</a> (not recommended)</sub></p>" - + "</body>\n" + "</html>"); + "<html><body><h1>I'm sorry, but your browser is not supported</h1>" + + "<p>The version (" + b.getBrowserMajorVersion() + + "." + b.getBrowserMinorVersion() + + ") of the browser you are using " + + " is outdated and not supported.</p>" + + "<p>You should <b>consider upgrading</b> to a more up-to-date browser.</p> " + + "<p>The most popular browsers are <b>" + + " <a href=\"https://www.google.com/chrome\">Chrome</a>," + + " <a href=\"http://www.mozilla.com/firefox\">Firefox</a>," + + (b.isWindows() + ? " <a href=\"http://windows.microsoft.com/en-US/internet-explorer/downloads/ie\">Internet Explorer</a>," + : "") + + " <a href=\"http://www.opera.com/browser\">Opera</a>" + + " and <a href=\"http://www.apple.com/safari\">Safari</a>.</b><br/>" + + "Upgrading to the latest version of one of these <b>will make the web safer, faster and better looking.</b></p>" + + (b.isIE() + ? "<script type=\"text/javascript\" src=\"http://ajax.googleapis.com/ajax/libs/chrome-frame/1/CFInstall.min.js\"></script>" + + "<p>If you can not upgrade your browser, please consider trying <a onclick=\"CFInstall.check({mode:'overlay'});return false;\" href=\"http://www.google.com/chromeframe\">Chrome Frame</a>.</p>" + : "") // + + "<p><sub><a onclick=\"document.cookie='" + + FORCE_LOAD_COOKIE + + "';window.location.reload();return false;\" href=\"#\">Continue without updating</a> (not recommended)</sub></p>" + + "</body>\n" + "</html>"); } } } diff --git a/server/src/main/java/com/vaadin/server/VaadinPortlet.java b/server/src/main/java/com/vaadin/server/VaadinPortlet.java index 16489da95d..c3daf2c617 100644 --- a/server/src/main/java/com/vaadin/server/VaadinPortlet.java +++ b/server/src/main/java/com/vaadin/server/VaadinPortlet.java @@ -47,6 +47,7 @@ import com.liferay.portal.kernel.util.PortalClassLoaderUtil; import com.liferay.portal.kernel.util.PropsUtil; import com.vaadin.server.communication.PortletDummyRequestHandler; import com.vaadin.server.communication.PortletUIInitHandler; +import com.vaadin.ui.UI; import com.vaadin.util.CurrentInstance; /** @@ -359,8 +360,7 @@ public class VaadinPortlet extends GenericPortlet Class<?> portletRequestClass = Class.forName( "com.bea.portlet.container.PortletRequestImpl"); servletRequestMethod = portletRequestClass - .getDeclaredMethod("getInternalRequest" - ); + .getDeclaredMethod("getInternalRequest"); servletRequestMethod.setAccessible(true); } diff --git a/server/src/main/java/com/vaadin/server/VaadinSession.java b/server/src/main/java/com/vaadin/server/VaadinSession.java index 9b87c081bc..5979933285 100644 --- a/server/src/main/java/com/vaadin/server/VaadinSession.java +++ b/server/src/main/java/com/vaadin/server/VaadinSession.java @@ -675,10 +675,10 @@ public class VaadinSession implements HttpSessionBindingListener, Serializable { } /** - * Gets the currently used session. The current session is - * automatically defined when processing requests related to the session - * (see {@link ThreadLocal}) and in {@link VaadinSession#access(Command)} - * and {@link UI#access(Command)}. In other cases, (e.g. from background + * Gets the currently used session. The current session is automatically + * defined when processing requests related to the session (see + * {@link ThreadLocal}) and in {@link VaadinSession#access(Command)} and + * {@link UI#access(Command)}. In other cases, (e.g. from background * threads, the current session is not automatically defined. * <p> * The session is stored using a weak reference to avoid leaking memory in diff --git a/server/src/main/java/com/vaadin/server/communication/ClientRpcWriter.java b/server/src/main/java/com/vaadin/server/communication/ClientRpcWriter.java index 17043deb7b..b6f333398c 100644 --- a/server/src/main/java/com/vaadin/server/communication/ClientRpcWriter.java +++ b/server/src/main/java/com/vaadin/server/communication/ClientRpcWriter.java @@ -124,17 +124,14 @@ public class ClientRpcWriter implements Serializable { List<ClientMethodInvocation> oldPendingRpc = pendingInvocations; int totalCalls = pendingInvocations.size() + paintablePendingRpc.size(); - pendingInvocations = new ArrayList<>( - totalCalls); + pendingInvocations = new ArrayList<>(totalCalls); // merge two ordered comparable lists for (int destIndex = 0, oldIndex = 0, paintableIndex = 0; destIndex < totalCalls; destIndex++) { if (paintableIndex >= paintablePendingRpc.size() - || (oldIndex < oldPendingRpc.size() - && oldPendingRpc - .get(oldIndex).compareTo( - paintablePendingRpc.get( - paintableIndex)) <= 0)) { + || (oldIndex < oldPendingRpc.size() && oldPendingRpc + .get(oldIndex).compareTo(paintablePendingRpc + .get(paintableIndex)) <= 0)) { pendingInvocations.add(oldPendingRpc.get(oldIndex++)); } else { pendingInvocations diff --git a/server/src/main/java/com/vaadin/server/communication/FileUploadHandler.java b/server/src/main/java/com/vaadin/server/communication/FileUploadHandler.java index 2a5af77b84..9a219c5d93 100644 --- a/server/src/main/java/com/vaadin/server/communication/FileUploadHandler.java +++ b/server/src/main/java/com/vaadin/server/communication/FileUploadHandler.java @@ -678,7 +678,7 @@ public class FileUploadHandler implements RequestHandler { response.setContentType("text/html"); try (OutputStream out = response.getOutputStream()) { final PrintWriter outWriter = new PrintWriter( - new BufferedWriter(new OutputStreamWriter(out, "UTF-8"))); + new BufferedWriter(new OutputStreamWriter(out, "UTF-8"))); outWriter.print("<html><body>download handled</body></html>"); outWriter.flush(); } @@ -687,8 +687,8 @@ public class FileUploadHandler implements RequestHandler { private void cleanStreamVariable(VaadinSession session, final UI ui, final ClientConnector owner, final String variableName) { session.accessSynchronously(() -> { - ui.getConnectorTracker().cleanStreamVariable( - owner.getConnectorId(), variableName); + ui.getConnectorTracker().cleanStreamVariable(owner.getConnectorId(), + variableName); }); } } diff --git a/server/src/main/java/com/vaadin/server/communication/LegacyUidlWriter.java b/server/src/main/java/com/vaadin/server/communication/LegacyUidlWriter.java index 52c32ff892..0a07ac503e 100644 --- a/server/src/main/java/com/vaadin/server/communication/LegacyUidlWriter.java +++ b/server/src/main/java/com/vaadin/server/communication/LegacyUidlWriter.java @@ -22,7 +22,6 @@ import java.io.Writer; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; -import java.util.Comparator; import java.util.List; import java.util.logging.Logger; diff --git a/server/src/main/java/com/vaadin/server/communication/PortletBootstrapHandler.java b/server/src/main/java/com/vaadin/server/communication/PortletBootstrapHandler.java index a75e6a810b..490fbb81f0 100644 --- a/server/src/main/java/com/vaadin/server/communication/PortletBootstrapHandler.java +++ b/server/src/main/java/com/vaadin/server/communication/PortletBootstrapHandler.java @@ -78,7 +78,8 @@ public class PortletBootstrapHandler extends BootstrapHandler { && !portalTheme.equals(context.getThemeName())) { String portalThemeUri = getThemeUri(context, portalTheme); // XSS safe - originates from portal properties - builder.append("vaadin.loadTheme('").append(portalThemeUri).append("');"); + builder.append("vaadin.loadTheme('").append(portalThemeUri) + .append("');"); } super.appendMainScriptTagContents(context, builder); diff --git a/server/src/main/java/com/vaadin/server/communication/PortletDummyRequestHandler.java b/server/src/main/java/com/vaadin/server/communication/PortletDummyRequestHandler.java index 7540fcb190..a3e3fac898 100644 --- a/server/src/main/java/com/vaadin/server/communication/PortletDummyRequestHandler.java +++ b/server/src/main/java/com/vaadin/server/communication/PortletDummyRequestHandler.java @@ -61,7 +61,7 @@ public class PortletDummyRequestHandler implements RequestHandler { final OutputStream out = ((ResourceResponse) response) .getPortletOutputStream(); try (PrintWriter outWriter = new PrintWriter( - new BufferedWriter(new OutputStreamWriter(out, "UTF-8")))) { + new BufferedWriter(new OutputStreamWriter(out, "UTF-8")))) { outWriter.print("<html><body>dummy page</body></html>"); } 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 75a5c9d94f..5a81b8020c 100644 --- a/server/src/main/java/com/vaadin/server/communication/PushHandler.java +++ b/server/src/main/java/com/vaadin/server/communication/PushHandler.java @@ -71,13 +71,14 @@ public class PushHandler { * open by calling resource.suspend(). If there is a pending push, send it * now. */ - private final PushEventCallback establishCallback = (AtmosphereResource resource, UI ui) -> { + private final PushEventCallback establishCallback = ( + AtmosphereResource resource, UI ui) -> { getLogger().log(Level.FINER, - "New push connection for resource {0} with transport {1}", - new Object[] { resource.uuid(), resource.transport() }); - + "New push connection for resource {0} with transport {1}", + new Object[] { resource.uuid(), resource.transport() }); + resource.getResponse().setContentType("text/plain; charset=UTF-8"); - + VaadinSession session = ui.getSession(); if (resource.transport() == TRANSPORT.STREAMING) { // Must ensure that the streaming response contains @@ -87,21 +88,21 @@ public class PushHandler { // connection) resource.getResponse().addHeader("Connection", "close"); } - + String requestToken = resource.getRequest() - .getParameter(ApplicationConstants.CSRF_TOKEN_PARAMETER); + .getParameter(ApplicationConstants.CSRF_TOKEN_PARAMETER); if (!VaadinService.isCsrfTokenValid(session, requestToken)) { getLogger().log(Level.WARNING, - "Invalid CSRF token in new connection received from {0}", - resource.getRequest().getRemoteHost()); + "Invalid CSRF token in new connection received from {0}", + resource.getRequest().getRemoteHost()); // Refresh on client side, create connection just for // sending a message sendRefreshAndDisconnect(resource); return; } - + suspend(resource); - + AtmospherePushConnection connection = getConnectionForUI(ui); assert (connection != null); connection.connect(resource); @@ -114,43 +115,43 @@ public class PushHandler { * the request and send changed UI state via the push channel (we do not * respond to the request directly.) */ - private final PushEventCallback receiveCallback = (AtmosphereResource resource, UI ui) -> { + private final PushEventCallback receiveCallback = ( + AtmosphereResource resource, UI ui) -> { getLogger().log(Level.FINER, "Received message from resource {0}", - resource.uuid()); - + resource.uuid()); + AtmosphereRequest req = resource.getRequest(); - + AtmospherePushConnection connection = getConnectionForUI(ui); - + assert connection != null : "Got push from the client " - + "even though the connection does not seem to be " - + "valid. This might happen if a HttpSession is " - + "serialized and deserialized while the push " - + "connection is kept open or if the UI has a " - + "connection of unexpected type."; - + + "even though the connection does not seem to be " + + "valid. This might happen if a HttpSession is " + + "serialized and deserialized while the push " + + "connection is kept open or if the UI has a " + + "connection of unexpected type."; + Reader reader = connection.receiveMessage(req.getReader()); if (reader == null) { // The whole message was not yet received return; } - + // Should be set up by caller VaadinRequest vaadinRequest = VaadinService.getCurrentRequest(); assert vaadinRequest != null; - + try { new ServerRpcHandler().handleRpc(ui, reader, vaadinRequest); connection.push(false); } catch (JsonException e) { - getLogger().log(Level.SEVERE, "Error writing JSON to response", - e); + getLogger().log(Level.SEVERE, "Error writing JSON to response", e); // Refresh on client side sendRefreshAndDisconnect(resource); } catch (InvalidUIDLSecurityKeyException e) { getLogger().log(Level.WARNING, - "Invalid security key received from {0}", - resource.getRequest().getRemoteHost()); + "Invalid security key received from {0}", + resource.getRequest().getRemoteHost()); // Refresh on client side sendRefreshAndDisconnect(resource); } diff --git a/server/src/main/java/com/vaadin/server/communication/PushRequestHandler.java b/server/src/main/java/com/vaadin/server/communication/PushRequestHandler.java index 140e41b992..ce3b399973 100644 --- a/server/src/main/java/com/vaadin/server/communication/PushRequestHandler.java +++ b/server/src/main/java/com/vaadin/server/communication/PushRequestHandler.java @@ -37,7 +37,6 @@ import org.atmosphere.util.VoidAnnotationProcessor; import com.vaadin.server.RequestHandler; import com.vaadin.server.ServiceDestroyEvent; -import com.vaadin.server.ServiceDestroyListener; import com.vaadin.server.ServiceException; import com.vaadin.server.ServletPortletHelper; import com.vaadin.server.SessionExpiredHandler; diff --git a/server/src/main/java/com/vaadin/server/communication/SessionRequestHandler.java b/server/src/main/java/com/vaadin/server/communication/SessionRequestHandler.java index 85b1fda1bf..3700e67c36 100644 --- a/server/src/main/java/com/vaadin/server/communication/SessionRequestHandler.java +++ b/server/src/main/java/com/vaadin/server/communication/SessionRequestHandler.java @@ -54,8 +54,7 @@ public class SessionRequestHandler implements RequestHandler { session.lock(); ArrayList<RequestHandler> requestHandlers; try { - requestHandlers = new ArrayList<>( - session.getRequestHandlers()); + requestHandlers = new ArrayList<>(session.getRequestHandlers()); } finally { session.unlock(); } diff --git a/server/src/main/java/com/vaadin/server/widgetsetutils/WidgetSetBuilder.java b/server/src/main/java/com/vaadin/server/widgetsetutils/WidgetSetBuilder.java index 689ac21cd7..a31b64a883 100644 --- a/server/src/main/java/com/vaadin/server/widgetsetutils/WidgetSetBuilder.java +++ b/server/src/main/java/com/vaadin/server/widgetsetutils/WidgetSetBuilder.java @@ -85,24 +85,24 @@ public class WidgetSetBuilder { } widgetsetFile.createNewFile(); try (PrintStream printStream = new PrintStream( - new FileOutputStream(widgetsetFile))) { + new FileOutputStream(widgetsetFile))) { printStream.print("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" - + "<!DOCTYPE module PUBLIC \"-//Google Inc.//DTD Google Web Toolkit 2.5.1//EN\" \"http://google-web-toolkit.googlecode.com/svn/tags/2.5.1/distro-source/core/src/gwt-module.dtd\">\n"); + + "<!DOCTYPE module PUBLIC \"-//Google Inc.//DTD Google Web Toolkit 2.5.1//EN\" \"http://google-web-toolkit.googlecode.com/svn/tags/2.5.1/distro-source/core/src/gwt-module.dtd\">\n"); printStream.print("<module>\n"); printStream.print(" <!--\n" - + " Uncomment the following to compile the widgetset for one browser only.\n\n" - + " Multiple browsers can be specified as a comma separated list. The\n" - + " supported user agents at the moment of writing were:\n" - + " ie8,ie9,gecko1_8,safari,opera\n\n" - + " The value gecko1_8 is used for Firefox and safari is used for webkit\n" - + " based browsers including Google Chrome.\n" - + " -->\n" - + " <!-- <set-property name=\"user.agent\" value=\"safari\"/> -->\n\n" - + " <!--\n" - + " To enable SuperDevMode, uncomment this line.\n\n" - + " See https://vaadin.com/wiki/-/wiki/Main/Using%20SuperDevMode for more\n" - + " information and instructions.\n" + " -->\n" - + " <!-- <set-configuration-property name=\"devModeRedirectEnabled\" value=\"true\" /> -->\n\n"); + + " Uncomment the following to compile the widgetset for one browser only.\n\n" + + " Multiple browsers can be specified as a comma separated list. The\n" + + " supported user agents at the moment of writing were:\n" + + " ie8,ie9,gecko1_8,safari,opera\n\n" + + " The value gecko1_8 is used for Firefox and safari is used for webkit\n" + + " based browsers including Google Chrome.\n" + + " -->\n" + + " <!-- <set-property name=\"user.agent\" value=\"safari\"/> -->\n\n" + + " <!--\n" + + " To enable SuperDevMode, uncomment this line.\n\n" + + " See https://vaadin.com/wiki/-/wiki/Main/Using%20SuperDevMode for more\n" + + " information and instructions.\n" + " -->\n" + + " <!-- <set-configuration-property name=\"devModeRedirectEnabled\" value=\"true\" /> -->\n\n"); printStream.print("\n</module>\n"); } changed = true; @@ -156,7 +156,7 @@ public class WidgetSetBuilder { private static void commitChanges(File widgetsetFile, String content) throws IOException { try (BufferedWriter bufferedWriter = new BufferedWriter( - new OutputStreamWriter(new FileOutputStream(widgetsetFile)))) { + new OutputStreamWriter(new FileOutputStream(widgetsetFile)))) { bufferedWriter.write(content); } } diff --git a/server/src/main/java/com/vaadin/ui/AbstractColorPicker.java b/server/src/main/java/com/vaadin/ui/AbstractColorPicker.java index 1630a18e65..608cdd9cfa 100644 --- a/server/src/main/java/com/vaadin/ui/AbstractColorPicker.java +++ b/server/src/main/java/com/vaadin/ui/AbstractColorPicker.java @@ -22,9 +22,9 @@ import java.util.Objects; import org.jsoup.nodes.Attributes; import org.jsoup.nodes.Element; +import com.vaadin.shared.ui.colorpicker.AbstractColorPickerState; import com.vaadin.shared.ui.colorpicker.Color; import com.vaadin.shared.ui.colorpicker.ColorPickerServerRpc; -import com.vaadin.shared.ui.colorpicker.AbstractColorPickerState; import com.vaadin.ui.components.colorpicker.ColorPickerPopup; import com.vaadin.ui.declarative.DesignAttributeHandler; import com.vaadin.ui.declarative.DesignContext; diff --git a/server/src/main/java/com/vaadin/ui/AbstractListing.java b/server/src/main/java/com/vaadin/ui/AbstractListing.java index 6800703afd..97fa1f3516 100644 --- a/server/src/main/java/com/vaadin/ui/AbstractListing.java +++ b/server/src/main/java/com/vaadin/ui/AbstractListing.java @@ -280,7 +280,7 @@ public abstract class AbstractListing<T> extends AbstractComponent * This method is separated from {@link writeDesign(Element, DesignContext)} * to be overridable in subclasses that need to replace this, but still must * be able to call {@code super.writeDesign(...)}. - * + * * @see #doReadDesign(Element, DesignContext) * * @param design @@ -360,7 +360,7 @@ public abstract class AbstractListing<T> extends AbstractComponent * This method is separated from {@link readDesign(Element, DesignContext)} * to be overridable in subclasses that need to replace this, but still must * be able to call {@code super.readDesign(...)}. - * + * * @see #doWriteDesign(Element, DesignContext) * * @param design diff --git a/server/src/main/java/com/vaadin/ui/AbstractTextField.java b/server/src/main/java/com/vaadin/ui/AbstractTextField.java index 07044bf472..c716c66978 100644 --- a/server/src/main/java/com/vaadin/ui/AbstractTextField.java +++ b/server/src/main/java/com/vaadin/ui/AbstractTextField.java @@ -272,6 +272,7 @@ public abstract class AbstractTextField extends AbstractField<String> /** * Clears the value of this field. */ + @Override public void clear() { setValue(""); } diff --git a/server/src/main/java/com/vaadin/ui/ComboBox.java b/server/src/main/java/com/vaadin/ui/ComboBox.java index 2df887016d..a15dd6d96c 100644 --- a/server/src/main/java/com/vaadin/ui/ComboBox.java +++ b/server/src/main/java/com/vaadin/ui/ComboBox.java @@ -23,11 +23,6 @@ import java.util.Map; import java.util.Objects; import java.util.Set; -import com.vaadin.server.KeyMapper; -import com.vaadin.server.Resource; -import com.vaadin.server.ResourceReference; -import com.vaadin.server.SerializableBiPredicate; -import com.vaadin.server.SerializableConsumer; import org.jsoup.nodes.Element; import com.vaadin.data.HasValue; @@ -41,6 +36,11 @@ import com.vaadin.event.FieldEvents.BlurListener; import com.vaadin.event.FieldEvents.FocusAndBlurServerRpcDecorator; import com.vaadin.event.FieldEvents.FocusEvent; import com.vaadin.event.FieldEvents.FocusListener; +import com.vaadin.server.KeyMapper; +import com.vaadin.server.Resource; +import com.vaadin.server.ResourceReference; +import com.vaadin.server.SerializableBiPredicate; +import com.vaadin.server.SerializableConsumer; import com.vaadin.shared.Registration; import com.vaadin.shared.data.DataCommunicatorConstants; import com.vaadin.shared.ui.combobox.ComboBoxConstants; @@ -238,13 +238,12 @@ public class ComboBox<T> extends AbstractSingleSelect<T> * conversion is performed before the comparison. * * @param captionFilter - * filter to check if an item is shown when user typed some text into the ComboBox + * filter to check if an item is shown when user typed some text + * into the ComboBox * @param items * the data items to display */ - public void setItems( - CaptionFilter captionFilter, - Collection<T> items) { + public void setItems(CaptionFilter captionFilter, Collection<T> items) { DataProvider<T, String> provider = DataProvider.create(items) .convertFilter(filterText -> item -> captionFilter.test( getItemCaptionGenerator().apply(item), filterText)); @@ -259,12 +258,12 @@ public class ComboBox<T> extends AbstractSingleSelect<T> * conversion is performed before the comparison. * * @param captionFilter - * filter to check if an item is shown when user typed some text into the ComboBox + * filter to check if an item is shown when user typed some text + * into the ComboBox * @param items * the data items to display */ - public void setItems( - CaptionFilter captionFilter, + public void setItems(CaptionFilter captionFilter, @SuppressWarnings("unchecked") T... items) { DataProvider<T, String> provider = DataProvider.create(items) .convertFilter(filterText -> item -> captionFilter.test( @@ -555,8 +554,8 @@ public class ComboBox<T> extends AbstractSingleSelect<T> public Registration addValueChangeListener( HasValue.ValueChangeListener<T> listener) { return addSelectionListener(event -> { - listener.valueChange(new ValueChangeEvent<>(event.getComponent(), this, - event.isUserOriginated())); + listener.valueChange(new ValueChangeEvent<>(event.getComponent(), + this, event.isUserOriginated())); }); } @@ -676,20 +675,23 @@ public class ComboBox<T> extends AbstractSingleSelect<T> } /** - * Predicate to check {@link ComboBox} item captions against user typed strings. + * Predicate to check {@link ComboBox} item captions against user typed + * strings. * * @see #setItems(CaptionFilter, Collection) * @see #setItems(CaptionFilter, Object[]) */ @FunctionalInterface - public interface CaptionFilter extends SerializableBiPredicate<String, String> { + public interface CaptionFilter + extends SerializableBiPredicate<String, String> { /** * Check item caption against entered text * * @param itemCaption * @param filterText - * @return {@code true} if item passes the filter and should be listed, {@code false} otherwise + * @return {@code true} if item passes the filter and should be listed, + * {@code false} otherwise */ @Override public boolean test(String itemCaption, String filterText); diff --git a/server/src/main/java/com/vaadin/ui/ConnectorTracker.java b/server/src/main/java/com/vaadin/ui/ConnectorTracker.java index ca901f6a6f..f66ba4c25d 100644 --- a/server/src/main/java/com/vaadin/ui/ConnectorTracker.java +++ b/server/src/main/java/com/vaadin/ui/ConnectorTracker.java @@ -725,8 +725,7 @@ public class ConnectorTracker implements Serializable { @SuppressWarnings("unchecked") HashMap<ClientConnector, String> stringDiffStates = (HashMap<ClientConnector, String>) in .readObject(); - diffStates = new HashMap<>( - stringDiffStates.size() * 2); + diffStates = new HashMap<>(stringDiffStates.size() * 2); for (ClientConnector key : stringDiffStates.keySet()) { try { diffStates.put(key, Json.parse(stringDiffStates.get(key))); diff --git a/server/src/main/java/com/vaadin/ui/CustomField.java b/server/src/main/java/com/vaadin/ui/CustomField.java index 8738bad2dc..c813442ffd 100644 --- a/server/src/main/java/com/vaadin/ui/CustomField.java +++ b/server/src/main/java/com/vaadin/ui/CustomField.java @@ -166,7 +166,7 @@ public abstract class CustomField<T> extends AbstractField<T> * <p> * By default, {@link Focusable} events are handled by the super class and * ultimately ignored. - * + * * @param focusDelegate * the focusable component to which focus events are redirected */ diff --git a/server/src/main/java/com/vaadin/ui/Grid.java b/server/src/main/java/com/vaadin/ui/Grid.java index 73d5c986f8..8b07501f07 100644 --- a/server/src/main/java/com/vaadin/ui/Grid.java +++ b/server/src/main/java/com/vaadin/ui/Grid.java @@ -77,7 +77,6 @@ import com.vaadin.shared.ui.grid.GridState; import com.vaadin.shared.ui.grid.GridStaticCellType; import com.vaadin.shared.ui.grid.HeightMode; import com.vaadin.shared.ui.grid.SectionState; -import com.vaadin.ui.Grid.SelectionMode; import com.vaadin.ui.components.grid.ColumnReorderListener; import com.vaadin.ui.components.grid.ColumnResizeListener; import com.vaadin.ui.components.grid.ColumnVisibilityChangeListener; diff --git a/server/src/main/java/com/vaadin/ui/HasValueChangeMode.java b/server/src/main/java/com/vaadin/ui/HasValueChangeMode.java index d877d4ec69..a59be6d058 100644 --- a/server/src/main/java/com/vaadin/ui/HasValueChangeMode.java +++ b/server/src/main/java/com/vaadin/ui/HasValueChangeMode.java @@ -57,12 +57,12 @@ public interface HasValueChangeMode extends Component { /** * Returns the currently set timeout, in milliseconds, for how often - * {@link ValueChangeEvent}s are triggered if the current {@link ValueChangeMode} - * is set to either {@link ValueChangeMode#LAZY} or + * {@link ValueChangeEvent}s are triggered if the current + * {@link ValueChangeMode} is set to either {@link ValueChangeMode#LAZY} or * {@link ValueChangeMode#TIMEOUT}. * - * @return the timeout in milliseconds of how often {@link ValueChangeEvent}s are - * triggered. + * @return the timeout in milliseconds of how often + * {@link ValueChangeEvent}s are triggered. */ public int getValueChangeTimeout(); diff --git a/server/src/main/java/com/vaadin/ui/MenuBar.java b/server/src/main/java/com/vaadin/ui/MenuBar.java index b769ab42bf..4cb8870c2f 100644 --- a/server/src/main/java/com/vaadin/ui/MenuBar.java +++ b/server/src/main/java/com/vaadin/ui/MenuBar.java @@ -16,8 +16,10 @@ package com.vaadin.ui; import java.io.Serializable; +import java.util.ArrayDeque; import java.util.ArrayList; import java.util.Collection; +import java.util.Deque; import java.util.Iterator; import java.util.List; import java.util.Map; @@ -35,8 +37,6 @@ import com.vaadin.shared.ui.menubar.MenuBarState; import com.vaadin.ui.Component.Focusable; import com.vaadin.ui.declarative.DesignAttributeHandler; import com.vaadin.ui.declarative.DesignContext; -import java.util.ArrayDeque; -import java.util.Deque; /** * <p> diff --git a/server/src/main/java/com/vaadin/ui/MultiSelect.java b/server/src/main/java/com/vaadin/ui/MultiSelect.java index a3677d6d4e..6519921c88 100644 --- a/server/src/main/java/com/vaadin/ui/MultiSelect.java +++ b/server/src/main/java/com/vaadin/ui/MultiSelect.java @@ -29,12 +29,12 @@ import com.vaadin.shared.Registration; /** * Multi selection component which allows to select and deselect multiple items. - * + * * @author Vaadin Ltd - * + * * @param <T> * the type of the items to select - * + * * @since 8.0 * */ diff --git a/server/src/main/java/com/vaadin/ui/RichTextArea.java b/server/src/main/java/com/vaadin/ui/RichTextArea.java index 44ecb7aae0..b54840fe32 100644 --- a/server/src/main/java/com/vaadin/ui/RichTextArea.java +++ b/server/src/main/java/com/vaadin/ui/RichTextArea.java @@ -169,6 +169,7 @@ public class RichTextArea extends AbstractField<String> /** * Clears the value of this field. */ + @Override public void clear() { setValue(""); } diff --git a/server/src/main/java/com/vaadin/ui/SingleSelect.java b/server/src/main/java/com/vaadin/ui/SingleSelect.java index 6c013529e1..f2ae85e95e 100644 --- a/server/src/main/java/com/vaadin/ui/SingleSelect.java +++ b/server/src/main/java/com/vaadin/ui/SingleSelect.java @@ -19,9 +19,9 @@ import com.vaadin.data.HasValue; /** * Single selection component whose selection is treated as a value. - * + * * @author Vaadin Ltd - * + * * @param <V> * the selection value type * diff --git a/server/src/main/java/com/vaadin/ui/UI.java b/server/src/main/java/com/vaadin/ui/UI.java index 9f0cc6d0dc..437a188361 100644 --- a/server/src/main/java/com/vaadin/ui/UI.java +++ b/server/src/main/java/com/vaadin/ui/UI.java @@ -413,7 +413,7 @@ public abstract class UI extends AbstractSingleComponentContainer /** * Fire a window order event. - * + * * @param windows * The windows with their orders whose order has been updated. */ @@ -1788,13 +1788,13 @@ public abstract class UI extends AbstractSingleComponentContainer * <p> * The other way to listen window position for specific window is * {@link Window#addWindowOrderChangeListener(WindowOrderChangeListener)} - * + * * @see Window#addWindowOrderChangeListener(WindowOrderChangeListener) - * + * * @param listener * the WindowModeChangeListener to add. * @since 8.0.0 - * + * * @return a registration object for removing the listener */ public Registration addWindowOrderUpdateListener( @@ -1810,12 +1810,12 @@ public abstract class UI extends AbstractSingleComponentContainer * <p> * The other way to listen window position for specific window is * {@link Window#addWindowOrderChangeListener(WindowOrderChangeListener)} - * + * * @see Window.WindowOrderChangeEvent - * + * * @author Vaadin Ltd * @since 8.0.0 - * + * */ public static class WindowOrderUpdateEvent extends Component.Event { @@ -1830,7 +1830,7 @@ public abstract class UI extends AbstractSingleComponentContainer /** * Gets the windows in the order they appear in the UI: top most window * is first, bottom one last. - * + * * @return the windows collection */ public Collection<Window> getWindows() { @@ -1840,9 +1840,9 @@ public abstract class UI extends AbstractSingleComponentContainer /** * An interface used for listening to Windows order update events. - * + * * @since 8.0.0 - * + * * @see Window.WindowOrderChangeEvent */ @FunctionalInterface @@ -1858,7 +1858,7 @@ public abstract class UI extends AbstractSingleComponentContainer * {@link Window}s whose order positions are updated. Use * {@link Window#getOrderPosition()} to get window position for specific * window. - * + * * @param event */ public void windowOrderUpdated(WindowOrderUpdateEvent event); diff --git a/server/src/main/java/com/vaadin/ui/Window.java b/server/src/main/java/com/vaadin/ui/Window.java index f41ef41244..b0c2b7e19e 100644 --- a/server/src/main/java/com/vaadin/ui/Window.java +++ b/server/src/main/java/com/vaadin/ui/Window.java @@ -335,11 +335,11 @@ public class Window extends Panel * Window with position 0 is on the bottom, and window with greatest * position is at the top. If window has no position (it's not yet attached * or hidden) then position is {@code -1}. - * + * * @see UI#addWindowOrderUpdateListener(com.vaadin.ui.UI.WindowOrderUpdateListener) - * + * * @since 8.0.0 - * + * * @return window order position. */ public int getOrderPosition() { @@ -396,11 +396,11 @@ public class Window extends Panel /** * Event which is fired when the window order position is changed. - * + * * @see UI.WindowOrderUpdateEvent - * + * * @author Vaadin Ltd - * + * */ public static class WindowOrderChangeEvent extends Component.Event { @@ -413,7 +413,7 @@ public class Window extends Panel /** * Gets the Window. - * + * * @return the window */ public Window getWindow() { @@ -422,7 +422,7 @@ public class Window extends Panel /** * Gets the new window order position. - * + * * @return the new order position */ public int getOrder() { @@ -432,7 +432,7 @@ public class Window extends Panel /** * An interface used for listening to Window order change events. - * + * * @see UI.WindowOrderUpdateListener */ @FunctionalInterface @@ -448,7 +448,7 @@ public class Window extends Panel * {@link Window} whose order position is changed. Use * {@link WindowOrderChangeEvent#getOrder()} to get a new order * position. - * + * * @param event */ public void windowOrderChanged(WindowOrderChangeEvent event); @@ -463,9 +463,9 @@ public class Window extends Panel * <p> * The other way to listen positions of all windows in UI is * {@link UI#addWindowOrderUpdateListener(com.vaadin.ui.UI.WindowOrderUpdateListener)} - * + * * @see UI#addWindowOrderUpdateListener(com.vaadin.ui.UI.WindowOrderUpdateListener) - * + * * @param listener * the WindowModeChangeListener to add. */ @@ -478,8 +478,8 @@ public class Window extends Panel } protected void fireWindowOrderChange(Integer order) { - if (order == null || this.orderPosition != order) { - this.orderPosition = (order == null) ? -1 : order; + if (order == null || orderPosition != order) { + orderPosition = (order == null) ? -1 : order; fireEvent(new Window.WindowOrderChangeEvent(this, getOrderPosition())); } 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 9ee87dc0c8..7cb13cb120 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 @@ -187,9 +187,9 @@ public class ColorPickerSelect extends CustomField<Color> { * <p> * Value can be {@code null} if component is not yet initialized via * {@link #initContent()} - * + * * @see ColorPickerSelect#initContent() - * + * * @return the selected color, may be {@code null} */ @Override diff --git a/server/src/main/java/com/vaadin/ui/components/grid/EditorComponentGenerator.java b/server/src/main/java/com/vaadin/ui/components/grid/EditorComponentGenerator.java index c21142ffee..b33c59a891 100644 --- a/server/src/main/java/com/vaadin/ui/components/grid/EditorComponentGenerator.java +++ b/server/src/main/java/com/vaadin/ui/components/grid/EditorComponentGenerator.java @@ -22,7 +22,7 @@ import com.vaadin.ui.Component; * A callback interface for generating an editor component corresponding to an * editable column of a grid. The generated component will be used in the grid * editor to edit the value of the column for the selected grid row. - * + * * @author Vaadin Ltd. * @since 8.0 * @@ -35,7 +35,7 @@ public interface EditorComponentGenerator<BEAN> /** * Gets a component for a given {@code bean}. - * + * * @param bean * the bean this component will be used to edit * @return the generated component diff --git a/server/src/main/java/com/vaadin/ui/components/grid/SortOrderProvider.java b/server/src/main/java/com/vaadin/ui/components/grid/SortOrderProvider.java index 2851b9d100..046719e978 100644 --- a/server/src/main/java/com/vaadin/ui/components/grid/SortOrderProvider.java +++ b/server/src/main/java/com/vaadin/ui/components/grid/SortOrderProvider.java @@ -31,8 +31,8 @@ import com.vaadin.ui.Grid.Column; * @author Vaadin Ltd */ @FunctionalInterface -public interface SortOrderProvider extends - SerializableFunction<SortDirection, Stream<SortOrder<String>>> { +public interface SortOrderProvider + extends SerializableFunction<SortDirection, Stream<SortOrder<String>>> { /** * Generates the sort orders when rows are sorted by a column. diff --git a/server/src/main/java/com/vaadin/ui/declarative/Design.java b/server/src/main/java/com/vaadin/ui/declarative/Design.java index 0644b27877..027fb3bc02 100644 --- a/server/src/main/java/com/vaadin/ui/declarative/Design.java +++ b/server/src/main/java/com/vaadin/ui/declarative/Design.java @@ -472,7 +472,8 @@ public class Design implements Serializable { } // create listener for component creations that binds the created // components to the componentRoot instance fields - ComponentCreationListener creationListener = (ComponentCreatedEvent event) -> { + ComponentCreationListener creationListener = ( + ComponentCreatedEvent event) -> { binder.bindField(event.getComponent(), event.getLocalId()); }; designContext.addComponentCreationListener(creationListener); diff --git a/server/src/main/java/com/vaadin/ui/declarative/FieldBinder.java b/server/src/main/java/com/vaadin/ui/declarative/FieldBinder.java index a4a4f0ffdf..f860e30e7c 100644 --- a/server/src/main/java/com/vaadin/ui/declarative/FieldBinder.java +++ b/server/src/main/java/com/vaadin/ui/declarative/FieldBinder.java @@ -19,6 +19,7 @@ import java.beans.IntrospectionException; import java.io.Serializable; import java.lang.reflect.Field; import java.util.ArrayList; +import java.util.Arrays; import java.util.Collection; import java.util.HashMap; import java.util.List; @@ -27,7 +28,6 @@ import java.util.Map; import java.util.logging.Logger; import com.vaadin.ui.Component; -import java.util.Arrays; /** * Binder utility that binds member fields of a design class instance to given @@ -250,8 +250,7 @@ public class FieldBinder implements Serializable { Class<?> searchClass) { ArrayList<java.lang.reflect.Field> memberFields = new ArrayList<>(); - memberFields.addAll(Arrays.asList(searchClass - .getDeclaredFields())); + memberFields.addAll(Arrays.asList(searchClass.getDeclaredFields())); return memberFields; } diff --git a/server/src/main/java/com/vaadin/ui/declarative/ShouldWriteDataDelegate.java b/server/src/main/java/com/vaadin/ui/declarative/ShouldWriteDataDelegate.java index 6b58b29e8a..83c409c58e 100644 --- a/server/src/main/java/com/vaadin/ui/declarative/ShouldWriteDataDelegate.java +++ b/server/src/main/java/com/vaadin/ui/declarative/ShouldWriteDataDelegate.java @@ -33,8 +33,8 @@ public interface ShouldWriteDataDelegate extends Serializable { /** * The default delegate implementation that assumes that all component data - * is provided by a data provider connected to a back end system and that the - * data should thus not be written. + * is provided by a data provider connected to a back end system and that + * the data should thus not be written. */ public static final ShouldWriteDataDelegate DEFAULT = ( Component component) -> false; diff --git a/server/src/main/java/com/vaadin/ui/renderers/AbstractJavaScriptRenderer.java b/server/src/main/java/com/vaadin/ui/renderers/AbstractJavaScriptRenderer.java index f372954e27..fd195efcb7 100644 --- a/server/src/main/java/com/vaadin/ui/renderers/AbstractJavaScriptRenderer.java +++ b/server/src/main/java/com/vaadin/ui/renderers/AbstractJavaScriptRenderer.java @@ -104,7 +104,7 @@ import elemental.json.JsonValue; * supported in the object passed to the <code>render</code> function - other * functions should not use the property. Readable and writable. * </ul> - * + * * @param <T> * the grid type this renderer can be attached to * @param <V> diff --git a/server/src/main/java/com/vaadin/util/CurrentInstance.java b/server/src/main/java/com/vaadin/util/CurrentInstance.java index 327c61d4b0..df23f6c8bc 100644 --- a/server/src/main/java/com/vaadin/util/CurrentInstance.java +++ b/server/src/main/java/com/vaadin/util/CurrentInstance.java @@ -53,7 +53,8 @@ import com.vaadin.ui.UI; */ public class CurrentInstance implements Serializable { private static final Object NULL_OBJECT = new Object(); - private static final CurrentInstance CURRENT_INSTANCE_NULL = new CurrentInstance(NULL_OBJECT); + private static final CurrentInstance CURRENT_INSTANCE_NULL = new CurrentInstance( + NULL_OBJECT); private final WeakReference<Object> instance; diff --git a/server/src/test/java/com/vaadin/benchmarks/PerformanceTester8759.java b/server/src/test/java/com/vaadin/benchmarks/PerformanceTester8759.java index af7e613bbf..6c4594eb34 100644 --- a/server/src/test/java/com/vaadin/benchmarks/PerformanceTester8759.java +++ b/server/src/test/java/com/vaadin/benchmarks/PerformanceTester8759.java @@ -5,7 +5,7 @@ import com.vaadin.ui.Label; /* * This simple test shows the performance difference between the StringTokenizer implementation and the String.split() implementation in AbstractComponent. * Your results will vary. - * The real world use case motivating it was a 10k Row table, which generated labels for 10 columns. + * The real world use case motivating it was a 10k Row table, which generated labels for 10 columns. * This is 1/10th of what this performance tester demonstrates. * * Please run with -server and -Xloggc:/tmp/gclog.vgc -verbose:gc -XX:+PrintCompilation diff --git a/server/src/test/java/com/vaadin/data/BeanBinderInstanceFieldTest.java b/server/src/test/java/com/vaadin/data/BeanBinderInstanceFieldTest.java index e0f6e2eaa5..9ed2e8edda 100644 --- a/server/src/test/java/com/vaadin/data/BeanBinderInstanceFieldTest.java +++ b/server/src/test/java/com/vaadin/data/BeanBinderInstanceFieldTest.java @@ -32,7 +32,7 @@ import com.vaadin.ui.TextField; /** * Unit tests for {@link BeanBinder#bindInstanceFields(Object)} method. - * + * * @author Vaadin Ltd * */ diff --git a/server/src/test/java/com/vaadin/data/BeanBinderTest.java b/server/src/test/java/com/vaadin/data/BeanBinderTest.java index d45cfe04fd..1b9f2f0ac7 100644 --- a/server/src/test/java/com/vaadin/data/BeanBinderTest.java +++ b/server/src/test/java/com/vaadin/data/BeanBinderTest.java @@ -198,7 +198,8 @@ public class BeanBinderTest private void assertInvalid(HasValue<?> field, String message) { BinderValidationStatus<?> status = binder.validate(); - List<BindingValidationStatus<?>> errors = status.getFieldValidationErrors(); + List<BindingValidationStatus<?>> errors = status + .getFieldValidationErrors(); assertEquals(1, errors.size()); assertSame(field, errors.get(0).getField()); assertEquals(message, errors.get(0).getMessage().get()); diff --git a/server/src/test/java/com/vaadin/data/BinderConverterValidatorTest.java b/server/src/test/java/com/vaadin/data/BinderConverterValidatorTest.java index bc46395d08..64bde4d772 100644 --- a/server/src/test/java/com/vaadin/data/BinderConverterValidatorTest.java +++ b/server/src/test/java/com/vaadin/data/BinderConverterValidatorTest.java @@ -97,12 +97,13 @@ public class BinderConverterValidatorTest binding.bind(Person::getFirstName, Person::setFirstName); BinderValidationStatus<Person> status = binder.validate(); - List<BindingValidationStatus<?>> errors = status.getFieldValidationErrors(); + List<BindingValidationStatus<?>> errors = status + .getFieldValidationErrors(); assertEquals(1, errors.size()); - BindingValidationStatus<?> validationStatus = errors.stream().findFirst() - .get(); + BindingValidationStatus<?> validationStatus = errors.stream() + .findFirst().get(); String msg = validationStatus.getMessage().get(); assertEquals(msg1, msg); diff --git a/server/src/test/java/com/vaadin/data/BinderMultiSelectTest.java b/server/src/test/java/com/vaadin/data/BinderMultiSelectTest.java index 820447172e..78a132b04d 100644 --- a/server/src/test/java/com/vaadin/data/BinderMultiSelectTest.java +++ b/server/src/test/java/com/vaadin/data/BinderMultiSelectTest.java @@ -65,8 +65,7 @@ public class BinderMultiSelectTest converterBinder.forField(select) .withConverter(new TestEnumSetToStringConverter()) - .bind(AtomicReference::get, - AtomicReference::set); + .bind(AtomicReference::get, AtomicReference::set); } @Test diff --git a/server/src/test/java/com/vaadin/data/BinderTestBase.java b/server/src/test/java/com/vaadin/data/BinderTestBase.java index 7a238ac7ce..8cad82d570 100644 --- a/server/src/test/java/com/vaadin/data/BinderTestBase.java +++ b/server/src/test/java/com/vaadin/data/BinderTestBase.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2016 Vaadin Ltd. - * + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the diff --git a/server/src/test/java/com/vaadin/data/HasValueTest.java b/server/src/test/java/com/vaadin/data/HasValueTest.java index f250d6a5b6..b40b7e64a1 100644 --- a/server/src/test/java/com/vaadin/data/HasValueTest.java +++ b/server/src/test/java/com/vaadin/data/HasValueTest.java @@ -18,8 +18,6 @@ package com.vaadin.data; import org.junit.Test; import org.mockito.Mockito; -import com.vaadin.data.HasValue; - /** * @author Vaadin Ltd * diff --git a/server/src/test/java/com/vaadin/data/ResultTest.java b/server/src/test/java/com/vaadin/data/ResultTest.java index 1dcda58a4d..8f594c1300 100644 --- a/server/src/test/java/com/vaadin/data/ResultTest.java +++ b/server/src/test/java/com/vaadin/data/ResultTest.java @@ -15,10 +15,11 @@ */ package com.vaadin.data; -import com.vaadin.server.SerializableFunction; import org.junit.Assert; import org.junit.Test; +import com.vaadin.server.SerializableFunction; + /** * @author Vaadin Ltd * @@ -70,7 +71,8 @@ public class ResultTest { Result<String> result = new SimpleResult<String>("foo", null) { @Override - public <S> Result<S> flatMap(SerializableFunction<String, Result<S>> mapper) { + public <S> Result<S> flatMap( + SerializableFunction<String, Result<S>> mapper) { return mapper.apply("foo"); } }; @@ -89,7 +91,8 @@ public class ResultTest { Result<String> result = new SimpleResult<String>("foo", null) { @Override - public <S> Result<S> flatMap(SerializableFunction<String, Result<S>> mapper) { + public <S> Result<S> flatMap( + SerializableFunction<String, Result<S>> mapper) { return new SimpleResult<>(null, "bar"); } }; diff --git a/server/src/test/java/com/vaadin/data/provider/AbstractDataProviderTest.java b/server/src/test/java/com/vaadin/data/provider/AbstractDataProviderTest.java index 58ce4c3f75..5fbaaaeb8a 100644 --- a/server/src/test/java/com/vaadin/data/provider/AbstractDataProviderTest.java +++ b/server/src/test/java/com/vaadin/data/provider/AbstractDataProviderTest.java @@ -21,9 +21,6 @@ import java.util.stream.Stream; import org.junit.Assert; import org.junit.Test; -import com.vaadin.data.provider.AbstractDataProvider; -import com.vaadin.data.provider.DataChangeEvent; -import com.vaadin.data.provider.Query; import com.vaadin.shared.Registration; /** diff --git a/server/src/test/java/com/vaadin/data/provider/BackendDataProviderTest.java b/server/src/test/java/com/vaadin/data/provider/BackendDataProviderTest.java index 6e9727af3f..585abc230a 100644 --- a/server/src/test/java/com/vaadin/data/provider/BackendDataProviderTest.java +++ b/server/src/test/java/com/vaadin/data/provider/BackendDataProviderTest.java @@ -7,8 +7,6 @@ import java.util.Map; import java.util.stream.Collectors; import java.util.stream.Stream; -import com.vaadin.data.provider.BackEndDataProvider; -import com.vaadin.data.provider.SortOrder; import com.vaadin.server.SerializablePredicate; import com.vaadin.shared.data.sort.SortDirection; diff --git a/server/src/test/java/com/vaadin/data/provider/DataCommunicatorTest.java b/server/src/test/java/com/vaadin/data/provider/DataCommunicatorTest.java index f185d0969e..f49dbf1f88 100644 --- a/server/src/test/java/com/vaadin/data/provider/DataCommunicatorTest.java +++ b/server/src/test/java/com/vaadin/data/provider/DataCommunicatorTest.java @@ -21,9 +21,6 @@ import org.junit.Assert; import org.junit.Test; import org.mockito.Mockito; -import com.vaadin.data.provider.DataCommunicator; -import com.vaadin.data.provider.DataProviderListener; -import com.vaadin.data.provider.ListDataProvider; import com.vaadin.server.MockVaadinSession; import com.vaadin.server.SerializablePredicate; import com.vaadin.server.VaadinRequest; diff --git a/server/src/test/java/com/vaadin/data/provider/DataProviderTestBase.java b/server/src/test/java/com/vaadin/data/provider/DataProviderTestBase.java index fa7ca2d840..da909af29a 100644 --- a/server/src/test/java/com/vaadin/data/provider/DataProviderTestBase.java +++ b/server/src/test/java/com/vaadin/data/provider/DataProviderTestBase.java @@ -12,12 +12,6 @@ import org.junit.Assert; import org.junit.Before; import org.junit.Test; -import com.vaadin.data.provider.DataChangeEvent; -import com.vaadin.data.provider.DataProvider; -import com.vaadin.data.provider.DataProviderListener; -import com.vaadin.data.provider.Query; -import com.vaadin.data.provider.Sort; -import com.vaadin.data.provider.SortOrder; import com.vaadin.server.SerializablePredicate; public abstract class DataProviderTestBase<D extends DataProvider<StrBean, SerializablePredicate<StrBean>>> { @@ -66,8 +60,7 @@ public abstract class DataProviderTestBase<D extends DataProvider<StrBean, Seria private Query<StrBean, SerializablePredicate<StrBean>> createQuery( List<SortOrder<String>> sortOrder, Comparator<StrBean> comp, SerializablePredicate<StrBean> filter) { - return new Query<>(0, - Integer.MAX_VALUE, sortOrder, comp, filter); + return new Query<>(0, Integer.MAX_VALUE, sortOrder, comp, filter); } private Query<StrBean, SerializablePredicate<StrBean>> createQuery( diff --git a/server/src/test/java/com/vaadin/data/provider/ListDataProviderTest.java b/server/src/test/java/com/vaadin/data/provider/ListDataProviderTest.java index 8cb9c2a4fe..148b5f98f8 100644 --- a/server/src/test/java/com/vaadin/data/provider/ListDataProviderTest.java +++ b/server/src/test/java/com/vaadin/data/provider/ListDataProviderTest.java @@ -6,10 +6,6 @@ import java.util.List; import org.junit.Assert; import org.junit.Test; -import com.vaadin.data.provider.DataProvider; -import com.vaadin.data.provider.ListDataProvider; -import com.vaadin.data.provider.Query; -import com.vaadin.data.provider.SortOrder; import com.vaadin.server.SerializablePredicate; public class ListDataProviderTest 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 7fb1c2ff76..758059c288 100644 --- a/server/src/test/java/com/vaadin/data/validator/StringLengthValidatorTest.java +++ b/server/src/test/java/com/vaadin/data/validator/StringLengthValidatorTest.java @@ -7,8 +7,8 @@ import org.junit.Test; public class StringLengthValidatorTest extends ValidatorTestBase { - private static final String LONG_STRING = Stream.generate(() -> "x").limit(1000) - .collect(Collectors.joining()); + private static final String LONG_STRING = Stream.generate(() -> "x") + .limit(1000).collect(Collectors.joining()); @Test public void testNullStringFails() { 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 23270cab5e..591debe9ba 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 @@ -99,7 +99,7 @@ public class BeanToValidate { } public void setAddresses(Address[] address) { - this.addresses = address; + addresses = address; } public Address getAddress() { diff --git a/server/src/test/java/com/vaadin/tests/design/ComponentFactoryTest.java b/server/src/test/java/com/vaadin/tests/design/ComponentFactoryTest.java index 1aacaf44cc..98224d90c1 100644 --- a/server/src/test/java/com/vaadin/tests/design/ComponentFactoryTest.java +++ b/server/src/test/java/com/vaadin/tests/design/ComponentFactoryTest.java @@ -24,7 +24,6 @@ import org.junit.Assert; import org.junit.Test; import com.vaadin.ui.AbstractComponent; -import com.vaadin.ui.Component; import com.vaadin.ui.Label; import com.vaadin.ui.declarative.Design; import com.vaadin.ui.declarative.Design.ComponentFactory; @@ -40,15 +39,16 @@ public class ComponentFactoryTest { // Set static component factory that delegate to a thread local factory static { - Design.setComponentFactory((String fullyQualifiedClassName, DesignContext context) -> { - ComponentFactory componentFactory = currentComponentFactory - .get(); - if (componentFactory == null) { - componentFactory = defaultFactory; - } - return componentFactory.createComponent(fullyQualifiedClassName, - context); - }); + Design.setComponentFactory( + (String fullyQualifiedClassName, DesignContext context) -> { + ComponentFactory componentFactory = currentComponentFactory + .get(); + if (componentFactory == null) { + componentFactory = defaultFactory; + } + return componentFactory + .createComponent(fullyQualifiedClassName, context); + }); } @Test(expected = IllegalArgumentException.class) @@ -59,11 +59,13 @@ public class ComponentFactoryTest { @Test public void testComponentFactoryLogging() { final List<String> messages = new ArrayList<>(); - currentComponentFactory.set((ComponentFactory) (String fullyQualifiedClassName, DesignContext context) -> { - messages.add("Requested class " + fullyQualifiedClassName); - return defaultFactory.createComponent(fullyQualifiedClassName, - context); - }); + currentComponentFactory + .set((ComponentFactory) (String fullyQualifiedClassName, + DesignContext context) -> { + messages.add("Requested class " + fullyQualifiedClassName); + return defaultFactory + .createComponent(fullyQualifiedClassName, context); + }); Design.read(new ByteArrayInputStream("<vaadin-label />".getBytes())); @@ -75,15 +77,24 @@ public class ComponentFactoryTest { @Test(expected = DesignException.class) public void testComponentFactoryReturningNull() { - currentComponentFactory.set((ComponentFactory) (String fullyQualifiedClassName, DesignContext context) -> null); + currentComponentFactory + .set((ComponentFactory) (String fullyQualifiedClassName, + DesignContext context) -> null); Design.read(new ByteArrayInputStream("<vaadin-label />".getBytes())); } @Test(expected = DesignException.class) public void testComponentFactoryThrowingStuff() { - currentComponentFactory.set((ComponentFactory) (String fullyQualifiedClassName, DesignContext context) -> defaultFactory.createComponent( - "foobar." + fullyQualifiedClassName, context) // Will throw because class is not found + currentComponentFactory.set((ComponentFactory) ( + String fullyQualifiedClassName, + DesignContext context) -> defaultFactory.createComponent( + "foobar." + fullyQualifiedClassName, context) // Will + // throw + // because + // class + // is not + // found ); Design.read(new ByteArrayInputStream("<vaadin-label />".getBytes())); @@ -92,11 +103,13 @@ public class ComponentFactoryTest { @Test public void testGetDefaultInstanceUsesComponentFactory() { final List<String> classes = new ArrayList<>(); - currentComponentFactory.set((ComponentFactory) (String fullyQualifiedClassName, DesignContext context) -> { - classes.add(fullyQualifiedClassName); - return defaultFactory.createComponent(fullyQualifiedClassName, - context); - }); + currentComponentFactory + .set((ComponentFactory) (String fullyQualifiedClassName, + DesignContext context) -> { + classes.add(fullyQualifiedClassName); + return defaultFactory + .createComponent(fullyQualifiedClassName, context); + }); DesignContext designContext = new DesignContext(); designContext.getDefaultInstance(new DefaultInstanceTestComponent()); diff --git a/server/src/test/java/com/vaadin/tests/design/DesignFormatterTest.java b/server/src/test/java/com/vaadin/tests/design/DesignFormatterTest.java index 30c07ccb11..f448f5c2b2 100644 --- a/server/src/test/java/com/vaadin/tests/design/DesignFormatterTest.java +++ b/server/src/test/java/com/vaadin/tests/design/DesignFormatterTest.java @@ -361,8 +361,7 @@ public class DesignFormatterTest { && SharedUtil.equals(other.getIcon(), act.getIcon()) && act.getKeyCode() == other.getKeyCode() && act.getModifiers().length == other.getModifiers().length) { - HashSet<Integer> thisSet = new HashSet<>( - act.getModifiers().length); + HashSet<Integer> thisSet = new HashSet<>(act.getModifiers().length); // this is a bit tricky comparison, but there is no nice way of // making int[] into a Set for (int mod : act.getModifiers()) { 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 cfea7a6fda..f3a44a7bf2 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 @@ -16,7 +16,6 @@ package com.vaadin.tests.design.designroot; import com.vaadin.ui.Button.ClickEvent; -import com.vaadin.ui.Button.ClickListener; import com.vaadin.ui.Notification; import com.vaadin.ui.TextField; diff --git a/server/src/test/java/com/vaadin/tests/event/EventRouterTest.java b/server/src/test/java/com/vaadin/tests/event/EventRouterTest.java index 7286b7ea2d..a290d43ea3 100644 --- a/server/src/test/java/com/vaadin/tests/event/EventRouterTest.java +++ b/server/src/test/java/com/vaadin/tests/event/EventRouterTest.java @@ -23,7 +23,6 @@ import org.junit.Before; import org.junit.Test; import com.vaadin.event.EventRouter; -import com.vaadin.server.ErrorEvent; import com.vaadin.server.ErrorHandler; import com.vaadin.ui.Component; import com.vaadin.ui.Component.Listener; diff --git a/server/src/test/java/com/vaadin/tests/event/ShortcutActionTest.java b/server/src/test/java/com/vaadin/tests/event/ShortcutActionTest.java index 90bc775efa..f701e089ce 100644 --- a/server/src/test/java/com/vaadin/tests/event/ShortcutActionTest.java +++ b/server/src/test/java/com/vaadin/tests/event/ShortcutActionTest.java @@ -98,8 +98,7 @@ public class ShortcutActionTest { && SharedUtil.equals(other.getIcon(), act.getIcon()) && act.getKeyCode() == other.getKeyCode() && act.getModifiers().length == other.getModifiers().length) { - HashSet<Integer> thisSet = new HashSet<>( - act.getModifiers().length); + HashSet<Integer> thisSet = new HashSet<>(act.getModifiers().length); // this is a bit tricky comparison, but there is no nice way of // making int[] into a Set for (int mod : act.getModifiers()) { 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 e33f8373ce..8a97e2217c 100644 --- a/server/src/test/java/com/vaadin/tests/server/ClassesSerializableTest.java +++ b/server/src/test/java/com/vaadin/tests/server/ClassesSerializableTest.java @@ -14,6 +14,7 @@ import java.lang.reflect.Method; import java.lang.reflect.Modifier; import java.lang.reflect.Type; import java.util.ArrayList; +import java.util.Arrays; import java.util.Collection; import java.util.Collections; import java.util.Comparator; @@ -30,7 +31,6 @@ import org.junit.Assert; import org.junit.Test; import com.vaadin.ui.Component; -import java.util.Arrays; public class ClassesSerializableTest { @@ -42,7 +42,8 @@ public class ClassesSerializableTest { private static final String[] BASE_PACKAGES = { "com.vaadin" }; - private static final 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/clientconnector/AttachDetachListenersTest.java b/server/src/test/java/com/vaadin/tests/server/clientconnector/AttachDetachListenersTest.java index 7a44e861da..65b7b437e0 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 @@ -160,7 +160,9 @@ public class AttachDetachListenersTest { @Override public void appendTo(StringBuffer buffer) { buffer.append("EventEquals("); - buffer.append("expected ").append(expected.getClass().getSimpleName()).append(" with connector ").append(expected.getConnector()); + buffer.append("expected ") + .append(expected.getClass().getSimpleName()) + .append(" with connector ").append(expected.getConnector()); buffer.append(")"); } diff --git a/server/src/test/java/com/vaadin/tests/server/component/DeclarativeMarginTestBase.java b/server/src/test/java/com/vaadin/tests/server/component/DeclarativeMarginTestBase.java index 7aabfe4f7f..b333c89fc8 100644 --- a/server/src/test/java/com/vaadin/tests/server/component/DeclarativeMarginTestBase.java +++ b/server/src/test/java/com/vaadin/tests/server/component/DeclarativeMarginTestBase.java @@ -35,8 +35,8 @@ public abstract class DeclarativeMarginTestBase<L extends Layout & MarginHandler MarginInfo m = new MarginInfo(top, right, bottom, left); - String design = getMarginTag(componentTag, defaultMargin, top, right, bottom, - left); + String design = getMarginTag(componentTag, defaultMargin, top, + right, bottom, left); // The assertEquals machinery in DeclarativeTestBase uses bean // introspection and MarginInfo is not a proper bean. It ends up @@ -48,14 +48,13 @@ public abstract class DeclarativeMarginTestBase<L extends Layout & MarginHandler } } - private String getMarginTag(String componentTag, boolean defaultMargin, boolean top, boolean right, - boolean bottom, boolean left) { + private String getMarginTag(String componentTag, boolean defaultMargin, + boolean top, boolean right, boolean bottom, boolean left) { String s = "<" + componentTag + " "; String suffix = defaultMargin ? "=false " : " "; if (top == left && top == right && top == bottom) { - if(top != defaultMargin) - { + if (top != defaultMargin) { s += "margin" + suffix; } } else { diff --git a/server/src/test/java/com/vaadin/tests/server/component/abstractdatefield/AbstractDateFieldDeclarativeTest.java b/server/src/test/java/com/vaadin/tests/server/component/abstractdatefield/AbstractDateFieldDeclarativeTest.java index 880a6a47f7..dcda449615 100644 --- a/server/src/test/java/com/vaadin/tests/server/component/abstractdatefield/AbstractDateFieldDeclarativeTest.java +++ b/server/src/test/java/com/vaadin/tests/server/component/abstractdatefield/AbstractDateFieldDeclarativeTest.java @@ -32,7 +32,7 @@ import com.vaadin.ui.AbstractDateField; * declarative test for a real component should extend it and implement abstract * methods to be able to test the common properties. Components specific * properties should be tested additionally in the subclasses implementations. - * + * * @author Vaadin Ltd * */ diff --git a/server/src/test/java/com/vaadin/tests/server/component/abstractorderedlayout/AbstractOrderedLayoutDeclarativeTest.java b/server/src/test/java/com/vaadin/tests/server/component/abstractorderedlayout/AbstractOrderedLayoutDeclarativeTest.java index 7e84bce54c..84b4b6135d 100644 --- a/server/src/test/java/com/vaadin/tests/server/component/abstractorderedlayout/AbstractOrderedLayoutDeclarativeTest.java +++ b/server/src/test/java/com/vaadin/tests/server/component/abstractorderedlayout/AbstractOrderedLayoutDeclarativeTest.java @@ -18,7 +18,6 @@ package com.vaadin.tests.server.component.abstractorderedlayout; import java.util.Arrays; import java.util.List; -import org.junit.Ignore; import org.junit.Test; import com.vaadin.shared.ui.label.ContentMode; diff --git a/server/src/test/java/com/vaadin/tests/server/component/abstractsinglecomponentcontainer/RemoveFromParentLockingTest.java b/server/src/test/java/com/vaadin/tests/server/component/abstractsinglecomponentcontainer/RemoveFromParentLockingTest.java index a2a25cb818..2da2d6aede 100644 --- a/server/src/test/java/com/vaadin/tests/server/component/abstractsinglecomponentcontainer/RemoveFromParentLockingTest.java +++ b/server/src/test/java/com/vaadin/tests/server/component/abstractsinglecomponentcontainer/RemoveFromParentLockingTest.java @@ -73,11 +73,11 @@ public class RemoveFromParentLockingTest { try { target.addComponent(testComponent); throw new AssertionError( - "Moving component when not holding its sessions's lock should throw"); + "Moving component when not holding its sessions's lock should throw"); } catch (IllegalStateException e) { Assert.assertEquals( - "Cannot remove from parent when the session is not locked.", - e.getMessage()); + "Cannot remove from parent when the session is not locked.", + e.getMessage()); } } @@ -106,12 +106,12 @@ public class RemoveFromParentLockingTest { try { lockedComponent.addComponent(notLockedComponent); throw new AssertionError( - "Moving component when not holding its sessions's lock should throw"); + "Moving component when not holding its sessions's lock should throw"); } catch (IllegalStateException e) { Assert.assertEquals( - "Cannot remove from parent when the session is not locked." - + " Furthermore, there is another locked session, indicating that the component might be about to be moved from one session to another.", - e.getMessage()); + "Cannot remove from parent when the session is not locked." + + " Furthermore, there is another locked session, indicating that the component might be about to be moved from one session to another.", + e.getMessage()); } } diff --git a/server/src/test/java/com/vaadin/tests/server/component/button/ButtonClickTest.java b/server/src/test/java/com/vaadin/tests/server/component/button/ButtonClickTest.java index eede9138c8..00bba9cd1d 100644 --- a/server/src/test/java/com/vaadin/tests/server/component/button/ButtonClickTest.java +++ b/server/src/test/java/com/vaadin/tests/server/component/button/ButtonClickTest.java @@ -8,7 +8,6 @@ import org.junit.Test; import com.vaadin.server.VaadinRequest; import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; -import com.vaadin.ui.Button.ClickListener; import com.vaadin.ui.UI; /** diff --git a/server/src/test/java/com/vaadin/tests/server/component/colorpicker/AbstractColorPickerDeclarativeTest.java b/server/src/test/java/com/vaadin/tests/server/component/colorpicker/AbstractColorPickerDeclarativeTest.java index 2c646e47a0..990121e704 100644 --- a/server/src/test/java/com/vaadin/tests/server/component/colorpicker/AbstractColorPickerDeclarativeTest.java +++ b/server/src/test/java/com/vaadin/tests/server/component/colorpicker/AbstractColorPickerDeclarativeTest.java @@ -30,7 +30,7 @@ import com.vaadin.ui.AbstractColorPicker.PopupStyle; * declarative test for a real component should extend it and implement abstract * methods to be able to test the common properties. Components specific * properties should be tested additionally in the subclasses implementations. - * + * * @author Vaadin Ltd * */ diff --git a/server/src/test/java/com/vaadin/tests/server/component/colorpicker/ColorPickerAreaDeclarativeTest.java b/server/src/test/java/com/vaadin/tests/server/component/colorpicker/ColorPickerAreaDeclarativeTest.java index 715acfd050..4169906629 100644 --- a/server/src/test/java/com/vaadin/tests/server/component/colorpicker/ColorPickerAreaDeclarativeTest.java +++ b/server/src/test/java/com/vaadin/tests/server/component/colorpicker/ColorPickerAreaDeclarativeTest.java @@ -20,7 +20,7 @@ import com.vaadin.ui.ColorPickerArea; /** * Declarative test for ColorPickerArea. Provides only information about * ColorPickerArea class. All tests are in the superclass. - * + * * @author Vaadin Ltd * */ diff --git a/server/src/test/java/com/vaadin/tests/server/component/colorpicker/ColorPickerDeclarativeTest.java b/server/src/test/java/com/vaadin/tests/server/component/colorpicker/ColorPickerDeclarativeTest.java index 41d730eb18..e76e1d6c01 100644 --- a/server/src/test/java/com/vaadin/tests/server/component/colorpicker/ColorPickerDeclarativeTest.java +++ b/server/src/test/java/com/vaadin/tests/server/component/colorpicker/ColorPickerDeclarativeTest.java @@ -20,7 +20,7 @@ import com.vaadin.ui.ColorPicker; /** * Declarative test for ColorPicker. Provides only information about * ColorPickerArea class. All tests are in the superclass. - * + * * @author Vaadin Ltd * */ diff --git a/server/src/test/java/com/vaadin/tests/server/component/combobox/ComboBoxDeclarativeTest.java b/server/src/test/java/com/vaadin/tests/server/component/combobox/ComboBoxDeclarativeTest.java index c35af4a6a2..1677f8699b 100644 --- a/server/src/test/java/com/vaadin/tests/server/component/combobox/ComboBoxDeclarativeTest.java +++ b/server/src/test/java/com/vaadin/tests/server/component/combobox/ComboBoxDeclarativeTest.java @@ -100,8 +100,9 @@ public class ComboBoxDeclarativeTest Method writeMethod) { if (readMethod != null) { Class<?> returnType = readMethod.getReturnType(); - if (StyleGenerator.class.equals(returnType)) + if (StyleGenerator.class.equals(returnType)) { return false; + } } return super.acceptProperty(clazz, readMethod, writeMethod); } diff --git a/server/src/test/java/com/vaadin/tests/server/component/grid/GridDeclarativeTest.java b/server/src/test/java/com/vaadin/tests/server/component/grid/GridDeclarativeTest.java index d8b75b130e..8c435f831d 100644 --- a/server/src/test/java/com/vaadin/tests/server/component/grid/GridDeclarativeTest.java +++ b/server/src/test/java/com/vaadin/tests/server/component/grid/GridDeclarativeTest.java @@ -586,6 +586,7 @@ public class GridDeclarativeTest extends AbstractListingDeclarativeTest<Grid> { return testRead(design, expected, false); } + @Override @SuppressWarnings("rawtypes") public Grid<?> testRead(String design, Grid expected, boolean retestWrite) { return testRead(design, expected, retestWrite, false); diff --git a/server/src/test/java/com/vaadin/tests/server/component/gridlayout/GridLayoutDeclarativeTest.java b/server/src/test/java/com/vaadin/tests/server/component/gridlayout/GridLayoutDeclarativeTest.java index 43176a5ce8..6b81df7e70 100644 --- a/server/src/test/java/com/vaadin/tests/server/component/gridlayout/GridLayoutDeclarativeTest.java +++ b/server/src/test/java/com/vaadin/tests/server/component/gridlayout/GridLayoutDeclarativeTest.java @@ -22,7 +22,6 @@ import java.io.IOException; import org.junit.Assert; import org.junit.Test; -import com.vaadin.shared.ui.MarginInfo; import com.vaadin.shared.ui.label.ContentMode; import com.vaadin.tests.server.component.DeclarativeMarginTestBase; import com.vaadin.ui.Alignment; @@ -38,7 +37,7 @@ public class GridLayoutDeclarativeTest @Test public void testMargins() { - testMargins("vaadin-grid-layout",false); + testMargins("vaadin-grid-layout", false); } @Test diff --git a/server/src/test/java/com/vaadin/tests/server/component/listselect/ListSelectDeclarativeTest.java b/server/src/test/java/com/vaadin/tests/server/component/listselect/ListSelectDeclarativeTest.java index a71aed674b..baae580ccc 100644 --- a/server/src/test/java/com/vaadin/tests/server/component/listselect/ListSelectDeclarativeTest.java +++ b/server/src/test/java/com/vaadin/tests/server/component/listselect/ListSelectDeclarativeTest.java @@ -26,9 +26,9 @@ import com.vaadin.ui.ListSelect; * There is only {@link ListSelect#setRows(int)}/{@link ListSelect#getRows()} * explicit test. All other tests are in the super class ( * {@link AbstractMultiSelectDeclarativeTest}). - * + * * @see AbstractMultiSelectDeclarativeTest - * + * * @author Vaadin Ltd * */ diff --git a/server/src/test/java/com/vaadin/tests/server/component/nativeselect/NativeSelectDeclarativeTest.java b/server/src/test/java/com/vaadin/tests/server/component/nativeselect/NativeSelectDeclarativeTest.java index f7114394d4..2b80546e80 100644 --- a/server/src/test/java/com/vaadin/tests/server/component/nativeselect/NativeSelectDeclarativeTest.java +++ b/server/src/test/java/com/vaadin/tests/server/component/nativeselect/NativeSelectDeclarativeTest.java @@ -22,7 +22,7 @@ import com.vaadin.ui.NativeSelect; * Declarative support tests for {@link NativeSelect}. All tests are in the * super class ({@link AbstractSingleSelectDeclarativeTest}). This class * declares only tag name and native select class (test parameters). - * + * * @author Vaadin Ltd * */ diff --git a/server/src/test/java/com/vaadin/tests/server/component/passwordfield/PasswordFieldDeclarativeTest.java b/server/src/test/java/com/vaadin/tests/server/component/passwordfield/PasswordFieldDeclarativeTest.java index c7908fd6b0..bb96bf0c3d 100644 --- a/server/src/test/java/com/vaadin/tests/server/component/passwordfield/PasswordFieldDeclarativeTest.java +++ b/server/src/test/java/com/vaadin/tests/server/component/passwordfield/PasswordFieldDeclarativeTest.java @@ -22,7 +22,7 @@ import com.vaadin.ui.TextField; /** * Declarative test for PasswordField. Provides only information about * ColorPickerArea class. All tests are in the superclass. - * + * * @author Vaadin Ltd * */ diff --git a/server/src/test/java/com/vaadin/tests/server/component/radiobuttongroup/RadioButtonGroupDeclarativeTest.java b/server/src/test/java/com/vaadin/tests/server/component/radiobuttongroup/RadioButtonGroupDeclarativeTest.java index d25c12a4d7..fbc1d912a9 100644 --- a/server/src/test/java/com/vaadin/tests/server/component/radiobuttongroup/RadioButtonGroupDeclarativeTest.java +++ b/server/src/test/java/com/vaadin/tests/server/component/radiobuttongroup/RadioButtonGroupDeclarativeTest.java @@ -29,9 +29,9 @@ import com.vaadin.ui.RadioButtonGroup; * Only {@link RadioButtonGroup#setHtmlContentAllowed(boolean)} is tested here * explicitly. All other tests are in the super class ( * {@link AbstractSingleSelectDeclarativeTest}). - * + * * @see AbstractSingleSelectDeclarativeTest - * + * * @author Vaadin Ltd * */ diff --git a/server/src/test/java/com/vaadin/tests/server/component/tabsheet/TabSheetTest.java b/server/src/test/java/com/vaadin/tests/server/component/tabsheet/TabSheetTest.java index 60ec97ad50..b48a3477ab 100644 --- a/server/src/test/java/com/vaadin/tests/server/component/tabsheet/TabSheetTest.java +++ b/server/src/test/java/com/vaadin/tests/server/component/tabsheet/TabSheetTest.java @@ -7,6 +7,7 @@ import static org.junit.Assert.assertSame; import java.util.Iterator; +import org.junit.Assert; import org.junit.Test; import com.vaadin.ui.Component; @@ -15,7 +16,6 @@ import com.vaadin.ui.TabSheet; import com.vaadin.ui.TabSheet.SelectedTabChangeEvent; import com.vaadin.ui.TabSheet.SelectedTabChangeListener; import com.vaadin.ui.TabSheet.Tab; -import org.junit.Assert; public class TabSheetTest { diff --git a/server/src/test/java/com/vaadin/tests/server/component/twincolselect/TwinColSelectDeclarativeTest.java b/server/src/test/java/com/vaadin/tests/server/component/twincolselect/TwinColSelectDeclarativeTest.java index 99841e9cf9..5f1eba4176 100644 --- a/server/src/test/java/com/vaadin/tests/server/component/twincolselect/TwinColSelectDeclarativeTest.java +++ b/server/src/test/java/com/vaadin/tests/server/component/twincolselect/TwinColSelectDeclarativeTest.java @@ -25,9 +25,9 @@ import com.vaadin.ui.TwinColSelect; * <p> * There are only TwinColSelect specific properties explicit tests. All other * tests are in the super class ( {@link AbstractMultiSelectDeclarativeTest}). - * + * * @see AbstractMultiSelectDeclarativeTest - * + * * @author Vaadin Ltd * */ 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 872683cec3..8416a216c1 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 @@ -11,9 +11,7 @@ import com.vaadin.server.VaadinRequest; import com.vaadin.server.VaadinSession; import com.vaadin.tests.util.AlwaysLockedVaadinSession; import com.vaadin.ui.HasComponents.ComponentAttachEvent; -import com.vaadin.ui.HasComponents.ComponentAttachListener; import com.vaadin.ui.HasComponents.ComponentDetachEvent; -import com.vaadin.ui.HasComponents.ComponentDetachListener; import com.vaadin.ui.Label; import com.vaadin.ui.UI; import com.vaadin.ui.VerticalLayout; diff --git a/server/src/test/java/com/vaadin/ui/AbstractMultiSelectTest.java b/server/src/test/java/com/vaadin/ui/AbstractMultiSelectTest.java index 68461b676f..d98477c66d 100644 --- a/server/src/test/java/com/vaadin/ui/AbstractMultiSelectTest.java +++ b/server/src/test/java/com/vaadin/ui/AbstractMultiSelectTest.java @@ -37,8 +37,8 @@ import org.junit.runners.Parameterized.Parameters; import org.mockito.Mockito; import com.vaadin.data.HasValue.ValueChangeEvent; -import com.vaadin.data.provider.DataProvider; import com.vaadin.data.Listing; +import com.vaadin.data.provider.DataProvider; import com.vaadin.event.selection.MultiSelectionEvent; import com.vaadin.event.selection.MultiSelectionListener; import com.vaadin.shared.Registration; @@ -318,8 +318,8 @@ public class AbstractMultiSelectTest<S extends AbstractMultiSelect<String> & Lis Assert.assertSame(registration, actualRegistration); - selectionListener.get().selectionChange(new MultiSelectionEvent<>(select, - Mockito.mock(Set.class), true)); + selectionListener.get().selectionChange(new MultiSelectionEvent<>( + select, Mockito.mock(Set.class), true)); Assert.assertEquals(select, event.get().getComponent()); Assert.assertEquals(set, event.get().getValue()); diff --git a/server/src/test/java/com/vaadin/ui/AbstractSingleSelectTest.java b/server/src/test/java/com/vaadin/ui/AbstractSingleSelectTest.java index 51e4fa71e9..1b814921e7 100644 --- a/server/src/test/java/com/vaadin/ui/AbstractSingleSelectTest.java +++ b/server/src/test/java/com/vaadin/ui/AbstractSingleSelectTest.java @@ -32,9 +32,9 @@ import org.junit.Test; import org.mockito.Mockito; import com.vaadin.data.HasValue.ValueChangeEvent; +import com.vaadin.data.Listing; import com.vaadin.data.provider.DataProvider; import com.vaadin.data.provider.bov.Person; -import com.vaadin.data.Listing; import com.vaadin.event.selection.SingleSelectionEvent; import com.vaadin.event.selection.SingleSelectionListener; import com.vaadin.shared.Registration; @@ -81,8 +81,7 @@ public class AbstractSingleSelectTest { listing = new PersonListing(); listing.setItems(PERSON_A, PERSON_B, PERSON_C); selectionChanges = new ArrayList<>(); - listing.addSelectionListener( - e -> selectionChanges.add(e.getValue())); + listing.addSelectionListener(e -> selectionChanges.add(e.getValue())); } public static final Person PERSON_C = new Person("c", 3); diff --git a/server/src/test/java/com/vaadin/ui/RadioButtonGroupBoVTest.java b/server/src/test/java/com/vaadin/ui/RadioButtonGroupBoVTest.java index 2fa64ee0ec..82124454e2 100644 --- a/server/src/test/java/com/vaadin/ui/RadioButtonGroupBoVTest.java +++ b/server/src/test/java/com/vaadin/ui/RadioButtonGroupBoVTest.java @@ -23,20 +23,15 @@ import java.util.EnumSet; * @author Vaadin Ltd * @since 8.0 */ -public class RadioButtonGroupBoVTest -{ +public class RadioButtonGroupBoVTest { public enum Status { - STATE_A, - STATE_B, - STATE_C, - STATE_D; + STATE_A, STATE_B, STATE_C, STATE_D; public String getCaption() { return "** " + toString(); } } - public void createOptionGroup() { RadioButtonGroup<Status> s = new RadioButtonGroup<>(); s.setItems(EnumSet.allOf(Status.class)); diff --git a/server/src/test/java/com/vaadin/ui/RadioButtonGroupTest.java b/server/src/test/java/com/vaadin/ui/RadioButtonGroupTest.java index 8dfbc70e56..281690d7ee 100644 --- a/server/src/test/java/com/vaadin/ui/RadioButtonGroupTest.java +++ b/server/src/test/java/com/vaadin/ui/RadioButtonGroupTest.java @@ -34,8 +34,8 @@ public class RadioButtonGroupTest { public void setUp() { radioButtonGroup = new RadioButtonGroup<>(); // Intentional deviation from upcoming selection order - radioButtonGroup - .setDataProvider(DataProvider.create("Third", "Second", "First")); + radioButtonGroup.setDataProvider( + DataProvider.create("Third", "Second", "First")); } @Test diff --git a/server/src/test/java/com/vaadin/ui/RichTextAreaTest.java b/server/src/test/java/com/vaadin/ui/RichTextAreaTest.java index a18105b5bb..56f1293556 100644 --- a/server/src/test/java/com/vaadin/ui/RichTextAreaTest.java +++ b/server/src/test/java/com/vaadin/ui/RichTextAreaTest.java @@ -15,6 +15,11 @@ */ package com.vaadin.ui; +import static com.vaadin.ui.ComponentTest.getRpcProxy; +import static com.vaadin.ui.ComponentTest.isDirty; +import static com.vaadin.ui.ComponentTest.syncToClient; +import static com.vaadin.ui.ComponentTest.updateDiffState; + import org.junit.Assert; import org.junit.Test; @@ -22,12 +27,8 @@ import com.vaadin.server.ClientConnector; import com.vaadin.server.ServerRpcManager.RpcInvocationException; import com.vaadin.shared.ui.richtextarea.RichTextAreaServerRpc; import com.vaadin.tests.util.MockUI; -import static com.vaadin.ui.ComponentTest.getRpcProxy; -import static com.vaadin.ui.ComponentTest.isDirty; -import static com.vaadin.ui.ComponentTest.syncToClient; -import static com.vaadin.ui.ComponentTest.updateDiffState; -public class RichTextAreaTest { +public class RichTextAreaTest { @Test public void initiallyEmpty() { diff --git a/server/src/test/java/com/vaadin/util/CurrentInstanceTest.java b/server/src/test/java/com/vaadin/util/CurrentInstanceTest.java index 3505ef7532..e2da8e0278 100644 --- a/server/src/test/java/com/vaadin/util/CurrentInstanceTest.java +++ b/server/src/test/java/com/vaadin/util/CurrentInstanceTest.java @@ -15,14 +15,7 @@ */ package com.vaadin.util; -import com.vaadin.server.VaadinRequest; -import com.vaadin.server.VaadinService; -import com.vaadin.server.VaadinSession; -import com.vaadin.ui.UI; -import org.easymock.EasyMock; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Test; +import static org.junit.Assert.assertNull; import java.lang.ref.WeakReference; import java.lang.reflect.Field; @@ -33,7 +26,15 @@ import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import java.util.concurrent.Future; -import static org.junit.Assert.assertNull; +import org.easymock.EasyMock; +import org.junit.Assert; +import org.junit.Before; +import org.junit.Test; + +import com.vaadin.server.VaadinRequest; +import com.vaadin.server.VaadinService; +import com.vaadin.server.VaadinSession; +import com.vaadin.ui.UI; public class CurrentInstanceTest { @@ -78,8 +79,7 @@ public class CurrentInstanceTest { IllegalAccessException { Field f = CurrentInstance.class.getDeclaredField("instances"); f.setAccessible(true); - return (ThreadLocal<Map<Class<?>, CurrentInstance>>) f - .get(null); + return (ThreadLocal<Map<Class<?>, CurrentInstance>>) f.get(null); } public void testInheritedClearedAfterRemove() { @@ -149,8 +149,7 @@ public class CurrentInstanceTest { .setCurrent(session2); // Use weak ref to verify object is collected - WeakReference<VaadinSession> ref = new WeakReference<>( - session1); + WeakReference<VaadinSession> ref = new WeakReference<>(session1); session1 = null; waitUntilGarbageCollected(ref); |