diff options
author | Ahmed Ashour <asashour@yahoo.com> | 2017-09-21 14:25:46 +0200 |
---|---|---|
committer | Henri Sara <henri.sara@gmail.com> | 2017-09-21 15:25:46 +0300 |
commit | 11ddb11cbc72b0ee233e503058d4e104030e4aa3 (patch) | |
tree | a3cef3be53ee41bba3d8ab8b64b0e10b2483a5fa /server/src/main/java/com/vaadin | |
parent | e118f4d860adeaca1690ef095906ae6be84f3cb5 (diff) | |
download | vaadin-framework-11ddb11cbc72b0ee233e503058d4e104030e4aa3.tar.gz vaadin-framework-11ddb11cbc72b0ee233e503058d4e104030e4aa3.zip |
Update modifier order to follow Java Specification suggestions (#10050)
Also includes some other minor cleanup.
Diffstat (limited to 'server/src/main/java/com/vaadin')
17 files changed, 30 insertions, 30 deletions
diff --git a/server/src/main/java/com/vaadin/data/provider/DataCommunicator.java b/server/src/main/java/com/vaadin/data/provider/DataCommunicator.java index 05fb776140..aba50226f7 100644 --- a/server/src/main/java/com/vaadin/data/provider/DataCommunicator.java +++ b/server/src/main/java/com/vaadin/data/provider/DataCommunicator.java @@ -595,7 +595,7 @@ public class DataCommunicator<T> extends AbstractExtension { * @since 8.1 * */ - protected DataKeyMapper<T> createKeyMapper(ValueProvider<T,Object> identifierGetter) { + protected DataKeyMapper<T> createKeyMapper(ValueProvider<T, Object> identifierGetter) { return new KeyMapper<T>(identifierGetter); } diff --git a/server/src/main/java/com/vaadin/event/FieldEvents.java b/server/src/main/java/com/vaadin/event/FieldEvents.java index 2b0a0f6286..c12d683f20 100644 --- a/server/src/main/java/com/vaadin/event/FieldEvents.java +++ b/server/src/main/java/com/vaadin/event/FieldEvents.java @@ -165,7 +165,7 @@ public interface FieldEvents { public void blur(BlurEvent event); } - public static abstract class FocusAndBlurServerRpcImpl + public abstract static class FocusAndBlurServerRpcImpl implements FocusAndBlurServerRpc { private final Component component; diff --git a/server/src/main/java/com/vaadin/event/ShortcutListener.java b/server/src/main/java/com/vaadin/event/ShortcutListener.java index 66e0110a4c..c8b70b649e 100644 --- a/server/src/main/java/com/vaadin/event/ShortcutListener.java +++ b/server/src/main/java/com/vaadin/event/ShortcutListener.java @@ -41,5 +41,5 @@ public abstract class ShortcutListener extends ShortcutAction } @Override - abstract public void handleAction(Object sender, Object target); + public abstract void handleAction(Object sender, Object target); } diff --git a/server/src/main/java/com/vaadin/event/dd/acceptcriteria/Or.java b/server/src/main/java/com/vaadin/event/dd/acceptcriteria/Or.java index b0dab24fe0..b0e13963bd 100644 --- a/server/src/main/java/com/vaadin/event/dd/acceptcriteria/Or.java +++ b/server/src/main/java/com/vaadin/event/dd/acceptcriteria/Or.java @@ -30,7 +30,7 @@ import com.vaadin.server.PaintTarget; */ public class Or extends ClientSideCriterion { private static final long serialVersionUID = 1L; - private final AcceptCriterion criteria[]; + private final AcceptCriterion[] criteria; /** * @param criteria diff --git a/server/src/main/java/com/vaadin/server/ComponentSizeValidator.java b/server/src/main/java/com/vaadin/server/ComponentSizeValidator.java index 9e1134efed..f65fc610c9 100644 --- a/server/src/main/java/com/vaadin/server/ComponentSizeValidator.java +++ b/server/src/main/java/com/vaadin/server/ComponentSizeValidator.java @@ -46,7 +46,7 @@ import com.vaadin.ui.Window; @SuppressWarnings({ "serial", "deprecation" }) public class ComponentSizeValidator implements Serializable { - private final static int LAYERS_SHOWN = 4; + private static final int LAYERS_SHOWN = 4; /** * Recursively checks given component and its subtree for invalid layout diff --git a/server/src/main/java/com/vaadin/server/JsonPaintTarget.java b/server/src/main/java/com/vaadin/server/JsonPaintTarget.java index a2df4203c8..3be04fc2c4 100644 --- a/server/src/main/java/com/vaadin/server/JsonPaintTarget.java +++ b/server/src/main/java/com/vaadin/server/JsonPaintTarget.java @@ -49,7 +49,7 @@ public class JsonPaintTarget implements PaintTarget { /* Document type declarations */ - private final static String UIDL_ARG_NAME = "name"; + private static final String UIDL_ARG_NAME = "name"; private final Deque<String> mOpenTags; @@ -206,7 +206,7 @@ public class JsonPaintTarget implements PaintTarget { * @return A new string instance where all occurrences of XML sensitive * characters are substituted with entities. */ - static public String escapeXML(String xml) { + public static String escapeXML(String xml) { if (xml == null || xml.length() <= 0) { return ""; } @@ -248,7 +248,7 @@ public class JsonPaintTarget implements PaintTarget { * The string to escape * @return Escaped version of the string */ - static public String escapeJSON(String s) { + public static String escapeJSON(String s) { // FIXME: Move this method to another class as other classes use it // also. if (s == null) { diff --git a/server/src/main/java/com/vaadin/server/VaadinPortlet.java b/server/src/main/java/com/vaadin/server/VaadinPortlet.java index 441580df84..d4a7d0e62d 100644 --- a/server/src/main/java/com/vaadin/server/VaadinPortlet.java +++ b/server/src/main/java/com/vaadin/server/VaadinPortlet.java @@ -63,7 +63,7 @@ public class VaadinPortlet extends GenericPortlet * Base class for portlet requests that need access to HTTP servlet * requests. */ - public static abstract class VaadinHttpAndPortletRequest + public abstract static class VaadinHttpAndPortletRequest extends VaadinPortletRequest { /** diff --git a/server/src/main/java/com/vaadin/server/VaadinServlet.java b/server/src/main/java/com/vaadin/server/VaadinServlet.java index 638eeb047f..edfbd1cc28 100644 --- a/server/src/main/java/com/vaadin/server/VaadinServlet.java +++ b/server/src/main/java/com/vaadin/server/VaadinServlet.java @@ -1019,7 +1019,7 @@ public class VaadinServlet extends HttpServlet implements Constants { private void streamContent(HttpServletResponse response, InputStream is) throws IOException { final OutputStream os = response.getOutputStream(); - final byte buffer[] = new byte[DEFAULT_BUFFER_SIZE]; + final byte[] buffer = new byte[DEFAULT_BUFFER_SIZE]; int bytes; while ((bytes = is.read(buffer)) >= 0) { os.write(buffer, 0, bytes); 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 08bcffa442..fb02819c23 100644 --- a/server/src/main/java/com/vaadin/server/communication/FileUploadHandler.java +++ b/server/src/main/java/com/vaadin/server/communication/FileUploadHandler.java @@ -308,7 +308,7 @@ public class FileUploadHandler implements RequestHandler { "The multipart stream ended unexpectedly"); } bout.write(readByte); - if(bout.size() > MULTIPART_BOUNDARY_LINE_LIMIT) { + if (bout.size() > MULTIPART_BOUNDARY_LINE_LIMIT) { throw new IOException( "The multipart stream does not contain boundary"); } @@ -564,7 +564,7 @@ public class FileUploadHandler implements RequestHandler { throw new NoInputStreamException(); } - final byte buffer[] = new byte[MAX_UPLOAD_BUFFER_SIZE]; + final byte[] buffer = new byte[MAX_UPLOAD_BUFFER_SIZE]; long lastStreamingEvent = 0; int bytesReadToBuffer = 0; do { 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 6eeaa88520..f287b4334f 100644 --- a/server/src/main/java/com/vaadin/server/communication/PushHandler.java +++ b/server/src/main/java/com/vaadin/server/communication/PushHandler.java @@ -308,7 +308,7 @@ public class PushHandler { // We don't want to use callWithUi here, as it assumes there's a client // request active and does requestStart and requestEnd among other // things. - if(event == null){ + if (event == null) { getLogger().log(Level.SEVERE, "Could not get event. This should never happen."); return; @@ -316,7 +316,7 @@ public class PushHandler { AtmosphereResource resource = event.getResource(); - if(resource == null){ + if (resource == null) { getLogger().log(Level.SEVERE, "Could not get resource. This should never happen."); return; diff --git a/server/src/main/java/com/vaadin/server/widgetsetutils/ClassPathExplorer.java b/server/src/main/java/com/vaadin/server/widgetsetutils/ClassPathExplorer.java index 50b23f80a3..f93803de99 100644 --- a/server/src/main/java/com/vaadin/server/widgetsetutils/ClassPathExplorer.java +++ b/server/src/main/java/com/vaadin/server/widgetsetutils/ClassPathExplorer.java @@ -58,7 +58,7 @@ public class ClassPathExplorer { /** * File filter that only accepts directories. */ - private final static FileFilter DIRECTORIES_ONLY = (File f) -> + private static final FileFilter DIRECTORIES_ONLY = (File f) -> f.exists() && f.isDirectory(); /** @@ -301,7 +301,7 @@ public class ClassPathExplorer { * * @return filtered list of class path entries */ - private final static List<String> getRawClasspathEntries() { + private static final List<String> getRawClasspathEntries() { // try to keep the order of the classpath List<String> locations = new ArrayList<>(); @@ -339,7 +339,7 @@ public class ClassPathExplorer { * string * @return map of classpath locations, see {@link #classpathLocations} */ - private final static Map<String, URL> getClasspathLocations( + private static final Map<String, URL> getClasspathLocations( List<String> rawClasspathEntries) { long start = System.currentTimeMillis(); // try to keep the order of the classpath @@ -428,7 +428,7 @@ public class ClassPathExplorer { * @param file * @param locations */ - private final static void include(String name, File file, + private static final void include(String name, File file, Map<String, URL> locations) { if (!file.exists()) { return; diff --git a/server/src/main/java/com/vaadin/ui/AbstractLocalDateField.java b/server/src/main/java/com/vaadin/ui/AbstractLocalDateField.java index 2fdf2bf382..2584eaf6ea 100644 --- a/server/src/main/java/com/vaadin/ui/AbstractLocalDateField.java +++ b/server/src/main/java/com/vaadin/ui/AbstractLocalDateField.java @@ -144,7 +144,7 @@ public abstract class AbstractLocalDateField if (value == null) return ""; DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofLocalizedDate(FormatStyle.SHORT); Locale locale = getLocale(); - if (locale != null){ + if (locale != null) { dateTimeFormatter = dateTimeFormatter.withLocale(locale); } return value.format(dateTimeFormatter); diff --git a/server/src/main/java/com/vaadin/ui/Composite.java b/server/src/main/java/com/vaadin/ui/Composite.java index 755b25b742..fcdbf4b04f 100644 --- a/server/src/main/java/com/vaadin/ui/Composite.java +++ b/server/src/main/java/com/vaadin/ui/Composite.java @@ -183,7 +183,7 @@ public class Composite extends AbstractComponent implements HasComponents { private Component getRootOrThrow() { Component root = getCompositionRoot(); - if(root == null) throw new IllegalStateException("Composition root has not been set"); + if (root == null) throw new IllegalStateException("Composition root has not been set"); return root; } @@ -202,7 +202,7 @@ public class Composite extends AbstractComponent implements HasComponents { private <T> T getRootAbstractComponentPropertyOrNull(SerializableFunction<AbstractComponent, T> getter) { Component root = getCompositionRoot(); - if(root instanceof AbstractComponent) { + if (root instanceof AbstractComponent) { return getter.apply((AbstractComponent) root); } return null; diff --git a/server/src/main/java/com/vaadin/ui/MenuBar.java b/server/src/main/java/com/vaadin/ui/MenuBar.java index 39d66bd0b0..35988bb84d 100644 --- a/server/src/main/java/com/vaadin/ui/MenuBar.java +++ b/server/src/main/java/com/vaadin/ui/MenuBar.java @@ -199,8 +199,8 @@ public class MenuBar extends AbstractComponent tmpItem.getCommand().menuSelected(tmpItem); } } - } // if - }// changeVariables + } + } /** * Constructs an empty, horizontal menu @@ -941,7 +941,7 @@ public class MenuBar extends AbstractComponent this.checked = checked; markAsDirty(); } - }// class MenuItem + } @Override public void writeDesign(Element design, DesignContext designContext) { @@ -1091,4 +1091,4 @@ public class MenuBar extends AbstractComponent result.add("html-content-allowed"); return result; } -}// class MenuBar +} diff --git a/server/src/main/java/com/vaadin/ui/Tree.java b/server/src/main/java/com/vaadin/ui/Tree.java index 3858975f06..e54d8e052a 100644 --- a/server/src/main/java/com/vaadin/ui/Tree.java +++ b/server/src/main/java/com/vaadin/ui/Tree.java @@ -235,7 +235,7 @@ public class Tree<T> extends Composite * * @since 8.1 */ - public final static class TreeMultiSelectionModel<T> + public static final class TreeMultiSelectionModel<T> extends MultiSelectionModelImpl<T> { @Override diff --git a/server/src/main/java/com/vaadin/ui/declarative/DesignAttributeHandler.java b/server/src/main/java/com/vaadin/ui/declarative/DesignAttributeHandler.java index 0fbfe9c6b5..cdf0c6aaee 100644 --- a/server/src/main/java/com/vaadin/ui/declarative/DesignAttributeHandler.java +++ b/server/src/main/java/com/vaadin/ui/declarative/DesignAttributeHandler.java @@ -58,10 +58,10 @@ public class DesignAttributeHandler implements Serializable { return Logger.getLogger(DesignAttributeHandler.class.getName()); } - private final static Map<Class<?>, AttributeCacheEntry> cache = new ConcurrentHashMap<>(); + private static final Map<Class<?>, AttributeCacheEntry> cache = new ConcurrentHashMap<>(); // translates string <-> object - private final static DesignFormatter FORMATTER = new DesignFormatter(); + private static final DesignFormatter FORMATTER = new DesignFormatter(); /** * Returns the currently used formatter. All primitive types and all types diff --git a/server/src/main/java/com/vaadin/util/FileTypeResolver.java b/server/src/main/java/com/vaadin/util/FileTypeResolver.java index 4cbac69df5..500e8736e7 100644 --- a/server/src/main/java/com/vaadin/util/FileTypeResolver.java +++ b/server/src/main/java/com/vaadin/util/FileTypeResolver.java @@ -42,13 +42,13 @@ public class FileTypeResolver implements Serializable { /** * Default icon given if no icon is specified for a mime-type. */ - static public Resource DEFAULT_ICON = new ThemeResource( + public static Resource DEFAULT_ICON = new ThemeResource( "../runo/icons/16/document.png"); /** * Default mime-type. */ - static public String DEFAULT_MIME_TYPE = "application/octet-stream"; + public static String DEFAULT_MIME_TYPE = "application/octet-stream"; /** * Initial file extension to mime-type mapping. |