You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ni...@apache.org on 2011/12/28 08:50:16 UTC
svn commit: r1225137 - in /camel/branches/camel-2.8.x: ./
camel-core/src/main/java/org/apache/camel/component/properties/
components/camel-velocity/src/test/java/org/apache/camel/component/velocity/
Author: ningjiang
Date: Wed Dec 28 07:50:16 2011
New Revision: 1225137
URL: http://svn.apache.org/viewvc?rev=1225137&view=rev
Log:
Merged revisions 1225077 via svnmerge from
https://svn.apache.org/repos/asf/camel/trunk
........
r1225077 | ningjiang | 2011-12-28 11:04:12 +0800 (Wed, 28 Dec 2011) | 1 line
CAMEL-4834 camel properties component should support not specifying the file location
........
Added:
camel/branches/camel-2.8.x/components/camel-velocity/src/test/java/org/apache/camel/component/velocity/VelocityFileLetterWithPropertyTest.java
- copied unchanged from r1225077, camel/trunk/components/camel-velocity/src/test/java/org/apache/camel/component/velocity/VelocityFileLetterWithPropertyTest.java
Modified:
camel/branches/camel-2.8.x/ (props changed)
camel/branches/camel-2.8.x/camel-core/src/main/java/org/apache/camel/component/properties/PropertiesComponent.java
Propchange: camel/branches/camel-2.8.x/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Dec 28 07:50:16 2011
@@ -1 +1 @@
-/camel/trunk:1212504,1215477,1221565,1224674
+/camel/trunk:1212504,1215477,1221565,1224674,1225077
Propchange: camel/branches/camel-2.8.x/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.
Modified: camel/branches/camel-2.8.x/camel-core/src/main/java/org/apache/camel/component/properties/PropertiesComponent.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.8.x/camel-core/src/main/java/org/apache/camel/component/properties/PropertiesComponent.java?rev=1225137&r1=1225136&r2=1225137&view=diff
==============================================================================
--- camel/branches/camel-2.8.x/camel-core/src/main/java/org/apache/camel/component/properties/PropertiesComponent.java (original)
+++ camel/branches/camel-2.8.x/camel-core/src/main/java/org/apache/camel/component/properties/PropertiesComponent.java Wed Dec 28 07:50:16 2011
@@ -83,19 +83,20 @@ public class PropertiesComponent extends
}
public String parseUri(String uri, String... paths) throws Exception {
- ObjectHelper.notNull(paths, "paths");
-
- // location may contain JVM system property or OS environment variables
- // so we need to parse those
- String[] locations = parseLocations(paths);
-
- // check cache first
- CacheKey key = new CacheKey(locations);
- Properties prop = cache ? cacheMap.get(key) : null;
- if (prop == null) {
- prop = propertiesResolver.resolveProperties(getCamelContext(), locations);
- if (cache) {
- cacheMap.put(key, prop);
+ Properties prop = null;
+ if (paths != null) {
+ // location may contain JVM system property or OS environment variables
+ // so we need to parse those
+ String[] locations = parseLocations(paths);
+
+ // check cache first
+ CacheKey key = new CacheKey(locations);
+ prop = cache ? cacheMap.get(key) : null;
+ if (prop == null) {
+ prop = propertiesResolver.resolveProperties(getCamelContext(), locations);
+ if (cache) {
+ cacheMap.put(key, prop);
+ }
}
}