Browse Source

Use varargs instead of array where appropriate (#4513)

Change-Id: Ide9349b6afa7e56ae04b7727134971ebf81c0b03
tags/7.1.1
Artur Signell 11 years ago
parent
commit
6c10136ae1

+ 1
- 14
server/src/com/vaadin/data/Buffered.java View 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;
}

+ 1
- 1
server/src/com/vaadin/data/Validator.java View 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(

+ 1
- 1
server/src/com/vaadin/data/util/BeanItem.java View 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));
}


+ 1
- 1
server/src/com/vaadin/data/util/sqlcontainer/RowId.java View 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!");
}

+ 1
- 1
server/src/com/vaadin/data/util/sqlcontainer/TemporaryRowId.java View 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);
}


+ 3
- 3
server/src/com/vaadin/event/ShortcutAction.java View 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

+ 3
- 3
server/src/com/vaadin/server/CompositeErrorMessage.java View 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);


+ 1
- 1
server/src/com/vaadin/ui/Form.java View 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]);

+ 3
- 3
server/src/com/vaadin/ui/Table.java View 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(

Loading…
Cancel
Save