aboutsummaryrefslogtreecommitdiffstats
path: root/server/src/main/java/com/vaadin
diff options
context:
space:
mode:
authorLeif Åstrand <legioth@gmail.com>2016-12-20 17:50:32 +0200
committerIlia Motornyi <elmot@vaadin.com>2016-12-20 17:50:32 +0200
commit95d016c08569f74a2c76eac40c4f5656bb773951 (patch)
tree340977988748756ee4ace27860dc00b3358519ae /server/src/main/java/com/vaadin
parent1407b8ddaea9a8aace0973864ad9ce093e20a566 (diff)
downloadvaadin-framework-95d016c08569f74a2c76eac40c4f5656bb773951.tar.gz
vaadin-framework-95d016c08569f74a2c76eac40c4f5656bb773951.zip
Global java code cleanup using Eclipse Neon.1
Diffstat (limited to 'server/src/main/java/com/vaadin')
-rw-r--r--server/src/main/java/com/vaadin/data/BeanBinder.java5
-rw-r--r--server/src/main/java/com/vaadin/data/Binder.java89
-rw-r--r--server/src/main/java/com/vaadin/data/BinderValidationStatus.java9
-rw-r--r--server/src/main/java/com/vaadin/data/Converter.java1
-rw-r--r--server/src/main/java/com/vaadin/data/Result.java14
-rw-r--r--server/src/main/java/com/vaadin/data/SimpleResult.java12
-rw-r--r--server/src/main/java/com/vaadin/data/StatusChangeEvent.java3
-rw-r--r--server/src/main/java/com/vaadin/data/ValidationException.java3
-rw-r--r--server/src/main/java/com/vaadin/data/ValidationResult.java4
-rw-r--r--server/src/main/java/com/vaadin/data/ValueContext.java8
-rw-r--r--server/src/main/java/com/vaadin/data/ValueProvider.java4
-rw-r--r--server/src/main/java/com/vaadin/data/provider/DataGenerator.java3
-rw-r--r--server/src/main/java/com/vaadin/data/provider/DataProviderListener.java2
-rw-r--r--server/src/main/java/com/vaadin/event/ActionManager.java2
-rw-r--r--server/src/main/java/com/vaadin/event/FieldEvents.java4
-rw-r--r--server/src/main/java/com/vaadin/event/SortEvent.java4
-rw-r--r--server/src/main/java/com/vaadin/event/dd/acceptcriteria/SourceIs.java4
-rw-r--r--server/src/main/java/com/vaadin/event/dd/acceptcriteria/SourceIsTarget.java4
-rw-r--r--server/src/main/java/com/vaadin/server/AbstractClientConnector.java8
-rw-r--r--server/src/main/java/com/vaadin/server/BootstrapHandler.java2
-rw-r--r--server/src/main/java/com/vaadin/server/BrowserWindowOpener.java2
-rw-r--r--server/src/main/java/com/vaadin/server/ComponentSizeValidator.java17
-rw-r--r--server/src/main/java/com/vaadin/server/JsonCodec.java3
-rw-r--r--server/src/main/java/com/vaadin/server/JsonPaintTarget.java8
-rw-r--r--server/src/main/java/com/vaadin/server/LegacyCommunicationManager.java1
-rw-r--r--server/src/main/java/com/vaadin/server/LegacyVaadinPortlet.java4
-rw-r--r--server/src/main/java/com/vaadin/server/LegacyVaadinServlet.java3
-rw-r--r--server/src/main/java/com/vaadin/server/LocaleService.java3
-rw-r--r--server/src/main/java/com/vaadin/server/SerializableComparator.java4
-rw-r--r--server/src/main/java/com/vaadin/server/SerializableConsumer.java4
-rw-r--r--server/src/main/java/com/vaadin/server/SerializablePredicate.java2
-rw-r--r--server/src/main/java/com/vaadin/server/SerializableSupplier.java4
-rw-r--r--server/src/main/java/com/vaadin/server/Setter.java17
-rw-r--r--server/src/main/java/com/vaadin/server/UnsupportedBrowserHandler.java48
-rw-r--r--server/src/main/java/com/vaadin/server/VaadinPortlet.java4
-rw-r--r--server/src/main/java/com/vaadin/server/VaadinSession.java8
-rw-r--r--server/src/main/java/com/vaadin/server/communication/ClientRpcWriter.java11
-rw-r--r--server/src/main/java/com/vaadin/server/communication/FileUploadHandler.java6
-rw-r--r--server/src/main/java/com/vaadin/server/communication/LegacyUidlWriter.java1
-rw-r--r--server/src/main/java/com/vaadin/server/communication/PortletBootstrapHandler.java3
-rw-r--r--server/src/main/java/com/vaadin/server/communication/PortletDummyRequestHandler.java2
-rw-r--r--server/src/main/java/com/vaadin/server/communication/PushHandler.java57
-rw-r--r--server/src/main/java/com/vaadin/server/communication/PushRequestHandler.java1
-rw-r--r--server/src/main/java/com/vaadin/server/communication/SessionRequestHandler.java3
-rw-r--r--server/src/main/java/com/vaadin/server/widgetsetutils/WidgetSetBuilder.java32
-rw-r--r--server/src/main/java/com/vaadin/ui/AbstractColorPicker.java2
-rw-r--r--server/src/main/java/com/vaadin/ui/AbstractListing.java4
-rw-r--r--server/src/main/java/com/vaadin/ui/AbstractTextField.java1
-rw-r--r--server/src/main/java/com/vaadin/ui/ComboBox.java36
-rw-r--r--server/src/main/java/com/vaadin/ui/ConnectorTracker.java3
-rw-r--r--server/src/main/java/com/vaadin/ui/CustomField.java2
-rw-r--r--server/src/main/java/com/vaadin/ui/Grid.java1
-rw-r--r--server/src/main/java/com/vaadin/ui/HasValueChangeMode.java8
-rw-r--r--server/src/main/java/com/vaadin/ui/MenuBar.java4
-rw-r--r--server/src/main/java/com/vaadin/ui/MultiSelect.java6
-rw-r--r--server/src/main/java/com/vaadin/ui/RichTextArea.java1
-rw-r--r--server/src/main/java/com/vaadin/ui/SingleSelect.java4
-rw-r--r--server/src/main/java/com/vaadin/ui/UI.java22
-rw-r--r--server/src/main/java/com/vaadin/ui/Window.java28
-rw-r--r--server/src/main/java/com/vaadin/ui/components/colorpicker/ColorPickerSelect.java4
-rw-r--r--server/src/main/java/com/vaadin/ui/components/grid/EditorComponentGenerator.java4
-rw-r--r--server/src/main/java/com/vaadin/ui/components/grid/SortOrderProvider.java4
-rw-r--r--server/src/main/java/com/vaadin/ui/declarative/Design.java3
-rw-r--r--server/src/main/java/com/vaadin/ui/declarative/FieldBinder.java5
-rw-r--r--server/src/main/java/com/vaadin/ui/declarative/ShouldWriteDataDelegate.java4
-rw-r--r--server/src/main/java/com/vaadin/ui/renderers/AbstractJavaScriptRenderer.java2
-rw-r--r--server/src/main/java/com/vaadin/util/CurrentInstance.java3
67 files changed, 290 insertions, 294 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;