incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r1346477 - /sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/InternalResource.java
Date Tue, 05 Jun 2012 17:14:46 GMT
Author: cziegeler
Date: Tue Jun  5 17:14:46 2012
New Revision: 1346477

URL: http://svn.apache.org/viewvc?rev=1346477&view=rev
Log:
SLING-2476 : Sling installer swallows exceptions for properties config file parsing

Modified:
    sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/InternalResource.java

Modified: sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/InternalResource.java
URL: http://svn.apache.org/viewvc/sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/InternalResource.java?rev=1346477&r1=1346476&r2=1346477&view=diff
==============================================================================
--- sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/InternalResource.java
(original)
+++ sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/InternalResource.java
Tue Jun  5 17:14:46 2012
@@ -94,9 +94,10 @@ public class InternalResource extends In
         if ( is != null &&
              (InstallableResource.TYPE_PROPERTIES.equals(type) ||
               ((type == null || InstallableResource.TYPE_FILE.equals(type)) && isConfigExtension(resource.getId()))))
{
-            dict = readDictionary(is, getExtension(resource.getId()));
-            if ( dict == null ) {
-                throw new IOException("Unable to read dictionary from input stream: " + resource.getId());
+            try {
+                dict = readDictionary(is, getExtension(resource.getId()));
+            } catch (final IOException ioe) {
+                throw (IOException)new IOException("Unable to read dictionary from input
stream: " + resource.getId()).initCause(ioe);
             }
             is = null;
         }
@@ -214,11 +215,11 @@ public class InternalResource extends In
      * - *.config files are handled by the Apache Felix ConfigAdmin file reader
      * @param is
      * @param extension
-     * @return
      * @throws IOException
      */
     private static Dictionary<String, Object> readDictionary(
-            final InputStream is, final String extension) {
+            final InputStream is, final String extension)
+    throws IOException {
         final Hashtable<String, Object> ht = new Hashtable<String, Object>();
         final InputStream in = new BufferedInputStream(is);
         try {
@@ -246,8 +247,6 @@ public class InternalResource extends In
                     ht.put(key, config.get(key));
                 }
             }
-        } catch ( IOException ignore ) {
-            return null;
         } finally {
             try { in.close(); } catch (IOException ignore) {}
         }



Mime
View raw message