Author: ningjiang Date: Fri Apr 12 06:49:50 2013 New Revision: 1467175 URL: http://svn.apache.org/r1467175 Log: CAMEL-6262 close the input steam inside the ServiceSupport Merged revisions 1467172 via svnmerge from https://svn.apache.org/repos/asf/camel/branches/camel-2.10.x
................ r1467172 | ningjiang | 2013-04-12 14:35:23 +0800 (Fri, 12 Apr 2013) | 14 lines Merged revisions 1467165-1467166 via svnmerge from https://svn.apache.org/repos/asf/camel/trunk ........ r1467165 | ningjiang | 2013-04-12 12:13:09 +0800 (Fri, 12 Apr 2013) | 1 line CAMEL-6262 close the input steam inside the ServiceSupport ........ r1467166 | ningjiang | 2013-04-12 12:16:35 +0800 (Fri, 12 Apr 2013) | 1 line CAMEL-6262 fix the CS errors ........ ................ Modified: camel/branches/camel-2.9.x/ (props changed) camel/branches/camel-2.9.x/camel-core/src/main/java/org/apache/camel/support/ServiceSupport.java Propchange: camel/branches/camel-2.9.x/ ------------------------------------------------------------------------------ Merged /camel/trunk:r1467165-1467166 Merged /camel/branches/camel-2.10.x:r1467172 Propchange: camel/branches/camel-2.9.x/ ------------------------------------------------------------------------------ Binary property 'svnmerge-integrated' - no diff available. Modified: camel/branches/camel-2.9.x/camel-core/src/main/java/org/apache/camel/support/ServiceSupport.java URL: http://svn.apache.org/viewvc/camel/branches/camel-2.9.x/camel-core/src/main/java/org/apache/camel/support/ServiceSupport.java?rev=1467175&r1=1467174&r2=1467175&view=diff ============================================================================== --- camel/branches/camel-2.9.x/camel-core/src/main/java/org/apache/camel/support/ServiceSupport.java (original) +++ camel/branches/camel-2.9.x/camel-core/src/main/java/org/apache/camel/support/ServiceSupport.java Fri Apr 12 06:49:50 2013 @@ -16,12 +16,15 @@ */ package org.apache.camel.support; +import java.io.IOException; import java.io.InputStream; import java.util.Properties; import java.util.concurrent.atomic.AtomicBoolean; import org.apache.camel.ServiceStatus; import org.apache.camel.StatefulService; +import org.apache.camel.util.IOHelper; +import org.apache.camel.util.ObjectHelper; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -273,17 +276,21 @@ public abstract class ServiceSupport imp if (version != null) { return version; } - + InputStream is = null; // try to load from maven properties first try { Properties p = new Properties(); - InputStream is = getClass().getResourceAsStream("/META-INF/maven/org.apache.camel/camel-core/pom.properties"); + is = getClass().getResourceAsStream("/META-INF/maven/org.apache.camel/camel-core/pom.properties"); if (is != null) { p.load(is); version = p.getProperty("version", ""); } } catch (Exception e) { // ignore + } finally { + if (is != null) { + IOHelper.close(is, null, null); + } } // fallback to using Java API