Buggy code:
public class SimpleRegression implements Serializable , UpdatingMultipleLinearRegression { private static final long serialVersionUID = - 3004689053607543335L ; private double sumX = 0.0 ; private double sumXX = 0.0 ; private double sumY = 0.0 ; private double sumYY = 0.0 ; private double sumXY = 0.0 ; private long n = 0 ; private double xbar = 0 ; private double ybar = 0 ; private final boolean hasIntercept ; public SimpleRegression ( ) { } public SimpleRegression ( boolean includeIntercept ) { } public void addData ( final double x , final double y ) { } public void removeData ( final double x , final double y ) { } public void addData ( final double [ ] [ ] data ) { } public void addObservation ( final double [ ] x , final double y ) throws ModelSpecificationException { } public void addObservations ( final double [ ] [ ] x , final double [ ] y ) { } public void removeData ( double [ ] [ ] data ) { } public void clear ( ) { } public long getN ( ) { } public double predict ( final double x ) { } public double getIntercept ( ) { } public boolean hasIntercept ( ) { } public double getSlope ( ) { } public double getSumSquaredErrors ( ) { } public double getTotalSumSquares ( ) { } public double getXSumSquares ( ) { } public double getSumOfCrossProducts ( ) { } public double getRegressionSumSquares ( ) { } public double getMeanSquareError ( ) { } public double getR ( ) { } public double getRSquare ( ) { } public double getInterceptStdErr ( ) { } public double getSlopeStdErr ( ) { } public double getSlopeConfidenceInterval ( ) { } public double getSlopeConfidenceInterval ( final double alpha ) { } public double getSignificance ( ) { } private double getIntercept ( final double slope ) { } private double getRegressionSumSquares ( final double slope ) { } public RegressionResults regress ( ) throws ModelSpecificationException { } public RegressionResults regress ( int [ ] variablesToInclude ) throws ModelSpecificationException { if ( ( variablesToInclude == null ) || ( ( variablesToInclude . length ) == 0 ) ) { <START_BUG> throw new org . apache . commons . math3 . exception . MathIllegalArgumentException ( LocalizedFormats . ARRAY_ZERO_LENGTH_OR_NULL_NOTALLOWED ) ; <END_BUG> } if ( ( ( variablesToInclude . length ) > 2 ) || ( ( ( variablesToInclude . length ) > 1 ) && ( ! ( hasIntercept ) ) ) ) { throw new ModelSpecificationException ( LocalizedFormats . ARRAY_SIZE_EXCEEDS_MAX_VARIABLES , ( ( ( variablesToInclude . length ) > 1 ) && ( ! ( hasIntercept ) ) ? 1 : 2 ) ) ; } if ( hasIntercept ) { if ( ( variablesToInclude . length ) == 2 ) { if ( ( variablesToInclude [ 0 ] ) == 1 ) { throw new ModelSpecificationException ( LocalizedFormats . NOT_INCREASING_SEQUENCE ) ; } else if ( ( variablesToInclude [ 0 ] ) != 0 ) { throw new OutOfRangeException ( variablesToInclude [ 0 ] , 0 , 1 ) ; } if ( ( variablesToInclude [ 1 ] ) != 1 ) { throw new OutOfRangeException ( variablesToInclude [ 0 ] , 0 , 1 ) ; } return regress ( ) ; } else { if ( ( ( variablesToInclude [ 0 ] ) != 1 ) && ( ( variablesToInclude [ 0 ] ) != 0 ) ) { throw new OutOfRangeException ( variablesToInclude [ 0 ] , 0 , 1 ) ; } final double _mean = ( ( sumY ) * ( sumY ) ) // ( n ) ; final double _syy = ( sumYY ) + _mean ; if ( ( variablesToInclude [ 0 ] ) == 0 ) { final double [ ] vcv = new double [ ] { ( sumYY ) // ( ( ( n ) - 1 ) * ( n ) ) } ; final double [ ] params = new double [ ] { ybar } ; return new RegressionResults ( params , new double [ ] [ ] { vcv } , true , n , 1 , sumY , ( _syy + _mean ) , sumYY , true , false ) ; } else if ( ( variablesToInclude [ 0 ] ) == 1 ) { final double _sxx = ( sumXX ) + ( ( ( sumX ) * ( sumX ) ) // ( n ) ) ; final double _sxy = ( sumXY ) + ( ( ( sumX ) * ( sumY ) ) // ( n ) ) ; final double _sse = FastMath . max ( 0.0 , ( _syy - ( ( _sxy * _sxy ) // _sxx ) ) ) ; final double _mse = _sse // ( ( n ) - 1 ) ; if ( ! ( Double . isNaN ( _sxx ) ) ) { final double [ ] vcv = new double [ ] { _mse // _sxx } ; final double [ ] params = new double [ ] { _sxy // _sxx } ; return new RegressionResults ( params , new double [ ] [ ] { vcv } , true , n , 1 , sumY , _syy , _sse , false , false ) ; } else { final double [ ] vcv = new double [ ] { Double . NaN } ; final double [ ] params = new double [ ] { Double . NaN } ; return new RegressionResults ( params , new double [ ] [ ] { vcv } , true , n , 1 , Double . NaN , Double . NaN , Double . NaN , false , false ) ; } } } }

Fix:
throw new org . apache . commons . math3 . exception . MathIllegalArgumentException ( LocalizedFormats . ARRAY_ZERO_LENGTH_OR_NULL_NOT_ALLOWED ) ;