nus-yam/ex-repair huggingface dataset:
Buggy code:
public class Cache extends NameSet { private class CacheElement { RRset rrset ; byte credibility ; long timeIn ; int ttl ; int srcid ; public CacheElement ( int _ttl , byte cred , int src ) { } public CacheElement ( Record r , byte cred , int src ) { } public CacheElement ( RRset r , byte cred , int src ) { } public void update ( Record r ) { } public boolean expiredTTL ( ) { } public String toString ( ) { } } public Cache ( ) { } public Cache ( String file ) throws IOException { } public void addRecord ( Record r , byte cred , Object o ) { Name name = r . getName ( ) ; short type = r . getRRsetType ( ) ; int src = ( o != null ) ? o . hashCode ( ) : 0 ; if ( ( r . getTTL ( ) ) == 0 ) return ; <START_BUG> Cache . CacheElement element = ( ( Cache . CacheElement ) ( findSet ( name , type ) ) ) ; <END_BUG> if ( ( element == null ) || ( cred > ( element . credibility ) ) ) addSet ( name , type , ( element = new Cache . CacheElement ( r , cred , src ) ) ) ; else if ( cred == ( element . credibility ) ) { if ( ( element . srcid ) != src ) element . rrset . clear ( ) ; element . update ( r ) ; } } public void addRRset ( RRset rrset , byte cred , Object o ) { } public void addNegative ( Name name , short type , int ttl , byte cred , Object o ) { } public CacheResponse lookupRecords ( Name name , short type , byte minCred ) { } RRset findRecords ( Name name , short type , byte minCred ) { } public RRset findRecords ( Name name , short type ) { } public RRset findAnyRecords ( Name name , short type ) { } public void addMessage ( Message in ) { } }

Fix:
Cache . CacheElement element = ( ( Cache . CacheElement ) ( findExactSet ( name , type ) ) ) ;
Buggy code:
public class YearDV extends AbstractDateTimeDV { public Object getActualValue ( String content , ValidationContext context ) throws InvalidDatatypeValueException { } protected DateTimeData parse ( String str ) throws SchemaDateTimeException { } protected String dateToString ( DateTimeData date ) { } protected XMLGregorianCalendar getXMLGregorianCalendar ( DateTimeData date ) { <START_BUG> return factory . newXMLGregorianCalendar ( date . unNormYear , DatatypeConstants . FIELD_UNDEFINED , DatatypeConstants . FIELD_UNDEFINED , DatatypeConstants . FIELD_UNDEFINED , DatatypeConstants . FIELD_UNDEFINED , DatatypeConstants . FIELD_UNDEFINED , DatatypeConstants . FIELD_UNDEFINED , ( date . hasTimeZone ( ) ? ( ( date . timezoneHr ) * 60 ) + ( date . timezoneMin ) : DatatypeConstants . FIELD_UNDEFINED ) ) ; <END_BUG> } }

Fix:
return datatypeFactory . newXMLGregorianCalendar ( date . unNormYear , DatatypeConstants . FIELD_UNDEFINED , DatatypeConstants . FIELD_UNDEFINED , DatatypeConstants . FIELD_UNDEFINED , DatatypeConstants . FIELD_UNDEFINED , DatatypeConstants . FIELD_UNDEFINED , DatatypeConstants . FIELD_UNDEFINED , ( date . hasTimeZone ( ) ? ( ( date . timezoneHr ) * 60 ) + ( date . timezoneMin ) : DatatypeConstants . FIELD_UNDEFINED ) ) ;
Buggy code:
public class FieldLUDecomposition < T extends FieldElement < T > > { private final Field < T > field ; private T [ ] [ ] lu ; private int [ ] pivot ; private boolean even ; private boolean singular ; private FieldMatrix < T > cachedL ; private FieldMatrix < T > cachedU ; private FieldMatrix < T > cachedP ; public FieldLUDecomposition ( FieldMatrix < T > matrix ) { } public FieldMatrix < T > getL ( ) { } public FieldMatrix < T > getU ( ) { } public FieldMatrix < T > getP ( ) { } public int [ ] getPivot ( ) { } public T getDeterminant ( ) { } public FieldDecompositionSolver < T > getSolver ( ) { } private static class Solver < T extends FieldElement < T > > implements FieldDecompositionSolver < T > { private final Field < T > field ; private final T [ ] [ ] lu ; private final int [ ] pivot ; private final boolean singular ; private Solver ( final Field < T > field , final T [ ] [ ] lu , final int [ ] pivot , final boolean singular ) { } public boolean isNonSingular ( ) { } public FieldVector < T > solve ( FieldVector < T > b ) { } public ArrayFieldVector < T > solve ( ArrayFieldVector < T > b ) { final int m = pivot . length ; <START_BUG> final int length = b . getDataRef ( ) . length ; <END_BUG> if ( length != m ) { throw new DimensionMismatchException ( length , m ) ; } if ( singular ) { throw new SingularMatrixException ( ) ; } @ SuppressWarnings ( "unchecked" ) final T [ ] bp = ( ( T [ ] ) ( Array . newInstance ( field . getRuntimeClass ( ) , m ) ) ) ; for ( int row = 0 ; row < m ; row ++ ) { bp [ row ] = b . getEntry ( pivot [ row ] ) ; } for ( int col = 0 ; col < m ; col ++ ) { final T bpCol = bp [ col ] ; for ( int i = col + 1 ; i < m ; i ++ ) { bp [ i ] = bp [ i ] . subtract ( bpCol . multiply ( lu [ i ] [ col ] ) ) ; } } for ( int col = m - 1 ; col >= 0 ; col -- ) { bp [ col ] = bp [ col ] . divide ( lu [ col ] [ col ] ) ; final T bpCol = bp [ col ] ; for ( int i = 0 ; i < col ; i ++ ) { bp [ i ] = bp [ i ] . subtract ( bpCol . multiply ( lu [ i ] [ col ] ) ) ; } } return new ArrayFieldVector < T > ( bp , false ) ; } public FieldMatrix < T > solve ( FieldMatrix < T > b ) { } public FieldMatrix < T > getInverse ( ) { } } }

Fix:
final int length = b . getDimension ( ) ;
Buggy code:
public class StudentSubmissionView extends JFrame { private static final String NAME_OF_PAGE = "Student<seq2seq4repair_space>Submission" ; private static final MainView home = new MainView ( ) ; private String userID ; public void studentSubmissionStart ( String id ) { initComponents ( ) ; hideErrorFields ( ) ; userID = id ; idOfUser . setText ( userID ) ; try { for ( UIManager . LookAndFeelInfo info : UIManager . getInstalledLookAndFeels ( ) ) { if ( "Windows" . equals ( info . getName ( ) ) ) { UIManager . setLookAndFeel ( info . getClassName ( ) ) ; break ; } } } catch ( ClassNotFoundException | InstantiationException | IllegalAccessException | UnsupportedLookAndFeelException ex ) { Logger . getLogger ( StudentSubmissionView . class . getName ( ) ) . log ( Level . SEVERE , null , ex ) ; } addWindowListener ( new WindowAdapter ( ) { @ Override public void windowClosing ( WindowEvent e ) { dispose ( ) ; <START_BUG> StudentSubmissionView . home . resetAdminMode ( ) ; <END_BUG> } } ) ; setVisible ( true ) ; } @ SuppressWarnings ( "unchecked" ) private void initComponents ( ) { } private void hideErrorFields ( ) { } private boolean errCheck ( ) { } private void Student_SubmitActionPerformed ( ActionEvent evt ) { } private void Reset_StudentSubmissionFields ( ) { } private void BrowseMouseClicked ( MouseEvent evt ) { } private void jMenuItem1ActionPerformed ( ActionEvent evt ) { } private void BrowseActionPerformed ( ActionEvent evt ) { } private void printerBoxActionPerformed ( ActionEvent evt ) { } private void classBoxActionPerformed ( ActionEvent evt ) { } private void fileLocationActionPerformed ( ActionEvent evt ) { } private void jButton1ActionPerformed ( ActionEvent evt ) { } private void projNameActionPerformed ( ActionEvent evt ) { } private void idOfUserActionPerformed ( ActionEvent evt ) { } private JButton Browse ; private JButton Student_Submit ; private JComboBox classBox ; private JMenu editMenu ; private JLabel error_NoClassSelected ; private JLabel error_NoFileLocationSelected ; private JLabel error_NoPrinterSelected ; private JTextField fileLocation ; private JTextField idOfUser ; private JButton jButton1 ; private JLabel jLabel1 ; private JLabel jLabel1_FileLocation ; private JLabel jLabel5_ProjName ; private JLabel jLabel6_Class ; private JLabel jLabel7_Printer ; private JLabel jLabel8_StudentSubmission ; private JLabel jLabel9 ; private JMenuBar jMenuBar1 ; private JMenuItem jMenuItem1 ; private JScrollPane jScrollPane1 ; private JSeparator jSeparator1 ; private JTextArea jTextArea1 ; private JComboBox printerBox ; private JTextField projName ; }

Fix:
StudentSubmissionView . home . setVisible ( true ) ;
Buggy code:
public class AjaxTabbedPanel extends TabbedPanel { private static final long serialVersionUID = 1L ; public AjaxTabbedPanel ( String id , List < ITab > tabs ) { } @ Override protected WebMarkupContainer newLink ( String linkId , final int index ) { return new org . apache . wicket . ajax . markup . html . AjaxFallbackLink < Void > ( linkId ) { private static final long serialVersionUID = 1L ; @ Override public void onClick ( AjaxRequestTarget target ) { setSelectedTab ( index ) ; if ( target != null ) { <START_BUG> target . addComponent ( AjaxTabbedPanel . this ) ; <END_BUG> } onAjaxUpdate ( target ) ; } } ; } protected void onAjaxUpdate ( AjaxRequestTarget target ) { } }

Fix:
target . add ( AjaxTabbedPanel . this ) ;
Buggy code:
public class Initializer extends BodyDeclaration { public static final ChildPropertyDescriptor JAVADOC_PROPERTY = BodyDeclaration . internalJavadocPropertyFactory ( Initializer . class ) ; public static final SimplePropertyDescriptor MODIFIERS_PROPERTY = BodyDeclaration . internalModifiersPropertyFactory ( Initializer . class ) ; public static final ChildListPropertyDescriptor MODIFIERS2_PROPERTY = BodyDeclaration . internalModifiers2PropertyFactory ( Initializer . class ) ; public static final ChildPropertyDescriptor BODY_PROPERTY = new ChildPropertyDescriptor ( Initializer . class , "body" , Block . class , ASTNode . MANDATORY , ASTNode . CYCLE_RISK ) ; private static final List PROPERTY_DESCRIPTORS_2_0 ; private static final List PROPERTY_DESCRIPTORS_3_0 ; public static List propertyDescriptors ( int apiLevel ) { } private Block body = null ; Initializer ( AST ast ) { } final List internalStructuralPropertiesForType ( int apiLevel ) { } final int internalGetSetIntProperty ( SimplePropertyDescriptor property , boolean get , int value ) { } final ASTNode internalGetSetChildProperty ( ChildPropertyDescriptor property , boolean get , ASTNode child ) { } final List internalGetChildListProperty ( ChildListPropertyDescriptor property ) { } final ChildPropertyDescriptor internalJavadocProperty ( ) { } final ChildListPropertyDescriptor internalModifiers2Property ( ) { } final SimplePropertyDescriptor internalModifiersProperty ( ) { } final int getNodeType0 ( ) { } ASTNode clone0 ( AST target ) { } final boolean subtreeMatch0 ( ASTMatcher matcher , Object other ) { } void accept0 ( ASTVisitor visitor ) { } public Block getBody ( ) { if ( ( this . body ) == null ) { <START_BUG> synchronized ( this . ast ) { <END_BUG> if ( ( this . body ) == null ) { preLazyInit ( ) ; this . body = new Block ( this . ast ) ; postLazyInit ( this . body , Initializer . BODY_PROPERTY ) ; } } } return this . body ; } public void setBody ( Block body ) { } int memSize ( ) { } int treeSize ( ) { } }

Fix:
synchronized ( this ) {
Buggy code:
public abstract class AbstractHttpReceivingTransportHandler extends AbstractTransportHandler { @ Override public final void handleRequest ( ServerHttpRequest request , ServerHttpResponse response , WebSocketHandler wsHandler , SockJsSession wsSession ) throws SockJsException { } protected void handleRequestInternal ( ServerHttpRequest request , ServerHttpResponse response , WebSocketHandler wsHandler , AbstractHttpSockJsSession sockJsSession ) throws SockJsException { } private void handleReadError ( ServerHttpResponse response , String error , String sessionId ) { try { response . setStatusCode ( INTERNAL_SERVER_ERROR ) ; <START_BUG> response . getBody ( ) . write ( error . getBytes ( "UTF-8" ) ) ; <END_BUG> } catch ( IOException ex ) { throw new SockJsException ( ( "Failed<seq2seq4repair_space>to<seq2seq4repair_space>send<seq2seq4repair_space>error:<seq2seq4repair_space>" + error ) , sessionId , ex ) ; } } protected abstract String [ ] readMessages ( ServerHttpRequest request ) throws IOException { } protected abstract HttpStatus getResponseStatus ( ) { } }

Fix:
response . getBody ( ) . write ( error . getBytes ( UTF8_CHARSET ) ) ;
Buggy code:
public class SettingsActivity extends AlarmAbstractActivity { public static class SettingsFragment extends PreferenceFragment implements SharedPreferences . OnSharedPreferenceChangeListener { @ Override public void onCreate ( Bundle savedInstanceState ) { super . onCreate ( savedInstanceState ) ; addPreferencesFromResource ( preferences ) ; <START_BUG> PreferenceManager . setDefaultValues ( getActivity ( ) , preferences , true ) ; <END_BUG> initSummary ( getPreferenceScreen ( ) ) ; } @ Override public void onResume ( ) { } @ Override public void onPause ( ) { } @ Override public void onSharedPreferenceChanged ( SharedPreferences sharedPreferences , String key ) { } private void initSummary ( Preference p ) { } private void updatePrefSummary ( Preference p ) { } } @ Override protected void onCreate ( Bundle savedInstanceState ) { super . onCreate ( savedInstanceState , getString ( action_settings ) ) ; getFragmentManager ( ) . beginTransaction ( ) . replace ( content , new SettingsActivity . SettingsFragment ( ) ) . commit ( ) ; } }

Fix:
PreferenceManager . setDefaultValues ( getActivity ( ) , preferences , false ) ;
Buggy code:
public class MultivariateMultiStartOptimizerTest { @ Test public void testRosenbrock ( ) { MultivariateMultiStartOptimizerTest . Rosenbrock rosenbrock = new MultivariateMultiStartOptimizerTest . Rosenbrock ( ) ; SimplexOptimizer underlying = new SimplexOptimizer ( new SimpleScalarValueChecker ( ( - 1 ) , 0.001 ) ) ; NelderMeadSimplex simplex = new NelderMeadSimplex ( new double [ ] [ ] { new double [ ] { - 1.2 , 1.0 } , new double [ ] { 0.9 , 1.2 } , new double [ ] { 3.5 , - 2.3 } } ) ; underlying . setSimplex ( simplex ) ; JDKRandomGenerator g = new JDKRandomGenerator ( ) ; g . setSeed ( 16069223052L ) ; RandomVectorGenerator generator = new UncorrelatedRandomVectorGenerator ( 2 , new org . apache . commons . math . random . GaussianRandomGenerator ( g ) ) ; MultivariateMultiStartOptimizer optimizer = new MultivariateMultiStartOptimizer ( underlying , 10 , generator ) ; <START_BUG> RealPointValuePair optimum = optimizer . optimize ( 1100 , rosenbrock , MINIMIZE , new double [ ] { - 1.2 , 1.0 } ) ; <END_BUG> Assert . assertEquals ( rosenbrock . getCount ( ) , optimizer . getEvaluations ( ) ) ; Assert . assertTrue ( ( ( optimizer . getEvaluations ( ) ) > 900 ) ) ; Assert . assertTrue ( ( ( optimizer . getEvaluations ( ) ) < 1200 ) ) ; Assert . assertTrue ( ( ( optimum . getValue ( ) ) < 8.0E-4 ) ) ; } private static class Rosenbrock implements MultivariateFunction { private int count ; public Rosenbrock ( ) { } public double value ( double [ ] x ) { } public int getCount ( ) { } } }

Fix:
PointValuePair optimum = optimizer . optimize ( 1100 , rosenbrock , MINIMIZE , new double [ ] { - 1.2 , 1.0 } ) ;
Buggy code:
public enum DirectionType { NORTH ( new Vector ( 0 , 0 , ( - 1 ) ) , Arrays . asList ( "north" , "n" ) ) , SOUTH ( new Vector ( 0 , 0 , 1 ) , Arrays . asList ( "south" , "s" ) ) , EAST ( new Vector ( 1 , 0 , 0 ) , Arrays . asList ( "east" , "e" ) ) , WEST ( new Vector ( ( - 1 ) , 0 , 0 ) , Arrays . asList ( "west" , "w" ) ) , NORTHEAST ( new Vector ( 1 , 0 , ( - 1 ) ) , Arrays . asList ( "northeast" , "ne" ) ) , SOUTHEAST ( new Vector ( 1 , 0 , 1 ) , Arrays . asList ( "southeast" , "se" ) ) , NORTHWEST ( new Vector ( ( - 1 ) , 0 , ( - 1 ) ) , Arrays . asList ( "northwest" , "nw" ) ) , SOUTHWEST ( new Vector ( ( - 1 ) , 0 , 1 ) , Arrays . asList ( "southwest" , "sw" ) ) ; private Vector direction ; private List < String > names ; private static final Map < String , DirectionType > nameMap = new HashMap < String , DirectionType > ( ) ; private DirectionType ( Vector direction , List < String > names ) { } public Vector getDirection ( ) { <START_BUG> return direction ; <END_BUG> } public static DirectionType fromName ( String name ) { } }

Fix:
return direction . clone ( ) ;
Buggy code:
public class CashMachineListView extends ArrayAdapter < CashMachineItem > { private final Activity activity ; private final List < CashMachineItem > items ; public CashMachineListView ( Activity activity , List < CashMachineItem > items ) { } @ Override public View getView ( int position , View convertView , ViewGroup parent ) { LayoutInflater inflater = activity . getLayoutInflater ( ) ; View rowView = inflater . inflate ( cash_machine_item , null , true ) ; TextView placeLabel = ( ( TextView ) ( rowView . findViewById ( cash_item_place ) ) ) ; TextView addressLabel = ( ( TextView ) ( rowView . findViewById ( cash_address ) ) ) ; TextView scheduleLablel = ( ( TextView ) ( rowView . findViewById ( cash_schedule ) ) ) ; placeLabel . setText ( items . get ( position ) . getPlace ( ) ) ; addressLabel . setText ( items . get ( position ) . getAddress ( ) ) ; Calendar c = Calendar . getInstance ( ) ; c . setTime ( new Date ( ) ) ; <START_BUG> scheduleLablel . setText ( items . get ( position ) . getSchedule ( ) . get ( c . get ( Calendar . DAY_OF_WEEK ) ) ) ; <END_BUG> return rowView ; } }

Fix:
scheduleLablel . setText ( items . get ( position ) . getSchedule ( ) . get ( ( ( c . get ( Calendar . DAY_OF_WEEK ) ) - 1 ) ) ) ;
Buggy code:
public class WithinAnnotationPointcut extends NameBindingPointcut { private AnnotationTypePattern annotationTypePattern ; private ShadowMunger munger ; private String declarationText ; public WithinAnnotationPointcut ( AnnotationTypePattern type ) { } public WithinAnnotationPointcut ( AnnotationTypePattern type , ShadowMunger munger ) { } public AnnotationTypePattern getAnnotationTypePattern ( ) { } public int couldMatchKinds ( ) { } public Pointcut parameterizeWith ( Map typeVariableMap ) { } public FuzzyBoolean fastMatch ( FastMatchInfo info ) { } protected FuzzyBoolean matchInternal ( Shadow shadow ) { } protected void resolveBindings ( IScope scope , Bindings bindings ) { } protected Pointcut concretize1 ( ResolvedType inAspect , ResolvedType declaringType , IntMap bindings ) { } protected Test findResidueInternal ( Shadow shadow , ExposedState state ) { if ( ( annotationTypePattern ) instanceof BindingAnnotationTypePattern ) { BindingAnnotationTypePattern btp = ( ( BindingAnnotationTypePattern ) ( annotationTypePattern ) ) ; UnresolvedType annotationType = btp . annotationType ; Var var = shadow . getWithinAnnotationVar ( annotationType ) ; if ( var == null ) throw new org . aspectj . weaver . BCException ( ( ( ( ( ( ( ( ( "Impossible!<seq2seq4repair_space>annotation=[" + annotationType ) + "]<seq2seq4repair_space>shadow=[" ) + shadow ) + "<seq2seq4repair_space>at<seq2seq4repair_space>" ) + ( shadow . getSourceLocation ( ) ) ) + "]<seq2seq4repair_space>pointcut<seq2seq4repair_space>is<seq2seq4repair_space>at<seq2seq4repair_space>[" ) + ( getSourceLocation ( ) ) ) + "]" ) ) ; state . set ( btp . getFormalIndex ( ) , var ) ; } <START_BUG> return Literal . TRUE ; <END_BUG> } public List getBindingAnnotationTypePatterns ( ) { } public List getBindingTypePatterns ( ) { } public void write ( DataOutputStream s ) throws IOException { } public static Pointcut read ( VersionedDataInputStream s , ISourceContext context ) throws IOException { } public boolean equals ( Object obj ) { } public int hashCode ( ) { } private void buildDeclarationText ( ) { } public String toString ( ) { } public Object accept ( PatternNodeVisitor visitor , Object data ) { } }

Fix:
return match ( shadow ) . alwaysTrue ( ) ? Literal . TRUE : Literal . FALSE ;
Buggy code:
public class ClaimantEditClaimController { private Claim claim = null ; public ClaimantEditClaimController ( Claim currentClaim ) { } public void editClaim ( String name , String begin , String end ) throws StatusException { if ( ( AppSingleton . getInstance ( ) . getStatus ( ) . equals ( "Submitted" ) ) || ( AppSingleton . getInstance ( ) . getStatus ( ) . equals ( "Approved" ) ) ) { throw new StatusException ( ) ; } Date beginDate = null ; Date endDate = null ; try { beginDate = AppSingleton . getDateFormat ( ) . parse ( begin ) ; } catch ( ParseException e ) { beginDate = null ; } try { endDate = AppSingleton . getDateFormat ( ) . parse ( end ) ; } catch ( ParseException e ) { endDate = null ; } claim . setName ( name ) ; claim . setBeginDate ( beginDate ) ; claim . setEndDate ( endDate ) ; <START_BUG> if ( ( ( name . equals ( "" ) ) || ( begin . equals ( "" ) ) ) || ( end . equals ( "" ) ) ) { <END_BUG> claim . setMissValue ( true ) ; } else { claim . setMissValue ( false ) ; } } }

Fix:
if ( ( ( name . equals ( "" ) ) || ( begin == null ) ) || ( end == null ) ) {
Buggy code:
public class TranslationCheckTest extends BaseCheckTestSupport { @ Override protected DefaultConfiguration createCheckerConfig ( Configuration config ) { } @ Test public void testTranslation ( ) throws Exception { } @ Test public void testBaseNameSeparator ( ) throws Exception { } @ Test public void testOnePropertyFileSet ( ) throws Exception { } @ Test public void testLogIOExceptionFileNotFound ( ) throws Exception { } @ Test public void testLogIOException ( ) throws Exception { TranslationCheck check = new TranslationCheck ( ) ; DefaultConfiguration checkConfig = createCheckConfig ( TranslationCheck . class ) ; check . configure ( checkConfig ) ; check . setMessageDispatcher ( createChecker ( checkConfig ) ) ; Method logIOException = check . getClass ( ) . getDeclaredMethod ( "logIOException" , IOException . class , File . class ) ; logIOException . setAccessible ( true ) ; <START_BUG> logIOException . invoke ( check , new IOException ( ) , new File ( "" ) ) ; <END_BUG> } }

Fix:
logIOException . invoke ( check , new IOException ( "test<seq2seq4repair_space>exception" ) , new File ( "" ) ) ;
Buggy code:
public abstract class Page extends MarkupContainer implements IRedirectListener { protected static final boolean ACCESS_ALLOWED = true ; protected static final boolean ACCESS_DENIED = false ; private static final Log log = LogFactory . getLog ( Page . class ) ; private int autoIndex ; private FeedbackMessages feedbackMessages ; private int id = - 1 ; private final Session session ; private boolean stale = false ; private int staleRendering = 0 ; protected Page ( ) { } public final void detachModels ( ) { } public int getAutoIndex ( ) { } public FeedbackMessages getFeedbackMessages ( ) { } public final int getId ( ) { } public final String getName ( ) { } public final Session getSession ( ) { } public final boolean isRenderingStale ( final int rendering ) { } public final boolean isStale ( ) { } public final void onRedirect ( ) { } public final void removePersistedFormData ( final Class formClass , final boolean disablePersistence ) { } public void render ( ) { } public String toString ( ) { <START_BUG> return ( ( ( "[class<seq2seq4repair_space>=<seq2seq4repair_space>" + ( getClass ( ) . getName ( ) ) ) + ",<seq2seq4repair_space>id<seq2seq4repair_space>=<seq2seq4repair_space>" ) + ( id ) ) + "]" ; <END_BUG> } protected boolean checkAccess ( ) { } protected void configureResponse ( ) { } protected void onRender ( ) { } final void reset ( ) { } final void setId ( final int id ) { } final void setStale ( final boolean stale ) { } final void setStaleRendering ( final int staleRendering ) { } }

Fix:
return ( ( ( "[Page<seq2seq4repair_space>class<seq2seq4repair_space>=<seq2seq4repair_space>" + ( getClass ( ) . getName ( ) ) ) + ",<seq2seq4repair_space>id<seq2seq4repair_space>=<seq2seq4repair_space>" ) + ( id ) ) + "]" ;
Buggy code:
public class ColumnFamilyRecordReader extends RecordReader < byte [ ] , SortedMap < byte [ ] , IColumn > > { private ColumnFamilySplit split ; private ColumnFamilyRecordReader . RowIterator iter ; private Pair < byte [ ] , SortedMap < byte [ ] , IColumn > > currentRow ; private SlicePredicate predicate ; private int totalRowCount ; private int batchRowCount ; private String cfName ; private String keyspace ; private TSocket socket ; private Client client ; public void close ( ) { } public byte [ ] getCurrentKey ( ) { } public SortedMap < byte [ ] , IColumn > getCurrentValue ( ) { } public float getProgress ( ) { } public void initialize ( InputSplit split , TaskAttemptContext context ) throws IOException { } public boolean nextKeyValue ( ) throws IOException { } private String getLocation ( ) { } private class RowIterator extends AbstractIterator < Pair < byte [ ] , SortedMap < byte [ ] , IColumn > > > { private List < KeySlice > rows ; private String startToken ; private int totalRead = 0 ; private int i = 0 ; private final AbstractType comparator ; private final AbstractType subComparator ; private final IPartitioner partitioner ; private RowIterator ( ) { } private void maybeInit ( ) { } public int rowsRead ( ) { } @ Override protected Pair < byte [ ] , SortedMap < byte [ ] , IColumn > > computeNext ( ) { } private IColumn unthriftify ( ColumnOrSuperColumn cosc ) { } private IColumn unthriftifySuper ( SuperColumn super_column ) { ClockType clockType = ClockType . Timestamp ; <START_BUG> AbstractReconciler reconciler = new TimestampReconciler ( ) ; <END_BUG> org . apache . cassandra . db . SuperColumn sc = new org . apache . cassandra . db . SuperColumn ( super_column . name , subComparator , clockType , reconciler ) ; for ( Column column : super_column . columns ) { sc . addColumn ( unthriftifySimple ( column ) ) ; } return sc ; } private IColumn unthriftifySimple ( Column column ) { } private IClock unthriftifyClock ( Clock clock ) { } } }

Fix:
AbstractReconciler reconciler = TimestampReconciler . instance ;
Buggy code:
public class PublishTest extends TestCase { BundleContext context ; List serviceRegistrations = new ArrayList ( ) ; protected void setUp ( ) throws Exception { } protected void tearDown ( ) throws Exception { } class TestServicePublication implements IServicePublication { public ServiceReference getReference ( ) { } } class DiscoveredServiceTrackerImpl implements DiscoveredServiceTracker { public void serviceChanged ( DiscoveredServiceNotification notification ) { } } protected Properties createServicePublicationProperties ( List interfaces ) { Properties props = new Properties ( ) ; <START_BUG> props . put ( PROP_KEY_SERVICE_INTERFACE_NAME , interfaces ) ; <END_BUG> return props ; } protected ServicePublication createServicePublication ( ) { } protected DiscoveredServiceTracker createDiscoveredServiceTracker ( ) { } public void testDiscoveryTrackerPublish ( ) throws Exception { } public void testServicePublish ( ) throws Exception { } public void testDiscoveryTrackerAndServicePublish ( ) throws Exception { } }

Fix:
props . put ( SERVICE_INTERFACE_NAME , interfaces ) ;
Buggy code:
public class TestDeleteAction extends BaseAction { private static String FWD_CLOSE = "close" ; protected ActionForward performAction ( ActionMapping mapping , ActionForm form , HttpServletRequest request , HttpServletResponse response ) throws Exception { String forward = "success" ; DynaActionForm dynaForm = ( ( DynaActionForm ) ( form ) ) ; String [ ] selectedIDs = ( ( String [ ] ) ( dynaForm . get ( "selectedIDs" ) ) ) ; UserSessionData usd = ( ( UserSessionData ) ( request . getSession ( ) . getAttribute ( USER_SESSION_DATA ) ) ) ; String sysUserId = String . valueOf ( usd . getSystemUserId ( ) ) ; List tests = new ArrayList ( ) ; for ( int i = 0 ; i < ( selectedIDs . length ) ; i ++ ) { Test test = new Test ( ) ; test . setId ( selectedIDs [ i ] ) ; test . setSysUserId ( sysUserId ) ; tests . add ( test ) ; } Transaction tx = HibernateUtil . getSession ( ) . beginTransaction ( ) ; ActionMessages errors = null ; try { TestDAO testDAO = new TestDAOImpl ( ) ; testDAO . deleteData ( tests ) ; <START_BUG> TypeOfSampleUtil . clearTestCache ( ) ; <END_BUG> dynaForm . initialize ( mapping ) ; tx . commit ( ) ; } catch ( LIMSRuntimeException lre ) { LogEvent . logError ( "TestDeleteAction" , "performAction()" , lre . toString ( ) ) ; tx . rollback ( ) ; errors = new ActionMessages ( ) ; ActionError error = null ; if ( ( lre . getException ( ) ) instanceof StaleObjectStateException ) { error = new ActionError ( "errors.OptimisticLockException" , null , null ) ; } else { error = new ActionError ( "errors.DeleteException" , null , null ) ; } errors . add ( GLOBAL_MESSAGE , error ) ; saveErrors ( request , errors ) ; request . setAttribute ( ERROR_KEY , errors ) ; forward = FWD_FAIL ; } finally { HibernateUtil . closeSession ( ) ; } if ( forward . equals ( FWD_FAIL ) ) return mapping . findForward ( forward ) ; if ( "true" . equalsIgnoreCase ( request . getParameter ( "close" ) ) ) { forward = TestDeleteAction . FWD_CLOSE ; } request . setAttribute ( "menuDefinition" , "TestMenuDefinition" ) ; return mapping . findForward ( forward ) ; } protected String getPageTitleKey ( ) { } protected String getPageSubtitleKey ( ) { } No newline ; at end ; of file ; }

Fix:
TypeOfSampleUtil . clearCache ( ) ;
Buggy code:
public class AuthFragment extends Fragment { public static final String TOKEN_STORAGE_KEY = "token" ; public static String PREFS_FILE_NAME = "prefs" ; public static Button mScanQRButton = null ; public static ProgressBar mAsyncSpinner = null ; private static Activity mActiviy ; public AuthFragment ( ) { } public static String getToken ( ) { } @ Override public View onCreateView ( LayoutInflater inflater , ViewGroup container , Bundle savedInstanceState ) { } private void checkTokenAsync ( ) { } public void onActivityResult ( int requestCode , int resultCode , Intent data ) { } private void activateQRButton ( ) { } public void showErrorToast ( String text ) { } public class CheckToken extends AsyncTask < Void , Void , Boolean > { private final String LOG_TAG = AuthFragment . CheckToken . class . getSimpleName ( ) ; protected Boolean getTokenStatusFromJSON ( String JSONString ) throws JSONException { } @ Override protected Boolean doInBackground ( Void ... params ) { } protected void onPostExecute ( Boolean result ) { if ( result != null ) { <START_BUG> if ( result == true ) { <END_BUG> startActivity ( new Intent ( getActivity ( ) , TimetableActivity . class ) ) ; getActivity ( ) . finish ( ) ; } else { if ( ! ( MainActivity . active ) ) { startActivity ( new Intent ( getActivity ( ) , MainActivity . class ) ) ; getActivity ( ) . finish ( ) ; } activateQRButton ( ) ; } } else { showErrorToast ( "Connection<seq2seq4repair_space>error." ) ; activateQRButton ( ) ; } } } }

Fix:
if ( result ) {
Buggy code:
public class TaskListSorter implements OnTaskResult . ITaskListener { public static final class TaskListInfo { public String key = "" ; public int start_position = - 1 ; public List < Task > tasks ; public TaskListInfo ( String key ) { } public boolean add ( Task task ) { } public boolean remove ( Task task ) { } public boolean update ( Task task ) { } } public static final int KEY_FINISH = 7 ; public static final String [ ] keys = new String [ ] { "urgent" , "expired" , "day" , "week" , "month" , "year" , "other" , "finish" } ; private HashMap < Integer , TaskListSorter . TaskListInfo > m_data ; public static int ITEM_TYPE_CLASS = 0 ; public static int ITEM_TYPE_TASK = 1 ; private TaskFolder m_folder = null ; public TaskListSorter ( ) { } public int judge ( Task task ) { } public static final SimpleDateFormat dateFormat ( ) { } public static final SimpleDateFormat monthDayFormat ( ) { } private int judgeDate ( Task task ) { if ( ( ( task . expired ) != null ) && ( ! ( task . expired . isEmpty ( ) ) ) ) { SimpleDateFormat df = TaskListSorter . dateFormat ( ) ; long diff = 0 ; try { Date expired = df . parse ( task . expired ) ; Date today = new Date ( ) ; diff = ( expired . getTime ( ) ) - ( today . getTime ( ) ) ; diff = diff // ( ( ( 1000 * 60 ) * 60 ) * 24 ) ; } catch ( ParseException e ) { e . printStackTrace ( ) ; } if ( diff < 0 ) { return 1 ; } <START_BUG> if ( diff < 2 ) { <END_BUG> return 2 ; } if ( diff < 8 ) { return 3 ; } else if ( diff < 31 ) { return 4 ; } else { return 5 ; } } return - 1 ; } public boolean init ( TaskFolder folder ) { } private void classifyData ( TaskFolder folder ) { } private void sort ( ) { } private void startPostion ( ) { } public void clearData ( ) { } public boolean remove ( Task task ) { } public boolean add ( Task task ) { } public boolean update ( Task task ) { } public Task getTask ( int position ) { } public String getTaskKey ( int position ) { } public int getItemType ( int position ) { } public int getCount ( ) { } public int getClassIndex ( int position ) { } public TaskListSorter . TaskListInfo get ( int key ) { } @ Override public int act ( Type type , TaskFolder folder , Task oldTask , Task task ) { } @ Override protected void finalize ( ) throws Throwable { } public String log ( ) { } }

Fix:
if ( diff < 1 ) {
Buggy code:
public class ImageJTypedPath extends TypedPath . NonPosixTypedPath { @ FileSystemInfo ( name = "ImageJ<seq2seq4repair_space>Path" , desc = "a<seq2seq4repair_space>path<seq2seq4repair_space>stored<seq2seq4repair_space>in<seq2seq4repair_space>imagej<seq2seq4repair_space>windows" ) public static class IJP extends ITIPLFileSystem . WebPrefixFileSystem { public IJP ( ) { } @ Override public boolean isValidPath ( final String currentString ) { } @ Override protected TypedPath openPath ( String prefix , String contents , String originalString ) { } } protected ImagePlus ip ; public ImageJTypedPath ( final ImagePlus ip ) { } public ImageJTypedPath ( int imageNo ) { } @ Override public PATHTYPE getPathType ( ) { } @ Override public boolean isReadable ( ) { } @ Override public TypedPath changePath ( String newPath ) { } @ Override public FileObject getFileObject ( ) { final ImagePlus cIP = this . ip ; return new FileObject ( ) { @ Override public byte [ ] getData ( ) { return new byte [ 0 ] ; } @ Override public String [ ] getText ( ) { return new String [ 0 ] ; } @ Override public InputStream getInputStream ( ) { return null ; } @ Override <START_BUG> public OutputStream getOutputStream ( ) { <END_BUG> return null ; } } ; } @ Override public TypedPath [ ] listFiles ( PathFilter pf ) { } public static ImageJTypedPath [ ] listWindows ( ) { } }

Fix:
public OutputStream getOutputStream ( boolean append ) {
Buggy code:
public abstract class AbstractContextLoader implements SmartContextLoader { private static final Log logger = LogFactory . getLog ( AbstractContextLoader . class ) ; private static final String [ ] EMPTY_STRING_ARRAY = new String [ ] { } ; private static final String SLASH = "//" ; public boolean generatesDefaults ( ) { } public void processContextConfiguration ( ContextConfigurationAttributes configAttributes ) { } public boolean supports ( MergedContextConfiguration mergedConfig ) { <START_BUG> return ! ( ObjectUtils . isEmpty ( mergedConfig . getLocations ( ) ) ) ; <END_BUG> } public final String [ ] processLocations ( Class < ? > clazz , String ... locations ) { } protected String [ ] generateDefaultLocations ( Class < ? > clazz ) { } protected String [ ] modifyLocations ( Class < ? > clazz , String ... locations ) { } protected boolean isGenerateDefaultLocations ( ) { } protected abstract String getResourceSuffix ( ) { } }

Fix:
return ( ! ( ObjectUtils . isEmpty ( mergedConfig . getLocations ( ) ) ) ) && ( ObjectUtils . isEmpty ( mergedConfig . getClasses ( ) ) ) ;
Buggy code:
public class DefaultValidatorResourceKeyFactory implements IValidatorResourceKeyFactory { public String newKey ( IValidator validator , FormComponent formComponent ) { <START_BUG> return ( ( formComponent . getId ( ) ) + "." ) + ( Classes . name ( validator . getClass ( ) ) ) ; <END_BUG> } }

Fix:
return ( ( formComponent . getId ( ) ) + "." ) + ( Classes . simpleName ( validator . getClass ( ) ) ) ;
Buggy code:
public abstract class AbstractAjaxBehavior implements IBehavior , IBehaviorListener , IHeaderContributor { private static final ThreadLocal headContribHolder = new ThreadLocal ( ) ; private Component component ; public AbstractAjaxBehavior ( ) { } public final void bind ( final Component hostComponent ) { } public void detachModel ( ) { } public final String getCallbackUrl ( ) { if ( ( getComponent ( ) ) == null ) { throw new IllegalArgumentException ( "Behavior<seq2seq4repair_space>must<seq2seq4repair_space>be<seq2seq4repair_space>bound<seq2seq4repair_space>to<seq2seq4repair_space>a<seq2seq4repair_space>component<seq2seq4repair_space>to<seq2seq4repair_space>create<seq2seq4repair_space>the<seq2seq4repair_space>URL" ) ; } if ( ! ( ( this ) instanceof IBehaviorListener ) ) { throw new IllegalArgumentException ( "The<seq2seq4repair_space>behavior<seq2seq4repair_space>must<seq2seq4repair_space>implement<seq2seq4repair_space>IBehaviorListener<seq2seq4repair_space>to<seq2seq4repair_space>accept<seq2seq4repair_space>requests" ) ; } int index = getComponent ( ) . getBehaviors ( ) . indexOf ( this ) ; if ( index == ( - 1 ) ) { throw new IllegalArgumentException ( ( ( ( "Behavior<seq2seq4repair_space>" + ( this ) ) + "<seq2seq4repair_space>was<seq2seq4repair_space>not<seq2seq4repair_space>registered<seq2seq4repair_space>with<seq2seq4repair_space>this<seq2seq4repair_space>component:<seq2seq4repair_space>" ) + ( getComponent ( ) . toString ( ) ) ) ) ; } <START_BUG> return ( ( getComponent ( ) . urlFor ( IBehaviorListener . class ) ) + "&behaviorId=" ) + index ; <END_BUG> } public final void onComponentTag ( final Component component , final ComponentTag tag ) { } protected void onComponentTag ( final ComponentTag tag ) { } public final void rendered ( final Component hostComponent ) { } public final void renderHead ( final Response response ) { } protected void writeJsReference ( final Response response , final PackageResourceReference ref ) { } protected final Component getComponent ( ) { } protected abstract String getImplementationId ( ) { } protected void onBind ( ) { } protected void onComponentRendered ( ) { } protected void onRenderHeadContribution ( final Response response ) { } protected void onRenderHeadInitContribution ( final Response response ) { } private final void write ( final HtmlHeaderContainer container , final String str ) { } }

Fix:
return ( ( getComponent ( ) . urlFor ( INTERFACE ) ) + "&behaviorId=" ) + index ;
Buggy code:
public abstract class MSVSS extends Task { private String m_SSDir = "" ; private String m_vssLogin = null ; private String m_vssPath = null ; private String m_serverPath = null ; public final void setSsdir ( String dir ) { <START_BUG> m_SSDir = project . translatePath ( dir ) ; <END_BUG> } public final String getSSCommand ( ) { } public final void setLogin ( String login ) { } public void getLoginCommand ( Commandline cmd ) { } public final void setVsspath ( String vssPath ) { } public String getVsspath ( ) { } public final void setServerpath ( String serverPath ) { } protected int run ( Commandline cmd ) { } private static final String SS_EXE = "ss" ; public static final String PROJECT_PREFIX = "$" ; public static final String COMMAND_GET = "Get" ; public static final String COMMAND_CHECKOUT = "Checkout" ; public static final String COMMAND_CHECKIN = "Checkin" ; public static final String COMMAND_LABEL = "Label" ; public static final String COMMAND_HISTORY = "History" ; public static final String FLAG_LOGIN = "-Y" ; public static final String FLAG_OVERRIDE_WORKING_DIR = "-GL" ; public static final String FLAG_AUTORESPONSE_DEF = "-I-" ; public static final String FLAG_AUTORESPONSE_YES = "-I-Y" ; public static final String FLAG_AUTORESPONSE_NO = "-I-N" ; public static final String FLAG_RECURSION = "-R" ; public static final String FLAG_VERSION = "-V" ; public static final String FLAG_VERSION_DATE = "-Vd" ; public static final String FLAG_VERSION_LABEL = "-VL" ; public static final String FLAG_WRITABLE = "-W" ; public static final String VALUE_NO = "-N" ; public static final String VALUE_YES = "-Y" ; public static final String FLAG_QUIET = "-O-" ; }

Fix:
m_SSDir = Project . translatePath ( dir ) ;
Buggy code:
public abstract class LeonModule extends ServletModule { protected List < String > javaScriptFilesToLoad = Lists . newLinkedList ( ) ; protected List < String > exposedUrls = Lists . newLinkedList ( ) ; public void exposeUrl ( String regex ) { } public void loadFile ( String fileName ) { } public void loadFile ( Class < ? > basePackage , String fileName ) { String base = basePackage . getPackage ( ) . getName ( ) . replace ( "." , "//" ) ; <START_BUG> String file = ( fileName . startsWith ( "//" ) ) ? fileName : fileName + "//" ; <END_BUG> loadFile ( ( base + file ) ) ; } @ Override protected void configureServlets ( ) { } @ Override protected < T > AnnotatedBindingBuilder < T > bind ( Class < T > clazz ) { } @ Override protected < T > LinkedBindingBuilder < T > bind ( Key < T > key ) { } @ Override protected < T > AnnotatedBindingBuilder < T > bind ( TypeLiteral < T > typeLiteral ) { } public void exposeJavaService ( String url , Class < ? > clazz ) { } public void exposeJavaService ( String url , Key < ? > key ) { } public void exposeJavaScript ( String url , String javaScriptObjectName ) { } protected abstract void config ( ) { } }

Fix:
String file = ( fileName . startsWith ( "//" ) ) ? fileName : "//" + fileName ;
Buggy code:
public class AuthController extends Controller { private static Session s ; public static Session getSession ( ) { } public static User getUser ( ) { } public static boolean check ( ) { } public static Result login ( ) { } <START_BUG> @ With ( AuthCheck . class ) <END_BUG> public static Result logout ( ) { AuthController . s = new Session ( request ( ) . cookies ( ) . get ( "sessid" ) . value ( ) ) ; AuthController . s . getUser ( ) . setSession ( null ) ; db . update ( AuthController . s . getUser ( ) , "session" , "" ) ; db . delete ( AuthController . s ) ; response ( ) . discardCookie ( "sessid" ) ; response ( ) . discardCookie ( "sesskey" ) ; return redirect ( "//login" ) ; } }

Fix:
@ With ( ActionController . class )
Buggy code:
public class StatefulSessionBeanObjectViewConfigurator extends SessionBeanObjectViewConfigurator { public static final StatefulSessionBeanObjectViewConfigurator INSTANCE = new StatefulSessionBeanObjectViewConfigurator ( ) ; @ Override protected void handleIsIdenticalMethod ( final ComponentConfiguration componentConfiguration , final ViewConfiguration configuration , final DeploymentReflectionIndex index , final Method method ) { <START_BUG> configuration . addClientInterceptor ( method , StatefulIdentityInterceptorFactory . INSTANCE , EJB_EQUALS_HASHCODE ) ; <END_BUG> } @ Override protected void handleRemoveMethod ( final ComponentConfiguration componentConfiguration , final ViewConfiguration configuration , final DeploymentReflectionIndex index , final Method method ) throws DeploymentUnitProcessingException { } }

Fix:
configuration . addClientInterceptor ( method , FACTORY , EJB_EQUALS_HASHCODE ) ;
Buggy code:
public class CrusherRecipeManager { public static final int ORE_ENERGY_COST = 400 ; public static final int INGOT_ENERGY_COST = 240 ; private static final String CORE_FILE_NAME = "SAGMillRecipes_Core.xml" ; private static final String CUSTOM_FILE_NAME = "SAGMillRecipes_User.xml" ; static final CrusherRecipeManager instance = new CrusherRecipeManager ( ) ; public static CrusherRecipeManager getInstance ( ) { } private final List < Recipe > recipes = new ArrayList < Recipe > ( ) ; private final List < RecipeInput > ballExcludes = new ArrayList < RecipeInput > ( ) ; private final List < GrindingBall > balls = new ArrayList < GrindingBall > ( ) ; private Set < ItemStack > excludedStacks = new HashSet < ItemStack > ( ) ; public CrusherRecipeManager ( ) { } public boolean isValidSagBall ( ItemStack stack ) { } public boolean isExcludedFromBallBonus ( MachineRecipeInput [ ] inputs ) { if ( ( inputs == null ) || ( ( inputs . length ) < 1 ) ) { return true ; } for ( MachineRecipeInput input : inputs ) { if ( ( input . item ) != null ) { if ( isExcludedStack ( input . item ) ) { return true ; } int id = OreDictionary . getOreID ( input . item ) ; if ( id >= 0 ) { String name = OreDictionary . getOreName ( id ) ; <START_BUG> if ( name . startsWith ( "ingot" ) ) { <END_BUG> addExcludedStack ( input . item ) ; return true ; } } } } for ( RecipeInput input : ballExcludes ) { if ( ( input != null ) && ( input . isInput ( inputs [ 0 ] . item ) ) ) { addExcludedStack ( inputs [ 0 ] . item ) ; return true ; } } return false ; } private void addExcludedStack ( ItemStack item ) { } private boolean isExcludedStack ( ItemStack item ) { } public IGrindingMultiplier getGrindballFromStack ( ItemStack stack ) { } public boolean isValidInput ( MachineRecipeInput input ) { } public void loadRecipesFromConfig ( ) { } public void addCustomRecipes ( String xmlDef ) { } public IRecipe getRecipeForInput ( ItemStack input ) { } private void processConfig ( RecipeConfig config ) { } public void addRecipe ( ItemStack input , int energyCost , ItemStack output ) { } public void addRecipe ( ItemStack input , int energyCost , RecipeOutput ... output ) { } public void addRecipe ( Recipe recipe ) { } public List < Recipe > getRecipes ( ) { } public static ItemStack getInput ( IRecipe recipe ) { } public List < GrindingBall > getBalls ( ) { } }

Fix:
if ( ( name . startsWith ( "ingot" ) ) || ( name . startsWith ( "block" ) ) ) {
Buggy code:
@ SuppressWarnings ( "unchecked" ) public class JSONPrinter { private static void writeToFile ( String filePath , JSONAware jsonObject ) { } public static void printUCCClusters ( String filePath , List < HashMap < String , Double > > clusterList ) { } public static void printUCCData ( String filePath , List < List < KMeans . UCCHistogram > > clusterInfoList ) { } public static void printUCCHistograms ( String filePath , List < List < HashMap < String , Double > > > clusterHistogramList ) { } public static void printUCCInfo ( String filePath , HashMap < String , Double > uccInfo ) { } private static JSONObject printRecursive ( int index , int begin , int end , ColumnCombination dependant , ColumnCombination currentPath , List < ColumnCombination > combinationList , TableInformation tableInformation , Map < FunctionalDependency , Integer > partialErrors ) { } public static void printFDsAsPrefixTreeJSON ( String filePath , List < FDResult > transformedResults , Map < ColumnCombination , List < ColumnCombination > > dependantsIndex , TableInformation tableInformation ) { JSONObject root = new JSONObject ( ) ; root . put ( "name" , tableInformation . getTableName ( ) ) ; root . put ( "tableSize" , tableInformation . getRowCount ( ) ) ; JSONArray rootChildren = new JSONArray ( ) ; List < ColumnCombination > dependantColumns = new java . util . ArrayList ( dependantsIndex . keySet ( ) ) ; <START_BUG> dependantColumns . sort ( new ColumnCombinationLexicalComparator ( ) ) ; <END_BUG> Map < FunctionalDependency , Integer > partialKeyErrors = FDRanking . calculatePartialKeyErrors ( transformedResults , tableInformation ) ; for ( ColumnCombination dependantColumn : dependantColumns ) { List < ColumnCombination > determinants = dependantsIndex . get ( dependantColumn ) ; Collections . sort ( determinants , new ColumnCombinationLexicalComparator ( ) ) ; JSONObject dependantJSON = JSONPrinter . printRecursive ( ( - 1 ) , 0 , ( ( determinants . size ( ) ) - 1 ) , dependantColumn . copy ( ) , new ColumnCombination ( tableInformation . getColumnCount ( ) ) , determinants , tableInformation , partialKeyErrors ) ; dependantJSON . put ( "name" , tableInformation . getColumn ( dependantColumn . nextSetBit ( 0 ) ) . getColumnName ( ) ) ; rootChildren . add ( dependantJSON ) ; } root . put ( "children" , rootChildren ) ; filePath = PathUnifier . combinePaths ( filePath , "PrefixTree.json" ) ; JSONPrinter . writeToFile ( filePath , root ) ; } }

Fix:
Collections . sort ( dependantColumns , new ColumnCombinationLexicalComparator ( ) ) ;
Buggy code:
public interface IComponentAssignedModel extends IModel { <START_BUG> INestedModelContainer wrapOnAssignment ( Component component ) ; <END_BUG> }

Fix:
IWrapModel wrapOnAssignment ( Component component ) ;
Buggy code:
public class CurrentWeather { private String mIcon ; private long mTime ; private double mTemperature ; private double mHumidity ; private double mPrecipChance ; private String mSummary ; public String getTimeZone ( ) { } public void setTimeZone ( String timeZone ) { } private String mTimeZone ; public String getIcon ( ) { } public void setIcon ( String icon ) { } public int getIconId ( ) { } public long getTime ( ) { } public String getFormattedTime ( ) { } public void setTime ( long time ) { } <START_BUG> public double getTemperature ( ) { <END_BUG> return ( ( int ) ( Math . round ( mTemperature ) ) ) ; } public void setTemperature ( double temperature ) { } public double getHumidity ( ) { } public void setHumidity ( double humidity ) { } public int getPrecipChance ( ) { } public void setPrecipChance ( double precipChance ) { } public String getSummary ( ) { } public void setSummary ( String summary ) { } }

Fix:
public int getTemperature ( ) {