nus-yam/ex-repair huggingface dataset:
Buggy code:
public abstract class SSHBase extends Task implements LogListener { private String host ; private String keyfile ; private String knownHosts ; private boolean trust = false ; private int port = 22 ; private boolean failOnError = true ; private SSHUserInfo userInfo ; public SSHBase ( ) { } public void setHost ( String host ) { } public String getHost ( ) { } public void setFailonerror ( boolean failure ) { } public boolean getFailonerror ( ) { } public void setUsername ( String username ) { } public void setPassword ( String password ) { } public void setKeyfile ( String keyfile ) { } public void setPassphrase ( String passphrase ) { } public void setKnownhosts ( String knownHosts ) { } public void setTrust ( boolean yesOrNo ) { } public void setPort ( int port ) { } public int getPort ( ) { } public void init ( ) throws BuildException { } protected Session openSession ( ) throws JSchException { JSch jsch = new JSch ( ) ; if ( null != ( userInfo . getKeyfile ( ) ) ) { <START_BUG> jsch . addIdentity ( userInfo . getKeyfile ( ) , "passphrase" ) ; <END_BUG> } if ( ( knownHosts ) != null ) { log ( ( "Using<seq2seq4repair_space>known<seq2seq4repair_space>hosts:<seq2seq4repair_space>" + ( knownHosts ) ) , MSG_DEBUG ) ; jsch . setKnownHosts ( knownHosts ) ; } Session session = jsch . getSession ( userInfo . getName ( ) , host , port ) ; session . setUserInfo ( userInfo ) ; log ( ( ( ( "Connecting<seq2seq4repair_space>to<seq2seq4repair_space>" + ( host ) ) + ":" ) + ( port ) ) ) ; session . connect ( ) ; return session ; } protected SSHUserInfo getUserInfo ( ) { } }

Fix:
jsch . addIdentity ( userInfo . getKeyfile ( ) ) ;
Buggy code:
public class AbstractRandomGeneratorTest extends RandomDataTest { protected TestRandomGenerator testGenerator = new TestRandomGenerator ( ) ; public AbstractRandomGeneratorTest ( String name ) { } public static Test suite ( ) { } public void testNextInt ( ) { try { <START_BUG> int x = testGenerator . nextInt ( ( - 1 ) ) ; <END_BUG> fail ( "IllegalArgumentException<seq2seq4repair_space>expected" ) ; } catch ( IllegalArgumentException ex ) { } Frequency freq = new Frequency ( ) ; int value = 0 ; for ( int i = 0 ; i < ( smallSampleSize ) ; i ++ ) { value = testGenerator . nextInt ( 4 ) ; assertTrue ( "nextInt<seq2seq4repair_space>range" , ( ( value >= 0 ) && ( value <= 3 ) ) ) ; freq . addValue ( value ) ; } long [ ] observed = new long [ 4 ] ; for ( int i = 0 ; i < 4 ; i ++ ) { observed [ i ] = freq . getCount ( i ) ; } assertTrue ( "chi-square<seq2seq4repair_space>test<seq2seq4repair_space>--<seq2seq4repair_space>will<seq2seq4repair_space>fail<seq2seq4repair_space>about<seq2seq4repair_space>1<seq2seq4repair_space>in<seq2seq4repair_space>1000<seq2seq4repair_space>times" , ( ( testStatistic . chiSquare ( expected , observed ) ) < 16.27 ) ) ; } public void testNextLong ( ) { } public void testNextBoolean ( ) { } public void testNextFloat ( ) { } }

Fix:
testGenerator . nextInt ( ( - 1 ) ) ;
Buggy code:
@ WebServlet ( "//AddNotice" ) @ SuppressWarnings ( "serial" ) public class AddNotice extends HttpServlet { protected void doGet ( HttpServletRequest request , HttpServletResponse response ) throws ServletException , IOException { } protected void doPost ( HttpServletRequest request , HttpServletResponse response ) throws ServletException , IOException { HttpSession session = request . getSession ( false ) ; Writer wt = response . getWriter ( ) ; if ( null == session ) { wt . write ( "Invalid<seq2seq4repair_space>Access" ) ; return ; } Byte userType = ( ( Byte ) ( session . getAttribute ( "userType" ) ) ) ; if ( ( null == userType ) || ( userType != ( Login . ADMIN ) ) ) { wt . write ( "Invalid<seq2seq4repair_space>Access" ) ; return ; } String title = request . getParameter ( "title" ) ; String content = request . getParameter ( "content" ) ; if ( ( ( ( null == title ) || ( null == content ) ) || ( ( title . length ( ) ) == 0 ) ) || ( ( content . length ( ) ) == 0 ) ) { wt . write ( "Invalid<seq2seq4repair_space>Parameter" ) ; return ; } try { Connection conn = MySqlConnection . getConnection ( ) ; Statement stmt = conn . createStatement ( ) ; <START_BUG> stmt . executeUpdate ( ( ( ( ( "INSERT<seq2seq4repair_space>INTO<seq2seq4repair_space>Notice<seq2seq4repair_space>(title,content,day)<seq2seq4repair_space>VALUE<seq2seq4repair_space>('" + ( Comment . toDatabase ( title ) ) ) + "','" ) + ( Comment . toDatabase ( content ) ) ) + "',CURDATE()" ) ) ; <END_BUG> stmt . close ( ) ; conn . close ( ) ; wt . write ( "ok" ) ; } catch ( SQLException e ) { wt . write ( "Database<seq2seq4repair_space>Error" ) ; e . printStackTrace ( ) ; } } }

Fix:
stmt . executeUpdate ( ( ( ( ( "INSERT<seq2seq4repair_space>INTO<seq2seq4repair_space>Notice<seq2seq4repair_space>(title,content,day)<seq2seq4repair_space>VALUE<seq2seq4repair_space>('" + ( Comment . toDatabase ( title ) ) ) + "','" ) + ( Comment . toDatabase ( content ) ) ) + "',CURDATE())" ) ) ;
Buggy code:
@ SuppressWarnings ( "serial" ) class PrettyPrintList < E > extends ArrayList < E > { interface ListPrinter < E > { String toString ( E e ) throws Exception { } } final PrettyPrintList . ListPrinter < E > printer ; PrettyPrintList ( PrettyPrintList . ListPrinter < E > printer ) { } PrettyPrintList ( int size , PrettyPrintList . ListPrinter < E > printer ) { } @ Override public String toString ( ) { Iterator < E > i = iterator ( ) ; if ( ! ( i . hasNext ( ) ) ) return "" ; StringBuilder sb = new StringBuilder ( ) ; try { for ( ; ; ) { E e = i . next ( ) ; <START_BUG> printer . toString ( e ) ; <END_BUG> if ( ! ( i . hasNext ( ) ) ) return sb . toString ( ) ; sb . append ( "\n" ) ; } } catch ( Exception ex ) { throw new IllegalStateException ( "Cannot<seq2seq4repair_space>create<seq2seq4repair_space>String<seq2seq4repair_space>representation" , ex ) ; } } No newline ; at end ; of file ; }

Fix:
sb . append ( printer . toString ( e ) ) ;
Buggy code:
public class CompareWithManifest extends AbstractCurationTask { private int status = Curator . CURATE_SUCCESS ; private final String manifestGroupName = ConfigurationManager . getProperty ( "replicate" , "group.manifest.name" ) ; @ Override public int perform ( DSpaceObject dso ) throws IOException { ReplicaManager repMan = ReplicaManager . instance ( ) ; <START_BUG> String objId = repMan . storageId ( dso . getHandle ( ) , null ) ; <END_BUG> try { Context context = new Context ( ) ; checkManifest ( repMan , objId , context ) ; context . complete ( ) ; } catch ( SQLException sqlE ) { throw new IOException ( sqlE ) ; } return status ; } private void checkManifest ( ReplicaManager repMan , String id , Context context ) throws IOException , SQLException { } }

Fix:
String objId = repMan . storageId ( dso . getHandle ( ) , MANIFEST_EXTENSION ) ;
Buggy code:
public enum TempPath implements CompileParameter { INSTANCE ; private static final String CACHE_NAME = "temp_path_cache" ; public static File getTempPath ( final Context context ) { } private static boolean prepareSystemTempPath ( final Context context ) { } private static boolean prepareCustomPath ( final Context context , final File path ) { } @ Override public boolean check ( final Context context ) { if ( context . contains ( TEMP ) ) { final String value = context . get ( TEMP ) ; if ( ( value != null ) && ( ( value . length ( ) ) > 0 ) ) { final File path = new File ( value ) ; if ( ! ( path . exists ( ) ) ) { context . error ( ( ( "Temporary<seq2seq4repair_space>path<seq2seq4repair_space>provided<seq2seq4repair_space>(" + value ) + "),<seq2seq4repair_space>but<seq2seq4repair_space>doesn't<seq2seq4repair_space>exists.<seq2seq4repair_space>Please<seq2seq4repair_space>create<seq2seq4repair_space>it<seq2seq4repair_space>or<seq2seq4repair_space>use<seq2seq4repair_space>system<seq2seq4repair_space>path." ) ) ; return false ; } if ( ! ( path . isDirectory ( ) ) ) { context . error ( ( "Temporary<seq2seq4repair_space>path<seq2seq4repair_space>provided,<seq2seq4repair_space>but<seq2seq4repair_space>it's<seq2seq4repair_space>not<seq2seq4repair_space>a<seq2seq4repair_space>directory:<seq2seq4repair_space>" + value ) ) ; return false ; } <START_BUG> if ( ( path . listFiles ( ) . length ) > 1 ) { <END_BUG> context . error ( "Temporary<seq2seq4repair_space>path<seq2seq4repair_space>contains<seq2seq4repair_space>files." ) ; if ( ! ( context . canInteract ( ) ) ) { context . error ( "Please<seq2seq4repair_space>manage<seq2seq4repair_space>the<seq2seq4repair_space>path<seq2seq4repair_space>you<seq2seq4repair_space>have<seq2seq4repair_space>assigned<seq2seq4repair_space>as<seq2seq4repair_space>temporary." ) ; return false ; } final String delete = context . ask ( "Delete<seq2seq4repair_space>them?<seq2seq4repair_space>(y//N):" ) ; if ( ! ( "y" . equalsIgnoreCase ( delete ) ) ) { return false ; } else { return TempPath . prepareCustomPath ( context , path ) ; } } context . cache ( TempPath . CACHE_NAME , path ) ; return true ; } } return TempPath . prepareSystemTempPath ( context ) ; } @ Override public void run ( final Context context ) { } @ Override public String getShortDescription ( ) { } @ Override public String getDetailedDescription ( ) { } }

Fix:
if ( ( path . listFiles ( ) . length ) > 0 ) {
Buggy code:
public class TradeTest { private static IMocksControl control ; private static Terminal terminal ; private static Terminal terminal2 ; private static SecurityDescriptor descr ; private Trade trade ; private static Calendar cal ; @ BeforeClass public static void setUpBeforeClass ( ) throws Exception { } @ Before public void setUp ( ) throws Exception { } private Trade createTrade ( Long id , String time ) throws Exception { } @ Test public void testConstruct1 ( ) throws Exception { } @ Test public void testConstruct0 ( ) throws Exception { } @ Test public void testSetTerminal ( ) throws Exception { } @ Test public void testToString ( ) { TradeTest . control . replay ( ) ; <START_BUG> assertEquals ( ( "Trade:<seq2seq4repair_space>2010-09-01T03:45:15.000+04:00<seq2seq4repair_space>#105<seq2seq4repair_space>Buy<seq2seq4repair_space>" + "SBER@EQBR(STK//RUB)<seq2seq4repair_space>1x100.0<seq2seq4repair_space>Vol=200.0" ) , trade . toString ( ) ) ; <END_BUG> } @ Test public void testEquals ( ) throws Exception { } @ Test public void testEquals_SpecialCases ( ) throws Exception { } @ Test public void testHashCode ( ) throws Exception { } @ Test public void testGetSecurity ( ) throws Exception { } @ Test public void testCompareTo ( ) throws Exception { } }

Fix:
assertEquals ( ( ( ( "Trade:<seq2seq4repair_space>" + ( trade . getTime ( ) ) ) + "<seq2seq4repair_space>#105<seq2seq4repair_space>Buy<seq2seq4repair_space>" ) + "SBER@EQBR(STK//RUB)<seq2seq4repair_space>1x100.0<seq2seq4repair_space>Vol=200.0" ) , trade . toString ( ) ) ;
Buggy code:
public class ProcessEvent extends SimEvent { public ProcessEvent ( double eventTime , BGPSpeaker owner ) { } public void handleEvent ( SimLogger theLogger ) { } public SimEvent repopulate ( ) { <START_BUG> this . getOwner ( ) . handleProcessingEventCompleted ( ) ; <END_BUG> return this . getOwner ( ) . getNextProcessEvent ( ) ; } }

Fix:
this . getOwner ( ) . handleProcessingEventCompleted ( super . getEventTime ( ) ) ;
Buggy code:
@ Service public class PacketForwarderServiceImpl implements PacketForwarderService { @ Autowired RestTemplate restTemplate ; @ Override public ResponseEntity < PacketRes > forwardPacket ( PacketRes packet ) { String url = ( "http:////" + ( packet . getDstIp ( ) ) ) + "//rest//packets" ; <START_BUG> ResponseEntity < PacketRes > res = restTemplate . postForEntity ( url , PacketRes . class , PacketRes . class ) ; <END_BUG> return res ; } }

Fix:
ResponseEntity < PacketRes > res = restTemplate . postForEntity ( url , packet , PacketRes . class ) ;
Buggy code:
public class WarcArchiveContentIdentifier { private BinarySignatureIdentifier binarySignatureIdentifier ; private ContainerSignatureDefinitions containerSignatureDefinitions ; private String path ; private String slash ; private String slash1 ; private File tmpDir ; public WarcArchiveContentIdentifier ( final BinarySignatureIdentifier binarySignatureIdentifier , final ContainerSignatureDefinitions containerSignatureDefinitions , final String path , final String slash , final String slash1 ) { } public void identify ( final URI uri , final IdentificationRequest request ) throws CommandExecutionException { final int httpACCEPTED = 200 ; final String newPath = ( ( ( ( "warc:" + ( slash1 ) ) + ( path ) ) + ( request . getFileName ( ) ) ) + "!" ) + ( slash ) ; slash1 = "" ; final IdentificationRequestFactory factory = new WebArchiveEntryRequestFactory ( ) ; try { InputStream warcIn = request . getSourceInputStream ( ) ; WarcReader warcReader = WarcReaderFactory . getReader ( warcIn ) ; Iterator < WarcRecord > iterator = warcReader . iterator ( ) ; try { WarcRecord record = null ; while ( iterator . hasNext ( ) ) { record = iterator . next ( ) ; <START_BUG> if ( ( ( "response" . equals ( record . header . warcTypeStr ) ) && ( ( record . getHttpHeader ( ) ) != null ) ) && ( httpACCEPTED != ( record . getHttpHeader ( ) . statusCode ) ) ) { <END_BUG> String name = record . header . warcTargetUriStr ; RequestMetaData metaData = new RequestMetaData ( record . header . contentLength , record . header . warcDate . getTime ( ) , name ) ; final RequestIdentifier identifier = new RequestIdentifier ( uri ) ; IdentificationRequest arcRequest = factory . newRequest ( metaData , identifier ) ; arcRequest . open ( record . getPayloadContent ( ) ) ; final IdentificationResultCollection arcResults = binarySignatureIdentifier . matchBinarySignatures ( arcRequest ) ; final ResultPrinter resultPrinter = new ResultPrinter ( binarySignatureIdentifier , containerSignatureDefinitions , newPath , slash , slash1 , true , true ) ; resultPrinter . print ( arcResults , arcRequest ) ; } } } finally { if ( warcIn != null ) { warcIn . close ( ) ; } } } catch ( IOException ioe ) { System . err . println ( ( ( ( ioe + "<seq2seq4repair_space>(" ) + newPath ) + ")" ) ) ; } } }

Fix:
if ( ( ( "response" . equals ( record . header . warcTypeStr ) ) && ( ( record . getHttpHeader ( ) ) != null ) ) && ( httpACCEPTED == ( record . getHttpHeader ( ) . statusCode ) ) ) {
Buggy code:
public class ToolFactory { public static ICodeFormatter createCodeFormatter ( ) { } public static ICodeFormatter createDefaultCodeFormatter ( Map options ) { } public static IClassFileDisassembler createDefaultClassFileDisassembler ( ) { } public static IClassFileReader createDefaultClassFileReader ( String fileName , int decodingFlag ) { } public static IClassFileReader createDefaultClassFileReader ( IClassFile classfile , int decodingFlag ) { } public static IClassFileReader createDefaultClassFileReader ( String zipFileName , String zipEntryName , int decodingFlag ) { } public static IScanner createScanner ( boolean tokenizeComments , boolean tokenizeWhiteSpace , boolean assertMode , boolean recordLineSeparator ) { <START_BUG> Scanner scanner = new Scanner ( tokenizeComments , tokenizeWhiteSpace , false , assertMode , null ) ; <END_BUG> scanner . recordLineSeparator = recordLineSeparator ; return scanner ; } }

Fix:
Scanner scanner = new Scanner ( tokenizeComments , tokenizeWhiteSpace , false , assertMode , null , null ) ;
Buggy code:
) ) ; <START_BUG> parser . flushCharData ( start , stop ) ; <END_BUG>

Fix:
parser . flushCharData ( parser . tmplStart , parser . tmplStop ) ;
Buggy code:
public class Main { public static void main ( String [ ] args ) throws IOException , ParseException { <START_BUG> Main . writeCSVFileFromURL ( "https:////trello.com//b//ul2foDit//tv-road-trip" ) ; <END_BUG> } public static void writeCSVFileFromURL ( String userURL ) throws IOException , ParseException { } }

Fix:
Main . writeCSVFileFromURL ( "https:////trello.com//b//qrdIFuVw//brainstorming" ) ;
Buggy code:
public class DisruptorQueue { private static final Object MARKER = new Object ( ) ; private static final Object HALT_PROCESSING = new Object ( ) ; Disruptor _disruptor ; ExecutorService _executor ; DisruptorQueue . WaiterEventHandler _handler ; RingBuffer < MutableObject > _buffer ; public DisruptorQueue ( ClaimStrategy claim , WaitStrategy wait ) { } public void setHandler ( EventHandler handler ) { } public void publish ( Object o ) { } public void haltProcessing ( ) { } public void shutdown ( ) { _disruptor . shutdown ( ) ; <START_BUG> _executor . shutdown ( ) ; <END_BUG> } static class WaiterEventHandler implements EventHandler < MutableObject > { AtomicBoolean started = new AtomicBoolean ( false ) ; volatile EventHandler _promise = null ; EventHandler _cached = null ; List < DisruptorQueue . CachedEvent > _toHandle = new ArrayList < DisruptorQueue . CachedEvent > ( ) ; boolean halted = false ; public void setHandler ( EventHandler handler ) { } @ Override public void onEvent ( MutableObject t , long sequence , boolean isBatchEnd ) throws Exception { } private void handleEvent ( Object o , long sequence , boolean isBatchEnd ) throws Exception { } } static class CachedEvent { public Object o ; public long seq ; public boolean isBatchEnd ; public CachedEvent ( Object o , long seq , boolean isBatchEnd ) { } } static class ObjectEventFactory implements EventFactory < MutableObject > { @ Override public MutableObject newInstance ( ) { } } }

Fix:
_executor . shutdownNow ( ) ;
Buggy code:
public abstract class TestUtils extends AjcTestCase { private static final boolean verbose = false ; protected File baseDir ; protected CompilationResult binaryWeave ( String inpath , String insource , int expErrors , int expWarnings ) { } protected CompilationResult binaryWeave ( String inpath , String insource , int expErrors , int expWarnings , boolean xlinterror ) { <START_BUG> return binaryWeave ( inpath , insource , expErrors , expWarnings , false , "" ) ; <END_BUG> } protected CompilationResult binaryWeave ( String inpath , String insource , int expErrors , int expWarnings , String extraOption ) { } protected CompilationResult binaryWeave ( String inpath , String insource , int expErrors , int expWarnings , boolean xlinterror , String extraOption ) { } private String formatCollection ( Collection s ) { } protected List getWeavingMessages ( List msgs ) { } protected void verifyWeavingMessagesOutput ( CompilationResult cR , String [ ] expected ) { } private String dump ( List l ) { } }

Fix:
return binaryWeave ( inpath , insource , expErrors , expWarnings , xlinterror , "" ) ;
Buggy code:
public class RolloutPlanTestCase extends AbstractCliTestBase { private static File warFile ; private static final int TEST_PORT = 8081 ; private static final String [ ] serverGroups = new String [ ] { "main-server-group" , "other-server-group" , "test-server-group" } ; @ BeforeClass public static void before ( ) throws Exception { } @ AfterClass public static void after ( ) throws Exception { } @ After public void afterTest ( ) throws Exception { cli . sendLine ( "undeploy<seq2seq4repair_space>RolloutPlanTestCase.war<seq2seq4repair_space>--all-relevant-server-groups" , true ) ; <START_BUG> cli . sendLine ( "//socket-binding-group=standard-sockets//socket-binding=test-binding:remove(){allow-resource-service-restart=true}" , true ) ; <END_BUG> } @ Test public void testInSeriesRolloutPlan ( ) throws Exception { } @ Test public void testMaxFailServersRolloutPlan ( ) throws Exception { } @ Test public void testMaxFailServersPercentageRolloutPlan ( ) throws Exception { } @ Test public void testRollbackAcrossGroupsRolloutPlan ( ) throws Exception { } private CLIOpResult testAddConnector ( String rolloutPlanId ) throws Exception { } private CLIOpResult testRemoveConnector ( String rolloutPlanId ) throws Exception { } private void testCleanupConnector ( String rolloutPlanId ) throws Exception { } private boolean getServerStatus ( String serverName , CLIOpResult result ) throws Exception { } private static String checkURL ( String server , boolean shouldFail ) throws Exception { } private static String checkURL ( String server , boolean shouldFail , String path ) throws Exception { } private static String getServerHost ( String server ) { } private static void waitUntilState ( final String serverName , final String state ) throws TimeoutException { } private static class NoResponseException extends Exception { private static final long serialVersionUID = 1L ; private NoResponseException ( String serverName ) { } } }

Fix:
cli . sendLine ( "//socket-binding-group=standard-sockets//socket-binding=test-binding:remove" , true ) ;
Buggy code:
public class Main extends Application { private Stage primaryStage ; private BorderPane root ; private Dialog dialogUtil ; private ErrorHandleService errorHandling ; private Settings settings ; private static final String TITLE = "WUUT<seq2seq4repair_space>-<seq2seq4repair_space>WakeUp<seq2seq4repair_space>Utility<seq2seq4repair_space>Tool<seq2seq4repair_space>-<seq2seq4repair_space>BETA" ; private ObservableList < HostManager > hostManager = FXCollections . observableArrayList ( ) ; public Main ( ) { } public ObservableList < HostManager > getHostManager ( ) { } @ Override public void start ( Stage primaryStage ) { } public static void main ( String [ ] args ) { } private void loadRootView ( ) throws IOException { FXMLLoader loader = new FXMLLoader ( ) ; loader . setLocation ( Main . class . getResource ( "view//RootLayout.fxml" ) ) ; root = ( ( BorderPane ) ( loader . load ( ) ) ) ; RootLayoutController rootCntrl = loader . getController ( ) ; rootCntrl . setMainApp ( this ) ; rootCntrl . loadSettings ( settings ) ; double posX = settings . getWindowSettings ( ) . getPosX ( ) ; double posY = settings . getWindowSettings ( ) . getPosY ( ) ; if ( ( posX == ( - 1 ) ) || ( posY == ( - 1 ) ) ) primaryStage . centerOnScreen ( ) ; else { primaryStage . setX ( posX ) ; primaryStage . setY ( posY ) ; } primaryStage . setWidth ( settings . getWindowSettings ( ) . getWidth ( ) ) ; <START_BUG> primaryStage . setHeight ( this . settings . getWindowSettings ( ) . getHeight ( ) ) ; <END_BUG> Scene scene = new Scene ( root ) ; primaryStage . setScene ( scene ) ; primaryStage . show ( ) ; } private void loadMainView ( ) throws IOException { } public File getLastUsedFile ( ) { } public void setLastUsedFilePath ( File file ) { } public boolean showHostNewEditDialog ( DialogType type , Host host ) { } public Stage getPrimaryStage ( ) { } public Settings getSettings ( ) { } public void saveToFile ( File file ) { } public void loadFromFile ( File file ) { } }

Fix:
primaryStage . setHeight ( settings . getWindowSettings ( ) . getHeight ( ) ) ;
Buggy code:
public class AuthMethodParser { public static final String UTF_8 = "UTF-8" ; public static List < AuthMethodConfig > parse ( final String methods , final Map < String , String > replacements ) { try { if ( ( methods == null ) || ( methods . isEmpty ( ) ) ) { return Collections . emptyList ( ) ; } final List < AuthMethodConfig > ret = new ArrayList < AuthMethodConfig > ( ) ; String [ ] parts = methods . split ( "," ) ; for ( String part : parts ) { if ( part . isEmpty ( ) ) { continue ; } int index = part . indexOf ( '?' ) ; if ( index == ( - 1 ) ) { ret . add ( AuthMethodParser . createAuthMethodConfig ( part , replacements ) ) ; } else { final String name = part . substring ( 0 , index ) ; <START_BUG> Map < String , Deque < String > > props = QueryParameterUtils . parseQueryString ( part . substring ( ( index + 1 ) ) ) ; <END_BUG> final AuthMethodConfig authMethodConfig = AuthMethodParser . createAuthMethodConfig ( name , replacements ) ; for ( Map . Entry < String , Deque < String > > entry : props . entrySet ( ) ) { Deque < String > val = entry . getValue ( ) ; if ( val . isEmpty ( ) ) { authMethodConfig . getProperties ( ) . put ( URLDecoder . decode ( entry . getKey ( ) , AuthMethodParser . UTF_8 ) , "" ) ; } else { authMethodConfig . getProperties ( ) . put ( URLDecoder . decode ( entry . getKey ( ) , AuthMethodParser . UTF_8 ) , URLDecoder . decode ( val . getFirst ( ) , AuthMethodParser . UTF_8 ) ) ; } } ret . add ( authMethodConfig ) ; } } return ret ; } catch ( UnsupportedEncodingException e ) { throw new RuntimeException ( e ) ; } } private static AuthMethodConfig createAuthMethodConfig ( String part , Map < String , String > replacements ) throws UnsupportedEncodingException { } private AuthMethodParser ( ) { } }

Fix:
Map < String , Deque < String > > props = QueryParameterUtils . parseQueryString ( part . substring ( ( index + 1 ) ) , AuthMethodParser . UTF_8 ) ;
Buggy code:
public class PGN { public static final String CASTLING_KINGSIDE = "O-O" ; public static final String CASTLING_QUEENSIDE = "O-O-O" ; public static final String GAME_TERMINATION_BLACK_WINS = "0-1" ; public static final String GAME_TERMINATION_DRAW = "1//2-1//2" ; public static final String GAME_TERMINATION_WHITE_WINS = "1-0" ; private static final Logger logger = LoggerFactory . getLogger ( PGN . class ) ; protected final Chessboard chessboard ; protected final List < String > moves ; protected final Map < String , String > tagPairs ; public PGN ( Chessboard board ) { } public PartialMove parseMove ( final PieceColor toMove , String move ) throws AmbiguousMoveException , IllegalMoveException { } private PartialMove parseCastlingMove ( final PieceColor toMove , final String move ) throws IllegalMoveException { } private PartialMove parsePawnMove ( final PieceColor toMove , final String move , final Square dest ) throws IllegalMoveException { String fileString = move . substring ( 0 , 1 ) ; if ( ! ( "abcdefgh" . contains ( fileString ) ) ) throw new IllegalMoveException ( ) ; final File file = File . forName ( fileString ) ; <START_BUG> Optional < Piece > pawn = chessboard . getActivePieces ( toMove , PAWN ) . stream ( ) . filter ( ( piece ) -> ( ( piece . getSquare ( ) . getFile ( ) ) == file ) && ( piece . isLegalSquare ( dest ) ) ) . findFirst ( ) ; <END_BUG> if ( ! ( pawn . isPresent ( ) ) ) throw new IllegalMoveException ( ) ; MoveType type = ( dest . equals ( chessboard . getGameState ( ) . getEnPassantTargetSquare ( ) ) ) ? MoveType . EN_PASSANT : MoveType . NORMAL ; PGN . logger . debug ( "Move<seq2seq4repair_space>'{}'<seq2seq4repair_space>parsed<seq2seq4repair_space>as<seq2seq4repair_space>pawn<seq2seq4repair_space>move<seq2seq4repair_space>[destination={},<seq2seq4repair_space>type={}]" , move , dest . getName ( ) , type . toString ( ) ) ; return new PartialMove ( pawn . get ( ) , dest , type ) ; } private PartialMove parsePieceMove ( final PieceColor toMove , final String move , Square dest ) throws AmbiguousMoveException , IllegalMoveException { } public Map < String , String > getTagPairs ( ) { } public String getTagValue ( final String tagName ) { } public void setTagValue ( final String tagName , final String tagValue ) { } }

Fix:
Optional < Piece > pawn = chessboard . getActivePieces ( toMove , PAWN ) . stream ( ) . filter ( ( piece ) -> ( ( piece . getSquare ( ) . getFile ( ) ) == file ) && ( ( piece . isLegalSquare ( dest ) ) || ( piece . isAttacking ( dest ) ) ) ) . findFirst ( ) ;
Buggy code:
public class FileLogger { private static final String TAG = FileLogger . class . getSimpleName ( ) ; private static final String GROUND_TRUTH_FOLDER = "iRace<seq2seq4repair_space>Heel<seq2seq4repair_space>Strike" ; private static final String LOG_FILE_EXTENSION = ".txt" ; private static final String SEPERATOR = "\t" ; private static final String TIMESTAMP_LOG_FORMAT = ( "%d" + ( FileLogger . SEPERATOR ) ) + "%s" ; private static final String TIMESTAMP_FORMAT = "MMMM<seq2seq4repair_space>dd<seq2seq4repair_space>yyyy<seq2seq4repair_space>|<seq2seq4repair_space>HH:mm:ss:SSS" ; private static FileLogger fileLogger ; private ArrayList < String > logs ; public static FileLogger getInstance ( ) { } private FileLogger ( ) { } public void writeLogsToFile ( ArrayList < Long > timestamps ) { } private void addTimestampsToLog ( ArrayList < Long > timestamps ) { for ( int index = 0 ; index < ( timestamps . size ( ) ) ; index ++ ) <START_BUG> addTimestampToLog ( index , timestamps . get ( index ) ) ; <END_BUG> } private void addTimestampToLog ( int index , long timestamp ) { } private String getFileName ( long timestamp ) { } private String getDateFormat ( long timestamp ) { } private String createGroundTruthFolderIfNotExist ( ) { } }

Fix:
addTimestampToLog ( ( index + 1 ) , timestamps . get ( index ) ) ;
Buggy code:
public class AutoWebApp extends BaseInterceptor { int debug = 0 ; Hashtable hosts = new Hashtable ( ) ; String appsD = "webapps" ; String defaultHost = null ; boolean flat = true ; boolean ignoreDot = true ; String profile = null ; boolean trusted = false ; char hostSeparator = '@' ; char dotReplacement = '_' ; char slashReplacement = '_' ; public AutoWebApp ( ) { } public void setDir ( String d ) { } public void setHost ( String h ) { } public void setIngoreDot ( boolean b ) { } public void setFlat ( boolean b ) { } public void setProfile ( String s ) { } public void setTrusted ( boolean b ) { } public void engineInit ( ContextManager cm ) throws TomcatException { } private void addWebApp ( ContextManager cm , File dir , String host , String name ) throws TomcatException { host = unEscapeHost ( host ) ; if ( host == null ) host = "DEFAULT" ; String path = "//" + ( unEscapePath ( name ) ) ; if ( path . equals ( "//ROOT" ) ) path = "" ; Hashtable loaded = ( ( Hashtable ) ( hosts . get ( host ) ) ) ; if ( ( loaded != null ) && ( ( loaded . get ( path ) ) != null ) ) { <START_BUG> log ( ( ( ( "Already<seq2seq4repair_space>loaded:<seq2seq4repair_space>" + host ) + ":" ) + ( "" . equals ( path ) ? "//" : path ) ) ) ; <END_BUG> return ; } log ( ( ( ( "Auto-Adding<seq2seq4repair_space>" + host ) + ":" ) + ( "" . equals ( path ) ? "//" : path ) ) ) ; if ( dir . isDirectory ( ) ) { Context ctx = new Context ( ) ; ctx . setContextManager ( cm ) ; ctx . setPath ( path ) ; if ( ! ( "DEFAULT" . equals ( host ) ) ) ctx . setHost ( host ) ; try { ctx . setDocBase ( dir . getCanonicalPath ( ) ) ; } catch ( IOException ex ) { ctx . setDocBase ( dir . getAbsolutePath ( ) ) ; } if ( trusted ) ctx . setTrusted ( true ) ; if ( ( profile ) != null ) ctx . setProperty ( "profile" , profile ) ; if ( ( debug ) > 0 ) log ( ( ( ( ( ( "automatic<seq2seq4repair_space>add<seq2seq4repair_space>" + host ) + ":" ) + ( ctx . toString ( ) ) ) + "<seq2seq4repair_space>" ) + path ) ) ; cm . addContext ( ctx ) ; } else { log ( ( "Not<seq2seq4repair_space>a<seq2seq4repair_space>dir<seq2seq4repair_space>" + ( dir . getAbsolutePath ( ) ) ) ) ; } } private void addVHost ( ContextManager cm , File dir , String host ) throws TomcatException { } private String unEscapeHost ( String hostName ) { } private String unEscapePath ( String pathDir ) { } private String unEscapeString ( String s , char esc , char repl ) { } }

Fix:
log ( ( ( ( "Loaded<seq2seq4repair_space>from<seq2seq4repair_space>config:<seq2seq4repair_space>" + host ) + ":" ) + ( "" . equals ( path ) ? "//" : path ) ) ) ;
Buggy code:
public class CustomSuccessHandler extends SimpleUrlAuthenticationSuccessHandler { private RedirectStrategy redirectStrategy = new DefaultRedirectStrategy ( ) ; @ Override protected void handle ( HttpServletRequest request , HttpServletResponse response , Authentication authentication ) throws IOException { } protected String determineTargetUrl ( Authentication authentication ) { String url = "" ; Collection < ? extends GrantedAuthority > authorities = authentication . getAuthorities ( ) ; List < String > roles = new ArrayList < String > ( ) ; for ( GrantedAuthority a : authorities ) { roles . add ( a . getAuthority ( ) ) ; } if ( roles . contains ( "ROLE_ADMIN" ) ) { <START_BUG> url = "//monitor" ; <END_BUG> } else { url = "//" ; } return url ; } public void setRedirectStrategy ( RedirectStrategy redirectStrategy ) { } protected RedirectStrategy getRedirectStrategy ( ) { } }

Fix:
url = "//" ;
Buggy code:
public class ArticleDefaultSignatureTitleAreaDialog extends TitleAreaDialog { private Artikel article ; private Button btnRadioOnAtcCode ; private ArticleDefaultSignatureComposite adsc ; private Prescription prescription ; private Button btnRadioOnArticle ; public ArticleDefaultSignatureTitleAreaDialog ( Shell parentShell , Artikel article ) { } public ArticleDefaultSignatureTitleAreaDialog ( Shell parentShell , Prescription pr ) { } @ Override protected Control createDialogArea ( Composite parent ) { setMessage ( "Für<seq2seq4repair_space>diesen<seq2seq4repair_space>ATC<seq2seq4repair_space>Code<seq2seq4repair_space>oder<seq2seq4repair_space>diesen<seq2seq4repair_space>Artikel<seq2seq4repair_space>folgende<seq2seq4repair_space>Standard-Signatur<seq2seq4repair_space>hinterlegen" ) ; setTitle ( "Standard-Signatur<seq2seq4repair_space>hinterlegen" ) ; Composite area = ( ( Composite ) ( super . createDialogArea ( parent ) ) ) ; Composite container = new Composite ( area , SWT . NONE ) ; container . setLayout ( new GridLayout ( 2 , false ) ) ; GridData gd_container = new GridData ( GridData . FILL_BOTH ) ; gd_container . grabExcessVerticalSpace = false ; container . setLayoutData ( gd_container ) ; btnRadioOnAtcCode = new Button ( container , SWT . RADIO ) ; btnRadioOnAtcCode . setText ( "auf<seq2seq4repair_space>ATC<seq2seq4repair_space>Code<seq2seq4repair_space>hinterlegen" ) ; btnRadioOnArticle = new Button ( container , SWT . RADIO ) ; btnRadioOnArticle . setLayoutData ( new GridData ( SWT . FILL , SWT . CENTER , false , false , 1 , 1 ) ) ; btnRadioOnArticle . setText ( "auf<seq2seq4repair_space>Artikel<seq2seq4repair_space>hinterlegen" ) ; if ( ( article ) != null ) { String atc_code = article . getATC_code ( ) ; boolean atcCode = ( atc_code != null ) && ( ( atc_code . length ( ) ) > 0 ) ; btnRadioOnAtcCode . setEnabled ( atcCode ) ; btnRadioOnAtcCode . setSelection ( atcCode ) ; btnRadioOnArticle . setSelection ( ( ! atcCode ) ) ; } adsc = new ArticleDefaultSignatureComposite ( area , SWT . None ) ; adsc . setLayoutData ( new GridData ( SWT . FILL , SWT . CENTER , true , false , 1 , 1 ) ) ; if ( ( prescription ) != null ) { ArrayList < Float > doseAsFloats = Prescription . getDoseAsFloats ( prescription . getDosis ( ) ) ; for ( int i = 0 ; i < ( doseAsFloats . size ( ) ) ; i ++ ) { String val = trimTrailingZeros ( Float . toString ( doseAsFloats . get ( i ) ) ) ; switch ( i ) { case 0 : adsc . setSignatureMorning ( val ) ; break ; case 1 : adsc . setSignatureNoon ( val ) ; break ; case 2 : adsc . setSignatureEvening ( val ) ; break ; case 3 : <START_BUG> adsc . setSignatureEvening ( val ) ; <END_BUG> break ; default : break ; } } adsc . setSignatureComment ( prescription . getBemerkung ( ) ) ; } return area ; } @ Override protected void createButtonsForButtonBar ( Composite parent ) { } @ Override protected void okPressed ( ) { } private String trimTrailingZeros ( String number ) { } }

Fix:
adsc . setSignatureNight ( val ) ;
Buggy code:
public abstract class AbstractImageBuilder implements ICompilerRequestor { protected JavaBuilder javaBuilder ; protected IContainer outputFolder ; protected IContainer [ ] sourceFolders ; protected BuildNotifier notifier ; protected boolean hasSeparateOutputFolder ; protected NameEnvironment nameEnvironment ; protected Compiler compiler ; protected State newState ; protected WorkQueue workQueue ; protected ArrayList problemTypeLocations ; private boolean inCompiler ; public static int MAX_AT_ONCE = 1000 ; static final String ProblemMarkerTag = IJavaModelMarker . JAVA_MODEL_PROBLEM_MARKER ; protected AbstractImageBuilder ( JavaBuilder javaBuilder ) { } public void acceptResult ( CompilationResult result ) { } protected void cleanUp ( ) { } protected void compile ( String [ ] filenames , String [ ] initialTypeNames ) { } void compile ( CompilationUnit [ ] units , String [ ] initialTypeNames , String [ ] additionalFilenames ) { } protected void finishedWith ( char [ ] fileId , char [ ] [ ] additionalTypeNames ) throws CoreException { } protected RuntimeException internalException ( Throwable t ) { } protected Compiler newCompiler ( ) { } protected IMarker [ ] getProblemsFor ( IResource resource ) { } protected void removeProblemsFor ( IResource resource ) { } protected void storeProblemsFor ( IResource resource , IProblem [ ] problems ) { } protected void updateProblemsFor ( CompilationResult result ) { } protected IContainer getOutputFolder ( IPath packagePath ) throws CoreException { } protected boolean isClassFileChanged ( IFile file , String fileName , byte [ ] bytes , boolean isSecondaryType ) throws CoreException { } protected char [ ] writeClassFile ( ClassFile classFile , boolean isSecondaryType ) throws CoreException { String fileName = new String ( classFile . fileName ( ) ) ; IPath filePath = new Path ( fileName ) ; IContainer container = outputFolder ; if ( ( filePath . segmentCount ( ) ) > 1 ) { container = getOutputFolder ( filePath . removeLastSegments ( 1 ) ) ; filePath = new Path ( filePath . lastSegment ( ) ) ; } <START_BUG> IFile file = container . getFile ( filePath . addFileExtension ( ClassExtension ) ) ; <END_BUG> byte [ ] bytes = classFile . getBytes ( ) ; if ( isClassFileChanged ( file , fileName , bytes , isSecondaryType ) ) { if ( JavaBuilder . DEBUG ) System . out . println ( ( "Writing<seq2seq4repair_space>class<seq2seq4repair_space>file<seq2seq4repair_space>" + ( file . getName ( ) ) ) ) ; file . create ( new ByteArrayInputStream ( bytes ) , true , null ) ; } else if ( JavaBuilder . DEBUG ) { System . out . println ( ( "Skipped<seq2seq4repair_space>over<seq2seq4repair_space>unchanged<seq2seq4repair_space>class<seq2seq4repair_space>file<seq2seq4repair_space>" + ( file . getName ( ) ) ) ) ; } return filePath . lastSegment ( ) . toCharArray ( ) ; } }

Fix:
IFile file = container . getFile ( filePath . addFileExtension ( CLASS_EXTENSION ) ) ;
Buggy code:
public class HttpRequest { private static String execute ( final Callable < String > task , final long timeout , final TimeUnit unit ) throws IOException , TimeoutException { final ExecutorService executor = Executors . newSingleThreadExecutor ( ) ; final Future < String > result = executor . submit ( task ) ; try { return result . get ( timeout , unit ) ; } catch ( TimeoutException e ) { result . cancel ( true ) ; throw e ; } catch ( InterruptedException e ) { throw new RuntimeException ( e ) ; } catch ( ExecutionException e ) { <START_BUG> throw ( ( IOException ) ( e . getCause ( ) ) ) ; <END_BUG> } finally { executor . shutdownNow ( ) ; try { executor . awaitTermination ( timeout , unit ) ; } catch ( InterruptedException e ) { } } } public static String get ( final String spec , final long timeout , final TimeUnit unit ) throws IOException , ExecutionException , TimeoutException { } public static String get ( final String spec , final long waitUntilAvailableMs , final long responseTimeout , final TimeUnit responseTimeoutUnit ) throws IOException , ExecutionException , TimeoutException { } public static String get ( final String spec , final String username , final String password , final long timeout , final TimeUnit unit ) throws IOException , TimeoutException { } private static String read ( final InputStream in ) throws IOException { } private static String processResponse ( HttpURLConnection conn ) throws IOException { } public static String put ( final String spec , final String message , final long timeout , final TimeUnit unit ) throws MalformedURLException , ExecutionException , TimeoutException { } private static String execRequestMethod ( final String spec , final String message , final long timeout , final TimeUnit unit , final String requestMethod ) throws MalformedURLException , ExecutionException , TimeoutException { } public static String post ( final String spec , final String message , final long timeout , final TimeUnit unit ) throws MalformedURLException , ExecutionException , TimeoutException { } public static String delete ( final String spec , final String message , final long timeout , final TimeUnit unit ) throws MalformedURLException , ExecutionException , TimeoutException { } public static String head ( final String spec , final String message , final long timeout , final TimeUnit unit ) throws MalformedURLException , ExecutionException , TimeoutException { } private static void write ( OutputStream out , String message ) throws IOException { } }

Fix:
throw new IOException ( e ) ;
Buggy code:
public class ApplicationSettingsTest extends TestCase { public ApplicationSettingsTest ( final String message ) { } public void testFrameworkVersion ( ) { Settings settings = new Settings ( new DummyApplication ( ) ) ; <START_BUG> assertFalse ( "n//a" . equalsIgnoreCase ( settings . getVersion ( ) ) ) ; <END_BUG> } public void testExceptionOnMissingResourceDefaultValue ( ) throws Exception { } public void testExceptionOnMissingResourceSetsCorrectly ( ) throws Exception { } public void testUseDefaultOnMissingResourceDefaultValue ( ) throws Exception { } public void testUseDefaultOnMissingResourceSetsCorrectly ( ) throws Exception { } public void testDefaultStringResourceLoaderSetup ( ) { } public void testOverrideStringResourceLoaderSetup ( ) { } public void testLocalizer ( ) { } }

Fix:
assertEquals ( "n//a" , settings . getVersion ( ) ) ;
Buggy code:
@ Stateless @ Remote ( TopologyChangeListener . class ) @ Listener ( sync = false ) public class TopologyChangeListenerBean implements TopologyChangeListener { public static final long TIMEOUT = 15000 ; @ Override public void establishTopology ( String containerName , String cacheName , String ... nodes ) throws InterruptedException { Set < String > expectedMembers = new TreeSet < > ( ) ; if ( nodes != null ) { for ( String name : nodes ) { <START_BUG> expectedMembers . add ( ( ( name + "//" ) + containerName ) ) ; <END_BUG> } } ServiceRegistry registry = CurrentServiceContainer . getServiceContainer ( ) ; ServiceName name = JBOSS . append ( "infinispan" , containerName , cacheName ) ; Cache < ? , ? > cache = ServiceContainerHelper . findValue ( registry , name ) ; if ( cache == null ) { throw new IllegalStateException ( String . format ( "Failed<seq2seq4repair_space>to<seq2seq4repair_space>locate<seq2seq4repair_space>%s" , name ) ) ; } cache . addListener ( this ) ; try { long start = System . currentTimeMillis ( ) ; long now = start ; long timeout = start + ( TopologyChangeListenerBean . TIMEOUT ) ; synchronized ( this ) { Set < String > members = TopologyChangeListenerBean . getMembers ( cache ) ; while ( ! ( expectedMembers . equals ( members ) ) ) { System . out . println ( String . format ( "%s<seq2seq4repair_space>!=<seq2seq4repair_space>%s,<seq2seq4repair_space>waiting<seq2seq4repair_space>for<seq2seq4repair_space>a<seq2seq4repair_space>topology<seq2seq4repair_space>change<seq2seq4repair_space>event..." , expectedMembers , members ) ) ; this . wait ( ( timeout - now ) ) ; now = System . currentTimeMillis ( ) ; if ( now >= timeout ) { throw new InterruptedException ( String . format ( "Cache<seq2seq4repair_space>%s//%s<seq2seq4repair_space>failed<seq2seq4repair_space>to<seq2seq4repair_space>establish<seq2seq4repair_space>view<seq2seq4repair_space>%s<seq2seq4repair_space>within<seq2seq4repair_space>%d<seq2seq4repair_space>ms.<seq2seq4repair_space>Current<seq2seq4repair_space>view<seq2seq4repair_space>is:<seq2seq4repair_space>%s" , containerName , cacheName , expectedMembers , TopologyChangeListenerBean . TIMEOUT , members ) ) ; } members = TopologyChangeListenerBean . getMembers ( cache ) ; } System . out . println ( String . format ( "Cache<seq2seq4repair_space>%s//%s<seq2seq4repair_space>successfully<seq2seq4repair_space>established<seq2seq4repair_space>view<seq2seq4repair_space>%s<seq2seq4repair_space>within<seq2seq4repair_space>%d<seq2seq4repair_space>ms." , containerName , cacheName , expectedMembers , ( now - start ) ) ) ; } } finally { cache . removeListener ( this ) ; } } private static Set < String > getMembers ( Cache < ? , ? > cache ) { } @ TopologyChanged public void topologyChanged ( TopologyChangedEvent < ? , ? > event ) { } }

Fix:
expectedMembers . add ( ( name + "//ee" ) ) ;
Buggy code:
@ Singleton @ LocalBean @ Startup public class TestServiceStarter { @ PersistenceContext ( unitName = "RAINSAgentPU" ) private EntityManager entityManager ; public void testStubDriver ( ) { } public void testVersaNSDriver ( ) { } public void testAwsDriver ( ) { if ( ( PersistenceManager . getEntityManager ( ) ) == null ) { PersistenceManager . initialize ( entityManager ) ; } try { Context ejbCxt = new InitialContext ( ) ; HandleSystemCall systemCallHandler = ( ( HandleSystemCall ) ( ejbCxt . lookup ( "java:module//HandleSystemCall" ) ) ) ; Map < String , String > driverProperties = new HashMap < > ( ) ; driverProperties . put ( "topologyUri" , "urn:ogf:network:aws.amazon.com:aws-cloud" ) ; driverProperties . put ( "driverEjbPath" , "java:module//AwsDriver" ) ; driverProperties . put ( "aws_access_key_id" , "" ) ; driverProperties . put ( "aws_secret_access_key" , "" ) ; <START_BUG> driverProperties . put ( "region" , "eu-east-1" ) ; <END_BUG> systemCallHandler . plugDriverInstance ( driverProperties ) ; } catch ( Exception ex ) { Logger . getLogger ( TestServiceStarter . class . getName ( ) ) . log ( Level . SEVERE , null , ex ) ; } } @ PostConstruct public void runTests ( ) { } }

Fix:
driverProperties . put ( "region" , "" ) ;
Buggy code:
public class MouseMoveFilter { public static final int SMOOTH_N_TH = 10 ; public static final double gradient = 0.01 ; private LinkedList < Point > previousPoints ; private double [ ] coeffs ; public MouseMoveFilter ( ) { } public Point filter ( int x , int y ) { previousPoints . push ( new Point ( x , y ) ) ; <START_BUG> while ( ( previousPoints . size ( ) ) >= ( MouseMoveFilter . SMOOTH_N_TH ) ) { <END_BUG> previousPoints . removeLast ( ) ; } double x_sum = 0 ; double y_sum = 0 ; int i = 0 ; for ( Point point : previousPoints ) { x_sum += ( point . x ) * ( coeffs [ i ] ) ; y_sum += ( point . y ) * ( coeffs [ i ] ) ; } return new Point ( ( ( int ) ( x_sum ) ) , ( ( int ) ( y_sum ) ) ) ; } private double [ ] getFilterCoeff ( double gradient , int n ) { } }

Fix:
while ( ( previousPoints . size ( ) ) > ( MouseMoveFilter . SMOOTH_N_TH ) ) {
Buggy code:
public class PackageNameMapper extends GlobPatternMapper { protected String extractVariablePart ( String name ) { String var = name . substring ( prefixLength , ( ( name . length ( ) ) - ( postfixLength ) ) ) ; if ( getHandleDirSep ( ) ) { <START_BUG> var = name . replace ( '//' , '.' ) . replace ( '\\' , '.' ) ; <END_BUG> } return var . replace ( File . separatorChar , '.' ) ; } }

Fix:
var = var . replace ( '//' , '.' ) . replace ( '\\' , '.' ) ;
Buggy code:
public class FunctionBuilder implements TemporaryProvider { private Block startingBlock ; private Block currentBlock ; private Branch currentBranch = null ; private Loop currentLoop = null ; private TempAllocator tempAllocator = new TempAllocator ( ) ; private Stack < Block > controlFlowStack = new Stack < Block > ( ) ; public FunctionBuilder ( ) { } public List < Identifier > getTemporaries ( ) { } public void addStatement ( Statement statement ) { } public void addBranch ( RelationalOp op ) { } public void beginTrueBlock ( ) { } public void beginFalseBlock ( ) { } public void endBranch ( ) { } public void addLoop ( ) { currentLoop = new Loop ( ) ; if ( ( startingBlock ) == null ) { currentBlock = startingBlock = currentLoop ; } else if ( ( currentBlock ) instanceof ControlFlow ) { ControlFlow cf = ( ( ControlFlow ) ( currentBlock ) ) ; controlFlowStack . push ( currentBlock ) ; if ( cf . isComplete ( ) ) currentBlock . setSuccessor ( currentBranch ) ; else <START_BUG> cf . addBlock ( currentBlock ) ; <END_BUG> } else currentBlock . setSuccessor ( currentLoop ) ; currentBlock = currentLoop ; } public void setLoopTestResult ( Expression testResult ) { } public void beginTest ( ) { } public void beginBody ( ) { } public void endLoop ( ) { } public void clear ( ) { } public Block getStartingBlock ( ) { } @ Override public Identifier getTemporary ( ) { } }

Fix:
cf . addBlock ( currentLoop ) ;