felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rickh...@apache.org
Subject svn commit: r1464569 - /felix/trunk/resolver/src/main/java/org/apache/felix/resolver/ResolverImpl.java
Date Thu, 04 Apr 2013 14:33:19 GMT
Author: rickhall
Date: Thu Apr  4 14:33:19 2013
New Revision: 1464569

URL: http://svn.apache.org/r1464569
Log:
Apply patch (FELIX-4008) to avoid NPE when converting blame to string.

Modified:
    felix/trunk/resolver/src/main/java/org/apache/felix/resolver/ResolverImpl.java

Modified: felix/trunk/resolver/src/main/java/org/apache/felix/resolver/ResolverImpl.java
URL: http://svn.apache.org/viewvc/felix/trunk/resolver/src/main/java/org/apache/felix/resolver/ResolverImpl.java?rev=1464569&r1=1464568&r2=1464569&view=diff
==============================================================================
--- felix/trunk/resolver/src/main/java/org/apache/felix/resolver/ResolverImpl.java (original)
+++ felix/trunk/resolver/src/main/java/org/apache/felix/resolver/ResolverImpl.java Thu Apr
 4 14:33:19 2013
@@ -2007,8 +2007,20 @@ public class ResolverImpl implements Res
                         allCandidates,
                         blame.m_reqs.get(i));
                     sb.append(export.getNamespace());
-                    sb.append("=");
-                    sb.append(export.getAttributes().get(export.getNamespace()).toString());
+                    sb.append(": ");
+                    Object namespaceVal = export.getAttributes().get(export.getNamespace());
+                    if (namespaceVal != null)
+                    {
+                        sb.append(namespaceVal.toString());
+                    }
+                    else
+                    {
+                        for (Entry<String, Object> attrEntry : export.getAttributes().entrySet())
+                        {
+                            sb.append(attrEntry.getKey()).append('=')
+                                .append(attrEntry.getValue()).append(';');
+                        }
+                    }
                     if (export.getNamespace().equals(PackageNamespace.PACKAGE_NAMESPACE)
                         && !export.getAttributes().get(PackageNamespace.PACKAGE_NAMESPACE)
                         .equals(blame.m_cap.getAttributes().get(
@@ -2193,4 +2205,4 @@ public class ResolverImpl implements Res
             return m_blames.toString();
         }
     }
-}
\ No newline at end of file
+}



Mime
View raw message