You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by zr...@apache.org on 2017/03/30 13:38:16 UTC
camel git commit: CAMEL-11044-create list with a single element
instead of creating list with asList
Repository: camel
Updated Branches:
refs/heads/master bc9d07700 -> e1d82abd6
CAMEL-11044-create list with a single element instead of creating list with asList
Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/e1d82abd
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/e1d82abd
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/e1d82abd
Branch: refs/heads/master
Commit: e1d82abd6efd7a9a0b9eed9b23b5f25ee1e2825f
Parents: bc9d077
Author: onders86 <on...@gmail.com>
Authored: Thu Mar 30 15:35:13 2017 +0200
Committer: Zoran Regvart <zr...@apache.org>
Committed: Thu Mar 30 15:37:31 2017 +0200
----------------------------------------------------------------------
.../main/java/org/apache/camel/util/EndpointHelper.java | 11 +++--------
1 file changed, 3 insertions(+), 8 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/camel/blob/e1d82abd/camel-core/src/main/java/org/apache/camel/util/EndpointHelper.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/util/EndpointHelper.java b/camel-core/src/main/java/org/apache/camel/util/EndpointHelper.java
index d1ebff3..fd22f55 100644
--- a/camel-core/src/main/java/org/apache/camel/util/EndpointHelper.java
+++ b/camel-core/src/main/java/org/apache/camel/util/EndpointHelper.java
@@ -16,17 +16,14 @@
*/
package org.apache.camel.util;
-import java.net.URI;
import java.net.URISyntaxException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Iterator;
-import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.atomic.AtomicLong;
-import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.util.regex.PatternSyntaxException;
@@ -46,10 +43,6 @@ import org.apache.camel.spi.BrowsableEndpoint;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import static org.apache.camel.util.JsonSchemaHelper.getPropertyDefaultValue;
-import static org.apache.camel.util.JsonSchemaHelper.getPropertyPrefix;
-import static org.apache.camel.util.JsonSchemaHelper.isPropertyMultiValue;
-import static org.apache.camel.util.JsonSchemaHelper.isPropertyRequired;
import static org.apache.camel.util.ObjectHelper.after;
/**
@@ -364,7 +357,9 @@ public final class EndpointHelper {
return (List) bean;
} else {
// The bean is a list element
- return Arrays.asList(elementType.cast(bean));
+ List<T> singleElementList = new ArrayList<T>();
+ singleElementList.add(elementType.cast(bean));
+ return singleElementList;
}
} else { // more than one list element
List<T> result = new ArrayList<T>(elements.size());