nus-yam/ex-repair huggingface dataset:
Buggy code:
public class ColumnDiscoverer implements IDiscoverer { private static final Logger log = Logger . getLogger ( ColumnDiscoverer . class ) ; @ Override public void discover ( Properties databaseProperties , Properties columnProperties , Collection < String > tables ) throws DatabaseAnonymizerException { ColumnDiscoverer . log . info ( "Column<seq2seq4repair_space>discovery<seq2seq4repair_space>in<seq2seq4repair_space>process" ) ; IMetaData metaData = MetaDataFactory . fetchMetaData ( databaseProperties ) ; List < ColumnMetaData > map = metaData . getMetaData ( ) ; List < String > suspList = new ArrayList ( columnProperties . keySet ( ) ) ; ArrayList < String > matches = new ArrayList < > ( ) ; for ( String s : suspList ) { Pattern p = Pattern . compile ( s ) ; for ( ColumnMetaData pair : map ) { String tableName = pair . getTableName ( ) ; String columnName = pair . getColumnName ( ) ; if ( ( ! ( tables . isEmpty ( ) ) ) && ( ! ( tables . contains ( tableName . toLowerCase ( ) ) ) ) ) { continue ; } <START_BUG> if ( p . matcher ( columnName ) . matches ( ) ) { <END_BUG> matches . add ( ( ( tableName + "." ) + columnName ) ) ; } } } ColumnDiscoverer . log . info ( "-----------------" ) ; ColumnDiscoverer . log . info ( "List<seq2seq4repair_space>of<seq2seq4repair_space>suspects:" ) ; ColumnDiscoverer . log . info ( "-----------------" ) ; Collections . sort ( matches ) ; for ( String entry : matches ) { ColumnDiscoverer . log . info ( entry ) ; } } No newline ; at end ; of file ; }

Fix:
if ( p . matcher ( columnName . toLowerCase ( ) ) . matches ( ) ) {
Buggy code:
public class ExternalLink extends WebMarkupContainer { private static final long serialVersionUID = 1L ; private final IModel href ; private final IModel label ; private boolean contextRelative = false ; private PopupSettings popupSettings = null ; public ExternalLink ( final String id , final String href , final String label ) { } public ExternalLink ( final String id , final String href ) { } public ExternalLink ( final String id , final IModel href , final IModel label ) { } public ExternalLink ( final String id , final IModel href ) { } public final PopupSettings getPopupSettings ( ) { } public final ExternalLink setPopupSettings ( final PopupSettings popupSettings ) { } protected void onComponentTag ( ComponentTag tag ) { } protected void onComponentTagBody ( MarkupStream markupStream , ComponentTag openTag ) { this . checkComponentTag ( openTag , "a" ) ; if ( ( ( label ) != null ) && ( ( label . getObject ( ) ) != null ) ) { <START_BUG> replaceComponentTagBody ( markupStream , openTag , label . getObject ( ) . toString ( ) ) ; <END_BUG> } else { super . onComponentTagBody ( markupStream , openTag ) ; } } public boolean isContextRelative ( ) { } public ExternalLink setContextRelative ( boolean contextRelative ) { } }

Fix:
replaceComponentTagBody ( markupStream , openTag , getModelObjectAsString ( label . getObject ( ) ) ) ;
Buggy code:
public class Gen2 extends AbstractSoundGenerator { private double cf ; private double cf_rad ; private double mf ; private double mf_rad ; private double d ; private double modIndex ; private double t ; @ Override public short [ ] getMonoSamples ( int length ) { samples = new short [ length ] ; carIncr = ( ( twopi ) * ( mSynthController . getCarrierFreq ( ) ) ) * ( mSynthController . getSampleInterval ( ) ) ; modIncr = ( ( twopi ) * ( mSynthController . getModFreq ( ) ) ) * ( mSynthController . getSampleInterval ( ) ) ; modOffset = 2 * ( Math . acos ( mSynthController . getModIndex ( ) ) ) ; ampOffset = 2 * ( transfer ( mSynthController . getAmplitude ( ) ) ) ; d = 8000 ; cf = mSynthController . getCarrierFreq ( ) ; <START_BUG> mf = 300000 ; <END_BUG> cf_rad = AudioUtils . convertHzToRadians ( cf ) ; mf_rad = AudioUtils . convertHzToRadians ( mf ) ; modIndex = ( d ) // ( mf ) ; t = mSynthController . getSampleInterval ( ) ; for ( int i = 0 ; i < length ; i ++ ) { theta = Math . sin ( ( ( ( cf_rad ) * ( t ) ) + ( ( modIndex ) * ( Math . sin ( ( ( mf_rad ) * ( t ) ) ) ) ) ) ) ; t += mSynthController . getSampleInterval ( ) ; samples [ i ] = AudioUtils . scaleToShort ( 1 , theta ) ; } return samples ; } @ Override public short [ ] getStereoSamples ( int length ) { } @ Override public String getDescription ( ) { } }

Fix:
mf = mSynthController . getModFreq ( ) ;
Buggy code:
public class Server implements IServer { private ArrayList < Socket > sinks ; private ServerSocket sinkSocket ; private ServerSocket sourceSocket ; public Server ( ) { } private void setSinks ( ) { } private void listenSources ( ) { try { System . out . println ( "Waiting<seq2seq4repair_space>for<seq2seq4repair_space>connection<seq2seq4repair_space>from<seq2seq4repair_space>sources..." ) ; <START_BUG> sinkSocket = new ServerSocket ( 7001 ) ; <END_BUG> while ( true ) { Socket sourceSocket = this . sourceSocket . accept ( ) ; System . out . println ( ( ( "Connection<seq2seq4repair_space>from<seq2seq4repair_space>source:<seq2seq4repair_space>" + ( sourceSocket . getInetAddress ( ) ) ) + "<seq2seq4repair_space>was<seq2seq4repair_space>established." ) ) ; notifySink ( sourceSocket ) ; sourceSocket . close ( ) ; System . out . println ( "Waiting<seq2seq4repair_space>for<seq2seq4repair_space>connection<seq2seq4repair_space>from<seq2seq4repair_space>sources..." ) ; } } catch ( IOException e ) { e . printStackTrace ( ) ; } } @ Override public void notifySink ( Socket source ) { } public static void main ( String [ ] args ) { } }

Fix:
sourceSocket = new ServerSocket ( 7001 ) ;
Buggy code:
public class StudentBaseModel extends AbstractPaginationModel implements Serializable { private static final long serialVersionUID = - 2954819011036534693L ; @ Override public List < Filter > getFilters ( ) { } @ Override public ISearch buildSearch ( ) { Search search = new Search ( ) ; search . setSearchClass ( StudentBase . class ) ; search . setFirstResult ( getFirst ( ) ) ; search . setMaxResults ( getPageSize ( ) ) ; if ( ( null != ( id ) ) && ( ( id ) > 0 ) ) { search . addFilterEqual ( "id" , id ) ; } if ( ( null != ( name ) ) && ( ( name . trim ( ) . length ( ) ) > 0 ) ) { search . addFilterEqual ( "name" , name . trim ( ) ) ; } if ( ( null != ( studentId ) ) && ( ( studentId . trim ( ) . length ( ) ) > 0 ) ) { <START_BUG> search . addFilterEqual ( "studentId" , name . trim ( ) ) ; <END_BUG> } if ( ( null != ( email ) ) && ( ( email . trim ( ) . length ( ) ) > 0 ) ) { search . addFilterEqual ( "email" , email . trim ( ) ) ; } if ( ( null != ( majorCode ) ) && ( ( majorCode . trim ( ) . length ( ) ) > 0 ) ) { search . addFilterEqual ( "majorCode" , majorCode . trim ( ) ) ; } if ( ( null != ( majorName ) ) && ( ( majorName . trim ( ) . length ( ) ) > 0 ) ) { search . addFilterEqual ( "majorName" , majorName . trim ( ) ) ; } if ( ( null != ( className ) ) && ( ( className . trim ( ) . length ( ) ) > 0 ) ) { search . addFilterEqual ( "className" , className . trim ( ) ) ; } if ( ( null != ( aliasName ) ) && ( ( aliasName . trim ( ) . length ( ) ) > 0 ) ) { search . addFilterEqual ( "aliasName" , aliasName . trim ( ) ) ; } search . addFilterEqual ( "userType" , STUDENT . getCode ( ) ) ; return search ; } @ Override public List < SimpleExpression > wrapperFilter ( ) { } public Integer getId ( ) { } public void setId ( Integer id ) { } public Date getBirthday ( ) { } public void setBirthday ( Date birthday ) { } public String getName ( ) { } public void setName ( String name ) { } public int getGender ( ) { } public void setGender ( int gender ) { } public String getStudentId ( ) { } public void setStudentId ( String studentId ) { } public String getEmail ( ) { } public void setEmail ( String email ) { } public String getMajorCode ( ) { } public void setMajorCode ( String majorCode ) { } public String getMajorName ( ) { } public void setMajorName ( String majorName ) { } public String getClassName ( ) { } public void setClassName ( String className ) { } public String getAliasName ( ) { } public void setAliasName ( String aliasName ) { } private Integer id ; private Date birthday ; private String name ; private int gender ; private String studentId ; private String email ; private String majorCode ; private String majorName ; private String className ; private String aliasName ; }

Fix:
search . addFilterEqual ( "studentId" , studentId . trim ( ) ) ;
Buggy code:
public class MinimaxAlphaBeta extends Agent { private final int numPlys ; private static int infinity = 999999999 ; public MinimaxAlphaBeta ( int playernum , String [ ] args ) { } @ Override public Map < Integer , Action > initialStep ( State . StateView newstate , History . HistoryView statehistory ) { } @ Override public Map < Integer , Action > middleStep ( State . StateView newstate , History . HistoryView statehistory ) { } @ Override public void terminalStep ( State . StateView newstate , History . HistoryView statehistory ) { } @ Override public void savePlayerData ( OutputStream os ) { } @ Override public void loadPlayerData ( InputStream is ) { } public GameStateChild alphaBetaSearch ( GameStateChild node , int depth , double alpha , double beta ) { } public double minimax ( GameStateChild node , int depth , double alpha , double beta , boolean maximizingPlayer ) { double v = 0 ; List < GameStateChild > children = new ArrayList < GameStateChild > ( ) ; children = node . state . getChildren ( maximizingPlayer ) ; children = orderChildrenWithHeuristics ( children , maximizingPlayer ) ; if ( ( depth <= 0 ) || ( ( children . size ( ) ) == 0 ) ) { <START_BUG> node . state . getUtility ( ) ; <END_BUG> } if ( maximizingPlayer ) { v = - ( MinimaxAlphaBeta . infinity ) ; for ( int i = 0 ; i < ( children . size ( ) ) ; i ++ ) { v = Math . max ( v , minimax ( children . get ( i ) , ( depth - 1 ) , alpha , beta , false ) ) ; alpha = Math . max ( alpha , v ) ; if ( beta <= alpha ) break ; } } else { v = MinimaxAlphaBeta . infinity ; for ( int i = 0 ; i < ( children . size ( ) ) ; i ++ ) { v = Math . min ( v , minimax ( children . get ( i ) , ( depth - 1 ) , alpha , beta , true ) ) ; beta = Math . min ( beta , v ) ; if ( beta <= alpha ) break ; } } return v ; } public List < GameStateChild > orderChildrenWithHeuristics ( List < GameStateChild > children , boolean maximizingPlayer ) { } public List < GameStateChild > insertionSort ( List < GameStateChild > list , boolean maxPlayer ) { } }

Fix:
return node . state . getUtility ( ) ;
Buggy code:
public abstract class JedisClusterCommand < T > { private JedisClusterConnectionHandler connectionHandler ; private int commandTimeout ; private int redirections ; private ThreadLocal < Jedis > askConnection = new ThreadLocal < Jedis > ( ) ; public JedisClusterCommand ( JedisClusterConnectionHandler connectionHandler , int timeout , int maxRedirections ) { } public abstract T execute ( Jedis connection ) { } public T run ( String key ) { } private T runWithRetries ( String key , int redirections , boolean tryRandomNode , boolean asking ) { if ( redirections <= 0 ) { throw new JedisClusterMaxRedirectionsException ( "Too<seq2seq4repair_space>many<seq2seq4repair_space>Cluster<seq2seq4repair_space>redirections?" ) ; } Jedis connection = null ; try { if ( asking ) { connection = askConnection . get ( ) ; connection . asking ( ) ; asking = false ; } else { if ( tryRandomNode ) { connection = connectionHandler . getConnection ( ) ; } else { connection = connectionHandler . getConnectionFromSlot ( JedisClusterCRC16 . getSlot ( key ) ) ; } } return execute ( connection ) ; } catch ( JedisConnectionException jce ) { if ( tryRandomNode ) { throw jce ; } releaseConnection ( connection , true ) ; connection = null ; <START_BUG> return runWithRetries ( key , ( redirections -- ) , true , asking ) ; <END_BUG> } catch ( JedisRedirectionException jre ) { if ( jre instanceof JedisAskDataException ) { asking = true ; askConnection . set ( this . connectionHandler . getConnectionFromNode ( jre . getTargetNode ( ) ) ) ; } else if ( jre instanceof JedisMovedDataException ) { this . connectionHandler . renewSlotCache ( ) ; } else { throw new redis . clients . jedis . exceptions . JedisClusterException ( jre ) ; } releaseConnection ( connection , false ) ; connection = null ; return runWithRetries ( key , ( redirections - 1 ) , false , asking ) ; } finally { releaseConnection ( connection , false ) ; } } private void releaseConnection ( Jedis connection , boolean broken ) { } }

Fix:
return runWithRetries ( key , ( redirections - 1 ) , true , asking ) ;
Buggy code:
public class SSTableReaderTest extends CleanupHelper { @ Test public void testSpannedIndexPositions ( ) throws IOException , InterruptedException , ExecutionException { RowIndexedReader . BUFFER_SIZE = 40 ; Table table = Table . open ( "Keyspace1" ) ; ColumnFamilyStore store = table . getColumnFamilyStore ( "Standard1" ) ; instance . disableAutoCompaction ( ) ; for ( int j = 0 ; j < 100 ; j += 2 ) { byte [ ] key = String . valueOf ( j ) . getBytes ( ) ; RowMutation rm = new RowMutation ( "Keyspace1" , key ) ; <START_BUG> rm . add ( new QueryPath ( "Standard1" , null , "0" . getBytes ( ) ) , new byte [ 0 ] , j ) ; <END_BUG> rm . apply ( ) ; } store . forceBlockingFlush ( ) ; instance . submitMajor ( store ) . get ( ) ; SSTableReader sstable = store . getSSTables ( ) . iterator ( ) . next ( ) ; for ( int j = 0 ; j < 100 ; j += 2 ) { DecoratedKey dk = Util . dk ( String . valueOf ( j ) ) ; FileDataInput file = sstable . getFileDataInput ( dk , ( ( DatabaseDescriptor . getIndexedReadBufferSizeInKB ( ) ) * 1024 ) ) ; DecoratedKey keyInDisk = sstable . getPartitioner ( ) . convertFromDiskFormat ( FBUtilities . readShortByteArray ( file ) ) ; assert keyInDisk . equals ( dk ) : String . format ( "%s<seq2seq4repair_space>!=<seq2seq4repair_space>%s<seq2seq4repair_space>in<seq2seq4repair_space>%s" , keyInDisk , dk , file . getPath ( ) ) ; } for ( int j = 1 ; j < 110 ; j += 2 ) { DecoratedKey dk = Util . dk ( String . valueOf ( j ) ) ; assert ( sstable . getPosition ( dk ) ) == null ; } assert ( sstable . indexSummary . getSpannedIndexDataPositions ( ) . entrySet ( ) . size ( ) ) > 0 ; for ( Map . Entry < IndexSummary . KeyPosition , SSTable . PositionSize > entry : sstable . indexSummary . getSpannedIndexDataPositions ( ) . entrySet ( ) ) { IndexSummary . KeyPosition kp = entry . getKey ( ) ; SSTable . PositionSize info = entry . getValue ( ) ; long nextIndexPosition = ( ( ( kp . indexPosition ) + 2 ) + ( StorageService . getPartitioner ( ) . convertToDiskFormat ( kp . key ) . length ) ) + 8 ; BufferedRandomAccessFile indexFile = new BufferedRandomAccessFile ( sstable . indexFilename ( ) , "r" ) ; indexFile . seek ( nextIndexPosition ) ; String nextKey = indexFile . readUTF ( ) ; BufferedRandomAccessFile file = new BufferedRandomAccessFile ( sstable . getFilename ( ) , "r" ) ; file . seek ( ( ( info . position ) + ( info . size ) ) ) ; assertEquals ( nextKey , file . readUTF ( ) ) ; } } }

Fix:
rm . add ( new QueryPath ( "Standard1" , null , "0" . getBytes ( ) ) , new byte [ 0 ] , new TimestampClock ( j ) ) ;
Buggy code:
public class ExactAnnotationTypePattern extends AnnotationTypePattern { protected TypeX annotationType ; protected String formalName ; protected boolean resolved = false ; private boolean bindingPattern = false ; public ExactAnnotationTypePattern ( TypeX annotationType ) { } public ExactAnnotationTypePattern ( String formalName ) { } public FuzzyBoolean fastMatches ( AnnotatedElement annotated ) { } public FuzzyBoolean matches ( AnnotatedElement annotated ) { } public void resolve ( World world ) { } public AnnotationTypePattern resolveBindings ( IScope scope , Bindings bindings , boolean allowBinding ) { if ( resolved ) return this ; resolved = true ; if ( ( formalName ) != null ) { FormalBinding formalBinding = scope . lookupFormal ( formalName ) ; if ( formalBinding != null ) { if ( bindings == null ) { scope . message ( ERROR , this , "negation<seq2seq4repair_space>doesn't<seq2seq4repair_space>allow<seq2seq4repair_space>binding" ) ; return this ; } if ( ! allowBinding ) { scope . message ( ERROR , this , "name<seq2seq4repair_space>binding<seq2seq4repair_space>only<seq2seq4repair_space>allowed<seq2seq4repair_space>in<seq2seq4repair_space>@pcds,<seq2seq4repair_space>args,<seq2seq4repair_space>this,<seq2seq4repair_space>and<seq2seq4repair_space>target" ) ; return this ; } verifyIsAnnotationType ( formalBinding . getType ( ) , scope ) ; BindingAnnotationTypePattern binding = new BindingAnnotationTypePattern ( formalBinding ) ; binding . copyLocationFrom ( this ) ; bindings . register ( binding , scope ) ; binding . resolveBinding ( scope . getWorld ( ) ) ; return binding ; } else { scope . message ( ERROR , this , ( "unbound<seq2seq4repair_space>formal<seq2seq4repair_space>" + ( formalName ) ) ) ; return this ; } } else { <START_BUG> String cleanname = annotationType . getClassName ( ) ; <END_BUG> annotationType = scope . getWorld ( ) . resolve ( annotationType , true ) ; if ( ( annotationType ) == ( ResolvedTypeX . MISSING ) ) { TypeX type = null ; while ( ( type = scope . lookupType ( cleanname , this ) ) == ( ResolvedTypeX . MISSING ) ) { int lastDot = cleanname . lastIndexOf ( '.' ) ; if ( lastDot == ( - 1 ) ) break ; cleanname = ( ( cleanname . substring ( 0 , lastDot ) ) + "$" ) + ( cleanname . substring ( ( lastDot + 1 ) ) ) ; } annotationType = scope . getWorld ( ) . resolve ( type , true ) ; } verifyIsAnnotationType ( annotationType , scope ) ; return this ; } } private void verifyIsAnnotationType ( TypeX type , IScope scope ) { } private static byte VERSION = 1 ; public void write ( DataOutputStream s ) throws IOException { } public static AnnotationTypePattern read ( VersionedDataInputStream s , ISourceContext context ) throws IOException { } public boolean equals ( Object obj ) { } public int hashCode ( ) { } public String toString ( ) { } }

Fix:
String cleanname = annotationType . getName ( ) ;
Buggy code:
public abstract class ListView extends WebMarkupContainer { private static Log log = LogFactory . getLog ( ListView . class ) ; private int firstIndex = 0 ; private boolean optimizeItemRemoval = false ; private int viewSize = Integer . MAX_VALUE ; public ListView ( final String id , final IModel model ) { } public ListView ( final String id , final List list ) { } public final List getList ( ) { } public boolean getOptimizeItemRemoval ( ) { } public final int getStartIndex ( ) { } public int getViewSize ( ) { } public final Link moveDownLink ( final String id , final ListItem item ) { } public final Link moveUpLink ( final String id , final ListItem item ) { } public final Link removeLink ( final String id , final ListItem item ) { } public void setOptimizeItemRemoval ( boolean optimizeItemRemoval ) { } public ListView setStartIndex ( final int startIndex ) { } public ListView setViewSize ( final int size ) { } protected IModel getListItemModel ( final IModel listViewModel , final int index ) { } protected IModel initModel ( ) { <START_BUG> return new Model ( null ) ; <END_BUG> } protected void internalOnBeginRequest ( ) { } protected ListItem newItem ( final int index ) { } protected void onBeginPopulateItem ( final ListItem item ) { } protected void onRender ( ) { } protected abstract void populateItem ( final ListItem item ) { } protected void renderItem ( final ListItem item ) { } }

Fix:
return new Model ( ) ;
Buggy code:
public class PathUtil { public static boolean isAbsolutePath ( String path ) { } public static String normalizePath ( String absolutePath ) { } public static File getFile ( String path , String currentDirectoryPath ) { } public static String getExtensionName ( String path ) { <START_BUG> return PathUtil . getExtensionName ( path , null ) ; <END_BUG> } public static String getExtensionName ( String path , String holderExtensionName ) { } public static String clearExtensionName ( String path ) { } }

Fix:
return PathUtil . getExtensionName ( path , "html" ) ;
Buggy code:
public class LogAccessFile { private static final int LOG_RECORD_FIXED_OVERHEAD_SIZE = 16 ; private static final int LOG_RECORD_HEADER_SIZE = 12 ; private static final int LOG_RECORD_TRAILER_SIZE = 4 ; private static final int LOG_NUMBER_LOG_BUFFERS = 3 ; private LinkedList freeBuffers ; private LinkedList dirtyBuffers ; private LogAccessFileBuffer currentBuffer ; private boolean flushInProgress = false ; private final StorageRandomAccessFile log ; private final Object logFileSemaphore ; static int mon_numWritesToLog ; static int mon_numBytesToLog ; private ArrayOutputStream logOutputBuffer ; private FormatIdOutputStream logicalOut ; private boolean directWrite = false ; private long checksumInstant = - 1 ; private int checksumLength ; private int checksumLogRecordSize ; private boolean writeChecksum ; private ChecksumOperation checksumLogOperation ; private LogRecord checksumLogRecord ; private LogToFile logFactory ; private boolean databaseEncrypted = false ; public LogAccessFile ( LogToFile logFactory , StorageRandomAccessFile log , int bufferSize ) { } private byte [ ] db = new byte [ LogAccessFile . LOG_RECORD_TRAILER_SIZE ] ; public void writeLogRecord ( int length , long instant , byte [ ] data , int data_offset , byte [ ] optional_data , int optional_data_offset , int optional_data_length ) throws IOException , StandardException { } private final int writeInt ( int i , byte [ ] b , int p ) { } private final int writeLong ( long l , byte [ ] b , int p ) { } public void writeInt ( int i ) { } public void writeLong ( long l ) { } public void write ( int b ) { } public void write ( byte [ ] b , int off , int len ) { } protected void flushDirtyBuffers ( ) throws IOException { } public void flushLogAccessFile ( ) throws IOException , StandardException { } public void switchLogBuffer ( ) throws IOException , StandardException { } public void syncLogAccessFile ( ) throws IOException , StandardException { for ( int i = 0 ; ; ) { try { synchronized ( this ) { log . sync ( false ) ; } break ; } catch ( SyncFailedException sfe ) { i ++ ; try { Thread . sleep ( 200 ) ; } catch ( InterruptedException ie ) { } if ( i > 20 ) <START_BUG> throw StandardException . newException ( LOG_FULL , sfe , null ) ; <END_BUG> } } } public void corrupt ( ) throws IOException { } public void close ( ) throws IOException , StandardException { } private void writeToLog ( byte [ ] b , int off , int len ) throws IOException { } protected long reserveSpaceForChecksum ( int length , long logFileNumber , long currentPosition ) throws IOException , StandardException { } private void writeChecksumLogRecord ( ) throws IOException , StandardException { } protected void writeEndMarker ( int marker ) throws IOException , StandardException { } }

Fix:
throw StandardException . newException ( LOG_FULL , sfe ) ;
Buggy code:
public class POP3ServerCollection { private List serverList ; private POP3Server popServer ; private List listeners ; public POP3ServerCollection ( ) { } public ListIterator getServerIterator ( ) { } public POP3ServerController [ ] getList ( ) { } public void add ( AccountItem item ) { } public POP3ServerController uidGet ( int uid ) { } public POP3ServerController get ( int index ) { } public int count ( ) { } public void removePopServer ( int uid ) { int index = getIndex ( uid ) ; POP3ServerController server ; if ( index == ( - 1 ) ) { <START_BUG> log . error ( "could<seq2seq4repair_space>not<seq2seq4repair_space>find<seq2seq4repair_space>popserver" ) ; <END_BUG> return ; } else { server = ( ( POP3ServerController ) ( serverList . remove ( index ) ) ) ; } notifyListeners ( new ModelChangedEvent ( ModelChangedEvent . REMOVED ) ) ; } public int getIndex ( int uid ) { } public void saveAll ( ) { } public POP3Server getSelected ( ) { } public void addModelListener ( ModelChangeListener l ) { } private void notifyListeners ( ModelChangedEvent e ) { } }

Fix:
log . severe ( "could<seq2seq4repair_space>not<seq2seq4repair_space>find<seq2seq4repair_space>popserver" ) ;
Buggy code:
class ExpressionComparator extends FieldComparator < Double > { private final double [ ] values ; private double bottom ; private ValueSource source ; private FunctionValues scores ; private AtomicReaderContext readerContext ; public ExpressionComparator ( ValueSource source , int numHits ) { } @ Override public void setScorer ( Scorer scorer ) { super . setScorer ( scorer ) ; assert ( readerContext ) != null ; try { Map < String , Object > context = new HashMap < String , Object > ( ) ; assert scorer != null ; <START_BUG> context . put ( "scorer" , new ScoreFunctionValues ( scorer ) ) ; <END_BUG> scores = source . getValues ( context , readerContext ) ; } catch ( IOException e ) { throw new RuntimeException ( e ) ; } } @ Override public int compare ( int slot1 , int slot2 ) { } @ Override public void setBottom ( int slot ) { } @ Override public int compareBottom ( int doc ) throws IOException { } @ Override public void copy ( int slot , int doc ) throws IOException { } @ Override public FieldComparator < Double > setNextReader ( AtomicReaderContext context ) throws IOException { } @ Override public Double value ( int slot ) { } @ Override public int compareDocToValue ( int doc , Double valueObj ) throws IOException { } }

Fix:
context . put ( "scorer" , scorer ) ;
Buggy code:
public class FileListPanel extends JPanel implements ActionListener { private JTable files = null ; private transient ObjectTableModel tableModel = null ; private static final String ACTION_BROWSE = "browse" ; private JButton browse = new JButton ( JMeterUtils . getResString ( FileListPanel . ACTION_BROWSE ) ) ; private JButton clear = new JButton ( JMeterUtils . getResString ( "clear" ) ) ; private JButton delete = new JButton ( JMeterUtils . getResString ( "delete" ) ) ; private List listeners = new LinkedList ( ) ; private String title ; private String filetype ; public FileListPanel ( ) { } public FileListPanel ( String title ) { } public FileListPanel ( String title , String filetype ) { } public FileListPanel ( ChangeListener l , String title ) { } public void addChangeListener ( ChangeListener l ) { } private void init ( ) { } public void enableFile ( boolean enable ) { } public void addFilename ( String f ) { } public void clearFiles ( ) { } public void setFiles ( String [ ] files ) { } public String [ ] getFiles ( ) { } protected void deleteFile ( ) { } private void fireFileChanged ( ) { } protected void initializeTableModel ( ) { <START_BUG> tableModel = new ObjectTableModel ( new String [ ] { "Library" } , new Functor [ 0 ] , new Functor [ 0 ] , new Class [ ] { String . class } ) ; <END_BUG> } public void actionPerformed ( ActionEvent e ) { } }

Fix:
tableModel = new ObjectTableModel ( new String [ ] { "Library" } , new Functor [ 0 ] , new Functor [ 0 ] , new Class [ ] { String . class } , false ) ;
Buggy code:
public class SWTException extends RuntimeException { public int code ; public Throwable throwable ; static final long serialVersionUID = 3257282552304842547L ; public SWTException ( ) { } public SWTException ( String message ) { } public SWTException ( int code ) { } public SWTException ( int code , String message ) { } public Throwable getCause ( ) { } public String getMessage ( ) { } public void printStackTrace ( ) { super . printStackTrace ( ) ; <START_BUG> if ( ( throwable ) != null ) { <END_BUG> System . err . println ( "***<seq2seq4repair_space>Stack<seq2seq4repair_space>trace<seq2seq4repair_space>of<seq2seq4repair_space>contained<seq2seq4repair_space>exception<seq2seq4repair_space>***" ) ; throwable . printStackTrace ( ) ; } } }

Fix:
if ( ( ! ( SWT . IS_JDK1_4 ) ) && ( ( throwable ) != null ) ) {
Buggy code:
@ Component @ Profile ( "demodata" ) public class DataBasePopulator { private static final Logger LOG = LoggerFactory . getLogger ( DataBasePopulator . class ) ; @ Autowired private MatchService matchService ; @ Autowired private UserService userService ; @ Autowired private BettingService bettingService ; @ PostConstruct public void initDatabaseWithDemoData ( ) { DataBasePopulator . LOG . info ( "initDatabaseWithDemoData:<seq2seq4repair_space>inserting<seq2seq4repair_space>demo<seq2seq4repair_space>data..." ) ; userService . createAndSaveUser ( "admin" , "admin" , "ROLE_USER" , "ROLE_ADMIN" ) ; AppUser appUser = userService . createAndSaveUser ( "michael" , "michael" , "ROLE_USER" ) ; Match match = matchService . createAndSaveMatch ( "Bulgarien" , "Irland" , 3 , 5 , "Gruppe<seq2seq4repair_space>A" ) ; <START_BUG> bettingService . createBetting ( appUser , match , 2 , 1 ) ; <END_BUG> } }

Fix:
bettingService . createAndSaveBetting ( appUser , match , 2 , 1 ) ;
Buggy code:
public abstract class JashingFilter extends SparkFilter { private Jashing jashing ; @ Override protected SparkApplication getApplication ( FilterConfig filterConfig ) throws ServletException { } @ Override public void init ( FilterConfig filterConfig ) throws ServletException { <START_BUG> Jashing jashing = Jashing . newOne ( ) . registerModule ( getModules ( ) ) . build ( CONTAINER ) ; <END_BUG> jashing . bootstrap ( ) ; this . jashing = jashing ; super . init ( filterConfig ) ; } @ Override public void destroy ( ) { } protected abstract Module [ ] getModules ( ) { } }

Fix:
Jashing jashing = Jashing . builder ( ) . registerModule ( getModules ( ) ) . build ( CONTAINER ) ;
Buggy code:
public class Header extends AbstractTestElement implements Serializable { private static String NAME = "Header.name" ; private static String VALUE = "Header.value" ; public Header ( ) { } public Header ( String name , String value ) { } public void addConfigElement ( ConfigElement config ) { } public boolean expectsModification ( ) { } public String getClassLabel ( ) { } public String getValue ( ) { <START_BUG> return ( ( String ) ( this . getProperty ( Header . VALUE ) ) ) ; <END_BUG> } public synchronized void setValue ( String value ) { } public String toString ( ) { } }

Fix:
return getPropertyAsString ( Header . VALUE ) ;
Buggy code:
class QueryExecutor { private final SQLDatabase database ; private final Datastore datastore ; private final ExecutorService queue ; private static final Logger logger = Logger . getLogger ( QueryExecutor . class . getName ( ) ) ; private static final int SMALL_RESULT_SET_SIZE_THRESHOLD = 500 ; QueryExecutor ( SQLDatabase database , Datastore datastore , ExecutorService queue ) { } public QueryResult find ( Map < String , Object > query , final Map < String , Object > indexes , long skip , long limit , List < String > fields , final List < Map < String , String > > sortDocument ) { } protected ChildrenQueryNode translateQuery ( Map < String , Object > query , Map < String , Object > indexes , Boolean [ ] indexesCoverQuery ) { } protected UnindexedMatcher matcherForIndexCoverage ( Boolean [ ] indexesCoverQuery , Map < String , Object > selector ) { } private boolean validateSortDocument ( List < Map < String , String > > sortDocument ) { } private boolean validateFields ( List < String > fields ) { if ( fields == null ) { return true ; } for ( String field : fields ) { <START_BUG> if ( field . contains ( "\\." ) ) { <END_BUG> String msg = String . format ( "Projection<seq2seq4repair_space>field<seq2seq4repair_space>cannot<seq2seq4repair_space>use<seq2seq4repair_space>dotted<seq2seq4repair_space>notation:<seq2seq4repair_space>%s" , field ) ; QueryExecutor . logger . log ( Level . SEVERE , msg ) ; return false ; } } return true ; } private List < String > normaliseFields ( List < String > fields ) { } protected Set < String > executeQueryTree ( QueryNode node , SQLDatabase db ) { } private List < String > sortIds ( Set < String > docIdSet , List < Map < String , String > > sortDocument , Map < String , Object > indexes , SQLDatabase db ) { } protected static SqlParts sqlToSortIds ( Set < String > docIdSet , List < Map < String , String > > sortDocument , Map < String , Object > indexes ) { } @ SuppressWarnings ( "unchecked" ) private static String chooseIndexForSort ( List < Map < String , String > > sortDocument , Map < String , Object > indexes ) { } No newline ; at end ; of file ; }

Fix:
if ( field . contains ( "." ) ) {
Buggy code:
public abstract class AbstractBatchTestCase { static final String ENCODING = "utf-8" ; public static WebArchive createDefaultWar ( final String warName , final Package pkg , final String jobXml ) { <START_BUG> return ShrinkWrap . create ( WebArchive . class , warName ) . addPackage ( AbstractBatchTestCase . class . getPackage ( ) ) . addClasses ( TimeoutUtil . class ) . addAsWebInfResource ( INSTANCE , "beans.xml" ) . addAsManifestResource ( pkg , jobXml , ( "batch-jobs//" + jobXml ) ) . setManifest ( new Asset ( ) { <END_BUG> public InputStream openStream ( ) { ManifestBuilder builder = ManifestBuilder . newInstance ( ) ; builder . addManifestHeader ( "Dependencies" , "org.jboss.msc,org.wildfly.security.manager" ) ; return builder . openStream ( ) ; } } ) ; } protected static String performCall ( final String url ) throws IOException , ExecutionException , TimeoutException { } public static class UrlBuilder { private final URL url ; private final String [ ] paths ; private final Map < String , String > params ; private UrlBuilder ( final URL url , final String ... paths ) { } public static AbstractBatchTestCase . UrlBuilder of ( final URL url , final String ... paths ) { } public AbstractBatchTestCase . UrlBuilder addParameter ( final String key , final int value ) { } public AbstractBatchTestCase . UrlBuilder addParameter ( final String key , final String value ) { } public String build ( ) throws UnsupportedEncodingException { } } public static class LoggingSetup implements ServerSetupTask { static final ModelNode WELD_BOOTSTRAP_LOGGER_ADDRESS ; @ Override public void setup ( final ManagementClient managementClient , final String containerId ) throws Exception { } @ Override public void tearDown ( final ManagementClient managementClient , final String containerId ) throws Exception { } static ModelNode execute ( final ModelControllerClient client , final ModelNode op ) throws IOException { } } }

Fix:
return ShrinkWrap . create ( WebArchive . class , warName ) . addPackage ( AbstractBatchTestCase . class . getPackage ( ) ) . addClasses ( TimeoutUtil . class ) . addAsWebInfResource ( INSTANCE , "beans.xml" ) . addAsWebInfResource ( pkg , jobXml , ( "classes//META-INF//batch-jobs//" + jobXml ) ) . setManifest ( new Asset ( ) {
Buggy code:
public class StickyPistonTrackerTask extends BukkitRunnable { private BlockFace direction ; private Block block ; private Block movedBlock ; public StickyPistonTrackerTask ( BlockFace direction , Block block , Block movedBlock ) { } @ Override public void run ( ) { if ( ! ( mcMMO . getPlaceStore ( ) . isTrue ( movedBlock ) ) ) { return ; } if ( ! ( BlockUtils . isPistonPiece ( movedBlock . getState ( ) ) ) ) { return ; } mcMMO . getPlaceStore ( ) . setFalse ( movedBlock ) ; <START_BUG> mcMMO . getPlaceStore ( ) . setTrue ( block . getRelative ( direction ) ) ; <END_BUG> } }

Fix:
mcMMO . getPlaceStore ( ) . setTrue ( movedBlock . getRelative ( direction ) ) ;
Buggy code:
public class MigrateResult < T extends CSVEntity > { private int successCount ; private int failCount ; private String stageName ; private CSVFile errorFile ; public MigrateResult ( String stageName ) { } public boolean hasFailed ( ) { } public void addResult ( RowResult < T > rowResult ) { } public int numberOfFailedRecords ( ) { } public int numberOfSuccessfulRecords ( ) { } public String getStageName ( ) { } public void setErrorFile ( CSVFile errorFile ) { } public String getErrorFileName ( ) { } public boolean isValidationStage ( ) { <START_BUG> return stageName . equals ( VALIDATION . getName ( ) ) ; <END_BUG> } @ Override public String toString ( ) { } }

Fix:
return stageName . equals ( VALIDATION_STAGENAME ) ;
Buggy code:
public class ExternalToolsManager { private static ExternalToolsManager instance = new ExternalToolsManager ( ) ; private ExternalToolsExtensionHandler handler ; private ExternalToolsManager ( ) { } public static ExternalToolsManager getInstance ( ) { } private ExternalToolsExtensionHandler getHandler ( ) { } public File getLocationOfExternalTool ( String toolID ) { AbstractExternalToolsPlugin plugin = null ; try { IExtension extension = getHandler ( ) . getExtension ( toolID ) ; <START_BUG> plugin = ( ( AbstractExternalToolsPlugin ) ( extension . instanciateExtension ( new Object [ ] { null } ) ) ) ; <END_BUG> } catch ( Exception e1 ) { e1 . printStackTrace ( ) ; return null ; } XmlElement root = getConfiguration ( toolID ) ; if ( root == null ) { XmlElement parent = Config . getInstance ( ) . get ( "external_tools" ) . getElement ( "tools" ) ; XmlElement child = new XmlElement ( "tool" ) ; child . addAttribute ( "first_time" , "true" ) ; child . addAttribute ( "name" , toolID ) ; parent . addElement ( child ) ; root = child ; } boolean firsttime = false ; if ( root . getAttribute ( "first_time" ) . equals ( "true" ) ) { firsttime = true ; } if ( firsttime ) { ExternalToolsWizardLauncher launcher = new ExternalToolsWizardLauncher ( ) ; launcher . launchWizard ( toolID , true ) ; if ( launcher . isFinished ( ) ) { XmlElement r = getConfiguration ( toolID ) ; File file = new File ( r . getAttribute ( "location" ) ) ; return file ; } } else { String location = root . getAttribute ( "location" ) ; File file = new File ( location ) ; return file ; } return null ; } public XmlElement getConfiguration ( String id ) { } }

Fix:
plugin = ( ( AbstractExternalToolsPlugin ) ( extension . instanciateExtension ( null ) ) ) ;
Buggy code:
class LogoutHandler implements ManagementHttpHandler { private NonceFactory nonceFactory = new NonceFactory ( ) ; private String realm ; @ Override public void start ( HttpServer httpServer , SecurityRealm securityRealm ) { } @ Override public void stop ( HttpServer httpServer ) { } @ Override public void handle ( HttpExchange exchange ) throws IOException { final Headers requestHeaders = exchange . getRequestHeaders ( ) ; final Headers responseHeaders = exchange . getResponseHeaders ( ) ; if ( ( realm ) == null ) { responseHeaders . set ( Constants . LOCATION , "//" ) ; exchange . sendResponseHeaders ( 307 , ( - 1 ) ) ; } String authorization = requestHeaders . getFirst ( "Authorization" ) ; String rawQuery = exchange . getRequestURI ( ) . getRawQuery ( ) ; boolean query = ( rawQuery != null ) && ( rawQuery . contains ( "logout" ) ) ; String userAgent = requestHeaders . getFirst ( "User-Agent" ) ; boolean opera = ( userAgent != null ) && ( userAgent . contains ( "Opera" ) ) ; boolean win = ( ( ! opera ) && ( userAgent != null ) ) && ( userAgent . contains ( "MSIE" ) ) ; <START_BUG> String referrer = responseHeaders . getFirst ( "Referrer" ) ; <END_BUG> String protocol = "http" ; String host = null ; if ( referrer != null ) { try { URI uri = new URI ( referrer ) ; protocol = uri . getScheme ( ) ; host = ( uri . getHost ( ) ) + ( ( uri . getPort ( ) ) == ( - 1 ) ? "" : ":" + ( String . valueOf ( uri . getPort ( ) ) ) ) ; } catch ( URISyntaxException e ) { } } if ( host == null ) { host = requestHeaders . getFirst ( "Host" ) ; if ( host == null ) { exchange . sendResponseHeaders ( 500 , ( - 1 ) ) ; return ; } } if ( ( ! win ) && ( ( authorization == null ) || ( ! ( authorization . contains ( "enter-login-here" ) ) ) ) ) { if ( ! query ) { responseHeaders . set ( Constants . LOCATION , ( ( ( protocol + ":////enter-login-here:blah@" ) + host ) + "//logout?logout" ) ) ; exchange . sendResponseHeaders ( 307 , ( - 1 ) ) ; return ; } String realm = ( opera ) ? "HIT<seq2seq4repair_space>THE<seq2seq4repair_space>ESCAPE<seq2seq4repair_space>KEY" : this . realm ; DigestAuthenticator . DigestContext context = DigestAuthenticator . getOrCreateNegotiationContext ( exchange , nonceFactory , false ) ; responseHeaders . add ( Constants . WWW_AUTHENTICATE_HEADER , ( "Digest<seq2seq4repair_space>" + ( DigestAuthenticator . createChallenge ( context , realm , false ) ) ) ) ; exchange . sendResponseHeaders ( 401 , 0 ) ; PrintStream print = new PrintStream ( exchange . getResponseBody ( ) ) ; print . println ( ( ( ( ( "<html><script<seq2seq4repair_space>type=\'text//javascript\'>window.location=\"" + protocol ) + ":////" ) + host ) + "//\";<//script><//html>" ) ) ; print . flush ( ) ; print . close ( ) ; return ; } responseHeaders . set ( Constants . LOCATION , ( ( ( protocol + ":////" ) + host ) + "//" ) ) ; exchange . sendResponseHeaders ( 307 , ( - 1 ) ) ; } }

Fix:
String referrer = responseHeaders . getFirst ( "Referer" ) ;
Buggy code:
public class XmlTag extends MarkupElement { public static final XmlTag . Type CLOSE = new XmlTag . Type ( "CLOSE" ) ; public static final XmlTag . Type OPEN = new XmlTag . Type ( "OPEN" ) ; public static final XmlTag . Type OPEN_CLOSE = new XmlTag . Type ( "OPEN_CLOSE" ) ; ValueMap attributes = new ValueMap ( ) ; int columnNumber ; int length ; int lineNumber ; String name ; String namespace ; int pos ; String text ; XmlTag . Type type ; private XmlTag closes ; private XmlTag copyOf = this ; private boolean isMutable = true ; private boolean nameChanged = false ; public static final class Type extends EnumeratedType { Type ( final String name ) { } } public XmlTag ( ) { } public final boolean closes ( final XmlTag open ) { } public ValueMap getAttributes ( ) { } public int getColumnNumber ( ) { } public int getLength ( ) { } public int getLineNumber ( ) { } public String getName ( ) { } public boolean getNameChanged ( ) { } public String getNamespace ( ) { } public final XmlTag getOpenTag ( ) { } public int getPos ( ) { } public String getString ( final String key ) { } public XmlTag . Type getType ( ) { } public boolean isClose ( ) { } public final boolean isMutable ( ) { } public boolean isOpen ( ) { } public boolean isOpenClose ( ) { } public void makeImmutable ( ) { } public XmlTag mutable ( ) { } public Object put ( final String key , final boolean value ) { } public Object put ( final String key , final int value ) { } public Object put ( final String key , final String value ) { } public Object put ( final String key , final StringValue value ) { <START_BUG> return attributes . put ( key . toLowerCase ( ) , value ) ; <END_BUG> } public void putAll ( final Map map ) { } public void remove ( final String key ) { } public void setName ( final String name ) { } public void setOpenTag ( final XmlTag tag ) { } public void setType ( final XmlTag . Type type ) { } public String toDebugString ( ) { } public String toString ( ) { } public String toUserDebugString ( ) { } public String toXmlString ( ) { } }

Fix:
return attributes . put ( key . toLowerCase ( ) , value . toString ( ) ) ;
Buggy code:
public class Host implements WebHost , Service < Host > { private final PathHandler pathHandler = new PathHandler ( ) ; private final Set < String > allAliases ; private final String name ; private final InjectedValue < Server > server = new InjectedValue ( ) ; private final InjectedValue < UndertowService > undertowService = new InjectedValue ( ) ; private final Set < Deployment > deployments = Collections . synchronizedSet ( new HashSet < Deployment > ( ) ) ; protected Host ( String name , List < String > aliases ) { } @ Override public void start ( StartContext context ) throws StartException { } @ Override public void stop ( StopContext context ) { } @ Override public Host getValue ( ) throws IllegalArgumentException , IllegalStateException { } protected InjectedValue < Server > getServerInjection ( ) { } public Server getServer ( ) { } protected InjectedValue < UndertowService > getUndertowService ( ) { } public Set < String > getAllAliases ( ) { } public String getName ( ) { } protected HttpHandler getRootHandler ( ) { } public void registerDeployment ( final Deployment deployment , HttpHandler handler ) { } public void unregisterDeployment ( final Deployment deployment ) { } public void registerHandler ( String path , HttpHandler handler ) { } public void unregisterHandler ( String path ) { } public Set < String > getContexts ( ) { } public Set < Deployment > getDeployments ( ) { } @ Override public WebDeploymentController addWebDeployment ( final WebDeploymentBuilder webDeploymentBuilder ) throws Exception { } private class WebDeploymentControllerImpl implements WebDeploymentController { private final DeploymentInfo deploymentInfo ; private volatile DeploymentManager manager ; private WebDeploymentControllerImpl ( final DeploymentInfo deploymentInfo ) { } @ Override public void create ( ) throws Exception { } @ Override public void start ( ) throws Exception { } @ Override public void stop ( ) throws Exception { } @ Override public void destroy ( ) throws Exception { manager . undeploy ( ) ; ServletContainer container = getServerInjection ( ) . getValue ( ) . getServletContainer ( ) . getValue ( ) . getServletContainer ( ) ; <START_BUG> container . removeDeployment ( deploymentInfo . getDeploymentName ( ) ) ; <END_BUG> } } }

Fix:
container . removeDeployment ( deploymentInfo ) ;
Buggy code:
public class ServoReporter implements MetricsReporter { private static final Logger log = LoggerFactory . getLogger ( ServoReporter . class ) ; private final ScheduledExecutorService scheduler = Executors . newSingleThreadScheduledExecutor ( new ThreadFactoryBuilder ( ) . setDaemon ( false ) . setNameFormat ( "ServoReporter-%d" ) . build ( ) ) ; private String clientId ; private ConcurrentMap < DoubleGauge , KafkaMetric > gauges = new ConcurrentHashMap < DoubleGauge , KafkaMetric > ( ) ; @ Override public void init ( List < KafkaMetric > metrics ) { } private void addMetric ( KafkaMetric metric ) { <START_BUG> gauges . put ( Servo . getDoubleGauge ( MonitorConfig . builder ( ( "kafka.producer." + ( metric . name ( ) ) ) ) . withTag ( "clientId" , clientId ) . build ( ) ) , metric ) ; <END_BUG> } @ Override public void metricChange ( KafkaMetric metric ) { } @ Override public void close ( ) { } @ Override public void configure ( Map < String , ? > configs ) { } }

Fix:
gauges . put ( Servo . getDoubleGauge ( MonitorConfig . builder ( ( "kafka.producer." + ( metric . metricName ( ) ) ) ) . withTag ( "clientId" , clientId ) . build ( ) ) , metric ) ;