Buggy code:
public GLM2 setBetaConstraints ( Frame f ) { } static String arrayToString ( double [ ] arr ) { } public transient float [ ] thresholds = ModelUtils . DEFAULT_THRESHOLDS ; public static String link ( Key k , String content ) { } public GLM2 . GLMGridSearch gridSearch ( ) { } private transient AtomicBoolean _jobdone = new AtomicBoolean ( false ) ; @ Override public void cancel ( String msg ) { } private boolean sorted ( int [ ] ary ) { } private double computeIntercept ( DataInfo dinfo , double ymu , Vec offset , Vec response ) { } private transient Frame source2 ; private int _noffsets = 0 ; private int _intercept = 1 ; private double [ ] _lbs ; private double [ ] _ubs ; private double [ ] _bgs ; private double [ ] _rho ; boolean toEnum = false ; private double [ ] makeAry ( int sz , double val ) { } private double [ ] mapVec ( double [ ] src , double [ ] tgt , int [ ] map ) { } @ Override public void init ( ) { } @ Override protected void cleanup ( ) { } @ Override protected boolean filterNaCols ( ) { } @ Override protected Response serve ( ) { } private static double beta_diff ( double [ ] b1 , double [ ] b2 ) { } private static class GLM2_Progress extends Iced { final long _total ; double _done ; public GLM2_Progress ( int total ) { } public float progess ( ) { } } private static class GLM2_ProgressUpdate extends TAtomic < GLM2 . GLM2_Progress > { final int _i ; public GLM2_ProgressUpdate ( ) { } public GLM2_ProgressUpdate ( int i ) { } @ Override public GLM2 . GLM2_Progress atomic ( GLM2 . GLM2_Progress old ) { } } @ Override public float progress ( ) { } protected double l2norm ( double [ ] beta ) { } protected double l1norm ( double [ ] beta ) { } private final double [ ] expandVec ( double [ ] beta , final int [ ] activeCols ) { } private final double [ ] contractVec ( double [ ] beta , final int [ ] activeCols ) { } private final double [ ] contractVec ( double [ ] beta , final int [ ] activeCols , int intercept ) { } private final double [ ] resizeVec ( double [ ] beta , final int [ ] activeCols , final int [ ] oldActiveCols ) { } protected boolean needLineSearch ( final GLMIterationTask glmt ) { } private static double [ ] diff ( double [ ] x , double [ ] y ) { } public static final double c1 = 0.01 ; protected final boolean needLineSearch ( double step , final double objOld , final double objNew , final double [ ] pk , final double [ ] gradOld ) { } private class LineSearchIteration extends H2OCallback < GLMTask . GLMLineSearchTask > { final GLMIterationTask _glmt ; LineSearchIteration ( GLMIterationTask glmt , CountedCompleter cmp ) { } @ Override public void callback ( final GLMTask . GLMLineSearchTask glmt ) { } } protected double checkGradient ( final double [ ] newBeta , final double [ ] grad ) { } private String LogInfo ( String msg ) { } private double [ ] setSubmodel ( final double [ ] newBeta , GLMValidation val , H2OCountedCompleter cmp ) { int intercept = ( this . intercept ) ? 1 : 0 ; <START_BUG> double [ ] fullBeta = ( ( ( _activeCols ) == null ) || ( newBeta == null ) ) ? newBeta : expandVec ( newBeta , _activeCols ) ; <END_BUG> if ( val != null ) val . null_deviance = _nullDeviance ; if ( this . intercept ) fullBeta [ ( ( fullBeta . length ) - 1 ) ] += _iceptAdjust ; if ( ( _noffsets ) > 0 ) { fullBeta = Arrays . copyOf ( fullBeta , ( ( fullBeta . length ) + ( _noffsets ) ) ) ; if ( this . intercept ) fullBeta [ ( ( fullBeta . length ) - 1 ) ] = fullBeta [ ( ( ( fullBeta . length ) - intercept ) - ( _noffsets ) ) ] ; for ( int i = ( ( fullBeta . length ) - intercept ) - ( _noffsets ) ; i < ( ( fullBeta . length ) - intercept ) ; ++ i ) fullBeta [ i ] = 1 ; } final double [ ] newBetaDeNorm ; final int numoff = _srcDinfo . numStart ( ) ; if ( ( _srcDinfo . _predictor_transform ) == ( TransformType . STANDARDIZE ) ) { assert this . intercept ; newBetaDeNorm = fullBeta . clone ( ) ; double norm = 0.0 ; for ( int i = numoff ; i < ( ( fullBeta . length ) - intercept ) ; i ++ ) { double b = ( newBetaDeNorm [ i ] ) * ( _srcDinfo . _normMul [ ( i - numoff ) ] ) ; norm += b * ( _srcDinfo . _normSub [ ( i - numoff ) ] ) ; newBetaDeNorm [ i ] = b ; } if ( this . intercept ) newBetaDeNorm [ ( ( newBetaDeNorm . length ) - 1 ) ] -= norm ; } else if ( ( _srcDinfo . _predictor_transform ) == ( TransformType . DESCALE ) ) { assert ! ( this . intercept ) ; newBetaDeNorm = fullBeta . clone ( ) ; for ( int i = numoff ; i < ( fullBeta . length ) ; i ++ ) newBetaDeNorm [ i ] *= _srcDinfo . _normMul [ ( i - numoff ) ] ;

Fix:
double [ ] fullBeta = ( ( ( _activeCols ) == null ) || ( newBeta == null ) ) ? newBeta . clone ( ) : expandVec ( newBeta , _activeCols ) ;