karaf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jean-Baptiste Onofré (JIRA) <j...@apache.org>
Subject [jira] [Updated] (KARAF-2943) Wrong polymorphism leads to null variables
Date Fri, 19 Sep 2014 08:52:34 GMT

     [ https://issues.apache.org/jira/browse/KARAF-2943?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Jean-Baptiste Onofré updated KARAF-2943:
----------------------------------------
    Fix Version/s:     (was: 3.0.2)
                   3.0.3
                   4.0.0

> 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
>            Assignee: Christian Schneider
>             Fix For: 4.0.0, 3.0.3
>
>         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
> {code}
> <plugin>
>   <groupId>org.apache.karaf.tooling</groupId>
>   <artifactId>karaf-maven-plugin</artifactId>
>   <version>3.0.1</version>
>   <executions>
>     <execution>
>       ...
>       <goals>
>         <goal>features-export-meta-data</goal>
>       </goals>
>       <configuration>
>         ...
>         <mergedFeature>true</mergedFeature>
>         <oneVersion>true</oneVersion>
>       </configuration>
>     </execution>
>   </executions>
> </plugin>
> {code}
> as maps for merging are being filled with null values instead of unique artifact attributes.
> The root reason is unfortunately supressed see
> {code:title=BundleRef.java|borderStyle=solid}
> 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");
>         bundleJar.close();
>     } catch (Exception e) {
>         // Ignore errors in manifest
>     }
> }
> {code}
> 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
(v6.3.4#6332)

Mime
View raw message