commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r756634 - /commons/proper/lang/trunk/src/java/org/apache/commons/lang/ObjectUtils.java
Date Fri, 20 Mar 2009 17:10:41 GMT
Author: sebb
Date: Fri Mar 20 17:10:39 2009
New Revision: 756634

URL: http://svn.apache.org/viewvc?rev=756634&view=rev
Log:
LANG-495 - add generics for max and min

Modified:
    commons/proper/lang/trunk/src/java/org/apache/commons/lang/ObjectUtils.java

Modified: commons/proper/lang/trunk/src/java/org/apache/commons/lang/ObjectUtils.java
URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/java/org/apache/commons/lang/ObjectUtils.java?rev=756634&r1=756633&r2=756634&view=diff
==============================================================================
--- commons/proper/lang/trunk/src/java/org/apache/commons/lang/ObjectUtils.java (original)
+++ commons/proper/lang/trunk/src/java/org/apache/commons/lang/ObjectUtils.java Fri Mar 20
17:10:39 2009
@@ -248,7 +248,7 @@
      *   <li>If both the comparables are null, null is returned.
      *  </ul>
      */
-    public static Object min(Comparable c1, Comparable c2) {
+    public static <T extends Comparable<? super T>> T min(T c1, T c2) {
         if (c1 != null && c2 != null) {
             return c1.compareTo(c2) < 1 ? c1 : c2;
         } else {
@@ -269,7 +269,7 @@
      *   <li>If both the comparables are null, null is returned.
      *  </ul>
      */
-    public static Object max(Comparable c1, Comparable c2) {
+    public static <T extends Comparable<? super T>> T max(T c1, T c2) {
         if (c1 != null && c2 != null) {
             return c1.compareTo(c2) >= 0 ? c1 : c2;
         } else {



Mime
View raw message