You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@felix.apache.org by pa...@apache.org on 2020/07/08 14:17:59 UTC

[felix-dev] branch master updated: FELIX-6297: backport to work with java6

This is an automated email from the ASF dual-hosted git repository.

pauls pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/felix-dev.git


The following commit(s) were added to refs/heads/master by this push:
     new 3c26add  FELIX-6297: backport to work with java6
3c26add is described below

commit 3c26add121493bf0ed3ae937d1e0577d98e88a41
Author: Karl Pauls <kp...@adobe.com>
AuthorDate: Wed Jul 8 16:17:42 2020 +0200

    FELIX-6297: backport to work with java6
---
 .../felix/framework/util/MultiReleaseContent.java  | 23 ++++++++++++++++------
 1 file changed, 17 insertions(+), 6 deletions(-)

diff --git a/framework/src/main/java/org/apache/felix/framework/util/MultiReleaseContent.java b/framework/src/main/java/org/apache/felix/framework/util/MultiReleaseContent.java
index 9653029..53996dd 100644
--- a/framework/src/main/java/org/apache/felix/framework/util/MultiReleaseContent.java
+++ b/framework/src/main/java/org/apache/felix/framework/util/MultiReleaseContent.java
@@ -61,22 +61,33 @@ public class MultiReleaseContent implements Content
         }
         if (javaVersion > 8)
         {
+            InputStream manifestStream = null;
+
             try
             {
-                try (InputStream manifestStream = content.getEntryAsStream("META-INF/MANIFEST.MF"))
+                manifestStream = content.getEntryAsStream("META-INF/MANIFEST.MF");
+                if (manifestStream != null)
                 {
-                    if (manifestStream != null)
+                    if ("true".equals(new Manifest(manifestStream).getMainAttributes().getValue("Multi-Release")))
                     {
-                        if ("true".equals(new Manifest(manifestStream).getMainAttributes().getValue("Multi-Release")))
-                        {
-                            content = new MultiReleaseContent(javaVersion, content);
-                        }
+                        content = new MultiReleaseContent(javaVersion, content);
                     }
                 }
             }
             catch (Exception ex)
             {
             }
+            finally
+            {
+                if (manifestStream != null)
+                {
+                    try
+                    {
+                        manifestStream.close();
+                    }
+                    catch (Exception ex){}
+                }
+            }
         }
         return content;
     }