camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ningji...@apache.org
Subject svn commit: r1467172 - in /camel/branches/camel-2.10.x: ./ camel-core/src/main/java/org/apache/camel/support/ServiceSupport.java components/camel-jms/
Date Fri, 12 Apr 2013 06:35:23 GMT
Author: ningjiang
Date: Fri Apr 12 06:35:23 2013
New Revision: 1467172

URL: http://svn.apache.org/r1467172
Log:
CAMEL-6262 close the input steam inside the ServiceSupport
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.10.x/   (props changed)
    camel/branches/camel-2.10.x/camel-core/src/main/java/org/apache/camel/support/ServiceSupport.java
    camel/branches/camel-2.10.x/components/camel-jms/   (props changed)

Propchange: camel/branches/camel-2.10.x/
------------------------------------------------------------------------------
  Merged /camel/trunk:r1467165-1467166

Propchange: camel/branches/camel-2.10.x/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.

Modified: camel/branches/camel-2.10.x/camel-core/src/main/java/org/apache/camel/support/ServiceSupport.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.10.x/camel-core/src/main/java/org/apache/camel/support/ServiceSupport.java?rev=1467172&r1=1467171&r2=1467172&view=diff
==============================================================================
--- camel/branches/camel-2.10.x/camel-core/src/main/java/org/apache/camel/support/ServiceSupport.java
(original)
+++ camel/branches/camel-2.10.x/camel-core/src/main/java/org/apache/camel/support/ServiceSupport.java
Fri Apr 12 06:35:23 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

Propchange: camel/branches/camel-2.10.x/components/camel-jms/
------------------------------------------------------------------------------
  Merged /camel/trunk/components/camel-jms:r1467165-1467166



Mime
View raw message