nus-yam/ex-repair huggingface dataset:
Buggy code:
public class Point implements Comparable < Point > { public final Comparator < Point > SLOPE_ORDER = new Point . SlopeOrder ( ) ; private final int x ; private final int y ; private class SlopeOrder implements Comparator < Point > { private Point currentPoint ; SlopeOrder ( ) { } public int compare ( Point v , Point w ) { Point currentPoint = Point . this ; <START_BUG> int result = ( ( int ) ( ( v . slopeTo ( currentPoint ) ) - ( w . slopeTo ( currentPoint ) ) ) ) ; <END_BUG> if ( result < 0 ) { return - 1 ; } else if ( result > 0 ) { return 1 ; } else { return 0 ; } } } public Point ( int x , int y ) { } public void draw ( ) { } public void drawTo ( Point that ) { } public double slopeTo ( Point that ) { } public int compareTo ( Point that ) { } public String toString ( ) { } public static void main ( String [ ] args ) { } }

Fix:
double result = ( v . slopeTo ( currentPoint ) ) - ( w . slopeTo ( currentPoint ) ) ;
Buggy code:
public abstract class AbstractFormValidator implements IFormValidator { protected Map < String , Serializable > messageModel ( ) { FormComponent [ ] formComponents = getDependentFormComponents ( ) ; if ( ( formComponents != null ) && ( ( formComponents . length ) > 0 ) ) { Map < String , Serializable > args = new HashMap < String , Serializable > ( ( ( formComponents . length ) * 3 ) ) ; for ( int i = 0 ; i < ( formComponents . length ) ; i ++ ) { final FormComponent formComponent = formComponents [ i ] ; String arg = "label" + i ; IModel label = formComponent . getLabel ( ) ; if ( label != null ) { <START_BUG> args . put ( arg , ( ( Serializable ) ( label . getObject ( formComponent ) ) ) ) ; <END_BUG> } else { args . put ( arg , formComponent . getLocalizer ( ) . getString ( formComponent . getId ( ) , formComponent . getParent ( ) , formComponent . getId ( ) ) ) ; } args . put ( ( "input" + i ) , formComponent . getInput ( ) ) ; args . put ( ( "name" + i ) , formComponent . getId ( ) ) ; } return args ; } else { return new HashMap < String , Serializable > ( 2 ) ; } } protected String resourceKey ( FormComponent [ ] components ) { } }

Fix:
args . put ( arg , ( ( Serializable ) ( label . getObject ( ) ) ) ) ;
Buggy code:
@ Entity @ NamedQueries ( { @ NamedQuery ( name = "Subject.findAll" , query = "SELECT<seq2seq4repair_space>s<seq2seq4repair_space>FROM<seq2seq4repair_space>Subject<seq2seq4repair_space>s" ) } ) public class Subject implements Serializable { private static final long serialVersionUID = 1L ; @ Id @ GeneratedValue ( strategy = GenerationType . AUTO ) @ OrderBy private Long id ; @ Column ( length = 50 , nullable = false ) private String title ; @ Column ( length = 255 , nullable = false ) private String description ; @ Column ( length = 50 , nullable = false ) private String teacher ; @ Column ( length = 1 ) private String pool ; public Subject ( ) { } public Subject ( String title , String description , String teacher ) { } public String getDescription ( ) { } public void setDescription ( String description ) { } public String getTeacher ( ) { } public void setTeacher ( String teacher ) { } public String getTitle ( ) { } public void setTitle ( String title ) { } public String getPool ( ) { } public void setPool ( String pool ) { } public Long getId ( ) { } @ Override public int hashCode ( ) { } @ Override public boolean equals ( Object object ) { } @ Override public String toString ( ) { <START_BUG> return ( "entities.ProposalSubject[<seq2seq4repair_space>id=" + ( id ) ) + "<seq2seq4repair_space>]" ; <END_BUG> } }

Fix:
return ( "entities.Subject[<seq2seq4repair_space>id=" + ( id ) ) + "<seq2seq4repair_space>]" ;
Buggy code:
public class Notifications { public static final long [ ] vibratePattern = new long [ ] { 0 , 1000 , 300 , 1000 , 300 , 1000 } ; public static boolean bg_notifications ; public static boolean bg_vibrate ; public static boolean bg_lights ; public static boolean bg_sound ; public static boolean bg_sound_in_silent ; public static int bg_snooze ; public static String bg_notification_sound ; public static boolean calibration_notifications ; public static boolean calibration_vibrate ; public static boolean calibration_lights ; public static boolean calibration_sound ; public static int calibration_snooze ; public static String calibration_notification_sound ; public static Context mContext ; public static int BgNotificationId = 1 ; public static int calibrationNotificationId = 2 ; public static int doubleCalibrationNotificationId = 3 ; public static int extraCalibrationNotificationId = 4 ; public static SharedPreferences prefs ; public static int currentVolume ; public static AudioManager manager ; public static void setNotificationSettings ( Context context ) { } public static void notificationSetter ( Context context ) { Notifications . setNotificationSettings ( context ) ; BgGraphBuilder bgGraphBuilder = new BgGraphBuilder ( context ) ; double high = bgGraphBuilder . highMark ; double low = bgGraphBuilder . lowMark ; Bg bgReading = Bg . last ( ) ; if ( Notifications . bg_notifications ) { <START_BUG> if ( ( ( bgReading . sgv_double ( ) ) >= high ) || ( ( bgReading . sgv_double ( ) ) <= low ) ) { <END_BUG> Notifications . bgAlert ( bgReading . unitized_string ( Notifications . prefs ) , bgReading . slopeArrow ( ) ) ; } else { Notifications . clearBgAlert ( ) ; } } else { Notifications . clearAllBgNotifications ( ) ; } } public static void clearAllBgNotifications ( ) { } public static void bgNotificationCreate ( String title , String content , Intent intent , int notificationId ) { } public static void soundAlert ( String soundUri ) { } public static void notificationUpdate ( String title , String content , Intent intent , int notificationId ) { } public static Builder notificationBuilder ( String title , String content , Intent intent ) { } public static PendingIntent notificationIntent ( Intent intent ) { } public static void notificationDismiss ( int notificationId ) { } public static void bgAlert ( String value , String slopeArrow ) { } public static void clearBgAlert ( ) { } }

Fix:
if ( ( ( bgGraphBuilder . unitized ( bgReading . sgv_double ( ) ) ) >= high ) || ( ( bgGraphBuilder . unitized ( bgReading . sgv_double ( ) ) ) <= low ) ) {
Buggy code:
public class MockHttpApplicationTest extends TestCase { private MockHttpApplication application ; public MockHttpApplicationTest ( String name ) { } protected void setUp ( ) throws Exception { super . setUp ( ) ; application = new MockHttpApplication ( null ) ; <START_BUG> application . getSettings ( ) . setHomePage ( MockPage . class ) ; <END_BUG> } public void testRenderHomePage ( ) throws Exception { } public void testClickLink ( ) throws Exception { } private boolean validateDocument ( String document , int expectedLinkClickCount ) { } }

Fix:
application . getPages ( ) . setHomePage ( MockPage . class ) ;
Buggy code:
public class DBUtility { private static Connection connection = null ; public static Connection getConnection ( ) { if ( ( DBUtility . connection ) != null ) { return DBUtility . connection ; } else { try { String url = "jdbc:mysql:////localhost:3306//" ; String dbName = "my_elective" ; String driver = "com.mysql.jdbc.Driver" ; String userName = "root" ; <START_BUG> String password = "root" ; <END_BUG> Class . forName ( driver ) . newInstance ( ) ; DBUtility . connection = DriverManager . getConnection ( ( url + dbName ) , userName , password ) ; } catch ( Exception e ) { e . printStackTrace ( ) ; } return DBUtility . connection ; } } }

Fix:
String password = "password" ;
Buggy code:
public class ZkCmdExecutor { private static final Logger LOG = Logger . getLogger ( ZkCmdExecutor . class ) ; private long retryDelay = 1000L ; private int retryCount = 15 ; private List < ACL > acl = Ids . OPEN_ACL_UNSAFE ; public ZkCmdExecutor ( ) { } public List < ACL > getAcl ( ) { } public void setAcl ( List < ACL > acl ) { } public long getRetryDelay ( ) { } public void setRetryDelay ( long retryDelay ) { } @ SuppressWarnings ( "unchecked" ) public < T > T retryOperation ( ZkOperation operation ) throws InterruptedException , KeeperException { } public void ensureExists ( String path , final SolrZkClient zkClient ) throws InterruptedException , KeeperException { } public void ensureExists ( final String path , final byte [ ] data , CreateMode createMode , final SolrZkClient zkClient ) throws InterruptedException , KeeperException { } protected void retryDelay ( int attemptCount ) { if ( attemptCount > 0 ) { try { <START_BUG> Thread . sleep ( Math . min ( 10000 , ( attemptCount * ( retryDelay ) ) ) ) ; <END_BUG> } catch ( InterruptedException e ) { ZkCmdExecutor . LOG . debug ( ( "Failed<seq2seq4repair_space>to<seq2seq4repair_space>sleep:<seq2seq4repair_space>" + e ) , e ) ; } } } }

Fix:
Thread . sleep ( Math . max ( 10000 , ( attemptCount * ( retryDelay ) ) ) ) ;
Buggy code:
public class Rmic extends MatchingTask { private String base ; private String classname ; private String sourceBase ; private String stubVersion ; private Path compileClasspath ; private boolean verify = false ; private boolean filtering = false ; private Vector compileList = new Vector ( ) ; public void setBase ( String base ) { } public void setClass ( String classname ) { } public void setClassname ( String classname ) { } public void setSourceBase ( String sourceBase ) { } public void setStubVersion ( String stubVersion ) { } public void setFiltering ( String filter ) { } public void setClasspath ( Path classpath ) { } public Path createClasspath ( ) { } public void setVerify ( String verify ) { } public void execute ( ) throws BuildException { } private void moveGeneratedFile ( File baseDir , File sourceBaseFile , String classname ) throws BuildException { } protected void scanDir ( File baseDir , String [ ] files , boolean shouldVerify ) { } private boolean isValidRmiRemote ( Class testClass ) { } private boolean shouldCompile ( File classFile ) { } private String getCompileClasspath ( File baseFile ) { } private void addExistingToClasspath ( Path target , Path source ) { String [ ] list = source . list ( ) ; for ( int i = 0 ; i < ( list . length ) ; i ++ ) { File f = project . resolveFile ( list [ i ] ) ; if ( f . exists ( ) ) { <START_BUG> target . setLocation ( f . getAbsolutePath ( ) ) ; <END_BUG> } else { log ( ( "Dropping<seq2seq4repair_space>from<seq2seq4repair_space>classpath:<seq2seq4repair_space>" + ( f . getAbsolutePath ( ) ) ) , MSG_VERBOSE ) ; } } } }

Fix:
target . setLocation ( f ) ;
Buggy code:
public class OrganicBananas extends ItemAbstract { private static final int MAX_QUALITY = 50 ; private static final int SELLIN_STEP = 1 ; private static final int QUALITY_STEP = 2 ; @ Override public void update ( Item item ) { } @ Override public void updateSellIn ( Item item ) { } @ Override public void updateQuality ( Item item ) { <START_BUG> if ( ( item . getSellIn ( ) ) < 0 ) <END_BUG> item . setQuality ( ( ( item . getQuality ( ) ) - ( OrganicBananas . QUALITY_STEP ) ) ) ; else item . setQuality ( ( ( item . getQuality ( ) ) - ( ( OrganicBananas . QUALITY_STEP ) * 2 ) ) ) ; } }

Fix:
if ( ( item . getSellIn ( ) ) > 0 )
Buggy code:
public class Cab extends MatchingTask { private ArrayList m_filesets = new ArrayList ( ) ; private boolean m_compress = true ; private File m_baseDir ; private File m_cabFile ; private String m_options ; public void setBasedir ( final File baseDir ) { } public void setCabfile ( final File cabFile ) { } public void setCompress ( final boolean compress ) { } public void setOptions ( final String options ) { } public void addFileset ( final FileSet set ) { } public void execute ( ) throws TaskException { checkConfiguration ( ) ; final ArrayList files = getFileList ( ) ; if ( isUpToDate ( files ) ) { return ; } getLogger ( ) . info ( ( "Building<seq2seq4repair_space>cab:<seq2seq4repair_space>" + ( m_cabFile . getAbsolutePath ( ) ) ) ) ; if ( ! ( Os . isFamily ( "windows" ) ) ) { getLogger ( ) . debug ( "Using<seq2seq4repair_space>listcab//libcabinet" ) ; final StringBuffer sb = new StringBuffer ( ) ; final Iterator e = files . iterator ( ) ; while ( e . hasNext ( ) ) { sb . append ( e . next ( ) ) . append ( "\n" ) ; } sb . append ( "\n" ) . append ( m_cabFile . getAbsolutePath ( ) ) . append ( "\n" ) ; try { Process p = Runtime . getRuntime ( ) . exec ( "listcab" ) ; OutputStream out = p . getOutputStream ( ) ; out . write ( sb . toString ( ) . getBytes ( ) ) ; out . flush ( ) ; out . close ( ) ; } catch ( IOException ex ) { String msg = ( ( "Problem<seq2seq4repair_space>creating<seq2seq4repair_space>" + ( m_cabFile ) ) + "<seq2seq4repair_space>" ) + ( ex . getMessage ( ) ) ; throw new TaskException ( msg ) ; } } else { try { File listFile = createListFile ( files ) ; Execute2 exe = new Execute2 ( ) ; setupLogger ( exe ) ; exe . setWorkingDirectory ( m_baseDir ) ; final Commandline cmd = createCommand ( listFile ) ; <START_BUG> exe . setCommandline ( cmd . getCommandline ( ) ) ; <END_BUG> exe . execute ( ) ; listFile . delete ( ) ; } catch ( final IOException ioe ) { final String message = ( ( "Problem<seq2seq4repair_space>creating<seq2seq4repair_space>" + ( m_cabFile ) ) + "<seq2seq4repair_space>" ) + ( ioe . getMessage ( ) ) ; throw new TaskException ( message ) ; } } } protected ArrayList getFileList ( ) throws TaskException { } protected boolean isUpToDate ( ArrayList files ) { } protected void appendFiles ( ArrayList files , DirectoryScanner ds ) { } protected void checkConfiguration ( ) throws TaskException { } protected Commandline createCommand ( final File listFile ) throws TaskException { } protected File createListFile ( ArrayList files ) throws IOException { } }

Fix:
exe . setCommandline ( cmd ) ;
Buggy code:
public class DemonListener implements Listener { @ EventHandler public void onNetherFallDamage ( EntityDamageEvent e ) { } @ EventHandler public void onDemonLazor ( PlayerInteractEvent e ) { if ( ! ( WorldCheck . isEnabled ( e . getPlayer ( ) . getWorld ( ) ) ) ) return ; if ( ( ! ( DemonListener . isDemon ( e . getPlayer ( ) ) ) ) || ( ( e . getAction ( ) ) != ( Action . RIGHT_CLICK_AIR ) ) ) return ; Player p = e . getPlayer ( ) ; if ( ! ( p . isSneaking ( ) ) ) return ; Material hand = p . getItemInHand ( ) . getType ( ) ; if ( hand == ( Material . BLAZE_ROD ) ) { <START_BUG> Missile . createMissile ( p . getLocation ( ) , p . getLocation ( ) . getDirection ( ) . multiply ( 1.4 ) , new Effect [ ] { Effect . LAVADRIP , Effect . FLAME , Effect . SMALL_SMOKE } , 30 ) ; <END_BUG> } } private static final List < EntityType > hellMobs = Lists . newArrayList ( MAGMA_CUBE , GHAST , PIG_ZOMBIE , BLAZE ) ; @ EventHandler public void onDemonMobtarget ( EntityTargetLivingEntityEvent e ) { } @ EventHandler public void onDemonNearDeath ( EntityDamageByEntityEvent e ) { } private static boolean isDemon ( Player p ) { } }

Fix:
Missile . createMissile ( p . getLocation ( ) , p . getLocation ( ) . getDirection ( ) . multiply ( 1.1 ) , new Effect [ ] { Effect . LAVADRIP , Effect . POTION_SWIRL , Effect . COLOURED_DUST } , 30 ) ;
Buggy code:
public class FileProcessor { public final int CORE_COUNT ; public FileProcessor ( ) { } public void saveStructure ( Structure structure , int mode ) { } public Structure createStructure ( String path ) { try { Structure structure = new Structure ( ) ; FileChannel channel = new RandomAccessFile ( path , "r" ) . getChannel ( ) ; ByteBuffer bb = ByteBuffer . allocateDirect ( ( ( 1024 * 64 ) * 1024 ) ) ; bb . clear ( ) ; if ( ( channel . size ( ) ) > ( Integer . MAX_VALUE ) ) <START_BUG> throw new IOException ( "File<seq2seq4repair_space>is<seq2seq4repair_space>too<seq2seq4repair_space>big" ) ; <END_BUG> byte [ ] bytes = new byte [ ( ( int ) ( channel . size ( ) ) ) ] ; while ( ( channel . read ( bb ) ) > 0 ) { bb . flip ( ) ; for ( int i = 0 ; i < ( channel . size ( ) ) ; i ++ ) { bytes [ i ] = bb . asReadOnlyBuffer ( ) . get ( i ) ; bb . clear ( ) ; } } structure . setData ( bytes ) ; structure . setPath ( path ) ; if ( path . contains ( "\\" ) ) structure . setName ( path . substring ( ( ( path . lastIndexOf ( "\\" ) ) + 1 ) ) ) ; else structure . setName ( path ) ; return structure ; } catch ( IOException e ) { e . printStackTrace ( ) ; } return null ; } public List < String > getFilesPaths ( String path ) { } }

Fix:
throw new IOException ( "File<seq2seq4repair_space>is<seq2seq4repair_space>too<seq2seq4repair_space>big." ) ;
Buggy code:
public class WebMarkupContainer extends MarkupContainer { private static final long serialVersionUID = 1L ; public WebMarkupContainer ( final String id ) { } public WebMarkupContainer ( final String id , IModel model ) { } public String getMarkupType ( ) { <START_BUG> return "html" ; <END_BUG> } public final WebPage getWebPage ( ) { } }

Fix:
return getPage ( ) . getMarkupType ( ) ;
Buggy code:
public class JSortTable extends JTable implements MouseListener { protected int sortedColumnIndex = - 1 ; protected boolean sortedColumnAscending = true ; private String sortedColumn ; public JSortTable ( ) { } public JSortTable ( SortTableModel model ) { } public JSortTable ( SortTableModel model , TableColumnModel colModel ) { } public JSortTable ( SortTableModel model , TableColumnModel colModel , ListSelectionModel selModel ) { } protected void initSortHeader ( ) { } public int getSortedColumnIndex ( ) { } public void updateSortedColumn ( ) { } public void setSortedColumnIndex ( int index ) { } public void scrollToRow ( final int row , final int col ) { } public void scrollToBottom ( final int col ) { } public boolean isSortedColumnAscending ( ) { } public void mouseClicked ( MouseEvent event ) { if ( ( ( event . getClickCount ( ) ) < 2 ) || ( event . isPopupTrigger ( ) ) ) { return ; } else <START_BUG> if ( ( ( event . getClickCount ( ) ) > 1 ) && ( ( event . getButton ( ) ) == ( MouseEvent . BUTTON2_MASK ) ) ) { <END_BUG> return ; } TableColumnModel colModel = getColumnModel ( ) ; int index = colModel . getColumnIndexAtX ( event . getX ( ) ) ; int modelIndex = colModel . getColumn ( index ) . getModelIndex ( ) ; SortTableModel model = ( ( SortTableModel ) ( getModel ( ) ) ) ; if ( model . isSortable ( modelIndex ) ) { if ( ( sortedColumnIndex ) == index ) { sortedColumnAscending = ! ( sortedColumnAscending ) ; } sortedColumnIndex = index ; sortedColumn = colModel . getColumn ( index ) . getHeaderValue ( ) . toString ( ) ; model . sortColumn ( modelIndex , sortedColumnAscending ) ; getTableHeader ( ) . resizeAndRepaint ( ) ; } } public void mousePressed ( MouseEvent event ) { } public void mouseReleased ( MouseEvent event ) { } public void mouseEntered ( MouseEvent event ) { } public void mouseExited ( MouseEvent event ) { } }

Fix:
if ( ( ( event . getClickCount ( ) ) > 1 ) && ( ( ( event . getModifiers ( ) ) & ( MouseEvent . BUTTON2_MASK ) ) > 0 ) ) {
Buggy code:
public abstract class AbstractResourceInjection implements ResourceInjection { protected final boolean primitiveTarget ; private final Value < JndiInjectable > value ; protected AbstractResourceInjection ( final Value < JndiInjectable > value , final boolean primitiveTarget ) { } public void inject ( final Object target ) { <START_BUG> final Object value = this . value . getValue ( ) . getInjectedValue ( ) ; <END_BUG> if ( ( primitiveTarget ) && ( value == null ) ) { return ; } doInject ( target , value ) ; } protected abstract void doInject ( final Object target , final Object value ) { } }

Fix:
final Object value = this . value . getValue ( ) . getReference ( ) . getInstance ( ) ;
Buggy code:
public class MessageRenderer implements IMessageRenderer { private Color otherColor = null ; private Color systemColor = null ; private Color dateColor = null ; private Color highlightColor = null ; private StringBuffer buffer ; private List styleRanges = new ArrayList ( ) ; protected static final String DEFAULT_ME_COLOR = "0,255,0" ; protected static final String DEFAULT_OTHER_COLOR = "0,0,0" ; protected static final String DEFAULT_SYSTEM_COLOR = "0,0,255" ; protected static final String DEFAULT_HIGHLIGHT_COLOR = "255,0,0" ; protected static final String DEFAULT_DATE_COLOR = "0,0,0" ; protected static final String DEFAULT_TIME_FORMAT = Messages . MessageRenderer_DEFAULT_TIME_FORMAT ; protected static final String DEFAULT_DATE_FORMAT = Messages . MessageRenderer_DEFAULT_DATE_FORMAT ; protected boolean nickContained ; protected String message ; protected String originator ; public MessageRenderer ( ) { } public StyleRange [ ] getStyleRanges ( ) { } public String render ( String message , String originator , String localUserName ) { } protected void doRender ( ) { } protected void appendDateTime ( ) { <START_BUG> String message = NLS . bind ( MessageRenderer_DEFAULT_DATETIME_FORMAT , getCurrentDate ( MessageRenderer . DEFAULT_TIME_FORMAT ) ) ; <END_BUG> append ( message , dateColor , null , NORMAL ) ; } protected void appendNickname ( ) { } protected void appendMessage ( ) { } protected void append ( String message , Color foreground , Color background , int style ) { } private Color colorFromRGBString ( String rgb ) { } protected String getCurrentDate ( String format ) { } protected String getDateTime ( ) { } }

Fix:
String message = ( NLS . bind ( MessageRenderer_DEFAULT_DATETIME_FORMAT , getCurrentDate ( MessageRenderer . DEFAULT_TIME_FORMAT ) ) ) + "<seq2seq4repair_space>" ;
Buggy code:
public class CryptoMapper implements IRequestMapper { private final IRequestMapper wrappedMapper ; private final IProvider < ICrypt > cryptProvider ; public CryptoMapper ( IRequestMapper wrappedMapper , Application application ) { } public CryptoMapper ( IRequestMapper wrappedMapper , IProvider < ICrypt > cryptProvider ) { } public int getCompatibilityScore ( Request request ) { } public Url mapHandler ( IRequestHandler requestHandler ) { } public IRequestHandler mapRequest ( Request request ) { Url url = decryptUrl ( request , request . getUrl ( ) ) ; if ( url == null ) { return null ; } <START_BUG> return wrappedMapper . mapRequest ( request . requestWithUrl ( url ) ) ; <END_BUG> } private ICrypt getCrypt ( ) { } private Url encryptUrl ( Url url ) { } private Url decryptUrl ( Request request , Url encryptedUrl ) { } private static class ApplicationCryptProvider implements IProvider < ICrypt > { private final Application application ; public ApplicationCryptProvider ( Application application ) { } public ICrypt get ( ) { } } }

Fix:
return wrappedMapper . mapRequest ( request . cloneWithUrl ( url ) ) ;
Buggy code:
public class MultiDirectionalTest extends TestCase { public MultiDirectionalTest ( String name ) { } public void testCostExceptions ( ) throws ConvergenceException { CostFunction wrong = new CostFunction ( ) { public double cost ( double [ ] x ) throws CostException { if ( ( x [ 0 ] ) < 0 ) { <START_BUG> throw new CostException ( "{0}" , new Object [ ] { "oops" } ) ; <END_BUG> } else if ( ( x [ 0 ] ) > 1 ) { throw new CostException ( new RuntimeException ( "oops" ) ) ; } else { return ( x [ 0 ] ) * ( 1 - ( x [ 0 ] ) ) ; } } } ; try { new MultiDirectional ( 1.9 , 0.4 ) . minimize ( wrong , 10 , new MultiDirectionalTest . ValueChecker ( 0.001 ) , new double [ ] { - 0.5 } , new double [ ] { 0.5 } ) ; fail ( "an<seq2seq4repair_space>exception<seq2seq4repair_space>should<seq2seq4repair_space>have<seq2seq4repair_space>been<seq2seq4repair_space>thrown" ) ; } catch ( CostException ce ) { assertNull ( ce . getCause ( ) ) ; } catch ( Exception e ) { fail ( ( "wrong<seq2seq4repair_space>exception<seq2seq4repair_space>caught:<seq2seq4repair_space>" + ( e . getMessage ( ) ) ) ) ; } try { new MultiDirectional ( 1.9 , 0.4 ) . minimize ( wrong , 10 , new MultiDirectionalTest . ValueChecker ( 0.001 ) , new double [ ] { 0.5 } , new double [ ] { 1.5 } ) ; fail ( "an<seq2seq4repair_space>exception<seq2seq4repair_space>should<seq2seq4repair_space>have<seq2seq4repair_space>been<seq2seq4repair_space>thrown" ) ; } catch ( CostException ce ) { assertNotNull ( ce . getCause ( ) ) ; } catch ( Exception e ) { fail ( ( "wrong<seq2seq4repair_space>exception<seq2seq4repair_space>caught:<seq2seq4repair_space>" + ( e . getMessage ( ) ) ) ) ; } } public void testRosenbrock ( ) throws ConvergenceException , CostException { } public void testPowell ( ) throws ConvergenceException , CostException { } private static class ValueChecker implements ConvergenceChecker { public ValueChecker ( double threshold ) { } public boolean converged ( PointCostPair [ ] simplex ) { } private double threshold ; } public static Test suite ( ) { } private int count ; }

Fix:
throw new CostException ( "{0}" , "oops" ) ;
Buggy code:
public class ListGetBenchmarkBroken { private static final int ITERATIONS = 1000000000 ; public static void main ( String [ ] args ) { List < Integer > list = Arrays . asList ( 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 10 ) ; long startTime = System . nanoTime ( ) ; for ( int i = 0 ; i < ( ListGetBenchmarkBroken . ITERATIONS ) ; i ++ ) { <START_BUG> list . get ( 0 ) ; <END_BUG> } long endTime = System . nanoTime ( ) ; long duration = endTime - startTime ; System . out . println ( ( ( ( ( "Executed<seq2seq4repair_space>in<seq2seq4repair_space>" + ( TimeUnit . NANOSECONDS . toMillis ( duration ) ) ) + "ms,<seq2seq4repair_space>" ) + ( + ( ( ( double ) ( duration ) ) // ( ListGetBenchmarkBroken . ITERATIONS ) ) ) ) + "<seq2seq4repair_space>ns//op" ) ) ; } }

Fix:
list . get ( 3 ) ;
Buggy code:
public final class BracketingNthOrderBrentSolverTest extends BaseSecantSolverAbstractTest { @ Override <START_BUG> protected UnivariateRealSolver getSolver ( ) { <END_BUG> return new BracketingNthOrderBrentSolver ( ) ; } @ Override protected int [ ] getQuinticEvalCounts ( ) { } @ Test ( expected = NumberIsTooSmallException . class ) public void testInsufficientOrder1 ( ) { } @ Test ( expected = NumberIsTooSmallException . class ) public void testInsufficientOrder2 ( ) { } @ Test ( expected = NumberIsTooSmallException . class ) public void testInsufficientOrder3 ( ) { } @ Test public void testConstructorsOK ( ) { } @ Test public void testConvergenceOnFunctionAccuracy ( ) { } @ Test public void testIssue716 ( ) { } @ Test public void testFasterThanNewton ( ) { } private void compare ( BracketingNthOrderBrentSolverTest . TestFunction f ) { } private void compare ( DifferentiableUnivariateFunction f , double root , double min , double max ) { } private abstract static class TestFunction implements DifferentiableUnivariateFunction { private final double root ; private final double min ; private final double max ; protected TestFunction ( final double root , final double min , final double max ) { } public double getRoot ( ) { } public double getMin ( ) { } public double getMax ( ) { } public abstract double value ( double x ) { } public abstract double derivative ( double x ) { } public UnivariateFunction derivative ( ) { } } }

Fix:
protected UnivariateSolver getSolver ( ) {
Buggy code:
public class RoomScreen implements Screen { final Syzygy game ; private User user ; private Array < Enemy > enemies ; private Joystick joystickMove ; private Joystick joystickFire ; private Dungeon dungeon ; private Room currentRoom ; private long lastSpawnTime ; public RoomScreen ( final Syzygy game ) { } @ Override public void render ( float delta ) { gl . glClearColor ( 0 , 1 , 0 , 1 ) ; gl . glClear ( GL_COLOR_BUFFER_BIT ) ; game . getStage ( ) . getViewport ( ) . getCamera ( ) . update ( ) ; game . getStage ( ) . getBatch ( ) . setProjectionMatrix ( game . getStage ( ) . getViewport ( ) . getCamera ( ) . combined ) ; game . getStage ( ) . draw ( ) ; game . getStage ( ) . act ( delta ) ; if ( ( ( joystickFire . getKnobPercentX ( ) ) != 0 ) || ( ( joystickFire . getKnobPercentY ( ) ) != 0 ) ) { if ( ( ( TimeUtils . nanoTime ( ) ) - ( user . getLastShotTime ( ) ) ) > ( user . getAtkSpeed ( ) ) ) { game . getStage ( ) . addActor ( user . fireBullet ( new com . badlogic . gdx . math . Vector2 ( ( ( joystickFire . getKnobX ( ) ) - ( ( joystickFire . getWidth ( ) ) // 2 ) ) , ( ( joystickFire . getKnobY ( ) ) - ( ( joystickFire . getHeight ( ) ) // 2 ) ) ) , 5.0F ) ) ; } } currentRoom . setEnemyNumber ( Collisions . enemyHits ( enemies , currentRoom . getEnemyNumber ( ) ) ) ; if ( ( currentRoom . getEnemyNumber ( ) ) <= 0 ) { addPortalsToStage ( ) ; for ( Portal portal : currentRoom . getPortals ( ) ) { <START_BUG> if ( ( user . overlaps ( portal ) ) && ( portal . isVisible ( ) ) ) { <END_BUG> currentRoom . removePortalsfromStage ( ) ; currentRoom = portal . getNextRoom ( ) ; if ( ( PortalPos . UP ) == ( portal . getPortalPos ( ) ) ) { user . setY ( ( ( portal . getHeight ( ) ) // 2 ) ) ; } else if ( ( PortalPos . LEFT ) == ( portal . getPortalPos ( ) ) ) { user . setX ( ( ( Constants . GAMESCREEN_WIDTH ) - ( ( Constants . PORTAL_HEIGHT ) // 2 ) ) ) ; } else if ( ( PortalPos . RIGHT ) == ( portal . getPortalPos ( ) ) ) { user . setX ( ( ( portal . getWidth ( ) ) // 2 ) ) ; } else if ( ( PortalPos . DOWN ) == ( portal . getPortalPos ( ) ) ) { user . setY ( ( ( Constants . GAMESCREEN_HEIGHT ) - ( ( Constants . PORTAL_HEIGHT ) // 2 ) ) ) ; } System . out . println ( ( ( "||" + ( currentRoom . getEnemyNumber ( ) ) ) + "||" ) ) ; spawnEnemies ( ) ; } } } Collisions . removeBullets ( ) ; } @ Override public void resize ( int width , int height ) { } @ Override public void show ( ) { } @ Override public void hide ( ) { } @ Override public void pause ( ) { } @ Override public void resume ( ) { } @ Override public void dispose ( ) { } private void spawnUser ( float x , float y , float width , float height ) { } private void spawnEnemies ( ) { } private void addPortalsToStage ( ) { } private void spawnBigSlime ( ) { } private void spawnSlime ( ) { } private void spawnGolem ( ) { } public void createJoysticks ( ) { } }

Fix:
if ( ( ( user . overlaps ( portal ) ) && ( portal . isVisible ( ) ) ) && ( Collisions . moveToward ( user , portal . getPortalPos ( ) ) ) ) {
Buggy code:
public class VariableDeclarationStatement extends Statement { private static final int LEGAL_MODIFIERS = Modifier . FINAL ; private int modifiers = Modifier . NONE ; private Type baseType = null ; private ASTNode . NodeList variableDeclarationFragments = new ASTNode . NodeList ( true , VariableDeclarationFragment . class ) ; VariableDeclarationStatement ( AST ast ) { } public int getNodeType ( ) { } ASTNode clone ( AST target ) { VariableDeclarationStatement result = new VariableDeclarationStatement ( target ) ; result . setSourceRange ( this . getStartPosition ( ) , this . getLength ( ) ) ; <START_BUG> result . setLeadingComment ( getLeadingComment ( ) ) ; <END_BUG> result . setModifiers ( getModifiers ( ) ) ; result . setType ( ( ( Type ) ( getType ( ) . clone ( target ) ) ) ) ; result . fragments ( ) . addAll ( ASTNode . copySubtrees ( target , fragments ( ) ) ) ; return result ; } public boolean subtreeMatch ( ASTMatcher matcher , Object other ) { } void accept0 ( ASTVisitor visitor ) { } public int getModifiers ( ) { } public void setModifiers ( int modifiers ) { } public Type getType ( ) { } public void setType ( Type type ) { } public List fragments ( ) { } int memSize ( ) { } int treeSize ( ) { } }

Fix:
result . copyLeadingComment ( this ) ;
Buggy code:
public class CSVReader { public static void main ( String [ ] args ) { String csvFile = "book.csv" ; BufferedReader br = null ; String line = "" ; String cvsSplitBy = "," ; ArrayList < VectorRep > col = new ArrayList < VectorRep > ( ) ; for ( int i = 0 ; i < 7 ; i ++ ) { VectorRep v = new VectorRep ( ) ; col . add ( v ) ; } try { br = new BufferedReader ( new FileReader ( csvFile ) ) ; Compute ent = new Compute ( ) ; while ( ( line = br . readLine ( ) ) != null ) { String [ ] st = line . split ( cvsSplitBy ) ; col . get ( 0 ) . add ( st [ 0 ] ) ; col . get ( 1 ) . add ( st [ 1 ] ) ; col . get ( 2 ) . add ( st [ 2 ] ) ; col . get ( 3 ) . add ( st [ 3 ] ) ; col . get ( 4 ) . add ( st [ 4 ] ) ; col . get ( 5 ) . add ( st [ 5 ] ) ; col . get ( 6 ) . add ( st [ 6 ] ) ; } <START_BUG> System . out . print ( ( ( col . get ( 0 ) . v . size ( ) ) + "\n" ) ) ; <END_BUG> System . out . print ( ( "Gain<seq2seq4repair_space>:" + ( ent . gain ( col ) ) ) ) ; } catch ( FileNotFoundException e ) { e . printStackTrace ( ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } finally { if ( br != null ) { try { br . close ( ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } } } } No newline ; at end ; of file ; }

Fix:
System . out . print ( ( ( "Column<seq2seq4repair_space>Size:" + ( col . get ( 0 ) . v . size ( ) ) ) + "\n" ) ) ;
Buggy code:
public class UpdateCommand implements Cloneable { protected SolrQueryRequest req ; protected final String commandName ; protected long version ; protected int flags ; public static int BUFFERING = 1 ; public static int REPLAY = 2 ; public static int IGNORE_AUTOCOMMIT = 2 ; public UpdateCommand ( String commandName , SolrQueryRequest req ) { } @ Override public String toString ( ) { <START_BUG> return commandName ; <END_BUG> } public long getVersion ( ) { } public void setVersion ( long version ) { } public void setFlags ( int flags ) { } public int getFlags ( ) { } public SolrQueryRequest getReq ( ) { } public void setReq ( SolrQueryRequest req ) { } @ Override public UpdateCommand clone ( ) { } }

Fix:
return ( ( ( ( commandName ) + ":{flags=" ) + ( flags ) ) + ",<seq2seq4repair_space>version=" ) + ( version ) ;
Buggy code:
public class TARDISArtronFurnaceListener implements Listener { private final TARDIS plugin ; private final double burnFactor ; private final short cookTime ; private final List < BlockFace > surrounding = Arrays . asList ( EAST , SOUTH , WEST , NORTH , NORTH_EAST , NORTH_WEST , SOUTH_EAST , SOUTH_WEST ) ; public TARDISArtronFurnaceListener ( TARDIS plugin ) { } @ EventHandler ( ignoreCancelled = true ) public void onArtronFurnaceBurn ( FurnaceBurnEvent event ) { } @ EventHandler ( ignoreCancelled = true ) public void furnaceSmeltEvent ( FurnaceSmeltEvent event ) { } @ SuppressWarnings ( "deprecation" ) @ EventHandler ( ignoreCancelled = true ) public void onInventoryClick ( InventoryClickEvent event ) { if ( ! ( ( event . getInventory ( ) ) instanceof FurnaceInventory ) ) { return ; } <START_BUG> Furnace furnace = ( ( Furnace ) ( event . getWhoClicked ( ) . getTargetBlock ( null , 10 ) . getState ( ) ) ) ; <END_BUG> if ( ( ( ( furnace . getInventory ( ) . getTitle ( ) . equals ( "TARDIS<seq2seq4repair_space>Artron<seq2seq4repair_space>Furnace" ) ) && ( ( ( event . getSlot ( ) ) == 0 ) || ( ( event . getSlot ( ) ) == 1 ) ) ) && ( ( event . getCursor ( ) . getType ( ) ) != ( Material . AIR ) ) ) && ( ( furnace . getCookTime ( ) ) > ( cookTime ) ) ) { furnace . setCookTime ( cookTime ) ; } } @ EventHandler ( ignoreCancelled = true ) public void onArtronFurnacePlace ( BlockPlaceEvent event ) { } @ EventHandler ( ignoreCancelled = true ) public void onArtronFurnaceBreak ( BlockBreakEvent event ) { } }

Fix:
Furnace furnace = ( ( Furnace ) ( event . getInventory ( ) . getHolder ( ) ) ) ;
Buggy code:
public class CheckGroupSelector extends LabeledWebMarkupContainer { private static final long serialVersionUID = 1L ; private final CheckGroup < ? > group ; public CheckGroupSelector ( String id ) { } public CheckGroupSelector ( String id , CheckGroup < ? > group ) { } @ Override protected void onComponentTag ( ComponentTag tag ) { checkComponentTag ( tag , "input" ) ; checkComponentTagAttribute ( tag , "type" , "checkbox" ) ; CheckGroup < ? > group = this . group ; if ( group == null ) { group = findParent ( CheckGroup . class ) ; if ( group == null ) { throw new org . apache . wicket . WicketRuntimeException ( ( ( "CheckGroupSelector<seq2seq4repair_space>component<seq2seq4repair_space>[" + ( getPath ( ) ) ) + "]<seq2seq4repair_space>cannot<seq2seq4repair_space>find<seq2seq4repair_space>its<seq2seq4repair_space>parent<seq2seq4repair_space>CheckGroup.<seq2seq4repair_space>All<seq2seq4repair_space>CheckGroupSelector<seq2seq4repair_space>components<seq2seq4repair_space>must<seq2seq4repair_space>be<seq2seq4repair_space>a<seq2seq4repair_space>child<seq2seq4repair_space>of<seq2seq4repair_space>or<seq2seq4repair_space>below<seq2seq4repair_space>in<seq2seq4repair_space>the<seq2seq4repair_space>hierarchy<seq2seq4repair_space>of<seq2seq4repair_space>a<seq2seq4repair_space>CheckGroup<seq2seq4repair_space>component." ) ) ; } } <START_BUG> tag . put ( "onclick" , ( ( "var<seq2seq4repair_space>cb=this.form['" + ( group . getInputName ( ) ) ) + "'];<seq2seq4repair_space>if<seq2seq4repair_space>(cb!=null)<seq2seq4repair_space>{<seq2seq4repair_space>if<seq2seq4repair_space>(!isNaN(cb.length))<seq2seq4repair_space>{<seq2seq4repair_space>for(var<seq2seq4repair_space>i=0;i<cb.length;i++)<seq2seq4repair_space>{<seq2seq4repair_space>if<seq2seq4repair_space>(cb[i].checked<seq2seq4repair_space>!=<seq2seq4repair_space>this.checked)<seq2seq4repair_space>{cb[i].click();}<seq2seq4repair_space>}<seq2seq4repair_space>}<seq2seq4repair_space>else<seq2seq4repair_space>{<seq2seq4repair_space>if<seq2seq4repair_space>(cb.checked<seq2seq4repair_space>!=<seq2seq4repair_space>this.checked)<seq2seq4repair_space>{cb.click();}<seq2seq4repair_space>}<seq2seq4repair_space>}" ) ) ; <END_BUG> super . onComponentTag ( tag ) ; } }

Fix:
tag . put ( "onclick" , ( ( "var<seq2seq4repair_space>cb=this.form['" + ( group . getInputName ( ) ) ) + "'];<seq2seq4repair_space>if<seq2seq4repair_space>(cb!=null)<seq2seq4repair_space>{<seq2seq4repair_space>if<seq2seq4repair_space>(!isNaN(cb.length))<seq2seq4repair_space>{<seq2seq4repair_space>for(var<seq2seq4repair_space>i=0;i<cb.length;i++)<seq2seq4repair_space>{<seq2seq4repair_space>if<seq2seq4repair_space>(cb[i].disabled)<seq2seq4repair_space>continue;<seq2seq4repair_space>if<seq2seq4repair_space>(cb[i].checked<seq2seq4repair_space>!=<seq2seq4repair_space>this.checked)<seq2seq4repair_space>{cb[i].click();}<seq2seq4repair_space>}<seq2seq4repair_space>}<seq2seq4repair_space>else<seq2seq4repair_space>{<seq2seq4repair_space>if<seq2seq4repair_space>(!cb.disabled&&cb.checked<seq2seq4repair_space>!=<seq2seq4repair_space>this.checked)<seq2seq4repair_space>{cb.click();}<seq2seq4repair_space>}<seq2seq4repair_space>}" ) ) ;
Buggy code:
public final class StaticJspUtils { private static boolean isExpression ( String value ) { } private static Matcher matchExpression ( String value ) { } public static String unwrapExpression ( String value ) { Matcher matcher = StaticJspUtils . PATTERN_EXPRESSION . matcher ( value ) ; if ( ! ( matcher . matches ( ) ) ) { return value ; } <START_BUG> return matcher . group ( 1 ) ; <END_BUG> } public static String wrapExpression ( String value ) { } private static final Pattern PATTERN_EXPRESSION = Pattern . compile ( "(#|\\$)\\{([^\\}]+)\\}" ) ; private static final String EXPRESSION_START = "${" ; private static final String EXPRESSION_END = "}" ; private StaticJspUtils ( ) { } }

Fix:
return matcher . group ( 2 ) ;
Buggy code:
public class MethodLocator extends PatternLocator { protected MethodPattern pattern ; protected boolean isDeclarationOfReferencedMethodsPattern ; public char [ ] [ ] [ ] allSuperDeclaringTypeNames ; public MethodLocator ( MethodPattern pattern ) { } public void initializePolymorphicSearch ( MatchLocator locator ) { } protected boolean isVirtualInvoke ( MethodBinding method , MessageSend messageSend ) { } public int match ( MethodDeclaration node , MatchingNodeSet nodeSet ) { } public int match ( MessageSend node , MatchingNodeSet nodeSet ) { } protected int matchContainer ( ) { } protected int matchMethod ( MethodBinding method ) { } protected void matchReportReference ( ASTNode reference , IJavaElement element , int accuracy , MatchLocator locator ) throws CoreException { } void matchReportReference ( MessageSend messageSend , MatchLocator locator , MethodBinding methodBinding ) throws CoreException { } protected int referenceType ( ) { } protected void reportDeclaration ( MethodBinding methodBinding , MatchLocator locator , SimpleSet knownMethods ) throws CoreException { } public int resolveLevel ( ASTNode possibleMatchingNode ) { } public int resolveLevel ( Binding binding ) { } protected int resolveLevel ( MessageSend messageSend ) { MethodBinding method = messageSend . binding ; <START_BUG> if ( method == null ) <END_BUG> return PatternLocator . INACCURATE_MATCH ; int methodLevel = matchMethod ( method ) ; if ( methodLevel == ( PatternLocator . IMPOSSIBLE_MATCH ) ) { if ( method != ( method . original ( ) ) ) methodLevel = matchMethod ( method . original ( ) ) ; if ( methodLevel == ( PatternLocator . IMPOSSIBLE_MATCH ) ) return PatternLocator . IMPOSSIBLE_MATCH ; method = method . original ( ) ; } char [ ] qualifiedPattern = PatternLocator . qualifiedPattern ( this . pattern . declaringSimpleName , this . pattern . declaringQualification ) ; if ( qualifiedPattern == null ) return methodLevel ; int declaringLevel ; if ( ( isVirtualInvoke ( method , messageSend ) ) && ( ! ( ( messageSend . actualReceiverType ) instanceof ArrayBinding ) ) ) { declaringLevel = resolveLevelAsSubtype ( qualifiedPattern , method . declaringClass ) ; if ( declaringLevel == ( PatternLocator . IMPOSSIBLE_MATCH ) ) { if ( ( ( method . declaringClass ) == null ) || ( ( this . allSuperDeclaringTypeNames ) == null ) ) { declaringLevel = PatternLocator . INACCURATE_MATCH ; } else { char [ ] [ ] compoundName = method . declaringClass . compoundName ; for ( int i = 0 , max = this . allSuperDeclaringTypeNames . length ; i < max ; i ++ ) if ( CharOperation . equals ( this . allSuperDeclaringTypeNames [ i ] , compoundName ) ) return methodLevel ; } } } else { declaringLevel = resolveLevelForType ( qualifiedPattern , method . declaringClass ) ; } return methodLevel > declaringLevel ? declaringLevel : methodLevel ; } protected int resolveLevelAsSubtype ( char [ ] qualifiedPattern , ReferenceBinding type ) { } public String toString ( ) { } }

Fix:
if ( ( method == null ) || ( ( messageSend . resolvedType ) == null ) )
Buggy code:
public class TestDocBoost extends LuceneTestCase { public TestDocBoost ( String name ) { } public void testDocBoost ( ) throws Exception { RAMDirectory store = new RAMDirectory ( ) ; IndexWriter writer = new IndexWriter ( store , new SimpleAnalyzer ( ) , true , MaxFieldLength . LIMITED ) ; Fieldable f1 = new Field ( "field" , "word" , Store . YES , Index . ANALYZED ) ; Fieldable f2 = new Field ( "field" , "word" , Store . YES , Index . ANALYZED ) ; f2 . setBoost ( 2.0F ) ; Document d1 = new Document ( ) ; Document d2 = new Document ( ) ; Document d3 = new Document ( ) ; Document d4 = new Document ( ) ; d3 . setBoost ( 3.0F ) ; d4 . setBoost ( 2.0F ) ; d1 . add ( f1 ) ; d2 . add ( f2 ) ; d3 . add ( f1 ) ; d4 . add ( f2 ) ; writer . addDocument ( d1 ) ; writer . addDocument ( d2 ) ; writer . addDocument ( d3 ) ; writer . addDocument ( d4 ) ; writer . optimize ( ) ; writer . close ( ) ; final float [ ] scores = new float [ 4 ] ; <START_BUG> new IndexSearcher ( store ) . search ( new TermQuery ( new Term ( "field" , "word" ) ) , new Collector ( ) { <END_BUG> private int base = 0 ; private Scorer scorer ; public void setScorer ( Scorer scorer ) throws IOException { this . scorer = scorer ; } public final void collect ( int doc ) throws IOException { scores [ ( doc + ( base ) ) ] = scorer . score ( ) ; } public void setNextReader ( IndexReader reader , int docBase ) { base = docBase ; } public boolean acceptsDocsOutOfOrder ( ) { return true ; } } ) ; float lastScore = 0.0F ; for ( int i = 0 ; i < 4 ; i ++ ) { assertTrue ( ( ( scores [ i ] ) > lastScore ) ) ; lastScore = scores [ i ] ; } } }

Fix:
new IndexSearcher ( store , true ) . search ( new TermQuery ( new Term ( "field" , "word" ) ) , new Collector ( ) {
Buggy code:
class FirstLinkFinder { public static void main ( String [ ] args ) throws Exception { File fileNameInput = new File ( ".//wikiFileNamesPythonOutput.txt" ) ; Scanner fileNamesGetter = new Scanner ( fileNameInput ) ; while ( fileNamesGetter . hasNextLine ( ) ) { String currentFileName = fileNamesGetter . nextLine ( ) ; File currentFile = new File ( currentFileName ) ; <START_BUG> FileReader infoGetter = new FileReader ( currentFile ) ; <END_BUG> infoGetter . search ( ) ; } } }

Fix:
FirstLinkReader infoGetter = new FirstLinkReader ( currentFile ) ;
Buggy code:
@ SuppressWarnings ( { "unchecked" } ) public class DefaultBeanInfo < T > implements BeanInfo < T > { private final List < ClassReflectionIndex > indexes = new ArrayList < ClassReflectionIndex > ( ) ; private final Class beanClass ; private DeploymentReflectionIndex index ; private Class currentClass ; public DefaultBeanInfo ( DeploymentReflectionIndex index , Class < T > beanClass ) { } protected < U > U lookup ( DefaultBeanInfo . Lookup < U > lookup , int start , int depth ) { } public Constructor < T > getConstructor ( final String ... parameterTypes ) { } @ Override public Constructor < T > findConstructor ( final String ... parameterTypes ) { } @ Override public Field getField ( final String name ) { } @ Override public Method getMethod ( final String name , final String ... parameterTypes ) { return lookup ( new DefaultBeanInfo . Lookup < Method > ( ) { @ Override public Method lookup ( ClassReflectionIndex index ) { Collection < Method > methods = index . getMethods ( name , parameterTypes ) ; if ( ( methods . size ( ) ) != 1 ) <START_BUG> throw MESSAGES . ambigousMatch ( methods ) ; <END_BUG> return methods . iterator ( ) . next ( ) ; } } , 0 , Integer . MAX_VALUE ) ; } @ Override public Method findMethod ( String name , String ... parameterTypes ) { } @ Override public Method getGetter ( final String propertyName , final Class < ? > type ) { } @ Override public Method getSetter ( final String propertyName , final Class < ? > type ) { } private interface Lookup < U > { U lookup ( ClassReflectionIndex index ) { } } }

Fix:
throw MESSAGES . ambiguousMatch ( methods ) ;
Buggy code:
public abstract class ClientSOContainer extends SOContainer { ISynchAsynchConnection connection ; ID remoteServerID ; byte connectionState ; public static final byte UNCONNECTED = 0 ; public static final byte CONNECTING = 1 ; public static final byte CONNECTED = 2 ; static final class Lock { } ClientSOContainer . Lock connectLock ; public ClientSOContainer ( ISharedObjectContainerConfig config ) { } public void dispose ( long wait ) { } public final boolean isGroupServer ( ) { } public final boolean isGroupManager ( ) { } public ID getGroupID ( ) { } public void joinGroup ( ID remote , Object data ) throws SharedObjectContainerJoinException { } protected void handleViewChangeMessage ( ContainerMessage mess ) throws IOException { } protected void forwardExcluding ( ID from , ID excluding , ContainerMessage data ) throws IOException { } protected Serializable getConnectData ( ID target , Object data ) { } protected Serializable getLeaveData ( ID target ) { } public void leaveGroup ( ) { } protected abstract ISynchAsynchConnection getClientConnection ( ID remoteSpace , Object data ) throws ConnectionInstantiationException { } protected void handleChangeMsg ( ID fromID , ID toID , long seqNum , Serializable data ) throws IOException { } protected void queueContainerMessage ( ContainerMessage message ) throws IOException { } protected void forwardExcluding ( ID from , ID excluding , byte msg , Serializable data ) throws IOException { } protected void forwardToRemote ( ID from , ID to , ContainerMessage message ) throws IOException { } protected ID getIDForConnection ( IAsynchConnection conn ) { } protected void memberLeave ( ID fromID , IAsynchConnection conn ) { if ( fromID . equals ( remoteServerID ) ) { <START_BUG> groupManager . removeAllMembers ( ) ; <END_BUG> super . memberLeave ( fromID , conn ) ; connectionState = ClientSOContainer . UNCONNECTED ; connection = null ; remoteServerID = null ; } else if ( fromID . equals ( getID ( ) ) ) { super . memberLeave ( fromID , conn ) ; } } protected void sendMessage ( ContainerMessage data ) throws IOException { } protected ID [ ] sendCreateMsg ( ID toID , SharedObjectDescription createInfo ) throws IOException { } protected void processDisconnect ( DisconnectConnectionEvent evt ) { } protected void processAsynchPacket ( AsynchConnectionEvent evt ) throws IOException { } protected Serializable processSynch ( SynchConnectionEvent evt ) throws IOException { } protected boolean isConnected ( ) { } protected boolean isConnecting ( ) { } private void checkConnected ( ) throws ConnectException { } protected ID acceptNewServer ( ContainerMessage serverData ) throws Exception { } }

Fix:
groupManager . removeNonLocalMembers ( ) ;