nus-yam/ex-repair huggingface dataset:
Buggy code:
public class ComplexBatch { public static void main ( String [ ] args ) { } public int [ ] range ( int start , int stop ) { } public void run ( ) { Memory m = new FirstFit ( 1000 ) ; Pointer [ ] ps = new Pointer [ 20 ] ; ps [ 0 ] = m . alloc ( 100 ) ; ps [ 0 ] . write ( range ( 1 , 100 ) ) ; ps [ 1 ] = m . alloc ( 200 ) ; ps [ 1 ] . write ( range ( 1001 , 1200 ) ) ; ps [ 2 ] = m . alloc ( 500 ) ; ps [ 2 ] . write ( range ( 101 , 600 ) ) ; ps [ 3 ] = m . alloc ( 200 ) ; ps [ 3 ] . write ( range ( 1 , 200 ) ) ; m . release ( ps [ 2 ] ) ; ps [ 4 ] = m . alloc ( 50 ) ; ps [ 4 ] . write ( range ( 51 , 100 ) ) ; ps [ 5 ] = m . alloc ( 5 ) ; ps [ 5 ] . write ( range ( 42 , 46 ) ) ; ps [ 6 ] = m . alloc ( 90 ) ; ps [ 6 ] . write ( range ( 5000 , 5089 ) ) ; m . release ( ps [ 0 ] ) ; ps [ 7 ] = m . alloc ( 60 ) ; ps [ 7 ] . write ( range ( 10 , 69 ) ) ; m . release ( ps [ 4 ] ) ; ps [ 8 ] = m . alloc ( 45 ) ; ps [ 8 ] . write ( range ( 1 , 45 ) ) ; ps [ 9 ] = m . alloc ( 10 ) ; ps [ 9 ] . write ( range ( 16 , 25 ) ) ; m . release ( ps [ 5 ] ) ; m . release ( ps [ 6 ] ) ; ps [ 10 ] = m . alloc ( 40 ) ; ps [ 10 ] . write ( range ( 301 , 340 ) ) ; ps [ 11 ] = m . alloc ( 200 ) ; ps [ 11 ] . write ( range ( 1 , 200 ) ) ; ps [ 12 ] = m . alloc ( 35 ) ; ps [ 12 ] . write ( range ( 501 , 535 ) ) ; ps [ 13 ] = m . alloc ( 25 ) ; ps [ 13 ] . write ( range ( 1 , 25 ) ) ; ps [ 14 ] = m . alloc ( 60 ) ; ps [ 14 ] . write ( range ( 1 , 60 ) ) ; ps [ 15 ] = m . alloc ( 60 ) ; ps [ 15 ] . write ( range ( 1 , 60 ) ) ; m . release ( ps [ 3 ] ) ; m . release ( ps [ 13 ] ) ; m . release ( ps [ 12 ] ) ; ps [ 16 ] = m . alloc ( 170 ) ; ps [ 16 ] . write ( range ( 10001 , 10170 ) ) ; ps [ 17 ] = m . alloc ( 105 ) ; <START_BUG> ps [ 17 ] . write ( range ( ( - 40 ) , 65 ) ) ; <END_BUG> ps [ 18 ] = m . alloc ( 40 ) ; ps [ 18 ] . write ( range ( 1 , 40 ) ) ; ps [ 19 ] = m . alloc ( 5 ) ; ps [ 19 ] . write ( range ( 11 , 15 ) ) ; m . printLayout ( ) ; m . release ( ps [ 1 ] ) ; m . release ( ps [ 7 ] ) ; m . release ( ps [ 8 ] ) ; m . release ( ps [ 9 ] ) ; m . release ( ps [ 10 ] ) ; m . release ( ps [ 11 ] ) ; m . release ( ps [ 14 ] ) ; m . release ( ps [ 15 ] ) ; m . release ( ps [ 16 ] ) ; m . release ( ps [ 17 ] ) ; m . release ( ps [ 18 ] ) ; m . release ( ps [ 19 ] ) ; m . printLayout ( ) ; } }

Fix:
ps [ 17 ] . write ( range ( 40 , 65 ) ) ;
Buggy code:
public abstract class AbstractFolderOptionsPlugin implements PluginInterface { private MailFrameMediator mediator ; private String name ; private String pluginId ; public AbstractFolderOptionsPlugin ( String name , String pluginId , MailFrameMediator mediator ) { } public abstract void saveOptionsToXml ( MessageFolder folder ) { } public abstract void loadOptionsFromXml ( MessageFolder folder ) { } public MailFrameMediator getMediator ( ) { } public XmlElement getConfigNode ( MessageFolder folder ) { if ( folder == null ) { return FolderItem . getGlobalOptions ( ) . getElement ( getName ( ) ) ; } <START_BUG> XmlElement parent = folder . getFolderItem ( ) . getFolderOptions ( ) ; <END_BUG> XmlElement child = parent . getElement ( getName ( ) ) ; if ( child == null ) { child = createDefaultElement ( false ) ; parent . addElement ( child ) ; } if ( child . getAttribute ( "overwrite" ) . equals ( "true" ) ) { return child ; } else { parent = FolderItem . getGlobalOptions ( ) ; child = parent . getElement ( getName ( ) ) ; if ( child == null ) { child = createDefaultElement ( true ) ; parent . addElement ( child ) ; } return child ; } } public XmlElement createDefaultElement ( boolean global ) { } public String getName ( ) { } }

Fix:
XmlElement parent = folder . getConfiguration ( ) . getFolderOptions ( ) ;
Buggy code:
public class Resources { public static BufferedImage sBlock ; public static BufferedImage sCloud1 ; public static BufferedImage sCloud2 ; public static BufferedImage sDuck ; public static BufferedImage sGrass ; public static BufferedImage sIconimage ; public static BufferedImage sJump ; public static BufferedImage sRun1 ; public static BufferedImage sRun2 ; public static BufferedImage sRun3 ; public static BufferedImage sRun4 ; public static BufferedImage sRun5 ; public static BufferedImage sSelector ; public static BufferedImage sWelcome ; public static AudioClip sHit ; public static AudioClip sOnjump ; public static Color sSkyBlue ; public static Animation sRunAnimation ; public static void load ( ) { Resources . sWelcome = Resources . loadImage ( "welcome.png" ) ; Resources . sIconimage = Resources . loadImage ( "iconimage.png" ) ; Resources . sBlock = Resources . loadImage ( "block.png" ) ; Resources . sDuck = Resources . loadImage ( "duck.png" ) ; Resources . sCloud1 = Resources . loadImage ( "cloud1.png" ) ; Resources . sCloud2 = Resources . loadImage ( "cloud1.png" ) ; Resources . sGrass = Resources . loadImage ( "grass.png" ) ; <START_BUG> Resources . sJump = Resources . loadImage ( "Jump.png" ) ; <END_BUG> Resources . sRun1 = Resources . loadImage ( "run_anim1.png" ) ; Resources . sRun2 = Resources . loadImage ( "run_anim2.png" ) ; Resources . sRun3 = Resources . loadImage ( "run_anim3.png" ) ; Resources . sRun4 = Resources . loadImage ( "run_anim4.png" ) ; Resources . sRun5 = Resources . loadImage ( "run_anim5.png" ) ; Resources . sSelector = Resources . loadImage ( "selector.png" ) ; Resources . sHit = Resources . loadSound ( "hit.wav" ) ; Resources . sOnjump = Resources . loadSound ( "onjump.wav" ) ; Resources . sSkyBlue = new Color ( 208 , 244 , 247 ) ; Frame f1 = new Frame ( Resources . sRun1 , 0.1F ) ; Frame f2 = new Frame ( Resources . sRun2 , 0.1F ) ; Frame f3 = new Frame ( Resources . sRun3 , 0.1F ) ; Frame f4 = new Frame ( Resources . sRun4 , 0.1F ) ; Frame f5 = new Frame ( Resources . sRun5 , 0.1F ) ; Resources . sRunAnimation = new Animation ( f1 , f2 , f3 , f4 , f5 , f3 , f2 ) ; } private static AudioClip loadSound ( String filename ) { } private static BufferedImage loadImage ( String filename ) { } }

Fix:
Resources . sJump = Resources . loadImage ( "jump.png" ) ;
Buggy code:
public class DatePickerTest extends WicketTestCase { private static final Logger log = LoggerFactory . getLogger ( DatePickerTest . class ) ; private TimeZone defaultTz = TimeZone . getDefault ( ) ; @ Override protected void tearDown ( ) throws Exception { } public void test1 ( ) throws Exception { } public void test2 ( ) throws Exception { } public void test3 ( ) throws Exception { } public void testJodaTimeDefaultTimeZone ( ) { } public void testDates1 ( ) throws ParseException { } public void testDates2 ( ) throws ParseException { } public void testDates3 ( ) throws ParseException { } public Date convertDate ( final String dateStr , final Integer hours , final Integer minutes , final AM_PM amOrPm , final boolean use12HourFormat , final TimeZone tzClient ) throws ParseException { } public Date convertDateNew ( final String dateStr , final Integer hours , final Integer minutes , final AM_PM amOrPm , final boolean use12HourFormat , final TimeZone tzClient ) throws ParseException { DatePickerTest . log . error ( ">>><seq2seq4repair_space>convertDateNew()" ) ; Date dateFieldInput = ( dateStr != null ) ? DateFormat . getDateInstance ( ) . parse ( dateStr ) : null ; if ( dateFieldInput == null ) { dateFieldInput = new Date ( ) ; } Calendar cal = Calendar . getInstance ( ) ; cal . setTime ( dateFieldInput ) ; int year = cal . get ( Calendar . YEAR ) ; int month = ( cal . get ( Calendar . MONTH ) ) + 1 ; int day = cal . get ( Calendar . DAY_OF_MONTH ) ; int iHours = ( hours == null ) ? 0 : hours % 24 ; int iMins = ( minutes == null ) ? 0 : minutes ; MutableDateTime date = new MutableDateTime ( year , month , day , iHours , iMins , 0 , 0 , DateTimeZone . forTimeZone ( tzClient ) ) ; DatePickerTest . log . error ( ( ( ( "1.<seq2seq4repair_space>date:<seq2seq4repair_space>" + ( date . getMillis ( ) ) ) + "<seq2seq4repair_space>" ) + date ) ) ; int halfday = 0 ; if ( use12HourFormat ) { halfday = ( amOrPm == ( AM_PM . PM ) ) ? 1 : 0 ; date . set ( DateTimeFieldType . halfdayOfDay ( ) , halfday ) ; <START_BUG> date . set ( DateTimeFieldType . hourOfDay ( ) , ( hours % 12 ) ) ; <END_BUG> } DatePickerTest . log . error ( ( ( ( "2.<seq2seq4repair_space>halfday<seq2seq4repair_space>adjustments:<seq2seq4repair_space>" + ( date . getMillis ( ) ) ) + "<seq2seq4repair_space>" ) + date ) ) ; Date rtn = new Date ( date . getMillis ( ) ) ; DatePickerTest . log . error ( ( ( ( "3.<seq2seq4repair_space>final<seq2seq4repair_space>date:<seq2seq4repair_space>" + ( rtn . getTime ( ) ) ) + "<seq2seq4repair_space>" ) + rtn ) ) ; return rtn ; } public Date convertDateJoda ( final String dateStr , final Integer hours , final Integer minutes , final AM_PM amOrPm , final boolean use12HourFormat , final TimeZone tzClient ) throws ParseException { } protected < T extends Page > void myTestExecution ( final Class < T > pageClass , final String filename ) throws Exception { } }

Fix:
date . set ( DateTimeFieldType . hourOfDay ( ) , ( iHours % 12 ) ) ;
Buggy code:
public class ImageComparator { public Window window ; private List < Image > imageList ; private static final double COMPARISON_THRESHHOLD = 0.15 ; public ImageComparator ( File [ ] fileArr , Window w ) { } public void compareAll ( ) { } private List < File > generateFileList ( File [ ] filelist ) { List < File > acceptedFiles = new ArrayList < File > ( ) ; for ( File f : filelist ) { String name = f . getName ( ) ; boolean accepted = false ; for ( String type : FileSelector . ACCEPTED_FILETYPES ) { <START_BUG> if ( name . endsWith ( ( "." + type ) ) ) { <END_BUG> acceptedFiles . add ( f ) ; accepted = true ; } } if ( ! accepted ) { ImageComparator . warnInvalidType ( name ) ; } } System . out . println ( acceptedFiles ) ; return acceptedFiles ; } private void populateImageList ( List < File > fileList ) { } private static void warnInvalidType ( String filename ) { } private static void warnLoadError ( String filename ) { } }

Fix:
if ( name . toLowerCase ( ) . endsWith ( ( "." + type ) ) ) {
Buggy code:
public class ReplicationRun_Local_3_p5 extends ReplicationRun_Local_3 { public ReplicationRun_Local_3_p5 ( String testcaseName ) { } public static Test suite ( ) { } public void testReplication_Local_3_p5_DERBY_3878 ( ) throws Exception { makeReadyForReplication ( ) ; replicationTest = "org.apache.derbyTesting.functionTests.tests.replicationTests.ReplicationTestRun" ; util . DEBUG ( ( "replicationTest:<seq2seq4repair_space>" + ( replicationTest ) ) ) ; replicationVerify = "org.apache.derbyTesting.functionTests.tests.replicationTests.ReplicationTestRun_Verify" ; util . DEBUG ( ( "replicationVerify:<seq2seq4repair_space>" + ( replicationVerify ) ) ) ; runTest ( replicationTest , jvmVersion , testClientHost , masterServerHost , masterServerPort , replicatedDb ) ; _killMasterServer ( ) ; stopSlave ( slaveServerHost , slaveServerPort , slaveDatabasePath , replicatedDb , false ) ; <START_BUG> masterServer = startServer ( masterJvmVersion , derbyMasterVersion , masterServerHost , ALL_INTERFACES , masterServerPort , masterDbSubPath ) ; <END_BUG> if ( ( masterServerHost . equalsIgnoreCase ( "localhost" ) ) || ( localEnv ) ) { String URL = masterURL ( replicatedDb ) ; Class . forName ( DRIVER_CLASS_NAME ) ; util . DEBUG ( ( ( "bootMasterDatabase<seq2seq4repair_space>getConnection(" + URL ) + ")" ) ) ; Connection conn = DriverManager . getConnection ( URL ) ; Statement s = conn . createStatement ( ) ; s . execute ( "call<seq2seq4repair_space>syscs_util.syscs_freeze_database()" ) ; conn . close ( ) ; } else { runTest ( freezeDB , jvmVersion , testClientHost , masterServerHost , masterServerPort , replicatedDb ) ; } initSlave ( slaveServerHost , jvmVersion , replicatedDb ) ; startSlave ( jvmVersion , replicatedDb , slaveServerHost , slaveServerPort , slaveServerHost , slaveReplPort , testClientHost ) ; startMaster ( jvmVersion , replicatedDb , masterServerHost , masterServerPort , masterServerHost , slaveServerPort , slaveServerHost , slaveReplPort ) ; assertSqlStateSlaveConn ( REPLICATION_SLAVE_STARTED_OK ) ; failOver ( jvmVersion , masterDatabasePath , masterDbSubPath , replicatedDb , masterServerHost , masterServerPort , testClientHost ) ; connectPing ( ( ( ( ( ( slaveDatabasePath ) + ( FS ) ) + ( slaveDbSubPath ) ) + ( FS ) ) + ( replicatedDb ) ) , slaveServerHost , slaveServerPort , testClientHost ) ; verifySlave ( ) ; verifyMaster ( ) ; stopServer ( jvmVersion , derbyVersion , slaveServerHost , slaveServerPort ) ; stopServer ( jvmVersion , derbyVersion , masterServerHost , masterServerPort ) ; } private void _killMasterServer ( ) throws ClassNotFoundException , SQLException { } }

Fix:
startServer ( masterJvmVersion , derbyMasterVersion , masterServerHost , ALL_INTERFACES , masterServerPort , masterDbSubPath ) ;
Buggy code:
public class TabFolder extends Composite { TabItem [ ] items ; int itemCount ; boolean ignoreSelect ; public TabFolder ( Composite parent , int style ) { } public void addSelectionListener ( SelectionListener listener ) { } static int checkStyle ( int style ) { } protected void checkSubclass ( ) { } public Point computeSize ( int wHint , int hHint , boolean changed ) { } public Rectangle computeTrim ( int x , int y , int width , int height ) { } void createHandle ( ) { } void createItem ( TabItem item , int index ) { } void createWidget ( ) { } NSFont defaultNSFont ( ) { } void destroyItem ( TabItem item ) { } public Rectangle getClientArea ( ) { } public TabItem getItem ( int index ) { } public TabItem getItem ( Point point ) { } public int getItemCount ( ) { } public TabItem [ ] getItems ( ) { } public TabItem [ ] getSelection ( ) { } public int getSelectionIndex ( ) { } float getThemeAlpha ( ) { <START_BUG> return 0.25F * ( parent . getThemeAlpha ( ) ) ; <END_BUG> } public int indexOf ( TabItem item ) { } Point minimumSize ( int wHint , int hHint , boolean flushCache ) { } void releaseChildren ( boolean destroy ) { } void removeControl ( Control control ) { } public void removeSelectionListener ( SelectionListener listener ) { } void setFont ( NSFont font ) { } public void setSelection ( TabItem item ) { } public void setSelection ( TabItem [ ] items ) { } public void setSelection ( int index ) { } void setSelection ( int index , boolean notify , boolean force ) { } void setSmallSize ( ) { } boolean traversePage ( boolean next ) { } void tabView_willSelectTabViewItem ( int id , int sel , int tabView , int tabViewItem ) { } void tabView_didSelectTabViewItem ( int id , int sel , int tabView , int tabViewItem ) { } }

Fix:
return ( ( background ) != null ? 1 : 0.25F ) * ( parent . getThemeAlpha ( ) ) ;
Buggy code:
public class RedoActionHandler extends OperationHistoryActionHandler { public RedoActionHandler ( IWorkbenchWindow window , IUndoContext context ) { } protected void flush ( ) { } protected String getCommandString ( ) { <START_BUG> return WorkbenchMessages . getString ( "Workbench.redo" ) ; <END_BUG> } protected IUndoableOperation getOperation ( ) { } public void run ( ) { } protected boolean shouldBeEnabled ( ) { } }

Fix:
return WorkbenchMessages . Workbench_redo ;
Buggy code:
public class PGSQLInputImpl implements PGSQLInput { private PGConnectionImpl connection ; private CompositeType type ; private Map < String , Class < ? > > typeMap ; private int currentAttrIdx ; private Object [ ] attributeValues ; private Boolean nullFlag ; public PGSQLInputImpl ( PGConnectionImpl connection , CompositeType type , Map < String , Class < ? > > typeMap , Object [ ] attributeValues ) { } public Object [ ] getAttributeValues ( ) { } private Object getNextAttributeValue ( ) { } @ Override public String readString ( ) throws SQLException { } @ Override public boolean readBoolean ( ) throws SQLException { } @ Override public byte readByte ( ) throws SQLException { } @ Override public short readShort ( ) throws SQLException { } @ Override public int readInt ( ) throws SQLException { } @ Override public long readLong ( ) throws SQLException { } @ Override public float readFloat ( ) throws SQLException { } @ Override public double readDouble ( ) throws SQLException { } @ Override public BigDecimal readBigDecimal ( ) throws SQLException { } @ Override public byte [ ] readBytes ( ) throws SQLException { Object val = getNextAttributeValue ( ) ; if ( val == null ) { return null ; } Attribute attr = type . getAttribute ( currentAttrIdx ) ; if ( attr == null ) { throw new SQLException ( "Invalid<seq2seq4repair_space>input<seq2seq4repair_space>request<seq2seq4repair_space>(type<seq2seq4repair_space>not<seq2seq4repair_space>array)" ) ; } <START_BUG> InputStream data = SQLTypeUtils . coerceToByteStream ( getNextAttributeValue ( ) , attr . type , connection ) ; <END_BUG> try { return ByteStreams . toByteArray ( data ) ; } catch ( IOException e ) { throw new SQLException ( e ) ; } } @ Override public Date readDate ( ) throws SQLException { } @ Override public Time readTime ( ) throws SQLException { } @ Override public Timestamp readTimestamp ( ) throws SQLException { } @ Override public Reader readCharacterStream ( ) throws SQLException { } @ Override public InputStream readAsciiStream ( ) throws SQLException { } @ Override public InputStream readBinaryStream ( ) throws SQLException { } @ Override public Object readObject ( ) throws SQLException { } @ Override public Ref readRef ( ) throws SQLException { } @ Override public Blob readBlob ( ) throws SQLException { } @ Override public Clob readClob ( ) throws SQLException { } @ Override public Array readArray ( ) throws SQLException { } @ Override public URL readURL ( ) throws SQLException { } @ Override public SQLXML readSQLXML ( ) throws SQLException { } @ Override public RowId readRowId ( ) throws SQLException { } @ Override public boolean wasNull ( ) throws SQLException { } @ Override public NClob readNClob ( ) throws SQLException { } @ Override public String readNString ( ) throws SQLException { } }

Fix:
InputStream data = SQLTypeUtils . coerceToByteStream ( val , attr . type , connection ) ;
Buggy code:
public class HavingDateComparatorsTest extends AbstractHavingTest { @ BeforeClass public static void setUpBeforeClass ( ) throws Exception { } @ AfterClass public static void tearDownAfterClass ( ) { } @ Test public void should_validate_equal ( ) throws Exception { } @ Test public void should_validate_unequal ( ) throws Exception { } @ Test public void should_validate_in ( ) throws Exception { } @ Test public void should_validate_greather_than ( ) throws Exception { } @ Test public void should_validate_greather_than_or_equal ( ) throws Exception { } @ Test public void should_validate_less_than ( ) throws Exception { } @ Test public void should_validate_less_than_or_equal ( ) throws Exception { } @ Test public void should_validate_between ( ) throws Exception { String dateQueryString = ( "get<seq2seq4repair_space>2<seq2seq4repair_space>distinct<seq2seq4repair_space>creation_date<seq2seq4repair_space>in<seq2seq4repair_space>('" + ( directory ) ) + "')<seq2seq4repair_space>sort<seq2seq4repair_space>by<seq2seq4repair_space>creation_date<seq2seq4repair_space>ascending;" ; Query dateQuery = QueryFactory . newQuery ( dateQueryString ) ; List < Comparable > dateResuls = dateQuery . execute ( ) ; <START_BUG> assertThat ( dateResuls ) . hasSize ( 2 ) . hasOnlyElementsOfType ( String . class ) ; <END_BUG> String queryString = ( ( ( ( ( "get<seq2seq4repair_space>file<seq2seq4repair_space>in<seq2seq4repair_space>('" + ( directory ) ) + "')<seq2seq4repair_space>having<seq2seq4repair_space>creation_date<seq2seq4repair_space>between<seq2seq4repair_space>'" ) + ( dateResuls . get ( 0 ) ) ) + "'<seq2seq4repair_space>and<seq2seq4repair_space>'" ) + ( dateResuls . get ( 1 ) ) ) + "';" ; Query query = QueryFactory . newQuery ( queryString ) ; List < Comparable > results = query . execute ( ) ; assertThat ( results ) . hasOnlyElementsOfType ( File . class ) ; assertThat ( results ) . isNotNull ( ) ; } @ Test ( expected = Exception . class ) public void should_unvalidate_like ( ) throws Exception { } @ Test ( expected = Exception . class ) public void should_unvalidate_match ( ) throws Exception { } }

Fix:
assertThat ( dateResuls ) . hasOnlyElementsOfType ( String . class ) ;
Buggy code:
class OSGiNamespace11Parser implements XMLStreamConstants , Namespace11 , XMLElementReader < List < ModelNode > > { static XMLElementReader < List < ModelNode > > INSTANCE = new OSGiNamespace11Parser ( ) ; private OSGiNamespace11Parser ( ) { } @ Override public void readElement ( XMLExtendedStreamReader reader , List < ModelNode > operations ) throws XMLStreamException { } private ModelNode parseActivationAttribute ( XMLExtendedStreamReader reader , ModelNode address ) throws XMLStreamException { } private List < ModelNode > parseConfigurations ( XMLExtendedStreamReader reader , ModelNode address ) throws XMLStreamException { } private List < ModelNode > parseFrameworkProperties ( XMLExtendedStreamReader reader , ModelNode address , List < ModelNode > operations ) throws XMLStreamException { requireNoAttributes ( reader ) ; List < ModelNode > result = new ArrayList < ModelNode > ( ) ; while ( ( reader . hasNext ( ) ) && ( ( reader . nextTag ( ) ) != ( XMLStreamConstants . END_ELEMENT ) ) ) { switch ( Namespace . forUri ( reader . getNamespaceURI ( ) ) ) { case OSGI_1_1 : { final Element element = Element . forName ( reader . getLocalName ( ) ) ; if ( element == ( Element . PROPERTY ) ) { String name = null ; String value = null ; int count = reader . getAttributeCount ( ) ; for ( int i = 0 ; i < count ; i ++ ) { requireNoNamespaceAttribute ( reader , i ) ; final String attrValue = reader . getAttributeValue ( i ) ; final Attribute attribute = Attribute . forName ( reader . getAttributeLocalName ( i ) ) ; switch ( attribute ) { case NAME : { name = attrValue ; break ; } default : throw unexpectedAttribute ( reader , i ) ; } } if ( name == null ) { throw missingRequired ( reader , Collections . singleton ( NAME ) ) ; } value = reader . getElementText ( ) . trim ( ) ; ModelNode propNode = new ModelNode ( ) ; propNode . get ( OP ) . set ( ADD ) ; <START_BUG> propNode . get ( OP_ADDR ) . set ( address ) . add ( FRAMEWORK_PROPERTY , name ) ; <END_BUG> propNode . get ( VALUE ) . set ( value ) ; result . add ( propNode ) ; break ; } else { throw unexpectedElement ( reader ) ; } } default : throw unexpectedElement ( reader ) ; } } return result ; } private List < ModelNode > parseCapabilities ( XMLExtendedStreamReader reader , ModelNode address ) throws XMLStreamException { } }

Fix:
propNode . get ( OP_ADDR ) . set ( address ) . add ( PROPERTY , name ) ;
Buggy code:
public class ActionAddTopLevelPackage extends UMLChangeAction { public static ActionAddTopLevelPackage SINGLETON = new ActionAddTopLevelPackage ( ) ; public ActionAddTopLevelPackage ( ) { } public void actionPerformed ( ActionEvent ae ) { Project p = TheInstance . getProject ( ) ; try { <START_BUG> int numPacks = p . getModels ( ) . size ( ) ; <END_BUG> String nameStr = "package_" + ( numPacks + 1 ) ; MModel model = UmlFactory . getFactory ( ) . getModelManagement ( ) . createModel ( ) ; model . setName ( nameStr ) ; p . addMember ( model ) ; super . actionPerformed ( ae ) ; ActionClassDiagram . SINGLETON . actionPerformed ( ae ) ; } catch ( PropertyVetoException pve ) { } } }

Fix:
int numPacks = p . getUserDefinedModels ( ) . size ( ) ;
Buggy code:
public class MeCommand implements CommandExecutor { private final nChat plugin ; public MeCommand ( nChat plugin ) { } public boolean onCommand ( CommandSender sender , Command cmd , String commandLabel , String [ ] args ) { if ( ! ( sender instanceof Player ) ) return true ; Player player = ( ( Player ) ( sender ) ) ; if ( ! ( plugin . getPermissionsHandler ( ) . hasPermission ( sender , "nChat.me" ) ) ) return true ; String message = arrayToString ( args , "<seq2seq4repair_space>" ) ; <START_BUG> plugin . getServer ( ) . broadcastMessage ( plugin . formatMessage ( player , plugin . meFormat , message ) ) ; <END_BUG> return true ; } private String arrayToString ( String [ ] array , String seperator ) { } }

Fix:
plugin . getServer ( ) . broadcastMessage ( plugin . formatMessage ( player , plugin . getConfigHandler ( ) . getMeFormat ( ) , message ) ) ;
Buggy code:
public final class Configurator { private final Logger logger = LoggerFactory . getLogger ( Configurator . class ) ; public Configurator ( ) { } public Configurator ( String defaultPrivateHomeName ) { } private static boolean equals ( Properties p , String optionKey , String optionValue , boolean caseSensitive ) { } private static boolean isTrue ( Properties p , String optionKey ) { } public static boolean equals ( String optionKey , String optionValue , boolean caseSensitive ) { } public static boolean isTrue ( String optionKey ) { } public static String getDefaultPrivateHomePath ( String defaultPrivateHomeName ) { } private File detectPrivateHome ( String defaultPrivateHomeName ) { final String defaultPrivateHomePath = Configurator . getDefaultPrivateHomePath ( defaultPrivateHomeName ) ; final String privateHomePathByRuntimeArg = System . getProperty ( PRIVATE_HOME_PATH ) ; <START_BUG> if ( privateHomePathByRuntimeArg != null ) { <END_BUG> final File f = new File ( privateHomePathByRuntimeArg ) ; if ( ! ( f . isAbsolute ( ) ) ) { logger . warn ( "The<seq2seq4repair_space>specified<seq2seq4repair_space>home<seq2seq4repair_space>path<seq2seq4repair_space>\"%s\"<seq2seq4repair_space>is<seq2seq4repair_space>not<seq2seq4repair_space>absolute!<seq2seq4repair_space>it\'s<seq2seq4repair_space>error-prone!" , privateHomePathByRuntimeArg ) ; } return f ; } return new File ( defaultPrivateHomePath ) ; } private void preSetupPrivateHome ( File privateHome ) { } private void postSetupPrivateHome ( File privateHome ) { } private void overrideOptionValue ( String k , Properties p ) { } private void setUnspecifiedOptionsWithDefaultValues ( Properties p ) { } private void setConstrainedOptions ( Properties p ) { } private void addAppOptionsToSystemProperties ( File privateHome ) { } private void setPathAbsolute ( Properties p , String key , File privateHome ) { } }

Fix:
if ( ( privateHomePathByRuntimeArg != null ) && ( ! ( privateHomePathByRuntimeArg . isEmpty ( ) ) ) ) {
Buggy code:
public interface IRequestTargetMounter { void mount ( String path , IRequestTargetUrlCodingStrategy urlCodingStrategy ) { } void unmount ( String path ) { } IRequestTargetUrlCodingStrategy urlCodingStrategyForPath ( String path ) { } <START_BUG> String pathForTarget ( IRequestTarget requestTarget ) ; <END_BUG> IRequestTarget targetForPath ( String path ) { } }

Fix:
CharSequence pathForTarget ( IRequestTarget requestTarget ) ;
Buggy code:
public class App extends SimpleApplication { public static final boolean DEBUG = AppProperties . isDebugMode ( ) ; private BulletAppState physicsState ; private Player player ; private SpotLight flashlight ; private Node coinsNode ; private Spatial theTree ; private List < Zombie > enemies = new ArrayList < Zombie > ( ) ; private String message = "" ; private BitmapText textCoins ; private BitmapText textMessage ; private float footstepsTime = 0 ; private float footstepsNextTime = 1 ; private Vector3f footstepsPosition = new Vector3f ( ) ; private AudioNode audioFootsteps ; @ Override public void simpleInitApp ( ) { } private void initInput ( ) { } private void initLight ( ) { } private void initPhysics ( ) { } private void initMaze ( int mazeSize , int wallSize ) { } private void initFloor ( int mazeSize , int wallSize ) { } private void initPlayer ( int mazeSize , int wallSize ) { } private void initObjects ( int mazeSize , int wallSize ) { coinsNode = new Node ( "Coins" ) ; Random random = new Random ( ) ; for ( int i = 0 ; i < 5 ; i ++ ) { Sphere coinShape = new Sphere ( 10 , 10 , 0.2F ) ; Geometry coinGeo = new Geometry ( "Coin" , coinShape ) ; coinGeo . setLocalTranslation ( ( ( ( random . nextInt ( mazeSize ) ) * wallSize ) * 2 ) , 0.2F , ( ( ( ( random . nextInt ( mazeSize ) ) * wallSize ) * 2 ) + wallSize ) ) ; coinGeo . setShadowMode ( CastAndReceive ) ; Material mat = new Material ( assetManager , "Common//MatDefs//Light//Lighting.j3md" ) ; mat . setBoolean ( "UseMaterialColors" , true ) ; mat . setColor ( "Diffuse" , Yellow ) ; mat . setColor ( "Ambient" , Yellow ) ; mat . setColor ( "Specular" , White ) ; mat . setFloat ( "Shininess" , 8 ) ; coinGeo . setMaterial ( mat ) ; coinsNode . attachChild ( coinGeo ) ; } rootNode . attachChild ( coinsNode ) ; theTree = assetManager . loadModel ( "Models//Tree//Tree.mesh.j3o" ) ; <START_BUG> theTree . setLocalTranslation ( ( mazeSize * wallSize ) , 0 , ( ( mazeSize * wallSize ) + wallSize ) ) ; <END_BUG> theTree . setShadowMode ( CastAndReceive ) ; } private void initEnemies ( int mazeSize , int wallSize ) { } private void initParticles ( int mazeSize , int wallSize ) { } private void initAudio ( ) { } private void initGUI ( ) { } private void updateGUI ( ) { } private void updateAudio ( float tpf ) { } @ Override public void simpleUpdate ( float tpf ) { } }

Fix:
theTree . setLocalTranslation ( ( ( ( ( mazeSize // 2 ) - 1 ) * wallSize ) * 2 ) , 0 , ( ( mazeSize * wallSize ) + wallSize ) ) ;
Buggy code:
public class CflowPointcut extends Pointcut { private Pointcut entry ; private boolean isBelow ; private int [ ] freeVars ; public static final ResolvedPointcutDefinition CFLOW_MARKER = new ResolvedPointcutDefinition ( null , 0 , null , TypeX . NONE , Pointcut . makeMatchesNothing ( RESOLVED ) ) ; public CflowPointcut ( Pointcut entry , boolean isBelow , int [ ] freeVars ) { } <START_BUG> public FuzzyBoolean fastMatch ( ResolvedTypeX type ) { <END_BUG> return FuzzyBoolean . MAYBE ; } public FuzzyBoolean match ( Shadow shadow ) { } public void write ( DataOutputStream s ) throws IOException { } public static Pointcut read ( DataInputStream s , ISourceContext context ) throws IOException { } public void resolveBindings ( IScope scope , Bindings bindings ) { } public boolean equals ( Object other ) { } public int hashCode ( ) { } public String toString ( ) { } public Test findResidue ( Shadow shadow , ExposedState state ) { } public Pointcut concretize1 ( ResolvedTypeX inAspect , IntMap bindings ) { } }

Fix:
public FuzzyBoolean fastMatch ( FastMatchInfo type ) {
Buggy code:
public class CassandraDaemon extends AbstractCassandraDaemon { private static Logger logger = LoggerFactory . getLogger ( CassandraDaemon . class ) ; private TServer serverEngine ; protected void setup ( ) throws IOException { } public void start ( ) { <START_BUG> CassandraDaemon . logger . info ( "Cassandra<seq2seq4repair_space>starting<seq2seq4repair_space>up..." ) ; <END_BUG> Mx4jTool . maybeLoad ( ) ; serverEngine . serve ( ) ; } public void stop ( ) { } public static void main ( String [ ] args ) { } }

Fix:
CassandraDaemon . logger . info ( "Listening<seq2seq4repair_space>for<seq2seq4repair_space>thrift<seq2seq4repair_space>clients..." ) ;
Buggy code:
public class Player extends AppCompatActivity { MediaPlayer mediaPlayer ; Button pause ; Button skipLeft ; Button skipRight ; TextView currentTime ; TextView finalTime ; SeekBar seekBar ; TextView title ; ListView note ; TextView t ; double startTime ; private Handler myHandler = new Handler ( ) ; String n = "" ; String uri = "" ; ArrayList < String > noteList ; SharedPreferences myPrefs ; String real = "" ; int currentNotePos ; Player . NoteListAdapter nla ; boolean isAppOpen ; ImageView shareButton ; final int PICK_FILE = 0 ; Uri myUri ; File exportedFile = null ; @ Override protected void onCreate ( Bundle savedInstanceState ) { } private void share ( ) { } @ Override protected void onPause ( ) { } @ Override protected void onResume ( ) { } @ Override protected void onDestroy ( ) { } private Runnable UpdateSongTime ; private void checkCurrentPos ( ) { } private class NoteListAdapter extends BaseAdapter { ArrayList < String > s ; protected NoteListAdapter ( ArrayList < String > s1 ) { } @ Override public int getCount ( ) { } @ Override public String getItem ( int arg0 ) { } @ Override public long getItemId ( int arg0 ) { } @ Override public View getView ( int pos , View v , ViewGroup arg2 ) { } } @ Override public boolean onCreateOptionsMenu ( Menu menu ) { } @ Override public boolean onOptionsItemSelected ( MenuItem item ) { } private boolean export ( ) { } @ Override protected void onActivityResult ( int requestCode , int resultCode , Intent data ) { } private void importFrom ( File f ) { try { Scanner scanner = new Scanner ( f ) ; n = myPrefs . getString ( uri , "" ) ; String temp = "" ; while ( scanner . hasNextLine ( ) ) { temp = scanner . nextLine ( ) ; if ( ! ( n . contains ( temp ) ) ) { <START_BUG> n += ( scanner . nextLine ( ) ) + "\n" ; <END_BUG> } } SharedPreferences . Editor editor = myPrefs . edit ( ) ; editor . putString ( uri , n ) ; editor . commit ( ) ; Scanner in = new Scanner ( n ) ; noteList = new ArrayList < > ( ) ; while ( in . hasNextLine ( ) ) { noteList . add ( in . nextLine ( ) . trim ( ) ) ; } noteList . remove ( "" ) ; Collections . sort ( ( ( List ) ( noteList ) ) ) ; nla = new Player . NoteListAdapter ( noteList ) ; note . setAdapter ( nla ) ; } catch ( FileNotFoundException e ) { e . printStackTrace ( ) ; } } No newline ; at end ; of file ; }

Fix:
n += temp + "\n" ;
Buggy code:
@ Api ( name = "jasify" , version = "v1" , defaultVersion = AnnotationBoolean . TRUE , description = "Jasify<seq2seq4repair_space>Schedule" , authenticators = { JasifyAuthenticator . class } , authLevel = AuthLevel . NONE , transformers = { JasAccountTransformer . class , JasActivityPackageTransformer . class , JasActivityTransformer . class , JasActivityTypeTransformer . class , JasGroupTransformer . class , JasKeyTransformer . class , JasOrganizationTransformer . class , JasRepeatDetailsTransformer . class , JasSubscriptionTransformer . class , JasTransactionTransformer . class , JasUserLoginTransformer . class , JasUserTransformer . class } , auth = @ ApiAuth ( allowCookieAuth = AnnotationBoolean . TRUE ) , namespace = @ ApiNamespace ( ownerDomain = "jasify.com" , ownerName = "Jasify" , packagePath = "" ) ) public class UserEndpoint { @ ApiMethod ( name = "users.query" , path = "users" , httpMethod = HttpMethod . GET ) public JasUserList getUsers ( User caller , @ Nullable @ Named ( "offset" ) Integer offset , @ Nullable @ Named ( "limit" ) Integer limit , @ Nullable @ Named ( "query" ) String query , @ Nullable @ Named ( "field" ) String field , @ Nullable @ Named ( "orderBy" ) String orderBy , @ Nullable @ Named ( "order" ) Query . SortDirection order ) throws ForbiddenException , UnauthorizedException { <START_BUG> mustBeAdmin ( caller ) ; <END_BUG> JasUserList users = new JasUserList ( ) ; if ( offset == null ) offset = 0 ; if ( limit == null ) limit = Constants . DEFAULT_LIMIT ; if ( order == null ) order = Constants . DEFAULT_ORDER ; UserService svc = UserServiceFactory . getUserService ( ) ; users . setTotal ( svc . getTotalUsers ( ) ) ; if ( "email" . equals ( field ) ) { users . addAll ( svc . searchByEmail ( ( query == null ? null : Pattern . compile ( query ) ) , order , offset , limit ) ) ; } else if ( "name" . equals ( field ) ) { users . addAll ( svc . searchByName ( ( query == null ? null : Pattern . compile ( query ) ) , order , offset , limit ) ) ; } else { users . addAll ( svc . list ( order , offset , limit ) ) ; } return users ; } @ ApiMethod ( name = "users.get" , path = "users//{id}" , httpMethod = HttpMethod . GET ) public User getUser ( User caller , @ Named ( "id" ) Key id ) throws ForbiddenException , NotFoundException , UnauthorizedException { } @ ApiMethod ( name = "users.update" , path = "users//{id}" , httpMethod = HttpMethod . PUT ) public User updateUser ( User caller , @ Named ( "id" ) Key id , com . jasify . schedule . appengine . model . users . User user ) throws ForbiddenException , NotFoundException , UnauthorizedException , FieldValueException { } @ ApiMethod ( name = "users.add" , path = "users" , httpMethod = HttpMethod . POST ) public User addUser ( User caller , JasAddUserRequest request , HttpServletRequest servletRequest ) throws EmailExistsException , UserLoginExistsException , UsernameExistsException { } }

Fix:
mustBeAdminOrOrgMember ( caller ) ;
Buggy code:
public class OptoJenaFiberSwitchDemo { @ Test public void test ( ) throws InterruptedException { final OptoJenaFiberSwitchDevice lOptoJenaFiberSwitchDevice = new OptoJenaFiberSwitchDevice ( "COM10" ) ; assertTrue ( lOptoJenaFiberSwitchDevice . open ( ) ) ; final DoubleVariable lPositionVariable = lOptoJenaFiberSwitchDevice . getPositionVariable ( ) ; for ( int i = 0 ; i < 500 ; i ++ ) { <START_BUG> int lTargetPosition = i % 4 ; <END_BUG> lPositionVariable . set ( ( ( double ) ( lTargetPosition ) ) ) ; Thread . sleep ( 10 ) ; System . out . format ( "i=%d,<seq2seq4repair_space>tp=%d\n" , i , lTargetPosition ) ; } assertTrue ( lOptoJenaFiberSwitchDevice . close ( ) ) ; } }

Fix:
int lTargetPosition = 0 ;
Buggy code:
public class EChronos_CodeGenerator extends CodeGeneratorBase { public EChronos_CodeGenerator ( Logger log , Model model , File aadlDirectory , File outputDir ) { } public void createAssemblyHeader ( ) throws Aadl2RtosFailure { } public void createPrxFile ( ) throws Aadl2RtosFailure { ModelNames mn = new ModelNames ( model ) ; <START_BUG> String name = "smaccm_decls.h" ; <END_BUG> File file = new File ( outputDirectory , name ) ; String path = file . getAbsolutePath ( ) ; String platform ; if ( model . getHWTarget ( ) . equals ( "PX4" ) ) { platform = "Prx-stm32f4-discovery.stg" ; } else { log . error ( "eChronos<seq2seq4repair_space>code<seq2seq4repair_space>generator:<seq2seq4repair_space>currently<seq2seq4repair_space>only<seq2seq4repair_space>PX4<seq2seq4repair_space>hardware<seq2seq4repair_space>platform<seq2seq4repair_space>is<seq2seq4repair_space>supported.\n" ) ; throw new Aadl2RtosFailure ( ) ; } try ( BufferedWriter writer = new BufferedWriter ( new FileWriter ( file ) ) ) { STGroupFile stg = this . createTemplate ( platform ) ; writeBoilerplateDTHeader ( name , path , writer , stg . getInstanceOf ( "prxPrefix" ) , false ) ; ST st = stg . getInstanceOf ( "prxBody" ) ; st . add ( "model" , mn ) ; writer . append ( st . render ( ) ) ; writeBoilerplateFooter ( name , path , writer , stg . getInstanceOf ( "prxPostfix" ) ) ; } catch ( IOException e ) { log . error ( "Problem<seq2seq4repair_space>creating<seq2seq4repair_space>EChronos<seq2seq4repair_space>assembly<seq2seq4repair_space>header<seq2seq4repair_space>file." ) ; throw new Aadl2RtosFailure ( ) ; } } @ Override public void osSpecificComponentFiles ( ThreadImplementation ti , File componentDirectory , File srcDirectory , File includeDirectory ) throws Aadl2RtosFailure { } @ Override public void createPeriodicDispatcherComponent ( ) throws Aadl2RtosFailure { } @ Override public void write ( ) throws Aadl2RtosFailure { } No newline ; at end ; of file ; }

Fix:
String name = mn . getEChronosPrxFileName ( ) ;
Buggy code:
public class InfoFragment extends ListFragment { @ Override public View onCreateView ( LayoutInflater inflater , ViewGroup container , Bundle savedInstanceState ) { ChargeController cc = MonitorApplication . chargeControllers ( ) . getCurrentChargeController ( ) ; if ( cc != null ) { Pair [ ] data = new Pair [ 9 ] ; data [ 0 ] = new Pair ( getString ( info_model_title ) , cc . getModel ( ) ) ; data [ 1 ] = new Pair ( getString ( info_mac_title ) , cc . getMacAddress ( ) ) ; data [ 2 ] = new Pair ( getString ( info_unitid_title ) , String . format ( "%04x<seq2seq4repair_space>%04x" , ( ( ( cc . unitID ( ) ) > > 16 ) & 65535 ) , ( ( cc . unitID ( ) ) & 65535 ) ) . toUpperCase ( ) ) ; data [ 3 ] = new Pair ( getString ( info_ipaddress_title ) , String . format ( "%s:%s" , cc . deviceIpAddress ( ) , cc . port ( ) ) ) ; data [ 4 ] = new Pair ( getString ( info_classic_rev_title ) , cc . getAppVersion ( ) ) ; data [ 5 ] = new Pair ( getString ( info_network_rev_title ) , cc . getNetVersion ( ) ) ; data [ 6 ] = new Pair ( getString ( info_build_date_title ) , cc . getBuildDate ( ) ) ; data [ 7 ] = new Pair ( getString ( info_last_voc_title ) , String . format ( "%1.1f<seq2seq4repair_space>V" , cc . getLastVOC ( ) ) ) ; <START_BUG> data [ 8 ] = new Pair ( "Nominal<seq2seq4repair_space>Battery<seq2seq4repair_space>Voltage" , String . format ( "%d<seq2seq4repair_space>V" , cc . getNominalBatteryVoltage ( ) ) ) ; <END_BUG> InfoListAdapter adapter = new InfoListAdapter ( inflater . getContext ( ) , data ) ; setListAdapter ( adapter ) ; } return super . onCreateView ( inflater , container , savedInstanceState ) ; } }

Fix:
data [ 8 ] = new Pair ( getString ( info_nominal_battery_voltage ) , String . format ( "%d<seq2seq4repair_space>V" , cc . getNominalBatteryVoltage ( ) ) ) ;
Buggy code:
public class JobStateRecipe { private Job < ? , ? > job ; private Stack < AbstractBuild > buildHistory = new Stack < AbstractBuild > ( ) ; public JobStateRecipe ( ) { } public JobStateRecipe withName ( String name ) { } private JobStateRecipe withShortUrl ( String url ) { } public JobStateRecipe withDisplayName ( String name ) { } public JobStateRecipe thatHasNeverRun ( ) { } public JobStateRecipe whereTheLast ( BuildStateRecipe recipe ) { } public JobStateRecipe andThePrevious ( BuildStateRecipe recipe ) { } @ SuppressWarnings ( "unchecked" ) public Job < ? , ? > execute ( ) { AbstractBuild earlierBuild ; AbstractBuild earliestBuild ; while ( ( buildHistory . size ( ) ) > 1 ) { earliestBuild = buildHistory . pop ( ) ; earlierBuild = buildHistory . peek ( ) ; when ( earlierBuild . getPreviousBuild ( ) ) . thenReturn ( earliestBuild ) ; } if ( ( buildHistory . size ( ) ) == 1 ) { <START_BUG> when ( job . getLastBuild ( ) ) . thenReturn ( buildHistory . pop ( ) ) ; <END_BUG> } return job ; } private JobStateRecipe updatedWithEarliestHistoryEntryFor ( AbstractBuild build ) { } private JobStateRecipe updatedWithOnlyOneHistoryEntryFor ( AbstractBuild build ) { } No newline ; at end ; of file ; }

Fix:
when ( ( ( AbstractBuild ) ( job . getLastBuild ( ) ) ) ) . thenReturn ( buildHistory . pop ( ) ) ;
Buggy code:
public class ProgressMonitorWindow implements ProgressListener { private ProgressMonitor pbar ; public ProgressMonitorWindow ( JFrame parent , String title ) { } public void progress ( final ProgressEvent event ) { if ( ( this . pbar ) != null ) { <START_BUG> int currentUpdate = Long . valueOf ( event . getPosition ( ) ) . intValue ( ) ; <END_BUG> pbar . setProgress ( currentUpdate ) ; Object [ ] args = new Object [ ] { String . valueOf ( currentUpdate ) } ; pbar . setNote ( Translator . localize ( "dialog.progress.note" , args ) ) ; } } public void progress ( final int progress ) { } public boolean isCanceled ( ) { } public void close ( ) { } }

Fix:
int currentUpdate = new Long ( event . getPosition ( ) ) . intValue ( ) ;
Buggy code:
public class DebuggingSlicePool implements Pool < ByteBuffer > { private static final ThreadLocal < String > ALLOCATION_CONTEXT = new ThreadLocal < > ( ) ; static final Set < DebuggingSlicePool . DebuggingBuffer > BUFFERS = Collections . newSetFromMap ( new ConcurrentHashMap < DebuggingSlicePool . DebuggingBuffer , Boolean > ( ) ) ; static volatile String currentLabel ; private final Pool < ByteBuffer > delegate ; public DebuggingSlicePool ( Pool < ByteBuffer > delegate ) { } public static void addContext ( String context ) { } @ Override public Pooled < ByteBuffer > allocate ( ) { } static class DebuggingBuffer implements Pooled < ByteBuffer > { private final RuntimeException allocationPoint ; private final Pooled < ByteBuffer > delegate ; private final String label ; private volatile boolean free = false ; private RuntimeException freePoint ; public DebuggingBuffer ( Pooled < ByteBuffer > delegate , String label ) { } @ Override public void discard ( ) { } @ Override public void free ( ) { if ( free ) { <START_BUG> throw new RuntimeException ( "Buffer<seq2seq4repair_space>already<seq2seq4repair_space>freed,<seq2seq4repair_space>free<seq2seq4repair_space>point:<seq2seq4repair_space>" , freePoint ) ; <END_BUG> } freePoint = new RuntimeException ( "FREE<seq2seq4repair_space>POINT" ) ; free = true ; DebuggingSlicePool . BUFFERS . remove ( this ) ; delegate . free ( ) ; } @ Override public ByteBuffer getResource ( ) throws IllegalStateException { } @ Override public void close ( ) { } RuntimeException getAllocationPoint ( ) { } String getLabel ( ) { } @ Override public String toString ( ) { } } }

Fix:
return ;
Buggy code:
public final class LikyaDayKeeper implements Runnable { private boolean executePermission = true ; private Thread myExecuter ; private static LikyaDayKeeper ref ; private static SpaceWideRegistry spaceWideRegistry ; private Calendar transitionTime = null ; private static Calendar TRANSITION_PERIOD ; private boolean isForced = false ; public static LikyaDayKeeper getInstance ( SpaceWideRegistry spaceWideRegistry ) { } private LikyaDayKeeper ( SpaceWideRegistry spaceWideRegistry ) { } public void run ( ) { while ( executePermission ) { Date currentTime = Calendar . getInstance ( ) . getTime ( ) ; <START_BUG> if ( transitionTime . before ( currentTime ) ) { <END_BUG> SpaceWideRegistry . getGlobalLogger ( ) . info ( "" ) ; SpaceWideRegistry . getGlobalLogger ( ) . info ( "<seq2seq4repair_space>><seq2seq4repair_space>Gündönümü<seq2seq4repair_space>gelmiştir<seq2seq4repair_space>!!" ) ; shiftTransitionTime ( ) ; SpaceWideRegistry . getGlobalLogger ( ) . info ( "<seq2seq4repair_space>><seq2seq4repair_space>is<seq2seq4repair_space>yuku<seq2seq4repair_space>islenmesi<seq2seq4repair_space>sureci<seq2seq4repair_space>baslamistir<seq2seq4repair_space>!!" ) ; LikyaDayKeeper . spaceWideRegistry . getSpaceWideReference ( ) . startCpc ( ) ; } else if ( isForced ) { isForced = false ; LikyaDayKeeper . spaceWideRegistry . getSpaceWideReference ( ) . startCpc ( ) ; } try { Thread . sleep ( 1000 ) ; } catch ( InterruptedException e ) { e . printStackTrace ( ) ; } } } public void shiftTransitionTime ( ) { } public boolean isExecutePermission ( ) { } public void setExecutePermission ( boolean executePermission ) { } public Thread getMyExecuter ( ) { } public void setMyExecuter ( Thread myExecuter ) { } public boolean isForced ( ) { } public synchronized void setForced ( boolean isForced ) { } public Calendar getTransitionTime ( ) { } No newline ; at end ; of file ; }

Fix:
if ( transitionTime . getTime ( ) . before ( currentTime ) ) {
Buggy code:
@ Slow @ ThreadLeakFilters ( defaultFilters = true , filters = { SolrIgnoredThreadsFilter . class , QuickPatchThreadsFilter . class } ) public class TestLBHttpSolrServer extends SolrTestCaseJ4 { private static final Logger log = LoggerFactory . getLogger ( TestLBHttpSolrServer . class ) ; TestLBHttpSolrServer . SolrInstance [ ] solr = new TestLBHttpSolrServer . SolrInstance [ 3 ] ; HttpClient httpClient ; static String savedFactory ; @ BeforeClass public static void beforeClass ( ) { } @ AfterClass public static void afterClass ( ) { } @ Override public void setUp ( ) throws Exception { } private void addDocs ( TestLBHttpSolrServer . SolrInstance solrInstance ) throws IOException , SolrServerException { } @ Override public void tearDown ( ) throws Exception { } public void testSimple ( ) throws Exception { } public void testTwoServers ( ) throws Exception { } public void testReliability ( ) throws Exception { } private void waitForServer ( int maximum , LBHttpSolrServer server , int nServers , String serverName ) throws Exception { } private class SolrInstance { String name ; File homeDir ; File dataDir ; File confDir ; int port ; JettySolrRunner jetty ; public SolrInstance ( String name , int port ) { } public String getHomeDir ( ) { } public String getUrl ( ) { <START_BUG> return ( ( ( "http" + ( isSSLMode ( ) ? "s" : "" ) ) + ":////127.0.0.1:" ) + ( port ) ) + "//solr" ; <END_BUG> } public String getSchemaFile ( ) { } public String getConfDir ( ) { } public String getDataDir ( ) { } public String getSolrConfigFile ( ) { } public String getSolrXmlFile ( ) { } public void setUp ( ) throws Exception { } public void tearDown ( ) throws Exception { } public void startJetty ( ) throws Exception { } } }

Fix:
return buildUrl ( port , "//solr" ) ;