commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1330622 - /commons/proper/math/trunk/src/main/java/org/apache/commons/math3/util/MathArrays.java
Date Thu, 26 Apr 2012 01:28:15 GMT
Author: sebb
Date: Thu Apr 26 01:28:14 2012
New Revision: 1330622

URL: http://svn.apache.org/viewvc?rev=1330622&view=rev
Log:
Fix generics warning

Modified:
    commons/proper/math/trunk/src/main/java/org/apache/commons/math3/util/MathArrays.java

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math3/util/MathArrays.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math3/util/MathArrays.java?rev=1330622&r1=1330621&r2=1330622&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math3/util/MathArrays.java
(original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math3/util/MathArrays.java
Thu Apr 26 01:28:14 2012
@@ -155,10 +155,10 @@ public class MathArrays {
      * @param strict Whether the order should be strict.
      * @return {@code true} if sorted, {@code false} otherwise.
      */
-    public static boolean isMonotonic(Comparable[] val,
+    public static  <T extends Comparable<? super T>> boolean isMonotonic(T[]
val,
                                       OrderDirection dir,
                                       boolean strict) {
-        Comparable previous = val[0];
+        T previous = val[0];
         final int max = val.length;
         for (int i = 1; i < max; i++) {
             final int comp;



Mime
View raw message