Permalink
Browse files

Change signatures to make use of Java 5 varargs

Issues: SWF-1532
  • Loading branch information...
Phillip Webb
Phillip Webb committed Apr 5, 2012
1 parent 53384ad commit 54a300e009cdbdb8ead165df709f8f0d392d818e
Showing with 39 additions and 39 deletions.
  1. +1 −1 ...nding/src/main/java/org/springframework/binding/expression/support/CompositeStringExpression.java
  2. +1 −1 spring-binding/src/main/java/org/springframework/binding/expression/support/FluentParserContext.java
  3. +3 −3 spring-binding/src/main/java/org/springframework/binding/message/MessageBuilder.java
  4. +1 −1 spring-binding/src/main/java/org/springframework/binding/method/MethodKey.java
  5. +2 −2 spring-binding/src/main/java/org/springframework/binding/method/Parameters.java
  6. +2 −2 spring-faces/src/main/java/org/springframework/faces/webflow/FlowApplication.java
  7. +1 −1 spring-faces/src/test/java/org/springframework/faces/webflow/FlowActionListenerTests.java
  8. +1 −1 spring-faces/src/test/java/org/springframework/faces/webflow/MockApplication.java
  9. +1 −1 spring-webflow/src/main/java/org/springframework/webflow/action/CompositeAction.java
  10. +2 −2 spring-webflow/src/main/java/org/springframework/webflow/action/DispatchMethodInvoker.java
  11. +3 −3 spring-webflow/src/main/java/org/springframework/webflow/action/RenderAction.java
  12. +3 −3 spring-webflow/src/main/java/org/springframework/webflow/config/FlowRegistryFactoryBean.java
  13. +2 −2 spring-webflow/src/main/java/org/springframework/webflow/core/collection/CollectionUtils.java
  14. +1 −1 spring-webflow/src/main/java/org/springframework/webflow/engine/ActionList.java
  15. +1 −1 spring-webflow/src/main/java/org/springframework/webflow/engine/Flow.java
  16. +1 −1 ...ng-webflow/src/main/java/org/springframework/webflow/engine/FlowExecutionExceptionHandlerSet.java
  17. +1 −1 spring-webflow/src/main/java/org/springframework/webflow/engine/TransitionSet.java
  18. +1 −1 spring-webflow/src/main/java/org/springframework/webflow/engine/ViewState.java
  19. +1 −1 spring-webflow/src/main/java/org/springframework/webflow/engine/impl/FlowExecutionListeners.java
  20. +2 −2 ...ng-webflow/src/main/java/org/springframework/webflow/engine/support/ActionTransitionCriteria.java
  21. +2 −2 spring-webflow/src/main/java/org/springframework/webflow/engine/support/TransitionCriteriaChain.java
  22. +3 −3 ...main/java/org/springframework/webflow/execution/factory/FlowExecutionListenerCriteriaFactory.java
  23. +3 −3 ...rc/main/java/org/springframework/webflow/execution/factory/StaticFlowExecutionListenerLoader.java
@@ -36,7 +36,7 @@
* @param expressions the ordered set of expressions that when evaluated will have their results stringed together
* to build the composite string
*/
- public CompositeStringExpression(Expression[] expressions) {
+ public CompositeStringExpression(Expression... expressions) {
this.expressions = expressions;
}
@@ -99,7 +99,7 @@ public FluentParserContext variable(ExpressionVariable variable) {
* @param variables the expression variables
* @return this
*/
- public FluentParserContext variables(ExpressionVariable[] variables) {
+ public FluentParserContext variables(ExpressionVariable... variables) {
expressionVariables.addAll(Arrays.asList(variables));
return this;
}
@@ -117,7 +117,7 @@ public MessageBuilder code(String code) {
* @param codes the message codes; if null, no changes will be made
* @return this, for fluent API usage
*/
- public MessageBuilder codes(String[] codes) {
+ public MessageBuilder codes(String... codes) {
if (codes == null) {
return this;
}
@@ -142,7 +142,7 @@ public MessageBuilder arg(Object arg) {
* @param args the message argument values, if null no changes will be made
* @return this, for fluent API usage
*/
- public MessageBuilder args(Object[] args) {
+ public MessageBuilder args(Object... args) {
if (args == null) {
return this;
}
@@ -169,7 +169,7 @@ public MessageBuilder resolvableArg(Object arg) {
* @param args the resolvable message arguments
* @return this, for fluent API usage
*/
- public MessageBuilder resolvableArgs(Object[] args) {
+ public MessageBuilder resolvableArgs(Object... args) {
if (args == null) {
return this;
}
@@ -58,7 +58,7 @@
* @param methodName the method name
* @param parameterTypes the method's parameter types, or <code>null</code> if the method has no parameters
*/
- public MethodKey(Class<?> declaredType, String methodName, Class<?>[] parameterTypes) {
+ public MethodKey(Class<?> declaredType, String methodName, Class<?>... parameterTypes) {
Assert.notNull(declaredType, "The method's declared type is required");
Assert.notNull(methodName, "The method name is required");
this.declaredType = declaredType;
@@ -65,7 +65,7 @@ public Parameters(Parameter parameter) {
* Create a parameter list from the parameter array.
* @param parameters the parameters
*/
- public Parameters(Parameter[] parameters) {
+ public Parameters(Parameter... parameters) {
this.parameters = new ArrayList<Parameter>(parameters.length);
addAll(parameters);
}
@@ -82,7 +82,7 @@ public boolean add(Parameter parameter) {
* Add new parameters to this list.
* @param parameters the parameters
*/
- public boolean addAll(Parameter[] parameters) {
+ public boolean addAll(Parameter... parameters) {
return this.parameters.addAll(Arrays.asList(parameters));
}
@@ -1,5 +1,5 @@
/*
- * Copyright 2004-2010 the original author or authors.
+ * Copyright 2004-2012 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -161,7 +161,7 @@ public Converter createConverter(Class<?> targetClass) {
return delegate.createConverter(targetClass);
}
- public MethodBinding createMethodBinding(String ref, Class<?>[] params) throws ReferenceSyntaxException {
+ public MethodBinding createMethodBinding(String ref, Class<?>... params) throws ReferenceSyntaxException {
return delegate.createMethodBinding(ref, params);
}
@@ -83,7 +83,7 @@ public MethodBindingStub(String result) {
return String.class;
}
- public Object invoke(FacesContext context, Object[] args) throws EvaluationException, MethodNotFoundException {
+ public Object invoke(FacesContext context, Object... args) throws EvaluationException, MethodNotFoundException {
return this.result;
}
@@ -141,7 +141,7 @@ public Converter createConverter(Class<?> targetClass) {
return null;
}
- public MethodBinding createMethodBinding(String ref, Class<?>[] params) throws ReferenceSyntaxException {
+ public MethodBinding createMethodBinding(String ref, Class<?>... params) throws ReferenceSyntaxException {
return null;
}
@@ -62,7 +62,7 @@
* Create a composite action composed of given actions.
* @param actions the actions
*/
- public CompositeAction(Action[] actions) {
+ public CompositeAction(Action... actions) {
Assert.notEmpty(actions, "At least one action is required");
this.actions = actions;
}
@@ -64,7 +64,7 @@ public Method create(String key) {
* @param target the target to dispatch to
* @param parameterTypes the parameter types defining the argument signature of the dispatch methods
*/
- public DispatchMethodInvoker(Object target, Class<?>[] parameterTypes) {
+ public DispatchMethodInvoker(Object target, Class<?>... parameterTypes) {
Assert.notNull(target, "The target of a dispatch method invocation is required");
this.target = target;
this.parameterTypes = parameterTypes;
@@ -92,7 +92,7 @@ public Object getTarget() {
* @throws MethodLookupException when the method cannot be resolved
* @throws Exception when the invoked method throws an exception
*/
- public Object invoke(String methodName, Object[] arguments) throws MethodLookupException, Exception {
+ public Object invoke(String methodName, Object... arguments) throws MethodLookupException, Exception {
try {
Method dispatchMethod = getDispatchMethod(methodName);
return dispatchMethod.invoke(target, arguments);
@@ -1,5 +1,5 @@
/*
- * Copyright 2004-2008 the original author or authors.
+ * Copyright 2004-2012 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -38,7 +38,7 @@
* Creates a new render action.
* @param fragmentExpressions the set of expressions to resolve the view fragments to render
*/
- public RenderAction(Expression[] fragmentExpressions) {
+ public RenderAction(Expression... fragmentExpressions) {
if (fragmentExpressions == null || fragmentExpressions.length == 0) {
throw new IllegalArgumentException(
"You must provide at least one fragment expression to this render action");
@@ -59,4 +59,4 @@ protected Event doExecute(RequestContext context) throws Exception {
public String toString() {
return new ToStringCreator(this).append("fragments", fragmentExpressions).toString();
}
-}
+}
@@ -85,22 +85,22 @@
* Flow definitions defined in external files that should be registered in the registry produced by this factory
* bean.
*/
- public void setFlowLocations(FlowLocation[] flowLocations) {
+ public void setFlowLocations(FlowLocation... flowLocations) {
this.flowLocations = flowLocations;
}
/**
* Resolvable path patterns to flows to register in the registry produced by this factory bean.
*/
- public void setFlowLocationPatterns(String[] flowLocationPatterns) {
+ public void setFlowLocationPatterns(String... flowLocationPatterns) {
this.flowLocationPatterns = flowLocationPatterns;
}
/**
* Java {@link FlowBuilder flow builder} classes that should be registered in the registry produced by this factory
* bean.
*/
- public void setFlowBuilders(FlowBuilderInfo[] flowBuilders) {
+ public void setFlowBuilders(FlowBuilderInfo... flowBuilders) {
this.flowBuilders = flowBuilders;
}
@@ -78,7 +78,7 @@ private CollectionUtils() {
* @param objects the objects to add
* @return whether or not the target collection changed
*/
- public static <T> boolean addAllNoDuplicates(List<T> target, T[] objects) {
+ public static <T> boolean addAllNoDuplicates(List<T> target, T... objects) {
if (objects == null || objects.length == 0) {
return false;
} else {
@@ -137,4 +137,4 @@ public void remove() throws UnsupportedOperationException {
throw new UnsupportedOperationException("Not supported");
}
}
-}
+}
@@ -59,7 +59,7 @@ public boolean add(Action action) {
* @param actions the actions to add
* @return true if this list's contents changed as a result of the add operation
*/
- public boolean addAll(Action[] actions) {
+ public boolean addAll(Action... actions) {
if (actions == null) {
return false;
}
@@ -369,7 +369,7 @@ public void addVariable(FlowVariable variable) {
* Adds flow variables.
* @param variables the variables
*/
- public void addVariables(FlowVariable[] variables) {
+ public void addVariables(FlowVariable... variables) {
if (variables == null) {
return;
}
@@ -56,7 +56,7 @@ public boolean add(FlowExecutionExceptionHandler exceptionHandler) {
* @param exceptionHandlers the exception handlers to add
* @return true if this set's contents changed as a result of the add operation
*/
- public boolean addAll(FlowExecutionExceptionHandler[] exceptionHandlers) {
+ public boolean addAll(FlowExecutionExceptionHandler... exceptionHandlers) {
return CollectionUtils.addAllNoDuplicates(this.exceptionHandlers, exceptionHandlers);
}
@@ -55,7 +55,7 @@ public boolean add(Transition transition) {
* @param transitions the transitions to add
* @return true if this set's contents changed as a result of the add operation
*/
- public boolean addAll(Transition[] transitions) {
+ public boolean addAll(Transition... transitions) {
return CollectionUtils.addAllNoDuplicates(this.transitions, transitions);
}
@@ -96,7 +96,7 @@ public void addVariable(ViewVariable variable) {
* Adds a set of view variables.
* @param variables the variables
*/
- public void addVariables(ViewVariable[] variables) {
+ public void addVariables(ViewVariable... variables) {
for (ViewVariable variable : variables) {
addVariable(variable);
}
@@ -56,7 +56,7 @@ public FlowExecutionListeners() {
* Create a flow execution listener helper that wraps the specified listener array.
* @param listeners the listener array
*/
- public FlowExecutionListeners(FlowExecutionListener[] listeners) {
+ public FlowExecutionListeners(FlowExecutionListener... listeners) {
if (listeners != null) {
this.listeners = listeners;
} else {
@@ -66,7 +66,7 @@ public ActionTransitionCriteria(Action action) {
* false otherwise).
* @param trueEventIds the true result event IDs
*/
- public void setTrueEventIds(String[] trueEventIds) {
+ public void setTrueEventIds(String... trueEventIds) {
this.trueEventIds = trueEventIds;
}
@@ -91,4 +91,4 @@ private boolean isTrueEvent(String eventId) {
}
return false;
}
-}
+}
@@ -49,7 +49,7 @@ public TransitionCriteriaChain() {
* Creates a transition criteria chain with the specified criteria.
* @param criteria the criteria
*/
- public TransitionCriteriaChain(TransitionCriteria[] criteria) {
+ public TransitionCriteriaChain(TransitionCriteria... criteria) {
criteriaChain.addAll(Arrays.asList(criteria));
}
@@ -82,7 +82,7 @@ public String toString() {
* Create a transition criteria chain chaining given list of actions.
* @param actions the actions (and their execution properties) to chain together
*/
- public static TransitionCriteria criteriaChainFor(Action[] actions) {
+ public static TransitionCriteria criteriaChainFor(Action... actions) {
if (actions == null || actions.length == 0) {
return WildcardTransitionCriteria.INSTANCE;
}
@@ -64,7 +64,7 @@ public FlowExecutionListenerCriteria flow(String flowId) {
* Returns a criteria that just matches a flow if it is identified by one of the specified ids.
* @param flowIds the flow ids to match
*/
- public FlowExecutionListenerCriteria flows(String[] flowIds) {
+ public FlowExecutionListenerCriteria flows(String... flowIds) {
return new FlowIdFlowExecutionListenerCriteria(flowIds);
}
@@ -96,7 +96,7 @@ public String toString() {
* Create a new flow id matching flow execution listener criteria implementation.
* @param flowIds the flow ids to match
*/
- public FlowIdFlowExecutionListenerCriteria(String[] flowIds) {
+ public FlowIdFlowExecutionListenerCriteria(String... flowIds) {
Assert.notEmpty(flowIds, "The flow id array is required");
this.flowIds = flowIds;
}
@@ -114,4 +114,4 @@ public String toString() {
return new ToStringCreator(this).append("flowIds", StylerUtils.style(flowIds)).toString();
}
}
-}
+}
@@ -1,5 +1,5 @@
/*
- * Copyright 2004-2008 the original author or authors.
+ * Copyright 2004-2012 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -52,7 +52,7 @@ public StaticFlowExecutionListenerLoader(FlowExecutionListener listener) {
* should not attempt to modify the passed in array as no deep copy is made.
* @param listeners the listener array.
*/
- public StaticFlowExecutionListenerLoader(FlowExecutionListener[] listeners) {
+ public StaticFlowExecutionListenerLoader(FlowExecutionListener... listeners) {
Assert.notNull(listeners, "The flow execution listener array is required");
this.listeners = listeners;
}
@@ -67,4 +67,4 @@ private StaticFlowExecutionListenerLoader() {
public FlowExecutionListener[] getListeners(FlowDefinition flowDefinition) {
return listeners;
}
-}
+}

0 comments on commit 54a300e

Please sign in to comment.