]> source.dussan.org Git - vaadin-framework.git/commitdiff
Improve naming of fields and variables (#10242)
authorAhmed Ashour <asashour@yahoo.com>
Thu, 26 Oct 2017 11:26:20 +0000 (13:26 +0200)
committerPekka Maanpää <pekkamaa@vaadin.com>
Thu, 26 Oct 2017 11:26:20 +0000 (14:26 +0300)
* Variable names to conform to naming convention.

* Use static constants where it makes sense

87 files changed:
client/src/main/java/com/vaadin/client/ApplicationConnection.java
client/src/main/java/com/vaadin/client/DateTimeService.java
client/src/main/java/com/vaadin/client/LayoutManager.java
client/src/main/java/com/vaadin/client/MeasuredSize.java
client/src/main/java/com/vaadin/client/Profiler.java
client/src/main/java/com/vaadin/client/VTooltip.java
client/src/main/java/com/vaadin/client/WidgetUtil.java
client/src/main/java/com/vaadin/client/communication/JsonDecoder.java
client/src/main/java/com/vaadin/client/communication/URLReference_Serializer.java
client/src/main/java/com/vaadin/client/componentlocator/LegacyLocatorStrategy.java
client/src/main/java/com/vaadin/client/debug/internal/VDebugWindow.java
client/src/main/java/com/vaadin/client/event/PointerEventSupport.java
client/src/main/java/com/vaadin/client/extensions/javascriptmanager/JavaScriptManagerConnector.java
client/src/main/java/com/vaadin/client/ui/TouchScrollDelegate.java
client/src/main/java/com/vaadin/client/ui/VAbstractPopupCalendar.java
client/src/main/java/com/vaadin/client/ui/VAudio.java
client/src/main/java/com/vaadin/client/ui/VMenuBar.java
client/src/main/java/com/vaadin/client/ui/VNotification.java
client/src/main/java/com/vaadin/client/ui/VSlider.java
client/src/main/java/com/vaadin/client/ui/VTabsheet.java
client/src/main/java/com/vaadin/client/ui/VUI.java
client/src/main/java/com/vaadin/client/ui/VWindow.java
client/src/main/java/com/vaadin/client/ui/formlayout/FormLayoutConnector.java
client/src/main/java/com/vaadin/client/ui/popupview/VisibilityChangeEvent.java
client/src/main/java/com/vaadin/client/ui/richtextarea/VRichTextToolbar.java
client/src/main/java/com/vaadin/client/widget/escalator/ScrollbarBundle.java
client/src/main/java/com/vaadin/client/widget/grid/datasources/ListSorter.java
client/src/main/java/com/vaadin/client/widget/grid/selection/SelectionEvent.java
client/src/main/java/com/vaadin/client/widgets/Grid.java
compatibility-client/src/main/java/com/vaadin/v7/client/ui/VCalendar.java
compatibility-client/src/main/java/com/vaadin/v7/client/ui/VPopupCalendar.java
compatibility-client/src/main/java/com/vaadin/v7/client/ui/VScrollTable.java
compatibility-client/src/main/java/com/vaadin/v7/client/ui/VSlider.java
compatibility-client/src/main/java/com/vaadin/v7/client/ui/VTextualDate.java
compatibility-client/src/main/java/com/vaadin/v7/client/ui/VTree.java
compatibility-client/src/main/java/com/vaadin/v7/client/ui/calendar/VCalendarAction.java
compatibility-client/src/main/java/com/vaadin/v7/client/ui/calendar/schedule/CalendarEvent.java
compatibility-client/src/main/java/com/vaadin/v7/client/ui/calendar/schedule/DateCellDayEvent.java
compatibility-client/src/main/java/com/vaadin/v7/client/ui/calendar/schedule/DateUtil.java
compatibility-client/src/main/java/com/vaadin/v7/client/ui/calendar/schedule/DayToolbar.java
compatibility-client/src/main/java/com/vaadin/v7/client/ui/calendar/schedule/SimpleDayCell.java
compatibility-client/src/main/java/com/vaadin/v7/client/ui/calendar/schedule/WeekGrid.java
compatibility-client/src/main/java/com/vaadin/v7/client/ui/richtextarea/VRichTextToolbar.java
compatibility-client/src/main/java/com/vaadin/v7/client/widget/escalator/ScrollbarBundle.java
compatibility-client/src/main/java/com/vaadin/v7/client/widget/grid/datasources/ListSorter.java
compatibility-client/src/main/java/com/vaadin/v7/client/widget/grid/selection/SelectionEvent.java
compatibility-client/src/main/java/com/vaadin/v7/client/widgets/Escalator.java
compatibility-client/src/main/java/com/vaadin/v7/client/widgets/Grid.java
compatibility-server/src/main/java/com/vaadin/v7/data/util/converter/DefaultConverterFactory.java
compatibility-server/src/main/java/com/vaadin/v7/ui/AbstractTextField.java
compatibility-server/src/main/java/com/vaadin/v7/ui/DefaultFieldFactory.java
compatibility-server/src/main/java/com/vaadin/v7/ui/Upload.java
compatibility-server/src/main/java/com/vaadin/v7/ui/components/colorpicker/ColorPickerGrid.java
compatibility-server/src/main/java/com/vaadin/v7/ui/components/colorpicker/ColorPickerHistory.java
compatibility-server/src/main/java/com/vaadin/v7/ui/components/colorpicker/ColorPickerPopup.java
compatibility-server/src/main/java/com/vaadin/v7/util/SerializerHelper.java
compatibility-shared/src/main/java/com/vaadin/v7/shared/ui/colorpicker/Color.java
server/src/main/java/com/vaadin/data/BeanPropertySet.java
server/src/main/java/com/vaadin/event/dd/acceptcriteria/AcceptAll.java
server/src/main/java/com/vaadin/event/dd/acceptcriteria/SourceIsTarget.java
server/src/main/java/com/vaadin/server/AbstractClientConnector.java
server/src/main/java/com/vaadin/server/ComponentSizeValidator.java
server/src/main/java/com/vaadin/server/DefaultSystemMessagesProvider.java
server/src/main/java/com/vaadin/server/GlobalResourceHandler.java
server/src/main/java/com/vaadin/server/JsonCodec.java
server/src/main/java/com/vaadin/server/LegacyCommunicationManager.java
server/src/main/java/com/vaadin/server/LegacyVaadinPortlet.java
server/src/main/java/com/vaadin/server/LegacyVaadinServlet.java
server/src/main/java/com/vaadin/server/LocaleService.java
server/src/main/java/com/vaadin/server/ServerRpcManager.java
server/src/main/java/com/vaadin/server/ServerRpcMethodInvocation.java
server/src/main/java/com/vaadin/server/SizeWithUnit.java
server/src/main/java/com/vaadin/server/StreamResource.java
server/src/main/java/com/vaadin/server/widgetsetutils/ClassPathExplorer.java
server/src/main/java/com/vaadin/ui/AbstractComponent.java
server/src/main/java/com/vaadin/ui/Upload.java
server/src/main/java/com/vaadin/ui/declarative/DesignAttributeHandler.java
server/src/main/java/com/vaadin/ui/declarative/converters/DesignResourceConverter.java
server/src/main/java/com/vaadin/util/CurrentInstance.java
server/src/main/java/com/vaadin/util/FileTypeResolver.java
server/src/main/java/com/vaadin/util/TimeZoneUtil.java
server/src/test/java/com/vaadin/data/BeanPropertySetTest.java
server/src/test/java/com/vaadin/server/AbstractClientConnectorTest.java
server/src/test/java/com/vaadin/util/CurrentInstanceTest.java
shared/src/main/java/com/vaadin/shared/communication/URLReference.java
shared/src/main/java/com/vaadin/shared/ui/colorpicker/Color.java
testbench-api/src/main/java/com/vaadin/testbench/elements/AbstractComponentElement.java

index d9e8f545d2da61ae2ecdd7ca1424e4e2de8bbec5..3cd25903110e99b19158516453277fba69394eaa 100644 (file)
@@ -481,7 +481,7 @@ public class ApplicationConnection implements HasHandlers {
     }
 
     private native void initializeTestbenchHooks(
-            ComponentLocator componentLocator, String TTAppId)
+            ComponentLocator componentLocator, String ttAppId)
     /*-{
         var ap = this;
         var client = {};
@@ -527,7 +527,7 @@ public class ApplicationConnection implements HasHandlers {
         });
         client.initializing = false;
 
-        $wnd.vaadin.clients[TTAppId] = client;
+        $wnd.vaadin.clients[ttAppId] = client;
     }-*/;
 
     /**
index 3c37c40b34ef32faa7285384b1b4862e4d256c28..4883d34caf4414f472ce3834ca825b039267d71c 100644 (file)
@@ -40,6 +40,8 @@ public class DateTimeService {
     private static int[] maxDaysInMonth = { 31, 28, 31, 30, 31, 30, 31, 31, 30,
             31, 30, 31 };
 
+    private static final long MILLISECONDS_PER_DAY = 24 * 3600 * 1000;
+
     /**
      * Creates a new date time service with the application default locale.
      */
@@ -286,7 +288,6 @@ public class DateTimeService {
      * @return The ISO-8601 week number for {@literal date}
      */
     public static int getISOWeekNumber(Date date) {
-        final long MILLISECONDS_PER_DAY = 24 * 3600 * 1000;
         int dayOfWeek = date.getDay(); // 0 == sunday
 
         // ISO 8601 use weeks that start on monday so we use
index 117154f9def3e2f672f4e753f59f454210cfddd0..5a161e4bc92267da7a02e64d609d3f578886bae1 100644 (file)
@@ -43,7 +43,7 @@ public class LayoutManager {
 
     private static final String LOOP_ABORT_MESSAGE = "Aborting layout after 100 passes. This would probably be an infinite loop.";
 
-    private static final boolean debugLogging = false;
+    private static final boolean DEBUG_LOGGING = false;
 
     private ApplicationConnection connection;
     private final Set<Element> measuredNonConnectorElements = new HashSet<>();
@@ -457,7 +457,7 @@ public class LayoutManager {
                         }
                         countLayout(layoutCounts, rr);
                     }
-                    if (debugLogging) {
+                    if (DEBUG_LOGGING) {
                         updatedSet.add(layout.getConnectorId());
                     }
                 }
@@ -517,7 +517,7 @@ public class LayoutManager {
                         }
                         countLayout(layoutCounts, rr);
                     }
-                    if (debugLogging) {
+                    if (DEBUG_LOGGING) {
                         updatedSet.add(layout.getConnectorId());
                     }
                 }
@@ -525,7 +525,7 @@ public class LayoutManager {
 
             Profiler.leave("LayoutManager handle ManagedLayout");
 
-            if (debugLogging) {
+            if (DEBUG_LOGGING) {
                 JsArrayString changedCids = updatedSet.dump();
 
                 StringBuilder b = new StringBuilder("  ");
@@ -637,7 +637,7 @@ public class LayoutManager {
                     continue;
                 }
 
-                if (debugLogging) {
+                if (DEBUG_LOGGING) {
                     getLogger().info("Doing overflow fix for "
                             + Util.getConnectorString(componentConnector)
                             + " in " + Util.getConnectorString(
index 1fcdb9d17afad884e54988c060701d80f0760374..bf9b64602bd242d2712e490b2f1845f2ed4bc65b 100644 (file)
@@ -21,7 +21,7 @@ import com.google.gwt.core.client.JsArrayString;
 import com.google.gwt.dom.client.Element;
 
 public class MeasuredSize {
-    private static final boolean debugSizeChanges = false;
+    private static final boolean DEBUG_SIZE_CHANGES = false;
 
     public static class MeasureResult {
         private final boolean widthChanged;
@@ -278,7 +278,7 @@ public class MeasuredSize {
 
     private void debugSizeChange(Element element, String sizeChangeType,
             String changedFrom, String changedTo) {
-        if (debugSizeChanges) {
+        if (DEBUG_SIZE_CHANGES) {
             getLogger().info(sizeChangeType + " has changed from " + changedFrom
                     + " to " + changedTo + " for " + element);
         }
index 1b445ff2e4ea8835c4e184b43daf0d4b0100d23d..e9e75a69227d0df11a1e79e30e2f737837395571 100644 (file)
@@ -47,7 +47,7 @@ public class Profiler {
 
     private static RelativeTimeSupplier RELATIVE_TIME_SUPPLIER;
 
-    private static final String evtGroup = "VaadinProfiler";
+    private static final String EVT_GROUP = "VaadinProfiler";
 
     private static ProfilerResultConsumer consumer;
 
@@ -290,7 +290,7 @@ public class Profiler {
 
         private native String getEvtGroup()
         /*-{
-            return this.evtGroup;
+            return this.EVT_GROUP;
         }-*/;
 
         private native double getMillis()
@@ -325,7 +325,7 @@ public class Profiler {
 
         public final String getEventName() {
             String group = getEvtGroup();
-            if (evtGroup.equals(group)) {
+            if (EVT_GROUP.equals(group)) {
                 return getSubSystem();
             } else {
                 return group + "." + getSubSystem();
@@ -387,7 +387,7 @@ public class Profiler {
     private static final native void logGwtEvent(String name, String type)
     /*-{
         $wnd.__gwtStatsEvent({
-            evtGroup: @com.vaadin.client.Profiler::evtGroup,
+            evtGroup: @com.vaadin.client.Profiler::EVT_GROUP,
             moduleName: @com.google.gwt.core.client.GWT::getModuleName()(),
             millis: (new Date).getTime(),
             sessionId: undefined,
@@ -463,7 +463,7 @@ public class Profiler {
         Set<Node> extendedTimeNodes = new HashSet<>();
         for (int i = 0; i < gwtStatsEvents.length(); i++) {
             GwtStatsEvent gwtStatsEvent = gwtStatsEvents.get(i);
-            if (!evtGroup.equals(gwtStatsEvent.getEvtGroup())) {
+            if (!EVT_GROUP.equals(gwtStatsEvent.getEvtGroup())) {
                 // Only log our own events to avoid problems with events which
                 // are not of type start+end
                 continue;
index b0108dff64e308d2202e67228f1ef073ab3e37f4..399497bea17debf97d9ecf463b6c4dc897cb2313 100644 (file)
@@ -56,6 +56,8 @@ public class VTooltip extends VOverlay {
     private static final int MARGIN = 4;
     public static final int TOOLTIP_EVENTS = Event.ONKEYDOWN | Event.ONMOUSEOVER
             | Event.ONMOUSEOUT | Event.ONMOUSEMOVE | Event.ONCLICK;
+    private static final int EVENT_XY_POSITION_OUTSIDE = -5000;
+
     VErrorMessage em = new VErrorMessage();
     HTML description = GWT.create(HTML.class);
 
@@ -81,6 +83,9 @@ public class VTooltip extends VOverlay {
      */
     private com.google.gwt.dom.client.Element currentElement = null;
 
+    private int tooltipEventMouseX;
+    private int tooltipEventMouseY;
+
     /**
      * Used to show tooltips; usually used via the singleton in
      * {@link ApplicationConnection}. NOTE that #setOwner(Widget)} should be
@@ -471,10 +476,6 @@ public class VTooltip extends VOverlay {
         setPopupPosition(tooltipEventMouseX, tooltipEventMouseY);
     }
 
-    private int EVENT_XY_POSITION_OUTSIDE = -5000;
-    private int tooltipEventMouseX;
-    private int tooltipEventMouseY;
-
     public void updatePosition(Event event, boolean isFocused) {
         tooltipEventMouseX = getEventX(event, isFocused);
         tooltipEventMouseY = getEventY(event, isFocused);
index d9061321caa1f7441b44c5f8f345d91d3f5fa5f9..3841592704d33a9547b014082c7cce2a9a5cf7bf 100644 (file)
@@ -131,7 +131,7 @@ public class WidgetUtil {
         }
     }
 
-    private static final Element escapeHtmlHelper = DOM.createDiv();
+    private static final Element ESCAPE_HTML_HELPER = DOM.createDiv();
 
     /**
      * Converts html entities to text.
@@ -140,8 +140,8 @@ public class WidgetUtil {
      * @return escaped string presentation of given html
      */
     public static String escapeHTML(String html) {
-        DOM.setInnerText(escapeHtmlHelper, html);
-        String escapedText = DOM.getInnerHTML(escapeHtmlHelper);
+        DOM.setInnerText(ESCAPE_HTML_HELPER, html);
+        String escapedText = DOM.getInnerHTML(ESCAPE_HTML_HELPER);
         return escapedText;
     }
 
@@ -1460,7 +1460,7 @@ public class WidgetUtil {
         /*
          * Regex to parse the size.
          */
-        private static final RegExp sizePattern = RegExp
+        private static final RegExp SIZE_PATTERN = RegExp
                 .compile(SharedUtil.SIZE_PATTERN);
 
         /**
@@ -1483,7 +1483,7 @@ public class WidgetUtil {
             float size = 0;
             Unit unit = null;
 
-            MatchResult matcher = sizePattern.exec(s);
+            MatchResult matcher = SIZE_PATTERN.exec(s);
             if (matcher.getGroupCount() > 1) {
 
                 size = Float.parseFloat(matcher.getGroup(1));
@@ -1498,7 +1498,7 @@ public class WidgetUtil {
             } else {
                 throw new IllegalArgumentException(
                         "Invalid size argument: \"" + s + "\" (should match "
-                                + sizePattern.getSource() + ")");
+                                + SIZE_PATTERN.getSource() + ")");
             }
             return new CssSize(size, unit);
         }
index 9a0eb6098399469d2dcd25942eaa140d0bddbf29..6e1d9c28d60875eacc9c7c005dca4f5bef5ce1d8 100644 (file)
@@ -52,22 +52,22 @@ import elemental.json.JsonValue;
  */
 public class JsonDecoder {
 
-    private static final FastStringSet decodedWithoutReference = FastStringSet
+    private static final FastStringSet DECODED_WITHOUT_REFERENCE = FastStringSet
             .create();
     static {
-        decodedWithoutReference.add(String.class.getName());
-        decodedWithoutReference.add(Boolean.class.getName());
-        decodedWithoutReference.add(Byte.class.getName());
-        decodedWithoutReference.add(Character.class.getName());
-        decodedWithoutReference.add(Short.class.getName());
-        decodedWithoutReference.add(Integer.class.getName());
-        decodedWithoutReference.add(Long.class.getName());
-        decodedWithoutReference.add(Float.class.getName());
-        decodedWithoutReference.add(Double.class.getName());
-        decodedWithoutReference.add(Connector.class.getName());
-        decodedWithoutReference.add(Map.class.getName());
-        decodedWithoutReference.add(List.class.getName());
-        decodedWithoutReference.add(Set.class.getName());
+        DECODED_WITHOUT_REFERENCE.add(String.class.getName());
+        DECODED_WITHOUT_REFERENCE.add(Boolean.class.getName());
+        DECODED_WITHOUT_REFERENCE.add(Byte.class.getName());
+        DECODED_WITHOUT_REFERENCE.add(Character.class.getName());
+        DECODED_WITHOUT_REFERENCE.add(Short.class.getName());
+        DECODED_WITHOUT_REFERENCE.add(Integer.class.getName());
+        DECODED_WITHOUT_REFERENCE.add(Long.class.getName());
+        DECODED_WITHOUT_REFERENCE.add(Float.class.getName());
+        DECODED_WITHOUT_REFERENCE.add(Double.class.getName());
+        DECODED_WITHOUT_REFERENCE.add(Connector.class.getName());
+        DECODED_WITHOUT_REFERENCE.add(Map.class.getName());
+        DECODED_WITHOUT_REFERENCE.add(List.class.getName());
+        DECODED_WITHOUT_REFERENCE.add(Set.class.getName());
     }
 
     /**
@@ -193,7 +193,7 @@ public class JsonDecoder {
     }
 
     private static boolean needsReferenceValue(Type type) {
-        return !decodedWithoutReference.contains(type.getBaseTypeName());
+        return !DECODED_WITHOUT_REFERENCE.contains(type.getBaseTypeName());
     }
 
     private static Map<Object, Object> decodeMap(Type type, JsonValue jsonMap,
index cc6d7411838c1e714d693cf66824d8e3bf58bdbe..d691bfeac53fe399946691fb435f293c992f93c6 100644 (file)
@@ -38,10 +38,10 @@ public class URLReference_Serializer implements JSONSerializer<URLReference> {
         JsonObject json = (JsonObject) jsonValue;
         if (json.hasKey(URL_FIELD)) {
             JsonValue jsonURL = json.get(URL_FIELD);
-            String URL = (String) JsonDecoder.decodeValue(
+            String url = (String) JsonDecoder.decodeValue(
                     new Type(String.class.getName(), null), jsonURL, null,
                     connection);
-            reference.setURL(URL);
+            reference.setURL(url);
         }
         return reference;
     }
index d2c818f2f5a198b8cef3c25a53dedd412b8d77ca..e775793e6f7e2cc1e50c76686cc25df3fd96f9d8 100644 (file)
@@ -74,7 +74,7 @@ public class LegacyLocatorStrategy implements LocatorStrategy {
 
     private final ApplicationConnection client;
 
-    private static final RegExp validSyntax = RegExp.compile(
+    private static final RegExp VALID_SYNTAX = RegExp.compile(
             "^((\\w+::)?((PID_S)?\\w[-$_a-zA-Z0-9.' ]*)?)?(/[-$_a-zA-Z0-9]+\\[\\d+\\])*/?(#.*)?$");
 
     public LegacyLocatorStrategy(ApplicationConnection clientConnection) {
@@ -83,7 +83,7 @@ public class LegacyLocatorStrategy implements LocatorStrategy {
 
     @Override
     public boolean validatePath(String path) {
-        return validSyntax.test(path);
+        return VALID_SYNTAX.test(path);
     }
 
     @Override
index 7ac67d349a4c1fc7df5d31a293b710460a3853e8..bfb4ca04ffb90fb5e7aab193731a971641b38393 100644 (file)
@@ -111,8 +111,8 @@ public final class VDebugWindow extends VOverlay {
     protected int fontSize = 1; // 0-2
 
     // Timers since application start, and last timer reset
-    private static final Duration start = new Duration();
-    private static Duration lastReset = start;
+    private static final Duration START = new Duration();
+    private static Duration lastReset = START;
 
     // outer panel
     protected FlowPanel window = new FlowPanel();
@@ -637,7 +637,7 @@ public final class VDebugWindow extends VOverlay {
      * @return
      */
     static int getMillisSinceStart() {
-        return start.elapsedMillis();
+        return START.elapsedMillis();
     }
 
     /**
index 1a9fefd703eaedfc332d9fe9d741f94e3c609066..9386e4612e37142a0fe24dc4d2ee7b6482c68a0a 100644 (file)
@@ -27,14 +27,14 @@ import com.vaadin.client.event.PointerEvent.EventType;
  */
 public class PointerEventSupport {
 
-    private static final PointerEventSupportImpl impl = GWT
+    private static final PointerEventSupportImpl IMPL = GWT
             .create(PointerEventSupportImpl.class);
 
     private PointerEventSupport() {
     }
 
     public static void init() {
-        impl.init();
+        IMPL.init();
     }
 
     /**
@@ -42,7 +42,7 @@ public class PointerEventSupport {
      *         otherwise
      */
     public static boolean isSupported() {
-        return impl.isSupported();
+        return IMPL.isSupported();
     }
 
     /**
@@ -50,6 +50,6 @@ public class PointerEventSupport {
      * @return the native event name of the given event
      */
     public static String getNativeEventName(EventType eventType) {
-        return impl.getNativeEventName(eventType);
+        return IMPL.getNativeEventName(eventType);
     }
 }
index 1fc86201bdf07e60637b93b6de832dd45b095951..4381caddd008edfedc5cc82757e2711d6165b3ae 100644 (file)
@@ -40,8 +40,8 @@ public class JavaScriptManagerConnector extends AbstractExtensionConnector {
     protected void init() {
         registerRpc(ExecuteJavaScriptRpc.class, new ExecuteJavaScriptRpc() {
             @Override
-            public void executeJavaScript(String Script) {
-                eval(Script);
+            public void executeJavaScript(String script) {
+                eval(script);
             }
         });
     }
index af8f918a4af6d1d6114592d229c9eae2f2140530..185b93c8a8be276e70d29a824c260f3efbd9bcb2 100644 (file)
@@ -101,7 +101,7 @@ public class TouchScrollDelegate implements NativePreviewHandler {
 
     private static TouchScrollDelegate activeScrollDelegate;
 
-    private static final boolean androidWithBrokenScrollTop = BrowserInfo.get()
+    private static final boolean ANDROID_WITH_BROKEN_SCROLL_TOP = BrowserInfo.get()
             .isAndroidWithBrokenScrollTop();
 
     /**
@@ -330,7 +330,7 @@ public class TouchScrollDelegate implements NativePreviewHandler {
     }
 
     private int getScrollTop() {
-        if (androidWithBrokenScrollTop) {
+        if (ANDROID_WITH_BROKEN_SCROLL_TOP) {
             if (scrolledElement.getPropertyJSO("_vScrollTop") != null) {
                 return scrolledElement.getPropertyInt("_vScrollTop");
             }
@@ -360,7 +360,7 @@ public class TouchScrollDelegate implements NativePreviewHandler {
         VConsole.log("Animate " + time + " " + from + " " + to);
         int translateTo = -to + origScrollTop;
         int fromY = -from + origScrollTop;
-        if (androidWithBrokenScrollTop) {
+        if (ANDROID_WITH_BROKEN_SCROLL_TOP) {
             fromY -= origScrollTop;
             translateTo -= origScrollTop;
         }
@@ -380,7 +380,7 @@ public class TouchScrollDelegate implements NativePreviewHandler {
      * scrolltop, causing onscroll event.
      */
     private void moveTransformationToScrolloffset() {
-        if (androidWithBrokenScrollTop) {
+        if (ANDROID_WITH_BROKEN_SCROLL_TOP) {
             scrolledElement.setPropertyInt("_vScrollTop", finalScrollTop);
             if (scrollHandler != null) {
                 scrollHandler.onScroll(null);
@@ -465,7 +465,7 @@ public class TouchScrollDelegate implements NativePreviewHandler {
 
     private void quickSetScrollPosition(int deltaX, int deltaY) {
         deltaScrollPos = deltaY;
-        if (androidWithBrokenScrollTop) {
+        if (ANDROID_WITH_BROKEN_SCROLL_TOP) {
             deltaY += origScrollTop;
             translateTo(-deltaY);
         } else {
@@ -570,7 +570,7 @@ public class TouchScrollDelegate implements NativePreviewHandler {
 
         int translateTo = -finalY + origScrollTop;
         int fromY = -currentY + origScrollTop;
-        if (androidWithBrokenScrollTop) {
+        if (ANDROID_WITH_BROKEN_SCROLL_TOP) {
             fromY -= origScrollTop;
             translateTo -= origScrollTop;
         }
@@ -652,7 +652,7 @@ public class TouchScrollDelegate implements NativePreviewHandler {
     }
 
     private int getMaxOverScroll() {
-        return androidWithBrokenScrollTop ? 0
+        return ANDROID_WITH_BROKEN_SCROLL_TOP ? 0
                 : scrolledElement.getClientHeight() / 3;
     }
 
index 18d8dbdfee035e29a49e78845043766a3da43e39..70ada4d70e4ae9ec55510ee7be5fb92d3b1571ad 100644 (file)
@@ -98,7 +98,7 @@ public abstract class VAbstractPopupCalendar<PANEL extends VAbstractCalendarPane
 
     private Element descriptionForAssistiveDevicesElement;
 
-    private final String CALENDAR_TOGGLE_ID = "popupButton";
+    private static final String CALENDAR_TOGGLE_ID = "popupButton";
 
     public VAbstractPopupCalendar(PANEL calendarPanel, R resolution) {
         super(resolution);
index cf80c80e373a2c72f65524d7b1612f9a8192e2d9..31e316506672779a6268574208640ac86be2b97c 100644 (file)
@@ -20,7 +20,7 @@ import com.google.gwt.dom.client.AudioElement;
 import com.google.gwt.dom.client.Document;
 
 public class VAudio extends VMediaBase {
-    private static String CLASSNAME = "v-audio";
+    private static final String CLASSNAME = "v-audio";
 
     private AudioElement audio;
 
index 607128c43c6639c2510c41659e4a336de6a538b1..5ee7cb0860089ee3e8f5e421ff7f2271b88618da 100644 (file)
@@ -505,7 +505,7 @@ public class VMenuBar extends SimpleFocusablePanel
      * root menus on mouse hover.
      */
     private static class LazyCloser extends Timer {
-        static LazyCloser INSTANCE;
+        static LazyCloser instance;
         private VMenuBar activeRoot;
 
         @Override
@@ -517,27 +517,27 @@ public class VMenuBar extends SimpleFocusablePanel
         }
 
         public static void cancelClosing() {
-            if (INSTANCE != null) {
-                INSTANCE.cancel();
+            if (instance != null) {
+                instance.cancel();
             }
         }
 
         public static void prepare(VMenuBar vMenuBar) {
-            if (INSTANCE == null) {
-                INSTANCE = new LazyCloser();
+            if (instance == null) {
+                instance = new LazyCloser();
             }
-            if (INSTANCE.activeRoot == vMenuBar) {
-                INSTANCE.cancel();
-            } else if (INSTANCE.activeRoot != null) {
-                INSTANCE.cancel();
-                INSTANCE.run();
+            if (instance.activeRoot == vMenuBar) {
+                instance.cancel();
+            } else if (instance.activeRoot != null) {
+                instance.cancel();
+                instance.run();
             }
-            INSTANCE.activeRoot = vMenuBar;
+            instance.activeRoot = vMenuBar;
         }
 
         public static void schedule() {
-            if (INSTANCE != null && INSTANCE.activeRoot != null) {
-                INSTANCE.schedule(750);
+            if (instance != null && instance.activeRoot != null) {
+                instance.schedule(750);
             }
         }
 
@@ -1587,7 +1587,7 @@ public class VMenuBar extends SimpleFocusablePanel
 
     }
 
-    private final String SUBPART_PREFIX = "item";
+    private static final String SUBPART_PREFIX = "item";
 
     @Override
     public com.google.gwt.user.client.Element getSubPartElement(
index 7cc47d90f1ec7aa257efc98a977a08b9220946ae..37255ff4bbb5ed592afa07f41d4018a0c5d22b7e 100644 (file)
@@ -75,11 +75,11 @@ public class VNotification extends VOverlay {
     public static final int DELAY_NONE = 0;
 
     private static final String STYLENAME = "v-Notification";
-    private static final int mouseMoveThreshold = 7;
+    private static final int MOUSE_MOVE_THRESHOLD = 7;
     private static final int Z_INDEX_BASE = 20000;
     public static final String STYLE_SYSTEM = "system";
 
-    private static final List<VNotification> notifications = new ArrayList<>();
+    private static final List<VNotification> NOTIFICATIONS = new ArrayList<>();
 
     private boolean infiniteDelay = false;
     private int hideDelay = 0;
@@ -254,7 +254,7 @@ public class VNotification extends VOverlay {
         setPosition(position);
         super.show();
         updatePositionOffsets(position);
-        notifications.add(this);
+        NOTIFICATIONS.add(this);
         positionOrSizeUpdated();
         /**
          * Android 4 fails to render notifications correctly without a little
@@ -288,7 +288,7 @@ public class VNotification extends VOverlay {
             delay.cancel();
         }
         // Run only once
-        if (notifications.contains(this)) {
+        if (NOTIFICATIONS.contains(this)) {
             DOM.removeEventPreview(this);
 
             // Still animating in, wait for it to finish before touching
@@ -310,7 +310,7 @@ public class VNotification extends VOverlay {
             } else {
                 VNotification.super.hide();
                 fireEvent(new HideEvent(this));
-                notifications.remove(this);
+                NOTIFICATIONS.remove(this);
             }
         }
     }
@@ -433,9 +433,9 @@ public class VNotification extends VOverlay {
                 x = DOM.eventGetClientX(event);
                 y = DOM.eventGetClientY(event);
             } else if (Math
-                    .abs(DOM.eventGetClientX(event) - x) > mouseMoveThreshold
+                    .abs(DOM.eventGetClientX(event) - x) > MOUSE_MOVE_THRESHOLD
                     || Math.abs(DOM.eventGetClientY(event)
-                            - y) > mouseMoveThreshold) {
+                            - y) > MOUSE_MOVE_THRESHOLD) {
                 hideAfterDelay();
             }
             break;
@@ -592,7 +592,7 @@ public class VNotification extends VOverlay {
      * TODO Should this be a generic Overlay feature instead?
      */
     public static void bringNotificationsToFront() {
-        for (VNotification notification : notifications) {
+        for (VNotification notification : NOTIFICATIONS) {
             DOM.removeEventPreview(notification);
             DOM.addEventPreview(notification);
         }
index 22c681d5c2eab41adf8dd3ad6dd0f5b352a3edd2..ec4167f9fad1dea5d1989474f8b77a0ef81b409c 100644 (file)
@@ -75,7 +75,7 @@ public class VSlider extends SimpleFocusablePanel
 
     /* DOM element for slider's base */
     private final Element base;
-    private final int BASE_BORDER_WIDTH = 1;
+    private static final int BASE_BORDER_WIDTH = 1;
 
     /* DOM element for slider's handle */
     private final Element handle;
index c2cbd626e8d10f96db084cfd861438833c2c89ff..e7da3891133363e48f4c23b8b5c1f66e1268411c 100644 (file)
@@ -185,7 +185,7 @@ public class VTabsheet extends VTabsheetBase
 
             setStyleName(td, TD_DISABLED_CLASSNAME, !enabled);
             if (!enabled) {
-                focusImpl.setTabIndex(td, -1);
+                FOCUS_IMPL.setTabIndex(td, -1);
             }
         }
 
@@ -297,11 +297,11 @@ public class VTabsheet extends VTabsheetBase
 
         public void focus() {
             getTabsheet().scrollIntoView(this);
-            focusImpl.focus(td);
+            FOCUS_IMPL.focus(td);
         }
 
         public void blur() {
-            focusImpl.blur(td);
+            FOCUS_IMPL.blur(td);
         }
 
         public boolean hasTooltip() {
@@ -739,6 +739,9 @@ public class VTabsheet extends VTabsheetBase
     public static final String TABS_CLASSNAME = CLASSNAME + "-tabcontainer";
     public static final String SCROLLER_CLASSNAME = CLASSNAME + "-scroller";
 
+    private static final FocusImpl FOCUS_IMPL = FocusImpl
+            .getFocusImplForPanel();
+
     /** For internal use only. May be removed or replaced in the future. */
     // tabbar and 'scroller' container
     public final Element tabs;
@@ -749,8 +752,6 @@ public class VTabsheet extends VTabsheetBase
      */
     int tabulatorIndex = 0;
 
-    private static final FocusImpl focusImpl = FocusImpl.getFocusImplForPanel();
-
     // tab-scroller element
     private final Element scroller;
     // tab-scroller next button element
index 6e3ffd716fe521fa57c96b12db337979e41c4791..6ee44aa93068edd521b4f0ba373ea40af89b0f74 100644 (file)
@@ -50,7 +50,7 @@ public class VUI extends SimplePanel implements ResizeHandler,
         com.google.gwt.user.client.ui.Focusable, HasResizeHandlers,
         HasScrollHandlers {
 
-    private static int MONITOR_PARENT_TIMER_INTERVAL = 1000;
+    private static final int MONITOR_PARENT_TIMER_INTERVAL = 1000;
 
     /** For internal use only. May be removed or replaced in the future. */
     public String id;
index 8ac90386c756278dba296fc0901e3df4e1e6179f..b27c803b75f98f667bfeea6ca0f95ad61cb3e258 100644 (file)
@@ -81,7 +81,7 @@ public class VWindow extends VOverlay implements ShortcutActionHandlerOwner,
 
     private static List<VWindow> windowOrder = new ArrayList<>();
 
-    private static HandlerManager WINDOW_ORDER_HANDLER = new HandlerManager(
+    private static final HandlerManager WINDOW_ORDER_HANDLER = new HandlerManager(
             VWindow.class);
 
     private static boolean orderingDefered;
index ea9fd57c2692f6b96ed9eb6238f4c27edd27c97e..857d4e07b35e274de1171df9e1c0271b26c0b9e6 100644 (file)
@@ -70,7 +70,7 @@ public class FormLayoutConnector extends AbstractLayoutConnector
 
     private Map<ComponentConnector, String> oldMaxWidths = null;
 
-    private static final ElementResizeListener dummyFirstCellResizeListener = new ElementResizeListener() {
+    private static final ElementResizeListener DUMMY_FIRST_CELL_RESIZE_LISTENER = new ElementResizeListener() {
         @Override
         public void onElementResize(ElementResizeEvent e) {
             // Ignore event, listener added just to make measurements available
@@ -220,7 +220,7 @@ public class FormLayoutConnector extends AbstractLayoutConnector
         Element td = findFirstComponentTd();
         if (td != null) {
             getLayoutManager().addElementResizeListener(td,
-                    dummyFirstCellResizeListener);
+                    DUMMY_FIRST_CELL_RESIZE_LISTENER);
         }
     }
 
@@ -228,7 +228,7 @@ public class FormLayoutConnector extends AbstractLayoutConnector
         Element td = findFirstComponentTd();
         if (td != null) {
             getLayoutManager().removeElementResizeListener(td,
-                    dummyFirstCellResizeListener);
+                    DUMMY_FIRST_CELL_RESIZE_LISTENER);
         }
     }
 
index 06380eef28a2c9a0e1b23c203914a8a2125f7d6b..02eee0804eb36a367301291d4aaf93eb01ef8c18 100644 (file)
@@ -19,7 +19,7 @@ import com.google.gwt.event.shared.GwtEvent;
 
 public class VisibilityChangeEvent extends GwtEvent<VisibilityChangeHandler> {
 
-    private static Type<VisibilityChangeHandler> TYPE;
+    private static Type<VisibilityChangeHandler> type;
 
     private boolean visible;
 
@@ -37,10 +37,10 @@ public class VisibilityChangeEvent extends GwtEvent<VisibilityChangeHandler> {
     }
 
     public static Type<VisibilityChangeHandler> getType() {
-        if (TYPE == null) {
-            TYPE = new Type<>();
+        if (type == null) {
+            type = new Type<>();
         }
-        return TYPE;
+        return type;
     }
 
     @Override
index d235ddeca39eb0cd4e6e1e5c3820ec75b405c1eb..f3ebb34d7f8e2c544437ec6d5d9f295089cf4d61 100644 (file)
@@ -201,7 +201,7 @@ public class VRichTextToolbar extends Composite {
                 fonts.setSelectedIndex(0);
             } else if (sender == fontSizes) {
                 basic.setFontSize(
-                        fontSizesConstants[fontSizes.getSelectedIndex() - 1]);
+                        FONT_SIZES_CONSTANTS[fontSizes.getSelectedIndex() - 1]);
                 fontSizes.setSelectedIndex(0);
             }
         }
@@ -275,7 +275,7 @@ public class VRichTextToolbar extends Composite {
         }
     }
 
-    private static final RichTextArea.FontSize[] fontSizesConstants = {
+    private static final RichTextArea.FontSize[] FONT_SIZES_CONSTANTS = {
             RichTextArea.FontSize.XX_SMALL, RichTextArea.FontSize.X_SMALL,
             RichTextArea.FontSize.SMALL, RichTextArea.FontSize.MEDIUM,
             RichTextArea.FontSize.LARGE, RichTextArea.FontSize.X_LARGE,
index bb1686ae8389abd220b12899c3c48f9f8a9554d9..c979325f7e9dba19128b47ff9d874b7e0854d390 100644 (file)
@@ -50,7 +50,7 @@ import com.vaadin.client.widget.grid.events.ScrollHandler;
  */
 public abstract class ScrollbarBundle implements DeferredWorker {
 
-    private static final boolean supportsRequestAnimationFrame = new AnimationSupportDetector()
+    private static final boolean SUPPORTS_REQUEST_ANIMATION_FRAME = new AnimationSupportDetector()
             .isNativelySupported();
 
     private class ScrollEventFirer {
@@ -92,7 +92,7 @@ public abstract class ScrollbarBundle implements DeferredWorker {
                  * We'll gather all the scroll events, and only fire once, once
                  * everything has calmed down.
                  */
-                if (supportsRequestAnimationFrame) {
+                if (SUPPORTS_REQUEST_ANIMATION_FRAME) {
                     // Chrome MUST use this as deferred commands will sometimes
                     // be run with a 300+ ms delay when scrolling.
                     AnimationScheduler.get().requestAnimationFrame(
index 07fc05622b720c173bf29a6003e08006c6f60b6e..d5f3e2452838043f81f64345eeb38938f3ea4e0b 100644 (file)
@@ -144,17 +144,17 @@ public class ListSorter<T> {
                     Grid.Column column = o.getColumn();
                     Comparator cmp = ListSorter.this.comparators.get(column);
                     int result = 0;
-                    Object value_a = column.getValue(a);
-                    Object value_b = column.getValue(b);
+                    Object valueA = column.getValue(a);
+                    Object valueB = column.getValue(b);
                     if (cmp != null) {
-                        result = cmp.compare(value_a, value_b);
+                        result = cmp.compare(valueA, valueB);
                     } else {
-                        if (!(value_a instanceof Comparable)) {
+                        if (!(valueA instanceof Comparable)) {
                             throw new IllegalStateException("Column " + column
                                     + " has no assigned comparator and value "
-                                    + value_a + " isn't naturally comparable");
+                                    + valueA + " isn't naturally comparable");
                         }
-                        result = ((Comparable) value_a).compareTo(value_b);
+                        result = ((Comparable) valueA).compareTo(valueB);
                     }
 
                     if (result != 0) {
index 4145919f2f46d4af10ccde6aacebb1f7ebbf1ba4..fd65e63cea3b7051e34fad26f6c4dbc0d90ae48f 100644 (file)
@@ -32,7 +32,7 @@ import com.vaadin.client.widgets.Grid;
 @SuppressWarnings("rawtypes")
 public class SelectionEvent<T> extends GwtEvent<SelectionHandler> {
 
-    private static final Type<SelectionHandler> eventType = new Type<>();
+    private static final Type<SelectionHandler> EVENT_TYPE = new Type<>();
 
     private final Grid<T> grid;
     private final List<T> added;
@@ -142,12 +142,12 @@ public class SelectionEvent<T> extends GwtEvent<SelectionHandler> {
      * @return a {@link Type} identifier.
      */
     public static Type<SelectionHandler> getType() {
-        return eventType;
+        return EVENT_TYPE;
     }
 
     @Override
     public Type<SelectionHandler> getAssociatedType() {
-        return eventType;
+        return EVENT_TYPE;
     }
 
     @Override
index 73867caa728da711d572ee7ec7982a245e1eab2f..e134d01d9b85aa121b63e2f6c1529beff4278d8b 100755 (executable)
@@ -4702,7 +4702,7 @@ public class Grid<T> extends ResizeComposite implements HasSelectionHandlers<T>,
          */
         private final class DefaultTextRenderer implements Renderer<Object> {
             boolean warned = false;
-            private final String DEFAULT_RENDERER_WARNING = "This column uses a dummy default TextRenderer. "
+            private static final String DEFAULT_RENDERER_WARNING = "This column uses a dummy default TextRenderer. "
                     + "A more suitable renderer should be set using the setRenderer() method.";
 
             @Override
index 7a3d560b30378b08f0437f4b14f8144df4a87816..2e07216e5fc9ba222a45d6ccb7ea730d5ece8e48 100644 (file)
@@ -101,7 +101,7 @@ public class VCalendar extends Composite implements VHasDropHandler {
 
     private EventSortOrder eventSortOrder = EventSortOrder.DURATION_DESC;
 
-    private static EventDurationComparator DEFAULT_COMPARATOR = new EventDurationComparator(
+    private static final EventDurationComparator DEFAULT_COMPARATOR = new EventDurationComparator(
             false);
 
     private CalendarDropHandler dropHandler;
@@ -656,7 +656,7 @@ public class VCalendar extends Composite implements VHasDropHandler {
 
         for (CalendarDay day : days) {
             String date = day.getDate();
-            String localized_date_format = day.getLocalizedDateFormat();
+            String localizedDateFormat = day.getLocalizedDateFormat();
             Date d = dateformat_date.parse(date);
             int dayOfWeek = day.getDayOfWeek();
             if (dayOfWeek < getFirstDayNumber()
@@ -670,7 +670,7 @@ public class VCalendar extends Composite implements VHasDropHandler {
                 isToday = true;
             }
             dayToolbar.add(realDayNames[dayOfWeek - 1], date,
-                    localized_date_format, isToday ? "today" : null);
+                    localizedDateFormat, isToday ? "today" : null);
             weeklyLongEvents.addDate(d);
             weekGrid.addDate(d);
             if (isToday) {
index dca367ee2253799738f34c40790e1686659717dc..e8c889a9c0e16fb99f6aa8184eda5960ff158971 100644 (file)
@@ -540,7 +540,7 @@ public class VPopupCalendar extends VTextualDate
         }
     }
 
-    private final String CALENDAR_TOGGLE_ID = "popupButton";
+    private static final String CALENDAR_TOGGLE_ID = "popupButton";
 
     @Override
     public com.google.gwt.user.client.Element getSubPartElement(
index 16817fd82dc4d60c4f8d52fa280d88a16695d2ad..54b2417e461d95f71944cd3f066edf8e4fb0f5e8 100644 (file)
@@ -314,11 +314,11 @@ public class VScrollTable extends FlowPanel
      * multiple of pagelength which component will cache when requesting more
      * rows
      */
-    private double cache_rate = CACHE_RATE_DEFAULT;
+    private double cacheRate = CACHE_RATE_DEFAULT;
     /**
      * fraction of pageLength which can be scrolled without making new request
      */
-    private double cache_react_rate = 0.75 * cache_rate;
+    private double cacheReactRate = 0.75 * cacheRate;
 
     public static final char ALIGN_CENTER = 'c';
     public static final char ALIGN_LEFT = 'b';
@@ -404,7 +404,7 @@ public class VScrollTable extends FlowPanel
 
     private boolean enableDebug = false;
 
-    private static final boolean hasNativeTouchScrolling = BrowserInfo.get()
+    private static final boolean HAS_NATIVE_TOUCH_SCROLLLING = BrowserInfo.get()
             .isTouchDevice()
             && !BrowserInfo.get().requiresTouchScrollDelegate();
 
@@ -1649,9 +1649,9 @@ public class VScrollTable extends FlowPanel
     }
 
     private void setCacheRate(double d) {
-        if (cache_rate != d) {
-            cache_rate = d;
-            cache_react_rate = 0.75 * d;
+        if (cacheRate != d) {
+            cacheRate = d;
+            cacheReactRate = 0.75 * d;
         }
     }
 
@@ -1797,9 +1797,9 @@ public class VScrollTable extends FlowPanel
      */
     protected void discardRowsOutsideCacheWindow() {
         int firstRowToKeep = (int) (firstRowInViewPort
-                - pageLength * cache_rate);
+                - pageLength * cacheRate);
         int lastRowToKeep = (int) (firstRowInViewPort + pageLength
-                + pageLength * cache_rate);
+                + pageLength * cacheRate);
         // sanity checks:
         if (firstRowToKeep < 0) {
             firstRowToKeep = 0;
@@ -2474,12 +2474,12 @@ public class VScrollTable extends FlowPanel
         if (enabled) {
             // Do we need cache rows
             if (scrollBody.getLastRendered() + 1 < firstRowInViewPort
-                    + pageLength + (int) cache_react_rate * pageLength) {
+                    + pageLength + (int) cacheReactRate * pageLength) {
                 if (totalRows - 1 > scrollBody.getLastRendered()) {
                     // fetch cache rows
                     int firstInNewSet = scrollBody.getLastRendered() + 1;
                     int lastInNewSet = (int) (firstRowInViewPort + pageLength
-                            + cache_rate * pageLength);
+                            + cacheRate * pageLength);
                     if (lastInNewSet > totalRows - 1) {
                         lastInNewSet = totalRows - 1;
                     }
@@ -2648,8 +2648,8 @@ public class VScrollTable extends FlowPanel
                  */
 
                 setReqFirstRow(
-                        (firstRowInViewPort - (int) (pageLength * cache_rate)));
-                int last = firstRowInViewPort + (int) (cache_rate * pageLength)
+                        (firstRowInViewPort - (int) (pageLength * cacheRate)));
+                int last = firstRowInViewPort + (int) (cacheRate * pageLength)
                         + pageLength - 1;
                 if (last >= totalRows) {
                     last = totalRows - 1;
@@ -2672,9 +2672,9 @@ public class VScrollTable extends FlowPanel
                 if (reqFirstRow < firstToBeRendered) {
                     firstToBeRendered = reqFirstRow;
                 } else if (firstRowInViewPort
-                        - (int) (cache_rate * pageLength) > firstToBeRendered) {
+                        - (int) (cacheRate * pageLength) > firstToBeRendered) {
                     firstToBeRendered = firstRowInViewPort
-                            - (int) (cache_rate * pageLength);
+                            - (int) (cacheRate * pageLength);
                     if (firstToBeRendered < 0) {
                         firstToBeRendered = 0;
                     }
@@ -2697,9 +2697,9 @@ public class VScrollTable extends FlowPanel
                 if (lastReqRow > lastToBeRendered) {
                     lastToBeRendered = lastReqRow;
                 } else if (firstRowInViewPort + pageLength
-                        + pageLength * cache_rate < lastToBeRendered) {
+                        + pageLength * cacheRate < lastToBeRendered) {
                     lastToBeRendered = (firstRowInViewPort + pageLength
-                            + (int) (pageLength * cache_rate));
+                            + (int) (pageLength * cacheRate));
                     if (lastToBeRendered >= totalRows) {
                         lastToBeRendered = totalRows - 1;
                     }
@@ -2767,8 +2767,8 @@ public class VScrollTable extends FlowPanel
          */
         public void refreshContent() {
             isRequestHandlerRunning = true;
-            int first = (int) (firstRowInViewPort - pageLength * cache_rate);
-            int reqRows = (int) (2 * pageLength * cache_rate + pageLength);
+            int first = (int) (firstRowInViewPort - pageLength * cacheRate);
+            int reqRows = (int) (2 * pageLength * cacheRate + pageLength);
             if (first < 0) {
                 reqRows = reqRows + first;
                 first = 0;
@@ -2906,18 +2906,18 @@ public class VScrollTable extends FlowPanel
                 addStyleName(primaryStyleName + "-header-sortable");
             }
 
-            final String ALIGN_PREFIX = primaryStyleName
+            final String alignPrefix = primaryStyleName
                     + "-caption-container-align-";
 
             switch (align) {
             case ALIGN_CENTER:
-                captionContainer.addClassName(ALIGN_PREFIX + "center");
+                captionContainer.addClassName(alignPrefix + "center");
                 break;
             case ALIGN_RIGHT:
-                captionContainer.addClassName(ALIGN_PREFIX + "right");
+                captionContainer.addClassName(alignPrefix + "right");
                 break;
             default:
-                captionContainer.addClassName(ALIGN_PREFIX + "left");
+                captionContainer.addClassName(alignPrefix + "left");
                 break;
             }
 
@@ -3236,7 +3236,7 @@ public class VScrollTable extends FlowPanel
                         firstvisible = 0;
                         rowRequestHandler.setReqFirstRow(0);
                         rowRequestHandler
-                                .setReqRows((int) (2 * pageLength * cache_rate
+                                .setReqRows((int) (2 * pageLength * cacheRate
                                         + pageLength));
                         rowRequestHandler.deferRowFetch(); // some validation +
                                                            // defer 250ms
@@ -4941,9 +4941,9 @@ public class VScrollTable extends FlowPanel
             }
 
             int reactFirstRow = (int) (firstRowInViewPort
-                    - pageLength * cache_react_rate);
+                    - pageLength * cacheReactRate);
             int reactLastRow = (int) (firstRowInViewPort + pageLength
-                    + pageLength * cache_react_rate);
+                    + pageLength * cacheReactRate);
             if (reactFirstRow < 0) {
                 reactFirstRow = 0;
             }
@@ -5944,7 +5944,7 @@ public class VScrollTable extends FlowPanel
 
                 boolean touchEventHandled = false;
 
-                if (enabled && hasNativeTouchScrolling) {
+                if (enabled && HAS_NATIVE_TOUCH_SCROLLLING) {
                     touchContextProvider.handleTouchEvent(event);
 
                     final Element targetTdOrTr = getEventTargetTdOrTr(event);
@@ -7390,12 +7390,12 @@ public class VScrollTable extends FlowPanel
         }
 
         int postLimit = (int) (firstRowInViewPort + (pageLength - 1)
-                + pageLength * cache_react_rate);
+                + pageLength * cacheReactRate);
         if (postLimit > totalRows - 1) {
             postLimit = totalRows - 1;
         }
         int preLimit = (int) (firstRowInViewPort
-                - pageLength * cache_react_rate);
+                - pageLength * cacheReactRate);
         if (preLimit < 0) {
             preLimit = 0;
         }
@@ -7415,8 +7415,8 @@ public class VScrollTable extends FlowPanel
         if (allRenderedRowsAreNew()) {
             // need a totally new set of rows
             rowRequestHandler.setReqFirstRow(
-                    (firstRowInViewPort - (int) (pageLength * cache_rate)));
-            int last = firstRowInViewPort + (int) (cache_rate * pageLength)
+                    (firstRowInViewPort - (int) (pageLength * cacheRate)));
+            int last = firstRowInViewPort + (int) (cacheRate * pageLength)
                     + pageLength - 1;
             if (last >= totalRows) {
                 last = totalRows - 1;
@@ -7431,7 +7431,7 @@ public class VScrollTable extends FlowPanel
             // need some rows to the beginning of the rendered area
 
             rowRequestHandler.setReqFirstRow(
-                    (int) (firstRowInViewPort - pageLength * cache_rate));
+                    (int) (firstRowInViewPort - pageLength * cacheRate));
             rowRequestHandler.setReqRows(
                     firstRendered - rowRequestHandler.getReqFirstRow());
             rowRequestHandler.deferRowFetch();
@@ -7441,7 +7441,7 @@ public class VScrollTable extends FlowPanel
         if (postLimit > lastRendered) {
             // need some rows to the end of the rendered area
             int reqRows = (int) ((firstRowInViewPort + pageLength
-                    + pageLength * cache_rate) - lastRendered);
+                    + pageLength * cacheRate) - lastRendered);
             rowRequestHandler.triggerRowFetch(lastRendered + 1, reqRows);
         }
     }
@@ -7450,9 +7450,9 @@ public class VScrollTable extends FlowPanel
         int firstRowInViewPort = calcFirstRowInViewPort();
         int firstRendered = scrollBody.getFirstRendered();
         int lastRendered = scrollBody.getLastRendered();
-        return (firstRowInViewPort - pageLength * cache_rate > lastRendered
+        return (firstRowInViewPort - pageLength * cacheRate > lastRendered
                 || firstRowInViewPort + pageLength
-                        + pageLength * cache_rate < firstRendered);
+                        + pageLength * cacheRate < firstRendered);
     }
 
     protected int calcFirstRowInViewPort() {
index 5cd956c9f9f4719311f27be6252e4699bfeaea6f..d252b55330351ab767ffa16f8763186923186dc7 100644 (file)
@@ -82,7 +82,7 @@ public class VSlider extends SimpleFocusablePanel
 
     /* DOM element for slider's base */
     private final Element base;
-    private final int BASE_BORDER_WIDTH = 1;
+    private static final int BASE_BORDER_WIDTH = 1;
 
     /* DOM element for slider's handle */
     private final Element handle;
index c9204478b4af4cf3bcc7c8a6469b20d7484e5240..bb2453c881295cf9430cb6601bd36cbfaf1c6f9b 100644 (file)
@@ -376,7 +376,7 @@ public class VTextualDate extends VDateField implements Field, ChangeHandler,
         this.text.setText(text);
     }
 
-    private final String TEXTFIELD_ID = "field";
+    private static final String TEXTFIELD_ID = "field";
 
     @Override
     public com.google.gwt.user.client.Element getSubPartElement(
index 043b21019740d9688e6a78a50b3a23c530283c90..fb3ff935031d0ea8e39fcde22a6a76d0dac54b73 100644 (file)
@@ -2072,8 +2072,8 @@ public class VTree extends FocusElementPanel
         return KeyCodes.KEY_END;
     }
 
-    private final String SUBPART_NODE_PREFIX = "n";
-    private final String EXPAND_IDENTIFIER = "expand";
+    private static final String SUBPART_NODE_PREFIX = "n";
+    private static final String EXPAND_IDENTIFIER = "expand";
 
     /*
      * In webkit, focus may have been requested for this component but not yet
index 1ca09f78062fd937de83e84c256df266e951f2a9..4eed40620e76f17209cbfc4790efb3eff490b953 100644 (file)
@@ -41,7 +41,7 @@ public class VCalendarAction extends Action {
 
     private CalendarEvent event;
 
-    private final DateTimeFormat dateformat_datetime = DateTimeFormat
+    private static final DateTimeFormat DATE_FORMAT_DATE_TIME = DateTimeFormat
             .getFormat(DateConstants.ACTION_DATE_FORMAT_PATTERN);
 
     /**
@@ -76,8 +76,8 @@ public class VCalendarAction extends Action {
      */
     @Override
     public void execute() {
-        String startDate = dateformat_datetime.format(actionStartDate);
-        String endDate = dateformat_datetime.format(actionEndDate);
+        String startDate = DATE_FORMAT_DATE_TIME.format(actionStartDate);
+        String endDate = DATE_FORMAT_DATE_TIME.format(actionEndDate);
 
         if (event == null) {
             rpc.actionOnEmptyCell(actionKey.split("-")[0], startDate, endDate);
index bc08421d4cc2146b18bd549f041b15c70fecd9bc..7185e0bf1f7a92c514c22eae7c8fcb444822a73c 100644 (file)
@@ -36,8 +36,8 @@ public class CalendarEvent {
     private int slotIndex = -1;
     private boolean format24h;
 
-    DateTimeFormat dateformat_date = DateTimeFormat.getFormat("h:mm a");
-    DateTimeFormat dateformat_date24 = DateTimeFormat.getFormat("H:mm");
+    DateTimeFormat dateformatDate = DateTimeFormat.getFormat("h:mm a");
+    DateTimeFormat dateformatDate24 = DateTimeFormat.getFormat("H:mm");
     private boolean allDay;
 
     /**
@@ -241,9 +241,9 @@ public class CalendarEvent {
      */
     public String getTimeAsText() {
         if (format24h) {
-            return dateformat_date24.format(startTime);
+            return dateformatDate24.format(startTime);
         } else {
-            return dateformat_date.format(startTime);
+            return dateformatDate.format(startTime);
         }
     }
 
index 5855e25a2ace7370d7c96ef47266bfac9eb35dc1..f47cc29397d95cf49a91d98118a6fc6cf0cfb6be 100644 (file)
@@ -61,7 +61,7 @@ public class DateCellDayEvent extends FocusableHTML
     private int startY = -1;
     private int startX = -1;
     private String moveWidth;
-    public static final int halfHourInMilliSeconds = 1800 * 1000;
+    public static final int HALF_HOUR_IN_MILLI_SECONDS = 1800 * 1000;
     private Date startDatetimeFrom;
     private Date startDatetimeTo;
     private boolean mouseMoveStarted;
@@ -396,7 +396,7 @@ public class DateCellDayEvent extends FocusableHTML
             long daysMs = dayDiff * DateConstants.DAYINMILLIS;
             from.setTime(startDatetimeFrom.getTime() + daysMs);
             from.setTime(from.getTime()
-                    + ((long) halfHourInMilliSeconds * halfHourDiff));
+                    + ((long) HALF_HOUR_IN_MILLI_SECONDS * halfHourDiff));
             to.setTime((from.getTime() + duration));
 
             calendarEvent.setStartTime(from);
@@ -425,7 +425,7 @@ public class DateCellDayEvent extends FocusableHTML
         } else if (clickTarget == topResizeBar) {
             long oldStartTime = startDatetimeFrom.getTime();
             long newStartTime = oldStartTime
-                    + ((long) halfHourInMilliSeconds * halfHourDiff);
+                    + ((long) HALF_HOUR_IN_MILLI_SECONDS * halfHourDiff);
 
             if (!isTimeRangeTooSmall(newStartTime, startDatetimeTo.getTime())) {
                 newStartTime = startDatetimeTo.getTime() - getMinTimeRange();
@@ -445,7 +445,7 @@ public class DateCellDayEvent extends FocusableHTML
         } else if (clickTarget == bottomResizeBar) {
             long oldEndTime = startDatetimeTo.getTime();
             long newEndTime = oldEndTime
-                    + ((long) halfHourInMilliSeconds * halfHourDiff);
+                    + ((long) HALF_HOUR_IN_MILLI_SECONDS * halfHourDiff);
 
             if (!isTimeRangeTooSmall(startDatetimeFrom.getTime(), newEndTime)) {
                 newEndTime = startDatetimeFrom.getTime() + getMinTimeRange();
index 1d06406e5a41a10ca1a9cd05071425e0c80ad385..7558088b465d81eb565653765c2901a8a5762847 100644 (file)
@@ -52,9 +52,9 @@ public class DateUtil {
      * @return given Date as String, for communicating to server-side
      */
     public static String formatClientSideDate(Date date) {
-        DateTimeFormat dateformat_date = DateTimeFormat
+        DateTimeFormat dateformatDate = DateTimeFormat
                 .getFormat(DateConstants.CLIENT_DATE_FORMAT);
-        return dateformat_date.format(date);
+        return dateformatDate.format(date);
     }
 
     /**
@@ -63,8 +63,8 @@ public class DateUtil {
      * @return given Date as String, for communicating to server-side
      */
     public static String formatClientSideTime(Date date) {
-        DateTimeFormat dateformat_date = DateTimeFormat
+        DateTimeFormat dateformatDate = DateTimeFormat
                 .getFormat(DateConstants.CLIENT_TIME_FORMAT);
-        return dateformat_date.format(date);
+        return dateformatDate.format(date);
     }
 }
index b7e152c01079caf061a0e4583492336eebea752f..10216ba94fbebe06e6644baa3abe53831293233f 100644 (file)
@@ -89,8 +89,8 @@ public class DayToolbar extends HorizontalPanel implements ClickHandler {
     }
 
     public void add(String dayName, final String date,
-            String localized_date_format, String extraClass) {
-        Label l = new Label(dayName + " " + localized_date_format);
+            String localizedDateFormat, String extraClass) {
+        Label l = new Label(dayName + " " + localizedDateFormat);
         l.setStylePrimaryName("v-calendar-header-day");
 
         if (extraClass != null) {
index 470ce2f1c62f828d22c66e68949a21e0021033cf..bd73edab073944ebae6d9fb32800de6db5184595 100644 (file)
@@ -50,8 +50,8 @@ import com.vaadin.v7.shared.ui.calendar.DateConstants;
 public class SimpleDayCell extends FocusableFlowPanel implements MouseUpHandler,
         MouseDownHandler, MouseOverHandler, MouseMoveHandler {
 
-    private static int BOTTOMSPACERHEIGHT = -1;
-    private static int EVENTHEIGHT = -1;
+    private static int bottomSpacerHeight = -1;
+    private static int eventHeight = -1;
     private static final int BORDERPADDINGSIZE = 1;
 
     private final VCalendar calendar;
@@ -111,8 +111,8 @@ public class SimpleDayCell extends FocusableFlowPanel implements MouseUpHandler,
 
     @Override
     public void onLoad() {
-        BOTTOMSPACERHEIGHT = bottomspacer.getOffsetHeight();
-        EVENTHEIGHT = BOTTOMSPACERHEIGHT;
+        bottomSpacerHeight = bottomspacer.getOffsetHeight();
+        eventHeight = bottomSpacerHeight;
     }
 
     public void setMonthGrid(MonthGrid monthGrid) {
@@ -180,8 +180,8 @@ public class SimpleDayCell extends FocusableFlowPanel implements MouseUpHandler,
         } else {
             // Dynamic height by the content
             DOM.removeElementAttribute(getElement(), "height");
-            slots = (intHeight - caption.getOffsetHeight() - BOTTOMSPACERHEIGHT)
-                    / EVENTHEIGHT;
+            slots = (intHeight - caption.getOffsetHeight() - bottomSpacerHeight)
+                    / eventHeight;
             if (slots > 10) {
                 slots = 10;
             }
@@ -221,11 +221,11 @@ public class SimpleDayCell extends FocusableFlowPanel implements MouseUpHandler,
             }
         }
 
-        int remainingSpace = intHeight - ((slots * EVENTHEIGHT)
-                + BOTTOMSPACERHEIGHT + caption.getOffsetHeight());
-        int newHeight = remainingSpace + BOTTOMSPACERHEIGHT;
+        int remainingSpace = intHeight - ((slots * eventHeight)
+                + bottomSpacerHeight + caption.getOffsetHeight());
+        int newHeight = remainingSpace + bottomSpacerHeight;
         if (newHeight < 0) {
-            newHeight = EVENTHEIGHT;
+            newHeight = eventHeight;
         }
         bottomspacer.setHeight(newHeight + "px");
 
index b75bcae7c42ce6b92b0d895ee17c68d53b992da8..fd1dfd45a34ea1589a5796e560a00651884b8add 100644 (file)
@@ -540,7 +540,7 @@ public class WeekGrid extends SimplePanel {
 
     public static class Timebar extends HTML {
 
-        private static final int[] timesFor12h = { 12, 1, 2, 3, 4, 5, 6, 7, 8,
+        private static final int[] TIMES_FOR_12H = { 12, 1, 2, 3, 4, 5, 6, 7, 8,
                 9, 10, 11 };
 
         private int height;
@@ -601,7 +601,7 @@ public class WeekGrid extends SimplePanel {
                     for (int i = firstHour + 1; i <= amStop; i++) {
                         e = DOM.createDiv();
                         setStyleName(e, "v-calendar-time");
-                        e.setInnerHTML("<span>" + timesFor12h[i] + "</span>"
+                        e.setInnerHTML("<span>" + TIMES_FOR_12H[i] + "</span>"
                                 + " " + ampm[0]);
                         getElement().appendChild(e);
                     }
@@ -611,7 +611,7 @@ public class WeekGrid extends SimplePanel {
                     for (int i = pmStart; i < lastHour - 11; i++) {
                         e = DOM.createDiv();
                         setStyleName(e, "v-calendar-time");
-                        e.setInnerHTML("<span>" + timesFor12h[i] + "</span>"
+                        e.setInnerHTML("<span>" + TIMES_FOR_12H[i] + "</span>"
                                 + " " + ampm[1]);
                         getElement().appendChild(e);
                     }
index 8f52f281f9a57edc44b42f45cb3cb7dbba8f8f84..b03f71b2e3f002b65fb6243f4c4d34d2b7b4a28b 100644 (file)
@@ -201,7 +201,7 @@ public class VRichTextToolbar extends Composite {
                 fonts.setSelectedIndex(0);
             } else if (sender == fontSizes) {
                 basic.setFontSize(
-                        fontSizesConstants[fontSizes.getSelectedIndex() - 1]);
+                        FONT_SIZES_CONSTANTS[fontSizes.getSelectedIndex() - 1]);
                 fontSizes.setSelectedIndex(0);
             }
         }
@@ -275,7 +275,7 @@ public class VRichTextToolbar extends Composite {
         }
     }
 
-    private static final RichTextArea.FontSize[] fontSizesConstants = {
+    private static final RichTextArea.FontSize[] FONT_SIZES_CONSTANTS = {
             RichTextArea.FontSize.XX_SMALL, RichTextArea.FontSize.X_SMALL,
             RichTextArea.FontSize.SMALL, RichTextArea.FontSize.MEDIUM,
             RichTextArea.FontSize.LARGE, RichTextArea.FontSize.X_LARGE,
index 4ffad154e9ed24a9f02b93a0636d3dff5648f245..d8f86616acf1ac396498a3a2b6acc8e5c40ad46a 100644 (file)
@@ -50,7 +50,7 @@ import com.vaadin.v7.client.widget.grid.events.ScrollHandler;
  */
 public abstract class ScrollbarBundle implements DeferredWorker {
 
-    private static final boolean supportsRequestAnimationFrame = new AnimationSupportDetector()
+    private static final boolean SUPPORTS_REQUEST_ANIMATION_FRAME = new AnimationSupportDetector()
             .isNativelySupported();
 
     private class ScrollEventFirer {
@@ -97,7 +97,7 @@ public abstract class ScrollbarBundle implements DeferredWorker {
                  * We'll gather all the scroll events, and only fire once, once
                  * everything has calmed down.
                  */
-                if (supportsRequestAnimationFrame) {
+                if (SUPPORTS_REQUEST_ANIMATION_FRAME) {
                     // Chrome MUST use this as deferred commands will sometimes
                     // be run with a 300+ ms delay when scrolling.
                     AnimationScheduler.get().requestAnimationFrame(
index 22bc9e75082ce6e16f134b7cbdcdee3fd907fcf2..1ba971753e3e26782a17a351cbfd92bbc34f896b 100644 (file)
@@ -144,17 +144,17 @@ public class ListSorter<T> {
                     Grid.Column column = o.getColumn();
                     Comparator cmp = ListSorter.this.comparators.get(column);
                     int result = 0;
-                    Object value_a = column.getValue(a);
-                    Object value_b = column.getValue(b);
+                    Object valueA = column.getValue(a);
+                    Object valueB = column.getValue(b);
                     if (cmp != null) {
-                        result = cmp.compare(value_a, value_b);
+                        result = cmp.compare(valueA, valueB);
                     } else {
-                        if (!(value_a instanceof Comparable)) {
+                        if (!(valueA instanceof Comparable)) {
                             throw new IllegalStateException("Column " + column
                                     + " has no assigned comparator and value "
-                                    + value_a + " isn't naturally comparable");
+                                    + valueA + " isn't naturally comparable");
                         }
-                        result = ((Comparable) value_a).compareTo(value_b);
+                        result = ((Comparable) valueA).compareTo(valueB);
                     }
 
                     if (result != 0) {
index 94fb851df96c2a5923d0c8f2cb6fec97fd93cf19..35fb230cff7c7c10bdbafa5701d4188746d18665 100644 (file)
@@ -32,7 +32,7 @@ import com.vaadin.v7.client.widgets.Grid;
 @SuppressWarnings("rawtypes")
 public class SelectionEvent<T> extends GwtEvent<SelectionHandler> {
 
-    private static final Type<SelectionHandler> eventType = new Type<SelectionHandler>();
+    private static final Type<SelectionHandler> EVENT_TYPE = new Type<SelectionHandler>();
 
     private final Grid<T> grid;
     private final List<T> added;
@@ -151,12 +151,12 @@ public class SelectionEvent<T> extends GwtEvent<SelectionHandler> {
      * @return a {@link Type} identifier.
      */
     public static Type<SelectionHandler> getType() {
-        return eventType;
+        return EVENT_TYPE;
     }
 
     @Override
     public Type<SelectionHandler> getAssociatedType() {
-        return eventType;
+        return EVENT_TYPE;
     }
 
     @Override
index 64e9e0656b0854a6b41c87791db0e2108b3dda9d..ae98ffe782a2266c46b1d3ab6122038d7e7171d2 100644 (file)
@@ -390,7 +390,8 @@ public class Escalator extends Widget
             private boolean touching = false;
             // Two movement objects for storing status and processing touches
             private Movement yMov, xMov;
-            final double MIN_VEL = 0.6, MAX_VEL = 4, F_VEL = 1500, F_ACC = 0.7,
+            static final double MIN_VEL = 0.6, MAX_VEL = 4, F_VEL = 1500,
+                    F_ACC = 0.7,
                     F_AXIS = 1;
 
             // The object to deal with one direction scrolling
index 980745eac9223c7cc4f1e359064c6cfe00082485..a18cd15b28a484d9d3446e8870cae784ba02ee95 100644 (file)
@@ -4707,7 +4707,7 @@ public class Grid<T> extends ResizeComposite implements HasSelectionHandlers<T>,
          */
         private final class DefaultTextRenderer implements Renderer<Object> {
             boolean warned = false;
-            private final String DEFAULT_RENDERER_WARNING = "This column uses a dummy default TextRenderer. "
+            private static final String DEFAULT_RENDERER_WARNING = "This column uses a dummy default TextRenderer. "
                     + "A more suitable renderer should be set using the setRenderer() method.";
 
             @Override
index 53eacc20e2056c10d429632d5b5c3e8aa0a46a6d..1ee43cc1f84c650d066d2c23fe452ee4a3217f3c 100644 (file)
@@ -39,7 +39,7 @@ import com.vaadin.server.VaadinSession;
 @Deprecated
 public class DefaultConverterFactory implements ConverterFactory {
 
-    private static final Logger log = Logger
+    private static final Logger LOG = Logger
             .getLogger(DefaultConverterFactory.class.getName());
 
     @Override
@@ -48,7 +48,7 @@ public class DefaultConverterFactory implements ConverterFactory {
         Converter<PRESENTATION, MODEL> converter = findConverter(
                 presentationType, modelType);
         if (converter != null) {
-            log.finest(getClass().getName() + " created a "
+            LOG.finest(getClass().getName() + " created a "
                     + converter.getClass());
             return converter;
         }
@@ -57,12 +57,12 @@ public class DefaultConverterFactory implements ConverterFactory {
         Converter<MODEL, PRESENTATION> reverseConverter = findConverter(
                 modelType, presentationType);
         if (reverseConverter != null) {
-            log.finest(getClass().getName() + " created a reverse "
+            LOG.finest(getClass().getName() + " created a reverse "
                     + reverseConverter.getClass());
             return new ReverseConverter<PRESENTATION, MODEL>(reverseConverter);
         }
 
-        log.finest(getClass().getName() + " could not find a converter for "
+        LOG.finest(getClass().getName() + " could not find a converter for "
                 + presentationType.getName() + " to " + modelType.getName()
                 + " conversion");
         return null;
index aeb6d8154e26ce68113e6a393052eebc7642fb3d..a1ee67229dbf53d374185f9c13a9b675e0cff7da 100644 (file)
@@ -73,7 +73,7 @@ public abstract class AbstractTextField extends AbstractField<String> implements
 
     private TextChangeEventMode textChangeEventMode = TextChangeEventMode.LAZY;
 
-    private final int DEFAULT_TEXTCHANGE_TIMEOUT = 400;
+    private static final int DEFAULT_TEXTCHANGE_TIMEOUT = 400;
 
     private int textChangeEventTimeout = DEFAULT_TEXTCHANGE_TIMEOUT;
 
index f42000a1193f949fb0a6b6da98e9f2ee71e0ffe0..daa7b41386230a0a520296639f25a9b34b745c67 100644 (file)
@@ -38,7 +38,7 @@ import com.vaadin.v7.data.Property;
 public class DefaultFieldFactory
         implements FormFieldFactory, TableFieldFactory {
 
-    private static final DefaultFieldFactory instance = new DefaultFieldFactory();
+    private static final DefaultFieldFactory INSTANCE = new DefaultFieldFactory();
 
     /**
      * Singleton method to get an instance of DefaultFieldFactory.
@@ -46,7 +46,7 @@ public class DefaultFieldFactory
      * @return an instance of DefaultFieldFactory
      */
     public static DefaultFieldFactory get() {
-        return instance;
+        return INSTANCE;
     }
 
     protected DefaultFieldFactory() {
index b66531df2434af3743267c740a1bacc29bf04ae3..3da383cb3b5ce72a506f92b6cc8450abdb5bf4d7 100644 (file)
@@ -282,15 +282,15 @@ public class Upload extends AbstractLegacyComponent
          *            the source of the file.
          * @param filename
          *            the received file name.
-         * @param MIMEType
+         * @param mimeType
          *            the MIME type of the received file.
          * @param length
          *            the length of the received file.
          */
-        public FinishedEvent(Upload source, String filename, String MIMEType,
+        public FinishedEvent(Upload source, String filename, String mimeType,
                 long length) {
             super(source);
-            type = MIMEType;
+            type = mimeType;
             this.filename = filename;
             this.length = length;
         }
@@ -349,13 +349,13 @@ public class Upload extends AbstractLegacyComponent
          *
          * @param source
          * @param filename
-         * @param MIMEType
+         * @param mimeType
          * @param length
          * @param exception
          */
-        public FailedEvent(Upload source, String filename, String MIMEType,
+        public FailedEvent(Upload source, String filename, String mimeType,
                 long length, Exception reason) {
-            this(source, filename, MIMEType, length);
+            this(source, filename, mimeType, length);
             this.reason = reason;
         }
 
@@ -363,13 +363,13 @@ public class Upload extends AbstractLegacyComponent
          *
          * @param source
          * @param filename
-         * @param MIMEType
+         * @param mimeType
          * @param length
          * @param exception
          */
-        public FailedEvent(Upload source, String filename, String MIMEType,
+        public FailedEvent(Upload source, String filename, String mimeType,
                 long length) {
-            super(source, filename, MIMEType, length);
+            super(source, filename, mimeType, length);
         }
 
         /**
@@ -393,12 +393,12 @@ public class Upload extends AbstractLegacyComponent
          *
          * @param source
          * @param filename
-         * @param MIMEType
+         * @param mimeType
          * @param length
          */
         public NoOutputStreamEvent(Upload source, String filename,
-                String MIMEType, long length) {
-            super(source, filename, MIMEType, length);
+                String mimeType, long length) {
+            super(source, filename, mimeType, length);
         }
     }
 
@@ -412,14 +412,13 @@ public class Upload extends AbstractLegacyComponent
          *
          * @param source
          * @param filename
-         * @param MIMEType
+         * @param mimeType
          * @param length
          */
         public NoInputStreamEvent(Upload source, String filename,
-                String MIMEType, long length) {
-            super(source, filename, MIMEType, length);
+                String mimeType, long length) {
+            super(source, filename, mimeType, length);
         }
-
     }
 
     /**
@@ -436,14 +435,13 @@ public class Upload extends AbstractLegacyComponent
          *
          * @param source
          * @param filename
-         * @param MIMEType
+         * @param mimeType
          * @param length
          */
-        public SucceededEvent(Upload source, String filename, String MIMEType,
+        public SucceededEvent(Upload source, String filename, String mimeType,
                 long length) {
-            super(source, filename, MIMEType, length);
+            super(source, filename, mimeType, length);
         }
-
     }
 
     /**
@@ -466,14 +464,14 @@ public class Upload extends AbstractLegacyComponent
          *
          * @param source
          * @param filename
-         * @param MIMEType
+         * @param mimeType
          * @param length
          */
-        public StartedEvent(Upload source, String filename, String MIMEType,
+        public StartedEvent(Upload source, String filename, String mimeType,
                 long contentLength) {
             super(source);
             this.filename = filename;
-            type = MIMEType;
+            type = mimeType;
             length = contentLength;
         }
 
@@ -862,11 +860,11 @@ public class Upload extends AbstractLegacyComponent
      * Emit upload received event.
      *
      * @param filename
-     * @param MIMEType
+     * @param mimeType
      * @param length
      */
-    protected void fireStarted(String filename, String MIMEType) {
-        fireEvent(new Upload.StartedEvent(this, filename, MIMEType,
+    protected void fireStarted(String filename, String mimeType) {
+        fireEvent(new Upload.StartedEvent(this, filename, mimeType,
                 contentLength));
     }
 
@@ -874,42 +872,42 @@ public class Upload extends AbstractLegacyComponent
      * Emits the upload failed event.
      *
      * @param filename
-     * @param MIMEType
+     * @param mimeType
      * @param length
      */
-    protected void fireUploadInterrupted(String filename, String MIMEType,
+    protected void fireUploadInterrupted(String filename, String mimeType,
             long length) {
-        fireEvent(new Upload.FailedEvent(this, filename, MIMEType, length));
+        fireEvent(new Upload.FailedEvent(this, filename, mimeType, length));
     }
 
-    protected void fireNoInputStream(String filename, String MIMEType,
+    protected void fireNoInputStream(String filename, String mimeType,
             long length) {
-        fireEvent(new Upload.NoInputStreamEvent(this, filename, MIMEType,
+        fireEvent(new Upload.NoInputStreamEvent(this, filename, mimeType,
                 length));
     }
 
-    protected void fireNoOutputStream(String filename, String MIMEType,
+    protected void fireNoOutputStream(String filename, String mimeType,
             long length) {
-        fireEvent(new Upload.NoOutputStreamEvent(this, filename, MIMEType,
+        fireEvent(new Upload.NoOutputStreamEvent(this, filename, mimeType,
                 length));
     }
 
-    protected void fireUploadInterrupted(String filename, String MIMEType,
+    protected void fireUploadInterrupted(String filename, String mimeType,
             long length, Exception e) {
-        fireEvent(new Upload.FailedEvent(this, filename, MIMEType, length, e));
+        fireEvent(new Upload.FailedEvent(this, filename, mimeType, length, e));
     }
 
     /**
      * Emits the upload success event.
      *
      * @param filename
-     * @param MIMEType
+     * @param mimeType
      * @param length
      *
      */
-    protected void fireUploadSuccess(String filename, String MIMEType,
+    protected void fireUploadSuccess(String filename, String mimeType,
             long length) {
-        fireEvent(new Upload.SucceededEvent(this, filename, MIMEType, length));
+        fireEvent(new Upload.SucceededEvent(this, filename, mimeType, length));
     }
 
     /**
index 0326f1e224d6f040dbe913314bbb8509c82ffac8..144e2b4f6ab724caffbd3094e774ef38584ea3ad 100644 (file)
@@ -156,8 +156,8 @@ public class ColorPickerGrid extends AbstractComponent
     private void sendChangedColors() {
         if (!changedColors.isEmpty()) {
             String[] colors = new String[changedColors.size()];
-            String[] XCoords = new String[changedColors.size()];
-            String[] YCoords = new String[changedColors.size()];
+            String[] xCoords = new String[changedColors.size()];
+            String[] yCoords = new String[changedColors.size()];
             int counter = 0;
             for (Point p : changedColors.keySet()) {
                 Color c = changedColors.get(p);
@@ -168,13 +168,13 @@ public class ColorPickerGrid extends AbstractComponent
                 String color = c.getCSS();
 
                 colors[counter] = color;
-                XCoords[counter] = String.valueOf(p.getX());
-                YCoords[counter] = String.valueOf(p.getY());
+                xCoords[counter] = String.valueOf(p.getX());
+                yCoords[counter] = String.valueOf(p.getY());
                 counter++;
             }
             getState().changedColor = colors;
-            getState().changedX = XCoords;
-            getState().changedY = YCoords;
+            getState().changedX = xCoords;
+            getState().changedY = yCoords;
 
             changedColors.clear();
         }
index 5f4161ccab7b6ca4916ca201a80673a5a3d6c3eb..49775ff25ecbea33f23114b607278153494dd6dc 100644 (file)
@@ -50,14 +50,14 @@ public class ColorPickerHistory extends CustomComponent
     }
 
     /** The rows. */
-    private static final int rows = 4;
+    private static final int ROWS = 4;
 
     /** The columns. */
-    private static final int columns = 15;
+    private static final int COLUMNS = 15;
 
     /** Temporary color history for when the component is detached. */
     private ArrayBlockingQueue<Color> tempHistory = new ArrayBlockingQueue<Color>(
-            rows * columns);
+            ROWS * COLUMNS);
 
     /** The grid. */
     private final ColorPickerGrid grid;
@@ -68,7 +68,7 @@ public class ColorPickerHistory extends CustomComponent
     public ColorPickerHistory() {
         setPrimaryStyleName(STYLENAME);
 
-        grid = new ColorPickerGrid(rows, columns);
+        grid = new ColorPickerGrid(ROWS, COLUMNS);
         grid.setWidth("100%");
         grid.setPosition(0, 0);
         grid.addColorChangeListener(this);
@@ -86,7 +86,7 @@ public class ColorPickerHistory extends CustomComponent
         List<Color> tempColors = new ArrayList<Color>(tempHistory);
         if (getSession().getAttribute("colorPickerHistory") == null) {
             getSession().setAttribute("colorPickerHistory",
-                    new ArrayBlockingQueue<Color>(rows * columns));
+                    new ArrayBlockingQueue<Color>(ROWS * COLUMNS));
         }
         for (Color color : tempColors) {
             setColor(color);
@@ -137,11 +137,11 @@ public class ColorPickerHistory extends CustomComponent
         Collections.swap(colorList, colorList.indexOf(color), 0);
 
         // Create 2d color map
-        Color[][] colors = new Color[rows][columns];
+        Color[][] colors = new Color[ROWS][COLUMNS];
         Iterator<Color> iter = colorList.iterator();
 
-        for (int row = 0; row < rows; row++) {
-            for (int col = 0; col < columns; col++) {
+        for (int row = 0; row < ROWS; row++) {
+            for (int col = 0; col < COLUMNS; col++) {
                 if (iter.hasNext()) {
                     colors[row][col] = iter.next();
                 } else {
index 5ce6295d87a1be8acbf5e57eef4d95a22dbb79e0..b5e917eeb1586a341d52ae19b686b0d779a12261 100644 (file)
@@ -265,7 +265,7 @@ public class ColorPickerPopup extends Window
         rgbLayout.setStyleName("rgbtab");
 
         // Add the RGB color gradient
-        rgbGradient = new ColorPickerGradient("rgb-gradient", RGBConverter);
+        rgbGradient = new ColorPickerGradient("rgb-gradient", rgbConverter);
         rgbGradient.setColor(color);
         rgbGradient.addColorChangeListener(this);
         rgbLayout.addComponent(rgbGradient);
@@ -346,7 +346,7 @@ public class ColorPickerPopup extends Window
         hsvLayout.setStyleName("hsvtab");
 
         // Add the hsv gradient
-        hsvGradient = new ColorPickerGradient("hsv-gradient", HSVConverter);
+        hsvGradient = new ColorPickerGradient("hsv-gradient", hsvConverter);
         hsvGradient.setColor(color);
         hsvGradient.addColorChangeListener(this);
         hsvLayout.addComponent(hsvGradient);
@@ -696,7 +696,7 @@ public class ColorPickerPopup extends Window
     }
 
     /** RGB color converter */
-    private Coordinates2Color RGBConverter = new Coordinates2Color() {
+    private Coordinates2Color rgbConverter = new Coordinates2Color() {
 
         @Override
         public Color calculate(int x, int y) {
@@ -733,7 +733,7 @@ public class ColorPickerPopup extends Window
     };
 
     /** HSV color converter */
-    Coordinates2Color HSVConverter = new Coordinates2Color() {
+    Coordinates2Color hsvConverter = new Coordinates2Color() {
         @Override
         public int[] calculate(Color color) {
 
index 62452e974d577dd2fd9d15c6c7d1d3da4641df52..984783b38ecf853ef84caeabcea4d20b1c1b40c8 100644 (file)
@@ -107,7 +107,7 @@ public class SerializerHelper {
      * List of primitive classes. Google App Engine has problems
      * serializing/deserializing these (#3064).
      */
-    private static final Class<?>[] primitiveClasses = {
+    private static final Class<?>[] PRIMITIVE_CLASSES = {
             byte.class, short.class, int.class, long.class, float.class,
             double.class, boolean.class, char.class };
 
@@ -122,7 +122,7 @@ public class SerializerHelper {
      */
     public static Class<?> resolveClass(String className)
             throws ClassNotFoundException {
-        for (Class<?> c : primitiveClasses) {
+        for (Class<?> c : PRIMITIVE_CLASSES) {
             if (className.equals(c.getName())) {
                 return c;
             }
index d4929bb5c728e6d019162a329d8d1de27b239c4f..2a6a6a121375722830fbf02175669cf50e1bd622 100644 (file)
@@ -39,7 +39,7 @@ public class Color implements Serializable {
     private int blue;
     private int alpha;
 
-    private String OUTOFRANGE = "Value must be within the range [0-255]. Was: ";
+    private static final String OUTOFRANGE = "Value must be within the range [0-255]. Was: ";
 
     /**
      * Creates a color that has the specified red, green, blue, and alpha values
index ae14c31d830d16905cb86b9fc64947ff4520190a..dcbff134d44d57ddd48de85197cd96843a2b6200 100644 (file)
@@ -270,7 +270,7 @@ public class BeanPropertySet<T> implements PropertySet<T> {
         }
     }
 
-    private static final ConcurrentMap<Class<?>, BeanPropertySet<?>> instances = new ConcurrentHashMap<>();
+    private static final ConcurrentMap<Class<?>, BeanPropertySet<?>> INSTANCES = new ConcurrentHashMap<>();
 
     private final Class<T> beanType;
 
@@ -306,7 +306,7 @@ public class BeanPropertySet<T> implements PropertySet<T> {
         Objects.requireNonNull(beanType, "Bean type cannot be null");
 
         // Cache the reflection results
-        return (PropertySet<T>) instances.computeIfAbsent(beanType,
+        return (PropertySet<T>) INSTANCES.computeIfAbsent(beanType,
                 BeanPropertySet::new);
     }
 
index 6dfca521a4876b99b46de85d5671e8f1949d5bb8..d7684b014267117858c1cc9db42f15bd34290b8c 100644 (file)
@@ -29,13 +29,13 @@ import com.vaadin.event.dd.DragAndDropEvent;
 public final class AcceptAll extends ClientSideCriterion {
 
     private static final long serialVersionUID = 7406683402153141461L;
-    private static final AcceptCriterion singleton = new AcceptAll();
+    private static final AcceptCriterion SINGLETON = new AcceptAll();
 
     private AcceptAll() {
     }
 
     public static AcceptCriterion get() {
-        return singleton;
+        return SINGLETON;
     }
 
     @Override
index 8c4b82c0c7beba68815929358852236c99fe4a8f..292ac636a7295b3582cbc1ffbf65743bea25d5da 100644 (file)
@@ -35,7 +35,7 @@ import com.vaadin.ui.Component;
 public class SourceIsTarget extends ClientSideCriterion {
 
     private static final long serialVersionUID = -451399314705532584L;
-    private static final SourceIsTarget instance = new SourceIsTarget();
+    private static final SourceIsTarget INSTANCE = new SourceIsTarget();
 
     private SourceIsTarget() {
     }
@@ -52,7 +52,7 @@ public class SourceIsTarget extends ClientSideCriterion {
     }
 
     public static synchronized SourceIsTarget get() {
-        return instance;
+        return INSTANCE;
     }
 
 }
index 9086bf2cc281ac3990c9a1119b673f7c4358d480..d194dce51ca03af3d0fff99efe28c33f6148ed43 100644 (file)
@@ -99,7 +99,7 @@ public abstract class AbstractClientConnector
      * ShareState classes. Using WeakHashMap since entries are recalculated on
      * demand.
      */
-    private static final Map<Class<? extends AbstractClientConnector>, Class<? extends SharedState>> stateTypeCache = Collections
+    private static final Map<Class<? extends AbstractClientConnector>, Class<? extends SharedState>> STATE_TYPE_CACHE = Collections
             .synchronizedMap(new WeakHashMap<>());
 
     @Override
@@ -315,7 +315,7 @@ public abstract class AbstractClientConnector
         // exceptions flying around
         if (stateType == null) {
             // Cache because we don't need to do this once per instance
-            stateType = stateTypeCache.computeIfAbsent(this.getClass(),
+            stateType = STATE_TYPE_CACHE.computeIfAbsent(this.getClass(),
                     key -> findStateType());
         }
 
index 8fe7892c398956555598b89ee7abe960d5f7949f..58761f1e100dbb3e6dbf5a457a02e092313eeb80 100644 (file)
@@ -371,13 +371,13 @@ public class ComponentSizeValidator implements Serializable {
     private static void showComponent(Component component, String attribute,
             StringBuilder err, StringBuilder indent, boolean widthError) {
 
-        FileLocation createLoc = creationLocations.get(component);
+        FileLocation createLoc = CREATION_LOCATIONS.get(component);
 
         FileLocation sizeLoc;
         if (widthError) {
-            sizeLoc = widthLocations.get(component);
+            sizeLoc = WIDTH_LOCATIONS.get(component);
         } else {
-            sizeLoc = heightLocations.get(component);
+            sizeLoc = HEIGHT_LOCATIONS.get(component);
         }
 
         err.append(indent);
@@ -600,9 +600,9 @@ public class ComponentSizeValidator implements Serializable {
 
     }
 
-    private static final Map<Object, FileLocation> creationLocations = new HashMap<>();
-    private static final Map<Object, FileLocation> widthLocations = new HashMap<>();
-    private static final Map<Object, FileLocation> heightLocations = new HashMap<>();
+    private static final Map<Object, FileLocation> CREATION_LOCATIONS = new HashMap<>();
+    private static final Map<Object, FileLocation> WIDTH_LOCATIONS = new HashMap<>();
+    private static final Map<Object, FileLocation> HEIGHT_LOCATIONS = new HashMap<>();
 
     public static class FileLocation implements Serializable {
         public String method;
@@ -622,15 +622,15 @@ public class ComponentSizeValidator implements Serializable {
     }
 
     public static void setCreationLocation(Object object) {
-        setLocation(creationLocations, object);
+        setLocation(CREATION_LOCATIONS, object);
     }
 
     public static void setWidthLocation(Object object) {
-        setLocation(widthLocations, object);
+        setLocation(WIDTH_LOCATIONS, object);
     }
 
     public static void setHeightLocation(Object object) {
-        setLocation(heightLocations, object);
+        setLocation(HEIGHT_LOCATIONS, object);
     }
 
     private static void setLocation(Map<Object, FileLocation> map,
index 971587d74b2c4c156b954b2ebc6aabef869c34d7..3acb1191f51550412fca1d41d51beeeadcc0a116 100644 (file)
@@ -25,7 +25,7 @@ package com.vaadin.server;
  */
 public class DefaultSystemMessagesProvider implements SystemMessagesProvider {
 
-    private static final DefaultSystemMessagesProvider instance = new DefaultSystemMessagesProvider();
+    private static final DefaultSystemMessagesProvider INSTANCE = new DefaultSystemMessagesProvider();
 
     private DefaultSystemMessagesProvider() {
         // Singleton
@@ -43,7 +43,7 @@ public class DefaultSystemMessagesProvider implements SystemMessagesProvider {
      * @return the default system messages provider.
      */
     public static SystemMessagesProvider get() {
-        return instance;
+        return INSTANCE;
     }
 
 }
index 11e6832696d2029f7e1317999a9f259380a2523c..d8f312d4ea6d18fdc810c8d528a7c6ddf1593f63 100644 (file)
@@ -60,7 +60,7 @@ public class GlobalResourceHandler implements RequestHandler {
     private int nextLegacyId = 0;
 
     // APP/global/[uiid]/[type]/[id]
-    private static final Pattern pattern = Pattern
+    private static final Pattern PATTERN = Pattern
             .compile("^/?" + ApplicationConstants.APP_PATH + '/'
                     + RESOURCE_REQUEST_PATH + "(\\d+)/(([^/]+)(/.*))");
 
@@ -72,7 +72,7 @@ public class GlobalResourceHandler implements RequestHandler {
             return false;
         }
 
-        Matcher matcher = pattern.matcher(pathInfo);
+        Matcher matcher = PATTERN.matcher(pathInfo);
         if (!matcher.matches()) {
             return false;
         }
index fc8e858b3bd88ba1597f66d7e546f2aa305d5c70..5f26d14513c4820b97b576a07b2541b2653c3ced 100644 (file)
@@ -206,19 +206,19 @@ public class JsonCodec implements Serializable {
      * happens to process Vaadin requests, so it must be protected from
      * corruption caused by concurrent access.
      */
-    private static final ConcurrentMap<Class<?>, Collection<BeanProperty>> typePropertyCache = new ConcurrentHashMap<>();
+    private static final ConcurrentMap<Class<?>, Collection<BeanProperty>> TYPE_PROPERTY_CACHE = new ConcurrentHashMap<>();
 
-    private static final Map<Class<?>, String> typeToTransportType = new HashMap<>();
+    private static final Map<Class<?>, String> TYPE_TO_TRANSPORT_TYPE = new HashMap<>();
 
     /**
      * Note! This does not contain primitives.
      * <p>
      */
-    private static final Map<String, Class<?>> transportTypeToType = new HashMap<>();
+    private static final Map<String, Class<?>> TRANSPORT_TYPE_TO_TYPE = new HashMap<>();
 
-    private static final Map<Class<?>, JSONSerializer<?>> customSerializers = new HashMap<>();
+    private static final Map<Class<?>, JSONSerializer<?>> CUSTOM_SERIALIZERS = new HashMap<>();
     static {
-        customSerializers.put(Date.class, new DateSerializer());
+        CUSTOM_SERIALIZERS.put(Date.class, new DateSerializer());
     }
 
     static {
@@ -244,14 +244,14 @@ public class JsonCodec implements Serializable {
     }
 
     private static void registerType(Class<?> type, String transportType) {
-        typeToTransportType.put(type, transportType);
+        TYPE_TO_TRANSPORT_TYPE.put(type, transportType);
         if (!type.isPrimitive()) {
-            transportTypeToType.put(transportType, type);
+            TRANSPORT_TYPE_TO_TYPE.put(transportType, type);
         }
     }
 
     public static boolean isInternalTransportType(String transportType) {
-        return transportTypeToType.containsKey(transportType);
+        return TRANSPORT_TYPE_TO_TYPE.containsKey(transportType);
     }
 
     public static boolean isInternalType(Type type) {
@@ -267,7 +267,7 @@ public class JsonCodec implements Serializable {
             // value
             return true;
         }
-        return typeToTransportType.containsKey(getClassForType(type));
+        return TYPE_TO_TRANSPORT_TYPE.containsKey(getClassForType(type));
     }
 
     private static Class<?> getClassForType(Type type) {
@@ -281,7 +281,7 @@ public class JsonCodec implements Serializable {
     }
 
     private static Class<?> getType(String transportType) {
-        return transportTypeToType.get(transportType);
+        return TRANSPORT_TYPE_TO_TYPE.get(transportType);
     }
 
     public static Object decodeInternalOrCustomType(Type targetType,
@@ -329,8 +329,8 @@ public class JsonCodec implements Serializable {
             Class<?> classForType = getClassForType(targetType);
             return decodeEnum(classForType.asSubclass(Enum.class),
                     (JsonString) value);
-        } else if (customSerializers.containsKey(getClassForType(targetType))) {
-            return customSerializers.get(getClassForType(targetType))
+        } else if (CUSTOM_SERIALIZERS.containsKey(getClassForType(targetType))) {
+            return CUSTOM_SERIALIZERS.get(getClassForType(targetType))
                     .deserialize(targetType, value, connectorTracker);
         } else {
             return decodeObject(targetType, (JsonObject) value,
@@ -669,7 +669,7 @@ public class JsonCodec implements Serializable {
             toReturn = Json.create(((Connector) value).getConnectorId());
         } else if (value instanceof Enum) {
             toReturn = Json.create(((Enum<?>) value).name());
-        } else if (customSerializers.containsKey(value.getClass())) {
+        } else if (CUSTOM_SERIALIZERS.containsKey(value.getClass())) {
             toReturn = serializeJson(value, connectorTracker);
         } else if (valueType instanceof GenericArrayType) {
             toReturn = encodeArrayContents(
@@ -695,7 +695,7 @@ public class JsonCodec implements Serializable {
 
     public static Collection<BeanProperty> getProperties(Class<?> type)
             throws IntrospectionException {
-        Collection<BeanProperty> cachedProperties = typePropertyCache.get(type);
+        Collection<BeanProperty> cachedProperties = TYPE_PROPERTY_CACHE.get(type);
         if (cachedProperties != null) {
             return cachedProperties;
         }
@@ -706,7 +706,7 @@ public class JsonCodec implements Serializable {
 
         // Doesn't matter if the same calculation is done multiple times from
         // different threads, so there's no need to do e.g. putIfAbsent
-        typePropertyCache.put(type, properties);
+        TYPE_PROPERTY_CACHE.put(type, properties);
         return properties;
     }
 
@@ -982,12 +982,12 @@ public class JsonCodec implements Serializable {
      * of the hot part.
      */
     private static String getInternalTransportType(Type valueType) {
-        return typeToTransportType.get(getClassForType(valueType));
+        return TYPE_TO_TRANSPORT_TYPE.get(getClassForType(valueType));
     }
 
     private static JsonValue serializeJson(Object value,
             ConnectorTracker connectorTracker) {
-        JSONSerializer serializer = customSerializers.get(value.getClass());
+        JSONSerializer serializer = CUSTOM_SERIALIZERS.get(value.getClass());
         return serializer.serialize(value, connectorTracker);
     }
 
index cebb90a0ad859ec0395c32b3d8d2fc93934ab47a..c66609b17b983dddda9314581ffbb7dc12f6453e 100644 (file)
@@ -82,7 +82,7 @@ public class LegacyCommunicationManager implements Serializable {
         return session;
     }
 
-    private static final ConcurrentHashMap<Class<? extends SharedState>, JsonValue> referenceDiffStates = new ConcurrentHashMap<>();
+    private static final ConcurrentHashMap<Class<? extends SharedState>, JsonValue> REFERENCE_DIFF_STATES = new ConcurrentHashMap<>();
 
     /**
      * @deprecated As of 7.1. See #11411.
@@ -98,10 +98,10 @@ public class LegacyCommunicationManager implements Serializable {
         if (diffState == null) {
             // Use an empty state object as reference for full
             // repaints
-            diffState = referenceDiffStates.get(stateType);
+            diffState = REFERENCE_DIFF_STATES.get(stateType);
             if (diffState == null) {
                 diffState = createReferenceDiffStateState(stateType);
-                referenceDiffStates.put(stateType, diffState);
+                REFERENCE_DIFF_STATES.put(stateType, diffState);
             }
         }
         EncodeResult encodeResult = JsonCodec.encode(state, diffState,
index 831239096a997615d37fde36c875f9205329a576..56a1d7b806ef396546886643fe8cd0e33d8472d5 100644 (file)
@@ -24,7 +24,7 @@ import com.vaadin.util.ReflectTools;
 
 public class LegacyVaadinPortlet extends VaadinPortlet {
 
-    private static final LegacyApplicationUIProvider provider = new LegacyApplicationUIProvider() {
+    private static final LegacyApplicationUIProvider PROVIDER = new LegacyApplicationUIProvider() {
         @Override
         protected LegacyApplication createApplication() {
             VaadinPortlet portlet = VaadinPortlet.getCurrent();
@@ -80,7 +80,7 @@ public class LegacyVaadinPortlet extends VaadinPortlet {
 
     private void onVaadinSessionStarted(VaadinPortletRequest request,
             VaadinPortletSession session) throws PortletException {
-        session.addUIProvider(provider);
+        session.addUIProvider(PROVIDER);
     }
 
     protected boolean shouldCreateApplication(PortletRequest request) {
index 70174fdc32c1492d14e9db38df3016196136b731..b5da2da2a4ab8ce95c0c33afdcb55c917249a386 100644 (file)
@@ -24,7 +24,7 @@ import com.vaadin.util.ReflectTools;
 
 public class LegacyVaadinServlet extends VaadinServlet {
 
-    private static final UIProvider provider = new LegacyApplicationUIProvider() {
+    private static final UIProvider PROVIDER = new LegacyApplicationUIProvider() {
         @Override
         protected LegacyApplication createApplication() {
 
@@ -84,7 +84,7 @@ public class LegacyVaadinServlet extends VaadinServlet {
 
     private void onVaadinSessionStarted(VaadinRequest request,
             VaadinSession session) throws ServletException {
-        session.addUIProvider(provider);
+        session.addUIProvider(PROVIDER);
     }
 
 }
index 9ec7e1282fb647ab24e766b8530e7aa1ba8adb3d..dac57a1bd7f5b3b27743c322d87a5d1aaf8c9cbe 100644 (file)
@@ -177,15 +177,15 @@ public class LocaleService implements Serializable {
 
         localeData.dateFormat = datePattern.trim();
 
-        final boolean twelve_hour_clock = timePattern.indexOf("a") > -1;
+        final boolean twelveHourClock = timePattern.indexOf("a") > -1;
         // TODO there are other possibilities as well, like 'h' in french
         // (ignore them, too complicated)
-        final String hour_min_delimiter = timePattern.indexOf(".") > -1 ? "."
+        final String hourMinDelimiter = timePattern.indexOf(".") > -1 ? "."
                 : ":";
 
-        localeData.twelveHourClock = twelve_hour_clock;
-        localeData.hourMinuteDelimiter = hour_min_delimiter;
-        if (twelve_hour_clock) {
+        localeData.twelveHourClock = twelveHourClock;
+        localeData.hourMinuteDelimiter = hourMinDelimiter;
+        if (twelveHourClock) {
             final String[] ampm = dfs.getAmPmStrings();
             localeData.am = ampm[0];
             localeData.pm = ampm[1];
index 30c8ec48ba41ed2540772e7e250f3c50036c14f1..ba6d0b6ee5ed3e5fc3d8c73117bb4f3bcffedb27 100644 (file)
@@ -68,7 +68,7 @@ public class ServerRpcManager<T extends ServerRpc> implements Serializable {
 
     }
 
-    private static final Map<Class<?>, Class<?>> boxedTypes = new HashMap<>();
+    private static final Map<Class<?>, Class<?>> BOXED_TYPES = new HashMap<>();
     static {
         try {
             Class<?>[] boxClasses = new Class<?>[] { Boolean.class, Byte.class,
@@ -77,7 +77,7 @@ public class ServerRpcManager<T extends ServerRpc> implements Serializable {
             for (Class<?> boxClass : boxClasses) {
                 Field typeField = boxClass.getField("TYPE");
                 Class<?> primitiveType = (Class<?>) typeField.get(boxClass);
-                boxedTypes.put(primitiveType, boxClass);
+                BOXED_TYPES.put(primitiveType, boxClass);
             }
         } catch (Exception e) {
             throw new RuntimeException(e);
index f4e2b4064d6640012358dd7550fe2fd5563d42f3..98b436f489ab3bf15d4c66feda2ec2ef7a9d9409 100644 (file)
@@ -24,7 +24,7 @@ import com.vaadin.shared.communication.ServerRpc;
 
 public class ServerRpcMethodInvocation extends MethodInvocation {
 
-    private static final Map<String, Method> invocationMethodCache = new ConcurrentHashMap<>(
+    private static final Map<String, Method> INVOCATION_METHOD_CACHE = new ConcurrentHashMap<>(
             128, 0.75f, 1);
 
     private final Method method;
@@ -67,14 +67,14 @@ public class ServerRpcMethodInvocation extends MethodInvocation {
         // signature
         String signature = targetType.getName() + "." + methodName + "("
                 + parameterCount;
-        Method invocationMethod = invocationMethodCache.get(signature);
+        Method invocationMethod = INVOCATION_METHOD_CACHE.get(signature);
 
         if (invocationMethod == null) {
             invocationMethod = doFindInvocationMethod(targetType, methodName,
                     parameterCount);
 
             if (invocationMethod != null) {
-                invocationMethodCache.put(signature, invocationMethod);
+                INVOCATION_METHOD_CACHE.put(signature, invocationMethod);
             }
         }
 
index 935f7dd05059a435ea1b1fb6868fb903ec8f6d06..57765164e13fbcec64f10473a9ca7ce5adf24a74 100644 (file)
@@ -32,7 +32,7 @@ import com.vaadin.shared.util.SharedUtil;
 public class SizeWithUnit implements Serializable {
     private final float size;
     private final Unit unit;
-    private static final Pattern sizePattern = Pattern
+    private static final Pattern SIZE_PATTERN = Pattern
             .compile(SharedUtil.SIZE_PATTERN);
 
     /**
@@ -90,7 +90,7 @@ public class SizeWithUnit implements Serializable {
         }
         float size = 0;
         Unit unit = null;
-        Matcher matcher = sizePattern.matcher(s);
+        Matcher matcher = SIZE_PATTERN.matcher(s);
         if (matcher.find()) {
             size = Float.parseFloat(matcher.group(1));
             if (size < 0) {
@@ -107,7 +107,7 @@ public class SizeWithUnit implements Serializable {
             }
         } else {
             throw new IllegalArgumentException("Invalid size argument: \"" + s
-                    + "\" (should match " + sizePattern.pattern() + ")");
+                    + "\" (should match " + SIZE_PATTERN.pattern() + ")");
         }
         return new SizeWithUnit(size, unit);
     }
index 6b8f36ba542cf20506bdee35e5cad5c48c5f651d..9b6e02d0f610f6c29f0d6eef75971f2d92853661 100644 (file)
@@ -41,7 +41,7 @@ public class StreamResource implements ConnectorResource {
     /**
      * Explicit mime-type.
      */
-    private String MIMEType = null;
+    private String mimeType = null;
 
     /**
      * Filename.
@@ -76,8 +76,8 @@ public class StreamResource implements ConnectorResource {
      */
     @Override
     public String getMIMEType() {
-        if (MIMEType != null) {
-            return MIMEType;
+        if (mimeType != null) {
+            return mimeType;
         }
         return FileTypeResolver.getMIMEType(filename);
     }
@@ -85,11 +85,11 @@ public class StreamResource implements ConnectorResource {
     /**
      * Sets the mime type of the resource.
      *
-     * @param MIMEType
+     * @param mimeType
      *            the MIME type to be set.
      */
-    public void setMIMEType(String MIMEType) {
-        this.MIMEType = MIMEType;
+    public void setMIMEType(String mimeType) {
+        this.mimeType = mimeType;
     }
 
     /**
@@ -223,7 +223,7 @@ public class StreamResource implements ConnectorResource {
         } else if (obj instanceof StreamResource) {
             StreamResource that = (StreamResource) obj;
             return SharedUtil.equals(getStreamSource(), that.getStreamSource())
-                    && SharedUtil.equals(MIMEType, that.MIMEType)
+                    && SharedUtil.equals(mimeType, that.mimeType)
                     && SharedUtil.equals(getFilename(), that.getFilename())
                     && getBufferSize() == that.getBufferSize()
                     && getCacheTime() == that.getCacheTime();
@@ -234,7 +234,7 @@ public class StreamResource implements ConnectorResource {
 
     @Override
     public int hashCode() {
-        return Arrays.hashCode(new Object[] { getStreamSource(), MIMEType,
+        return Arrays.hashCode(new Object[] { getStreamSource(), mimeType,
                 getFilename(), getBufferSize(), getCacheTime() });
     }
 
index 74f8e1d013e84e36f0da45da062501ee8ca67702..31053fa77898ee254183eb8ee1ec346b23842607 100644 (file)
@@ -92,15 +92,15 @@ public class ClassPathExplorer {
      * entries that could include widgets/widgetsets are listed (primarily
      * directories, Vaadin JARs and add-on JARs).
      */
-    private static final List<String> rawClasspathEntries = getRawClasspathEntries();
+    private static final List<String> RAW_CLASSPATH_ENTRIES = getRawClasspathEntries();
 
     /**
      * Map from identifiers (either a package name preceded by the path and a
      * slash, or a URL for a JAR file) to the corresponding URLs. This is
      * constructed from the class path.
      */
-    private static final Map<String, URL> classpathLocations = getClasspathLocations(
-            rawClasspathEntries);
+    private static final Map<String, URL> CLASSPATH_LOCATIONS = getClasspathLocations(
+            RAW_CLASSPATH_ENTRIES);
 
     private static boolean debug = false;
 
@@ -138,7 +138,7 @@ public class ClassPathExplorer {
         long start = System.currentTimeMillis();
         Map<String, URL> widgetsets = new HashMap<>();
         Map<String, URL> themes = new HashMap<>();
-        Set<String> keySet = classpathLocations.keySet();
+        Set<String> keySet = CLASSPATH_LOCATIONS.keySet();
         for (String location : keySet) {
             searchForWidgetSetsAndAddonStyles(location, widgetsets, themes);
         }
@@ -179,16 +179,16 @@ public class ClassPathExplorer {
      * "Vaadin-Widgetsets" attribute in its manifest are added to widgetsets.
      *
      * @param locationString
-     *            an entry in {@link #classpathLocations}
+     *            an entry in {@link #CLASSPATH_LOCATIONS}
      * @param widgetsets
      *            a map from widgetset name (including package, with dots as
-     *            separators) to a URL (see {@link #classpathLocations}) - new
+     *            separators) to a URL (see {@link #CLASSPATH_LOCATIONS}) - new
      *            entries are added to this map
      */
     private static void searchForWidgetSetsAndAddonStyles(String locationString,
             Map<String, URL> widgetsets, Map<String, URL> addonStyles) {
 
-        URL location = classpathLocations.get(locationString);
+        URL location = CLASSPATH_LOCATIONS.get(locationString);
         File directory = new File(location.getFile());
 
         if (directory.exists() && !directory.isHidden()) {
@@ -329,12 +329,12 @@ public class ClassPathExplorer {
      * Determine every URL location defined by the current classpath, and it's
      * associated package name.
      *
-     * See {@link #classpathLocations} for information on output format.
+     * See {@link #CLASSPATH_LOCATIONS} for information on output format.
      *
      * @param rawClasspathEntries
      *            raw class path entries as split from the Java class path
      *            string
-     * @return map of classpath locations, see {@link #classpathLocations}
+     * @return map of classpath locations, see {@link #CLASSPATH_LOCATIONS}
      */
     private static final Map<String, URL> getClasspathLocations(
             List<String> rawClasspathEntries) {
@@ -419,7 +419,7 @@ public class ClassPathExplorer {
 
     /**
      * Recursively add subdirectories and jar files to locations - see
-     * {@link #classpathLocations}.
+     * {@link #CLASSPATH_LOCATIONS}.
      *
      * @param name
      * @param file
@@ -465,7 +465,7 @@ public class ClassPathExplorer {
     }
 
     /**
-     * Add a jar file to locations - see {@link #classpathLocations}.
+     * Add a jar file to locations - see {@link #CLASSPATH_LOCATIONS}.
      *
      * @param file
      * @param locations
@@ -522,14 +522,14 @@ public class ClassPathExplorer {
         if (debug) {
             debug("classpathLocations values:");
             List<String> locations = new ArrayList<>(
-                    classpathLocations.keySet());
+                    CLASSPATH_LOCATIONS.keySet());
             for (String location : locations) {
-                debug(String.valueOf(classpathLocations.get(location)));
+                debug(String.valueOf(CLASSPATH_LOCATIONS.get(location)));
             }
         }
 
         URL firstDirectory = null;
-        for (String entry : rawClasspathEntries) {
+        for (String entry : RAW_CLASSPATH_ENTRIES) {
 
             File directory = new File(entry);
             if (directory.exists() && !directory.isHidden()
index 7a87230125aa78ac9036e03468c2afd3bd3af30c..89dd61986ae47e1b1716502febf4c1ccba1cb1d2 100644 (file)
@@ -1251,7 +1251,7 @@ public abstract class AbstractComponent extends AbstractClientConnector
      *         implementation
      */
     protected Collection<String> getCustomAttributes() {
-        List<String> l = new ArrayList<>(Arrays.asList(customAttributes));
+        List<String> l = new ArrayList<>(Arrays.asList(CUSTOM_ATTRIBUTES));
         if (this instanceof Focusable) {
             l.add("tab-index");
             l.add("tabindex");
@@ -1259,7 +1259,7 @@ public abstract class AbstractComponent extends AbstractClientConnector
         return l;
     }
 
-    private static final String[] customAttributes = { "width", "height",
+    private static final String[] CUSTOM_ATTRIBUTES = { "width", "height",
             "debug-id", "error", "width-auto", "height-auto", "width-full",
             "height-full", "size-auto", "size-full", "immediate", "locale",
             "read-only", "_id" };
index 9096d8bc4038c36884d00bce364f5f8b1e893ad6..b8ae5100599fec0b235439a16a59a9c11a711b48 100644 (file)
@@ -280,15 +280,15 @@ public class Upload extends AbstractComponent
          *            the source of the file.
          * @param filename
          *            the received file name.
-         * @param MIMEType
+         * @param mimeType
          *            the MIME type of the received file.
          * @param length
          *            the length of the received file.
          */
-        public FinishedEvent(Upload source, String filename, String MIMEType,
+        public FinishedEvent(Upload source, String filename, String mimeType,
                 long length) {
             super(source);
-            type = MIMEType;
+            type = mimeType;
             this.filename = filename;
             this.length = length;
         }
@@ -346,13 +346,13 @@ public class Upload extends AbstractComponent
          *
          * @param source
          * @param filename
-         * @param MIMEType
+         * @param mimeType
          * @param length
          * @param reason
          */
-        public FailedEvent(Upload source, String filename, String MIMEType,
+        public FailedEvent(Upload source, String filename, String mimeType,
                 long length, Exception reason) {
-            this(source, filename, MIMEType, length);
+            this(source, filename, mimeType, length);
             this.reason = reason;
         }
 
@@ -360,12 +360,12 @@ public class Upload extends AbstractComponent
          *
          * @param source
          * @param filename
-         * @param MIMEType
+         * @param mimeType
          * @param length
          */
-        public FailedEvent(Upload source, String filename, String MIMEType,
+        public FailedEvent(Upload source, String filename, String mimeType,
                 long length) {
-            super(source, filename, MIMEType, length);
+            super(source, filename, mimeType, length);
         }
 
         /**
@@ -388,12 +388,12 @@ public class Upload extends AbstractComponent
          *
          * @param source
          * @param filename
-         * @param MIMEType
+         * @param mimeType
          * @param length
          */
         public NoOutputStreamEvent(Upload source, String filename,
-                String MIMEType, long length) {
-            super(source, filename, MIMEType, length);
+                String mimeType, long length) {
+            super(source, filename, mimeType, length);
         }
     }
 
@@ -406,14 +406,13 @@ public class Upload extends AbstractComponent
          *
          * @param source
          * @param filename
-         * @param MIMEType
+         * @param mimeType
          * @param length
          */
         public NoInputStreamEvent(Upload source, String filename,
-                String MIMEType, long length) {
-            super(source, filename, MIMEType, length);
+                String mimeType, long length) {
+            super(source, filename, mimeType, length);
         }
-
     }
 
     /**
@@ -429,14 +428,13 @@ public class Upload extends AbstractComponent
          *
          * @param source
          * @param filename
-         * @param MIMEType
+         * @param mimeType
          * @param length
          */
-        public SucceededEvent(Upload source, String filename, String MIMEType,
+        public SucceededEvent(Upload source, String filename, String mimeType,
                 long length) {
-            super(source, filename, MIMEType, length);
+            super(source, filename, mimeType, length);
         }
-
     }
 
     /**
@@ -458,14 +456,14 @@ public class Upload extends AbstractComponent
          *
          * @param source
          * @param filename
-         * @param MIMEType
+         * @param mimeType
          * @param contentLength
          */
-        public StartedEvent(Upload source, String filename, String MIMEType,
+        public StartedEvent(Upload source, String filename, String mimeType,
                 long contentLength) {
             super(source);
             this.filename = filename;
-            type = MIMEType;
+            type = mimeType;
             length = contentLength;
         }
 
@@ -783,10 +781,10 @@ public class Upload extends AbstractComponent
      * Emit upload received event.
      *
      * @param filename
-     * @param MIMEType
+     * @param mimeType
      */
-    protected void fireStarted(String filename, String MIMEType) {
-        fireEvent(new Upload.StartedEvent(this, filename, MIMEType,
+    protected void fireStarted(String filename, String mimeType) {
+        fireEvent(new Upload.StartedEvent(this, filename, mimeType,
                 contentLength));
     }
 
@@ -794,29 +792,29 @@ public class Upload extends AbstractComponent
      * Emits the upload failed event.
      *
      * @param filename
-     * @param MIMEType
+     * @param mimeType
      * @param length
      */
-    protected void fireUploadInterrupted(String filename, String MIMEType,
+    protected void fireUploadInterrupted(String filename, String mimeType,
             long length) {
-        fireEvent(new Upload.FailedEvent(this, filename, MIMEType, length));
+        fireEvent(new Upload.FailedEvent(this, filename, mimeType, length));
     }
 
-    protected void fireNoInputStream(String filename, String MIMEType,
+    protected void fireNoInputStream(String filename, String mimeType,
             long length) {
-        fireEvent(new Upload.NoInputStreamEvent(this, filename, MIMEType,
+        fireEvent(new Upload.NoInputStreamEvent(this, filename, mimeType,
                 length));
     }
 
-    protected void fireNoOutputStream(String filename, String MIMEType,
+    protected void fireNoOutputStream(String filename, String mimeType,
             long length) {
-        fireEvent(new Upload.NoOutputStreamEvent(this, filename, MIMEType,
+        fireEvent(new Upload.NoOutputStreamEvent(this, filename, mimeType,
                 length));
     }
 
-    protected void fireUploadInterrupted(String filename, String MIMEType,
+    protected void fireUploadInterrupted(String filename, String mimeType,
             long length, Exception e) {
-        fireEvent(new Upload.FailedEvent(this, filename, MIMEType, length, e));
+        fireEvent(new Upload.FailedEvent(this, filename, mimeType, length, e));
     }
 
     /**
index c508b693f80b39bc094fe963ef41db147fbb0d11..4115edfde0d74f2ad961c24858586e544e840cc4 100644 (file)
@@ -59,7 +59,7 @@ public class DesignAttributeHandler implements Serializable {
         return Logger.getLogger(DesignAttributeHandler.class.getName());
     }
 
-    private static final Map<Class<?>, AttributeCacheEntry> cache = new ConcurrentHashMap<>();
+    private static final Map<Class<?>, AttributeCacheEntry> CACHE = new ConcurrentHashMap<>();
 
     // translates string <-> object
     private static final DesignFormatter FORMATTER = new DesignFormatter();
@@ -145,7 +145,7 @@ public class DesignAttributeHandler implements Serializable {
      */
     public static Collection<String> getSupportedAttributes(Class<?> clazz) {
         resolveSupportedAttributes(clazz);
-        return cache.get(clazz).getAttributes();
+        return CACHE.get(clazz).getAttributes();
     }
 
     /**
@@ -160,7 +160,7 @@ public class DesignAttributeHandler implements Serializable {
         if (clazz == null) {
             throw new IllegalArgumentException("The clazz can not be null");
         }
-        if (cache.containsKey(clazz)) {
+        if (CACHE.containsKey(clazz)) {
             // NO-OP
             return;
         }
@@ -184,7 +184,7 @@ public class DesignAttributeHandler implements Serializable {
                 entry.addAttribute(attribute, getter, setter);
             }
         }
-        cache.put(clazz, entry);
+        CACHE.put(clazz, entry);
     }
 
     /**
@@ -413,7 +413,7 @@ public class DesignAttributeHandler implements Serializable {
     private static Method findSetterForAttribute(Class<?> clazz,
             String attribute) {
         resolveSupportedAttributes(clazz);
-        return cache.get(clazz).getSetter(attribute);
+        return CACHE.get(clazz).getSetter(attribute);
     }
 
     /**
@@ -429,7 +429,7 @@ public class DesignAttributeHandler implements Serializable {
     private static Method findGetterForAttribute(Class<?> clazz,
             String attribute) {
         resolveSupportedAttributes(clazz);
-        return cache.get(clazz).getGetter(attribute);
+        return CACHE.get(clazz).getGetter(attribute);
     }
 
     /**
index 11ed3c259b86496422e0efd3d776ee3c80d76174..46eecde33f283fb4d8a34ba8d7351f96fa942feb 100644 (file)
@@ -185,22 +185,22 @@ public class DesignResourceConverter implements Converter<String, Resource> {
             return ((ExternalResource) value).getURL();
         }
 
-        private static final Map<Class<? extends Resource>, ResourceConverterByProtocol> typeToConverter = new HashMap<>();
+        private static final Map<Class<? extends Resource>, ResourceConverterByProtocol> TYPE_TO_CONVERTER = new HashMap<>();
 
         static {
-            typeToConverter.put(ExternalResource.class, HTTP);
+            TYPE_TO_CONVERTER.put(ExternalResource.class, HTTP);
             // ^ any of non-specialized would actually work
-            typeToConverter.put(ThemeResource.class, THEME);
-            typeToConverter.put(FontIcon.class, FONTICON);
-            typeToConverter.put(FileResource.class, FILE);
+            TYPE_TO_CONVERTER.put(ThemeResource.class, THEME);
+            TYPE_TO_CONVERTER.put(FontIcon.class, FONTICON);
+            TYPE_TO_CONVERTER.put(FileResource.class, FILE);
 
         }
 
         public static ResourceConverterByProtocol byType(
                 Class<? extends Resource> resourceType) {
-            for (Class<?> type : typeToConverter.keySet()) {
+            for (Class<?> type : TYPE_TO_CONVERTER.keySet()) {
                 if (type.isAssignableFrom(resourceType)) {
-                    return typeToConverter.get(type);
+                    return TYPE_TO_CONVERTER.get(type);
                 }
             }
             return null;
index 8c3d93993a7db61dd772bf8f9e3dd8da28cc49f1..0c15abc9ae41a8791efd85cacaa21b9764531b10 100644 (file)
@@ -58,7 +58,7 @@ public class CurrentInstance implements Serializable {
 
     private final WeakReference<Object> instance;
 
-    private static final ThreadLocal<Map<Class<?>, CurrentInstance>> instances = new ThreadLocal<>();
+    private static final ThreadLocal<Map<Class<?>, CurrentInstance>> INSTANCES = new ThreadLocal<>();
 
     private CurrentInstance(Object instance) {
         this.instance = new WeakReference<>(instance);
@@ -73,7 +73,7 @@ public class CurrentInstance implements Serializable {
      *         if there is no current instance.
      */
     public static <T> T get(Class<T> type) {
-        Map<Class<?>, CurrentInstance> map = instances.get();
+        Map<Class<?>, CurrentInstance> map = INSTANCES.get();
         if (map == null) {
             return null;
         }
@@ -97,7 +97,7 @@ public class CurrentInstance implements Serializable {
                 removeStaleInstances(map);
 
                 if (map.isEmpty()) {
-                    instances.remove();
+                    INSTANCES.remove();
                 }
 
                 return null;
@@ -135,14 +135,14 @@ public class CurrentInstance implements Serializable {
      *            the actual instance
      */
     public static <T> CurrentInstance set(Class<T> type, T instance) {
-        Map<Class<?>, CurrentInstance> map = instances.get();
+        Map<Class<?>, CurrentInstance> map = INSTANCES.get();
         CurrentInstance previousInstance = null;
         if (instance == null) {
             // remove the instance
             if (map != null) {
                 previousInstance = map.remove(type);
                 if (map.isEmpty()) {
-                    instances.remove();
+                    INSTANCES.remove();
                     map = null;
                 }
             }
@@ -150,7 +150,7 @@ public class CurrentInstance implements Serializable {
             assert type.isInstance(instance) : "Invald instance type";
             if (map == null) {
                 map = new HashMap<>();
-                instances.set(map);
+                INSTANCES.set(map);
             }
 
             previousInstance = map.put(type, new CurrentInstance(instance));
@@ -165,7 +165,7 @@ public class CurrentInstance implements Serializable {
      * Clears all current instances.
      */
     public static void clearAll() {
-        instances.remove();
+        INSTANCES.remove();
     }
 
     /**
@@ -220,7 +220,7 @@ public class CurrentInstance implements Serializable {
      * @return a map containing the current instances
      */
     public static Map<Class<?>, CurrentInstance> getInstances() {
-        Map<Class<?>, CurrentInstance> map = instances.get();
+        Map<Class<?>, CurrentInstance> map = INSTANCES.get();
         if (map == null) {
             return Collections.emptyMap();
         } else {
@@ -237,7 +237,7 @@ public class CurrentInstance implements Serializable {
             if (removeStale) {
                 removeStaleInstances(map);
                 if (map.isEmpty()) {
-                    instances.remove();
+                    INSTANCES.remove();
                 }
             }
             return copy;
index 48d79169676bceec430cb4ecddb615cffa7e7575..8abaec049097ad0b85b4a28d911184b8f17dd668 100644 (file)
@@ -54,7 +54,7 @@ public class FileTypeResolver implements Serializable {
     /**
      * Initial file extension to mime-type mapping.
      */
-    private static final String initialExtToMIMEMap = "application/cu-seeme                            csm cu,"
+    private static final String INITIAL_EXT_TO_MIME_MAP = "application/cu-seeme                            csm cu,"
             + "application/dsptype                             tsp,"
             + "application/futuresplash                        spl,"
             + "application/mac-binhex40                        hqx,"
@@ -221,7 +221,7 @@ public class FileTypeResolver implements Serializable {
     static {
 
         // Initialize extension to MIME map
-        final StringTokenizer lines = new StringTokenizer(initialExtToMIMEMap,
+        final StringTokenizer lines = new StringTokenizer(INITIAL_EXT_TO_MIME_MAP,
                 ",");
         while (lines.hasMoreTokens()) {
             final String line = lines.nextToken();
@@ -356,24 +356,24 @@ public class FileTypeResolver implements Serializable {
      * @param extension
      *            the filename extension to be associated with
      *            <code>MIMEType</code>.
-     * @param MIMEType
+     * @param mimeType
      *            the new mime-type for <code>extension</code>.
      */
-    public static void addExtension(String extension, String MIMEType) {
-        EXT_TO_MIME_MAP.put(extension.toLowerCase(Locale.ROOT), MIMEType);
+    public static void addExtension(String extension, String mimeType) {
+        EXT_TO_MIME_MAP.put(extension.toLowerCase(Locale.ROOT), mimeType);
     }
 
     /**
      * Adds a icon for the given mime-type. If the mime-type also has a
      * corresponding icon, it is replaced with the new icon.
      *
-     * @param MIMEType
+     * @param mimeType
      *            the mime-type whose icon is to be changed.
      * @param icon
      *            the new icon to be associated with <code>MIMEType</code>.
      */
-    public static void addIcon(String MIMEType, Resource icon) {
-        MIME_TO_ICON_MAP.put(MIMEType, icon);
+    public static void addIcon(String mimeType, Resource icon) {
+        MIME_TO_ICON_MAP.put(mimeType, icon);
     }
 
     /**
index c3c25b21e45209b4b308f9ff9680ecea33774726..fb56c3688e9bb8f95803efd0f5de51dfbdf5b270 100644 (file)
@@ -104,7 +104,7 @@ public final class TimeZoneUtil implements Serializable {
         }
         info.id = zoneId.getId();
         info.transitions = transitionsList.stream().mapToLong(l -> l).toArray();
-        info.std_offset = (int) Duration.ofMillis(timeZone.getRawOffset())
+        info.stdOffset = (int) Duration.ofMillis(timeZone.getRawOffset())
                 .toMinutes();
         info.names = new String[] {
                 timeZone.getDisplayName(false, TimeZone.SHORT, locale),
@@ -119,7 +119,7 @@ public final class TimeZoneUtil implements Serializable {
         JreJsonFactory factory = new JreJsonFactory();
         JsonObject object = factory.createObject();
         object.put("id", info.id);
-        object.put("std_offset", info.std_offset);
+        object.put("std_offset", info.stdOffset);
         object.put("names", getArray(factory, info.names));
         object.put("transitions", getArray(factory, info.transitions));
         return JsonUtil.stringify(object);
@@ -143,7 +143,7 @@ public final class TimeZoneUtil implements Serializable {
 
     private static class TimeZoneInfo implements Serializable {
         String id;
-        int std_offset;
+        int stdOffset;
         String[] names;
         long[] transitions;
     }
index 7b492ad012c814bf518fc0a9a7e18cd0a7ea9f55..d7bc8f4c44536cedd15ea88b89fda9d80232bd03 100644 (file)
@@ -66,7 +66,7 @@ public class BeanPropertySetTest {
         // Simulate deserializing into a different JVM by clearing the instance
         // map
         Field instancesField = BeanPropertySet.class
-                .getDeclaredField("instances");
+                .getDeclaredField("INSTANCES");
         instancesField.setAccessible(true);
         Map<?, ?> instances = (Map<?, ?>) instancesField.get(null);
         instances.clear();
index b4e4f95194dfc7f60f6235aedfc10688100e0c82..368595ef272889817ec1403929b37d9911e747a3 100644 (file)
@@ -88,7 +88,7 @@ public class AbstractClientConnectorTest {
             NoSuchFieldException, SecurityException, InterruptedException,
             ClassNotFoundException {
         Field stateTypeCacheField = AbstractClientConnector.class
-                .getDeclaredField("stateTypeCache");
+                .getDeclaredField("STATE_TYPE_CACHE");
         stateTypeCacheField.setAccessible(true);
         Map<Class<?>, ?> stateTypeCache = (Map<Class<?>, ?>) stateTypeCacheField
                 .get(null);
index 74b8ce7e6d5173d3be02ea04c00c8e112ff92c7f..34d8de2fc644da944dbe88867ccc206d2fadaf38 100644 (file)
@@ -77,7 +77,7 @@ public class CurrentInstanceTest {
     private ThreadLocal<Map<Class<?>, CurrentInstance>> getInternalCurrentInstanceVariable()
             throws SecurityException, NoSuchFieldException,
             IllegalAccessException {
-        Field f = CurrentInstance.class.getDeclaredField("instances");
+        Field f = CurrentInstance.class.getDeclaredField("INSTANCES");
         f.setAccessible(true);
         return (ThreadLocal<Map<Class<?>, CurrentInstance>>) f.get(null);
     }
index 0b993a196db21183db2740a8cf357c3bb03da97f..cd7b26a8e228c22c115b6ecdcf47793943df377a 100644 (file)
@@ -19,7 +19,7 @@ import java.io.Serializable;
 
 public class URLReference implements Serializable {
 
-    private String URL;
+    private String url;
 
     /**
      * Returns the URL that this object refers to.
@@ -29,15 +29,15 @@ public class URLReference implements Serializable {
      * @return The URL for this reference or null if unknown.
      */
     public String getURL() {
-        return URL;
+        return url;
     }
 
     /**
      * Sets the URL that this object refers to.
      *
-     * @param URL
+     * @param url
      */
-    public void setURL(String URL) {
-        this.URL = URL;
+    public void setURL(String url) {
+        this.url = url;
     }
 }
index b52453cda1bb3838bf208ac709d81660b5ecb799..bf21a7311bc22b7aaf3e11e852e36f65f7fda210 100644 (file)
@@ -38,7 +38,7 @@ public class Color implements Serializable {
     private int blue;
     private int alpha;
 
-    private String OUTOFRANGE = "Value must be within the range [0-255]. Was: ";
+    private static final String OUTOFRANGE = "Value must be within the range [0-255]. Was: ";
 
     /**
      * Creates a color that has the specified red, green, blue, and alpha values
index b91f3994d1e52dcba1c69536d16fab02ff1cea7e..3c274b99f126526eead611d49ce252c1840f9718 100644 (file)
@@ -25,6 +25,7 @@ import com.vaadin.testbench.elementsbase.ServerClass;
 
 @ServerClass("com.vaadin.ui.AbstractComponent")
 public class AbstractComponentElement extends AbstractElement {
+
     /**
      * Returns the caption of the Component element.
      *
@@ -32,16 +33,16 @@ public class AbstractComponentElement extends AbstractElement {
      * @return component caption
      */
     public String getCaption() {
-        final String GWT_ID_ATTRIBUTE = "aria-labelledby";
+        final String gwtIdAttribute = "aria-labelledby";
         WebElement captElem = null;
         String captionId = null;
-        captionId = getAttribute(GWT_ID_ATTRIBUTE);
+        captionId = getAttribute(gwtIdAttribute);
         // IE8 getAttribute returns empty string instead of null
         // when there is no attribute with specified name
         if (captionId == null || captionId.isEmpty()) {
             WebElement elem = findElement(
-                    By.xpath(".//*[@" + GWT_ID_ATTRIBUTE + "]"));
-            captionId = elem.getAttribute(GWT_ID_ATTRIBUTE);
+                    By.xpath(".//*[@" + gwtIdAttribute + "]"));
+            captionId = elem.getAttribute(gwtIdAttribute);
         }
         // element ids are unique, we can search the whole page
         captElem = getDriver().findElement(By.id(captionId));
@@ -53,12 +54,11 @@ public class AbstractComponentElement extends AbstractElement {
     }
 
     public boolean isReadOnly() {
-        final String READONLY_CSS_CLASS = "v-readonly";
         String readonlyClass = getAttribute("class");
         // looking for READONLY_CSS_CLASS string
         String[] cssSelectors = readonlyClass.split("\\s");
         for (String selector : cssSelectors) {
-            if (selector.equals(READONLY_CSS_CLASS)) {
+            if (selector.equals("v-readonly")) {
                 return true;
             }
         }