]> source.dussan.org Git - vaadin-framework.git/commitdiff
Use varargs instead of array where appropriate (#4513)
authorArtur Signell <artur@vaadin.com>
Wed, 26 Jun 2013 06:41:17 +0000 (09:41 +0300)
committerVaadin Code Review <review@vaadin.com>
Wed, 26 Jun 2013 07:54:32 +0000 (07:54 +0000)
Change-Id: Ide9349b6afa7e56ae04b7727134971ebf81c0b03

server/src/com/vaadin/data/Buffered.java
server/src/com/vaadin/data/Validator.java
server/src/com/vaadin/data/util/BeanItem.java
server/src/com/vaadin/data/util/sqlcontainer/RowId.java
server/src/com/vaadin/data/util/sqlcontainer/TemporaryRowId.java
server/src/com/vaadin/event/ShortcutAction.java
server/src/com/vaadin/server/CompositeErrorMessage.java
server/src/com/vaadin/ui/Form.java
server/src/com/vaadin/ui/Table.java

index bbfc04b73a25c22231f7c4775a96df817501ac0c..0d6722f71fa4f08fdbbf92ae9c12656ff0806f49 100644 (file)
@@ -151,19 +151,6 @@ public interface Buffered extends Serializable {
             this.source = source;
         }
 
-        /**
-         * Creates a source exception from a cause exception.
-         * 
-         * @param source
-         *            the source object implementing the Buffered interface.
-         * @param cause
-         *            the original cause for this exception.
-         */
-        public SourceException(Buffered source, Throwable cause) {
-            this.source = source;
-            causes = new Throwable[] { cause };
-        }
-
         /**
          * Creates a source exception from multiple causes.
          * 
@@ -172,7 +159,7 @@ public interface Buffered extends Serializable {
          * @param causes
          *            the original causes for this exception.
          */
-        public SourceException(Buffered source, Throwable[] causes) {
+        public SourceException(Buffered source, Throwable... causes) {
             this.source = source;
             this.causes = causes;
         }
index c4f008cb39bdc58c46fcac95e218cb074ed05542..4f3fbe2cc34b24d2f0fa4ff8c9362dd7078022b6 100644 (file)
@@ -105,7 +105,7 @@ public interface Validator extends Serializable {
          *            this exception.
          */
         public InvalidValueException(String message,
-                InvalidValueException[] causes) {
+                InvalidValueException... causes) {
             super(message);
             if (causes == null) {
                 throw new NullPointerException(
index 24eb2505e4287680c9cc01a6280572d91c779375..fc51be8f36413c871b0e437c01917573c800a4e3 100644 (file)
@@ -141,7 +141,7 @@ public class BeanItem<BT> extends PropertysetItem {
      * @param propertyIds
      *            ids of the properties.
      */
-    public BeanItem(BT bean, String[] propertyIds) {
+    public BeanItem(BT bean, String... propertyIds) {
         this(bean, Arrays.asList(propertyIds));
     }
 
index 8fd8eec697aad137d46790033f723ff7c58c562a..c375bd5a4a01711ea00892afaa2bd3c173136103 100644 (file)
@@ -34,7 +34,7 @@ public class RowId implements Serializable {
     protected RowId() {
     }
 
-    public RowId(Object[] id) {
+    public RowId(Object... id) {
         if (id == null) {
             throw new IllegalArgumentException("id parameter must not be null!");
         }
index fbf53121da039efa0ba191bf7b7352c74241c68c..03f7f23fdd5f3fa888002254e5835e38be69df29 100644 (file)
@@ -18,7 +18,7 @@ package com.vaadin.data.util.sqlcontainer;
 public class TemporaryRowId extends RowId {
     private static final long serialVersionUID = -641983830469018329L;
 
-    public TemporaryRowId(Object[] id) {
+    public TemporaryRowId(Object... id) {
         super(id);
     }
 
index 78eec5311229f6eac9d5ae68d2b608fc8635170c..5ec4d3bfa0a3c33ded7619a00a0f8db94124c6e0 100644 (file)
@@ -70,7 +70,7 @@ public class ShortcutAction extends Action {
      * @param m
      *            optional modifier keys
      */
-    public ShortcutAction(String caption, int kc, int[] m) {
+    public ShortcutAction(String caption, int kc, int... m) {
         super(caption);
         keyCode = kc;
         modifiers = m;
@@ -91,7 +91,7 @@ public class ShortcutAction extends Action {
      * @param m
      *            optional modifier keys
      */
-    public ShortcutAction(String caption, Resource icon, int kc, int[] m) {
+    public ShortcutAction(String caption, Resource icon, int kc, int... m) {
         super(caption, icon);
         keyCode = kc;
         modifiers = m;
@@ -174,7 +174,7 @@ public class ShortcutAction extends Action {
      * @param shorthandCaption
      * @param modifierKeys
      */
-    public ShortcutAction(String shorthandCaption, int[] modifierKeys) {
+    public ShortcutAction(String shorthandCaption, int... modifierKeys) {
         // && -> & etc
         super(SHORTHAND_ESCAPE.matcher(shorthandCaption).replaceAll("$1$2$3"));
         // replace escaped chars with something that won't accidentally match
index 5ae7cfd57734e12b3158c1b5402d4ef5bbfeac9a..1645285f9b1217ad318e3b6f67986e9bdc5082e7 100644 (file)
@@ -32,10 +32,10 @@ public class CompositeErrorMessage extends AbstractErrorMessage {
      * Constructor for CompositeErrorMessage.
      * 
      * @param errorMessages
-     *            the Array of error messages that are listed togeter. Nulls are
-     *            ignored, but at least one message is required.
+     *            the array of error messages that are listed together. Nulls
+     *            are ignored, but at least one message is required.
      */
-    public CompositeErrorMessage(ErrorMessage[] errorMessages) {
+    public CompositeErrorMessage(ErrorMessage... errorMessages) {
         super(null);
         setErrorLevel(ErrorLevel.INFORMATION);
 
index 9d0bb41cac8c97d358466159c99570eeb2e9e9f1..706c103cd7cf53db169e2883a2588baf133eaa32 100644 (file)
@@ -1131,7 +1131,7 @@ public class Form extends AbstractField<Object> implements Item.Editor,
      * @param visibleProperties
      *            the visibleProperties to set.
      */
-    public void setVisibleItemProperties(Object[] visibleProperties) {
+    public void setVisibleItemProperties(Object... visibleProperties) {
         LinkedList<Object> v = new LinkedList<Object>();
         for (int i = 0; i < visibleProperties.length; i++) {
             v.add(visibleProperties[i]);
index a688b2eb4533d46c35c310184ccde317ede173b3..b5606b4e6738ef2850a966fd524e3a9f23e16206 100644 (file)
@@ -623,7 +623,7 @@ public class Table extends AbstractSelect implements Action.Container,
      * @param visibleColumns
      *            the Array of shown property id:s.
      */
-    public void setVisibleColumns(Object[] visibleColumns) {
+    public void setVisibleColumns(Object... visibleColumns) {
 
         // Visible columns must exist
         if (visibleColumns == null) {
@@ -722,7 +722,7 @@ public class Table extends AbstractSelect implements Action.Container,
      *            the Array of column headers that match the
      *            {@link #getVisibleColumns()} method.
      */
-    public void setColumnHeaders(String[] columnHeaders) {
+    public void setColumnHeaders(String... columnHeaders) {
 
         if (columnHeaders.length != visibleColumns.size()) {
             throw new IllegalArgumentException(
@@ -781,7 +781,7 @@ public class Table extends AbstractSelect implements Action.Container,
      *            the Array of icons that match the {@link #getVisibleColumns()}
      *            .
      */
-    public void setColumnIcons(Resource[] columnIcons) {
+    public void setColumnIcons(Resource... columnIcons) {
 
         if (columnIcons.length != visibleColumns.size()) {
             throw new IllegalArgumentException(