Buggy code:
public final class SpaceEfficientDenseModel extends AbstractPredictionModel { private static final Log logger = LogFactory . getLog ( SpaceEfficientDenseModel . class ) ; private int size ; private short [ ] weights ; private short [ ] covars ; private float [ ] sum_of_squared_gradients ; private float [ ] sum_of_squared_delta_x ; private float [ ] sum_of_gradients ; private short [ ] clocks ; private byte [ ] deltaUpdates ; public SpaceEfficientDenseModel ( int ndims ) { } public SpaceEfficientDenseModel ( int ndims , boolean withCovar ) { } @ Override protected boolean isDenseModel ( ) { } @ Override public boolean hasCovariance ( ) { } @ Override public void configureParams ( boolean sum_of_squared_gradients , boolean sum_of_squared_delta_x , boolean sum_of_gradients ) { } @ Override public void configureClock ( ) { } @ Override public boolean hasClock ( ) { } @ Override public void resetDeltaUpdates ( int feature ) { } private float getWeight ( final int i ) { } private float getCovar ( final int i ) { } private void setWeight ( final int i , final float v ) { } private void setCovar ( final int i , final float v ) { } private void ensureCapacity ( final int index ) { } @ SuppressWarnings ( "unchecked" ) @ Override public < T extends IWeightValue > T get ( Object feature ) { } @ Override public < T extends IWeightValue > void set ( Object feature , T value ) { int i = HiveUtils . parseInt ( feature ) ; ensureCapacity ( i ) ; float weight = value . get ( ) ; setWeight ( i , weight ) ; float covar = 1.0F ; boolean hasCovar = value . hasCovariance ( ) ; if ( hasCovar ) { covar = value . getCovariance ( ) ; setCovar ( i , covar ) ; } if ( ( sum_of_squared_gradients ) != null ) { sum_of_squared_gradients [ i ] = value . getSumOfSquaredGradients ( ) ; } if ( ( sum_of_squared_delta_x ) != null ) { sum_of_squared_delta_x [ i ] = value . getSumOfSquaredDeltaX ( ) ; } if ( ( sum_of_gradients ) != null ) { <START_BUG> sum_of_squared_gradients [ i ] = value . getSumOfGradients ( ) ; <END_BUG> } short clock = 0 ; int delta = 0 ; if ( ( ( clocks ) != null ) && ( value . isTouched ( ) ) ) { clock = ( ( short ) ( ( clocks [ i ] ) + 1 ) ) ; clocks [ i ] = clock ; delta = ( deltaUpdates [ i ] ) + 1 ; assert delta > 0 : delta ; deltaUpdates [ i ] = ( ( byte ) ( delta ) ) ; } onUpdate ( i , weight , covar , clock , delta , hasCovar ) ; } @ Override public void delete ( @ Nonnull Object feature ) { } @ Override public float getWeight ( Object feature ) { } @ Override public float getCovariance ( Object feature ) { } @ Override protected void _set ( Object feature , float weight , short clock ) { } @ Override protected void _set ( Object feature , float weight , float covar , short clock ) { } @ Override public int size ( ) { } @ Override public boolean contains ( Object feature ) { } @ SuppressWarnings ( "unchecked" ) @ Override public < K , V extends IWeightValue > IMapIterator < K , V > entries ( ) { } private final class Itr implements IMapIterator < Number , IWeightValue > { private int cursor ; private final WeightValueWithCovar tmpWeight ; private Itr ( ) { } @ Override public boolean hasNext ( ) { } @ Override public int next ( ) { } @ Override public Integer getKey ( ) { } @ Override public IWeightValue getValue ( ) { } @ Override public < T extends Copyable < IWeightValue > > void getValue ( T probe ) { } } }

Fix:
sum_of_gradients [ i ] = value . getSumOfGradients ( ) ;