incubator-amber-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From simonetrip...@apache.org
Subject svn commit: r962534 - /incubator/amber/trunk/spec-api/src/main/java/org/apache/amber/AbstractParameter.java
Date Fri, 09 Jul 2010 14:01:09 GMT
Author: simonetripodi
Date: Fri Jul  9 14:01:09 2010
New Revision: 962534

URL: http://svn.apache.org/viewvc?rev=962534&view=rev
Log:
fixed potential NPE when comparing objects

Modified:
    incubator/amber/trunk/spec-api/src/main/java/org/apache/amber/AbstractParameter.java

Modified: incubator/amber/trunk/spec-api/src/main/java/org/apache/amber/AbstractParameter.java
URL: http://svn.apache.org/viewvc/incubator/amber/trunk/spec-api/src/main/java/org/apache/amber/AbstractParameter.java?rev=962534&r1=962533&r2=962534&view=diff
==============================================================================
--- incubator/amber/trunk/spec-api/src/main/java/org/apache/amber/AbstractParameter.java (original)
+++ incubator/amber/trunk/spec-api/src/main/java/org/apache/amber/AbstractParameter.java Fri
Jul  9 14:01:09 2010
@@ -68,6 +68,10 @@ abstract class AbstractParameter<N>
      * {@inheritDoc}
      */
     public final int compareTo(AbstractParameter<N> parameter) {
+        if (parameter == null) {
+            return 1;
+        }
+
         int nameComparison = String.valueOf(this.key).compareTo(String.valueOf(parameter.getKey()));
         if (0 == nameComparison) {
             return this.value.compareTo(parameter.getValue());



Mime
View raw message