nus-yam/ex-repair huggingface dataset:
Buggy code:
public class ColorTrendReport { private SystemConnection system ; public ColorTrendReport ( SystemConnection system ) throws InvalidConnectionRequestException { } public ColorTrendResults runReport ( final Date startDate , final Date endDate , final Location start ) throws ActionExecutionException , SystemException { final TrendRange range = TrendRangeFactory . byDateRange ( startDate , endDate ) ; return system . runReadAction ( new ReadActionResult < ColorTrendResults > ( ) { @ Override public ColorTrendResults execute ( @ NotNull SystemAccess systemAccess ) throws Exception { Collection < EquipmentColorTrendSource > sources = start . find ( EquipmentColorTrendSource . class , new EnabledColorTrendWithSetpointAcceptor ( ) ) ; Map < ColorTrendSource , Map < EquipmentColor , Long > > results = new HashMap < ColorTrendSource , Map < EquipmentColor , Long > > ( ) ; for ( EquipmentColorTrendSource source : sources ) { try { Location equipment = FindNodes . findMyEquipment ( source . getLocation ( ) ) ; AttachedEquipment eqAspect = equipment . getAspect ( AttachedEquipment . class ) ; if ( ! ( eqAspect . getDevice ( ) . isOutOfService ( ) ) ) { if ( ColorTrendProcessor . trace ) { LOGGER . println ( ( "------<seq2seq4repair_space>Processing<seq2seq4repair_space>" + ( equipment . getDisplayName ( ) ) ) ) ; } results . put ( new ColorTrendSource ( equipment ) , processTrendData ( source , range ) . getColorMap ( ) ) ; } } catch ( Exception e ) { LOGGER . println ( "Error<seq2seq4repair_space>processing<seq2seq4repair_space>trend<seq2seq4repair_space>data" ) ; e . printStackTrace ( LOGGER ) ; } } <START_BUG> return new ColorTrendResults ( ( ( endDate . getTime ( ) ) - ( startDate . getTime ( ) ) ) , results ) ; <END_BUG> } } ) ; } private ColorTrendProcessor processTrendData ( EquipmentColorTrendSource source , TrendRange range ) throws TrendException { } }

Fix:
return new ColorTrendResults ( results ) ;
Buggy code:
public class PsmTableModel extends DefaultEventTableModel { private SpectrumRepository spectrumRepository ; public static final int SPECTRUM_ID = 0 ; public static final int PRECURSOR_CHARGE = 1 ; public static final int PRECURSOR_MZRATIO = 2 ; public static final int PRECURSOR_INTENSITY = 3 ; public static final int RETENTION_TIME = 4 ; public static final int PEPTIDE_SEQUENCE = 5 ; public static final int PSM_CONFIDENCE = 6 ; public static final int PROTEIN_ACCESSIONS = 7 ; private int page ; private int perPage ; private int rowCount ; public String sortColumn ; public String sortDirection ; public String filter ; public PsmTableModel ( EventList source , TableFormat tableFormat , SpectrumRepository spectrumRepository ) { } public List getRows ( AnalyticalRun analyticalRun ) { } public String getPageIndicator ( ) { } public void reset ( AnalyticalRun analyticalRun ) { } public void updateSort ( int index ) { } public String getColumnDbName ( int column ) { } public boolean isMaxPage ( ) { } public int getMaxPage ( ) { } public int getPage ( ) { } public void setPage ( int page ) { <START_BUG> if ( ( page <= ( getMaxPage ( ) ) ) && ( page > 0 ) ) { <END_BUG> this . page = page ; } } public void setFilter ( String filter ) { } }

Fix:
if ( ( page <= ( getMaxPage ( ) ) ) && ( page >= 0 ) ) {
Buggy code:
public class ProjectDAOTest extends TestCase { private MySQLControl mControl = null ; private Configuration mConfig ; public ProjectDAOTest ( String testMethod ) { } @ Before protected void setUp ( ) throws Exception { } @ After protected void tearDown ( ) throws Exception { } @ Test public void testCreate ( ) { } @ Test public void testCreateScrumRoleInCreate ( ) { } @ Test public void testGetScrumRole ( ) { } @ Test public void testUpdateScrumRole ( ) { } @ Test public void testGet ( ) throws SQLException { } @ Test public void testUpdate ( ) throws SQLException { } @ Test public void testDelete ( ) { } @ Test public void testGetProjectByName ( ) { for ( int i = 0 ; i < 3 ; i ++ ) { ProjectObject project = new ProjectObject ( ( "TEST_PROJECT_" + ( i + 1 ) ) ) ; project . setDisplayName ( ( "TEST_DISPLATNAME_" + ( i + 1 ) ) ) . setComment ( ( "TEST_COMMON_" + ( i + 1 ) ) ) . setManager ( "TEST_MANAGER" ) . setAttachFileSize ( 2 ) ; long projectId = ProjectDAO . getInstance ( ) . create ( project ) ; assertNotSame ( ( - 1 ) , projectId ) ; } <START_BUG> ProjectObject theProject = ProjectDAO . getInstance ( ) . getProjectByName ( "TEST_PROJECT_1" ) ; <END_BUG> assertEquals ( 1 , theProject . getId ( ) ) ; assertEquals ( "TEST_DISPLATNAME_1" , theProject . getDisplayName ( ) ) ; assertEquals ( "TEST_COMMON_1" , theProject . getComment ( ) ) ; } @ Test public void testGetProjects ( ) { } private ProjectObject convertProject ( ResultSet result ) throws SQLException { } private ScrumRole convertScrumRole ( String projectName , String role , ResultSet result ) throws SQLException { } private void closeResultSet ( ResultSet result ) { } }

Fix:
ProjectObject theProject = ProjectDAO . getInstance ( ) . get ( "TEST_PROJECT_1" ) ;
Buggy code:
public final class App extends Application { private static final String TAG = "App" ; private static Context sContext ; private static RequestQueue sRequestQueue ; public static void cancelNetworkRequests ( final Heartbeat heartbeat ) { } public static Context getContext ( ) { } private static PackageInfo getPackageInfo ( ) { } public static RequestQueue getRequestQueue ( ) { } public static int getVersionCode ( ) { } public static String getVersionName ( ) { } @ Override public void onCreate ( ) { super . onCreate ( ) ; App . sContext = getApplicationContext ( ) ; Fabric . with ( App . sContext , new Crashlytics ( ) ) ; if ( BuildConfig . DEBUG ) { Crashlytics . setBool ( DEBUG , true ) ; } else { Crashlytics . setBool ( DEBUG , false ) ; } App . sRequestQueue = Volley . newRequestQueue ( App . sContext , new OkHttpStack ( ) ) ; Database . initialize ( ) ; final int currentVersion = App . getVersionCode ( ) ; final int lastVersion = Settings . getLastVersion ( ) ; if ( currentVersion > lastVersion ) { onUpgrade ( lastVersion , currentVersion ) ; <START_BUG> Settings . setLastVersion ( lastVersion ) ; <END_BUG> } } private void onUpgrade ( final int lastVersion , final int currentVersion ) { } @ Override public void onTrimMemory ( final int level ) { } @ Override public String toString ( ) { } }

Fix:
Settings . setLastVersion ( currentVersion ) ;
Buggy code:
public class Utils { private static final Logger log = Logger . getLogger ( Utils . class ) ; public static void setProperty ( String name , String value , ModelControllerClient client ) { } public static void removeProperty ( String name , ModelControllerClient client ) { } public static void redefineProperty ( String name , String value , ModelControllerClient client ) { } public static ModelNode executeOp ( ModelNode op , ModelControllerClient client ) { ModelNode modelNodeResult ; try { modelNodeResult = client . execute ( op ) ; } catch ( IOException ioe ) { throw new RuntimeException ( ioe ) ; } if ( ! ( SUCCESS . equals ( modelNodeResult . get ( OUTCOME ) . asString ( ) ) ) ) { <START_BUG> throw new RuntimeException ( ( ( ( "Management<seq2seq4repair_space>operation:<seq2seq4repair_space>" + op ) + "<seq2seq4repair_space>was<seq2seq4repair_space>not<seq2seq4repair_space>succesful.<seq2seq4repair_space>Result<seq2seq4repair_space>was:<seq2seq4repair_space>" ) + modelNodeResult ) ) ; <END_BUG> } return modelNodeResult ; } public static String getProperty ( String name , ModelControllerClient client ) { } }

Fix:
throw new RuntimeException ( ( ( ( "Management<seq2seq4repair_space>operation:<seq2seq4repair_space>" + op ) + "<seq2seq4repair_space>was<seq2seq4repair_space>not<seq2seq4repair_space>successful.<seq2seq4repair_space>Result<seq2seq4repair_space>was:<seq2seq4repair_space>" ) + modelNodeResult ) ) ;
Buggy code:
public class FixedElapsedTimeTest { @ Test public void testIsSatisfied ( ) { final Population pop = new Population ( ) { public void addChromosome ( final Chromosome chromosome ) { } public Chromosome getFittestChromosome ( ) { return null ; } public int getPopulationLimit ( ) { return 0 ; } public int getPopulationSize ( ) { return 0 ; } public Population nextGeneration ( ) { return null ; } public Iterator < Chromosome > iterator ( ) { return null ; } } ; final long start = System . nanoTime ( ) ; final long duration = 3 ; final FixedElapsedTime tec = new FixedElapsedTime ( duration , TimeUnit . SECONDS ) ; while ( ! ( tec . isSatisfied ( pop ) ) ) { try { <START_BUG> Thread . sleep ( 500 ) ; <END_BUG> } catch ( InterruptedException e ) { } } final long end = System . nanoTime ( ) ; final long elapsedTime = end - start ; final long diff = FastMath . abs ( ( elapsedTime - ( TimeUnit . SECONDS . toNanos ( duration ) ) ) ) ; Assert . assertTrue ( ( diff < ( TimeUnit . MILLISECONDS . toNanos ( 100 ) ) ) ) ; } }

Fix:
Thread . sleep ( 50 ) ;
Buggy code:
class DRDAXAProtocol { private DRDAConnThread connThread ; private DDMReader reader ; private DDMWriter writer ; private Xid xid ; DRDAXAProtocol ( DRDAConnThread connThread ) { } protected void parseSYNCCTL ( ) throws DRDAProtocolException { } protected int parseSYNCTYPE ( ) throws DRDAProtocolException { } private Xid parseXID ( ) throws DRDAProtocolException { } private int parseXIDSHR ( ) throws DRDAProtocolException { } private int parseXAFlags ( ) throws DRDAProtocolException { } private void startXATransaction ( Xid xid , int xaflags ) throws DRDAProtocolException { } private void commitTransaction ( Xid xid , int xaflags ) throws DRDAProtocolException { } private void commitLocalTransaction ( ) throws DRDAProtocolException { } private void commitXATransaction ( Xid xid , int xaflags ) throws DRDAProtocolException { } private void rollbackTransaction ( Xid xid , boolean sendSYNCCRD ) throws DRDAProtocolException { } private void rollbackLocalTransaction ( boolean sendSYNCCRD ) throws DRDAProtocolException { } private void rollbackXATransaction ( Xid xid , boolean sendSYNCCRD ) throws DRDAProtocolException { } private void endXA ( Xid xid , int xaflags ) throws DRDAProtocolException { XAResource xaResource = getXAResource ( ) ; int xaRetVal = xaResource . XA_OK ; try { xaResource . end ( xid , xaflags ) ; <START_BUG> xid = null ; <END_BUG> if ( SanityManager . DEBUG ) { connThread . trace ( ( ( ( ( ( "ended<seq2seq4repair_space>XA<seq2seq4repair_space>transaction.<seq2seq4repair_space>xid<seq2seq4repair_space>=<seq2seq4repair_space>" + xid ) + "<seq2seq4repair_space>xaflags<seq2seq4repair_space>=" ) + xaflags ) + "xaRetVal=" ) + xaRetVal ) ) ; } } catch ( XAException xe ) { xaRetVal = processXAException ( xe ) ; } writeSYNCCRD ( SYNCTYPE_END_UOW , xaRetVal , null ) ; } private void prepareXATransaction ( Xid xid ) throws DRDAProtocolException { } private void forgetXATransaction ( Xid xid ) throws DRDAProtocolException { } private void recoverXA ( ) throws DRDAProtocolException { } private void recoverXA ( int xaflags ) throws DRDAProtocolException { } private void writeSYNCCRD ( int synctype , int xaRetVal , Xid [ ] xids ) throws DRDAProtocolException { } private void writePRPHRCLST ( Xid [ ] xids ) throws DRDAProtocolException { } private void writeXID ( Xid xid ) throws DRDAProtocolException { } private XAResource getXAResource ( ) { } private String syncTypeToString ( int syncType ) { } private String xaflagsToString ( int xaflags ) { } private int processXAException ( XAException xe ) { } void rollbackCurrentTransaction ( ) { } }

Fix:
this . xid = null ;
Buggy code:
public class JavadocSingleTypeReference extends SingleTypeReference { public int tagSourceStart ; public int tagSourceEnd ; public PackageBinding packageBinding ; public JavadocSingleTypeReference ( char [ ] source , long pos , int tagStart , int tagEnd ) { } protected void reportInvalidType ( Scope scope ) { } protected void reportDeprecatedType ( TypeBinding type , Scope scope ) { } public void traverse ( ASTVisitor visitor , BlockScope scope ) { } public void traverse ( ASTVisitor visitor , ClassScope scope ) { } TypeBinding internalResolveType ( Scope scope ) { this . constant = Constant . NotAConstant ; if ( ( this . resolvedType ) != null ) return this . resolvedType . isValidBinding ( ) ? this . resolvedType : null ; this . resolvedType = getTypeBinding ( scope ) ; if ( ! ( this . resolvedType . isValidBinding ( ) ) ) { char [ ] [ ] tokens = new char [ ] [ ] { this . token } ; Binding binding = scope . getTypeOrPackage ( tokens ) ; if ( binding instanceof PackageBinding ) { this . packageBinding = ( ( PackageBinding ) ( binding ) ) ; } else { if ( ( this . resolvedType . problemId ( ) ) == ( ProblemReasons . NonStaticReferenceInStaticContext ) ) { ReferenceBinding closestMatch = ( ( ProblemReferenceBinding ) ( this . resolvedType ) ) . closestMatch ( ) ; if ( ( closestMatch != null ) && ( closestMatch . isTypeVariable ( ) ) ) { this . resolvedType = closestMatch ; return this . resolvedType ; } } reportInvalidType ( scope ) ; } return null ; } if ( isTypeUseDeprecated ( this . resolvedType , scope ) ) reportDeprecatedType ( this . resolvedType , scope ) ; if ( ( this . resolvedType ) instanceof ParameterizedTypeBinding ) { <START_BUG> this . resolvedType = ( ( ParameterizedTypeBinding ) ( this . resolvedType ) ) . type ; <END_BUG> } return this . resolvedType ; } public TypeBinding resolveType ( BlockScope blockScope , boolean checkBounds ) { } public TypeBinding resolveType ( ClassScope classScope ) { } }

Fix:
this . resolvedType = ( ( ParameterizedTypeBinding ) ( this . resolvedType ) ) . genericType ( ) ;
Buggy code:
public class FolderWatchService extends AbstractWatchService { private static final Logger logger = LoggerFactory . getLogger ( FolderWatchService . class ) ; private static final long CLEANUP_TASK_DELAY = 5000 ; private Path folderToWatch ; private Thread fileEventProcessor ; private WatchService watcher ; private Map < WatchKey , Path > watchKeyToPath ; private Timer timer ; public FolderWatchService ( Path rootFolderToWatch ) throws IOException { } @ Override public void start ( ) throws Exception { super . start ( ) ; watcher = FileSystems . getDefault ( ) . newWatchService ( ) ; FolderWatchService . logger . info ( "Scanning<seq2seq4repair_space>{}<seq2seq4repair_space>..." , folderToWatch ) ; watchKeyToPath . clear ( ) ; registerFoldersRecursive ( folderToWatch ) ; FolderWatchService . logger . info ( "Scanning<seq2seq4repair_space>done." ) ; <START_BUG> fileEventProcessor = new Thread ( new FolderWatchService . FolderWatchEventProcessor ( ) ) ; <END_BUG> fileEventProcessor . start ( ) ; } @ Override public void stop ( ) throws Exception { } private synchronized void registerFolder ( final Path folder ) throws IOException { } private synchronized void registerFoldersRecursive ( final Path start ) throws IOException { } private synchronized void unregisterFolder ( WatchKey folderKey ) { } private synchronized void cleanupFolderRegistrations ( ) { } private synchronized void scheduleCleanupTask ( ) { } @ SuppressWarnings ( "unchecked" ) private static < T > WatchEvent < T > castWatchEvent ( WatchEvent < ? > event ) { } private class FolderWatchEventProcessor implements Runnable { @ Override public void run ( ) { } private void processEvents ( ) { } private void handleEvent ( WatchEvent . Kind < Path > kind , Path filePath ) { } } }

Fix:
fileEventProcessor = new Thread ( new FolderWatchService . FolderWatchEventProcessor ( ) , "WatchServiceEventProcessorThread" ) ;
Buggy code:
public class InheritanceHeadTest extends WicketTestCase { public InheritanceHeadTest ( String name ) { } public void test_1 ( ) throws Exception { } public void test_2 ( ) throws Exception { } public void test_3 ( ) throws Exception { tester = new WicketTester ( new WebApplication ( ) { public Session newSession ( Request request , Response response ) { <START_BUG> return new org . apache . wicket . protocol . http . WebSession ( this , request , response ) . setStyle ( "myStyle" ) ; <END_BUG> } public Class getHomePage ( ) { return ConcretePage2 . class ; } protected WebResponse newWebResponse ( HttpServletResponse servletResponse ) { return new WebResponse ( servletResponse ) ; } } ) ; executeTest ( ConcretePage2 . class , "ExpectedResult3.html" ) ; } }

Fix:
return new org . apache . wicket . protocol . http . WebSession ( this , request ) . setStyle ( "myStyle" ) ;
Buggy code:
public class TestSubScorerFreqs extends LuceneTestCase { private static Directory dir ; private static IndexSearcher s ; @ BeforeClass public static void makeIndex ( ) throws Exception { } @ AfterClass public static void finish ( ) throws Exception { } private static class CountingCollector extends Collector { private final Collector other ; private int docBase ; public final Map < Integer , Map < Query , Float > > docCounts = new HashMap < Integer , Map < Query , Float > > ( ) ; private final Map < Query , Scorer > subScorers = new HashMap < Query , Scorer > ( ) ; private final ScorerVisitor < Query , Query , Scorer > visitor = new TestSubScorerFreqs . CountingCollector . MockScorerVisitor ( ) ; private final EnumSet < Occur > collect ; private class MockScorerVisitor extends ScorerVisitor < Query , Query , Scorer > { @ Override public void visitOptional ( Query parent , Query child , Scorer scorer ) { } @ Override public void visitProhibited ( Query parent , Query child , Scorer scorer ) { } @ Override public void visitRequired ( Query parent , Query child , Scorer scorer ) { } } public CountingCollector ( Collector other ) { } public CountingCollector ( Collector other , EnumSet < Occur > collect ) { } @ Override public void setScorer ( Scorer scorer ) throws IOException { } @ Override public void collect ( int doc ) throws IOException { } @ Override public void setNextReader ( AtomicReaderContext context ) throws IOException { <START_BUG> this . docBase = docBase ; <END_BUG> other . setNextReader ( context ) ; } @ Override public boolean acceptsDocsOutOfOrder ( ) { } } private static final float FLOAT_TOLERANCE = 1.0E-5F ; @ Test public void testTermQuery ( ) throws Exception { } @ SuppressWarnings ( "unchecked" ) @ Test public void testBooleanQuery ( ) throws Exception { } @ Test public void testPhraseQuery ( ) throws Exception { } }

Fix:
docBase = context . docBase ;
Buggy code:
public class Ilasm extends MatchingTask { protected static final String exe_name = "ilasm" ; protected static final String file_ext = "il" ; protected static final String file_pattern = "**//*." + ( Ilasm . file_ext ) ; protected static final String exe_title = "ilasm" ; private File srcDir ; protected String targetType ; protected boolean verbose ; protected boolean listing ; protected File outputFile ; protected File resourceFile ; protected boolean failOnError ; protected boolean debug ; private File keyfile ; protected String extraOptions ; public Ilasm ( ) { } public void Clear ( ) { } public void setSrcDir ( File srcDirName ) { } public void setTargetType ( String targetType ) throws BuildException { } public String getTargetType ( ) { } protected String getTargetTypeParameter ( ) { } public void setOwner ( String s ) { } protected boolean notEmpty ( String s ) { } public void setVerbose ( boolean b ) { } protected String getVerboseParameter ( ) { } public void setListing ( boolean b ) { } protected String getListingParameter ( ) { } public void setOutputFile ( File params ) { } protected String getOutputFileParameter ( ) { } public void setResourceFile ( File fileName ) { } protected String getResourceFileParameter ( ) { } public void setFailOnError ( boolean b ) { } public boolean getFailFailOnError ( ) { } public void setDebug ( boolean f ) { } public boolean getDebug ( ) { } protected String getDebugParameter ( ) { } public void setKeyfile ( File keyfile ) { } protected String getKeyfileParameter ( ) { } public void setExtraOptions ( String extraOptions ) { } public String getExtraOptions ( ) { } protected String getExtraOptionsParameter ( ) { } public void execute ( ) throws BuildException { if ( ( srcDir ) == null ) { <START_BUG> srcDir = project . resolveFile ( "." ) ; <END_BUG> } DirectoryScanner scanner = super . getDirectoryScanner ( srcDir ) ; String [ ] dependencies = scanner . getIncludedFiles ( ) ; log ( ( ( ( "assembling<seq2seq4repair_space>" + ( dependencies . length ) ) + "<seq2seq4repair_space>file" ) + ( ( dependencies . length ) == 1 ? "" : "s" ) ) ) ; String baseDir = scanner . getBasedir ( ) . toString ( ) ; for ( int i = 0 ; i < ( dependencies . length ) ; i ++ ) { String targetFile = dependencies [ i ] ; targetFile = ( baseDir + ( File . separator ) ) + targetFile ; executeOneFile ( targetFile ) ; } } public void executeOneFile ( String targetFile ) throws BuildException { } }

Fix:
srcDir = getProject ( ) . resolveFile ( "." ) ;
Buggy code:
public final class DBOper extends DefaultDBImpl { private static final Logger logger = LoggerFactory . getLogger ( DBOper . class ) ; private static final DBOper dbOper = new DBOper ( ) ; public static synchronized DBOper getDBOper ( ) { } private DBOper ( ) { } public List < TerminalBean > queryTerminals ( ) { } public List < IDBean > queryTerminalIdsWithOnlineTime ( ) { } public boolean updateTerminalStatus ( String sql , List < Object > params ) { } public boolean updateTerminalOffline ( long terminalId ) { } public long addNewChargeDetail ( CmdChargeDetailReq chargeDetail ) { } public int addNewRefund ( CmdRefundReq refund ) { } public boolean addCashBoxAmount ( int terminalId , int amountAdded ) { } public boolean setCashBoxAmountZero ( int terminalId ) { } public boolean setCashBoxAmount ( int terminalId , int totalAmount ) { } public boolean addWithdrawDetail ( CmdClearCashBox cmd ) { } public boolean addOperLog ( int terminalId , int logType , String logMemo ) { } public boolean saveDataBean ( DBSaveBean dataBean ) { <START_BUG> return ( executeUpdateSingle ( dataBean . getSql ( ) , dataBean . getParams ( ) ) ) != ( - 1 ) ; <END_BUG> } public void test ( ) { } public static void main ( String [ ] strings ) { } }

Fix:
return ( executeUpdateSingle ( dataBean . getSql ( ) , dataBean . getParams ( ) ) ) > 0 ;
Buggy code:
public class CompactSortedSet < E > extends AbstractSet < E > implements Set < E > { private SortedList < E > data ; public CompactSortedSet ( ) { } public CompactSortedSet ( Comparator < ? super E > comparator ) { } @ Override public Iterator < E > iterator ( ) { } @ Override public int size ( ) { } @ Override public boolean contains ( Object o ) { } @ Override public Object [ ] toArray ( ) { } @ Override public < T > T [ ] toArray ( T [ ] a ) { } @ Override public boolean add ( E e ) { } @ Override public boolean remove ( Object o ) { } @ Override public boolean retainAll ( Collection < ? > c ) { } @ Override public boolean removeAll ( Collection < ? > c ) { <START_BUG> return data . retainAll ( c ) ; <END_BUG> } @ Override public void clear ( ) { } }

Fix:
return data . removeAll ( c ) ;
Buggy code:
public class ParameterTableListener implements TableModelListener { public ParameterTableListener ( ) { } public void tableChanged ( TableModelEvent e ) { int row = e . getFirstRow ( ) ; int column = e . getColumn ( ) ; DefaultTableModel model = ( ( DefaultTableModel ) ( e . getSource ( ) ) ) ; <START_BUG> if ( ( column == ( - 1 ) ) || ( row >= ( model . getRowCount ( ) ) ) ) <END_BUG> return ; String parName = ( ( String ) ( model . getValueAt ( row , 2 ) ) ) ; String data = ( ( String ) ( model . getValueAt ( row , 1 ) ) ) . trim ( ) ; if ( ( model . getValueAt ( row , 5 ) ) != null ) ( ( Parameter ) ( model . getValueAt ( row , 5 ) ) ) . setParameterValue ( data ) ; MetaProject . getInstance ( ) . setProjectChanged ( true , parName ) ; } }

Fix:
if ( ( ( column == ( - 1 ) ) || ( column == 5 ) ) || ( row >= ( model . getRowCount ( ) ) ) )
Buggy code:
public class TestFinnishLightStemFilter extends BaseTokenStreamTestCase { private Analyzer analyzer = new Analyzer ( ) { @ Override protected TokenStreamComponents createComponents ( String fieldName , Reader reader ) { } } ; public void testVocabulary ( ) throws IOException { } public void testRandomStrings ( ) throws Exception { <START_BUG> checkRandomData ( random ( ) , analyzer , ( 10000 * ( RANDOM_MULTIPLIER ) ) ) ; <END_BUG> } public void testEmptyTerm ( ) throws IOException { } }

Fix:
checkRandomData ( random ( ) , analyzer , ( 1000 * ( RANDOM_MULTIPLIER ) ) ) ;
Buggy code:
public class TableVisualizer extends AbstractVisualizer implements Clearable { private static final Logger log = LoggingManager . getLoggerForClass ( ) ; private final String [ ] COLUMNS = new String [ ] { JMeterUtils . getResString ( "table_visualizer_sample_num" ) , JMeterUtils . getResString ( "table_visualizer_start_time" ) , JMeterUtils . getResString ( "table_visualizer_thread_name" ) , JMeterUtils . getResString ( "sampler_label" ) , JMeterUtils . getResString ( "table_visualizer_sample_time" ) , JMeterUtils . getResString ( "success?" ) , JMeterUtils . getResString ( "table_visualizer_bytes" ) } ; private ObjectTableModel model = null ; private JTable table = null ; private JTextField dataField = null ; private JTextField averageField = null ; private JTextField deviationField = null ; private JTextField noSamplesField = null ; private JScrollPane tableScrollPanel = null ; private transient Calculator calc = new Calculator ( ) ; private long currentData = 0 ; private Format format = new SimpleDateFormat ( "HH:mm:ss.SSS" ) ; public TableVisualizer ( ) { } public static boolean testFunctors ( ) { TableVisualizer instance = new TableVisualizer ( ) ; <START_BUG> return instance . model . checkFunctors ( null ) ; <END_BUG> } public String getLabelResource ( ) { } protected synchronized void updateTextFields ( ) { } public void add ( SampleResult res ) { } public synchronized void clear ( ) { } public String toString ( ) { } private void init ( ) { } }

Fix:
return instance . model . checkFunctors ( null , instance . getClass ( ) ) ;
Buggy code:
public abstract class SolarActor extends Actor implements Telegraph { protected boolean selected ; protected TextureRegion solarActorTexture ; protected Sprite solarActorSprite ; protected SolarActorScale actorScale ; protected float currentShapeScale ; protected float currentOrbitScale ; static final double stageScalingFactor = 2 * ( Math . pow ( 10 , 4 ) ) ; public SolarActor ( String name ) { } @ Override public String toString ( ) { } public void select ( ) { } public void deselect ( ) { } public boolean isSelected ( ) { } protected static double convertAUIntoKilometer ( double AU ) { } protected static float scaleDistanceToStage ( double distance ) { } protected static float inverseStagescaling ( float stageDistance ) { } public boolean insideRectangle ( Rectangle rect ) { } @ Override public void setSize ( float width , float height ) { } public void updateScale ( ) { } @ Override public void setOrigin ( float originX , float originY ) { } @ Override public void setRotation ( float degrees ) { } public void setActorScale ( SolarActorScale scale ) { } public TextureRegion getSolarActorTexture ( ) { } protected void setupSolarActorSprite ( String textureName ) { } @ Override public void draw ( Batch batch , float parentAlpha ) { } @ Override public boolean handleMessage ( Telegram telegram ) { <START_BUG> if ( ( ( ( telegram . message ) == ( SolarMessageType . GAME_SCALE_CHANGED ) ) && true ) || ( telegram . sender . equals ( actorScale ) ) ) { <END_BUG> updateScale ( ) ; } return false ; } }

Fix:
if ( ( telegram . message ) == ( SolarMessageType . GAME_SCALE_CHANGED ) ) {
Buggy code:
public class CachingCVB0Mapper extends Mapper < IntWritable , VectorWritable , IntWritable , VectorWritable > { private static Logger log = LoggerFactory . getLogger ( CachingCVB0Mapper . class ) ; protected ModelTrainer modelTrainer ; protected int maxIters ; protected int numTopics ; @ Override protected void setup ( Context context ) throws IOException , InterruptedException { } @ Override public void map ( IntWritable docId , VectorWritable document , Context context ) throws IOException , InterruptedException { <START_BUG> Vector topicVector = new DenseVector ( new double [ numTopics ] ) . assign ( ( 1 // ( numTopics ) ) ) ; <END_BUG> modelTrainer . train ( document . get ( ) , topicVector , true , maxIters ) ; } @ Override protected void cleanup ( Context context ) throws IOException , InterruptedException { } }

Fix:
Vector topicVector = new DenseVector ( new double [ numTopics ] ) . assign ( ( 1.0 // ( numTopics ) ) ) ;
Buggy code:
public class PandocDecoder implements MarkdownDecoder { @ Override public String decode ( File file , MarkdownDecoderArg arg ) throws GeneralException { } private String formatFullText ( String contentFullText , Map < String , String > metas ) { } private PandocDecoder . MarkdownWrapper decodeMarkdownWrapperFromFile ( File file ) throws GeneralException { } private PandocDecoder . MarkdownWrapper decodeMarkdownWrapperFromString ( String s ) { <START_BUG> Pattern p = Pattern . compile ( "\\\\\\\\\\w+\\\\\\\\.*\n" ) ; <END_BUG> Map < String , String > metas = new HashMap < > ( ) ; Matcher m = p . matcher ( s ) ; int start ; int end = 0 ; while ( m . find ( ) ) { start = m . start ( ) ; end = m . end ( ) ; int separator = s . indexOf ( "\\\\" , ( start + 2 ) ) ; metas . put ( s . substring ( ( start + 2 ) , separator ) , ( ( separator + 2 ) >= end ? "" : s . substring ( ( separator + 2 ) , end ) . trim ( ) ) ) ; } PandocDecoder . MarkdownWrapper wrapper = new PandocDecoder . MarkdownWrapper ( metas , s . substring ( end ) ) ; return wrapper ; } private class MarkdownWrapper { private Map < String , String > metas ; private String content ; public MarkdownWrapper ( Map < String , String > metas , String content ) { } public Map < String , String > getMetas ( ) { } public void setMetas ( Map < String , String > metas ) { } public String getContent ( ) { } public void setContent ( String content ) { } } }

Fix:
Pattern p = Pattern . compile ( "^\\\\\\\\\\w+\\\\\\\\.*\n" , Pattern . MULTILINE ) ;
Buggy code:
public class VariationFuncList { public static final String DEFAULT_VARIATION = "linear3D" ; private static List < Class < ? extends VariationFunc > > items = new ArrayList < Class < ? extends VariationFunc > > ( ) ; private static List < String > unfilteredNameList = null ; private static List < String > filteredNameList = null ; private static Map < Class < ? extends VariationFunc > , String > aliasMap = new HashMap < Class < ? extends VariationFunc > , String > ( ) ; private static Map < String , String > resolvedAliasMap = null ; private static void registerVariationFunc ( Class < ? extends VariationFunc > pVariationFunc ) { } private static String getVariationName ( Class < ? extends VariationFunc > pFuncCls , boolean pFatal ) { } private static void refreshNameList ( ) { } public static List < String > getNameList ( ) { } private static List < String > getUnfilteredNameList ( ) { } public static Map < String , String > getAliasMap ( ) { } public static String getRandomVariationname ( ) { while ( true ) { int idx = ( ( int ) ( ( Math . random ( ) ) * ( VariationFuncList . getNameList ( ) . size ( ) ) ) ) ; String name = VariationFuncList . getNameList ( ) . get ( idx ) ; <START_BUG> if ( ( ( ( ( ! ( ( name . indexOf ( "inflate" ) ) == 0 ) ) && ( ! ( name . equals ( "svg_wf" ) ) ) ) && ( ! ( ( name . indexOf ( "post_" ) ) == 0 ) ) ) && ( ! ( ( name . indexOf ( "pre_" ) ) == 0 ) ) ) && ( ! ( ( name . indexOf ( "666" ) ) > 0 ) ) ) { <END_BUG> return name ; } } } public static VariationFunc getVariationFuncInstance ( String pName ) { } public static VariationFunc getVariationFuncInstance ( String pName , boolean pFatal ) { } }

Fix:
if ( ( ( ( ( ! ( ( name . indexOf ( "inflate" ) ) == 0 ) ) && ( ! ( name . equals ( "svg_wf" ) ) ) ) && ( ! ( ( name . indexOf ( "post_" ) ) == 0 ) ) ) && ( ! ( ( name . indexOf ( "pre_" ) ) == 0 ) ) ) && ( ! ( ( name . indexOf ( "iflames_wf" ) ) > 0 ) ) ) {
Buggy code:
public class FolderEdit implements BookAction { private static final Logger LOG = LogManager . getLogger ( BookAdd . class ) ; public void doIt ( HttpServletRequest request , HttpServletResponse response , ServletContext context , ManageItemsLocal manageItems ) { int parent = BookTools . getParentParameter ( request ) ; String ID = BookTools . getBookID ( request ) ; if ( ( ID != null ) && ( ! ( ID . equals ( "0" ) ) ) ) { BookTools . setPathAttribute ( request , manageItems ) ; Items pf = manageItems . getFolderByID ( BigDecimal . valueOf ( parent ) ) ; request . setAttribute ( "pfolder" , pf ) ; Items f = manageItems . getFolderByID ( BigDecimal . valueOf ( Integer . parseInt ( ID ) ) ) ; request . setAttribute ( "folder" , f ) ; request . setAttribute ( "TitleText" , String . format ( "Editing<seq2seq4repair_space>the<seq2seq4repair_space>folder<seq2seq4repair_space>\"%s\"" , f . getName ( ) ) ) ; try { BookTools . gotoDispatch ( "//editf.jsp" , request , response , context ) ; } catch ( ServletException ex ) { FolderEdit . LOG . error ( ex ) ; } catch ( IOException ex ) { FolderEdit . LOG . error ( ex ) ; } } else { request . setAttribute ( "ErrorText" , "Can<seq2seq4repair_space>not<seq2seq4repair_space>edit<seq2seq4repair_space>the<seq2seq4repair_space>Root<seq2seq4repair_space>folder!" ) ; try { <START_BUG> BookTools . gotoDispatch ( ( ( ( ( ( ( "bookshelf?" + ( MODE ) ) + "=" ) + ( MODE_IS_VIEW ) ) + "&" ) + ( PARENT ) ) + "=0" ) , request , response , context ) ; <END_BUG> } catch ( ServletException ex ) { FolderEdit . LOG . error ( ex ) ; } catch ( IOException ex ) { FolderEdit . LOG . error ( ex ) ; } } } }

Fix:
BookTools . gotoDispatch ( ( ( ( ( ( ( "//bookshelf?" + ( MODE ) ) + "=" ) + ( MODE_IS_VIEW ) ) + "&" ) + ( PARENT ) ) + "=0" ) , request , response , context ) ;
Buggy code:
public class PostReplyFragment extends DialogFragment { private static final String TAG = "PostReplyActivity" ; public static final int RESULT_POSTED = 1 ; private PostReplyFragment . FetchFormCookieTask mFetchCookieTask ; private PostReplyFragment . FetchFormKeyTask mFetchKeyTask ; private PostReplyFragment . SubmitReplyTask mSubmitTask ; private Bundle mExtras ; private ImageButton mSubmit ; private EditText mMessage ; private ProgressDialog mDialog ; private SharedPreferences mPrefs ; private TextView mTitle ; private String mThreadId ; private String mFormCookie ; private String mFormKey ; private String mReply ; private int mSelection ; public static PostReplyFragment newInstance ( Bundle aArguments ) { } @ Override public void onCreate ( Bundle savedInstanceState ) { } @ Override public View onCreateView ( LayoutInflater aInflater , ViewGroup aContainer , Bundle aSavedState ) { } @ Override public void onActivityCreated ( Bundle aSavedState ) { } @ Override public void onResume ( ) { super . onResume ( ) ; mFormKey = mPrefs . getString ( FORM_KEY , null ) ; if ( ( mFormKey ) == null ) { mFetchKeyTask = new PostReplyFragment . FetchFormKeyTask ( ) ; mFetchKeyTask . execute ( mThreadId ) ; } else { mFetchCookieTask = new PostReplyFragment . FetchFormCookieTask ( ) ; mFetchCookieTask . execute ( mThreadId ) ; } <START_BUG> if ( ( mSelection ) > 0 ) { <END_BUG> mMessage . setSelection ( mSelection ) ; } mSubmit . setEnabled ( false ) ; } @ Override public void onPause ( ) { } @ Override public void onStop ( ) { } @ Override public void onDestroy ( ) { } @ Override public void onDetach ( ) { } private void cleanupTasks ( ) { } private Bundle getExtras ( ) { } private OnClickListener onSubmitClick = new View . OnClickListener ( ) { public void onClick ( View aView ) { } } ; private class SubmitReplyTask extends AsyncTask < String , Void , Void > { private boolean mEditing ; public SubmitReplyTask ( boolean aEditing ) { } public void onPreExecute ( ) { } public Void doInBackground ( String ... aParams ) { } public void onPostExecute ( Void aResult ) { } } private class FetchFormKeyTask extends AsyncTask < String , Void , String > { public String doInBackground ( String ... aParams ) { } public void onPostExecute ( String aResult ) { } } private class FetchFormCookieTask extends AsyncTask < String , Void , String > { public String doInBackground ( String ... aParams ) { } public void onPostExecute ( String aResult ) { } } }

Fix:
if ( ( ( ( mSelection ) > 0 ) && ( ( mMessage ) != null ) ) && ( ( mMessage . length ( ) ) >= ( mSelection ) ) ) {
Buggy code:
public class TypeFactory { public static ReferenceType createParameterizedType ( ResolvedType aBaseType , UnresolvedType [ ] someTypeParameters , World inAWorld ) { ResolvedType baseType = aBaseType ; if ( ! ( aBaseType . isGenericType ( ) ) ) { if ( ( someTypeParameters != null ) && ( ( someTypeParameters . length ) > 0 ) ) { if ( ! ( aBaseType . isRawType ( ) ) ) <START_BUG> throw new IllegalStateException ( "Expecting<seq2seq4repair_space>raw<seq2seq4repair_space>type" ) ; <END_BUG> baseType = baseType . getGenericType ( ) ; if ( baseType == null ) throw new IllegalStateException ( "Raw<seq2seq4repair_space>type<seq2seq4repair_space>does<seq2seq4repair_space>not<seq2seq4repair_space>have<seq2seq4repair_space>generic<seq2seq4repair_space>type<seq2seq4repair_space>set" ) ; } } ResolvedType [ ] resolvedParameters = inAWorld . resolve ( someTypeParameters ) ; ReferenceType pType = new ReferenceType ( baseType , resolvedParameters , inAWorld ) ; return ( ( ReferenceType ) ( pType . resolve ( inAWorld ) ) ) ; } public static UnresolvedType createUnresolvedParameterizedType ( String sig , String erasuresig , UnresolvedType [ ] arguments ) { } public static ReferenceType createRawType ( ResolvedType aBaseType , World inAWorld ) { } private static UnresolvedType convertSigToType ( String aSignature ) { } public static UnresolvedType createTypeFromSignature ( String signature ) { } private static UnresolvedType [ ] createTypeParams ( String typeParameterSpecification ) { } }

Fix:
throw new IllegalStateException ( ( "Expecting<seq2seq4repair_space>raw<seq2seq4repair_space>type,<seq2seq4repair_space>not:<seq2seq4repair_space>" + aBaseType ) ) ;
Buggy code:
public class ThreeEighthesIntegratorTest extends TestCase { public ThreeEighthesIntegratorTest ( String name ) { } public void testDimensionCheck ( ) { } public void testDecreasingSteps ( ) throws DerivativeException , IntegratorException { TestProblemAbstract [ ] problems = TestProblemFactory . getProblems ( ) ; for ( int k = 0 ; k < ( problems . length ) ; ++ k ) { double previousError = Double . NaN ; for ( int i = 4 ; i < 10 ; ++ i ) { TestProblemAbstract pb = ( ( TestProblemAbstract ) ( problems [ k ] . clone ( ) ) ) ; double step = ( ( pb . getFinalTime ( ) ) - ( pb . getInitialTime ( ) ) ) * ( Math . pow ( 2.0 , ( - i ) ) ) ; FirstOrderIntegrator integ = new ThreeEighthesIntegrator ( step ) ; TestProblemHandler handler = new TestProblemHandler ( pb , integ ) ; integ . setStepHandler ( handler ) ; SwitchingFunction [ ] functions = pb . getSwitchingFunctions ( ) ; for ( int l = 0 ; l < ( functions . length ) ; ++ l ) { <START_BUG> integ . addSwitchingFunction ( functions [ l ] , Double . POSITIVE_INFINITY , ( 1.0E-6 * step ) ) ; <END_BUG> } integ . integrate ( pb , pb . getInitialTime ( ) , pb . getInitialState ( ) , pb . getFinalTime ( ) , new double [ pb . getDimension ( ) ] ) ; double error = handler . getMaximalValueError ( ) ; if ( i > 4 ) { assertTrue ( ( error < ( Math . abs ( previousError ) ) ) ) ; } previousError = error ; assertEquals ( 0 , handler . getMaximalTimeError ( ) , 1.0E-12 ) ; } } } public void testSmallStep ( ) throws DerivativeException , IntegratorException { } public void testBigStep ( ) throws DerivativeException , IntegratorException { } public void testKepler ( ) throws DerivativeException , IntegratorException { } private static class KeplerHandler implements StepHandler { public KeplerHandler ( TestProblem3 pb ) { } public boolean requiresDenseOutput ( ) { } public void reset ( ) { } public void handleStep ( StepInterpolator interpolator , boolean isLast ) { } private TestProblem3 pb ; private double maxError = 0 ; } public static Test suite ( ) { } }

Fix:
integ . addSwitchingFunction ( functions [ l ] , Double . POSITIVE_INFINITY , ( 1.0E-6 * step ) , 1000 ) ;
Buggy code:
public class CmpEntityBeanComponentInstance extends EntityBeanComponentInstance { private final Interceptor relationshipInterceptor ; CmpEntityBeanComponentInstance ( final BasicComponent component , final AtomicReference < ManagedReference > instanceReference , final Interceptor preDestroyInterceptor , Map < Method , Interceptor > methodInterceptors , final Interceptor relationshipInterceptor ) { } public CmpEntityBeanComponent getComponent ( ) { } public CmpEntityBeanContext getEjbContext ( ) { } @ Override public void setupContext ( final InterceptorContext interceptorContext ) { } public EntityBean getInstance ( ) { } @ Override public boolean isReloadRequired ( ) { } @ Override public void setReloadRequired ( final boolean reloadRequired ) { } @ Override public void reload ( ) { } public synchronized void store ( ) { try { if ( ! ( isRemoved ( ) ) ) { invokeEjbStore ( ) ; final CmpEntityBeanContext context = getEjbContext ( ) ; final JDBCEntityPersistenceStore store = getComponent ( ) . getStoreManager ( ) ; <START_BUG> if ( ( ( context . getPrimaryKey ( ) ) != null ) && ( store . isStoreRequired ( context ) ) ) { <END_BUG> store . storeEntity ( context ) ; } } } catch ( RemoteException e ) { throw new WrappedRemoteException ( e ) ; } catch ( Exception e ) { throw new EJBException ( e ) ; } } public void passivate ( ) { } Object invoke ( final CMRMessage message , final Object ... params ) { } }

Fix:
if ( ( ( context . getPrimaryKeyUnchecked ( ) ) != null ) && ( store . isStoreRequired ( context ) ) ) {
Buggy code:
public abstract class VariableInterpolator { protected final String string ; private boolean exceptionOnNullVarValue = false ; public VariableInterpolator ( final String string ) { } public VariableInterpolator ( final String string , final boolean exceptionOnNullVarValue ) { } protected abstract String getValue ( String variableName ) { } private int lowerPositive ( final int i1 , final int i2 ) { } @ Override public String toString ( ) { final StringBuilder buffer = new StringBuilder ( ) ; int start ; int pos = 0 ; while ( ( start = lowerPositive ( string . indexOf ( "$$" , pos ) , string . indexOf ( "${" , pos ) ) ) != ( - 1 ) ) { buffer . append ( string . substring ( pos , start ) ) ; if ( ( string . charAt ( ( start + 1 ) ) ) == '$' ) { buffer . append ( "$" ) ; pos = start + 2 ; continue ; } pos = start ; final int startVariableName = start + 2 ; final int endVariableName = string . indexOf ( '}' , startVariableName ) ; if ( endVariableName != ( - 1 ) ) { final String variableName = string . substring ( startVariableName , endVariableName ) ; final String value = getValue ( variableName ) ; if ( value == null ) { if ( exceptionOnNullVarValue ) { throw new IllegalArgumentException ( ( ( ( ( "Value<seq2seq4repair_space>of<seq2seq4repair_space>variable<seq2seq4repair_space>[[" + variableName ) + "]]<seq2seq4repair_space>could<seq2seq4repair_space>not<seq2seq4repair_space>be<seq2seq4repair_space>resolved<seq2seq4repair_space>while<seq2seq4repair_space>interpolating<seq2seq4repair_space>[[" ) + ( string ) ) + "]]" ) ) ; } else { <START_BUG> buffer . append ( ( ( "${" + variableName ) + "}" ) ) ; <END_BUG> } } else { buffer . append ( value ) ; } pos = endVariableName + 1 ; } else { break ; } } if ( pos < ( string . length ( ) ) ) { buffer . append ( string . substring ( pos ) ) ; } return buffer . toString ( ) ; } }

Fix:
buffer . append ( "${" ) . append ( variableName ) . append ( "}" ) ;
Buggy code:
public class ApplicationSettingsTest extends TestCase { public ApplicationSettingsTest ( final String message ) { } void foo ( IModel < ? extends Map > x ) { } public void testFrameworkVersion ( ) { } public void testExceptionOnMissingResourceDefaultValue ( ) throws Exception { } public void testExceptionOnMissingResourceSetsCorrectly ( ) throws Exception { } public void testUseDefaultOnMissingResourceDefaultValue ( ) throws Exception { } public void testUseDefaultOnMissingResourceSetsCorrectly ( ) throws Exception { } public void testDefaultStringResourceLoaderSetup ( ) { } public void testOverrideStringResourceLoaderSetup ( ) { Application dummy = new DummyApplication ( ) ; dummy . init ( ) ; Settings settings = new Settings ( dummy ) ; settings . addStringResourceLoader ( new BundleStringResourceLoader ( "wicket.resource.DummyResources" ) ) ; <START_BUG> settings . addStringResourceLoader ( new ComponentStringResourceLoader ( dummy ) ) ; <END_BUG> List < IStringResourceLoader > loaders = settings . getStringResourceLoaders ( ) ; Assert . assertEquals ( "There<seq2seq4repair_space>should<seq2seq4repair_space>be<seq2seq4repair_space>2<seq2seq4repair_space>overridden<seq2seq4repair_space>loaders" , 2 , loaders . size ( ) ) ; Assert . assertTrue ( "First<seq2seq4repair_space>loader<seq2seq4repair_space>one<seq2seq4repair_space>should<seq2seq4repair_space>be<seq2seq4repair_space>the<seq2seq4repair_space>bundle<seq2seq4repair_space>one" , ( ( loaders . get ( 0 ) ) instanceof BundleStringResourceLoader ) ) ; Assert . assertTrue ( "Second<seq2seq4repair_space>loader<seq2seq4repair_space>should<seq2seq4repair_space>be<seq2seq4repair_space>the<seq2seq4repair_space>component<seq2seq4repair_space>one" , ( ( loaders . get ( 1 ) ) instanceof ComponentStringResourceLoader ) ) ; } public void testLocalizer ( ) { } }

Fix:
settings . addStringResourceLoader ( new ComponentStringResourceLoader ( ) ) ;
Buggy code:
public class AgentFactoryTest { private AgentFactory _peerFactory ; int _parts ; List < LabeledSample > _data ; private BehaviourFactory _behaviourFactory ; private List < LabeledSample > _partition1 ; private List < LabeledSample > _partition2 ; private MessageFacadeFactory _messageFacadeFactory ; private int _iterations = 5 ; private PeerGraph _peerGraph ; private DataLoader _dataLoader ; private NoisyQueryableFactory _noisyQueryableFactory ; private double _budget = 2.0 ; private NoisyQueryable < LabeledSample > _queryable1 ; private NoisyQueryable < LabeledSample > _queryable2 ; private Environment _environment ; @ Before public void setUp ( ) { _parts = 2 ; _dataLoader = mock ( DataLoader . class ) ; mockData ( ) ; _noisyQueryableFactory = mock ( NoisyQueryableFactory . class ) ; _peerGraph = mock ( PeerGraph . class ) ; _behaviourFactory = mock ( BehaviourFactory . class ) ; _messageFacadeFactory = mock ( MessageFacadeFactory . class ) ; _environment = mock ( Environment . class ) ; PeerAgentTest . stubBehaviourFactory ( _behaviourFactory ) ; PeerAgentTest . stubMessageFacadeFactory ( _messageFacadeFactory ) ; when ( _noisyQueryableFactory . getQueryable ( any ( Budget . class ) , same ( _partition1 ) ) ) . thenReturn ( _queryable1 ) ; when ( _noisyQueryableFactory . getQueryable ( any ( Budget . class ) , same ( _partition2 ) ) ) . thenReturn ( _queryable2 ) ; <START_BUG> _peerFactory = new AgentFactory ( _behaviourFactory , _messageFacadeFactory , _peerGraph , _dataLoader , _noisyQueryableFactory , _environment ) ; <END_BUG> } private void mockData ( ) { } @ Test public void createPeers_OnePeerPerPartition ( ) { } @ Test public void createPeers_PartitionsData ( ) { } }

Fix:
_peerFactory = new AgentFactory ( _behaviourFactory , _messageFacadeFactory , _peerGraph , _dataLoader , _noisyQueryableFactory ) ;
Buggy code:
public class NSValue extends NSObject { public NSValue ( ) { } public NSValue ( int id ) { } public void getValue ( int value ) { } public id initWithBytes ( int value , int type ) { } public boolean isEqualToValue ( NSValue value ) { } public id nonretainedObjectValue ( ) { } public int objCType ( ) { } public NSPoint pointValue ( ) { } public int pointerValue ( ) { } public NSRange rangeValue ( ) { } public NSRect rectValue ( ) { } public NSSize sizeValue ( ) { NSSize result = new NSSize ( ) ; <START_BUG> OS . objc_msgSend_struct ( result , this . id , sel_sizeValue ) ; <END_BUG> return result ; } public static NSValue value ( int value , int type ) { } public static NSValue valueWithBytes ( int value , int type ) { } public static NSValue valueWithNonretainedObject ( id anObject ) { } public static NSValue valueWithPoint ( NSPoint point ) { } public static NSValue valueWithPointer ( int pointer ) { } public static NSValue valueWithRange ( NSRange range ) { } public static NSValue valueWithRect ( NSRect rect ) { } public static NSValue valueWithSize ( NSSize size ) { } }

Fix:
OS . objc_msgSend_stret ( result , this . id , sel_sizeValue ) ;