diff options
author | Ahmed Ashour <asashour@yahoo.com> | 2017-09-20 08:18:37 +0200 |
---|---|---|
committer | Henri Sara <henri.sara@gmail.com> | 2017-09-20 10:06:43 +0300 |
commit | d1520204ea3e55acdab5a0d6fb03154ffe50d538 (patch) | |
tree | 218b80c94e0d3e7b1d0a969cc7d56c890f6ab604 /server/src | |
parent | 89693cf4484a44d9bcd960a0fd87c581fb66a269 (diff) | |
download | vaadin-framework-d1520204ea3e55acdab5a0d6fb03154ffe50d538.tar.gz vaadin-framework-d1520204ea3e55acdab5a0d6fb03154ffe50d538.zip |
Use simple class names
Diffstat (limited to 'server/src')
13 files changed, 60 insertions, 50 deletions
diff --git a/server/src/main/java/com/vaadin/event/ListenerMethod.java b/server/src/main/java/com/vaadin/event/ListenerMethod.java index a47aa45334..07fe664d0d 100644 --- a/server/src/main/java/com/vaadin/event/ListenerMethod.java +++ b/server/src/main/java/com/vaadin/event/ListenerMethod.java @@ -18,7 +18,10 @@ package com.vaadin.event; import java.io.IOException; import java.io.NotSerializableException; +import java.io.ObjectInputStream; +import java.io.ObjectOutputStream; import java.io.Serializable; +import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.util.Arrays; import java.util.EventListener; @@ -83,7 +86,7 @@ public class ListenerMethod implements EventListener, Serializable { private int eventArgumentIndex; /* Special serialization to handle method references */ - private void writeObject(java.io.ObjectOutputStream out) + private void writeObject(ObjectOutputStream out) throws IOException { try { out.defaultWriteObject(); @@ -101,7 +104,7 @@ public class ListenerMethod implements EventListener, Serializable { } /* Special serialization to handle method references */ - private void readObject(java.io.ObjectInputStream in) + private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException { in.defaultReadObject(); try { @@ -170,17 +173,17 @@ public class ListenerMethod implements EventListener, Serializable { * eventArgumentIndex is negative, the triggering event object * will not be passed to the trigger method, though it is still * called. - * @throws java.lang.IllegalArgumentException + * @throws IllegalArgumentException * if <code>method</code> is not a member of <code>target</code> * . */ public ListenerMethod(Class<?> eventType, Object target, Method method, Object[] arguments, int eventArgumentIndex) - throws java.lang.IllegalArgumentException { + throws IllegalArgumentException { // Checks that the object is of correct type if (!method.getDeclaringClass().isAssignableFrom(target.getClass())) { - throw new java.lang.IllegalArgumentException( + throw new IllegalArgumentException( "The method " + method.getName() + " cannot be used for the given target: " + target.getClass().getName()); @@ -188,7 +191,7 @@ public class ListenerMethod implements EventListener, Serializable { // Checks that the event argument is null if (eventArgumentIndex >= 0 && arguments[eventArgumentIndex] != null) { - throw new java.lang.IllegalArgumentException( + throw new IllegalArgumentException( "argument[" + eventArgumentIndex + "] must be null"); } @@ -196,7 +199,7 @@ public class ListenerMethod implements EventListener, Serializable { if (eventArgumentIndex >= 0 && !method.getParameterTypes()[eventArgumentIndex] .isAssignableFrom(eventType)) { - throw new java.lang.IllegalArgumentException( + throw new IllegalArgumentException( "The method " + method.getName() + " does not accept the given eventType: " + eventType.getName()); @@ -236,13 +239,13 @@ public class ListenerMethod implements EventListener, Serializable { * eventArgumentIndex is negative, the triggering event object * will not be passed to the trigger method, though it is still * called. - * @throws java.lang.IllegalArgumentException + * @throws IllegalArgumentException * unless exactly one match <code>methodName</code> is found in * <code>target</code>. */ public ListenerMethod(Class<?> eventType, Object target, String methodName, Object[] arguments, int eventArgumentIndex) - throws java.lang.IllegalArgumentException { + throws IllegalArgumentException { // Finds the correct method final Method[] methods = target.getClass().getMethods(); @@ -259,7 +262,7 @@ public class ListenerMethod implements EventListener, Serializable { // Checks that the event argument is null if (eventArgumentIndex >= 0 && arguments[eventArgumentIndex] != null) { - throw new java.lang.IllegalArgumentException( + throw new IllegalArgumentException( "argument[" + eventArgumentIndex + "] must be null"); } @@ -267,7 +270,7 @@ public class ListenerMethod implements EventListener, Serializable { if (eventArgumentIndex >= 0 && !method.getParameterTypes()[eventArgumentIndex] .isAssignableFrom(eventType)) { - throw new java.lang.IllegalArgumentException( + throw new IllegalArgumentException( "The method " + method.getName() + " does not accept the given eventType: " + eventType.getName()); @@ -302,16 +305,16 @@ public class ListenerMethod implements EventListener, Serializable { * the trigger method. * @param arguments * the arguments to be passed to the trigger method. - * @throws java.lang.IllegalArgumentException + * @throws IllegalArgumentException * if <code>method</code> is not a member of <code>target</code> * . */ public ListenerMethod(Class<?> eventType, Object target, Method method, - Object[] arguments) throws java.lang.IllegalArgumentException { + Object[] arguments) throws IllegalArgumentException { // Check that the object is of correct type if (!method.getDeclaringClass().isAssignableFrom(target.getClass())) { - throw new java.lang.IllegalArgumentException( + throw new IllegalArgumentException( "The method " + method.getName() + " cannot be used for the given target: " + target.getClass().getName()); @@ -349,12 +352,12 @@ public class ListenerMethod implements EventListener, Serializable { * <code>java.lang.IllegalArgumentException</code> is thrown. * @param arguments * the arguments to be passed to the trigger method. - * @throws java.lang.IllegalArgumentException + * @throws IllegalArgumentException * unless exactly one match <code>methodName</code> is found in * <code>object</code>. */ public ListenerMethod(Class<?> eventType, Object target, String methodName, - Object[] arguments) throws java.lang.IllegalArgumentException { + Object[] arguments) throws IllegalArgumentException { // Find the correct method final Method[] methods = target.getClass().getMethods(); @@ -395,16 +398,16 @@ public class ListenerMethod implements EventListener, Serializable { * the object instance that contains the trigger method. * @param method * the trigger method. - * @throws java.lang.IllegalArgumentException + * @throws IllegalArgumentException * if <code>method</code> is not a member of <code>object</code> * . */ public ListenerMethod(Class<?> eventType, Object target, Method method) - throws java.lang.IllegalArgumentException { + throws IllegalArgumentException { // Checks that the object is of correct type if (!method.getDeclaringClass().isAssignableFrom(target.getClass())) { - throw new java.lang.IllegalArgumentException( + throw new IllegalArgumentException( "The method " + method.getName() + " cannot be used for the given target: " + target.getClass().getName()); @@ -451,12 +454,12 @@ public class ListenerMethod implements EventListener, Serializable { * the name of the trigger method. If the object does not contain * the method or it contains more than one matching methods * <code>java.lang.IllegalArgumentException</code> is thrown. - * @throws java.lang.IllegalArgumentException + * @throws IllegalArgumentException * unless exactly one match <code>methodName</code> is found in * <code>target</code>. */ public ListenerMethod(Class<?> eventType, Object target, String methodName) - throws java.lang.IllegalArgumentException { + throws IllegalArgumentException { // Finds the correct method final Method[] methods = target.getClass().getMethods(); @@ -518,11 +521,11 @@ public class ListenerMethod implements EventListener, Serializable { method.invoke(target, arguments); } - } catch (final java.lang.IllegalAccessException e) { + } catch (final IllegalAccessException e) { // This should never happen - throw new java.lang.RuntimeException( + throw new RuntimeException( "Internal error - please report", e); - } catch (final java.lang.reflect.InvocationTargetException e) { + } catch (final InvocationTargetException e) { // An exception was thrown by the invocation target. Throw it // forwards. throw new MethodException( diff --git a/server/src/main/java/com/vaadin/event/MethodEventSource.java b/server/src/main/java/com/vaadin/event/MethodEventSource.java index 7e55a5acd1..fd4660184c 100644 --- a/server/src/main/java/com/vaadin/event/MethodEventSource.java +++ b/server/src/main/java/com/vaadin/event/MethodEventSource.java @@ -57,7 +57,7 @@ public interface MethodEventSource extends Serializable { * @param method * the activation method. * @return a registration object for removing the listener - * @throws java.lang.IllegalArgumentException + * @throws IllegalArgumentException * unless <code>method</code> has exactly one match in * <code>object</code> * @throws NullPointerException @@ -95,7 +95,7 @@ public interface MethodEventSource extends Serializable { * @param methodName * the name of the activation method. * @return a registration object for removing the listener - * @throws java.lang.IllegalArgumentException + * @throws IllegalArgumentException * unless <code>method</code> has exactly one match in * <code>object</code> * @throws NullPointerException diff --git a/server/src/main/java/com/vaadin/server/LocaleService.java b/server/src/main/java/com/vaadin/server/LocaleService.java index 416677e1b2..9e47c4fe9b 100644 --- a/server/src/main/java/com/vaadin/server/LocaleService.java +++ b/server/src/main/java/com/vaadin/server/LocaleService.java @@ -152,7 +152,7 @@ public class LocaleService implements Serializable { /* * First day of week (0 = sunday, 1 = monday) */ - final java.util.Calendar cal = new GregorianCalendar(locale); + final Calendar cal = new GregorianCalendar(locale); localeData.firstDayOfWeek = cal.getFirstDayOfWeek() - 1; /* diff --git a/server/src/main/java/com/vaadin/server/PaintTarget.java b/server/src/main/java/com/vaadin/server/PaintTarget.java index cfa22966e4..6d531abc2c 100644 --- a/server/src/main/java/com/vaadin/server/PaintTarget.java +++ b/server/src/main/java/com/vaadin/server/PaintTarget.java @@ -475,7 +475,7 @@ public interface PaintTarget extends Serializable { * @throws PaintException * if the paint operation failed. */ - public void addUIDL(java.lang.String uidl) throws PaintException; + public void addUIDL(String uidl) throws PaintException; /** * Adds text node. All the contents of the text are XML-escaped. diff --git a/server/src/main/java/com/vaadin/ui/ConnectorTracker.java b/server/src/main/java/com/vaadin/ui/ConnectorTracker.java index 54fb5c5822..1bd9f81892 100644 --- a/server/src/main/java/com/vaadin/ui/ConnectorTracker.java +++ b/server/src/main/java/com/vaadin/ui/ConnectorTracker.java @@ -16,6 +16,8 @@ package com.vaadin.ui; import java.io.IOException; +import java.io.ObjectInputStream; +import java.io.ObjectOutputStream; import java.io.Serializable; import java.util.ArrayList; import java.util.Collection; @@ -727,7 +729,7 @@ public class ConnectorTracker implements Serializable { } /* Special serialization to JsonObjects which are not serializable */ - private void writeObject(java.io.ObjectOutputStream out) + private void writeObject(ObjectOutputStream out) throws IOException { out.defaultWriteObject(); // Convert JsonObjects in diff state to String representation as @@ -741,7 +743,7 @@ public class ConnectorTracker implements Serializable { } /* Special serialization to JsonObjects which are not serializable */ - private void readObject(java.io.ObjectInputStream in) + private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException { in.defaultReadObject(); diff --git a/server/src/main/java/com/vaadin/ui/GridLayout.java b/server/src/main/java/com/vaadin/ui/GridLayout.java index a678ee2a00..cc043927e9 100644 --- a/server/src/main/java/com/vaadin/ui/GridLayout.java +++ b/server/src/main/java/com/vaadin/ui/GridLayout.java @@ -627,7 +627,7 @@ public class GridLayout extends AbstractLayout * @author Vaadin Ltd. * @since 3.0 */ - public class OverlapsException extends java.lang.RuntimeException { + public class OverlapsException extends RuntimeException { private final Area existingArea; @@ -683,7 +683,7 @@ public class GridLayout extends AbstractLayout * @author Vaadin Ltd. * @since 3.0 */ - public class OutOfBoundsException extends java.lang.RuntimeException { + public class OutOfBoundsException extends RuntimeException { private final Area areaOutOfBounds; diff --git a/server/src/main/java/com/vaadin/ui/PopupView.java b/server/src/main/java/com/vaadin/ui/PopupView.java index d6671be191..6ce6aafe08 100644 --- a/server/src/main/java/com/vaadin/ui/PopupView.java +++ b/server/src/main/java/com/vaadin/ui/PopupView.java @@ -50,9 +50,9 @@ public class PopupView extends AbstractComponent implements HasComponents { POPUP_VISIBILITY_METHOD = PopupVisibilityListener.class .getDeclaredMethod("popupVisibilityChange", PopupVisibilityEvent.class); - } catch (final java.lang.NoSuchMethodException e) { + } catch (final NoSuchMethodException e) { // This should never happen - throw new java.lang.RuntimeException( + throw new RuntimeException( "Internal error finding methods in PopupView"); } } @@ -84,7 +84,7 @@ public class PopupView extends AbstractComponent implements HasComponents { * @param large * the full, Component-type representation */ - public PopupView(final java.lang.String small, final Component large) { + public PopupView(final String small, final Component large) { this(createContent(small, large)); } @@ -165,7 +165,7 @@ public class PopupView extends AbstractComponent implements HasComponents { if (visible) { visibleComponent = content.getPopupComponent(); if (visibleComponent == null) { - throw new java.lang.IllegalStateException( + throw new IllegalStateException( "PopupView.Content did not return Component to set visible"); } if (visibleComponent.getParent() != null) { diff --git a/server/src/main/java/com/vaadin/ui/TabSheet.java b/server/src/main/java/com/vaadin/ui/TabSheet.java index 3341255553..385c6b5f5c 100644 --- a/server/src/main/java/com/vaadin/ui/TabSheet.java +++ b/server/src/main/java/com/vaadin/ui/TabSheet.java @@ -785,9 +785,9 @@ public class TabSheet extends AbstractComponentContainer SELECTED_TAB_CHANGE_METHOD = SelectedTabChangeListener.class .getDeclaredMethod("selectedTabChange", SelectedTabChangeEvent.class); - } catch (final java.lang.NoSuchMethodException e) { + } catch (final NoSuchMethodException e) { // This should never happen - throw new java.lang.RuntimeException( + throw new RuntimeException( "Internal error finding methods in TabSheet"); } } diff --git a/server/src/main/java/com/vaadin/ui/Upload.java b/server/src/main/java/com/vaadin/ui/Upload.java index 4c6e49cd24..cdc78bae35 100644 --- a/server/src/main/java/com/vaadin/ui/Upload.java +++ b/server/src/main/java/com/vaadin/ui/Upload.java @@ -237,9 +237,9 @@ public class Upload extends AbstractComponent .getDeclaredMethod("uploadStarted", StartedEvent.class); UPLOAD_SUCCEEDED_METHOD = SucceededListener.class .getDeclaredMethod("uploadSucceeded", SucceededEvent.class); - } catch (final java.lang.NoSuchMethodException e) { + } catch (final NoSuchMethodException e) { // This should never happen - throw new java.lang.RuntimeException( + throw new RuntimeException( "Internal error finding methods in Upload"); } } diff --git a/server/src/main/java/com/vaadin/ui/Window.java b/server/src/main/java/com/vaadin/ui/Window.java index a6b2652e49..5a9b19f421 100644 --- a/server/src/main/java/com/vaadin/ui/Window.java +++ b/server/src/main/java/com/vaadin/ui/Window.java @@ -366,9 +366,9 @@ public class Window extends Panel try { WINDOW_CLOSE_METHOD = CloseListener.class .getDeclaredMethod("windowClose", CloseEvent.class); - } catch (final java.lang.NoSuchMethodException e) { + } catch (final NoSuchMethodException e) { // This should never happen - throw new java.lang.RuntimeException( + throw new RuntimeException( "Internal error, window close method not found"); } } @@ -662,9 +662,9 @@ public class Window extends Panel try { WINDOW_RESIZE_METHOD = ResizeListener.class .getDeclaredMethod("windowResized", ResizeEvent.class); - } catch (final java.lang.NoSuchMethodException e) { + } catch (final NoSuchMethodException e) { // This should never happen - throw new java.lang.RuntimeException( + throw new RuntimeException( "Internal error, window resized method not found"); } } diff --git a/server/src/main/java/com/vaadin/util/ReflectTools.java b/server/src/main/java/com/vaadin/util/ReflectTools.java index 4728c76c47..daeb2384b8 100644 --- a/server/src/main/java/com/vaadin/util/ReflectTools.java +++ b/server/src/main/java/com/vaadin/util/ReflectTools.java @@ -18,6 +18,7 @@ package com.vaadin.util; import java.beans.IntrospectionException; import java.beans.PropertyDescriptor; import java.io.Serializable; +import java.lang.reflect.Field; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.lang.reflect.Modifier; @@ -82,7 +83,7 @@ public class ReflectTools implements Serializable { * If the value could not be retrieved */ public static Object getJavaFieldValue(Object object, - java.lang.reflect.Field field) throws IllegalArgumentException, + Field field) throws IllegalArgumentException, IllegalAccessException, InvocationTargetException { PropertyDescriptor pd; try { @@ -126,7 +127,7 @@ public class ReflectTools implements Serializable { * If the value could not be retrieved */ public static Object getJavaFieldValue(Object object, - java.lang.reflect.Field field, Class<?> propertyType) + Field field, Class<?> propertyType) throws IllegalArgumentException, IllegalAccessException, InvocationTargetException { PropertyDescriptor pd; @@ -173,7 +174,7 @@ public class ReflectTools implements Serializable { * If the value could not be assigned to the field */ public static void setJavaFieldValue(Object object, - java.lang.reflect.Field field, Object value) + Field field, Object value) throws IllegalAccessException, IllegalArgumentException, InvocationTargetException { PropertyDescriptor pd; diff --git a/server/src/test/java/com/vaadin/util/ReflectToolsGetFieldValueByTypeTest.java b/server/src/test/java/com/vaadin/util/ReflectToolsGetFieldValueByTypeTest.java index 8972bbb66f..ebba16e0d0 100644 --- a/server/src/test/java/com/vaadin/util/ReflectToolsGetFieldValueByTypeTest.java +++ b/server/src/test/java/com/vaadin/util/ReflectToolsGetFieldValueByTypeTest.java @@ -3,6 +3,8 @@ package com.vaadin.util; import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; +import java.lang.reflect.Field; + import org.junit.Test; public class ReflectToolsGetFieldValueByTypeTest { @@ -23,7 +25,7 @@ public class ReflectToolsGetFieldValueByTypeTest { MySubClass myInstance = new MySubClass(); - java.lang.reflect.Field memberField; + Field memberField; Object fieldValue = false; try { memberField = myInstance.getClass().getField("field"); @@ -50,7 +52,7 @@ public class ReflectToolsGetFieldValueByTypeTest { MySubClass myInstance = new MySubClass(); - java.lang.reflect.Field memberField; + Field memberField; try { memberField = myInstance.getClass().getField("field"); // Should throw an IllegalArgument exception as the mySubClass class diff --git a/server/src/test/java/com/vaadin/util/ReflectToolsGetPrimitiveFieldValueTest.java b/server/src/test/java/com/vaadin/util/ReflectToolsGetPrimitiveFieldValueTest.java index 167ab774f2..57900a36e5 100644 --- a/server/src/test/java/com/vaadin/util/ReflectToolsGetPrimitiveFieldValueTest.java +++ b/server/src/test/java/com/vaadin/util/ReflectToolsGetPrimitiveFieldValueTest.java @@ -2,6 +2,8 @@ package com.vaadin.util; import static org.junit.Assert.assertFalse; +import java.lang.reflect.Field; + import org.junit.Test; public class ReflectToolsGetPrimitiveFieldValueTest { @@ -13,7 +15,7 @@ public class ReflectToolsGetPrimitiveFieldValueTest { MyClass myInstance = new MyClass(); - java.lang.reflect.Field memberField; + Field memberField; Object fieldValue = false; try { memberField = myInstance.getClass().getField("field"); |