felix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dirk Mahler (JIRA)" <j...@apache.org>
Subject [jira] Created: (FELIX-789) NPE in ResourceComparator if no presentationname given
Date Thu, 23 Oct 2008 16:10:44 GMT
NPE in ResourceComparator if no presentationname given

                 Key: FELIX-789
                 URL: https://issues.apache.org/jira/browse/FELIX-789
             Project: Felix
          Issue Type: Bug
          Components: Bundle Repository (OBR)
    Affects Versions: bundlerepository-1.2.0
         Environment: Eclipse Equinox 3.4.0
            Reporter: Dirk Mahler

If the OBR repository is created using the latest bindex version available from the OSGi web
site there may be resource entries without presentationnames. Processing such an entry results
in a NullPointerException in the class org.apache.felix.bundlerepository.ResourceComparator
if the variable name1 becomes null:

        String name1 = (String) r1.getPresentationName();        
        String name2 = (String) r2.getPresentationName();        
        return name1.compareToIgnoreCase(name2) ;

Replacing the last line with

        return name1 != null ? name1.compareToIgnoreCase(name2) : -1;

fixes the issue.

See also discussion (especially the latest posting by Peter Kriens) under 

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message