karaf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Achim Finke (JIRA)" <j...@apache.org>
Subject [jira] [Created] (KARAF-2943) Wrong polymorphism leads to null variables
Date Fri, 25 Apr 2014 12:48:16 GMT
Achim Finke created KARAF-2943:

             Summary: Wrong polymorphism leads to null variables
                 Key: KARAF-2943
                 URL: https://issues.apache.org/jira/browse/KARAF-2943
             Project: Karaf
          Issue Type: Bug
          Components: karaf-tooling
    Affects Versions: 3.0.1
            Reporter: Achim Finke
         Attachments: karaf.patch

As {{BundleRef}} and its parent {{ArtifactRef}} are defining the same variable {{artifact}}
and the artifact resolver is resolving artifacts via {{ArtifactRef}} accessing the {{artifact}}
via {{BundleRef}} returns null.

This bug is leading to an error using the following goal and configuration
as maps for merging are being filled with null values instead of unique artifact attributes.

The root reason is unfortunately supressed see
public void readManifest() {
    JarInputStream bundleJar = null;
    try {
        File file = artifact.getFile();
        bundleJar = new JarInputStream(new FileInputStream(file));
        Manifest manifest = bundleJar.getManifest();
        bundleSymbolicName = manifest.getMainAttributes().getValue("Bundle-SymbolicName");
        bundleVersion = manifest.getMainAttributes().getValue("Bundle-Version");
    } catch (Exception e) {
        // Ignore errors in manifest

I attached a patch correcting the polymorphism but it seems to be a good idea to think about
better error handling at this part.

This message was sent by Atlassian JIRA

View raw message