You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by er...@apache.org on 2011/09/22 11:55:02 UTC
svn commit: r1174032 -
/commons/proper/math/trunk/src/main/java/org/apache/commons/math/util/MathUtils.java
Author: erans
Date: Thu Sep 22 09:55:02 2011
New Revision: 1174032
URL: http://svn.apache.org/viewvc?rev=1174032&view=rev
Log:
Added "final".
Modified:
commons/proper/math/trunk/src/main/java/org/apache/commons/math/util/MathUtils.java
Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/util/MathUtils.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/util/MathUtils.java?rev=1174032&r1=1174031&r2=1174032&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math/util/MathUtils.java (original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/util/MathUtils.java Thu Sep 22 09:55:02 2011
@@ -1957,10 +1957,11 @@ public final class MathUtils {
* @param strict Whether the order should be strict.
* @return {@code true} if sorted, {@code false} otherwise
*/
- public static boolean isMonotone(Comparable[] val, OrderDirection dir,
- boolean strict){
+ public static boolean isMonotone(Comparable[] val,
+ OrderDirection dir,
+ boolean strict){
Comparable previous = val[0];
- int max = val.length;
+ final int max = val.length;
int comp;
for (int i = 1; i < max; i++) {
switch (dir) {
@@ -2006,10 +2007,11 @@ public final class MathUtils {
* @param strict Whether the order should be strict.
* @return {@code true} if sorted, {@code false} otherwise
*/
- public static boolean isMonotone(double[] val, OrderDirection dir,
+ public static boolean isMonotone(double[] val,
+ OrderDirection dir,
boolean strict){
double previous = val[0];
- int max = val.length;
+ final int max = val.length;
for (int i = 1; i < max; i++) {
switch (dir) {
case INCREASING:
@@ -2058,7 +2060,7 @@ public final class MathUtils {
public static boolean checkOrder(double[] val, OrderDirection dir,
boolean strict, boolean abort) {
double previous = val[0];
- int max = val.length;
+ final int max = val.length;
for (int i = 1; i < max; i++) {
switch (dir) {
case INCREASING: