aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArtur Signell <artur@vaadin.com>2013-06-26 09:41:17 +0300
committerVaadin Code Review <review@vaadin.com>2013-06-26 07:54:32 +0000
commit6c10136ae17f62c37c65805ff8847d86ce1733f7 (patch)
treefd40db14693bf405447d1255cc3bdc703bafb6f2
parent172d704fe372885e81cc83fe768281e40decfb3a (diff)
downloadvaadin-framework-6c10136ae17f62c37c65805ff8847d86ce1733f7.tar.gz
vaadin-framework-6c10136ae17f62c37c65805ff8847d86ce1733f7.zip
Use varargs instead of array where appropriate (#4513)
Change-Id: Ide9349b6afa7e56ae04b7727134971ebf81c0b03
-rw-r--r--server/src/com/vaadin/data/Buffered.java15
-rw-r--r--server/src/com/vaadin/data/Validator.java2
-rw-r--r--server/src/com/vaadin/data/util/BeanItem.java2
-rw-r--r--server/src/com/vaadin/data/util/sqlcontainer/RowId.java2
-rw-r--r--server/src/com/vaadin/data/util/sqlcontainer/TemporaryRowId.java2
-rw-r--r--server/src/com/vaadin/event/ShortcutAction.java6
-rw-r--r--server/src/com/vaadin/server/CompositeErrorMessage.java6
-rw-r--r--server/src/com/vaadin/ui/Form.java2
-rw-r--r--server/src/com/vaadin/ui/Table.java6
9 files changed, 15 insertions, 28 deletions
diff --git a/server/src/com/vaadin/data/Buffered.java b/server/src/com/vaadin/data/Buffered.java
index bbfc04b73a..0d6722f71f 100644
--- a/server/src/com/vaadin/data/Buffered.java
+++ b/server/src/com/vaadin/data/Buffered.java
@@ -152,19 +152,6 @@ public interface Buffered extends Serializable {
}
/**
- * 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.
*
* @param source
@@ -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;
}
diff --git a/server/src/com/vaadin/data/Validator.java b/server/src/com/vaadin/data/Validator.java
index c4f008cb39..4f3fbe2cc3 100644
--- a/server/src/com/vaadin/data/Validator.java
+++ b/server/src/com/vaadin/data/Validator.java
@@ -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(
diff --git a/server/src/com/vaadin/data/util/BeanItem.java b/server/src/com/vaadin/data/util/BeanItem.java
index 24eb2505e4..fc51be8f36 100644
--- a/server/src/com/vaadin/data/util/BeanItem.java
+++ b/server/src/com/vaadin/data/util/BeanItem.java
@@ -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));
}
diff --git a/server/src/com/vaadin/data/util/sqlcontainer/RowId.java b/server/src/com/vaadin/data/util/sqlcontainer/RowId.java
index 8fd8eec697..c375bd5a4a 100644
--- a/server/src/com/vaadin/data/util/sqlcontainer/RowId.java
+++ b/server/src/com/vaadin/data/util/sqlcontainer/RowId.java
@@ -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!");
}
diff --git a/server/src/com/vaadin/data/util/sqlcontainer/TemporaryRowId.java b/server/src/com/vaadin/data/util/sqlcontainer/TemporaryRowId.java
index fbf53121da..03f7f23fdd 100644
--- a/server/src/com/vaadin/data/util/sqlcontainer/TemporaryRowId.java
+++ b/server/src/com/vaadin/data/util/sqlcontainer/TemporaryRowId.java
@@ -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);
}
diff --git a/server/src/com/vaadin/event/ShortcutAction.java b/server/src/com/vaadin/event/ShortcutAction.java
index 78eec53112..5ec4d3bfa0 100644
--- a/server/src/com/vaadin/event/ShortcutAction.java
+++ b/server/src/com/vaadin/event/ShortcutAction.java
@@ -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
diff --git a/server/src/com/vaadin/server/CompositeErrorMessage.java b/server/src/com/vaadin/server/CompositeErrorMessage.java
index 5ae7cfd577..1645285f9b 100644
--- a/server/src/com/vaadin/server/CompositeErrorMessage.java
+++ b/server/src/com/vaadin/server/CompositeErrorMessage.java
@@ -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);
diff --git a/server/src/com/vaadin/ui/Form.java b/server/src/com/vaadin/ui/Form.java
index 9d0bb41cac..706c103cd7 100644
--- a/server/src/com/vaadin/ui/Form.java
+++ b/server/src/com/vaadin/ui/Form.java
@@ -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]);
diff --git a/server/src/com/vaadin/ui/Table.java b/server/src/com/vaadin/ui/Table.java
index a688b2eb45..b5606b4e67 100644
--- a/server/src/com/vaadin/ui/Table.java
+++ b/server/src/com/vaadin/ui/Table.java
@@ -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(