commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mben...@apache.org
Subject svn commit: r1594387 - /commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/reflect/TypeUtils.java
Date Tue, 13 May 2014 21:13:05 GMT
Author: mbenson
Date: Tue May 13 21:13:04 2014
New Revision: 1594387

URL: http://svn.apache.org/r1594387
Log:
TypeUtils wildcard fixes

Modified:
    commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/reflect/TypeUtils.java

Modified: commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/reflect/TypeUtils.java
URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/reflect/TypeUtils.java?rev=1594387&r1=1594386&r2=1594387&view=diff
==============================================================================
--- commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/reflect/TypeUtils.java
(original)
+++ commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/reflect/TypeUtils.java
Tue May 13 21:13:04 2014
@@ -1623,8 +1623,8 @@ public class TypeUtils {
     private static boolean equals(WildcardType w, Type t) {
         if (t instanceof WildcardType) {
             final WildcardType other = (WildcardType) t;
-            return equals(w.getLowerBounds(), other.getLowerBounds())
-                && equals(TypeUtils.getImplicitUpperBounds(w), TypeUtils.getImplicitUpperBounds(other));
+            return equals(getImplicitLowerBounds(w), getImplicitLowerBounds(other))
+                && equals(getImplicitUpperBounds(w), getImplicitUpperBounds(other));
         }
         return true;
     }
@@ -1808,9 +1808,9 @@ public class TypeUtils {
         final StringBuilder buf = new StringBuilder().append('?');
         final Type[] lowerBounds = w.getLowerBounds();
         final Type[] upperBounds = w.getUpperBounds();
-        if (lowerBounds.length > 0) {
+        if (lowerBounds.length > 1 || lowerBounds.length == 1 && lowerBounds[0]
!= null) {
             appendAllTo(buf.append(" super "), " & ", lowerBounds);
-        } else if (!(upperBounds.length == 1 && Object.class.equals(upperBounds[0])))
{
+        } else if (upperBounds.length > 1 || upperBounds.length == 1 && !Object.class.equals(upperBounds[0]))
{
             appendAllTo(buf.append(" extends "), " & ", upperBounds);
         }
         return buf.toString();



Mime
View raw message