nus-yam/ex-repair huggingface dataset:
Buggy code:
public class AssetManager extends com . badlogic . gdx . assets . AssetManager { public static AssetManager manager = new AssetManager ( ) ; private static Skin menuSkin ; private static Music music ; private static Skin gameElementTexture ; public static final String [ ] assetNames = new String [ ] { } ; private static final LinkedList < TiledMap > maps = new LinkedList < TiledMap > ( ) ; private static final List < AssetManager . OnProgressChanged > listeners = new LinkedList < AssetManager . OnProgressChanged > ( ) ; private static final HashMap < String , Texture > textureMap = new HashMap < String , Texture > ( ) ; public static void initializePreLoading ( ) { } public static void initializeWhileLoading ( ) { AssetManager . manager . load ( "music//musicfile.ogg" , Music . class ) ; AssetManager . notifyListeners ( 30 ) ; AssetManager . manager . finishLoading ( ) ; TextureAtlas atlas = new TextureAtlas ( "skins//LambdaGame.pack" ) ; AssetManager . manager . finishLoading ( ) ; AssetManager . menuSkin = new Skin ( files . internal ( "skins//DefaultLambdaGame.json" ) , atlas ) ; AssetManager . manager . finishLoading ( ) ; AssetManager . notifyListeners ( 66 ) ; TextureAtlas gameElementsAtlas = new TextureAtlas ( "Gameelements//Gameelements.pack" ) ; AssetManager . manager . finishLoading ( ) ; AssetManager . gameElementTexture = new Skin ( gameElementsAtlas ) ; AssetManager . manager . finishLoading ( ) ; AssetManager . notifyListeners ( 80 ) ; TmxMapLoader loader = new TmxMapLoader ( ) ; <START_BUG> for ( int i = 1 ; i < ( Constants . MAX_LEVEL_ID ) ; i ++ ) { <END_BUG> AssetManager . maps . add ( loader . load ( ( ( "assets//maps//Level" + i ) + ".tmx" ) ) ) ; AssetManager . notifyListeners ( ( 80 + ( ( int ) ( ( i * 20 ) // ( ( float ) ( Constants . MAX_LEVEL_ID ) ) ) ) ) ) ; } AssetManager . manager . finishLoading ( ) ; } private static void notifyListeners ( int value ) { } public static void addProgressListener ( AssetManager . OnProgressChanged listener ) { } public static void removeProgressListener ( AssetManager . OnProgressChanged listener ) { } public static TiledMap loadMap ( int levelId ) { } public static Music getMusic ( ) { } public static void queueLoading ( ) { } public static Skin getMenuSkin ( ) { } public interface OnProgressChanged { public void progressChanged ( int value ) { } } public static Skin getGameelementskin ( ) { } public static Texture getTexture ( String path ) { } }

Fix:
for ( int i = 1 ; i <= ( Constants . MAX_LEVEL_ID ) ; i ++ ) {
Buggy code:
public final class IIJobBuilder extends AbstractJobBuilder { public IIJobBuilder ( JobEngineConfig engineConfig ) { } public IIJob buildJob ( IISegment seg ) { } private IIJob initialJob ( IISegment seg , String type ) { } private void checkPreconditions ( IISegment seg ) { } private void appendMapReduceParameters ( StringBuilder builder , JobEngineConfig engineConfig ) { } private String getIIDistinctColumnsPath ( IISegment seg , String jobUuid ) { } private String getHFilePath ( IISegment seg , String jobId ) { } private MapReduceExecutable createFactDistinctColumnsStep ( IISegment seg , String factTableName , String jobId , String output ) { } private HadoopShellExecutable createBuildDictionaryStep ( IISegment seg , String factDistinctColumnsPath ) { } private MapReduceExecutable createInvertedIndexStep ( IISegment seg , String intermediateHiveTable , String iiOutputTempPath ) { MapReduceExecutable buildIIStep = new MapReduceExecutable ( ) ; StringBuilder cmd = new StringBuilder ( ) ; appendMapReduceParameters ( cmd , engineConfig ) ; <START_BUG> buildIIStep . setName ( STEP_NAME_BUILD_BASE_CUBOID ) ; <END_BUG> appendExecCmdParameters ( cmd , "iiname" , seg . getIIInstance ( ) . getName ( ) ) ; appendExecCmdParameters ( cmd , "tablename" , intermediateHiveTable ) ; appendExecCmdParameters ( cmd , "output" , iiOutputTempPath ) ; appendExecCmdParameters ( cmd , "jobname" , STEP_NAME_BUILD_II ) ; buildIIStep . setMapReduceParams ( cmd . toString ( ) ) ; buildIIStep . setMapReduceJobClass ( InvertedIndexJob . class ) ; return buildIIStep ; } private HadoopShellExecutable createCreateHTableStep ( IISegment seg ) { } private MapReduceExecutable createConvertToHfileStep ( IISegment seg , String inputPath , String jobId ) { } private HadoopShellExecutable createBulkLoadStep ( IISegment seg , String jobId ) { } }

Fix:
buildIIStep . setName ( STEP_NAME_BUILD_II ) ;
Buggy code:
public class MainEqualityTester implements NodeEqualityTester < Node > { private final Map < Class < ? > , NodeEqualityTester < ? > > testers = new HashMap < Class < ? > , NodeEqualityTester < ? > > ( ) ; public MainEqualityTester ( ) { } @ SuppressWarnings ( { "rawtypes" , "unchecked" } ) @ Override public void assertEqual ( Node expected , Node found ) { } private String toString ( Node node ) { StringBuilder builder = new StringBuilder ( ) ; toString ( node , 0 , builder ) ; <START_BUG> return builder . toString ( ) ; <END_BUG> } private void toString ( Node node , int deep , StringBuilder builder ) { } private NodeEqualityTester < ? > getTester ( Node expected ) { } private static class FailingTester implements NodeEqualityTester < Node > { @ Override public void assertEqual ( Node expected , Node found ) { } } }

Fix:
return builder . toString ( ) . replaceAll ( "@\\w+" , "" ) ;
Buggy code:
public class UserDao { private UserSQLiteOpenHelper dbHelper ; public UserDao ( Context contex ) { } public void add ( String token , int role ) { } public User find ( ) { User user = null ; SQLiteDatabase db = dbHelper . getReadableDatabase ( ) ; <START_BUG> Cursor cursor = db . rawQuery ( "select<seq2seq4repair_space>token,<seq2seq4repair_space>role,<seq2seq4repair_space>id<seq2seq4repair_space>from<seq2seq4repair_space>user" , null ) ; <END_BUG> if ( cursor . moveToNext ( ) ) { String token = cursor . getString ( cursor . getColumnIndex ( "token" ) ) ; int role = cursor . getInt ( cursor . getColumnIndex ( "role" ) ) ; user = new User ( token , role ) ; } cursor . close ( ) ; db . close ( ) ; return user ; } public void delete ( String token ) { } }

Fix:
Cursor cursor = db . rawQuery ( "select<seq2seq4repair_space>token,<seq2seq4repair_space>role<seq2seq4repair_space>from<seq2seq4repair_space>user" , null ) ;
Buggy code:
public class ArchiverFactory { private static List archives ; private ArchiverFactory ( ) { } public static void registerArchiver ( String className ) throws ClassNotFoundException , ArchiveException { } public static void registerArchiver ( Class clazz ) throws ArchiveException { } public static Archive getInstance ( String archiverName ) throws ArchiveException { } public static Archive getInstance ( File file ) throws ArchiveException { <START_BUG> if ( ( file == null ) && ( ! ( file . isFile ( ) ) ) ) { <END_BUG> throw new ArchiveException ( "ArchiverFactory<seq2seq4repair_space>could<seq2seq4repair_space>not<seq2seq4repair_space>create<seq2seq4repair_space>instance<seq2seq4repair_space>for<seq2seq4repair_space>this<seq2seq4repair_space>file" ) ; } PackableObject packable = null ; try { packable = PackableObject . identifyByHeader ( file , ArchiverFactory . archives ) ; if ( packable == null ) { return null ; } Archive archive = ( ( Archive ) ( packable . getClass ( ) . newInstance ( ) ) ) ; archive . setArchive ( file ) ; return archive ; } catch ( SecurityException e ) { throw new ArchiveException ( "A<seq2seq4repair_space>security<seq2seq4repair_space>violation<seq2seq4repair_space>occured<seq2seq4repair_space>while<seq2seq4repair_space>reading<seq2seq4repair_space>the<seq2seq4repair_space>field<seq2seq4repair_space>ARCHIVER_NAME" , e ) ; } catch ( IllegalArgumentException e ) { throw new ArchiveException ( "Internal<seq2seq4repair_space>factory<seq2seq4repair_space>exception" , e ) ; } catch ( Exception e ) { throw new ArchiveException ( "ArchiverFactory<seq2seq4repair_space>could<seq2seq4repair_space>not<seq2seq4repair_space>create<seq2seq4repair_space>instance" , e ) ; } } }

Fix:
if ( ( file == null ) || ( ! ( file . isFile ( ) ) ) ) {
Buggy code:
public class ServiceStatus extends EvalFunc < Tuple > { private static TupleFactory tupFactory = TupleFactory . getInstance ( ) ; private static BagFactory bagFactory = BagFactory . getInstance ( ) ; public ServiceStatus ( ) { } @ Override public Tuple exec ( Tuple input ) throws IOException { String profile = ( ( String ) ( input . get ( 0 ) ) ) ; String vo = ( ( String ) ( input . get ( 1 ) ) ) ; String vo_fqan = ( ( String ) ( input . get ( 2 ) ) ) ; String roc = ( ( String ) ( input . get ( 3 ) ) ) ; String site = ( ( String ) ( input . get ( 4 ) ) ) ; String service = ( ( String ) ( input . get ( 5 ) ) ) ; DefaultDataBag bag = ( ( DefaultDataBag ) ( input . get ( 6 ) ) ) ; Iterator < Tuple > it_bag = bag . iterator ( ) ; Aggregator aggr = new Aggregator ( ) ; while ( it_bag . hasNext ( ) ) { Tuple cur_item = it_bag . next ( ) ; String cur_hostname = ( ( String ) ( cur_item . get ( 0 ) ) ) ; String cur_timestamp = ( ( String ) ( cur_item . get ( 1 ) ) ) ; String cur_status = ( ( String ) ( cur_item . get ( 2 ) ) ) ; String cur_prevstate = ( ( String ) ( cur_item . get ( 3 ) ) ) ; int cur_date_int = ( ( Integer ) ( cur_item . get ( 4 ) ) ) ; <START_BUG> int cur_time_int = ( ( Integer ) ( cur_item . get ( 4 ) ) ) ; <END_BUG> aggr . insert ( cur_hostname , cur_time_int , cur_date_int , cur_timestamp , cur_status , cur_prevstate ) ; } aggr . optimize ( ) ; aggr . project ( ) ; aggr . aggregateAND ( ) ; aggr . aggrPrevState ( ) ; Tuple output = ServiceStatus . tupFactory . newTuple ( ) ; DataBag outBag = ServiceStatus . bagFactory . newDefaultBag ( ) ; output . append ( profile ) ; output . append ( vo ) ; output . append ( vo_fqan ) ; output . append ( roc ) ; output . append ( site ) ; output . append ( service ) ; for ( Map . Entry < Integer , Slot > item : aggr . aggr_tline . entrySet ( ) ) { Slot item_value = item . getValue ( ) ; Tuple cur_tupl = ServiceStatus . tupFactory . newTuple ( ) ; cur_tupl . append ( item . getValue ( ) . timestamp ) ; cur_tupl . append ( item . getValue ( ) . status ) ; cur_tupl . append ( item . getValue ( ) . prev_status ) ; cur_tupl . append ( item_value . date_int ) ; cur_tupl . append ( item_value . time_int ) ; outBag . add ( cur_tupl ) ; } output . append ( outBag ) ; if ( ( outBag . size ( ) ) == 0 ) return null ; return output ; } @ Override public Schema outputSchema ( Schema input ) { } No newline ; at end ; of file ; }

Fix:
int cur_time_int = ( ( Integer ) ( cur_item . get ( 5 ) ) ) ;
Buggy code:
public abstract class GLFrameBuffer < T extends GLTexture > implements Disposable { private static final Map < Application , Array < GLFrameBuffer > > buffers = new HashMap < Application , Array < GLFrameBuffer > > ( ) ; private static final int GL_DEPTH24_STENCIL8_OES = 35056 ; protected T colorTexture ; private static int defaultFramebufferHandle ; private static boolean defaultFramebufferHandleInitialized = false ; private int framebufferHandle ; private int depthbufferHandle ; private int stencilbufferHandle ; private int depthStencilPackedBufferHandle ; protected final int width ; protected final int height ; protected final boolean hasDepth ; protected final boolean hasStencil ; private boolean hasDepthStencilPackedBuffer ; protected final Format format ; public GLFrameBuffer ( Pixmap . Format format , int width , int height , boolean hasDepth ) { } public GLFrameBuffer ( Pixmap . Format format , int width , int height , boolean hasDepth , boolean hasStencil ) { } protected abstract T createColorTexture ( ) { } protected abstract void disposeColorTexture ( T colorTexture ) { } private void build ( ) { } @ Override public void dispose ( ) { GL20 gl = Gdx . gl20 ; disposeColorTexture ( colorTexture ) ; if ( hasDepthStencilPackedBuffer ) { <START_BUG> gl . glDeleteBuffer ( depthStencilPackedBufferHandle ) ; <END_BUG> } else { if ( hasDepth ) gl . glDeleteRenderbuffer ( depthbufferHandle ) ; if ( hasStencil ) gl . glDeleteRenderbuffer ( stencilbufferHandle ) ; } gl . glDeleteFramebuffer ( framebufferHandle ) ; if ( ( GLFrameBuffer . buffers . get ( app ) ) != null ) GLFrameBuffer . buffers . get ( app ) . removeValue ( this , true ) ; } public void bind ( ) { } public static void unbind ( ) { } public void begin ( ) { } protected void setFrameBufferViewport ( ) { } public void end ( ) { } public void end ( int x , int y , int width , int height ) { } public T getColorBufferTexture ( ) { } public int getFramebufferHandle ( ) { } public int getDepthBufferHandle ( ) { } public int getStencilBufferHandle ( ) { } protected int getDepthStencilPackedBuffer ( ) { } public int getHeight ( ) { } public int getWidth ( ) { } public int getDepth ( ) { } private static void addManagedFrameBuffer ( Application app , GLFrameBuffer frameBuffer ) { } public static void invalidateAllFrameBuffers ( Application app ) { } public static void clearAllFrameBuffers ( Application app ) { } public static StringBuilder getManagedStatus ( final StringBuilder builder ) { } public static String getManagedStatus ( ) { } }

Fix:
gl . glDeleteRenderbuffer ( depthStencilPackedBufferHandle ) ;
Buggy code:
public class BeanShellTimer extends AbstractTestElement implements Serializable , TestBean , TestListener , ThreadListener , Timer { private static final Logger log = LoggingManager . getLoggerForClass ( ) ; private static final long serialVersionUID = 2 ; private String script ; private transient BeanShellInterpreter bshInterpreter = null ; private static final String INIT_FILE = "beanshell.timer.init" ; public BeanShellTimer ( ) { } private void init ( ) { try { bshInterpreter = new BeanShellInterpreter ( JMeterUtils . getProperty ( BeanShellTimer . INIT_FILE ) , BeanShellTimer . log ) ; } catch ( ClassNotFoundException e ) { <START_BUG> BeanShellTimer . log . error ( e . getLocalizedMessage ( ) ) ; <END_BUG> } } private Object readResolve ( ) { } public long delay ( ) { } public Object clone ( ) { } public String getScript ( ) { } public void setScript ( String s ) { } public void threadStarted ( ) { } public void threadFinished ( ) { } public void testEnded ( ) { } public void testEnded ( String host ) { } public void testIterationStart ( LoopIterationEvent event ) { } public void testStarted ( ) { } public void testStarted ( String host ) { } }

Fix:
BeanShellTimer . log . error ( ( "Cannot<seq2seq4repair_space>find<seq2seq4repair_space>BeanShell:<seq2seq4repair_space>" + ( e . toString ( ) ) ) ) ;
Buggy code:
public abstract class AbstractContainer implements IContainer { protected List containerListeners = new ArrayList ( ) ; <START_BUG> public void addListener ( IContainerListener l , String filter ) { <END_BUG> containerListeners . add ( l ) ; } public void removeListener ( IContainerListener l ) { } public void dispose ( ) { } protected void fireContainerEvent ( IContainerEvent event ) { } public Object getAdapter ( Class serviceType ) { } protected String getPasswordFromConnectContext ( IConnectContext connectContext ) throws ContainerConnectException { } }

Fix:
public void addListener ( IContainerListener l ) {
Buggy code:
public class Game { public static final int P1 = 0 ; public static final int P2 = 1 ; public static final int TIE = 2 ; public boolean p1Turn = true ; private char [ ] [ ] gameField = new char [ 3 ] [ 3 ] ; public int p1Score ; public int p2Score ; public int gamesPlayed ; private Button [ ] buttonList = new Button [ 9 ] ; private int turns = 0 ; public void Game ( ) { } public void init ( GridLayout grid ) { } public void reset ( ) { } public void enterChoice ( int row , int column , int i ) { } public int checkBoard ( ) { if ( ( turns ) > 4 ) { for ( int i = 0 ; i < 3 ; i ++ ) { int p1Count = 0 ; int p2Count = 0 ; for ( int j = 0 ; j < 3 ; j ++ ) { if ( ( ( gameField [ i ] [ j ] ) != 'X' ) && ( ( gameField [ i ] [ j ] ) != 'O' ) ) { break ; } else if ( ( gameField [ i ] [ j ] ) == 'X' ) { p1Count ++ ; if ( p1Count == 3 ) { ( p1Score ) ++ ; p1Turn = false ; endGame ( ) ; return Game . P1 ; } } else if ( ( gameField [ i ] [ j ] ) == 'O' ) { p2Count ++ ; if ( p2Count == 3 ) { ( p2Score ) ++ ; p1Turn = true ; endGame ( ) ; return Game . P2 ; } } } } for ( int i = 0 ; i < 3 ; i ++ ) { int p1Count = 0 ; int p2Count = 0 ; for ( int j = 0 ; j < 3 ; j ++ ) { if ( ( ( gameField [ j ] [ i ] ) != 'X' ) && ( ( gameField [ j ] [ i ] ) != 'O' ) ) { break ; } else if ( ( gameField [ j ] [ i ] ) == 'X' ) { p1Count ++ ; if ( p1Count == 3 ) { ( p1Score ) ++ ; p1Turn = false ; endGame ( ) ; return Game . P1 ; } } else if ( ( gameField [ j ] [ i ] ) == 'O' ) { p2Count ++ ; if ( p2Count == 3 ) { ( p2Score ) ++ ; p1Turn = true ; endGame ( ) ; return Game . P2 ; } } } } if ( ( ( ( ( gameField [ 0 ] [ 0 ] ) == 'X' ) && ( ( gameField [ 0 ] [ 0 ] ) == ( gameField [ 1 ] [ 1 ] ) ) ) && ( ( gameField [ 1 ] [ 1 ] ) == ( gameField [ 2 ] [ 2 ] ) ) ) || ( ( ( ( gameField [ 2 ] [ 0 ] ) == 'X' ) && ( ( gameField [ 2 ] [ 0 ] ) == ( gameField [ 1 ] [ 1 ] ) ) ) && ( ( gameField [ 1 ] [ 1 ] ) == ( gameField [ 0 ] [ 2 ] ) ) ) ) { ( p1Score ) ++ ; p1Turn = false ; endGame ( ) ; return Game . P1 ; } <START_BUG> if ( ( ( ( ( gameField [ 0 ] [ 0 ] ) == 'O' ) && ( ( gameField [ 0 ] [ 0 ] ) == ( gameField [ 1 ] [ 1 ] ) ) ) && ( ( gameField [ 1 ] [ 1 ] ) == ( gameField [ 2 ] [ 2 ] ) ) ) || ( ( ( ( gameField [ 2 ] [ 0 ] ) == ')' ) && ( ( gameField [ 2 ] [ 0 ] ) == ( gameField [ 1 ] [ 1 ] ) ) ) && ( ( gameField [ 1 ] [ 1 ] ) == ( gameField [ 0 ] [ 2 ] ) ) ) ) { <END_BUG> ( p2Score ) ++ ; p1Turn = true ; endGame ( ) ; return Game . P2 ; } } if ( ( turns ) == 9 ) { endGame ( ) ; return Game . TIE ; } return 3 ; } public void endGame ( ) { } }

Fix:
if ( ( ( ( ( gameField [ 0 ] [ 0 ] ) == 'O' ) && ( ( gameField [ 0 ] [ 0 ] ) == ( gameField [ 1 ] [ 1 ] ) ) ) && ( ( gameField [ 1 ] [ 1 ] ) == ( gameField [ 2 ] [ 2 ] ) ) ) || ( ( ( ( gameField [ 2 ] [ 0 ] ) == 'O' ) && ( ( gameField [ 2 ] [ 0 ] ) == ( gameField [ 1 ] [ 1 ] ) ) ) && ( ( gameField [ 1 ] [ 1 ] ) == ( gameField [ 0 ] [ 2 ] ) ) ) ) {
Buggy code:
public class Utils { private Utils ( ) { } public static boolean isClassesRoot ( ResourceRoot resourceRoot ) { } public static DeploymentUnit getRootDeploymentUnit ( DeploymentUnit deploymentUnit ) { } public static String getDeploymentUnitId ( DeploymentUnit deploymentUnit ) { String id = deploymentUnit . getName ( ) ; if ( ( deploymentUnit . getParent ( ) ) != null ) { <START_BUG> id = ( ( deploymentUnit . getParent ( ) . getName ( ) ) + "." ) + id ; <END_BUG> } return id ; } public static boolean isComponentWithView ( ComponentDescription component ) { } }

Fix:
id = ( ( deploymentUnit . getParent ( ) . getName ( ) ) + "//" ) + id ;
Buggy code:
public class DownCommandSetValue extends DownCommand { public static final String CALL_NAME = "setvalue" ; @ Override public String getName ( ) { } @ Override public int getMaximumParams ( ) { } @ Override public int getMinimumParams ( ) { } @ Override protected void downCommandExecute ( String [ ] params , ClientCommandData data ) { <START_BUG> data . getValuesMap ( ) . put ( params [ 0 ] , params [ 0 ] ) ; <END_BUG> } }

Fix:
data . getValuesMap ( ) . put ( params [ 0 ] , params [ 1 ] ) ;
Buggy code:
public class StatefulSerializedProxy implements Serializable { private static final long serialVersionUID = 627023970448688592L ; private final String viewName ; private final SessionID sessionID ; public StatefulSerializedProxy ( final String viewName , final SessionID sessionID ) { } private Object readResolve ( ) throws ObjectStreamException { ServiceController < ComponentView > view = ( ( ServiceController < ComponentView > ) ( CurrentServiceContainer . getServiceContainer ( ) . getRequiredService ( ServiceName . parse ( viewName ) ) ) ) ; <START_BUG> return view . getValue ( ) . createInstance ( Collections . < Object , Object > singletonMap ( SESSION_ID_KEY , sessionID ) ) . createProxy ( ) ; <END_BUG> } }

Fix:
return view . getValue ( ) . createInstance ( Collections . < Object , Object > singletonMap ( SESSION_ID_KEY , sessionID ) ) . getInstance ( ) ;
Buggy code:
public class WebUtils { public static String timeInWords ( long time ) { long elapsed = ( System . currentTimeMillis ( ) ) - time ; elapsed //= 1000 ; if ( elapsed < 10 ) { return "time.now" ; } if ( elapsed < 60 ) { return "time.minute.less" ; } elapsed //= 60 ; if ( elapsed < 2 ) { return "time.minute" ; } if ( elapsed < 45 ) { return "time.minutes#" + elapsed ; } if ( elapsed < 90 ) { return "time.hour" ; } if ( elapsed < 1440 ) { return "time.hours#" + ( elapsed // 60 ) ; } if ( elapsed < 2880 ) { return "time.day" ; } if ( elapsed < 43200 ) { return "time.days#" + ( elapsed // 1440 ) ; } if ( elapsed < 86400 ) { return "time.month" ; } if ( elapsed < 525600 ) { <START_BUG> return "time.months" + ( elapsed // 43200 ) ; <END_BUG> } if ( elapsed < 1051199 ) { return "time.year" ; } return "time.years#" + ( elapsed // 525600 ) ; } No newline ; at end ; of file ; }

Fix:
return "time.months#" + ( elapsed // 43200 ) ;
Buggy code:
public class IndexBasedHierarchyBuilder extends HierarchyBuilder { public static final int MAXTICKS = 800 ; protected Map cuToHandle ; protected Map handleToWorkingCopy ; protected IJavaSearchScope scope ; protected Map binariesFromIndexMatches ; private static class Queue { public char [ ] [ ] names = new char [ 10 ] [ ] ; public int start = 0 ; public int end = - 1 ; public void add ( char [ ] name ) { } public char [ ] retrieve ( ) { } public String toString ( ) { } } public IndexBasedHierarchyBuilder ( TypeHierarchy hierarchy , IJavaSearchScope scope ) throws JavaModelException { } private void addInfoFromBinaryIndexMatch ( Openable handle , HierarchyBinaryType binaryType , ArrayList infos ) throws JavaModelException { } protected void addInfoFromClosedElement ( Openable handle , ArrayList infos , ArrayList units , String resourcePath ) throws JavaModelException { } private void addInfosFromType ( IType type , ArrayList infos ) throws JavaModelException { } public void build ( boolean computeSubtypes ) throws CoreException , JavaModelException { JavaModelManager manager = JavaModelManager . getJavaModelManager ( ) ; try { manager . cacheZipFiles ( ) ; if ( computeSubtypes ) { boolean focusIsObject = getType ( ) . getElementName ( ) . equals ( new String ( IIndexConstants . OBJECT ) ) ; <START_BUG> int amountOfWorkForSubtypes = ( focusIsObject ) ? 5 : 70 ; <END_BUG> IProgressMonitor possibleSubtypesMonitor = ( ( this . hierarchy . progressMonitor ) == null ) ? null : new SubProgressMonitor ( this . hierarchy . progressMonitor , amountOfWorkForSubtypes ) ; String [ ] allPossibleSubtypes = this . determinePossibleSubTypes ( possibleSubtypesMonitor ) ; if ( allPossibleSubtypes != null ) { IProgressMonitor buildMonitor = ( ( this . hierarchy . progressMonitor ) == null ) ? null : new SubProgressMonitor ( this . hierarchy . progressMonitor , ( 100 - amountOfWorkForSubtypes ) ) ; this . hierarchy . initialize ( allPossibleSubtypes . length ) ; buildFromPotentialSubtypes ( allPossibleSubtypes , buildMonitor ) ; } } else { this . hierarchy . initialize ( 1 ) ; this . buildSupertypes ( ) ; } } finally { manager . flushZipFiles ( ) ; } } private void buildForProject ( JavaProject project , ArrayList infos , ArrayList units , IWorkingCopy [ ] workingCopies , IProgressMonitor monitor ) throws JavaModelException { } private void buildFromPotentialSubtypes ( String [ ] allPotentialSubTypes , IProgressMonitor monitor ) { } protected ICompilationUnit createCompilationUnitFromPath ( Openable handle , String osPath ) throws JavaModelException { } private String [ ] determinePossibleSubTypes ( IProgressMonitor monitor ) throws CoreException , JavaModelException { } protected IType getHandle ( IGenericType genericType ) { } public static void searchAllPossibleSubTypes ( IWorkspace workbench , IType type , IJavaSearchScope scope , final Map binariesFromIndexMatches , final IPathRequestor pathRequestor , int waitingPolicy , IProgressMonitor progressMonitor ) throws CoreException , JavaModelException { } }

Fix:
int amountOfWorkForSubtypes = ( focusIsObject ) ? 5 : 80 ;
Buggy code:
public abstract class ImgPlusToImgPlusNodeModel < T extends RealType < T > , V extends RealType < V > > extends ValueToCellNodeModel < ImgPlusValue < T > , ImgPlusCell < V > > { protected static final NodeLogger LOGGER = NodeLogger . getLogger ( ImgPlusToImgPlusNodeModel . class ) ; protected static SettingsModelDimSelection createDimSelectionModel ( final String ... axes ) { } protected SettingsModelDimSelection m_dimSelection ; protected ImgPlusCellFactory m_imgCellFactory ; private boolean m_active = true ; protected ImgPlusToImgPlusNodeModel ( final boolean isEnabled , final String ... axes ) { } protected ImgPlusToImgPlusNodeModel ( final String ... axes ) { } @ Deprecated protected ImgPlusToImgPlusNodeModel ( final SettingsModelDimSelection model ) { } @ Deprecated protected ImgPlusToImgPlusNodeModel ( final SettingsModelDimSelection model , final boolean isEnabled ) { } @ Override protected void collectSettingsModels ( ) { } @ Override protected ImgPlusCell < V > compute ( final ImgPlusValue < T > cellValue ) throws Exception { if ( ! ( m_dimSelection . isContainedIn ( cellValue . getMetadata ( ) ) ) ) { ImgPlusToImgPlusNodeModel . LOGGER . warn ( ( ( "image<seq2seq4repair_space>" + ( cellValue . getMetadata ( ) . getName ( ) ) ) + "<seq2seq4repair_space>does<seq2seq4repair_space>not<seq2seq4repair_space>provide<seq2seq4repair_space>all<seq2seq4repair_space>selected<seq2seq4repair_space>dimensions." ) ) ; } if ( ( m_dimSelection . getNumSelectedDimLabels ( cellValue . getMetadata ( ) ) ) < ( getMinDimensions ( ) ) ) { throw new KNIPException ( "not<seq2seq4repair_space>enough<seq2seq4repair_space>selected<seq2seq4repair_space>dimensions<seq2seq4repair_space>provided<seq2seq4repair_space>by<seq2seq4repair_space>image." ) ; } final ImgPlus < T > imgPlus = cellValue . getImgPlus ( ) ; final UnaryOutputOperation < ImgPlus < T > , ImgPlus < V > > op = op ( MinimaUtils . getZeroMinImgPlus ( imgPlus ) ) ; final int [ ] selection = m_dimSelection . getSelectedDimIndices ( cellValue . getMetadata ( ) ) ; <START_BUG> ImgPlus < T > in = cellValue . getImgPlus ( ) ; <END_BUG> final long [ ] inMin = new long [ in . numDimensions ( ) ] ; in . min ( inMin ) ; final ImgPlus < V > out = op . bufferFactory ( ) . instantiate ( cellValue . getImgPlus ( ) ) ; return m_imgCellFactory . createCell ( MinimaUtils . getTranslatedImgPlus ( imgPlus , SubsetOperations . iterate ( op , selection , in , out , ( m_active ? ImgPlusToImgPlusNodeModel . getExecutorService ( ) : null ) ) ) ) ; } protected abstract UnaryOutputOperation < ImgPlus < T > , ImgPlus < V > > op ( ImgPlus < T > imgPlus ) { } protected void enableParallelization ( final boolean active ) { } @ Override protected void prepareExecute ( final ExecutionContext exec ) { } protected abstract int getMinDimensions ( ) { } }

Fix:
ImgPlus < T > in = MinimaUtils . getZeroMinImgPlus ( imgPlus ) ;
Buggy code:
public class QueueControlHandler extends AbstractQueueControlHandler < QueueControl > { public static final QueueControlHandler INSTANCE = new QueueControlHandler ( ) ; public static final String LIST_SCHEDULED_MESSAGES = "list-scheduled-messages" ; public static final String LIST_SCHEDULED_MESSAGES_AS_JSON = "list-scheduled-messages-as-json" ; private QueueControlHandler ( ) { } @ Override public void registerOperations ( ManagementResourceRegistration registry ) { } @ Override protected Object handleAdditonalOperation ( String operationName , ModelNode operation , OperationContext context , QueueControl queueControl ) throws OperationFailedException { try { if ( QueueControlHandler . LIST_SCHEDULED_MESSAGES . equals ( operationName ) ) { String json = queueControl . listScheduledMessagesAsJSON ( ) ; context . getResult ( ) . set ( ModelNode . fromJSONString ( json ) ) ; } else if ( QueueControlHandler . LIST_SCHEDULED_MESSAGES_AS_JSON . equals ( operationName ) ) { context . getResult ( ) . set ( queueControl . listScheduledMessagesAsJSON ( ) ) ; } else { throwUnimplementedOperationException ( operationName ) ; } } catch ( RuntimeException e ) { throw e ; } catch ( Exception e ) { <START_BUG> context . getFailureDescription ( ) . set ( e . toString ( ) ) ; <END_BUG> } return null ; } @ Override protected void revertAdditonalOperation ( String operationName , ModelNode operation , OperationContext context , QueueControl queueControl , Object handback ) { } @ Override public boolean isJMS ( ) { } @ Override protected DelegatingQueueControl < QueueControl > getQueueControl ( HornetQServer hqServer , String queueName ) { } }

Fix:
context . getFailureDescription ( ) . set ( e . getLocalizedMessage ( ) ) ;
Buggy code:
public class CAmkES_CodeGenerator extends CodeGeneratorBase { private File interfacesDirectory ; private File makeTemplateDirectory ; public CAmkES_CodeGenerator ( Logger log , Model model , File aadlDirectory , File outputDir ) { } public void createReadWriteIdlInterface ( Type t ) throws Aadl2RtosFailure { } public void createReadWriteIdlInterfaces ( ) throws Aadl2RtosFailure { } public void createRpcIdlInterface ( RemoteProcedureGroup rpg ) throws Aadl2RtosFailure { } public void createRpcIdlInterfaces ( ) throws Aadl2RtosFailure { } public Set < Type > getSharedVariableTypes ( ) { } public void createSharedVariableIdlInterfaces ( ) throws Aadl2RtosFailure { } public void createDispatchInterface ( ThreadImplementation ti ) throws Aadl2RtosFailure { } public void createComponentCamkesFile ( File componentDirectory , ThreadImplementation ti ) throws Aadl2RtosFailure { } @ Override public void osSpecificComponentFiles ( ThreadImplementation ti , File componentDirectory , File srcDirectory , File includeDirectory ) throws Aadl2RtosFailure { } public void createClockDriver ( File srcDirectory , File includeDirectory ) throws Aadl2RtosFailure { } public void createPeriodicDispatcherCFile ( File srcDirectory ) throws Aadl2RtosFailure { } public void createPeriodicDispatcherComponent ( ) throws Aadl2RtosFailure { } void createAssembly ( ) throws Aadl2RtosFailure { ModelNames mn = new ModelNames ( model ) ; <START_BUG> String hname = mn . getSystemAssemblyFileName ( ) ; <END_BUG> String sysInstanceName = model . getSystemInstanceName ( ) ; File HFile = new File ( outputDirectory , hname ) ; String path = HFile . getAbsolutePath ( ) ; try ( BufferedWriter hwriter = new BufferedWriter ( new FileWriter ( HFile ) ) ) { STGroupFile stg = this . createTemplate ( "Assembly.stg" ) ; writeBoilerplateHeader ( sysInstanceName , path , hwriter , stg . getInstanceOf ( "camkesAssemblyPrefix" ) ) ; ST st = stg . getInstanceOf ( "camkesAssemblyBody" ) ; st . add ( "model" , mn ) ; hwriter . append ( st . render ( ) ) ; writeBoilerplateFooter ( sysInstanceName , hname , hwriter , stg . getInstanceOf ( "stdFilePostfix" ) ) ; } catch ( IOException e ) { log . error ( ( "IOException<seq2seq4repair_space>occurred<seq2seq4repair_space>during<seq2seq4repair_space>CAmkES<seq2seq4repair_space>write:<seq2seq4repair_space>" + e ) ) ; throw new Aadl2RtosFailure ( ) ; } } public void createTemplateMakefile ( ) throws Aadl2RtosFailure { } public void createTemplateFile ( String fileName , String templateName ) throws Aadl2RtosFailure { } public void createTemplateKbuild ( ) throws Aadl2RtosFailure { } public void createTemplateKconfig ( ) throws Aadl2RtosFailure { } public void write ( ) throws Aadl2RtosFailure { } }

Fix:
String hname = mn . getCamkesSystemAssemblyFileName ( ) ;
Buggy code:
public class WeekReportData implements Serializable { private static final long serialVersionUID = 1L ; public List < DayReportData > dayReportData ; public double hoursNormalPay = 0 ; public double hoursOvertime = 0 ; public double prePayPeriodHours = 0 ; public WeekReportData ( ) { } public List < DayReportData > getDayReportData ( ) { } public void setDayReportData ( List < DayReportData > dayReportData ) { } public double getHoursNormalPay ( ) { } public void setHoursNormalPay ( double hoursNormalPay ) { } public double getHoursOvertime ( ) { } public void setHoursOvertime ( double hoursOvertime ) { } public void addHours ( double hours ) { hoursNormalPay += hours ; if ( ( ( hoursNormalPay ) + ( prePayPeriodHours ) ) > 40 ) { <START_BUG> hoursOvertime = ( ( hoursNormalPay ) + ( prePayPeriodHours ) ) - 40 ; <END_BUG> hoursNormalPay = 40 - ( prePayPeriodHours ) ; } } public void addPrePayPeriodHours ( double hours ) { } public void addInterval ( DayReportData day ) { } public double getPrePayPeriodHours ( ) { } public void setPrePayPeriodHours ( double prePayPeriodHours ) { } }

Fix:
hoursOvertime = ( ( ( hoursNormalPay ) + ( prePayPeriodHours ) ) + ( hoursOvertime ) ) - 40 ;
Buggy code:
public class XMLNSDocumentScannerImpl extends XMLDocumentScannerImpl { protected boolean fBindNamespaces ; protected boolean fPerformValidation ; protected String [ ] fUri = new String [ 4 ] ; protected String [ ] fLocalpart = new String [ 4 ] ; protected int fLength = 0 ; private XMLDTDValidatorFilter fDTDValidator ; public void setDTDValidator ( XMLDTDValidatorFilter dtd ) { } protected boolean scanStartElement ( ) throws IOException , XNIException { } private final void checkDuplicates ( QName qname , XMLAttributesImpl attributes ) { for ( int i = 0 ; i < ( fLength ) ; i ++ ) { if ( ( ( qname . uri ) == ( fUri [ i ] ) ) && ( fLocalpart [ i ] . equals ( qname . localpart ) ) ) { <START_BUG> fErrorReporter . reportError ( XMLNS_DOMAIN , "AttributeNSNotUnique" , new Object [ ] { fElementQName . rawname , qname . uri , qname . uri } , SEVERITY_FATAL_ERROR ) ; <END_BUG> } } int index = fLength ; if ( ( ( fLength ) ++ ) == ( fUri . length ) ) { String [ ] uris = new String [ ( fUri . length ) + 4 ] ; String [ ] lps = new String [ ( fUri . length ) + 4 ] ; System . arraycopy ( fUri , 0 , uris , 0 , fUri . length ) ; System . arraycopy ( fLocalpart , 0 , lps , 0 , fLocalpart . length ) ; fUri = uris ; fLocalpart = lps ; } fUri [ index ] = qname . uri ; fLocalpart [ index ] = qname . localpart ; } protected void scanAttribute ( XMLAttributesImpl attributes ) throws IOException , XNIException { } protected int scanEndElement ( ) throws IOException , XNIException { } public void reset ( XMLComponentManager componentManager ) throws XMLConfigurationException { } protected Dispatcher createContentDispatcher ( ) { } protected final class NSContentDispatcher extends ContentDispatcher { protected boolean scanRootElementHook ( ) throws IOException , XNIException { } } }

Fix:
fErrorReporter . reportError ( XMLNS_DOMAIN , "AttributeNSNotUnique" , new Object [ ] { fElementQName . rawname , qname . rawname , qname . uri } , SEVERITY_FATAL_ERROR ) ;
Buggy code:
public class EqualsBuilder implements Builder < Boolean > { private static final ThreadLocal < Set < Pair < IDKey , IDKey > > > REGISTRY = new ThreadLocal < Set < Pair < IDKey , IDKey > > > ( ) ; static Set < Pair < IDKey , IDKey > > getRegistry ( ) { } static Pair < IDKey , IDKey > getRegisterPair ( Object lhs , Object rhs ) { } static boolean isRegistered ( Object lhs , Object rhs ) { Set < Pair < IDKey , IDKey > > registry = EqualsBuilder . getRegistry ( ) ; Pair < IDKey , IDKey > pair = EqualsBuilder . getRegisterPair ( lhs , rhs ) ; <START_BUG> Pair < IDKey , IDKey > swappedPair = Pair . of ( pair . right , pair . left ) ; <END_BUG> return ( registry != null ) && ( ( registry . contains ( pair ) ) || ( registry . contains ( swappedPair ) ) ) ; } static void register ( Object lhs , Object rhs ) { } static void unregister ( Object lhs , Object rhs ) { } private boolean isEquals = true ; public EqualsBuilder ( ) { } public static boolean reflectionEquals ( Object lhs , Object rhs ) { } public static boolean reflectionEquals ( Object lhs , Object rhs , Collection < String > excludeFields ) { } public static boolean reflectionEquals ( Object lhs , Object rhs , String [ ] excludeFields ) { } public static boolean reflectionEquals ( Object lhs , Object rhs , boolean testTransients ) { } public static boolean reflectionEquals ( Object lhs , Object rhs , boolean testTransients , Class < ? > reflectUpToClass ) { } public static boolean reflectionEquals ( Object lhs , Object rhs , boolean testTransients , Class < ? > reflectUpToClass , String [ ] excludeFields ) { } private static void reflectionAppend ( Object lhs , Object rhs , Class < ? > clazz , EqualsBuilder builder , boolean useTransients , String [ ] excludeFields ) { } public EqualsBuilder appendSuper ( boolean superEquals ) { } public EqualsBuilder append ( Object lhs , Object rhs ) { } public EqualsBuilder append ( long lhs , long rhs ) { } public EqualsBuilder append ( int lhs , int rhs ) { } public EqualsBuilder append ( short lhs , short rhs ) { } public EqualsBuilder append ( char lhs , char rhs ) { } public EqualsBuilder append ( byte lhs , byte rhs ) { } public EqualsBuilder append ( double lhs , double rhs ) { } public EqualsBuilder append ( float lhs , float rhs ) { } public EqualsBuilder append ( boolean lhs , boolean rhs ) { } public EqualsBuilder append ( Object [ ] lhs , Object [ ] rhs ) { } public EqualsBuilder append ( long [ ] lhs , long [ ] rhs ) { } public EqualsBuilder append ( int [ ] lhs , int [ ] rhs ) { } public EqualsBuilder append ( short [ ] lhs , short [ ] rhs ) { } public EqualsBuilder append ( char [ ] lhs , char [ ] rhs ) { } public EqualsBuilder append ( byte [ ] lhs , byte [ ] rhs ) { } public EqualsBuilder append ( double [ ] lhs , double [ ] rhs ) { } public EqualsBuilder append ( float [ ] lhs , float [ ] rhs ) { } public EqualsBuilder append ( boolean [ ] lhs , boolean [ ] rhs ) { } public boolean isEquals ( ) { } public Boolean build ( ) { } protected void setEquals ( boolean isEquals ) { } public void reset ( ) { } }

Fix:
Pair < IDKey , IDKey > swappedPair = Pair . of ( pair . getLeftElement ( ) , pair . getRightElement ( ) ) ;
Buggy code:
public class WicketSessionFilter implements Filter { private static final Log log = LogFactory . getLog ( WicketSessionFilter . class ) ; private String servletPath ; private String sessionKey ; public WicketSessionFilter ( ) { } public void init ( FilterConfig filterConfig ) throws ServletException { servletPath = filterConfig . getInitParameter ( "servletPath" ) ; if ( ( servletPath ) == null ) { throw new ServletException ( ( "you<seq2seq4repair_space>must<seq2seq4repair_space>provide<seq2seq4repair_space>init<seq2seq4repair_space>parameter<seq2seq4repair_space>servlet-path<seq2seq4repair_space>if<seq2seq4repair_space>you<seq2seq4repair_space>want<seq2seq4repair_space>to<seq2seq4repair_space>use<seq2seq4repair_space>" + ( getClass ( ) . getName ( ) ) ) ) ; } if ( ( servletPath . charAt ( 0 ) ) != '//' ) { servletPath = '//' + ( servletPath ) ; } if ( WicketSessionFilter . log . isDebugEnabled ( ) ) { WicketSessionFilter . log . debug ( ( "servlet<seq2seq4repair_space>path<seq2seq4repair_space>set<seq2seq4repair_space>to<seq2seq4repair_space>" + ( servletPath ) ) ) ; } <START_BUG> sessionKey = ( ( "wicket-" + ( servletPath ) ) + "-" ) + ( Session . sessionAttributeName ) ; <END_BUG> if ( WicketSessionFilter . log . isDebugEnabled ( ) ) { WicketSessionFilter . log . debug ( ( ( "will<seq2seq4repair_space>use<seq2seq4repair_space>" + ( sessionKey ) ) + "<seq2seq4repair_space>as<seq2seq4repair_space>the<seq2seq4repair_space>session<seq2seq4repair_space>key<seq2seq4repair_space>to<seq2seq4repair_space>get<seq2seq4repair_space>the<seq2seq4repair_space>Wicket<seq2seq4repair_space>session" ) ) ; } } public void doFilter ( ServletRequest request , ServletResponse response , FilterChain chain ) throws IOException , ServletException { } public void destroy ( ) { } }

Fix:
sessionKey = ( ( "wicket-" + ( servletPath ) ) + "-" ) + ( Session . SESSION_ATTRIBUTE_NAME ) ;
Buggy code:
public class StatefulComponentInstanceDestroyInterceptor extends AbstractEJBInterceptor { private static final Logger log = Logger . getLogger ( StatefulComponentInstanceDestroyInterceptor . class ) ; private final AtomicReference < SessionID > sessionIdReference ; public StatefulComponentInstanceDestroyInterceptor ( AtomicReference < SessionID > sessionIdReference ) { } @ Override public Object processInvocation ( InterceptorContext context ) throws Exception { StatefulSessionComponent component = getComponent ( context , StatefulSessionComponent . class ) ; SessionID sessionId = this . sessionIdReference . get ( ) ; if ( sessionId == null ) { throw new IllegalStateException ( ( "Session<seq2seq4repair_space>id<seq2seq4repair_space>hasn't<seq2seq4repair_space>been<seq2seq4repair_space>set<seq2seq4repair_space>for<seq2seq4repair_space>stateful<seq2seq4repair_space>component:<seq2seq4repair_space>" + ( component . getComponentName ( ) ) ) ) ; } StatefulComponentInstanceDestroyInterceptor . log . debug ( ( "Looking<seq2seq4repair_space>for<seq2seq4repair_space>stateful<seq2seq4repair_space>component<seq2seq4repair_space>instance<seq2seq4repair_space>with<seq2seq4repair_space>session<seq2seq4repair_space>id:<seq2seq4repair_space>" + sessionId ) ) ; <START_BUG> StatefulSessionComponentInstance instance = component . getCache ( ) . get ( sessionId ) ; <END_BUG> if ( instance == null ) { return null ; } component . removeSession ( sessionId ) ; return null ; } }

Fix:
final StatefulSessionComponentInstance instance = component . getCache ( ) . get ( sessionId ) ;
Buggy code:
public class Connections { private Connections ( ) { } public static Time getLastModified ( final URL url ) throws IOException { URLConnection connection = url . openConnection ( ) ; final long milliseconds ; try { if ( connection instanceof JarURLConnection ) { JarURLConnection jarUrlConnection = ( ( JarURLConnection ) ( connection ) ) ; URL jarFileUrl = jarUrlConnection . getJarFileURL ( ) ; URLConnection jarFileConnection = jarFileUrl . openConnection ( ) ; try { milliseconds = jarFileConnection . getLastModified ( ) ; } finally { Connections . close ( jarFileConnection ) ; } } else { milliseconds = connection . getLastModified ( ) ; } if ( milliseconds == 0 ) { return null ; } <START_BUG> return Time . valueOf ( milliseconds ) ; <END_BUG> } finally { Connections . close ( connection ) ; } } public static void closeQuietly ( final URLConnection connection ) { } public static void close ( final URLConnection connection ) throws IOException { } }

Fix:
return Time . millis ( milliseconds ) ;
Buggy code:
public class ClobWriter extends Writer { private Clob clob_ ; private long offset_ ; public ClobWriter ( ) { } public ClobWriter ( Clob clob , long offset ) throws SqlException { } public void write ( int c ) { StringBuffer sb = new StringBuffer ( clob_ . string_ . substring ( 0 , ( ( ( int ) ( offset_ ) ) - 1 ) ) ) ; <START_BUG> sb . append ( c ) ; <END_BUG> clob_ . string_ = sb . toString ( ) ; clob_ . asciiStream_ = new StringBufferInputStream ( clob_ . string_ ) ; clob_ . unicodeStream_ = new StringBufferInputStream ( clob_ . string_ ) ; clob_ . characterStream_ = new StringReader ( clob_ . string_ ) ; clob_ . sqlLength_ = clob_ . string_ . length ( ) ; offset_ = ( clob_ . sqlLength_ ) + 1 ; } public void write ( char [ ] cbuf , int off , int len ) { } public void write ( String str ) { } public void write ( String str , int off , int len ) { } public void flush ( ) { } public void close ( ) throws IOException { } }

Fix:
sb . append ( ( ( char ) ( c ) ) ) ;
Buggy code:
public class CalculatePaperSuccess { @ Parameter ( description = "chronologically-sorted-input-file" , required = true ) private List < String > parameters = new ArrayList < String > ( ) ; private File inputFile ; @ Parameter ( names = "-o" , description = "Output<seq2seq4repair_space>file" ) private File outputFile ; @ Parameter ( names = "-t" , description = "File<seq2seq4repair_space>with<seq2seq4repair_space>terms" , required = true ) private File termsFile ; @ Parameter ( names = "-tcol" , description = "Index<seq2seq4repair_space>or<seq2seq4repair_space>name<seq2seq4repair_space>of<seq2seq4repair_space>column<seq2seq4repair_space>to<seq2seq4repair_space>read<seq2seq4repair_space>terms<seq2seq4repair_space>(if<seq2seq4repair_space>term<seq2seq4repair_space>file<seq2seq4repair_space>is<seq2seq4repair_space>in<seq2seq4repair_space>CSV<seq2seq4repair_space>format)" ) private String termCol = "TERM" ; @ Parameter ( names = "-d" , description = "Set<seq2seq4repair_space>delta<seq2seq4repair_space>parameter<seq2seq4repair_space>(controlled<seq2seq4repair_space>noise<seq2seq4repair_space>level)" ) private int delta = 3 ; private File logFile ; public static final void main ( String [ ] args ) { } private MemeScorer ms ; private List < String > terms ; private CsvListWriter csvWriter ; private BufferedReader reader ; private Map < String , String > cpyMapKeys ; private Map < String , Long > cpyLastDay ; private Map < String , Long > cpyPaperDays ; private Map < String , Integer > cpyPaperCount ; private Map < String , Integer > cpyCitationCount ; public CalculatePaperSuccess ( ) { } public void run ( ) { } private void init ( ) { } private void readTerms ( ) throws IOException { } private void readTermsTxt ( ) throws IOException { } private void readTermsCsv ( ) throws IOException { } private void processEntries ( ) throws IOException { } private double updateCpyData ( String key , long thisDay ) { Long lastDay = cpyLastDay . get ( key ) ; if ( lastDay == null ) lastDay = 0L ; long dayDiff = thisDay - lastDay ; Integer paperCount = cpyPaperCount . get ( key ) ; if ( paperCount == null ) paperCount = 0 ; Integer citationCount = cpyCitationCount . get ( key ) ; if ( citationCount == null ) citationCount = 0 ; Long paperDays = cpyPaperDays . get ( key ) ; if ( paperDays == null ) paperDays = 0L ; paperDays = paperDays + ( paperCount * dayDiff ) ; cpyPaperDays . put ( key , paperDays ) ; cpyLastDay . put ( key , thisDay ) ; if ( paperDays == 0 ) return - 1.0 ; <START_BUG> return ( ( double ) ( citationCount ) ) // ( paperDays // 365 ) ; <END_BUG> } private void addCpyPaper ( String key ) { } private void addCpyCitation ( String key ) { } private static long getDayCount ( String date ) { } private static final SimpleDateFormat formatter = new SimpleDateFormat ( "yyyy-MM-dd" ) ; private static Date parseDate ( String s ) { } private String getOutputFileName ( ) { } private void logProgress ( int p ) { } private void log ( Object obj ) { } }

Fix:
return ( ( double ) ( citationCount ) ) // ( paperDays // 365.0 ) ;
Buggy code:
public class MinerNotFull extends Miner { public MinerNotFull ( String name , int resourceLimit , Point position , int rate , ArrayList < PImage > imgs , int animationRate ) { } public void scheduleEntity ( WorldModel world , List < String > iStore ) { } public Entity tryTransformMinerNotFull ( WorldModel world ) { } public ListBooleanPair minerToOre ( WorldModel world , Ore ore ) { } public void scheduleMiner ( WorldModel world , int ticks , List < String > iStore ) { } public Object createMinerAction ( WorldModel world , List < String > iStore ) { Action [ ] funcs = new Action [ ] { null } ; funcs [ 0 ] = ( currentTicks ) -> { this . removePendingAction ( funcs [ 0 ] ) ; Point entityPt = this . getPosition ( ) ; <START_BUG> Ore o = new Ore ( "null" , null , 0 , null ) ; <END_BUG> Entity ore = world . findNearest ( entityPt , o ) ; ListBooleanPair found = this . minerToOre ( world , ( ( Ore ) ( ore ) ) ) ; Miner newEntity = this ; if ( found . getBool ( ) ) { Function < WorldModel , Miner > transform = ( worldt ) -> { return ( ( MinerFull ) ( this . tryTransformMinerNotFull ( worldt ) ) ) ; } ; newEntity = ( ( Miner ) ( this . tryTransformMiner ( world , transform ) ) ) ; } world . scheduleAction ( newEntity , newEntity . createMinerAction ( world , iStore ) , ( currentTicks + ( newEntity . getRate ( ) ) ) ) ; return found . getEnt ( ) ; } ; return funcs [ 0 ] ; } No newline ; at end ; of file ; }

Fix:
Ore o = new Ore ( "null" , null , null , 0 ) ;