cdm/src/main/java/uk/ac/rdg/resc/edal/time/FixedYearVariableMonthChronology.java
private static int sumArray(int[] arr) {
        if (arr == null) throw new NullPointerException("null array");
        if (arr.length == 0) throw new IllegalArgumentException("Zero-length array");
        int sum = 0;
        for (int i = 0; i < arr.length; i++) {
            if (arr[i] <= 0) {
                throw new IllegalArgumentException("All array values must be > 0");
            }
            sum += arr[i];
        }
        return sum;
    }
private static int sumArray(int[] arr) {
        if (arr == null) throw new NullPointerException("null array");
        if (arr.length == 0) throw new IllegalArgumentException("Zero-length array");
        int sum = 0;
        for (int i = 0; i < arr.length; i++) {
            if (arr[i] <= 0) {
                throw new IllegalArgumentException("All array values must be > 0");
            }
            sum += arr[i];
        }
        return sum;
    }
private static int sumArray ( int [ ] arr ) { if ( arr == null ) throw new NullPointerException ( "null array" ) ; if ( arr . length == 0 ) throw new IllegalArgumentException ( "Zero-length array" ) ; int sum = 0 ; for ( int i = 0 ; i < arr . length ; i ++ ) { if ( arr [ i ] <= 0 ) { throw new IllegalArgumentException ( "All array values must be > 0" ) ; } sum += arr [ i ] ; } return sum ; }
Calculates the sum of the values in the given array.
@throws NullPointerException if arr is null
@throws IllegalArgumentException if arr is empty or contains
zero or negative values.
Calculates the sum of the values in the given array .