nus-yam/ex-repair huggingface dataset:
Buggy code:
public class TestConjunctions extends LuceneTestCase { Analyzer analyzer ; Directory dir ; IndexReader reader ; IndexSearcher searcher ; static final String F1 = "title" ; static final String F2 = "body" ; @ Override public void setUp ( ) throws Exception { super . setUp ( ) ; analyzer = new org . apache . lucene . analysis . MockAnalyzer ( random ( ) ) ; dir = newDirectory ( ) ; IndexWriterConfig config = newIndexWriterConfig ( TEST_VERSION_CURRENT , analyzer ) ; config . setMergePolicy ( newLogMergePolicy ( ) ) ; RandomIndexWriter writer = new RandomIndexWriter ( random ( ) , dir , config ) ; writer . addDocument ( TestConjunctions . doc ( "lucene" , "lucene<seq2seq4repair_space>is<seq2seq4repair_space>a<seq2seq4repair_space>very<seq2seq4repair_space>popular<seq2seq4repair_space>search<seq2seq4repair_space>engine<seq2seq4repair_space>library" ) ) ; writer . addDocument ( TestConjunctions . doc ( "solr" , "solr<seq2seq4repair_space>is<seq2seq4repair_space>a<seq2seq4repair_space>very<seq2seq4repair_space>popular<seq2seq4repair_space>search<seq2seq4repair_space>server<seq2seq4repair_space>and<seq2seq4repair_space>is<seq2seq4repair_space>using<seq2seq4repair_space>lucene" ) ) ; writer . addDocument ( TestConjunctions . doc ( "nutch" , "nutch<seq2seq4repair_space>is<seq2seq4repair_space>an<seq2seq4repair_space>internet<seq2seq4repair_space>search<seq2seq4repair_space>engine<seq2seq4repair_space>with<seq2seq4repair_space>web<seq2seq4repair_space>crawler<seq2seq4repair_space>and<seq2seq4repair_space>is<seq2seq4repair_space>using<seq2seq4repair_space>lucene<seq2seq4repair_space>and<seq2seq4repair_space>hadoop" ) ) ; reader = writer . getReader ( ) ; <START_BUG> writer . close ( ) ; <END_BUG> searcher = newSearcher ( reader ) ; searcher . setSimilarity ( new TestConjunctions . TFSimilarity ( ) ) ; } static Document doc ( String v1 , String v2 ) { } public void testTermConjunctionsWithOmitTF ( ) throws Exception { } @ Override public void tearDown ( ) throws Exception { } private static class TFSimilarity extends Similarity { @ Override public long computeNorm ( FieldInvertState state ) { } @ Override public SimWeight computeWeight ( float queryBoost , CollectionStatistics collectionStats , TermStatistics ... termStats ) { } @ Override public SimScorer simScorer ( SimWeight weight , AtomicReaderContext context ) throws IOException { } } }

Fix:
writer . shutdown ( ) ;
Buggy code:
public class TruncateResponse { private static TruncateResponse . TruncateResponseSerializer serializer_ = new TruncateResponse . TruncateResponseSerializer ( ) ; public static TruncateResponse . TruncateResponseSerializer serializer ( ) { } public final String keyspace ; public final String columnFamily ; public final boolean success ; public static Message makeTruncateResponseMessage ( Message original , TruncateResponse truncateResponseMessage ) throws IOException { ByteArrayOutputStream bos = new ByteArrayOutputStream ( ) ; DataOutputStream dos = new DataOutputStream ( bos ) ; TruncateResponse . serializer ( ) . serialize ( truncateResponseMessage , dos ) ; <START_BUG> return original . getReply ( FBUtilities . getLocalAddress ( ) , bos . toByteArray ( ) ) ; <END_BUG> } public TruncateResponse ( String keyspace , String columnFamily , boolean success ) { } public static class TruncateResponseSerializer implements ICompactSerializer < TruncateResponse > { public void serialize ( TruncateResponse tr , DataOutputStream dos ) throws IOException { } public TruncateResponse deserialize ( DataInputStream dis ) throws IOException { } } }

Fix:
return original . getReply ( FBUtilities . getLocalAddress ( ) , bos . toByteArray ( ) , original . getVersion ( ) ) ;
Buggy code:
public class MixtureMultivariateNormalDistribution extends MixtureMultivariateRealDistribution < MultivariateNormalDistribution > { public MixtureMultivariateNormalDistribution ( double [ ] weights , double [ ] [ ] means , double [ ] [ ] [ ] covariances ) { } public MixtureMultivariateNormalDistribution ( List < Pair < Double , MultivariateNormalDistribution > > components ) { } public MixtureMultivariateNormalDistribution ( RandomGenerator rng , List < Pair < Double , MultivariateNormalDistribution > > components ) throws DimensionMismatchException , NotPositiveException { } private static List < Pair < Double , MultivariateNormalDistribution > > createComponents ( double [ ] weights , double [ ] [ ] means , double [ ] [ ] [ ] covariances ) { <START_BUG> final List < Pair < Double , MultivariateNormalDistribution > > mvns = new ArrayList < Pair < Double , MultivariateNormalDistribution > > ( ) ; <END_BUG> for ( int i = 0 ; i < ( weights . length ) ; i ++ ) { final MultivariateNormalDistribution dist = new MultivariateNormalDistribution ( means [ i ] , covariances [ i ] ) ; mvns . add ( new Pair < Double , MultivariateNormalDistribution > ( weights [ i ] , dist ) ) ; } return mvns ; } }

Fix:
final List < Pair < Double , MultivariateNormalDistribution > > mvns = new ArrayList < Pair < Double , MultivariateNormalDistribution > > ( weights . length ) ;
Buggy code:
public final class StreamManager { private static Logger logger_ = Logger . getLogger ( StreamManager . class ) ; public static class BootstrapTerminateVerbHandler implements IVerbHandler { private static Logger logger_ = Logger . getLogger ( BootstrapInitiateDoneVerbHandler . class ) ; public void doVerb ( Message message ) { <START_BUG> byte [ ] body = ( ( byte [ ] ) ( message . getMessageBody ( ) [ 0 ] ) ) ; <END_BUG> DataInputBuffer bufIn = new DataInputBuffer ( ) ; bufIn . reset ( body , body . length ) ; try { StreamContextManager . StreamStatusMessage streamStatusMessage = StreamStatusMessage . serializer ( ) . deserialize ( bufIn ) ; StreamContextManager . StreamStatus streamStatus = streamStatusMessage . getStreamStatus ( ) ; switch ( streamStatus . getAction ( ) ) { case DELETE : StreamManager . instance ( message . getFrom ( ) ) . finish ( streamStatus . getFile ( ) ) ; break ; case STREAM : StreamManager . BootstrapTerminateVerbHandler . logger_ . debug ( ( "Need<seq2seq4repair_space>to<seq2seq4repair_space>re-stream<seq2seq4repair_space>file<seq2seq4repair_space>" + ( streamStatus . getFile ( ) ) ) ) ; StreamManager . instance ( message . getFrom ( ) ) . repeat ( ) ; break ; default : break ; } } catch ( IOException ex ) { StreamManager . BootstrapTerminateVerbHandler . logger_ . info ( LogUtil . throwableToString ( ex ) ) ; } } } private static Map < EndPoint , StreamManager > streamManagers_ = new HashMap < EndPoint , StreamManager > ( ) ; public static StreamManager instance ( EndPoint to ) { } private List < File > filesToStream_ = new ArrayList < File > ( ) ; private EndPoint to_ ; private long totalBytesToStream_ = 0L ; private StreamManager ( EndPoint to ) { } public void addFilesToStream ( StreamContextManager [ ] streamContexts ) { } void start ( ) { } void repeat ( ) { } void finish ( String file ) throws IOException { } public synchronized void waitForStreamCompletion ( ) { } }

Fix:
byte [ ] body = message . getMessageBody ( ) ;
Buggy code:
public class FilesDataUnitUtils { public static class InMemoryEntry implements FilesDataUnit . Entry { private final String fileUri ; private final String symbolicName ; public InMemoryEntry ( String graphUri , String symbolicName ) { } @ Override public String getFileURIString ( ) throws DataUnitException { } @ Override public String getSymbolicName ( ) throws DataUnitException { } } private FilesDataUnitUtils ( ) { } public static Entry addFile ( WritableFilesDataUnit dataUnit , File file ) throws DataUnitException { } public static Entry addFile ( WritableFilesDataUnit dataUnit , File file , String path ) throws DataUnitException { final String symbolicName = path ; dataUnit . addExistingFile ( symbolicName , file . toURI ( ) . toString ( ) ) ; MetadataUtils . add ( dataUnit , symbolicName , UV_VIRTUAL_PATH , symbolicName ) ; <START_BUG> return new FilesDataUnitUtils . InMemoryEntry ( file . toString ( ) , symbolicName ) ; <END_BUG> } public static File asFile ( FilesDataUnit . Entry entry ) throws DataUnitException { } public static Entry createFile ( WritableFilesDataUnit dataUnit , String virtualPath ) throws DataUnitException { } }

Fix:
return new FilesDataUnitUtils . InMemoryEntry ( file . toURI ( ) . toString ( ) , symbolicName ) ;
Buggy code:
public class ResourceStreamResource extends AbstractResource { private final IResourceStream stream ; private String fileName ; private ContentDisposition contentDisposition = ContentDisposition . INLINE ; private String textEncoding ; private String mimeType ; public ResourceStreamResource ( IResourceStream stream ) { } public ResourceStreamResource setFileName ( String fileName ) { } public ResourceStreamResource setContentDisposition ( ContentDisposition contentDisposition ) { } public ResourceStreamResource setTextEncoding ( String textEncoding ) { } @ Override protected ResourceData newResourceData ( Attributes attributes ) { ResourceData data = new ResourceData ( ) ; data . setLastModified ( stream . lastModifiedTime ( ) . toDate ( ) ) ; <START_BUG> if ( ! ( data . notModified ( attributes ) ) ) { <END_BUG> InputStream inputStream = null ; if ( ( ( stream ) instanceof IResourceStreamWriter ) == false ) { try { inputStream = stream . getInputStream ( ) ; } catch ( ResourceStreamNotFoundException e ) { data . setErrorCode ( SC_NOT_FOUND ) ; close ( ) ; } } data . setContentDisposition ( contentDisposition ) ; data . setContentLength ( stream . length ( ) ) ; data . setFileName ( fileName ) ; data . setContentType ( stream . getContentType ( ) ) ; data . setTextEncoding ( textEncoding ) ; if ( ( stream ) instanceof IResourceStreamWriter ) { data . setWriteCallback ( new WriteCallback ( ) { @ Override public void writeData ( Attributes attributes ) { ( ( IResourceStreamWriter ) ( stream ) ) . write ( attributes . getResponse ( ) ) ; close ( ) ; } } ) ; } else { final InputStream s = inputStream ; data . setWriteCallback ( new WriteCallback ( ) { @ Override public void writeData ( Attributes attributes ) { try { writeStream ( attributes , s ) ; } finally { close ( ) ; } } } ) ; } } return data ; } private void close ( ) { } private static final Logger logger = LoggerFactory . getLogger ( ResourceStreamResource . class ) ; }

Fix:
if ( data . dataNeedsToBeWritten ( attributes ) ) {
Buggy code:
public class HostInfo extends Task { private static final String DEF_REM_ADDR6 = "::" ; private static final String DEF_REM_ADDR4 = "0.0.0.0" ; private static final String DEF_LOCAL_ADDR6 = "::1" ; private static final String DEF_LOCAL_ADDR4 = "127.0.0.1" ; private static final String DEF_LOCAL_NAME = "localhost" ; private static final String DEF_DOMAIN = "localdomain" ; private static final String DOMAIN = "DOMAIN" ; private static final String NAME = "NAME" ; private static final String ADDR4 = "ADDR4" ; private static final String ADDR6 = "ADDR6" ; private String prefix = "" ; private String host ; private InetAddress nameAddr ; private InetAddress best6 ; private InetAddress best4 ; private List inetAddrs ; public void setPrefix ( String aPrefix ) { } public void setHost ( String aHost ) { } public void execute ( ) throws BuildException { } private void executeLocal ( ) { } private boolean hasHostName ( InetAddress addr ) { } private void selectAddresses ( ) { } private InetAddress selectBestAddress ( InetAddress bestSoFar , InetAddress current ) { InetAddress best = bestSoFar ; if ( best == null ) { best = current ; } else { if ( ( current == null ) || ( current . isLoopbackAddress ( ) ) ) { } else if ( current . isLinkLocalAddress ( ) ) { if ( best . isLoopbackAddress ( ) ) { best = current ; } } else if ( current . isSiteLocalAddress ( ) ) { <START_BUG> if ( ( ( best . isLoopbackAddress ( ) ) || ( best . isLinkLocalAddress ( ) ) ) || ( ! ( hasHostName ( best ) ) ) ) { <END_BUG> best = current ; } } else { if ( ( ( ( best . isLoopbackAddress ( ) ) || ( best . isLinkLocalAddress ( ) ) ) || ( best . isSiteLocalAddress ( ) ) ) || ( ! ( hasHostName ( best ) ) ) ) { best = current ; } } } return best ; } private void executeRemote ( ) { } private void setDomainAndName ( String fqdn ) { } private void setProperty ( String name , String value ) { } }

Fix:
if ( ( ( best . isLoopbackAddress ( ) ) || ( best . isLinkLocalAddress ( ) ) ) || ( ( best . isSiteLocalAddress ( ) ) && ( ! ( hasHostName ( best ) ) ) ) ) {
Buggy code:
public class TestExecutionDao { private JdbcTemplate jdbcTemplate ; public TestExecutionDao ( JdbcTemplate jdbcTemplate ) { } public void insert ( TestExecution te ) { } public TestExecution get ( int id ) { } public List < TestExecution > getAll ( ) { } public List < TestExecution > getNotPublished ( ) { <START_BUG> String SQL = "SELECT<seq2seq4repair_space>id,<seq2seq4repair_space>data,<seq2seq4repair_space>execution_dt,<seq2seq4repair_space>last_change_dt\n" + "<seq2seq4repair_space>FROM<seq2seq4repair_space>execution<seq2seq4repair_space>where<seq2seq4repair_space>data->>\'publicated\'<seq2seq4repair_space>=<seq2seq4repair_space>\'0\';\n" ; <END_BUG> return jdbcTemplate . query ( SQL , new TestExecutionMapper ( ) ) ; } public List < TestExecution > getProcessing ( ) { } @ Transactional public void setPublished ( TestExecution te ) { } @ Transactional public void setFailedReason ( int id , String status ) { } @ Transactional public void setComment ( int id , String comment ) { } @ Transactional public synchronized void setReasonComment ( int id , String comment ) { } @ Transactional public synchronized void setStatus ( int id , ExecutionStatus status ) { } @ Transactional public synchronized void updatePostponedChecks ( int id , List < PostponedCheck > checks ) { } public void updateTestExecution ( TestExecution te ) { } public List < TestExecution > getByFilter ( TestResultsFilter filter ) { } public Integer countByFilter ( TestResultsFilter filter ) { } public TestExecution getLastPassed ( String issue ) { } public List < Map < String , Object > > selectProjects ( ) { } public List < Map < String , Object > > selectProjects ( TestResultsFilter filter ) { } public List < Map < String , Object > > selectVersions ( TestResultsFilter filter ) { } public List < Map < String , Object > > selectBuilds ( TestResultsFilter filter ) { } public List < Map < String , Object > > selectExecutions ( TestResultsFilter filter ) { } public List < Map < String , Object > > selectIssues ( TestResultsFilter filter ) { } public String getNameByIssue ( String issue ) { } }

Fix:
String SQL = "SELECT<seq2seq4repair_space>id,<seq2seq4repair_space>data,<seq2seq4repair_space>execution_dt,<seq2seq4repair_space>last_change_dt\n" + "<seq2seq4repair_space>FROM<seq2seq4repair_space>execution<seq2seq4repair_space>where<seq2seq4repair_space>data->>\'published\'<seq2seq4repair_space>=<seq2seq4repair_space>\'0\';\n" ;
Buggy code:
final class AppHtmlHandler { private final Template template ; public AppHtmlHandler ( ) { } public String render ( final String app , UriInfo uriInfo ) { final String baseUri = uriInfo . getBaseUri ( ) . toString ( ) ; final Map < String , Object > model = Maps . newHashMap ( ) ; model . put ( "app" , app ) ; <START_BUG> model . put ( "baseUri" , baseUri ) ; <END_BUG> return this . template . execute ( model ) ; } }

Fix:
model . put ( "baseUri" , ( baseUri . equals ( "//" ) ? "" : baseUri ) ) ;
Buggy code:
public class Board { private Map < Steen , int [ ] > vakjes ; public Board ( ) { } private Board ( Map < Steen , int [ ] > vakjes ) { } public void reset ( ) { } public boolean place ( Steen steen , int [ ] vakje ) { } public int [ ] getVakje ( int x , int y ) { } public Steen getSteen ( int [ ] vakje ) { Steen steen = null ; Set < Map . Entry < Steen , int [ ] > > entryset = vakjes . entrySet ( ) ; for ( Map . Entry < Steen , int [ ] > e : entryset ) { <START_BUG> if ( vakje . equals ( e . getValue ( ) ) ) { <END_BUG> steen = e . getKey ( ) ; } } return steen ; } public Board deepCopy ( ) { } public boolean isValidMove ( Steen steen , int [ ] vakje ) { } public String toString ( ) { } }

Fix:
if ( Arrays . equals ( vakje , e . getValue ( ) ) ) {
Buggy code:
public class AddPOP3MessageCommand extends FolderCommand { private MessageFolder inboxFolder ; public AddPOP3MessageCommand ( DefaultCommandReference reference ) { } public void execute ( WorkerStatusController worker ) throws Exception { } private boolean applySpamFilter ( Object uid , WorkerStatusController worker ) throws Exception { AccountItem item = CommandHelper . retrieveAccountItem ( inboxFolder , uid ) ; if ( ! ( item . getSpamItem ( ) . isEnabled ( ) ) ) { return false ; } FolderCommandReference r = new FolderCommandReference ( inboxFolder , new Object [ ] { uid } ) ; new org . columba . mail . spam . command . ScoreMessageCommand ( r ) . execute ( worker ) ; boolean spam = ( ( Boolean ) ( inboxFolder . getAttribute ( uid , "columba.spam" ) ) ) . booleanValue ( ) ; if ( spam == false ) return false ; if ( item . getSpamItem ( ) . isMoveIncomingJunkMessagesEnabled ( ) ) { if ( item . getSpamItem ( ) . isIncomingTrashSelected ( ) ) { MessageFolder trash = ( ( MessageFolder ) ( ( ( org . columba . mail . folder . RootFolder ) ( inboxFolder . getRootFolder ( ) ) ) . getTrashFolder ( ) ) ) ; FolderCommandReference ref2 = new FolderCommandReference ( inboxFolder , trash , new Object [ ] { uid } ) ; processor . addOp ( new org . columba . mail . folder . command . MoveMessageCommand ( ref2 ) ) ; } else { <START_BUG> AbstractFolder destFolder = treeModel . getFolder ( item . getSpamItem ( ) . getMoveCustomFolder ( ) ) ; <END_BUG> FolderCommandReference ref2 = new FolderCommandReference ( inboxFolder , destFolder , new Object [ ] { uid } ) ; processor . addOp ( new org . columba . mail . folder . command . MoveMessageCommand ( ref2 ) ) ; } return true ; } return false ; } private void applyFilters ( Object uid ) throws Exception { } }

Fix:
AbstractFolder destFolder = treeModel . getFolder ( item . getSpamItem ( ) . getIncomingCustomFolder ( ) ) ;
Buggy code:
public class QualifiedThisReference extends ThisReference { public TypeReference qualification ; ReferenceBinding currentCompatibleType ; public QualifiedThisReference ( TypeReference name , int sourceStart , int sourceEnd ) { } public FlowInfo analyseCode ( BlockScope currentScope , FlowContext flowContext , FlowInfo flowInfo ) { } public FlowInfo analyseCode ( BlockScope currentScope , FlowContext flowContext , FlowInfo flowInfo , boolean valueRequired ) { } public void generateCode ( BlockScope currentScope , CodeStream codeStream , boolean valueRequired ) { } public TypeBinding resolveType ( BlockScope scope ) { constant = NotAConstant ; <START_BUG> this . resolvedType = qualification . resolveType ( scope ) ; <END_BUG> if ( ( this . resolvedType ) == null ) return null ; int depth = 0 ; this . currentCompatibleType = scope . referenceType ( ) . binding ; while ( ( ( this . currentCompatibleType ) != null ) && ( ( this . currentCompatibleType ) != ( this . resolvedType ) ) ) { depth ++ ; this . currentCompatibleType = ( this . currentCompatibleType . isStatic ( ) ) ? null : this . currentCompatibleType . enclosingType ( ) ; } bits &= ~ ( ASTNode . DepthMASK ) ; bits |= ( depth & 255 ) << ( ASTNode . DepthSHIFT ) ; if ( ( this . currentCompatibleType ) == null ) { scope . problemReporter ( ) . noSuchEnclosingInstance ( this . resolvedType , this , false ) ; return this . resolvedType ; } if ( depth == 0 ) { checkAccess ( scope . methodScope ( ) ) ; } return this . resolvedType ; } public StringBuffer printExpression ( int indent , StringBuffer output ) { } public void traverse ( IAbstractSyntaxTreeVisitor visitor , BlockScope blockScope ) { } }

Fix:
this . resolvedType = this . qualification . resolveType ( scope ) ;
Buggy code:
public class WebRequestCrawlerSave extends WebRequest { private final String queryString ; private ValueMap parameters ; private String path ; public WebRequestCrawlerSave ( final HttpServletRequest request ) { } private String rebuildUrl ( String queryString ) { <START_BUG> queryString = Strings . replaceAll ( queryString , "1=" , "component=" ) ; <END_BUG> queryString = Strings . replaceAll ( queryString , "2=" , "version=" ) ; queryString = Strings . replaceAll ( queryString , "4=" , "interface=IRedirectListener" ) ; queryString = Strings . replaceAll ( queryString , "3=" , "interface=" ) ; queryString = Strings . replaceAll ( queryString , "5=" , "bookmarkablePage=" ) ; return queryString ; } private ValueMap analyzeQueryString ( final String queryString ) { } public String getParameter ( final String key ) { } public Map getParameterMap ( ) { } public String [ ] getParameters ( final String key ) { } public String toString ( ) { } public String getPath ( ) { } }

Fix:
queryString = Strings . replaceAll ( queryString , "1=" , "path=" ) ;
Buggy code:
public class MarkupStream { private MarkupElement current ; private int currentIndex = 0 ; private final Markup markup ; protected MarkupStream ( ) { } public MarkupStream ( final Markup markup ) { } public boolean atCloseTag ( ) { } public boolean atOpenCloseTag ( ) { } public boolean atOpenCloseTag ( final String componentId ) { } public boolean atOpenTag ( ) { } public boolean atOpenTag ( final String componentId ) { } public boolean atTag ( ) { } public MarkupElement get ( ) { } public int getCurrentIndex ( ) { } public IResourceStream getResource ( ) { } public ComponentTag getTag ( ) { } public boolean hasMore ( ) { } public MarkupElement next ( ) { } public void setCurrentIndex ( final int currentIndex ) { } public final void skipComponent ( ) { } public void skipRawMarkup ( ) { } public void skipUntil ( final String wicketTagName ) { } public void throwMarkupException ( final String message ) { } public String toHtmlDebugString ( ) { } public String toString ( ) { } private MarkupElement get ( final int index ) { } private void skipToMatchingCloseTag ( final ComponentTag openTag ) { } public String getXmlDeclaration ( ) { } public String getEncoding ( ) { } public Class getContainerClass ( ) { <START_BUG> return markup . getContainerClass ( ) ; <END_BUG> } public final int getHeaderIndex ( ) { } public String getWicketNamespace ( ) { } public boolean equalMarkup ( final MarkupStream markupStream ) { } }

Fix:
return markup . getResource ( ) . getMarkupClass ( ) ;
Buggy code:
public final class BombPartySprites { private BombPartySprites ( ) { } public static void readSprites ( ) throws SlickException { <START_BUG> Image image = new Image ( "sprites//bomb_party_v4.png" ) ; <END_BUG> final int width = image . getWidth ( ) ; final int height = image . getHeight ( ) ; final int relevantHeight = 6 * ( TILE_HEIGHT ) ; image = image . getSubImage ( 0 , ( height - relevantHeight ) , width , relevantHeight ) ; final SpriteSheet sprites = new SpriteSheet ( image , TILE_WIDTH , TILE_HEIGHT ) ; int idx = 0 ; for ( int i = 4 ; i < 10 ; i ++ ) { BombConstants . BOMB_FRAMES [ ( idx ++ ) ] = sprites . getSprite ( i , 5 ) ; } BombConstants . BOMB_FRAMES [ BombConstants . EXPLOSION_FRAME ] = sprites . getSprite ( 2 , 5 ) ; BombConstants . EXP_SPRITES [ DIRECTION_UP ] = sprites . getSprite ( 14 , 0 ) ; BombConstants . EXP_SPRITES [ DIRECTION_RIGHT ] = sprites . getSprite ( 3 , 5 ) ; BombConstants . EXP_SPRITES [ DIRECTION_DOWN ] = sprites . getSprite ( 14 , 2 ) ; BombConstants . EXP_SPRITES [ DIRECTION_LEFT ] = sprites . getSprite ( 0 , 5 ) ; BombConstants . EXP_EXTENSIONS [ DIRECTION_DOWN ] = BombConstants . EXP_EXTENSIONS [ DIRECTION_UP ] = sprites . getSprite ( 14 , 1 ) ; BombConstants . EXP_EXTENSIONS [ DIRECTION_LEFT ] = BombConstants . EXP_EXTENSIONS [ DIRECTION_RIGHT ] = sprites . getSprite ( 1 , 5 ) ; HeroConstants . HERO_CHILLIN [ DIRECTION_UP ] = sprites . getSprite ( 0 , 4 ) ; HeroConstants . HERO_CHILLIN [ DIRECTION_DOWN ] = sprites . getSprite ( 1 , 4 ) ; HeroConstants . HERO_CHILLIN [ DIRECTION_RIGHT ] = sprites . getSprite ( 4 , 4 ) ; HeroConstants . HERO_CHILLIN [ DIRECTION_LEFT ] = HeroConstants . HERO_CHILLIN [ DIRECTION_RIGHT ] . getFlippedCopy ( true , false ) ; HeroConstants . HERO_ANIMATION [ DIRECTION_UP ] = BombPartySprites . getPlayerAnimation ( sprites , false , 8 , 9 ) ; HeroConstants . HERO_ANIMATION [ DIRECTION_DOWN ] = BombPartySprites . getPlayerAnimation ( sprites , false , 2 , 3 ) ; HeroConstants . HERO_ANIMATION [ DIRECTION_LEFT ] = BombPartySprites . getPlayerAnimation ( sprites , true , 5 , 6 , 7 ) ; HeroConstants . HERO_ANIMATION [ DIRECTION_RIGHT ] = BombPartySprites . getPlayerAnimation ( sprites , false , 5 , 6 , 7 ) ; } private static Animation getPlayerAnimation ( final SpriteSheet sprites , final boolean reverse , final int ... position ) { } }

Fix:
Image image = new Image ( "sprites//bomb_party_v4.png" , false , Image . FILTER_NEAREST ) ;
Buggy code:
public class Tokenizer { private static String delim = "<seq2seq4repair_space>\t\n;()\"" ; private static String quotes = "\"" ; public static final int EOF = 0 ; public static final int EOL = 1 ; public static final int WHITESPACE = 2 ; public static final int IDENTIFIER = 3 ; public static final int QUOTED_STRING = 4 ; public static final int COMMENT = 5 ; private PushbackInputStream is ; private boolean ungottenToken ; private int multiline ; private boolean quoting ; private String delimiters ; private Tokenizer . Token current ; private StringBuffer sb ; private String filename ; private int line ; public static class Token { public int type ; public String value ; private Token ( ) { } private Tokenizer . Token set ( int type , StringBuffer value ) { } public String toString ( ) { } public boolean isString ( ) { } public boolean isEOL ( ) { } } public Tokenizer ( InputStream is ) { } public Tokenizer ( String s ) { } public Tokenizer ( File f ) throws FileNotFoundException { } private int getChar ( ) throws IOException { } private void ungetChar ( int c ) throws IOException { } private int skipWhitespace ( ) throws IOException { } private void checkUnbalancedParens ( ) throws TextParseException { } public Tokenizer . Token get ( boolean wantWhitespace , boolean wantComment ) throws IOException { } public Tokenizer . Token get ( ) throws IOException { } public void unget ( ) { } public String getString ( ) throws IOException { } public String getIdentifier ( ) throws IOException { } public long getLong ( ) throws IOException { } public long getUInt32 ( ) throws IOException { } public int getUInt16 ( ) throws IOException { } public int getUInt8 ( ) throws IOException { } public double getDouble ( ) throws IOException { } <START_BUG> public int getTTL ( ) throws IOException { <END_BUG> String next = getIdentifier ( ) ; try { return TTL . parseTTL ( next ) ; } catch ( NumberFormatException e ) { throw exception ( ( "invalid<seq2seq4repair_space>TTL:<seq2seq4repair_space>" + next ) ) ; } } public Name getName ( Name origin ) throws IOException { } public void getEOL ( ) throws IOException { } public TextParseException exception ( String s ) { } }

Fix:
public long getTTL ( ) throws IOException {
Buggy code:
public class SpeedCalculator { private static final long PERIOD = 5000 ; private ArrayList < SpeedCalculator . TimeLocationPair > record ; public SpeedCalculator ( ) { } public void clearRecord ( ) { } public void addRecord ( GeoPoint geoPoint ) { } public double getSpeed ( ) { } public double getLastPeriodTime ( ) { } public double getLastPeriodSpeed ( ) { int n = record . size ( ) ; if ( n < 2 ) return 0.0 ; else { double dt = ( ( record . get ( ( n - 1 ) ) . getTime ( ) ) - ( record . get ( ( n - 2 ) ) . getTime ( ) ) ) // 1000.0 ; <START_BUG> return ( MathUtil . distanceBetween ( record . get ( ( n - 1 ) ) . getLocation ( ) , record . get ( ( n - 2 ) ) . getLocation ( ) ) ) // dt ; <END_BUG> } } public static class TimeLocationPair { private GeoPoint location ; private long time ; public TimeLocationPair ( GeoPoint geoPoint , long time ) { } public GeoPoint getLocation ( ) { } public long getTime ( ) { } } }

Fix:
return ( ( MathUtil . distanceBetween ( record . get ( ( n - 1 ) ) . getLocation ( ) , record . get ( ( n - 2 ) ) . getLocation ( ) ) ) * 1000.0 ) // dt ;
Buggy code:
public class Text extends Scrollable { int textLimit = Text . LIMIT ; int tabs = 8 ; char echoCharacter ; boolean doubleClick ; String hiddenText ; String message ; public static final int LIMIT ; public static final String DELIMITER ; static final char PASSWORD = '•' ; public Text ( Composite parent , int style ) { } public void addModifyListener ( ModifyListener listener ) { } public void addSelectionListener ( SelectionListener listener ) { } public void addVerifyListener ( VerifyListener listener ) { } public void append ( String string ) { } static int checkStyle ( int style ) { } public void clearSelection ( ) { } public Point computeSize ( int wHint , int hHint , boolean changed ) { } public void copy ( ) { checkWidget ( ) ; if ( ( ( style ) & ( SWT . SINGLE ) ) != 0 ) { } else { <START_BUG> ( ( NSTextView ) ( view ) ) . copy ( ) ; <END_BUG> } } void createHandle ( ) { } void createWidget ( ) { } public void cut ( ) { } Color defaultBackground ( ) { } Color defaultForeground ( ) { } boolean dragDetect ( int x , int y , boolean filter , boolean [ ] consume ) { } public int getCaretLineNumber ( ) { } public Point getCaretLocation ( ) { } public int getCaretPosition ( ) { } public int getCharCount ( ) { } public boolean getDoubleClickEnabled ( ) { } public char getEchoChar ( ) { } public boolean getEditable ( ) { } public int getLineCount ( ) { } public String getLineDelimiter ( ) { } public int getLineHeight ( ) { } public int getOrientation ( ) { } public String getMessage ( ) { } int getPosition ( int x , int y ) { } int getPosition ( Point point ) { } public Point getSelection ( ) { } public int getSelectionCount ( ) { } public String getSelectionText ( ) { } public int getTabs ( ) { } public String getText ( ) { } public String getText ( int start , int end ) { } public int getTextLimit ( ) { } public int getTopIndex ( ) { } public int getTopPixel ( ) { } public void insert ( String string ) { } public void paste ( ) { } void releaseWidget ( ) { } public void removeModifyListener ( ModifyListener listener ) { } public void removeSelectionListener ( SelectionListener listener ) { } public void removeVerifyListener ( VerifyListener listener ) { } public void selectAll ( ) { } boolean sendKeyEvent ( int type , Event event ) { } void setBackground ( float [ ] color ) { } public void setDoubleClickEnabled ( boolean doubleClick ) { } public void setEchoChar ( char echo ) { } public void setEditable ( boolean editable ) { } void setFont ( NSFont font ) { } void setForeground ( float [ ] color ) { } public void setOrientation ( int orientation ) { } public void setMessage ( String message ) { } public void setSelection ( int start ) { } public void setSelection ( int start , int end ) { } public void setSelection ( Point selection ) { } public void setTabs ( int tabs ) { } public void setText ( String string ) { } public void setTextLimit ( int limit ) { } public void setTopIndex ( int index ) { } public void showSelection ( ) { } int traversalCode ( int key , NSEvent theEvent ) { } String verifyText ( String string , int start , int end , Event keyEvent ) { } }

Fix:
( ( NSText ) ( view ) ) . copy ( view ) ;
Buggy code:
public class ApplicationSettingsTest extends TestCase { public ApplicationSettingsTest ( final String message ) { } public void testFrameworkVersion ( ) { } public void testExceptionOnMissingResourceDefaultValue ( ) throws Exception { } public void testExceptionOnMissingResourceSetsCorrectly ( ) throws Exception { } public void testUseDefaultOnMissingResourceDefaultValue ( ) throws Exception { } public void testUseDefaultOnMissingResourceSetsCorrectly ( ) throws Exception { } public void testDefaultStringResourceLoaderSetup ( ) { Settings settings = new Settings ( new DummyApplication ( ) ) ; List loaders = settings . getStringResourceLoaders ( ) ; <START_BUG> Assert . assertEquals ( "There<seq2seq4repair_space>should<seq2seq4repair_space>be<seq2seq4repair_space>2<seq2seq4repair_space>default<seq2seq4repair_space>loaders" , 2 , loaders . size ( ) ) ; <END_BUG> Assert . assertTrue ( "First<seq2seq4repair_space>loader<seq2seq4repair_space>one<seq2seq4repair_space>should<seq2seq4repair_space>be<seq2seq4repair_space>the<seq2seq4repair_space>component<seq2seq4repair_space>one" , ( ( loaders . get ( 0 ) ) instanceof ComponentStringResourceLoader ) ) ; Assert . assertTrue ( "Second<seq2seq4repair_space>loader<seq2seq4repair_space>should<seq2seq4repair_space>be<seq2seq4repair_space>the<seq2seq4repair_space>application<seq2seq4repair_space>one" , ( ( loaders . get ( 1 ) ) instanceof ApplicationStringResourceLoader ) ) ; } public void testOverrideStringResourceLoaderSetup ( ) { } public void testLocalizer ( ) { } }

Fix:
Assert . assertEquals ( "There<seq2seq4repair_space>should<seq2seq4repair_space>be<seq2seq4repair_space>3<seq2seq4repair_space>default<seq2seq4repair_space>loaders" , 3 , loaders . size ( ) ) ;
Buggy code:
public class MVNPPlayerListener extends PlayerListener { private MultiverseNetherPortals plugin ; private MVNameChecker nameChecker ; private WorldManager worldManager ; public MVNPPlayerListener ( MultiverseNetherPortals plugin ) { } @ Override public void onPlayerPortal ( PlayerPortalEvent event ) { <START_BUG> Location currentLocation = event . getFrom ( ) ; <END_BUG> String currentWorld = currentLocation . getWorld ( ) . getName ( ) ; String linkedWorld = this . plugin . getWorldLink ( currentWorld ) ; if ( linkedWorld != null ) { this . getNewTeleportLocation ( event , currentLocation , linkedWorld ) ; } else if ( this . nameChecker . isValidNetherName ( currentWorld ) ) { this . getNewTeleportLocation ( event , currentLocation , this . nameChecker . getNormalName ( currentWorld ) ) ; } else { this . getNewTeleportLocation ( event , currentLocation , this . nameChecker . getNetherName ( currentWorld ) ) ; } } private void getNewTeleportLocation ( PlayerPortalEvent event , Location fromLocation , String worldstring ) { } private Location getScaledLocation ( Location fromLocation , double fromScaling , double toScaling ) { } }

Fix:
Location currentLocation = event . getFrom ( ) . clone ( ) ;
Buggy code:
public class AnalysisCounterView extends StatisticPageView { private TextView title ; private TextView levelHelp ; private TextView levelHelp_value ; private TextView levelValue ; private TextView levelText ; private TextView couponValue ; private TextView couponText ; private RelativeLayout titleLayout ; private FrameLayout frameLayout ; private ImageView levelCircle ; private ImageView QuestionButton ; private DatabaseControl db ; private Typeface wordTypeface ; private Typeface digitTypefaceBold ; private QuestionDialog msgBox ; private ShowRadarChart showRadarChart ; private AlphaAnimation titleAnimation ; private static final int [ ] levelId = new int [ ] { drawable . level0 , drawable . level1 , drawable . level2 , drawable . level3 , drawable . level4 , drawable . level5 , drawable . level6 , drawable . level7 , drawable . level8 , drawable . level9 , drawable . level10 } ; public AnalysisCounterView ( ShowRadarChart showRadarChart ) { } @ Override public void clear ( ) { } @ Override public void load ( ) { } private void setAnimation ( ) { } @ SuppressWarnings ( "deprecation" ) public void updateCounter ( ) { int prev_coupon = PreferenceControl . lastShowedCoupon ( ) ; int total_point = PreferenceControl . getPoint ( ) ; int coupon = PreferenceControl . getCoupon ( ) ; int level = total_point // ( Config . COUPON_CREDITS ) ; <START_BUG> int counter = total_point % ( Config . COUPON_CREDITS ) ; <END_BUG> PreferenceControl . setShowedCoupon ( coupon ) ; PreferenceControl . setCouponChange ( false ) ; if ( prev_coupon < coupon ) { setAnimation ( ) ; if ( ( VERSION . SDK_INT ) < 16 ) titleLayout . setBackgroundDrawable ( context . getResources ( ) . getDrawable ( analysis_title_bar_highlight ) ) ; else titleLayout . setBackground ( context . getResources ( ) . getDrawable ( analysis_title_bar_highlight ) ) ; } else { if ( ( VERSION . SDK_INT ) < 16 ) titleLayout . setBackgroundDrawable ( context . getResources ( ) . getDrawable ( analyse_line ) ) ; else titleLayout . setBackground ( context . getResources ( ) . getDrawable ( analyse_line ) ) ; } levelCircle . setImageResource ( AnalysisCounterView . levelId [ counter ] ) ; levelValue . setText ( ( "Lv." + level ) ) ; levelValue . invalidate ( ) ; levelHelp_value . setText ( String . valueOf ( level ) ) ; levelHelp_value . invalidate ( ) ; couponValue . setText ( String . valueOf ( coupon ) ) ; couponValue . invalidate ( ) ; } private ArrayList < Double > calculateRank ( ) { } @ Override public void onCancel ( ) { } }

Fix:
int counter = ( total_point // ( ( Config . COUPON_CREDITS ) // 10 ) ) % 10 ;
Buggy code:
public class TotalsCursorAdaptor extends CursorAdapter { public TotalsCursorAdaptor ( Cursor cursor , Context context ) { } @ Override public View newView ( Context context , Cursor cursor , ViewGroup parent ) { } @ Override public void bindView ( View view , Context context , Cursor cursor ) { TextView nameView = ( ( TextView ) ( view . findViewById ( nameTextView ) ) ) ; TextView totalTimeView = ( ( TextView ) ( view . findViewById ( totalTimeTextView ) ) ) ; String firstName = cursor . getString ( cursor . getColumnIndexOrThrow ( "firstName" ) ) ; String lastName = cursor . getString ( cursor . getColumnIndexOrThrow ( "lastName" ) ) ; String fullName ; <START_BUG> if ( ( firstName == null ) && ( lastName == null ) ) { <END_BUG> fullName = Integer . toString ( cursor . getInt ( cursor . getColumnIndexOrThrow ( "studentID" ) ) ) ; } else { fullName = ( firstName + "<seq2seq4repair_space>" ) + lastName ; } nameView . setText ( fullName ) ; long totalMilliseconds = cursor . getLong ( cursor . getColumnIndexOrThrow ( "totalTime" ) ) ; long seconds = totalMilliseconds // 1000 ; int minutes = ( ( int ) ( seconds // 60 ) ) ; int hours = minutes // 60 ; minutes %= 60 ; totalTimeView . setText ( String . format ( "%d:%02d" , hours , minutes ) ) ; } }

Fix:
if ( ( firstName . isEmpty ( ) ) && ( lastName . isEmpty ( ) ) ) {
Buggy code:
public class SuperTypeReferencePattern extends SearchPattern { public char [ ] superQualification ; public char [ ] superSimpleName ; protected char [ ] decodedSuperQualification ; protected char [ ] decodedSuperSimpleName ; protected char decodedSuperClassOrInterface ; protected char [ ] decodedQualification ; protected char [ ] decodedSimpleName ; protected char [ ] decodedEnclosingTypeName ; protected char decodedClassOrInterface ; protected int decodedModifiers ; public HashMap entryResults ; private static final IEntryResult [ ] NO_ENTRY_RESULT = new IEntryResult [ 0 ] ; public SuperTypeReferencePattern ( char [ ] superQualification , char [ ] superSimpleName , int matchMode , boolean isCaseSensitive ) { } public void decodeIndexEntry ( IEntryResult entryResult ) { } public void feedIndexRequestor ( IIndexSearchRequestor requestor , int detailLevel , int [ ] references , IndexInput input , IJavaSearchScope scope ) throws IOException { } public void findIndexMatches ( IndexInput input , IIndexSearchRequestor requestor , int detailLevel , IProgressMonitor progressMonitor , IJavaSearchScope scope ) throws IOException { } public char [ ] indexEntryPrefix ( ) { } protected int matchContainer ( ) { } protected boolean matchIndexEntry ( ) { } public String toString ( ) { } public boolean matchesBinary ( Object binaryInfo , Object enclosingBinaryInfo ) { } public int matchLevel ( AstNode node , boolean resolve ) { if ( ! ( node instanceof TypeReference ) ) return IMPOSSIBLE_MATCH ; TypeReference typeRef = ( ( TypeReference ) ( node ) ) ; if ( resolve ) { <START_BUG> TypeBinding binding = typeRef . binding ; <END_BUG> if ( binding == null ) { return INACCURATE_MATCH ; } else { return this . matchLevelForType ( this . superSimpleName , this . superQualification , binding ) ; } } else { if ( ( this . superSimpleName ) == null ) { return this . needsResolve ? POSSIBLE_MATCH : ACCURATE_MATCH ; } else { char [ ] typeRefSimpleName = null ; if ( typeRef instanceof SingleTypeReference ) { typeRefSimpleName = ( ( SingleTypeReference ) ( typeRef ) ) . token ; } else { char [ ] [ ] tokens = ( ( QualifiedTypeReference ) ( typeRef ) ) . tokens ; typeRefSimpleName = tokens [ ( ( tokens . length ) - 1 ) ] ; } if ( this . matchesName ( this . superSimpleName , typeRefSimpleName ) ) return this . needsResolve ? POSSIBLE_MATCH : ACCURATE_MATCH ; else return IMPOSSIBLE_MATCH ; } } } public int matchLevel ( Binding binding ) { } }

Fix:
TypeBinding binding = typeRef . resolvedType ;
Buggy code:
public class MatchingOpenable { private MatchLocator locator ; public IResource resource ; public Openable openable ; private CompilationUnitDeclaration parsedUnit ; private MatchSet matchSet ; public boolean shouldResolve = true ; public MatchingOpenable ( MatchLocator locator , IResource resource , Openable openable ) { } public MatchingOpenable ( MatchLocator locator , IResource resource , Openable openable , CompilationUnitDeclaration parsedUnit , MatchSet matchSet ) { } public void buildTypeBindings ( ) { } private void buildTypeBindings ( final char [ ] source ) { } private char [ ] getQualifiedName ( ) { } public char [ ] getSource ( ) { } public boolean hasAlreadyDefinedType ( ) { } public void locateMatches ( ) throws CoreException { } private void locateMatchesInClassFile ( ) throws CoreException , JavaModelException { } private void locateMatchesInCompilationUnit ( char [ ] source ) throws CoreException { if ( ( this . parsedUnit ) == null ) { this . matchSet = new MatchSet ( this . locator ) ; this . locator . parser . matchSet = this . matchSet ; this . parsedUnit = this . locator . dietParse ( source ) ; } if ( ( this . parsedUnit ) != null ) { try { this . locator . parser . matchSet = this . matchSet ; <START_BUG> this . locator . parser . scanner . setSourceBuffer ( source ) ; <END_BUG> this . locator . parser . parseBodies ( this . parsedUnit ) ; this . matchSet . cuHasBeenResolved = false ; this . matchSet . reportMatching ( parsedUnit ) ; if ( this . matchSet . needsResolve ( ) ) { if ( ( this . parsedUnit . types ) != null ) { if ( this . shouldResolve ) { try { if ( ( this . parsedUnit . scope ) != null ) { this . parsedUnit . scope . faultInTypes ( ) ; this . parsedUnit . resolve ( ) ; } this . matchSet . cuHasBeenResolved = true ; this . matchSet . reportMatching ( this . parsedUnit ) ; } catch ( AbortCompilation e ) { this . matchSet . cuHasBeenResolved = true ; this . matchSet . reportMatching ( this . parsedUnit ) ; if ( ! ( e instanceof AbortCompilationUnit ) ) { throw e ; } } } else { this . matchSet . cuHasBeenResolved = true ; this . matchSet . reportMatching ( this . parsedUnit ) ; } } } } finally { this . locator . parser . matchSet = null ; } } } public void reset ( ) { } public String toString ( ) { } }

Fix:
this . locator . parser . scanner . setSource ( source ) ;
Buggy code:
public final class RowConsumerTaskListener implements TaskListener { private final AtomicInteger _counter = new AtomicInteger ( ) ; private final AtomicBoolean _errorsReported = new AtomicBoolean ( false ) ; private final AnalysisListener _analysisListener ; private final AnalysisJob _analysisJob ; private final TaskRunner _taskRunner ; public RowConsumerTaskListener ( AnalysisJob analysisJob , AnalysisListener analysisListener , TaskRunner taskRunner ) { } @ Override public void onBegin ( Task task ) { } @ Override public void onComplete ( Task task ) { } @ Override public void onError ( Task task , Throwable throwable ) { boolean alreadyRegisteredError = _errorsReported . getAndSet ( true ) ; if ( ! alreadyRegisteredError ) { <START_BUG> _analysisListener . errorUknown ( _analysisJob , throwable ) ; <END_BUG> } incrementCounter ( ) ; } private void incrementCounter ( ) { } public boolean isErrornous ( ) { } public void awaitTasks ( final int numTasks ) { } }

Fix:
_analysisListener . errorUnknown ( _analysisJob , throwable ) ;
Buggy code:
public class CustomES implements EA { private final GeneticAlgorithmAgent [ ] population ; private final float [ ] fitness ; private final int elite ; private final Task task ; private final int evaluationRepetitions = 1 ; private final int parent = 20 ; private final int child = 40 ; private final int untouched = 30 ; private final int mutated = 10 ; private final int chanceToPullFromUntouched = 90 ; private final int chanceToPullFromMutated = 95 ; private final int chanceToPullFromChild = 98 ; java . util . Random Random = new java . util . Random ( ) ; public CustomES ( Task task , Evolvable initial , int populationSize ) { } public void nextGeneration ( ) { <START_BUG> for ( int i = 0 ; i < ( elite ) ; i ++ ) { <END_BUG> evaluate ( i ) ; } sortPopulationByFitness ( ) ; for ( int i = ( parent ) + ( untouched ) ; i < ( ( ( parent ) + ( untouched ) ) + ( mutated ) ) ; i ++ ) { population [ i ] . mutate ( ) ; evaluate ( i ) ; } for ( int i = ( ( parent ) + ( untouched ) ) + ( mutated ) ; i < ( ( ( ( parent ) + ( untouched ) ) + ( mutated ) ) + ( child ) ) ; i ++ ) { int mateA = Random . nextInt ( parent ) ; int mateB = Random . nextInt ( parent ) ; int mateC = Random . nextInt ( parent ) ; if ( ( Random . nextInt ( 100 ) ) > ( chanceToPullFromUntouched ) ) { mateA += Random . nextInt ( untouched ) ; } if ( ( Random . nextInt ( 100 ) ) > ( chanceToPullFromUntouched ) ) { mateB += Random . nextInt ( untouched ) ; } if ( ( Random . nextInt ( 100 ) ) > ( chanceToPullFromUntouched ) ) { mateC += Random . nextInt ( untouched ) ; } if ( ( Random . nextInt ( 100 ) ) > ( chanceToPullFromMutated ) ) { mateA += Random . nextInt ( mutated ) ; } if ( ( Random . nextInt ( 100 ) ) > ( chanceToPullFromMutated ) ) { mateB += Random . nextInt ( mutated ) ; } if ( ( Random . nextInt ( 100 ) ) > ( chanceToPullFromMutated ) ) { mateC += Random . nextInt ( mutated ) ; } if ( ( Random . nextInt ( 100 ) ) > ( chanceToPullFromChild ) ) { mateC += Random . nextInt ( child ) ; } if ( ( Random . nextInt ( 100 ) ) > ( chanceToPullFromChild ) ) { mateA += Random . nextInt ( child ) ; } if ( ( Random . nextInt ( 100 ) ) > ( chanceToPullFromChild ) ) { mateB += Random . nextInt ( child ) ; } if ( ( Random . nextInt ( 100 ) ) > 98 ) { mateC += Random . nextInt ( child ) ; } population [ i ] . customMlp . psoRecombine ( population [ mateA ] . customMlp , population [ mateB ] . customMlp , population [ mateC ] . customMlp ) ; population [ i ] . mutate ( ) ; evaluate ( i ) ; } shuffle ( ) ; sortPopulationByFitness ( ) ; } private void evaluate ( int which ) { } private void shuffle ( ) { } private void sortPopulationByFitness ( ) { } private void swap ( int i , int j ) { } public Evolvable [ ] getBests ( ) { } public float [ ] getBestFitnesses ( ) { } }

Fix:
for ( int i = 0 ; i < ( ( ( ( parent ) + ( child ) ) + ( untouched ) ) + ( mutated ) ) ; i ++ ) {