Fix generics warning

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1330622 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Sebastian Bazley 2012-04-26 01:28:14 +00:00
parent a5e84b3e75
commit 2ba27ad9df

View File

@ -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;