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
org.apache.felix.bundlerepository_1.2.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 
http://markmail.org/message/spi5uuceaqhll2t5#query:felix%20obr%20bindex%20nullpointerexception+page:1+mid:spi5uuceaqhll2t5+state:results

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

Reply via email to