import com.vaadin.server.SerializableFunction;
import com.vaadin.server.SerializablePredicate;
import com.vaadin.util.ReflectTools;
+import java.util.Arrays;
/**
* A {@code Binder} subclass specialized for binding <em>beans</em>: classes
ArrayList<Field> memberFieldInOrder = new ArrayList<>();
while (searchClass != null) {
- for (Field memberField : searchClass.getDeclaredFields()) {
- memberFieldInOrder.add(memberField);
- }
+ memberFieldInOrder.addAll(Arrays.asList(searchClass.getDeclaredFields()));
searchClass = searchClass.getSuperclass();
}
return memberFieldInOrder;
import com.vaadin.server.PaintTarget;
import com.vaadin.server.VariableOwner;
import com.vaadin.ui.Component;
+import java.util.Arrays;
/**
* Javadoc TODO
for (Action.Handler h : actionHandlers) {
Action[] as = h.getActions(target, sender);
if (as != null) {
- for (Action a : as) {
- actions.add(a);
- }
+ actions.addAll(Arrays.asList(as));
}
}
}
method.invoke(target, new Object[] { event });
} else {
final Object[] arg = new Object[arguments.length];
- for (int i = 0; i < arg.length; i++) {
- arg[i] = arguments[i];
- }
+ System.arraycopy(arguments, 0, arg, 0, arg.length);
arg[eventArgumentIndex] = event;
method.invoke(target, arg);
}
import java.util.logging.Logger;
import com.vaadin.ui.Component;
+import java.util.Arrays;
/**
* Binder utility that binds member fields of a design class instance to given
Class<?> searchClass) {
ArrayList<java.lang.reflect.Field> memberFields = new ArrayList<>();
- for (java.lang.reflect.Field memberField : searchClass
- .getDeclaredFields()) {
- memberFields.add(memberField);
- }
+ memberFields.addAll(Arrays.asList(searchClass
+ .getDeclaredFields()));
return memberFields;
}
import org.junit.Test;
import com.vaadin.ui.Component;
+import java.util.Arrays;
public class ClassesSerializableTest {
}
String[] split = classpath.split(pathSep);
- for (String classpathEntry : split) {
- locations.add(classpathEntry);
- }
+ locations.addAll(Arrays.asList(split));
return locations;
}