You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by se...@apache.org on 2012/04/26 03:28:15 UTC
svn commit: r1330622 -
/commons/proper/math/trunk/src/main/java/org/apache/commons/math3/util/MathArrays.java
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;