Buggy code:
public LazyDataset ( String name , int dtype , int elements , int [ ] shape , ILazyLoader loader ) { } public LazyDataset ( String name , int dtype , int [ ] shape , ILazyLoader loader ) { } public static LazyDataset createLazyDataset ( final Dataset dataset ) { } @ Override public int getDtype ( ) { } @ Override public int getElementsPerItem ( ) { } @ Override public int getSize ( ) { } @ Override public String toString ( ) { } @ Override public boolean equals ( Object obj ) { } @ Override public LazyDataset clone ( ) { } @ Override public void setShape ( int ... shape ) { } @ Override public LazyDataset squeeze ( boolean onlyFromEnds ) { } @ Override public Dataset getSlice ( int [ ] start , int [ ] stop , int [ ] step ) { } @ Override public Dataset getSlice ( Slice ... slice ) { } @ Override public Dataset getSlice ( IMonitor monitor , Slice ... slice ) throws Exception { } @ Override public LazyDataset getSliceView ( Slice ... slice ) { } private void setShapeInternal ( int ... nShape ) { } @ Override public LazyDataset getSliceView ( int [ ] start , int [ ] stop , int [ ] step ) { } @ Override public LazyDataset getTransposedView ( int ... axes ) { } private int [ ] getOriginal ( int [ ] values ) { } @ Override public Dataset getSlice ( IMonitor monitor , int [ ] start , int [ ] stop , int [ ] step ) throws Exception { if ( ( ( loader ) != null ) && ( ! ( loader . isFileReadable ( ) ) ) ) return null ; SliceND slice = new SliceND ( shape , start , stop , step ) ; int [ ] lstart = slice . getStart ( ) ; int [ ] lstop = slice . getStop ( ) ; int [ ] lstep = slice . getStep ( ) ; int [ ] nstart ; int [ ] nstop ; int [ ] nstep ; int r = ( ( base ) == null ) ? oShape . length : base . shape . length ; nstart = new int [ r ] ; nstop = new int [ r ] ; nstep = new int [ r ] ; Arrays . fill ( nstop , 1 ) ; Arrays . fill ( nstep , 1 ) ; { int i = 0 ; int j = 0 ; if ( ( prepShape ) < 0 ) { i = - ( prepShape ) ; } else if ( ( prepShape ) > 0 ) { j = prepShape ; } if ( ( begSlice ) == null ) { for ( ; ( i < r ) && ( j < ( shape . length ) ) ; i ++ , j ++ ) { nstart [ i ] = lstart [ j ] ; nstop [ i ] = lstop [ j ] ; nstep [ i ] = lstep [ j ] ; } } else { for ( ; ( i < r ) && ( j < ( shape . length ) ) ; i ++ , j ++ ) { nstart [ i ] = ( begSlice [ j ] ) + ( ( lstart [ j ] ) * ( delSlice [ j ] ) ) ; nstop [ i ] = ( ( begSlice [ j ] ) + ( ( ( lstop [ j ] ) - 1 ) * ( delSlice [ j ] ) ) ) + 1 ; nstep [ i ] = ( lstep [ j ] ) * ( delSlice [ j ] ) ; } } if ( ( map ) != null ) { nstart = getOriginal ( nstart ) ; nstop = getOriginal ( nstop ) ; nstep = getOriginal ( nstep ) ; } } <START_BUG> SliceND nslice = new SliceND ( oShape , nstart , nstop , nstep ) ; <END_BUG> Dataset a ; if ( ( base ) != null ) { a = base . getSlice ( monitor , nstart , nstop , nstep ) ; } else { try { a = DatasetUtils . convertToDataset ( loader . getDataset ( monitor , oShape , nstart , nstop , nstep ) ) ; } catch ( Exception e ) { logger . debug ( "Problem<seq2seq4repair_space>getting<seq2seq4repair_space>{}:<seq2seq4repair_space>{}" , String . format ( "slice<seq2seq4repair_space>%s<seq2seq4repair_space>%s<seq2seq4repair_space>%s" , Arrays . toString ( slice . getStart ( ) ) , Arrays . toString ( slice . getStop ( ) ) , Arrays . toString ( slice . getStep ( ) ) ) , e ) ; a = new DoubleDataset ( 1 ) ; } a . setName ( ( ( ( ( name ) + ( AbstractDataset . BLOCK_OPEN ) ) + ( nslice . toString ( ) ) ) + ( AbstractDataset . BLOCK_CLOSE ) ) ) ; if ( ( ( metadata ) != null ) && ( a instanceof LazyDatasetBase ) ) { LazyDatasetBase ba = ( ( LazyDatasetBase ) ( a ) ) ; ba . metadata = copyMetadata ( ( ( oMetadata ) != null ? oMetadata : metadata ) ) ; if ( ! ( nslice . isAll ( ) ) ) ba . sliceMetadata ( true , ( ( oMetadata ) != null ? oShape : shape ) , nslice ) ; } } if ( ( map ) != null ) { a = a . getTransposedView ( map ) ; } a . setShape ( slice . getShape ( ) ) ; return a ; } public static int getMaxSliceLength ( ILazyDataset lazySet , int dimension ) { } }

Fix:
SliceND nslice = new SliceND ( ( ( base ) == null ? oShape : base . shape ) , nstart , nstop , nstep ) ;