nus-yam/ex-repair huggingface dataset:
Buggy code:
public class ICMPv6Analyzer extends PacketAnalyzer { public static final byte ICMPv6_DISPATCH = 58 ; public static final int ECHO_REQUEST = 128 ; public static final int ECHO_REPLY = 129 ; public static final int GROUP_QUERY = 130 ; public static final int GROUP_REPORT = 131 ; public static final int GROUP_REDUCTION = 132 ; public static final int ROUTER_SOLICITATION = 133 ; public static final int ROUTER_ADVERTISEMENT = 134 ; public static final int NEIGHBOR_SOLICITATION = 135 ; public static final int NEIGHBOR_ADVERTISEMENT = 136 ; public static final int RPL_CODE_DIS = 0 ; public static final int RPL_CODE_DIO = 1 ; public static final int RPL_CODE_DAO = 2 ; public static final int RPL_CODE_DAO_ACK = 3 ; public static final int FLAG_ROUTER = 128 ; public static final int FLAG_SOLICITED = 64 ; public static final int FLAG_OVERRIDE = 32 ; public static final int ON_LINK = 128 ; public static final int AUTOCONFIG = 64 ; public static final int SOURCE_LINKADDR = 1 ; public static final int TARGET_LINKADDR = 2 ; public static final int PREFIX_INFO = 3 ; public static final int MTU_INFO = 5 ; public static final String [ ] TYPE_NAME = new String [ ] { "ECHO_REQUEST" , "ECHO_REPLY" , "GROUP_QUERY" , "GROUP_REPORT" , "GROUP_REDUCTION" , "ROUTER_SOLICITATION" , "ROUTER_ADVERTISEMENT" , "NEIGHBOR_SOLICITATION" , "NEIGHBOR_ADVERTISEMENT" , "REDIRECT" , "ROUTER<seq2seq4repair_space>RENUMBER" , "NODE<seq2seq4repair_space>INFORMATION<seq2seq4repair_space>QUERY" , "NODE<seq2seq4repair_space>INFORMATION<seq2seq4repair_space>RESPONSE" } ; public int analyzePacket ( Packet packet , StringBuffer brief , StringBuffer verbose ) { } @ Override public boolean matchPacket ( Packet packet ) { <START_BUG> return ( ( packet . level ) == ( NETWORK_LEVEL ) ) && ( ( packet . lastDispatch ) == ( ICMPv6Analyzer . ICMPv6_DISPATCH ) ) ; <END_BUG> } }

Fix:
return ( ( packet . level ) == ( APPLICATION_LEVEL ) ) && ( ( packet . lastDispatch ) == ( ICMPv6Analyzer . ICMPv6_DISPATCH ) ) ;
Buggy code:
public abstract class AbstractLocationResolver implements LocationResolver { public LocationType parseServiceLocationType ( String link ) throws Exception { } public Boolean isWMS ( String link ) { } public Boolean isWFS ( String link ) { } public Boolean isWCS ( String link ) { } public Boolean isArcGISRest ( String link ) { <START_BUG> if ( link . toLowerCase ( ) . contains ( "ArcGIS//rest" ) ) { <END_BUG> return true ; } else { return false ; } } public Boolean isFile ( String link ) { } public abstract Set < LocationLink > resolveLocation ( Document xmlDocument ) { } }

Fix:
if ( link . toLowerCase ( ) . contains ( "arcgis//rest" ) ) {
Buggy code:
public class BaseDataSourceAddHandler extends BaseOperationCommand { private final String dsType ; private final ArgumentWithValue profile ; private final ArgumentWithValue jndiName ; public BaseDataSourceAddHandler ( String commandName , String dsType ) { } @ Override public ModelNode buildRequest ( CommandContext ctx ) throws CommandFormatException { DefaultOperationRequestBuilder builder = new DefaultOperationRequestBuilder ( ) ; ParsedArguments args = ctx . getParsedArguments ( ) ; if ( ctx . isDomainMode ( ) ) { String profile = this . profile . getValue ( args ) ; if ( profile == null ) { throw new OperationFormatException ( "--profile<seq2seq4repair_space>argument<seq2seq4repair_space>value<seq2seq4repair_space>is<seq2seq4repair_space>missing." ) ; } builder . addNode ( "profile" , profile ) ; } builder . addNode ( "subsystem" , "datasources" ) ; builder . addNode ( dsType , jndiName . getValue ( args , true ) ) ; builder . setOperationName ( "add" ) ; <START_BUG> setParams ( args , builder . getModelNode ( ) ) ; <END_BUG> return builder . buildRequest ( ) ; } private void initArguments ( ) { } protected ArgumentWithoutValue initRequiredArguments ( ) { } protected void initOptionalArguments ( ArgumentWithoutValue lastRequired ) { } }

Fix:
setParams ( ctx , builder . getModelNode ( ) ) ;
Buggy code:
public class ClosePerspectiveAction extends Action { private WorkbenchWindow window ; public ClosePerspectiveAction ( WorkbenchWindow window ) { } public void run ( ) { WorkbenchPage page = ( ( WorkbenchPage ) ( window . getActivePage ( ) ) ) ; if ( page != null ) { Perspective persp = page . getActivePerspective ( ) ; if ( persp != null ) <START_BUG> page . closePerspective ( persp , true ) ; <END_BUG> } } }

Fix:
page . closePerspective ( persp , true , true ) ;
Buggy code:
public class PaymentForms extends Forms { String title ; JButton cancel = null ; JButton ok = null ; JTextField price = null ; JLabel fieldName = null ; SelfCalc valueDB = null ; double adRemValue = 0.0 ; public PaymentForms ( String title_ ) { } @ Override public void generateGui ( ) { } @ Override public void generatePanels ( GridBagConstraints c ) { } public Double getAddRemoValue ( ) { } public class SetMoney implements ActionListener { @ Override public void actionPerformed ( ActionEvent e ) { float currVal = valueDB . getValue ( ) ; String value = price . getText ( ) ; <START_BUG> String pattern = "[(\\d*)[.]?\\d{1,2}]{1,10}" ; <END_BUG> Pattern replace = Pattern . compile ( pattern ) ; Matcher matcher = replace . matcher ( value ) ; if ( matcher . matches ( ) ) { float floatValue = Float . parseFloat ( value ) ; adRemValue = floatValue ; if ( title . equals ( "Wypłata" ) ) { if ( currVal > floatValue ) { currVal -= floatValue ; valueDB . setValue ( currVal ) ; valueDB . updateValue ( ) ; } else { JOptionPane . showMessageDialog ( formFrame , "Podana<seq2seq4repair_space>kwoata<seq2seq4repair_space>jest<seq2seq4repair_space>zbyt<seq2seq4repair_space>wysoka" , "Nie<seq2seq4repair_space>można<seq2seq4repair_space>wypłacić<seq2seq4repair_space>pieniędzy" , JOptionPane . ERROR_MESSAGE ) ; } } else { currVal += floatValue ; valueDB . setValue ( currVal ) ; valueDB . updateValue ( ) ; } MainMMenu . money . setText ( ( currVal + "zł" ) ) ; formFrame . dispose ( ) ; } else { JOptionPane . showMessageDialog ( formFrame , ( "Wartość<seq2seq4repair_space>musi<seq2seq4repair_space>być<seq2seq4repair_space>podana<seq2seq4repair_space>w<seq2seq4repair_space>postaci<seq2seq4repair_space>liczbowej<seq2seq4repair_space>np.<seq2seq4repair_space>100,<seq2seq4repair_space>99,99,<seq2seq4repair_space>" + "lub<seq2seq4repair_space>podana<seq2seq4repair_space>kwaota<seq2seq4repair_space>jest<seq2seq4repair_space>za<seq2seq4repair_space>duża" ) , "Zostało<seq2seq4repair_space>podane<seq2seq4repair_space>nieprawidłowe<seq2seq4repair_space>dane" , JOptionPane . ERROR_MESSAGE ) ; price . setText ( "" ) ; } } } public class CloseForm implements ActionListener { @ Override public void actionPerformed ( ActionEvent e ) { formFrame . dispose ( ) ; } } }

Fix:
String pattern = "[(\\d*)[.]?\\d{1,2}]{1,7}" ;
Buggy code:
public final class TruePredicate < T > implements Serializable , Predicate < T > { private static final long serialVersionUID = 3374767158756189740L ; public static final Predicate < ? > INSTANCE = new TruePredicate < Object > ( ) ; @ SuppressWarnings ( "unchecked" ) public static < T > Predicate < T > truePredicate ( ) { } private TruePredicate ( ) { } <START_BUG> public boolean evaluate ( T object ) { <END_BUG> return true ; } private Object readResolve ( ) { } }

Fix:
public boolean evaluate ( final T object ) {
Buggy code:
public class IndexMergeTool { public static void main ( String [ ] args ) throws IOException { if ( ( args . length ) < 3 ) { System . err . println ( "Usage:<seq2seq4repair_space>IndexMergeTool<seq2seq4repair_space><mergedIndex><seq2seq4repair_space><index1><seq2seq4repair_space><index2><seq2seq4repair_space>[index3]<seq2seq4repair_space>..." ) ; System . exit ( 1 ) ; } FSDirectory mergedIndex = FSDirectory . open ( new File ( args [ 0 ] ) ) ; IndexWriter writer = new IndexWriter ( mergedIndex , new org . apache . lucene . index . IndexWriterConfig ( Version . LUCENE_CURRENT , null ) . setOpenMode ( CREATE ) ) ; Directory [ ] indexes = new Directory [ ( args . length ) - 1 ] ; for ( int i = 1 ; i < ( args . length ) ; i ++ ) { indexes [ ( i - 1 ) ] = FSDirectory . open ( new File ( args [ i ] ) ) ; } System . out . println ( "Merging..." ) ; writer . addIndexes ( indexes ) ; System . out . println ( "Full<seq2seq4repair_space>merge..." ) ; writer . forceMerge ( 1 ) ; <START_BUG> writer . close ( ) ; <END_BUG> System . out . println ( "Done." ) ; } }

Fix:
writer . shutdown ( ) ;
Buggy code:
public class MemoryIndex { public int NUM_CHANGES = 100 ; SimpleLookupTable docsToReferences ; SimpleWordSet allWords ; MemoryIndex ( ) { } void addDocumentNames ( String substring , SimpleSet results ) { } void addIndexEntry ( char [ ] category , char [ ] key , String documentName ) { } HashtableOfObject addQueryResults ( char [ ] [ ] categories , char [ ] key , int matchRule , HashtableOfObject results ) { Object [ ] paths = this . docsToReferences . keyTable ; Object [ ] referenceTables = this . docsToReferences . valueTable ; <START_BUG> if ( ( matchRule == ( ( SearchPattern . R_EXACT_MATCH ) + ( SearchPattern . R_CASE_SENSITIVE ) ) ) && ( key != null ) ) { <END_BUG> nextPath : for ( int i = 0 , l = referenceTables . length ; i < l ; i ++ ) { HashtableOfObject categoryToWords = ( ( HashtableOfObject ) ( referenceTables [ i ] ) ) ; if ( categoryToWords != null ) { for ( int j = 0 , m = categories . length ; j < m ; j ++ ) { SimpleWordSet wordSet = ( ( SimpleWordSet ) ( categoryToWords . get ( categories [ j ] ) ) ) ; if ( ( wordSet != null ) && ( wordSet . includes ( key ) ) ) { if ( results == null ) results = new HashtableOfObject ( 13 ) ; EntryResult result = ( ( EntryResult ) ( results . get ( key ) ) ) ; if ( result == null ) results . put ( key , ( result = new EntryResult ( key , null ) ) ) ; result . addDocumentName ( ( ( String ) ( paths [ i ] ) ) ) ; continue nextPath ; } } } } } else { for ( int i = 0 , l = referenceTables . length ; i < l ; i ++ ) { HashtableOfObject categoryToWords = ( ( HashtableOfObject ) ( referenceTables [ i ] ) ) ; if ( categoryToWords != null ) { for ( int j = 0 , m = categories . length ; j < m ; j ++ ) { SimpleWordSet wordSet = ( ( SimpleWordSet ) ( categoryToWords . get ( categories [ j ] ) ) ) ; if ( wordSet != null ) { char [ ] [ ] words = wordSet . words ; for ( int k = 0 , n = words . length ; k < n ; k ++ ) { char [ ] word = words [ k ] ; if ( ( word != null ) && ( Index . isMatch ( key , word , matchRule ) ) ) { if ( results == null ) results = new HashtableOfObject ( 13 ) ; EntryResult result = ( ( EntryResult ) ( results . get ( word ) ) ) ; if ( result == null ) results . put ( word , ( result = new EntryResult ( word , null ) ) ) ; result . addDocumentName ( ( ( String ) ( paths [ i ] ) ) ) ; } } } } } } } return results ; } boolean hasChanged ( ) { } void remove ( String documentName ) { } boolean shouldMerge ( ) { } }

Fix:
if ( ( matchRule == ( ( SearchPattern . R_EXACT_MATCH ) | ( SearchPattern . R_CASE_SENSITIVE ) ) ) && ( key != null ) ) {
Buggy code:
public class ModClusterRefresh implements OperationStepHandler , DescriptionProvider { static final ModClusterRefresh INSTANCE = new ModClusterRefresh ( ) ; @ Override public ModelNode getModelDescription ( Locale locale ) { } @ Override public void execute ( OperationContext context , ModelNode operation ) throws OperationFailedException { <START_BUG> if ( context . getProcessType ( ) . isServer ( ) ) { <END_BUG> context . addStep ( new OperationStepHandler ( ) { @ Override public void execute ( OperationContext context , ModelNode operation ) throws OperationFailedException { ServiceController < ? > controller = context . getServiceRegistry ( false ) . getService ( NAME ) ; ModCluster modcluster = ( ( ModCluster ) ( controller . getValue ( ) ) ) ; modcluster . refresh ( ) ; context . completeStep ( ) ; } } , RUNTIME ) ; } context . completeStep ( ) ; } }

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

Fix:
OS . objc_msgSend_struct ( result , this . id , sel_sizeValue ) ;
Buggy code:
public class ClientApplication { public static final int DEFAULT_WAITTIME = 40000 ; public static final int DEFAULT_TIMEOUT = TCPServerSOContainer . DEFAULT_KEEPALIVE ; public static final String CONNECTION_NAME = Client . class . getName ( ) ; public static final String CONNECTION_CLASS = Creator . class . getName ( ) ; public static final String CONTAINER_FACTORY_NAME = ContainerInstantiator . class . getName ( ) ; public static final String CONTAINER_FACTORY_CLASS = ClientApplication . CONTAINER_FACTORY_NAME ; public static final String COMPOSENT_CONTAINER_NAME = ContainerInstantiator . class . getName ( ) ; static int clientCount = 1 ; ISharedObjectContainer [ ] sm = new ISharedObjectContainer [ ClientApplication . clientCount ] ; String serverName = null ; String [ ] sharedObjectClassNames = null ; ID [ ] sharedObjects = null ; static ContainerTypeDescription contd = null ; static Random aRan = new Random ( ) ; public ClientApplication ( ) { } public void init ( String [ ] args ) throws Exception { serverName = TCPServerSOContainer . getDefaultServerURL ( ) ; if ( ( args . length ) > 0 ) { if ( ! ( args [ 0 ] . equals ( "-" ) ) ) serverName = args [ 0 ] ; } if ( ( args . length ) > 1 ) { sharedObjectClassNames = new String [ ( args . length ) - 1 ] ; for ( int i = 0 ; i < ( ( args . length ) - 1 ) ; i ++ ) { sharedObjectClassNames [ i ] = args [ ( i + 1 ) ] ; } } ConnectionTypeDescription cd = new ConnectionTypeDescription ( ClientApplication . class . getClassLoader ( ) , ClientApplication . CONNECTION_NAME , ClientApplication . CONNECTION_CLASS , null ) ; <START_BUG> ConnectionFactory . addDescription ( cd ) ; <END_BUG> ClientApplication . contd = new ContainerTypeDescription ( ClientApplication . class . getClassLoader ( ) , ClientApplication . CONTAINER_FACTORY_NAME , ClientApplication . CONTAINER_FACTORY_CLASS , null ) ; ContainerFactory . getDefault ( ) . addDescription ( ClientApplication . contd ) ; for ( int i = 0 ; i < ( ClientApplication . clientCount ) ; i ++ ) { sm [ i ] = createClient ( ) ; } } protected ISharedObjectContainer createClient ( ) throws Exception { } public void connect ( ID server ) throws Exception { } public void disconnect ( ) { } public void createSharedObjects ( ) throws Exception { } public void removeSharedObjects ( ) throws Exception { } public static void main ( String [ ] args ) throws Exception { } }

Fix:
ConnectionFactory . getDefault ( ) . addDescription ( cd ) ;
Buggy code:
public class AsyncAppender extends AppenderSkeleton implements AppenderAttachable { public static final int DEFAULT_BUFFER_SIZE = 128 ; private BoundedFIFO bf = new BoundedFIFO ( AsyncAppender . DEFAULT_BUFFER_SIZE ) ; AppenderAttachableImpl aai ; private Dispatcher dispatcher ; private boolean locationInfo = false ; private boolean interruptedWarningMessage = false ; public AsyncAppender ( ) { } public void addAppender ( Appender newAppender ) { } public void append ( LoggingEvent event ) { event . getNDC ( ) ; event . getThreadName ( ) ; <START_BUG> event . createProperties ( ) ; <END_BUG> if ( locationInfo ) { event . getLocationInformation ( ) ; } synchronized ( bf ) { while ( bf . isFull ( ) ) { try { bf . wait ( ) ; } catch ( InterruptedException e ) { if ( ! ( interruptedWarningMessage ) ) { interruptedWarningMessage = true ; LogLog . warn ( "AsyncAppender<seq2seq4repair_space>interrupted." , e ) ; } else { LogLog . warn ( "AsyncAppender<seq2seq4repair_space>interrupted<seq2seq4repair_space>again." ) ; } } } bf . put ( event ) ; if ( bf . wasEmpty ( ) ) { bf . notify ( ) ; } } } public void close ( ) { } public Enumeration getAllAppenders ( ) { } public Appender getAppender ( String name ) { } public boolean getLocationInfo ( ) { } public boolean isAttached ( Appender appender ) { } public boolean requiresLayout ( ) { } public void removeAllAppenders ( ) { } public void removeAppender ( Appender appender ) { } public void removeAppender ( String name ) { } public void setLocationInfo ( boolean flag ) { } public void setBufferSize ( int size ) { } public int getBufferSize ( ) { } }

Fix:
event . initializeProperties ( ) ;
Buggy code:
public class ParametersSerializer { private static final Mirror MIRROR = new Mirror ( ) ; private static final Matcher < Field > ONLY_INSTANCE_FIELDS_MAPPER = new Matcher < Field > ( ) { @ Override public boolean accepts ( Field field ) { } } ; public static Map < String , Object > paramsFor ( Object object , String name ) throws IllegalAccessException , NoSuchMethodException , InvocationTargetException { } private static Map < String , Object > serializedList ( List < ? > list , String name ) throws IllegalAccessException , NoSuchMethodException , InvocationTargetException { } private static Map < String , Object > mapForValue ( String name , Object value ) throws IllegalAccessException , NoSuchMethodException , InvocationTargetException { } private static boolean isEnum ( Object object ) { } private static boolean isList ( Object object ) { } private static Map < String , Object > simpleMapForValue ( Object object , String name ) { } private static String paramName ( String name , Field f ) { } private static Object fieldValue ( Object object , Field f ) { } private static List < Field > fieldsFrom ( Object object ) { } private static final HashSet < Class < ? > > WRAPPER_TYPES = ParametersSerializer . getWrapperTypes ( ) ; public static boolean isWrapperType ( Type clazz ) { } private static HashSet < Class < ? > > getWrapperTypes ( ) { HashSet < Class < ? > > ret = new HashSet < Class < ? > > ( ) ; ret . add ( Boolean . class ) ; ret . add ( Character . class ) ; ret . add ( Byte . class ) ; ret . add ( Short . class ) ; ret . add ( Integer . class ) ; ret . add ( Long . class ) ; ret . add ( Float . class ) ; ret . add ( Double . class ) ; ret . add ( Void . class ) ; ret . add ( String . class ) ; ret . add ( BigInteger . class ) ; ret . add ( BigDecimal . class ) ; <START_BUG> ret . add ( Data . class ) ; <END_BUG> ret . add ( int . class ) ; ret . add ( long . class ) ; ret . add ( double . class ) ; ret . add ( char . class ) ; return ret ; } }

Fix:
ret . add ( Date . class ) ;
Buggy code:
public class ModuleTaskTestCase extends AbstractTaskTestCase { @ Test public void testAddModule ( ) throws Exception { PatchInfo info = new org . jboss . as . patching . LocalPatchInfo ( TestUtils . randomString ( ) , PatchInfo . BASE , Collections . < String > emptyList ( ) , env ) ; String patchID = TestUtils . randomString ( ) ; File patchDir = TestUtils . mkdir ( tempDir , patchID ) ; String moduleName = TestUtils . randomString ( ) ; File moduleDir = TestUtils . createModule ( patchDir , moduleName ) ; byte [ ] newHash = HashUtils . hashFile ( moduleDir ) ; ContentModification moduleAdded = new ContentModification ( new ModuleItem ( moduleName , newHash ) , IoUtils . NO_CONTENT , ADD ) ; Patch patch = PatchBuilder . create ( ) . setPatchId ( patchID ) . setDescription ( TestUtils . randomString ( ) ) . setOneOffType ( info . getVersion ( ) ) . addContentModification ( moduleAdded ) . build ( ) ; TestUtils . createPatchXMLFile ( patchDir , patch ) ; File zippedPatch = TestUtils . createZippedPatchFile ( patchDir , patchID ) ; PatchingResult result = executePatch ( info , zippedPatch ) ; PatchingAssert . assertPatchHasBeenApplied ( result , patch ) ; File modulesPatchDir = env . getModulePatchDirectory ( patchID ) ; PatchingAssert . assertDirExists ( modulesPatchDir ) ; <START_BUG> TestUtils . tree ( result . getPatchInfo ( ) . getEnvironment ( ) . getInstalledImage ( ) . getJbossHome ( ) ) ; <END_BUG> PatchingAssert . assertContains ( modulesPatchDir , result . getPatchInfo ( ) . getModulePath ( ) ) ; PatchingAssert . assertDefinedModule ( result . getPatchInfo ( ) . getModulePath ( ) , moduleName , newHash ) ; } @ Test public void testRemoveModule ( ) throws Exception { } @ Test public void testUpdateModule ( ) throws Exception { } }

Fix:
TestUtils . tree ( env . getInstalledImage ( ) . getJbossHome ( ) ) ;
Buggy code:
public class TestKeywordAnalyzer extends BaseTokenStreamTestCase { private RAMDirectory directory ; private IndexSearcher searcher ; @ Override public void setUp ( ) throws Exception { } public void testPerFieldAnalyzer ( ) throws Exception { PerFieldAnalyzerWrapper analyzer = new PerFieldAnalyzerWrapper ( new SimpleAnalyzer ( ) ) ; analyzer . addAnalyzer ( "partnum" , new KeywordAnalyzer ( ) ) ; <START_BUG> QueryParser queryParser = new QueryParser ( Version . LUCENE_CURRENT , "description" , analyzer ) ; <END_BUG> Query query = queryParser . parse ( "partnum:Q36<seq2seq4repair_space>AND<seq2seq4repair_space>SPACE" ) ; ScoreDoc [ ] hits = searcher . search ( query , null , 1000 ) . scoreDocs ; assertEquals ( "Q36<seq2seq4repair_space>kept<seq2seq4repair_space>as-is" , "+partnum:Q36<seq2seq4repair_space>+space" , query . toString ( "description" ) ) ; assertEquals ( "doc<seq2seq4repair_space>found!" , 1 , hits . length ) ; } public void testMutipleDocument ( ) throws Exception { } public void testOffsets ( ) throws Exception { } }

Fix:
QueryParser queryParser = new QueryParser ( TEST_VERSION_CURRENT , "description" , analyzer ) ;
Buggy code:
public final class DoubleRange extends Range implements Serializable { private static final long serialVersionUID = 71849363892740L ; private final double min ; private final double max ; private transient Double minObject = null ; private transient Double maxObject = null ; private transient int hashCode = 0 ; private transient String toString = null ; public DoubleRange ( double number ) { } public DoubleRange ( Number number ) { } public DoubleRange ( double number1 , double number2 ) { } public DoubleRange ( Number number1 , Number number2 ) { } @ Override public Number getMinimumNumber ( ) { } @ Override public long getMinimumLong ( ) { } @ Override public int getMinimumInteger ( ) { } @ Override public double getMinimumDouble ( ) { } @ Override public float getMinimumFloat ( ) { } @ Override public Number getMaximumNumber ( ) { } @ Override public long getMaximumLong ( ) { } @ Override public int getMaximumInteger ( ) { } @ Override public double getMaximumDouble ( ) { } @ Override public float getMaximumFloat ( ) { } @ Override public boolean containsNumber ( Number number ) { } @ Override public boolean containsDouble ( double value ) { } @ Override public boolean containsRange ( Range range ) { } @ Override public boolean overlapsRange ( Range range ) { } @ Override public boolean equals ( Object obj ) { } @ Override public int hashCode ( ) { } @ Override public String toString ( ) { if ( ( toString ) == null ) { <START_BUG> StringBuffer buf = new StringBuffer ( 32 ) ; <END_BUG> buf . append ( "Range[" ) ; buf . append ( min ) ; buf . append ( ',' ) ; buf . append ( max ) ; buf . append ( ']' ) ; toString = buf . toString ( ) ; } return toString ; } }

Fix:
StringBuilder buf = new StringBuilder ( 32 ) ;
Buggy code:
public class TreasureView implements IWorldObjectView { private final Treasure treasure ; private static final int WIDTH = 30 ; private static final int HEIGHT = 32 ; private static final String SPRITE_LOCATION1 = "chest1.png" ; private static final String SPRITE_LOCATION2 = "chest2.png" ; private Sprite sprite ; private final Sprite SPRITE_OPENED ; private final Sprite SPRITE_CLOSED ; public TreasureView ( Treasure treasure ) { } public void update ( float delta ) { <START_BUG> if ( treasure . isOpen ( ) ) { <END_BUG> sprite = SPRITE_OPENED ; } else { sprite = SPRITE_CLOSED ; } } @ Override public void draw ( SpriteBatch batch ) { } No newline ; at end ; of file ; }

Fix:
if ( treasure . isCheastOpen ( ) ) {
Buggy code:
public class AntStructure extends Task { private final String lSep = System . getProperty ( "line.separator" ) ; private final String BOOLEAN = "%boolean;" ; private final String TASKS = "%tasks;" ; private final String TYPES = "%types;" ; private Hashtable visited = new Hashtable ( ) ; private File output ; public void setOutput ( File output ) { } public void execute ( ) throws BuildException { } private void printHead ( PrintWriter out , Enumeration tasks , Enumeration types ) { out . println ( "<?xml<seq2seq4repair_space>version=\"1.0\"<seq2seq4repair_space>encoding=\"UTF-8\"<seq2seq4repair_space>?>" ) ; out . println ( "<!ENTITY<seq2seq4repair_space>%<seq2seq4repair_space>boolean<seq2seq4repair_space>\"(true|false|on|off|yes|no)\">" ) ; out . print ( "<!ENTITY<seq2seq4repair_space>%<seq2seq4repair_space>tasks<seq2seq4repair_space>\"" ) ; boolean first = true ; while ( tasks . hasMoreElements ( ) ) { String taskName = ( ( String ) ( tasks . nextElement ( ) ) ) ; if ( ! first ) { out . print ( "<seq2seq4repair_space>|<seq2seq4repair_space>" ) ; } else { first = false ; } out . print ( taskName ) ; } out . println ( "\">" ) ; out . print ( "<!ENTITY<seq2seq4repair_space>%<seq2seq4repair_space>types<seq2seq4repair_space>\"" ) ; first = true ; while ( types . hasMoreElements ( ) ) { String typeName = ( ( String ) ( types . nextElement ( ) ) ) ; if ( ! first ) { out . print ( "<seq2seq4repair_space>|<seq2seq4repair_space>" ) ; } else { first = false ; } out . print ( typeName ) ; } out . println ( "\">" ) ; out . println ( "" ) ; out . print ( "<!ELEMENT<seq2seq4repair_space>project<seq2seq4repair_space>(target<seq2seq4repair_space>|<seq2seq4repair_space>property<seq2seq4repair_space>|<seq2seq4repair_space>taskdef<seq2seq4repair_space>|<seq2seq4repair_space>" ) ; out . print ( TYPES ) ; out . println ( ")*>" ) ; out . println ( "<!ATTLIST<seq2seq4repair_space>project" ) ; <START_BUG> out . println ( "<seq2seq4repair_space>name<seq2seq4repair_space>CDATA<seq2seq4repair_space>#REQUIRED" ) ; <END_BUG> out . println ( "<seq2seq4repair_space>default<seq2seq4repair_space>CDATA<seq2seq4repair_space>#REQUIRED" ) ; out . println ( "<seq2seq4repair_space>basedir<seq2seq4repair_space>CDATA<seq2seq4repair_space>#IMPLIED>" ) ; out . println ( "" ) ; } private void printTargetDecl ( PrintWriter out ) { } private void printElementDecl ( PrintWriter out , String name , Class element ) throws BuildException { } private void printTail ( PrintWriter out ) { } protected boolean isNmtoken ( String s ) { } protected boolean areNmtokens ( String [ ] s ) { } }

Fix:
out . println ( "<seq2seq4repair_space>name<seq2seq4repair_space>CDATA<seq2seq4repair_space>#IMPLIED" ) ;
Buggy code:
public class InitialContextFactory implements javax . naming . spi . InitialContextFactory { @ SuppressWarnings ( "unchecked" ) public Context getInitialContext ( Hashtable < ? , ? > environment ) throws NamingException { <START_BUG> return new NamingContext ( ( ( Hashtable < String , Object > ) ( environment ) ) ) ; <END_BUG> } }

Fix:
return new InitialContext ( ( ( Hashtable < String , Object > ) ( environment ) ) ) ;
Buggy code:
public class MobileDeviceManagementDAOFactory { private static DataSource dataSource ; private static MobileDataSourceConfig mobileDataSourceConfig ; private static final Log log = LogFactory . getLog ( MobileDeviceManagementDAOFactory . class ) ; public MobileDeviceManagementDAOFactory ( ) { } public static void init ( ) { } private static DataSource resolveDataSource ( MobileDataSourceConfig config ) throws DeviceManagementException { DataSource dataSource = null ; if ( config == null ) { throw new RuntimeException ( ( "Device<seq2seq4repair_space>Management<seq2seq4repair_space>Repository<seq2seq4repair_space>data<seq2seq4repair_space>source<seq2seq4repair_space>configuration<seq2seq4repair_space>" + "is<seq2seq4repair_space>null<seq2seq4repair_space>and<seq2seq4repair_space>thus,<seq2seq4repair_space>is<seq2seq4repair_space>not<seq2seq4repair_space>initialized" ) ) ; } <START_BUG> JNDILookupDefinition jndiConfig = config . getJndiLookupDefintion ( ) ; <END_BUG> if ( jndiConfig != null ) { if ( MobileDeviceManagementDAOFactory . log . isDebugEnabled ( ) ) { MobileDeviceManagementDAOFactory . log . debug ( ( "Initializing<seq2seq4repair_space>Device<seq2seq4repair_space>Management<seq2seq4repair_space>Repository<seq2seq4repair_space>data<seq2seq4repair_space>source<seq2seq4repair_space>using<seq2seq4repair_space>the<seq2seq4repair_space>JNDI<seq2seq4repair_space>" + "Lookup<seq2seq4repair_space>Definition" ) ) ; } List < JNDILookupDefinition . JNDIProperty > jndiPropertyList = jndiConfig . getJndiProperties ( ) ; if ( jndiPropertyList != null ) { Hashtable < Object , Object > jndiProperties = new Hashtable < Object , Object > ( ) ; for ( JNDILookupDefinition . JNDIProperty prop : jndiPropertyList ) { jndiProperties . put ( prop . getName ( ) , prop . getValue ( ) ) ; } dataSource = MobileDeviceManagementDAOUtil . lookupDataSource ( jndiConfig . getJndiName ( ) , jndiProperties ) ; } else { dataSource = MobileDeviceManagementDAOUtil . lookupDataSource ( jndiConfig . getJndiName ( ) , null ) ; } } return dataSource ; } public static MobileDeviceDAO getMobileDeviceDAO ( ) { } public static MobileOperationDAO getMobileOperationDAO ( ) { } public static MobileOperationPropertyDAO getMobileOperationPropertyDAO ( ) { } public static MobileDeviceOperationDAO getMobileDeviceOperationDAO ( ) { } public static FeatureDAO getFeatureDAO ( ) { } public static FeaturePropertyDAO getFeaturePropertyDAO ( ) { } public static MobileDataSourceConfig getMobileDeviceManagementConfig ( ) { } public static void setMobileDataSourceConfig ( MobileDataSourceConfig mobileDataSourceConfig ) { } public static DataSource getDataSource ( ) { } No newline ; at end ; of file ; }

Fix:
JNDILookupDefinition jndiConfig = config . getJndiLookupDefinition ( ) ;
Buggy code:
public class SpanNotQuery extends SpanQuery { private SpanQuery include ; private SpanQuery exclude ; public SpanNotQuery ( SpanQuery include , SpanQuery exclude ) { } public SpanQuery getInclude ( ) { } public SpanQuery getExclude ( ) { } public String getField ( ) { } public Collection getTerms ( ) { } public void extractTerms ( Set terms ) { } public String toString ( String field ) { } public Spans getSpans ( final IndexReader reader ) throws IOException { } public Query rewrite ( IndexReader reader ) throws IOException { } public boolean equals ( Object o ) { } public int hashCode ( ) { int h = include . hashCode ( ) ; h = ( h << 1 ) | ( h > > > 31 ) ; <START_BUG> h ^= include . hashCode ( ) ; <END_BUG> h = ( h << 1 ) | ( h > > > 31 ) ; h ^= Float . floatToRawIntBits ( getBoost ( ) ) ; return h ; } }

Fix:
h ^= exclude . hashCode ( ) ;
Buggy code:
public class CertifiedDataTest extends TestCase { protected double mean = Double . NaN ; protected double std = Double . NaN ; public CertifiedDataTest ( String name ) { } public void setUp ( ) { } public static Test suite ( ) { } public void testSummaryStatistics ( ) throws Exception { } public void testDescriptiveStatistics ( ) throws Exception { } private void loadStats ( String resource , Object u ) throws Exception { DescriptiveStatistics d = null ; SummaryStatistics s = null ; if ( u instanceof DescriptiveStatistics ) { d = ( ( DescriptiveStatistics ) ( u ) ) ; } else { s = ( ( SummaryStatistics ) ( u ) ) ; } u . getClass ( ) . getDeclaredMethod ( "clear" , new Class [ ] { } ) . invoke ( u , new Object [ ] { } ) ; mean = Double . NaN ; std = Double . NaN ; <START_BUG> BufferedReader in = new BufferedReader ( new InputStreamReader ( getClass ( ) . getResourceAsStream ( resource ) ) ) ; <END_BUG> String line = null ; for ( int j = 0 ; j < 60 ; j ++ ) { line = in . readLine ( ) ; if ( j == 40 ) { mean = Double . parseDouble ( line . substring ( ( ( line . lastIndexOf ( ":" ) ) + 1 ) ) . trim ( ) ) ; } if ( j == 41 ) { std = Double . parseDouble ( line . substring ( ( ( line . lastIndexOf ( ":" ) ) + 1 ) ) . trim ( ) ) ; } } line = in . readLine ( ) ; while ( line != null ) { if ( d != null ) { d . addValue ( Double . parseDouble ( line . trim ( ) ) ) ; } else { s . addValue ( Double . parseDouble ( line . trim ( ) ) ) ; } line = in . readLine ( ) ; } in . close ( ) ; } }

Fix:
BufferedReader in = new BufferedReader ( new InputStreamReader ( CertifiedDataTest . class . getResourceAsStream ( resource ) ) ) ;
Buggy code:
final class KeyBindingMachine { private String [ ] activeContextIds ; private String [ ] activeKeyConfigurationIds ; private String [ ] activeLocales ; private String [ ] activePlatforms ; private SortedSet [ ] keyBindings ; private Map keyBindingsByCommandId ; private Map keyBindingsByCommandIdForMode ; private Map matchesByKeySequence ; private Map matchesByKeySequenceForMode ; private KeySequence mode ; private boolean solved ; private SortedMap tree ; KeyBindingMachine ( ) { } String [ ] getActiveContextIds ( ) { } String [ ] getActiveKeyConfigurationIds ( ) { } String [ ] getActiveLocales ( ) { } String [ ] getActivePlatforms ( ) { } Map getKeyBindingsByCommandId ( ) { } Map getKeyBindingsByCommandIdForMode ( ) { } SortedSet getKeyBindings0 ( ) { } SortedSet getKeyBindings1 ( ) { } Map getMatchesByKeySequence ( ) { } Map getMatchesByKeySequenceForMode ( ) { } KeySequence getMode ( ) { } boolean setActiveContextIds ( String [ ] activeContextIds ) { } boolean setActiveKeyConfigurationIds ( String [ ] activeKeyConfigurationIds ) { } boolean setActiveLocales ( String [ ] activeLocales ) { } boolean setActivePlatforms ( String [ ] activePlatforms ) { } boolean setKeyBindings0 ( SortedSet keyBindings0 ) { } boolean setKeyBindings1 ( SortedSet keyBindings1 ) { } boolean setMode ( KeySequence mode ) { } private void build ( ) { if ( ( tree ) == null ) { tree = new TreeMap ( ) ; for ( int i = 0 ; i < ( keyBindings . length ) ; i ++ ) { Iterator iterator = keyBindings [ i ] . iterator ( ) ; while ( iterator . hasNext ( ) ) { IKeyBindingDefinition keyBindingDefinition = ( ( IKeyBindingDefinition ) ( iterator . next ( ) ) ) ; <START_BUG> KeyBindingNode . add ( tree , keyBindingDefinition . getKeySequence ( ) , keyBindingDefinition . getContextId ( ) , keyBindingDefinition . getKeyConfigurationId ( ) , i , keyBindingDefinition . getPlatform ( ) , keyBindingDefinition . getLocale ( ) , keyBindingDefinition . getCommandId ( ) ) ; <END_BUG> } } } } private void invalidateMode ( ) { } private void invalidateSolution ( ) { } private void invalidateTree ( ) { } private void solve ( ) { } }

Fix:
KeyBindingNode . add ( tree , keyBindingDefinition . getKeySequence ( ) , keyBindingDefinition . getActivityId ( ) , keyBindingDefinition . getKeyConfigurationId ( ) , i , keyBindingDefinition . getPlatform ( ) , keyBindingDefinition . getLocale ( ) , keyBindingDefinition . getCommandId ( ) ) ;
Buggy code:
public class JDBCPersistenceProductDerivation implements ProductDerivation { public int getType ( ) { } public void beforeConfigurationConstruct ( ConfigurationProvider cp ) { } public void beforeConfigurationLoad ( OpenJPAConfiguration c ) { <START_BUG> c . getStoreFacadeTypeRegistry ( ) . registerImplementation ( FetchPlan . class , JDBCStoreManager . class , JDBCFetchPlan . class ) ; <END_BUG> if ( ! ( c instanceof JDBCConfigurationImpl ) ) return ; JDBCConfigurationImpl conf = ( ( JDBCConfigurationImpl ) ( c ) ) ; String jpa = PersistenceProductDerivation . SPEC_JPA ; String ejb = PersistenceProductDerivation . ALIAS_EJB ; conf . metaFactoryPlugin . setAlias ( ejb , PersistenceMappingFactory . class . getName ( ) ) ; conf . metaFactoryPlugin . setAlias ( jpa , PersistenceMappingFactory . class . getName ( ) ) ; conf . mappingFactoryPlugin . setAlias ( ejb , PersistenceMappingFactory . class . getName ( ) ) ; conf . mappingFactoryPlugin . setAlias ( jpa , PersistenceMappingFactory . class . getName ( ) ) ; conf . mappingDefaultsPlugin . setAlias ( ejb , PersistenceMappingDefaults . class . getName ( ) ) ; conf . mappingDefaultsPlugin . setAlias ( jpa , PersistenceMappingDefaults . class . getName ( ) ) ; } public void afterSpecificationSet ( OpenJPAConfiguration c ) { } }

Fix:
c . getStoreFacadeTypeRegistry ( ) . registerImplementation ( FetchPlan . class , JDBCStoreManager . class , JDBCFetchPlanImpl . class ) ;
Buggy code:
public class CeylonContentProviderFilter { public static Object [ ] filterVariables ( Object [ ] variables , IPresentationContext context ) throws DebugException { } public static < Type > Type unBoxIfVariableBoxed ( final Type element ) throws DebugException { } @ SuppressWarnings ( "unchecked" ) public static < Type > Type unBoxIfVariableBoxed ( final Type element , final String namePrefix ) throws DebugException { Type replacedVariable = element ; if ( element instanceof IJavaVariable ) { <START_BUG> if ( VariableBox . class . getName ( ) . equals ( ( ( IJavaVariable ) ( element ) ) . getJavaType ( ) . getName ( ) ) ) { <END_BUG> IJavaValue value = ( ( IJavaValue ) ( ( ( IJavaVariable ) ( element ) ) . getValue ( ) ) ) ; IVariable [ ] children = value . getVariables ( ) ; if ( ( children . length ) > 0 ) { for ( IVariable child : children ) { if ( child instanceof JDIFieldVariable ) { if ( "ref" . equals ( child . getName ( ) ) ) { JDIFieldVariable refVariable = ( ( JDIFieldVariable ) ( child ) ) ; replacedVariable = ( ( Type ) ( new JDIFieldVariable ( refVariable . getJavaDebugTarget ( ) , refVariable . getField ( ) , refVariable . getObjectReference ( ) , null ) { public String getName ( ) throws DebugException { return namePrefix + ( CeylonJDIModelPresentation . fixVariableName ( ( ( IJavaVariable ) ( element ) ) . getName ( ) , ( ( IJavaVariable ) ( element ) ) . isLocal ( ) , ( ( IJavaVariable ) ( element ) ) . isSynthetic ( ) ) ) ; } } ) ) ; break ; } } } } } else if ( ( ! ( namePrefix . isEmpty ( ) ) ) && ( element instanceof JDIPlaceholderVariable ) ) { final JDIPlaceholderVariable placeHolderVariable = ( ( JDIPlaceholderVariable ) ( element ) ) ; IValue value = placeHolderVariable . getValue ( ) ; if ( value instanceof IJavaValue ) replacedVariable = ( ( Type ) ( new JDIPlaceholderVariable ( placeHolderVariable . getName ( ) , ( ( IJavaValue ) ( placeHolderVariable . getValue ( ) ) ) ) { public String getName ( ) { return namePrefix + ( CeylonJDIModelPresentation . fixVariableName ( placeHolderVariable . getName ( ) , false , false ) ) ; } } ) ) ; } else if ( ( ! ( namePrefix . isEmpty ( ) ) ) && ( element instanceof JDIFieldVariable ) ) { final JDIFieldVariable fieldVariable = ( ( JDIFieldVariable ) ( element ) ) ; replacedVariable = ( ( Type ) ( new JDIFieldVariable ( fieldVariable . getJavaDebugTarget ( ) , fieldVariable . getField ( ) , fieldVariable . getObjectReference ( ) , null ) { public String getName ( ) throws DebugException { return namePrefix + ( CeylonJDIModelPresentation . fixVariableName ( fieldVariable . getName ( ) , fieldVariable . isLocal ( ) , fieldVariable . isSynthetic ( ) ) ) ; } } ) ) ; } } return replacedVariable ; } }

Fix:
if ( VariableBox . class . getName ( ) . equals ( ( ( IJavaVariable ) ( element ) ) . getReferenceTypeName ( ) ) ) {
Buggy code:
public class SchemaSnapshotGenerator extends JdbcSnapshotGenerator { public SchemaSnapshotGenerator ( ) { } @ Override protected DatabaseObject snapshotObject ( DatabaseObject example , DatabaseSnapshot snapshot ) throws DatabaseException , InvalidExampleException { Database database = snapshot . getDatabase ( ) ; ResultSet schemas = null ; Schema match = null ; boolean passedCatalog = ( ( ( Schema ) ( example ) ) . getCatalogName ( ) ) != null ; boolean passedSchema = ( ( ( Schema ) ( example ) ) . getName ( ) ) != null ; String catalogName = ( ( Schema ) ( example ) ) . getCatalogName ( ) ; String schemaName = example . getName ( ) ; if ( database . supportsSchemas ( ) ) { if ( catalogName == null ) { catalogName = database . getDefaultCatalogName ( ) ; } if ( schemaName == null ) { schemaName = database . getDefaultSchemaName ( ) ; } } else { if ( database . supportsCatalogs ( ) ) { if ( ( catalogName == null ) && ( schemaName != null ) ) { catalogName = schemaName ; schemaName = null ; } } else { catalogName = null ; schemaName = null ; } } example = new Schema ( catalogName , schemaName ) ; ObjectQuotingStrategy currentStrategy = database . getObjectQuotingStrategy ( ) ; database . setObjectQuotingStrategy ( LEGACY ) ; try { if ( database . supportsSchemas ( ) ) { schemas = ( ( liquibase . database . jvm . JdbcConnection ) ( database . getConnection ( ) ) ) . getMetaData ( ) . getSchemas ( ) ; while ( schemas . next ( ) ) { String tableSchema = JdbcUtils . getValueForColumn ( schemas , "TABLE_SCHEM" , database ) ; CatalogAndSchema schemaFromJdbcInfo = ( ( liquibase . database . AbstractJdbcDatabase ) ( database ) ) . getSchemaFromJdbcInfo ( null , tableSchema ) ; Catalog catalog = new Catalog ( schemaFromJdbcInfo . getCatalogName ( ) ) ; <START_BUG> Schema schema = new Schema ( catalog , schemaFromJdbcInfo . getSchemaName ( ) ) ; <END_BUG> if ( DatabaseObjectComparatorFactory . getInstance ( ) . isSameObject ( schema , example , database ) ) { if ( match == null ) { match = schema ; } else { throw new InvalidExampleException ( ( ( ( "Found<seq2seq4repair_space>multiple<seq2seq4repair_space>catalog//schemas<seq2seq4repair_space>matching<seq2seq4repair_space>" + ( ( ( Schema ) ( example ) ) . getCatalogName ( ) ) ) + "." ) + ( example . getName ( ) ) ) ) ; } } } } else { Catalog catalog = new Catalog ( catalogName ) ; return new Schema ( catalog , null ) ; } } catch ( SQLException e ) { throw new DatabaseException ( e ) ; } finally { database . setObjectQuotingStrategy ( currentStrategy ) ; if ( schemas != null ) { try { schemas . close ( ) ; } catch ( SQLException ignore ) { } } } return match ; } @ Override protected void addTo ( DatabaseObject foundObject , DatabaseSnapshot snapshot ) throws DatabaseException , InvalidExampleException { } }

Fix:
Schema schema = new Schema ( catalog , tableSchema ) ;
Buggy code:
public class EntityBuilder { private static final Logger LOG = LoggerFactory . getLogger ( EntityBuilder . class ) ; private static final int NUMBER_OF_BASHKARS = 6 ; private static final int NUMBER_OF_WOODFOLK = 3 ; private static final int NUMBER_OF_LANCERS = 4 ; private static final int NUMBER_OF_PATROL = 3 ; private static final int NUMBER_OF_COMPANY = 7 ; private static final List < AbstractNative > orderNatives = new ArrayList < > ( ) ; private static final List < AbstractNative > soldierNatives = new ArrayList < > ( ) ; private static final List < AbstractNative > rogueNatives = new ArrayList < > ( ) ; private static final List < AbstractNative > guardNatives = new ArrayList < > ( ) ; private static final List < AbstractNative > bashkarNatives = new ArrayList < > ( ) ; private static final List < AbstractNative > woodfolkNatives = new ArrayList < > ( ) ; private static final List < AbstractNative > lancerNatives = new ArrayList < > ( ) ; private static final List < AbstractNative > companyNatives = new ArrayList < > ( ) ; private static final List < AbstractNative > patrolNatives = new ArrayList < > ( ) ; public static void placeEntities ( final BoardModel board ) { } private static void buildOrder ( final BoardModel board ) { } private static void buildSoldiers ( final BoardModel board ) { } private static void buildRogues ( final BoardModel board ) { } private static void buildGuard ( final BoardModel board ) { } public AbstractNative getBashkar ( final Clearing clearing ) { } private static void buildBashkar ( ) { } public AbstractNative getWoodfolk ( final Clearing clearing ) { } private static void buildWoodfolk ( ) { } public AbstractNative getLancer ( final Clearing clearing ) { } private static void buildLancer ( ) { } public AbstractNative getCompany ( final Clearing clearing ) { } private static void buildCompany ( ) { } public AbstractNative getPatrol ( final Clearing clearing ) { } private static void buildPatrol ( ) { boolean firstOne = true ; for ( int i = 0 ; i < ( EntityBuilder . NUMBER_OF_PATROL ) ; i ++ ) { AbstractNative patrolSwordsman = NativeFactory . createNative ( PATROL , SHORT_SWORDSMAN ) ; if ( firstOne ) { patrolSwordsman . markLeader ( ) ; firstOne = false ; } patrolSwordsman . setProwling ( true ) ; patrolSwordsman . setHidden ( false ) ; <START_BUG> EntityBuilder . lancerNatives . add ( patrolSwordsman ) ; <END_BUG> } } }

Fix:
EntityBuilder . patrolNatives . add ( patrolSwordsman ) ;
Buggy code:
@ Component public class QueueLoader { private final Logger Log = LoggerFactory . getLogger ( this . getClass ( ) ) ; private static final String ROOT_DIR = "C:\\Users\\mgh14\\Pictures\\screen-temp\\" ; private Map < String , String > urlsToFilenames = new HashMap < String , String > ( ) ; private int numPagesToRetrieve = 3 ; @ Autowired private ResourceUrlGetter resourceUrlGetter ; @ Autowired private ConcurrentLinkedQueue < String > resourceQueue ; @ Autowired private ExecutorService executorService ; public String getRelativeResourceFilename ( String resourceStr , int downloadNumber ) { } public void startResourceDownloads ( ) { executorService . execute ( new Runnable ( ) { public void run ( ) { ImageSaver imageSaver = new ImageSaver ( ) ; int downloadCounter = 0 ; List < URI > resourceUris = getShuffledResources ( resourceUrlGetter ) ; for ( URI resource : resourceUris ) { final String resourceStr = resource . toString ( ) ; final String filename = getRelativeResourceFilename ( resourceStr , ( ++ downloadCounter ) ) ; String finalFilename = null ; try { if ( ! ( urlsToFilenames . containsKey ( resourceStr ) ) ) { finalFilename = imageSaver . saveImage ( resourceStr , QueueLoader . ROOT_DIR , filename ) ; if ( ! ( ( finalFilename == null ) || ( finalFilename . trim ( ) . isEmpty ( ) ) ) ) { makeFileReadableAndWriteable ( finalFilename ) ; resourceQueue . add ( finalFilename ) ; } } } catch ( IOException e ) { continue ; } if ( finalFilename != null ) urlsToFilenames . put ( resourceStr , finalFilename ) ; } <START_BUG> if ( ( resourceUrlGetter . getNumPagesRetrieved ( ) ) <= ( numPagesToRetrieve ) ) { <END_BUG> System . out . println ( ( "Reached<seq2seq4repair_space>end<seq2seq4repair_space>of<seq2seq4repair_space>resource<seq2seq4repair_space>list<seq2seq4repair_space>for<seq2seq4repair_space>" + "page.<seq2seq4repair_space>Refreshing<seq2seq4repair_space>list..." ) ) ; startResourceDownloads ( ) ; } else { Log . info ( "Finished<seq2seq4repair_space>downloads.<seq2seq4repair_space>Loaded<seq2seq4repair_space>[{}]<seq2seq4repair_space>resource<seq2seq4repair_space>URI's<seq2seq4repair_space>into<seq2seq4repair_space>resource<seq2seq4repair_space>list." , urlsToFilenames . size ( ) ) ; } } } ) ; } @ SuppressWarnings ( "ResultOfMethodCallIgnored" ) private void makeFileReadableAndWriteable ( String filename ) { } private List < URI > getShuffledResources ( ResourceUrlGetter getter ) { } }

Fix:
if ( ( resourceUrlGetter . getNumPagesRetrieved ( ) ) < ( numPagesToRetrieve ) ) {