nus-yam/ex-repair huggingface dataset:
Buggy code:
public class EditingOptionPane extends AbstractOptionPane { public EditingOptionPane ( ) { } protected void _init ( ) { } protected void _save ( ) { } private JComboBox defaultMode ; private JTextField undoCount ; private EditingOptionPane . ModeProperties global ; private EditingOptionPane . ModeProperties [ ] modeProps ; private EditingOptionPane . ModeProperties current ; private JComboBox mode ; private JCheckBox useDefaults ; private JTextField filenameGlob ; private JTextField firstlineGlob ; private JTextField noWordSep ; private JComboBox folding ; private JTextField collapseFolds ; private JComboBox wrap ; private JComboBox maxLineLen ; private JComboBox tabSize ; private JComboBox indentSize ; private JCheckBox noTabs ; private void saveMode ( ) { } private void selectMode ( ) { } private void updateEnabled ( ) { if ( ( current ) == ( global ) ) { useDefaults . setEnabled ( false ) ; filenameGlob . setEnabled ( false ) ; firstlineGlob . setEnabled ( false ) ; noWordSep . setEnabled ( true ) ; folding . setEnabled ( true ) ; collapseFolds . setEnabled ( true ) ; wrap . setEnabled ( true ) ; maxLineLen . setEnabled ( true ) ; tabSize . setEnabled ( true ) ; indentSize . setEnabled ( true ) ; noTabs . setEnabled ( true ) ; } else { useDefaults . setEnabled ( true ) ; <START_BUG> boolean enabled = ! ( modeProps [ mode . getSelectedIndex ( ) ] . useDefaults ) ; <END_BUG> filenameGlob . setEnabled ( enabled ) ; firstlineGlob . setEnabled ( enabled ) ; noWordSep . setEnabled ( enabled ) ; folding . setEnabled ( enabled ) ; collapseFolds . setEnabled ( enabled ) ; wrap . setEnabled ( enabled ) ; maxLineLen . setEnabled ( enabled ) ; tabSize . setEnabled ( enabled ) ; indentSize . setEnabled ( enabled ) ; noTabs . setEnabled ( enabled ) ; } } class ActionHandler implements ActionListener { public void actionPerformed ( ActionEvent evt ) { } } class ModeProperties { Mode mode ; boolean edited ; boolean loaded ; boolean useDefaults ; String filenameGlob ; String firstlineGlob ; String noWordSep ; String folding ; String collapseFolds ; String wrap ; String maxLineLen ; String tabSize ; String indentSize ; boolean noTabs ; ModeProperties ( ) { } ModeProperties ( Mode mode ) { } void load ( ) { } void save ( ) { } } }

Fix:
boolean enabled = ! ( modeProps [ ( ( mode . getSelectedIndex ( ) ) - 1 ) ] . useDefaults ) ;
Buggy code:
public class SSHExec extends SSHBase { private String command = null ; private long maxwait = 0 ; private Thread thread = null ; private String output_property = null ; private File output_file = null ; private boolean append = false ; public SSHExec ( ) { } public void setCommand ( String command ) { } public void setTimeout ( long timeout ) { } public void setOutput ( File output ) { } public void setAppend ( boolean append ) { } public void setOutputproperty ( String property ) { } public void execute ( ) throws BuildException { if ( ( getHost ( ) ) == null ) { throw new BuildException ( "Host<seq2seq4repair_space>is<seq2seq4repair_space>required." ) ; } if ( ( getUserInfo ( ) . getName ( ) ) == null ) { throw new BuildException ( "Username<seq2seq4repair_space>is<seq2seq4repair_space>required." ) ; } if ( ( ( getUserInfo ( ) . getKeyfile ( ) ) == null ) && ( ( getUserInfo ( ) . getPassword ( ) ) == null ) ) { throw new BuildException ( "Password<seq2seq4repair_space>or<seq2seq4repair_space>Keyfile<seq2seq4repair_space>is<seq2seq4repair_space>required." ) ; } if ( ( command ) == null ) { throw new BuildException ( "Command<seq2seq4repair_space>is<seq2seq4repair_space>required." ) ; } ByteArrayOutputStream out = new ByteArrayOutputStream ( ) ; SSHExec . Tee tee = new SSHExec . Tee ( out , System . out ) ; try { Session session = openSession ( ) ; <START_BUG> session . setTimeout ( maxwait ) ; <END_BUG> final ChannelExec channel = ( ( ChannelExec ) ( session . openChannel ( "exec" ) ) ) ; channel . setCommand ( command ) ; channel . setOutputStream ( tee ) ; channel . connect ( ) ; thread = new Thread ( ) { public void run ( ) { while ( ! ( channel . isEOF ( ) ) ) { if ( ( thread ) == null ) { return ; } try { Thread . sleep ( 500 ) ; } catch ( Exception e ) { } } } } ; thread . start ( ) ; thread . join ( maxwait ) ; if ( thread . isAlive ( ) ) { thread = null ; log ( "Timeout<seq2seq4repair_space>period<seq2seq4repair_space>exceeded,<seq2seq4repair_space>connection<seq2seq4repair_space>dropped." ) ; } else { if ( ( output_property ) != null ) { getProject ( ) . setProperty ( output_property , out . toString ( ) ) ; } if ( ( output_file ) != null ) { writeToFile ( out . toString ( ) , append , output_file ) ; } } } catch ( Exception e ) { if ( getFailonerror ( ) ) { throw new BuildException ( e ) ; } else { log ( ( "Caught<seq2seq4repair_space>exception:<seq2seq4repair_space>" + ( e . getMessage ( ) ) ) , MSG_ERR ) ; } } } private void writeToFile ( String from , boolean append , File to ) throws IOException { } public class Tee extends OutputStream { private OutputStream left = null ; private OutputStream right = null ; public Tee ( OutputStream left , OutputStream right ) { } public void write ( int b ) throws IOException { } public void close ( ) throws IOException { } public void flush ( ) throws IOException { } } }

Fix:
session . setTimeout ( ( ( int ) ( maxwait ) ) ) ;
Buggy code:
public class CamelHbaseStoreBolt extends AmConfigurationBolt { private static final long serialVersionUID = - 668373233969623288L ; private static final Logger logger = LoggerFactory . getLogger ( CamelHbaseStoreBolt . class ) ; private String contextUri ; private String defaultEndPoint = "direct:hbase" ; private List < CellDefine > cellDefineList ; private transient ProducerTemplate producerTemplate ; protected AbstractMessageConverter converter ; public CamelHbaseStoreBolt ( ) { } @ SuppressWarnings ( "rawtypes" ) @ Override public void prepare ( Map stormConf , TopologyContext context , OutputCollector collector ) { } @ SuppressWarnings ( "unchecked" ) @ Override public void onMessage ( StreamMessage message ) { <START_BUG> Map < String , Object > values = null ; <END_BUG> try { values = this . converter . toMap ( message ) ; } catch ( ConvertFailException ex ) { String logFormat = "Fail<seq2seq4repair_space>convert<seq2seq4repair_space>to<seq2seq4repair_space>hbase<seq2seq4repair_space>record.<seq2seq4repair_space>Dispose<seq2seq4repair_space>received<seq2seq4repair_space>message.<seq2seq4repair_space>:<seq2seq4repair_space>Message={0}" ; CamelHbaseStoreBolt . logger . warn ( MessageFormat . format ( logFormat , message ) , ex ) ; ack ( ) ; return ; } HBaseData data = new HBaseData ( ) ; HBaseRow row = new HBaseRow ( ) ; row . setId ( ( ( ( values . get ( "timestamp" ) . toString ( ) ) + "_" ) + ( values . get ( "source" ) . toString ( ) ) ) ) ; List < String > bodyList = ( ( List < String > ) ( values . get ( "body" ) ) ) ; for ( int i = 0 ; i < ( bodyList . size ( ) ) ; i ++ ) { CellDefine cellDefine = this . cellDefineList . get ( i ) ; HBaseCell registCell = new HBaseCell ( ) ; registCell . setFamily ( cellDefine . family ) ; registCell . setQualifier ( cellDefine . qualifier ) ; registCell . setValue ( bodyList . get ( i ) ) ; row . getCells ( ) . add ( registCell ) ; } data . getRows ( ) . add ( row ) ; insert ( data ) ; ack ( ) ; } @ Override public void declareOutputFields ( OutputFieldsDeclarer declarer ) { } protected void insert ( HBaseData values ) { } public void setApplicationContextUri ( String applicationContextUri ) { } public void setCellDefineList ( List < CellDefine > cellDefineList ) { } public void setConverter ( AbstractMessageConverter converter ) { } }

Fix:
Map < String , Object > values ;
Buggy code:
@ JawrSpringTestConfigFiles ( webXml = "net//jawr//web//standard//config//web.xml" , jawrConfig = "net//jawr//web//standard//config//jawr.properties" , dispatcherServletConfig = "net//jawr//web//standard//config//dispatcher-servlet.xml" ) public class MainPageTest extends AbstractSpringPageTest { protected String getPageUrl ( ) { } @ Test public void testPageLoad ( ) throws Exception { } @ Test public void checkGeneratedJsLinks ( ) { } @ Test public void testJsBundleContent ( ) throws Exception { } @ Test public void checkGeneratedCssLinks ( ) { final List < HtmlLink > styleSheets = getHtmlLinkTags ( ) ; assertEquals ( 1 , styleSheets . size ( ) ) ; final HtmlLink css = styleSheets . get ( 0 ) ; <START_BUG> assertEquals ( ( ( getUrlPrefix ( ) ) + "//spring//jawr//N33754198//fwk//core//component.css" ) , css . getHrefAttribute ( ) ) ; <END_BUG> } @ Test public void testCssBundleContent ( ) throws Exception { } @ Test public void checkGeneratedHtmlImageLinks ( ) { } @ Test public void checkGeneratedHtmlImageInputLinks ( ) { } }

Fix:
assertEquals ( ( ( getUrlPrefix ( ) ) + "//spring//jawr//497434506//fwk//core//component.css" ) , css . getHrefAttribute ( ) ) ;
Buggy code:
class WrapperEditor extends PropertyEditorSupport implements PropertyChangeListener { protected static Logger log = LoggingManager . getLoggerForClass ( ) ; PropertyEditor typeEditor ; PropertyEditor guiEditor ; boolean acceptsNull ; boolean acceptsExpressions ; private String lastValidValue = null ; public WrapperEditor ( PropertyEditor typeEditor , PropertyEditor guiEditor , boolean acceptsNull , boolean acceptsExpressions ) { } public boolean supportsCustomEditor ( ) { } public Component getCustomEditor ( ) { } private boolean isValidValue ( String text ) { } private final void shouldNeverHappen ( ) throws Error { } private final void shouldNeverHappen ( Exception e ) throws Error { <START_BUG> throw new Error ( e ) ; <END_BUG> } private final boolean isExpression ( String text ) { } private final boolean isExpression ( Object text ) { } public Object getValue ( ) { } public void setValue ( Object value ) { } public String getAsText ( ) { } public void setAsText ( String text ) throws IllegalArgumentException { } public void propertyChange ( PropertyChangeEvent event ) { } }

Fix:
throw new Error ( e . toString ( ) ) ;
Buggy code:
@ RunWith ( Arquillian . class ) public class MappedNameInjectionTestCase { @ Deployment public static WebArchive createSecondDeployment ( ) { WebArchive war = ShrinkWrap . create ( WebArchive . class ) ; war . addClasses ( MappedNameInjectionTestCase . class , MappedNameBean . class ) ; <START_BUG> war . addAsWebInfResource ( "injection//mappedname//web.xml" ) ; <END_BUG> war . toString ( true ) ; return war ; } @ Test public void testResourceInjectionWithMappedName ( ) throws Exception { } }

Fix:
war . addAsWebInfResource ( MappedNameInjectionTestCase . class . getPackage ( ) , "//web.xml" , "//web.xml" ) ;
Buggy code:
public class RawClient { public static void main ( String [ ] args ) throws IOException , InterruptedException { BufferedReader input = new BufferedReader ( new InputStreamReader ( System . in ) ) ; Client < byte [ ] > client = new Client ( RawProtocol . class ) ; client . setReceiveHandler ( ( c , packet ) -> { for ( byte b : packet ) System . out . print ( ( b + "<seq2seq4repair_space>" ) ) ; System . out . println ( ) ; System . out . println ( new String ( packet ) ) ; } ) ; client . setDisconnectHandler ( ( pp , r ) -> System . out . println ( ( ( pp + ":<seq2seq4repair_space>" ) + r ) ) ) ; try { client . connect ( input . readLine ( ) ) ; } catch ( IOException e ) { throw new RuntimeException ( e ) ; } while ( input != null ) { String in = input . readLine ( ) ; if ( in != null ) { int times = 1 ; if ( in . startsWith ( "repeat<seq2seq4repair_space>" ) ) { String [ ] split = in . split ( "<seq2seq4repair_space>" , 3 ) ; times = Integer . parseInt ( split [ 1 ] ) ; in = split [ 2 ] ; } for ( int i1 = 0 ; i1 < times ; i1 ++ ) { if ( in . startsWith ( "b<seq2seq4repair_space>" ) ) { in = in . substring ( 2 ) ; String [ ] byteStrings = in . replaceAll ( "\\\\i" , ( "" + i1 ) ) . split ( "<seq2seq4repair_space>" ) ; byte [ ] bytes = new byte [ byteStrings . length ] ; try { for ( int i = 0 ; i < ( byteStrings . length ) ; i ++ ) bytes [ i ] = Byte . valueOf ( byteStrings [ i ] ) ; client . send ( bytes ) ; } catch ( NumberFormatException e ) { } } else { <START_BUG> client . send ( in . replaceAll ( "\\n" , "\n" ) . replaceAll ( "\\\\i" , ( "" + i1 ) ) . getBytes ( ) ) ; <END_BUG> } } } } } }

Fix:
client . send ( in . replaceAll ( "\\\\n" , "\n" ) . replaceAll ( "\\\\i" , ( "" + i1 ) ) . getBytes ( ) ) ;
Buggy code:
class LinkTab extends Tab { Link link1 ; Group linkGroup ; LinkTab ( ControlExample instance ) { } void createExampleGroup ( ) { super . createExampleGroup ( ) ; linkGroup = new Group ( exampleGroup , SWT . NONE ) ; linkGroup . setLayout ( new GridLayout ( ) ) ; <START_BUG> linkGroup . setLayoutData ( new GridData ( ( ( ( GridData . GRAB_HORIZONTAL ) | ( GridData . HORIZONTAL_ALIGN_FILL ) ) | ( GridData . VERTICAL_ALIGN_FILL ) ) ) ) ; <END_BUG> linkGroup . setText ( "Link" ) ; } void createExampleWidgets ( ) { } void createStyleGroup ( ) { } Control [ ] getExampleWidgets ( ) { } String [ ] getMethodNames ( ) { } String getTabText ( ) { } }

Fix:
linkGroup . setLayoutData ( new GridData ( SWT . FILL , SWT . FILL , true , true ) ) ;
Buggy code:
public class PrefFragment extends PreferenceFragment implements Preference . OnPreferenceChangeListener , StockFragment { private boolean mIsGetDefaultValues = true ; @ Override public void onCreate ( Bundle savedInstanceState ) { } @ Override public void onViewCreated ( View view , Bundle savedInstanceState ) { } @ Override public void onActivityCreated ( Bundle savedInstanceState ) { } private void bindPreferenceSummaryToValue ( Preference preference ) { } @ Override public boolean onPreferenceChange ( Preference preference , Object newValue ) { String prefValue = ( ( String ) ( newValue ) ) ; if ( preference instanceof ListPreference ) { ListPreference listPreference = ( ( ListPreference ) ( preference ) ) ; int prefIndex = listPreference . findIndexOfValue ( prefValue ) ; if ( prefIndex >= 0 ) preference . setSummary ( listPreference . getEntries ( ) [ prefIndex ] ) ; } else { preference . setSummary ( prefValue ) ; if ( ! ( mIsGetDefaultValues ) ) { if ( ! ( Utility . isNetworkEnabled ( getActivity ( ) ) ) ) { <START_BUG> Toast . makeText ( getActivity ( ) , "Check<seq2seq4repair_space>the<seq2seq4repair_space>internet<seq2seq4repair_space>connection" , LENGTH_SHORT ) . show ( ) ; <END_BUG> } else { getActivity ( ) . startService ( new android . content . Intent ( getActivity ( ) , WeatherService . class ) ) ; } } } mIsGetDefaultValues = false ; return true ; } @ Override public String getFragmentTitle ( ) { } @ Override public void Hide ( ) { } @ Override public void Show ( ) { } }

Fix:
Toast . makeText ( getActivity ( ) , getActivity ( ) . getString ( internet_error ) , LENGTH_LONG ) . show ( ) ;
Buggy code:
public class Initializer extends BodyDeclaration { public static final ChildPropertyDescriptor JAVADOC_PROPERTY = BodyDeclaration . internalJavadocPropertyFactory ( Initializer . class ) ; public static final SimplePropertyDescriptor MODIFIERS_PROPERTY = BodyDeclaration . internalModifiersPropertyFactory ( Initializer . class ) ; public static final ChildListPropertyDescriptor MODIFIERS2_PROPERTY = BodyDeclaration . internalModifiers2PropertyFactory ( Initializer . class ) ; public static final ChildPropertyDescriptor BODY_PROPERTY = new ChildPropertyDescriptor ( Initializer . class , "body" , Block . class , ASTNode . MANDATORY , ASTNode . CYCLE_RISK ) ; private static final List PROPERTY_DESCRIPTORS_2_0 ; private static final List PROPERTY_DESCRIPTORS_3_0 ; public static List propertyDescriptors ( int apiLevel ) { } private Block body = null ; Initializer ( AST ast ) { } final List internalStructuralPropertiesForType ( int apiLevel ) { } final int internalGetSetIntProperty ( SimplePropertyDescriptor property , boolean get , int value ) { } final ASTNode internalGetSetChildProperty ( ChildPropertyDescriptor property , boolean get , ASTNode child ) { } final List internalGetChildListProperty ( ChildListPropertyDescriptor property ) { } final ChildPropertyDescriptor internalJavadocProperty ( ) { } final ChildListPropertyDescriptor internalModifiers2Property ( ) { } final SimplePropertyDescriptor internalModifiersProperty ( ) { } final int getNodeType0 ( ) { } ASTNode clone0 ( AST target ) { Initializer result = new Initializer ( target ) ; <START_BUG> result . setSourceRange ( this . getStartPosition ( ) , this . getLength ( ) ) ; <END_BUG> if ( ( this . ast . apiLevel ) == ( AST . JLS2_INTERNAL ) ) { result . internalSetModifiers ( getModifiers ( ) ) ; } if ( ( this . ast . apiLevel ) >= ( AST . JLS3 ) ) { result . modifiers ( ) . addAll ( ASTNode . copySubtrees ( target , modifiers ( ) ) ) ; } result . setJavadoc ( ( ( Javadoc ) ( ASTNode . copySubtree ( target , getJavadoc ( ) ) ) ) ) ; result . setBody ( ( ( Block ) ( getBody ( ) . clone ( target ) ) ) ) ; return result ; } final boolean subtreeMatch0 ( ASTMatcher matcher , Object other ) { } void accept0 ( ASTVisitor visitor ) { } public Block getBody ( ) { } public void setBody ( Block body ) { } int memSize ( ) { } int treeSize ( ) { } }

Fix:
result . setSourceRange ( getStartPosition ( ) , getLength ( ) ) ;
Buggy code:
public class MainActivity extends Activity { private static final String TAG1 = "ad-01" ; private static final String TAG2 = "ad-02" ; private static final String SID = "管理画面から発行されるネイティブ(APP)のアイコン画像テキスト型のsidを設定してください" ; @ Override protected void onCreate ( Bundle savedInstanceState ) { super . onCreate ( savedInstanceState ) ; setContentView ( activity_main ) ; AMoAdLogger . getInstance ( ) . setEnabled ( true ) ; AMoAdLogger . getInstance ( ) . addAMoAdLoggerListener ( new AMoAdLoggerListener ( ) { @ Override public void onLog ( int level , String tag , String msg , Throwable throwable ) { } } ) ; AMoAdNativeViewManager . getInstance ( this ) . prepareAd ( MainActivity . SID , MainActivity . TAG1 , true ) ; <START_BUG> AMoAdNativeViewManager . getInstance ( this ) . prepareAd ( MainActivity . SID , MainActivity . TAG2 , true ) ; <END_BUG> ViewGroup containe = ( ( ViewGroup ) ( findViewById ( container ) ) ) ; View adView = AMoAdNativeViewManager . getInstance ( this ) . createView ( MainActivity . SID , MainActivity . TAG1 , template , new AMoAdNativeFailureListener ( ) { @ Override public void onFailure ( String sid , String tag , View templateView ) { } } ) ; containe . addView ( adView ) ; View templateView = findViewById ( templateView ) ; AMoAdNativeViewManager . getInstance ( this ) . renderAd ( MainActivity . SID , MainActivity . TAG2 , templateView , new AMoAdNativeFailureListener ( ) { @ Override public void onFailure ( String sid , String tag , View templateView ) { } } ) ; } @ Override public boolean onCreateOptionsMenu ( Menu menu ) { } @ Override public boolean onOptionsItemSelected ( MenuItem item ) { } void update ( ) { } void clear ( ) { } }

Fix:
AMoAdNativeViewManager . getInstance ( this ) . prepareAd ( MainActivity . SID , MainActivity . TAG2 , false ) ;
Buggy code:
public class TabFolder extends Composite { int parentingHandle ; TabItem [ ] items ; int itemCount ; int currentIndex = OS . Pt_PG_INVALID ; public TabFolder ( Composite parent , int style ) { } static int checkStyle ( int style ) { } public void addSelectionListener ( SelectionListener listener ) { } 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 ( int index ) { } void createWidget ( int index ) { } void createItem ( TabItem item , int index ) { } void deregister ( ) { } void destroyItem ( TabItem item ) { } public Rectangle getClientArea ( ) { } public TabItem getItem ( int index ) { } public TabItem [ ] getItems ( ) { } public int getItemCount ( ) { } public TabItem [ ] getSelection ( ) { } public int getSelectionIndex ( ) { } void hookEvents ( ) { } public int indexOf ( TabItem item ) { } Point minimumSize ( int wHint , int hHint , boolean flushCache ) { } void moveToBack ( int child ) { } int parentingHandle ( ) { } int Pt_CB_PG_PANEL_SWITCHING ( int widget , int info ) { } int Pt_CB_REALIZED ( int widget , int info ) { } void register ( ) { } void releaseHandle ( ) { } void releaseChildren ( boolean destroy ) { if ( ( items ) != null ) { for ( int i = 0 ; i < ( itemCount ) ; i ++ ) { TabItem item = items [ i ] ; if ( ( item != null ) && ( ! ( item . isDisposed ( ) ) ) ) { <START_BUG> item . releaseChildren ( false ) ; <END_BUG> } } itemCount = 0 ; items = null ; } super . releaseChildren ( destroy ) ; } void removeControl ( Control control ) { } public void removeSelectionListener ( SelectionListener listener ) { } int setBounds ( int x , int y , int width , int height , boolean move , boolean resize , boolean events ) { } public void setSelection ( int index ) { } void setSelection ( int index , boolean notify ) { } public void setSelection ( TabItem [ ] items ) { } boolean traversePage ( boolean next ) { } int topHandle ( ) { } int widgetClass ( ) { } }

Fix:
item . release ( false ) ;
Buggy code:
public interface Bootstrap { AsyncFuture < ServiceContainer > bootstrap ( Bootstrap . Configuration configuration , List < ServiceActivator > extraServices ) { } AsyncFuture < ServiceContainer > startup ( Bootstrap . Configuration configuration , List < ServiceActivator > extraServices ) { } final class Configuration { private final ServerEnvironment serverEnvironment ; private final RunningModeControl runningModeControl ; private final ExtensionRegistry extensionRegistry ; private ModuleLoader moduleLoader = Module . getBootModuleLoader ( ) ; private Bootstrap . ConfigurationPersisterFactory configurationPersisterFactory ; private long startTime = Module . getStartTime ( ) ; public Configuration ( final ServerEnvironment serverEnvironment ) { } public void setPortOffset ( final int portOffset ) { } public ServerEnvironment getServerEnvironment ( ) { } RunningModeControl getRunningModeControl ( ) { } public ExtensionRegistry getExtensionRegistry ( ) { } public ModuleLoader getModuleLoader ( ) { } public void setModuleLoader ( final ModuleLoader moduleLoader ) { } public synchronized Bootstrap . ConfigurationPersisterFactory getConfigurationPersisterFactory ( ) { if ( ( configurationPersisterFactory ) == null ) { configurationPersisterFactory = new Bootstrap . ConfigurationPersisterFactory ( ) { @ Override public ExtensibleConfigurationPersister createConfigurationPersister ( ServerEnvironment serverEnvironment , ExecutorService executorService ) { QName rootElement = new QName ( CURRENT . getUriString ( ) , "server" ) ; StandaloneXml parser = new StandaloneXml ( Module . getBootModuleLoader ( ) , executorService , extensionRegistry ) ; BackupXmlConfigurationPersister persister = new BackupXmlConfigurationPersister ( serverEnvironment . getServerConfigurationFile ( ) , rootElement , parser , parser ) ; <START_BUG> for ( Namespace namespace : Namespace . values ( ) ) { <END_BUG> if ( ! ( namespace . equals ( CURRENT ) ) ) { persister . registerAdditionalRootElement ( new QName ( namespace . getUriString ( ) , "server" ) , parser ) ; } } extensionRegistry . setWriterRegistry ( persister ) ; return persister ; } } ; } return configurationPersisterFactory ; } public synchronized void setConfigurationPersisterFactory ( final Bootstrap . ConfigurationPersisterFactory configurationPersisterFactory ) { } public long getStartTime ( ) { } public void setStartTime ( final long startTime ) { } } interface ConfigurationPersisterFactory { ExtensibleConfigurationPersister createConfigurationPersister ( final ServerEnvironment serverEnvironment , final ExecutorService executorService ) { } } final class Factory { private Factory ( ) { } public static Bootstrap newInstance ( ) { } } }

Fix:
for ( Namespace namespace : Namespace . domainValues ( ) ) {
Buggy code:
public class ReplyCommand implements CommandExecutor { public boolean onCommand ( CommandSender sender , Command command , String label , String [ ] args ) { if ( ( args . length ) == 0 ) return false ; String message = StringHelper . join ( args , 0 ) ; WhisperChannel channel = WhisperManager . getLastReceivedWhisper ( ( ( Player ) ( sender ) ) ) ; if ( channel == null ) { channel = WhisperManager . getLastSentWhisper ( ( ( Player ) ( sender ) ) ) ; if ( channel == null ) { sender . sendMessage ( "A<seq2seq4repair_space>player<seq2seq4repair_space>must<seq2seq4repair_space>whisper<seq2seq4repair_space>you<seq2seq4repair_space>before<seq2seq4repair_space>you<seq2seq4repair_space>can<seq2seq4repair_space>reply." ) ; return true ; } } if ( ! ( channel . target ( ) . isOnline ( ) ) ) { <START_BUG> sender . sendMessage ( MessageFormat . format ( "{0}<seq2seq4repair_space>is<seq2seq4repair_space>no<seq2seq4repair_space>longer<seq2seq4repair_space>online." , channel . target ( ) ) ) ; <END_BUG> return true ; } if ( channel . setDefault ( ) ) { } channel . broadcast ( new Player [ ] { ( ( Player ) ( sender ) ) } , message ) ; return true ; } }

Fix:
sender . sendMessage ( MessageFormat . format ( "{0}<seq2seq4repair_space>is<seq2seq4repair_space>no<seq2seq4repair_space>longer<seq2seq4repair_space>online." , channel . target ( ) . getName ( ) ) ) ;
Buggy code:
@ GenerateNodeFactory public abstract class LessThanOrEqualPrim extends ArithmeticPrim { @ Specialization public final boolean doLong ( final long left , final long right ) { } @ Specialization public final boolean doBigInteger ( final BigInteger left , final BigInteger right ) { } @ Specialization public final boolean doDouble ( final double left , final double right ) { } @ Specialization public final boolean doLong ( final long left , final BigInteger right ) { } @ Specialization public final boolean doLong ( final long left , final double right ) { } @ Specialization public final boolean doBigInteger ( final BigInteger left , final long right ) { } @ Specialization public final boolean doDouble ( final double left , final long right ) { <START_BUG> return doDouble ( left , right ) ; <END_BUG> } }

Fix:
return doDouble ( left , ( ( double ) ( right ) ) ) ;
Buggy code:
public class DbEntityPropertiesTest extends DbTestCommons { @ Test public void testEntityProperties ( ) { checkProfileProperties ( IProfile . class ) ; IProfile profile = DbProxy . create ( IProfile . class ) ; checkProfileProperties ( profile . getClass ( ) ) ; ConcurrentMap < String , Object > map = U . concurrentMap ( "id" , ( ( Object ) ( 123L ) ) , "version" , ( ( Object ) ( 456 ) ) ) ; IPost post1 = DbProxy . create ( IPost . class , map ) ; post1 . content ( ) . set ( "abc" ) ; Map < String , Object > postProps = Beany . read ( post1 ) ; Map < String , Object > likes = U . map ( "relation" , "likes" , "ids" , U . set ( ) ) ; Map < String , Object > postedOn = U . map ( "relation" , "^posted" , "ids" , U . set ( ) ) ; eq ( postProps , U . map ( "id" , 123L , "version" , 456L , "likes" , likes , "postedOn" , postedOn , "content" , "abc" ) ) ; profile . posts ( ) . add ( post1 ) ; Map < String , Object > profileProps = Beany . read ( profile ) ; eq ( profileProps , U . map ( "id" , null , "version" , null , "posts" , U . map ( "relation" , "posted" , "ids" , U . list ( 123L ) ) ) ) ; IProfile profile2 = DB . create ( IProfile . class ) ; <START_BUG> Beany . update ( profileProps , profile2 ) ; <END_BUG> Map < String , Object > profileProps2 = Beany . read ( profile2 ) ; eq ( profileProps2 , profileProps ) ; } private void checkProfileProperties ( Class < ? > clazz ) { } }

Fix:
Beany . update ( profile2 , profileProps , false ) ;
Buggy code:
public class RegisterTest extends AbstractDistributionTest implements ServiceConstants { List registrations = new ArrayList ( ) ; protected void setUp ( ) throws Exception { } protected void tearDown ( ) throws Exception { } protected String getClientContainerName ( ) { } protected void registerConcatService ( Properties props ) throws Exception { } public void testRegisterAllRSContainers ( ) throws Exception { } public void testRegisterServerContainer ( ) throws Exception { Properties props = new Properties ( ) ; props . put ( OSGI_REMOTE_INTERFACES , new String [ ] { OSGI_REMOTE_INTERFACES_WILDCARD } ) ; props . put ( OSGI_REMOTE_CONFIGURATION_TYPE , new String [ ] { ECF_REMOTE_CONFIGURATION_TYPE } ) ; IContainer serverContainer = getServer ( ) ; <START_BUG> props . put ( REMOTE_SERVICE_CONTAINER_ID , serverContainer . getID ( ) ) ; <END_BUG> registerConcatService ( props ) ; } }

Fix:
props . put ( SERVICE_CONTAINER_ID , serverContainer . getID ( ) ) ;
Buggy code:
public class RunListResource extends BaseResource { public static final String TYPE = "type" ; public static final String REFQNAME = "refqname" ; public static final String MUTABLE_RUN_KEY = "mutable" ; public static final String IGNORE_ABORT_QUERY = "ignoreabort" ; String refqname = null ; @ Get ( "txt" ) public Representation toTxt ( ) { } @ Get ( "xml" ) public Representation toXml ( ) { } @ Get ( "html" ) public Representation toHtml ( ) { } private RunViewList getRunViewList ( ) { } @ Post ( "form|txt" ) public void createRun ( Representation entity ) throws SlipStreamException , FileNotFoundException , IOException , ClassNotFoundException , SQLException , ResourceException { } private void setLastExecute ( User user ) { } private void setRunMutability ( Run run , Form form ) { String mutable = form . getFirstValue ( RunListResource . MUTABLE_RUN_KEY , "" ) ; <START_BUG> if ( mutable . trim ( ) . equals ( "true" ) ) { <END_BUG> run . setMutable ( ) ; } } private void authorizePost ( Module module ) { } private void setReference ( Form form ) { } public static Map < String , List < Parameter < ? > > > getUserChoicesFromForm ( ModuleCategory category , Form form ) throws ValidationException { } private static boolean notUserChoiceForNode ( Map . Entry < String , String > entry ) { } private RunType parseType ( Form form ) { } private Run launch ( Run run ) throws SlipStreamException { } private Run addCredentials ( Run run ) throws ConfigurationException , ServerExecutionEnginePluginException , ValidationException { } private Credentials loadCredentialsObject ( ) throws ConfigurationException , ValidationException { } private void createRepositoryResource ( Run run ) throws ConfigurationException { } private Module loadReferenceModule ( ) throws ValidationException { } private void updateReference ( Module module ) { } @ Override protected String getPageRepresentation ( ) { } }

Fix:
if ( isTrue ( mutable ) ) {
Buggy code:
public class BaseActivity extends Activity implements Response . ErrorListener , Response . Listener { public static int SUCCESS = 1 ; @ Override protected void onCreate ( Bundle savedInstanceState ) { } public void fetchData ( String url , int action , String postData ) { } @ Override public void onResponse ( final Object o ) { } @ Override public void onErrorResponse ( final VolleyError error ) { runOnUiThread ( new Runnable ( ) { @ Override public void run ( ) { <START_BUG> String errorMsg = "" ; <END_BUG> if ( error instanceof NetworkError ) { errorMsg = "Network<seq2seq4repair_space>Connection<seq2seq4repair_space>is<seq2seq4repair_space>not<seq2seq4repair_space>available." ; } else if ( error instanceof ServerError ) { errorMsg = "Server<seq2seq4repair_space>Error" ; } else if ( error instanceof AuthFailureError ) { errorMsg = "Auth<seq2seq4repair_space>Error" ; } else if ( error instanceof ParseError ) { errorMsg = "Parsing<seq2seq4repair_space>Error" ; } else if ( error instanceof NoConnectionError ) { errorMsg = "No<seq2seq4repair_space>connection<seq2seq4repair_space>could<seq2seq4repair_space>be<seq2seq4repair_space>established." ; } else if ( error instanceof TimeoutError ) { errorMsg = "Network<seq2seq4repair_space>Connection<seq2seq4repair_space>Time<seq2seq4repair_space>out" ; } ServiceResponse response = new ServiceResponse ( ) ; response . setErrorCode ( 0 ) ; response . setErrorMsg ( errorMsg ) ; updateUi ( response ) ; } } ) ; } public void updateUi ( ServiceResponse response ) { } private ProgressDialog mProgressDialog ; public void showProgressDialog ( String bodyText ) { } public void removeProgressDialog ( ) { } public void showProgressDialog ( ) { } }

Fix:
String errorMsg = "Some<seq2seq4repair_space>thing<seq2seq4repair_space>went<seq2seq4repair_space>wrong." ;
Buggy code:
public class MapBasedSet < E > extends AbstractMapBasedSet < E > implements MutableSet < E > { protected MutableMap < E , Object > map ; public MapBasedSet ( MutableMap < E , ? extends Object > map ) { } @ Override protected Map < E , Object > map ( ) { } @ Override public MutableSet < E > $plus ( E element ) { } @ Override public MutableSet < E > $minus ( Object element ) { } @ Override public MutableSet < ? extends E > $minus$minus ( Collection < ? > collection ) { } @ Override public MutableSet < ? extends E > $amp ( Collection < ? extends E > collection ) { } @ Override public MutableSet < ? extends E > $bar ( Collection < ? extends E > collection ) { } @ Override public MutableSet < ? extends E > $up ( Collection < ? extends E > collection ) { } @ Override public < R > MutableSet < R > mapped ( Function < ? super E , ? extends R > mapper ) { } @ Override public < R > MutableSet < R > flatMapped ( Function < ? super E , ? extends Iterable < ? extends R > > mapper ) { } @ Override public MutableSet < E > filtered ( Predicate < ? super E > condition ) { } @ Override public void clear ( ) { } @ Override public boolean add ( E element ) { <START_BUG> return ( this . map . put ( element , VALUE ) ) != null ; <END_BUG> } @ Override public boolean remove ( Object element ) { } @ Override public void $amp$eq ( Collection < ? extends E > collection ) { } @ Override public void $bar$eq ( Collection < ? extends E > collection ) { } @ Override public void $up$eq ( Collection < ? extends E > collection ) { } @ Override public void map ( Function < ? super E , ? extends E > mapper ) { } @ Override public void flatMap ( Function < ? super E , ? extends Iterable < ? extends E > > mapper ) { } @ Override public void filter ( Predicate < ? super E > condition ) { } @ Override public MutableSet < E > copy ( ) { } @ Override public ImmutableSet < E > immutable ( ) { } }

Fix:
return ( this . map . put ( element , VALUE ) ) == null ;
Buggy code:
public class FileChunkUtilTest extends H2HJUnitTest { private static File parent ; @ BeforeClass public static void initTest ( ) throws Exception { } @ AfterClass public static void cleanAfterClass ( ) { } @ Test public void testGetNumberOfChunksRandom ( ) throws IOException { } @ Test public void testGetNumberOfChunksEmpty ( ) throws IOException { } @ Test public void testGetNumberOfChunksNotExisting ( ) { } @ Test public void testGetNumberOfChunksNull ( ) { } @ Test public void testGetNumberOfChunksSizeZero ( ) throws IOException { } @ Test public void testGetNumberOfChunksSizeNegative ( ) throws IOException { } @ Test public void testGetChunkRandom ( ) throws IOException { Random rnd = new Random ( ) ; for ( int i = 0 ; i < 10 ; i ++ ) { <START_BUG> int genNOC = ( rnd . nextInt ( 100 ) ) + 1 ; <END_BUG> File randomFile = FileTestUtil . createFileRandomContent ( genNOC , FileChunkUtilTest . parent ) ; int chosenChunk = rnd . nextInt ( ( genNOC - 1 ) ) ; Chunk chunk = FileChunkUtil . getChunk ( randomFile , CHUNK_SIZE , chosenChunk , randomString ( ) ) ; assertEquals ( CHUNK_SIZE , chunk . getSize ( ) ) ; assertEquals ( chosenChunk , chunk . getOrder ( ) ) ; int lastChunkIndex = genNOC - 1 ; chunk = FileChunkUtil . getChunk ( randomFile , CHUNK_SIZE , lastChunkIndex , randomString ( ) ) ; assertTrue ( ( ( TestFileConfiguration . CHUNK_SIZE ) > ( chunk . getSize ( ) ) ) ) ; assertEquals ( lastChunkIndex , chunk . getOrder ( ) ) ; randomFile . deleteOnExit ( ) ; } } @ Test public void testGetChunkEmpty ( ) throws IOException { } @ Test ( expected = IOException . class ) public void testGetChunkNotExisting ( ) throws IOException { } @ Test ( expected = IOException . class ) public void testGetChunkNull ( ) throws IOException { } @ Test ( expected = IOException . class ) public void testGetChunkNegativeChunkSize ( ) throws IOException { } @ Test ( expected = IOException . class ) public void testGetChunkNegativeOrderNumber ( ) throws IOException { } @ Test public void testGetChunkTooHighIndex ( ) throws IOException { } }

Fix:
int genNOC = ( rnd . nextInt ( 100 ) ) + 2 ;
Buggy code:
public final class AutoComponentResolver implements IComponentResolver { private static final long serialVersionUID = 1L ; private final Map < Component , Object > nestedComponents = new HashMap < Component , Object > ( ) ; public final boolean resolve ( final MarkupContainer container , final MarkupStream markupStream , final ComponentTag tag ) { if ( tag . isWicketTag ( ) ) { if ( tag . isComponentTag ( ) ) { final Component component = createComponent ( container , tag ) ; if ( component != null ) { nestedComponents . put ( component , null ) ; try { <START_BUG> component . autoAdded ( ) ; <END_BUG> } finally { nestedComponents . remove ( component ) ; } return true ; } } } if ( ( ( tag . getId ( ) ) != null ) && ( nestedComponents . containsKey ( container ) ) ) { MarkupContainer parent = container . getParent ( ) ; while ( ( parent != null ) && ( nestedComponents . containsKey ( parent ) ) ) { parent = parent . getParent ( ) ; } if ( parent != null ) { final Component component = parent . get ( tag . getId ( ) ) ; if ( component != null ) { component . render ( markupStream ) ; return true ; } } } return false ; } private final Component createComponent ( final MarkupContainer container , final ComponentTag tag ) { } }

Fix:
component . render ( markupStream ) ;
Buggy code:
public class PhysicsActor extends Actor { protected Sprite sprite ; protected Body body ; protected Fixture fixture ; public void initPhysics ( World world , PolygonShape shape , float x , float y , boolean isDynamic ) { } public void initPhysics ( World world , PolygonShape shape , float x , float y ) { } public void initPhysicsAsBox ( World world , float x , float y , boolean isDynamic ) { sprite . setSize ( ( ( sprite . getWidth ( ) ) // ( GameScreen . PIXEL_PER_METER ) ) , ( ( sprite . getHeight ( ) ) // ( GameScreen . PIXEL_PER_METER ) ) ) ; PolygonShape shape = new PolygonShape ( ) ; <START_BUG> shape . setAsBox ( sprite . getWidth ( ) , sprite . getHeight ( ) ) ; <END_BUG> initPhysics ( world , shape , x , y , isDynamic ) ; } @ Override public void draw ( Batch batch , float parentAlpha ) { } }

Fix:
shape . setAsBox ( ( ( sprite . getWidth ( ) ) // 2.0F ) , ( ( sprite . getHeight ( ) ) // 2.0F ) , new com . badlogic . gdx . math . Vector2 ( ( ( sprite . getWidth ( ) ) // 2.0F ) , ( ( sprite . getHeight ( ) ) // 2.0F ) ) , 0 ) ;
Buggy code:
public abstract class ClasspathLocation { static ClasspathLocation forSourceFolder ( IContainer sourceFolder , IContainer outputFolder , char [ ] [ ] inclusionPatterns , char [ ] [ ] exclusionPatterns ) { } public static ClasspathLocation forBinaryFolder ( IContainer binaryFolder , boolean isOutputFolder , AccessRuleSet accessRuleSet ) { } static ClasspathLocation forLibrary ( String libraryPathname , long lastModified , AccessRuleSet accessRuleSet ) { <START_BUG> return new ClasspathJar ( libraryPathname , accessRuleSet ) ; <END_BUG> } static ClasspathLocation forLibrary ( String libraryPathname , AccessRuleSet accessRuleSet ) { } static ClasspathLocation forLibrary ( IFile library , AccessRuleSet accessRuleSet ) { } public abstract NameEnvironmentAnswer findClass ( String binaryFileName , String qualifiedPackageName , String qualifiedBinaryFileName ) { } public abstract IPath getProjectRelativePath ( ) { } public boolean isOutputFolder ( ) { } public abstract boolean isPackage ( String qualifiedPackageName ) { } public void cleanup ( ) { } public void reset ( ) { } public abstract String debugPathString ( ) { } }

Fix:
return new ClasspathJar ( libraryPathname , lastModified , accessRuleSet ) ;
Buggy code:
public final class Yank { private static final YankPoolManager YANK_POOL_MANAGER = YankPoolManager . INSTANCE ; private static Logger logger = LoggerFactory . getLogger ( Yank . class ) ; private static final String BEAN_EXCEPTION_MESSAGE = "Error<seq2seq4repair_space>converting<seq2seq4repair_space>row<seq2seq4repair_space>to<seq2seq4repair_space>bean!!<seq2seq4repair_space>Make<seq2seq4repair_space>sure<seq2seq4repair_space>you<seq2seq4repair_space>have<seq2seq4repair_space>a<seq2seq4repair_space>default<seq2seq4repair_space>no-args<seq2seq4repair_space>constructor!" ; private static final String QUERY_EXCEPTION_MESSAGE = "Error<seq2seq4repair_space>in<seq2seq4repair_space>SQL<seq2seq4repair_space>query!!!" ; private Yank ( ) { } public static Long insertSQLKey ( String sqlKey , Object [ ] params ) { } public static Long insert ( String sql , Object [ ] params ) { } public static int executeSQLKey ( String sqlKey , Object [ ] params ) { } public static int execute ( String sql , Object [ ] params ) { } public static < T > T queryScalarSQLKey ( String sqlKey , Class < T > scalarType , Object [ ] params ) { String sql = Yank . YANK_POOL_MANAGER . getMergedSqlProperties ( ) . getProperty ( sqlKey ) ; if ( ( sql == null ) || ( sql . equalsIgnoreCase ( "" ) ) ) { throw new SQLStatementNotFoundException ( ) ; } else { <START_BUG> return Yank . queryBean ( sql , scalarType , params ) ; <END_BUG> } } public static < T > T queryScalar ( String sql , Class < T > scalarType , Object [ ] params ) { } public static < T > T queryBeanSQLKey ( String sqlKey , Class < T > beanType , Object [ ] params ) { } public static < T > T queryBean ( String sql , Class < T > beanType , Object [ ] params ) { } public static < T > List < T > queryBeanListSQLKey ( String sqlKey , Class < T > beanType , Object [ ] params ) { } public static < T > List < T > queryBeanList ( String sql , Class < T > beanType , Object [ ] params ) { } public static < T > List < T > queryColumnSQLKey ( String sqlKey , String columnName , Class < T > columnType , Object [ ] params ) { } public static < T > List < T > queryColumn ( String sql , String columnName , Class < T > columnType , Object [ ] params ) { } public static List < Object [ ] > queryObjectArraysSQLKey ( String sqlKey , Object [ ] params ) { } public static List < Object [ ] > queryObjectArrays ( String sql , Object [ ] params ) { } public static int [ ] executeBatchSQLKey ( String sqlKey , Object [ ] [ ] params ) { } public static int [ ] executeBatch ( String sql , Object [ ] [ ] params ) { } private static void handleSQLException ( SQLException e ) { } public static void setupDataSource ( Properties dataSourceProperties ) { } public static void addSQLStatements ( Properties sqlProperties ) { } public static synchronized void releaseDataSource ( ) { } public static HikariDataSource getDataSource ( ) { } }

Fix:
return Yank . queryScalar ( sql , scalarType , params ) ;
Buggy code:
public class SkillBlockListener implements Listener { public SkillBlockListener ( ) { } <START_BUG> @ EventHandler ( priority = EventPriority . NORMAL ) <END_BUG> public void onBlockBreak ( BlockBreakEvent event ) { if ( event . isCancelled ( ) ) { return ; } for ( SkillBase base : SkillManager . getSkills ( ) ) { if ( SkillsSettings . isDebug ( ) ) { System . out . println ( ( ( ( "Checking<seq2seq4repair_space>" + ( base . getSkillName ( ) ) ) + "<seq2seq4repair_space>-><seq2seq4repair_space>" ) + ( base instanceof SkillBlockBase ) ) ) ; } if ( base instanceof SkillBlockBase ) { SkillBlockBase s = ( ( SkillBlockBase ) ( base ) ) ; if ( ! ( s . isEnabled ( ) ) ) { continue ; } handleSkill ( s , event ) ; } } } private void handleSkill ( SkillBlockBase s , BlockBreakEvent event ) { } }

Fix:
@ EventHandler ( priority = EventPriority . HIGHEST )
Buggy code:
@ SuppressWarnings ( "unused" ) public class myTests { sortingAlgorithms sortObject = new sortingAlgorithms ( ) ; int [ ] worstCase50 = new int [ 50 ] ; int [ ] worstCase500 = new int [ 500 ] ; int [ ] worstCase5000 = new int [ 5000 ] ; int [ ] worstCase50000 = new int [ 50000 ] ; int [ ] worstCase100000 = new int [ 100000 ] ; int [ ] worstCase250000 = new int [ 250000 ] ; int [ ] worstCase500000 = new int [ 500000 ] ; int [ ] randomCase50 = new int [ 50 ] ; int [ ] randomCase500 = new int [ 500 ] ; int [ ] randomCase5000 = new int [ 5000 ] ; int [ ] randomCase50000 = new int [ 50000 ] ; int [ ] randomCase100000 = new int [ 100000 ] ; int [ ] randomCase250000 = new int [ 250000 ] ; int [ ] randomCase500000 = new int [ 500000 ] ; public boolean isSorted ( int [ ] arr ) { } public void shuffleArray ( int [ ] arr ) { Random rnd = new Random ( ) ; <START_BUG> for ( int i = arr . length ; i > 0 ; i -- ) { <END_BUG> int index = rnd . nextInt ( ( i + 1 ) ) ; int blah = arr [ index ] ; arr [ index ] = arr [ i ] ; arr [ i ] = blah ; } } @ Test public void setUpArrays ( ) { } @ Test public void worstCaseInsertion1 ( ) { } @ Test public void worstCaseInsertion2 ( ) { } @ Test public void worstCaseInsertion3 ( ) { } @ Test public void worstCaseInsertion4 ( ) { } @ Test public void worstCaseInsertion5 ( ) { } @ Test public void worstCaseInsertion6 ( ) { } @ Test public void worstCaseInsertion7 ( ) { } @ Test public void worstCaseSelection1 ( ) { } @ Test public void worstCaseSelection2 ( ) { } @ Test public void worstCaseSelection3 ( ) { } @ Test public void worstCaseSelection4 ( ) { } @ Test public void worstCaseSelection5 ( ) { } @ Test public void worstCaseSelection6 ( ) { } @ Test public void worstCaseSelection7 ( ) { } }

Fix:
for ( int i = ( arr . length ) - 1 ; i > 0 ; i -- ) {
Buggy code:
public class QueueList implements SchedulerQueue { private LinkedList < SchedulerJob > list = new LinkedList < > ( ) ; @ Override public List < SchedulerJob > removeJobs ( long toTime ) { } @ Override public void doSchedule ( SchedulerJob schedulerJob ) { long time = schedulerJob . getScheduledTime ( ) ; if ( time <= 0 ) return ; synchronized ( this ) { Iterator < SchedulerJob > iter = list . iterator ( ) ; int pos = 0 ; while ( iter . hasNext ( ) ) { SchedulerJob item = iter . next ( ) ; <START_BUG> if ( ( item . getNextExecutionTime ( ) ) >= time ) { <END_BUG> list . add ( pos , schedulerJob ) ; return ; } pos ++ ; } list . add ( schedulerJob ) ; } } @ Override public void removeJob ( SchedulerJob job ) { } @ Override public int size ( ) { } @ Override public List < SchedulerJob > getJobs ( ) { } }

Fix:
if ( ( item . getScheduledTime ( ) ) >= time ) {
Buggy code:
public class Rover extends Movable { private List < Projectile > projectiles ; public Rover ( Mars mars ) throws CrashException { } public Rover ( final Mars mars , final Point landingPoint ) throws CrashException { } private void landOnMars ( Point landingPoint ) throws CrashException { } public boolean fireProjectile ( final Class < ? extends Projectile > type ) { Projectile projectileToFire = Iterables . get ( Collections2 . filter ( projectiles , new Predicate < Projectile > ( ) { @ Override public boolean apply ( Projectile input ) { return input . getClass ( ) . isAssignableFrom ( type ) ; } <START_BUG> } ) , 1 , null ) ; <END_BUG> if ( projectileToFire == null ) { return false ; } projectileToFire . launch ( getFacing ( ) , getLocation ( ) ) ; projectiles . remove ( projectileToFire ) ; return true ; } }

Fix:
} ) , 0 , null ) ;