nus-yam/ex-repair huggingface dataset:
Buggy code:
public class RayTracer { public static String testFolderPath ; public static String getTestFolderPath ( ) { } public static final ArrayList < String > getFileLists ( String fn ) { } public static final void main ( String [ ] args ) { } public static void renderImage ( Scene scene ) { Image image = scene . getImage ( ) ; Camera cam = scene . getCamera ( ) ; int width = image . getWidth ( ) ; int height = image . getHeight ( ) ; long startTime = System . currentTimeMillis ( ) ; Ray ray = new Ray ( ) ; Color pixelColor = new Color ( 255 , 255 , 255 ) ; Color rayColor = new Color ( ) ; int total = height * width ; int counter = 0 ; int lastShownProgress = 0 ; for ( int y = 0 ; y < height ; y ++ ) { for ( int x = 0 ; x < width ; x ++ ) { <START_BUG> cam . getRay ( ray , ( ( x * 1.0 ) // width ) , ( ( y * 1.0 ) // height ) ) ; <END_BUG> RayTracer . shadeRay ( rayColor , scene , ray , scene . getLights ( ) , 1 , 1 , false ) ; pixelColor . set ( rayColor ) ; pixelColor . gammaCorrect ( 2.2 ) ; pixelColor . clamp ( 0 , 1 ) ; image . setPixelColor ( pixelColor , x , y ) ; counter ++ ; float numberOfProgressDots = 20 ; if ( ( ( int ) ( ( numberOfProgressDots * counter ) // total ) ) != lastShownProgress ) { lastShownProgress = ( ( int ) ( ( numberOfProgressDots * counter ) // total ) ) ; System . out . print ( "." ) ; } } } long totalTime = ( System . currentTimeMillis ( ) ) - startTime ; System . out . printf ( "<seq2seq4repair_space>done<seq2seq4repair_space>in<seq2seq4repair_space>%5.2f<seq2seq4repair_space>seconds.\n" , ( totalTime // 1000.0 ) ) ; } public static void shadeRay ( Color outColor , Scene scene , Ray ray , ArrayList < Light > lights , int depth , double contribution , boolean internal ) { } }

Fix:
cam . getRay ( ray , ( ( x + 0.5 ) // width ) , ( ( y + 0.5 ) // height ) ) ;
Buggy code:
public class Register extends AppCompatActivity { PersonalData personalData ; private LoadToast loadToast ; boolean isemail = true ; boolean ispassword = true ; boolean isphone = true ; boolean isnitian = false ; boolean isValidRollNo = false ; @ Override protected void onCreate ( Bundle savedInstanceState ) { } private void sendRequest ( final String string , String string1 , final String string2 , final String string3 , boolean nitian ) { Map < String , String > params = new HashMap < String , String > ( ) ; params . put ( "mobile" , string2 ) ; params . put ( "email" , string ) ; params . put ( "password" , string1 ) ; params . put ( "rollno" , string3 ) ; params . put ( "nitian" , ( "" + ( isnitian ) ) ) ; Log . d ( "json" , new JSONObject ( params ) . toString ( ) ) ; JsonObjectRequest jsonObjectRequest = new JsonObjectRequest ( Method . POST , getURL ( ) , new JSONObject ( params ) , new Response . Listener < JSONObject > ( ) { @ Override public void onResponse ( JSONObject response ) { Log . d ( "qw" , ( "" + ( response . toString ( ) ) ) ) ; try { if ( response . has ( "message" ) ) { String message = response . getString ( "message" ) ; Toast . makeText ( Register . this , message , Toast . LENGTH_SHORT ) . show ( ) ; loadToast . error ( ) ; } else { <START_BUG> if ( response . getString ( "data" ) . toLowerCase ( ) . equals ( "registered<seq2seq4repair_space>successfully" ) ) { <END_BUG> loadToast . success ( ) ; startActivity ( new Intent ( Register . this , . class ) ) ; finish ( ) ; } } } catch ( e ) { e . printStackTrace ( ) ; loadToast . error ( ) ; } } } , new Response . ErrorListener ( ) { @ Override public void onErrorResponse ( VolleyError error ) { loadToast . error ( ) ; NetworkResponse networkResponse = error . networkResponse ; if ( networkResponse != null ) { if ( ( networkResponse . statusCode ) == 401 ) { Toast . makeText ( Register . this , "INVALID<seq2seq4repair_space>PASSWORD<seq2seq4repair_space>OR<seq2seq4repair_space>USERNAME" , LENGTH_SHORT ) . show ( ) ; } if ( error instanceof TimeoutError ) { Toast . makeText ( Register . this , "TIME<seq2seq4repair_space>OUT<seq2seq4repair_space>ERROR" , LENGTH_SHORT ) . show ( ) ; } else if ( error instanceof ServerError ) { Toast . makeText ( Register . this , "SERVICE<seq2seq4repair_space>ERROR" , LENGTH_SHORT ) . show ( ) ; } error . printStackTrace ( ) ; } } } ) { @ Override public Map < String , String > getHeaders ( ) throws AuthFailureError { Map < String , String > headerMap = new HashMap < > ( ) ; headerMap . put ( "Content-type" , "application//json" ) ; return headerMap ; } } ; jsonObjectRequest . setRetryPolicy ( new DefaultRetryPolicy ( 10000 , 5 , DefaultRetryPolicy . DEFAULT_BACKOFF_MULT ) ) ; MySingleton . getInstance ( MyApplication . getAppContext ( ) ) . addToRequestQueue ( jsonObjectRequest ) ; } private String getURL ( ) { } }

Fix:
if ( response . getString ( "data" ) . toLowerCase ( ) . equals ( "Registered<seq2seq4repair_space>Successfully" ) ) {
Buggy code:
public final class WebservicesDescriptorDeploymentProcessor implements DeploymentUnitProcessor { public void deploy ( final DeploymentPhaseContext phaseContext ) throws DeploymentUnitProcessingException { final DeploymentUnit unit = phaseContext . getDeploymentUnit ( ) ; final ResourceRoot deploymentRoot = unit . getAttachment ( DEPLOYMENT_ROOT ) ; final URL webservicesDescriptorURL = getWebServicesDescriptorURL ( deploymentRoot ) ; if ( webservicesDescriptorURL != null ) { final WebservicesPropertyReplaceFactory webservicesFactory = new WebservicesPropertyReplaceFactory ( webservicesDescriptorURL , JBossDescriptorPropertyReplacement . propertyReplacer ( unit ) ) ; final WebservicesMetaData webservicesMD = webservicesFactory . load ( webservicesDescriptorURL ) ; unit . putAttachment ( WEBSERVICES_METADATA_KEY , webservicesMD ) ; if ( hasJaxRpcMapping ( webservicesMD ) ) { <START_BUG> throw new DeploymentUnitProcessingException ( "JAXRPC<seq2seq4repair_space>not<seq2seq4repair_space>supported" ) ; <END_BUG> } } } public void undeploy ( final DeploymentUnit unit ) { } private URL getWebServicesDescriptorURL ( final ResourceRoot deploymentRoot ) throws DeploymentUnitProcessingException { } private boolean hasJaxRpcMapping ( WebservicesMetaData webservicesMD ) { } }

Fix:
throw WSMessages . MESSAGES . jaxRpcNotSupported ( ) ;
Buggy code:
public class ReportMainFrame extends JFrame { private static final long serialVersionUID = 240L ; private static final Logger log = LoggingManager . getLoggerForClass ( ) ; private static final String DEFAULT_TITLE = ( "Apache<seq2seq4repair_space>JMeter<seq2seq4repair_space>(" + ( JMeterUtils . getJMeterVersion ( ) ) ) + ")" ; protected ReportMenuBar menuBar ; protected JScrollPane mainPanel ; protected JScrollPane treePanel ; protected JTree tree ; private final ImageIcon stoppedIcon = JMeterUtils . getImage ( "thread.disabled.gif" ) ; private int previousDragXLocation = 0 ; private int previousDragYLocation = 0 ; private JButton runningIndicator ; private JDialog stoppingMessage ; @ Deprecated public ReportMainFrame ( ) { } public ReportMainFrame ( TreeModel treeModel , ReportTreeListener treeListener ) { } public void setFileLoadEnabled ( boolean enabled ) { } public void setFileSaveEnabled ( boolean enabled ) { } public void setEditMenu ( JPopupMenu menu ) { } public void setEditEnabled ( boolean enabled ) { } public void setEditAddMenu ( JMenu menu ) { } public void setEditAddEnabled ( boolean enabled ) { } public void setEditRemoveEnabled ( boolean enabled ) { } public void closeMenu ( ) { } public void showStoppingMessage ( String host ) { } public void setMainPanel ( JComponent comp ) { } public JTree getTree ( ) { } private void init ( ) { menuBar = new ReportMenuBar ( ) ; setJMenuBar ( menuBar ) ; JPanel all = new JPanel ( new BorderLayout ( ) ) ; all . add ( createToolBar ( ) , BorderLayout . NORTH ) ; JSplitPane treeAndMain = new JSplitPane ( JSplitPane . HORIZONTAL_SPLIT ) ; treePanel = createTreePanel ( ) ; treeAndMain . setLeftComponent ( treePanel ) ; mainPanel = createMainPanel ( ) ; treeAndMain . setRightComponent ( mainPanel ) ; treeAndMain . setResizeWeight ( 0.2 ) ; treeAndMain . setContinuousLayout ( true ) ; all . add ( treeAndMain , BorderLayout . CENTER ) ; getContentPane ( ) . add ( all ) ; tree . setSelectionRow ( 1 ) ; addWindowListener ( new ReportMainFrame . WindowHappenings ( ) ) ; setTitle ( ReportMainFrame . DEFAULT_TITLE ) ; <START_BUG> setIconImage ( JMeterUtils . getImage ( "jmeter.jpg" ) . getImage ( ) ) ; <END_BUG> } public void setExtendedFrameTitle ( String fname ) { } protected Component createToolBar ( ) { } protected JScrollPane createTreePanel ( ) { } protected JScrollPane createMainPanel ( ) { } private JTree makeTree ( TreeModel treeModel , ReportTreeListener treeListener ) { } protected TreeCellRenderer getCellRenderer ( ) { } public void drawDraggedComponent ( Component dragIcon , int x , int y ) { } protected static class WindowHappenings extends WindowAdapter { @ Override public void windowClosing ( WindowEvent event ) { } } }

Fix:
setIconImage ( JMeterUtils . getImage ( "icon-apache.png" ) . getImage ( ) ) ;
Buggy code:
public class TestRingCache { private RingCache ringCache ; private Client thriftClient ; public TestRingCache ( String keyspace ) throws IOException { } private void setup ( String server , int port ) throws Exception { } public static void main ( String [ ] args ) throws Throwable { int minRow ; int maxRow ; String rowPrefix ; String keyspace = "Keyspace1" ; if ( ( args . length ) > 0 ) { keyspace = args [ 0 ] ; rowPrefix = args [ 1 ] ; minRow = Integer . parseInt ( args [ 2 ] ) ; maxRow = minRow + 1 ; } else { minRow = 1 ; maxRow = 10 ; rowPrefix = "row" ; } TestRingCache tester = new TestRingCache ( keyspace ) ; for ( int nRows = minRow ; nRows < maxRow ; nRows ++ ) { <START_BUG> ByteBuffer row = ByteBuffer . wrap ( ( rowPrefix + nRows ) . getBytes ( ) ) ; <END_BUG> ColumnPath col = new ColumnPath ( "Standard1" ) . setSuper_column ( ( ( ByteBuffer ) ( null ) ) ) . setColumn ( "col1" . getBytes ( ) ) ; ColumnParent parent = new ColumnParent ( "Standard1" ) . setSuper_column ( ( ( ByteBuffer ) ( null ) ) ) ; Collection < InetAddress > endpoints = tester . ringCache . getEndpoint ( row ) ; InetAddress firstEndpoint = endpoints . iterator ( ) . next ( ) ; System . out . printf ( "hosts<seq2seq4repair_space>with<seq2seq4repair_space>key<seq2seq4repair_space>%s<seq2seq4repair_space>:<seq2seq4repair_space>%s;<seq2seq4repair_space>choose<seq2seq4repair_space>%s%n" , new String ( row . array ( ) ) , StringUtils . join ( endpoints , "," ) , firstEndpoint ) ; tester . setup ( firstEndpoint . getHostAddress ( ) , DatabaseDescriptor . getRpcPort ( ) ) ; tester . thriftClient . set_keyspace ( keyspace ) ; tester . thriftClient . insert ( row , parent , new Column ( ByteBufferUtil . bytes ( "col1" ) , ByteBufferUtil . bytes ( "val1" ) , 1 ) , ONE ) ; Column column = tester . thriftClient . get ( row , col , ONE ) . column ; System . out . println ( ( ( ( ( ( ( ( "read<seq2seq4repair_space>row<seq2seq4repair_space>" + ( new String ( row . array ( ) ) ) ) + "<seq2seq4repair_space>" ) + ( new String ( column . name . array ( ) ) ) ) + ":" ) + ( new String ( column . value . array ( ) ) ) ) + ":" ) + ( column . timestamp ) ) ) ; } System . exit ( 1 ) ; } }

Fix:
ByteBuffer row = ByteBufferUtil . bytes ( ( rowPrefix + nRows ) ) ;
Buggy code:
public class ArticleDaoImpl extends AbstractDao < Article , Integer > implements ArticleDao { public List < Article > findLastArticles ( ) { } public List < Article > findSearchedArticles ( List < String > listRequest ) { EntityManager em = getEntityManager ( ) ; EntityTransaction t = em . getTransaction ( ) ; List < Article > articleList = null ; String req = "SELECT<seq2seq4repair_space>a<seq2seq4repair_space>FROM<seq2seq4repair_space>Article<seq2seq4repair_space>a<seq2seq4repair_space>WHERE<seq2seq4repair_space>1=1" ; for ( String elem : listRequest ) { req = ( ( req + "<seq2seq4repair_space>AND<seq2seq4repair_space>articleTitle<seq2seq4repair_space>LIKE<seq2seq4repair_space>'%" ) + elem ) + "%'" ; } try { t . begin ( ) ; TypedQuery < Article > query = em . createQuery ( req , Article . class ) ; <START_BUG> query . setMaxResults ( 27 ) ; <END_BUG> articleList = query . getResultList ( ) ; t . commit ( ) ; } catch ( Exception e ) { e . printStackTrace ( ) ; } finally { if ( t . isActive ( ) ) { t . rollback ( ) ; em . close ( ) ; } } return articleList ; } public Map < String , List < Article > > findSearchedArticles2 ( List < String > listRequest ) { } }

Fix:
query . setMaxResults ( 33 ) ;
Buggy code:
public final class Program { String name ; String command ; String iconName ; Program ( ) { } public static Program findProgram ( String extension ) { } public static String [ ] getExtensions ( ) { } static String getKeyValue ( String string , boolean expand ) { TCHAR key = new TCHAR ( 0 , string , true ) ; int [ ] phkResult = new int [ 1 ] ; if ( ( OS . RegOpenKeyEx ( HKEY_CLASSES_ROOT , key , 0 , KEY_READ , phkResult ) ) != 0 ) { return null ; } String result = null ; int [ ] lpcbData = new int [ 1 ] ; <START_BUG> if ( ( OS . RegQueryValueEx ( phkResult [ 0 ] , ( ( TCHAR ) ( null ) ) , 0 , null , null , lpcbData ) ) == 0 ) { <END_BUG> result = "" ; int length = ( lpcbData [ 0 ] ) // ( TCHAR . sizeof ) ; if ( length != 0 ) { TCHAR lpData = new TCHAR ( 0 , length ) ; if ( ( OS . RegQueryValueEx ( phkResult [ 0 ] , null , 0 , null , lpData , lpcbData ) ) == 0 ) { if ( ( ! ( OS . IsWinCE ) ) && expand ) { length = OS . ExpandEnvironmentStrings ( lpData , null , 0 ) ; if ( length != 0 ) { TCHAR lpDst = new TCHAR ( 0 , length ) ; OS . ExpandEnvironmentStrings ( lpData , lpDst , length ) ; result = lpDst . toString ( 0 , Math . max ( 0 , ( length - 1 ) ) ) ; } } else { length = Math . max ( 0 , ( ( lpData . length ( ) ) - 1 ) ) ; result = lpData . toString ( 0 , length ) ; } } } } if ( ( phkResult [ 0 ] ) != 0 ) OS . RegCloseKey ( phkResult [ 0 ] ) ; return result ; } static Program getProgram ( String key ) { } public static Program [ ] getPrograms ( ) { } public static boolean launch ( String fileName ) { } public boolean execute ( String fileName ) { } public ImageData getImageData ( ) { } public String getName ( ) { } public boolean equals ( Object other ) { } public int hashCode ( ) { } public String toString ( ) { } }

Fix:
if ( ( OS . RegQueryValueEx ( phkResult [ 0 ] , ( ( TCHAR ) ( null ) ) , 0 , null , ( ( TCHAR ) ( null ) ) , lpcbData ) ) == 0 ) {
Buggy code:
public class FactoryFDAFeatures { private static Logger logger = Logger . getLogger ( "FDAFeatures-Factory" ) ; private static JenaConnector jn ; public FactoryFDAFeatures ( ) { } public ArrayList < WFSFeature > listFDAFeatures ( ) { } public static boolean existsFeature ( String featureName ) { } public static void updateFeature ( WFSFeature feature ) { } public static void deleteFeature ( WFSFeature feature ) { } public static boolean isQueryValid ( String query ) { } public static boolean isVariableValid ( WFSFeature feature ) { } public static boolean isEndpointValid ( String endpoint ) { } public static boolean isFeatureNameValid ( String featureName ) { } public static void addFeature ( WFSFeature feature ) { try { Writer writer = new FileWriter ( ( ( ( GlobalSettings . getFeatureDirectory ( ) ) + ( feature . getName ( ) ) ) + ".sparql" ) ) ; writer . write ( "{\n" ) ; writer . write ( ( ( ( "\"name\":\"" + ( GlobalSettings . getFDAFeaturesNameSpace ( ) ) ) + ( feature . getName ( ) . toLowerCase ( ) ) ) + "\",\n" ) ) ; writer . write ( ( ( "\"title\":\"" + ( feature . getTitle ( ) ) ) + "\",\n" ) ) ; writer . write ( ( ( "\"abstract\":\"" + ( feature . getFeatureAbstract ( ) ) ) + "\",\n" ) ) ; writer . write ( ( ( "\"keywords\":\"" + ( feature . getKeywords ( ) ) ) + "\",\n" ) ) ; writer . write ( ( ( "\"geometryVariable\":\"" + ( feature . getGeometryVariable ( ) ) ) + "\",\n" ) ) ; writer . write ( ( ( "\"endpoint\":\"" + ( feature . getEndpoint ( ) ) ) + "\",\n" ) ) ; writer . write ( ( ( "\"crs\":\"" + ( feature . getCRS ( ) ) ) + "\",\n" ) ) ; <START_BUG> if ( feature . getEnabled ( ) ) { <END_BUG> writer . write ( "\"enabled\":\"true\",\n" ) ; } else { writer . write ( "\"enabled\":\"false\",\n" ) ; } writer . write ( ( ( "\"query\":\"" + ( feature . getQuery ( ) . replace ( "\"" , "'" ) ) ) + "\"" ) ) ; writer . write ( "\n}" ) ; writer . close ( ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } } public ResultSet executeQuery ( String SPARQL , String endpoint ) { } public WFSFeature getFDAFeature ( String fileName ) { } public ArrayList < Triple > getPredicatesFDAFeatures ( WFSFeature feature ) { } public String getGeometryPredicate ( String SPARQLQuery ) { } public void enableFeature ( boolean enable ) { } }

Fix:
if ( feature . isEnabled ( ) ) {
Buggy code:
public class CheckVPCtoEc2 extends CheckService { private AmazonEC2Client ec2client ; private AmazonElasticLoadBalancingClient elbclient ; private List < VpcEx > vpcexs = new ArrayList ( ) ; public void load ( AWSClients clients , Regions regions ) { } private void load ( ) { } private void loadVpc ( ) { } private void loadELB ( VpcEx vpcex ) { } private void loadSubnet ( VpcEx vpcex ) { } private void loadNacl ( SubnetEx subnetex ) { } private void loadInstance ( SubnetEx subnetex ) { } private void loadSecurityGroup ( InstanceEx instanceex ) { } public String display ( ) { } private void displayELB ( VpcEx vpcex ) { } private void displaySubnet ( VpcEx vpcex ) { writeln ( "Subnet<seq2seq4repair_space>Check" , true , 3 ) ; for ( SubnetEx subnetex : vpcex . getSubnets ( ) ) { writeln ( ( ( ( "subnet(" + ( subnetex . getSubnet ( ) . getSubnetId ( ) ) ) + "):" ) + ( Tools . getTagValue ( subnetex . getSubnet ( ) . getTags ( ) , "NAME" ) ) ) , true , 4 ) ; writeln ( "Acl<seq2seq4repair_space>Check" , true , 5 ) ; for ( NetworkAcl nacl : subnetex . getNacls ( ) ) { for ( NetworkAclEntry aclentry : nacl . getEntries ( ) ) { String output = "" ; output = ( output + "ruleNumber:" ) + ( aclentry . getRuleNumber ( ) ) ; if ( aclentry . getEgress ( ) . booleanValue ( ) ) { output = output + "<seq2seq4repair_space>outbound" ; } else { output = output + "<seq2seq4repair_space>inbound" ; } output = ( output + "<seq2seq4repair_space>cidr:" ) + ( aclentry . getCidrBlock ( ) ) ; if ( ( aclentry . getPortRange ( ) ) != null ) { output = ( output + "<seq2seq4repair_space>portRange:" ) + ( aclentry . getPortRange ( ) . toString ( ) ) ; } else { output = output + "<seq2seq4repair_space>portRange:!!!ANY!!!!" ; } output = ( output + "<seq2seq4repair_space>ruleaction:" ) + ( aclentry . getRuleAction ( ) ) ; <START_BUG> if ( ( ( aclentry . equals ( "0.0.0.0//0" ) ) && ( ( aclentry . getPortRange ( ) ) == null ) ) && ( aclentry . getRuleAction ( ) . toLowerCase ( ) . equals ( "allow" ) ) ) { <END_BUG> output = output + ( setNG ( ) ) ; } writeln ( output , false , 6 ) ; } } closeFolder ( 5 ) ; for ( InstanceEx instanceex : subnetex . getInstances ( ) ) { writeln ( ( ( ( ( ( "instance(" + ( instanceex . getInstance ( ) . getInstanceId ( ) ) ) + ")[" ) + ( instanceex . getInstance ( ) . getState ( ) . getName ( ) ) ) + "]:" ) + ( Tools . getTagValue ( instanceex . getInstance ( ) . getTags ( ) , "NAME" ) ) ) , true , 5 ) ; if ( ( instanceex . getInstance ( ) . getIamInstanceProfile ( ) ) != null ) { writeln ( ( "iam<seq2seq4repair_space>role:" + ( instanceex . getInstance ( ) . getIamInstanceProfile ( ) . getArn ( ) ) ) , false , 6 ) ; } displaySecurityGroup ( instanceex . getSecurityGroups ( ) , 6 ) ; closeFolder ( 5 ) ; } closeFolder ( 4 ) ; } closeFolder ( 3 ) ; } }

Fix:
if ( ( ( aclentry . getCidrBlock ( ) . equals ( "0.0.0.0//0" ) ) && ( ( aclentry . getPortRange ( ) ) == null ) ) && ( aclentry . getRuleAction ( ) . toLowerCase ( ) . equals ( "allow" ) ) ) {
Buggy code:
public class TransactionLeakRollbackProcessor implements DeploymentUnitProcessor { private static final ServiceName SERVICE_NAME = JBOSS . append ( "transaction" , "ee-transaction-rollback-service" ) ; @ Override public void deploy ( DeploymentPhaseContext phaseContext ) throws DeploymentUnitProcessingException { final DeploymentUnit deploymentUnit = phaseContext . getDeploymentUnit ( ) ; final ServiceName serviceName = deploymentUnit . getServiceName ( ) . append ( TransactionLeakRollbackProcessor . SERVICE_NAME ) ; final TransactionRollbackSetupAction service = new TransactionRollbackSetupAction ( serviceName ) ; phaseContext . getServiceTarget ( ) . addService ( serviceName , service ) . addDependency ( TransactionManagerService . SERVICE_NAME , TransactionManager . class , service . getTransactionManager ( ) ) . install ( ) ; <START_BUG> deploymentUnit . addToAttachmentList ( EE_SETUP_ACTIONS , service ) ; <END_BUG> } @ Override public void undeploy ( DeploymentUnit context ) { } }

Fix:
deploymentUnit . addToAttachmentList ( WEB_SETUP_ACTIONS , service ) ;
Buggy code:
public class MutableFloat extends Number implements Comparable < MutableFloat > , Mutable < Number > { private static final long serialVersionUID = 5787169186L ; private float value ; public MutableFloat ( ) { } public MutableFloat ( float value ) { } public MutableFloat ( Number value ) { } public MutableFloat ( String value ) throws NumberFormatException { } public Float getValue ( ) { <START_BUG> return new Float ( this . value ) ; <END_BUG> } public void setValue ( float value ) { } public void setValue ( Number value ) { } public boolean isNaN ( ) { } public boolean isInfinite ( ) { } public void increment ( ) { } public void decrement ( ) { } public void add ( float operand ) { } public void add ( Number operand ) { } public void subtract ( float operand ) { } public void subtract ( Number operand ) { } @ Override public int intValue ( ) { } @ Override public long longValue ( ) { } @ Override public float floatValue ( ) { } @ Override public double doubleValue ( ) { } public Float toFloat ( ) { } @ Override public boolean equals ( Object obj ) { } @ Override public int hashCode ( ) { } public int compareTo ( MutableFloat other ) { } @ Override public String toString ( ) { } }

Fix:
return Float . valueOf ( this . value ) ;
Buggy code:
public class NSPrintInfo extends NSObject { public NSPrintInfo ( ) { } public NSPrintInfo ( int id ) { } public int PMPageFormat ( ) { } public int PMPrintSession ( ) { } public int PMPrintSettings ( ) { } public float bottomMargin ( ) { } public static NSPrinter defaultPrinter ( ) { } public NSMutableDictionary dictionary ( ) { } public int horizontalPagination ( ) { } public NSRect imageablePageBounds ( ) { } public id initWithDictionary ( NSDictionary attributes ) { } public boolean isHorizontallyCentered ( ) { } public boolean isVerticallyCentered ( ) { } public NSString jobDisposition ( ) { } public float leftMargin ( ) { } public NSString localizedPaperName ( ) { } public int orientation ( ) { } public NSString paperName ( ) { } public NSSize paperSize ( ) { NSSize result = new NSSize ( ) ; <START_BUG> OS . objc_msgSend_stret ( result , this . id , sel_paperSize ) ; <END_BUG> return result ; } public NSMutableDictionary printSettings ( ) { } public NSPrinter printer ( ) { } public float rightMargin ( ) { } public void setBottomMargin ( float margin ) { } public static void setDefaultPrinter ( NSPrinter printer ) { } public void setHorizontalPagination ( int mode ) { } public void setHorizontallyCentered ( boolean flag ) { } public void setJobDisposition ( NSString disposition ) { } public void setLeftMargin ( float margin ) { } public void setOrientation ( int orientation ) { } public void setPaperName ( NSString name ) { } public void setPaperSize ( NSSize size ) { } public void setPrinter ( NSPrinter printer ) { } public void setRightMargin ( float margin ) { } public static void setSharedPrintInfo ( NSPrintInfo printInfo ) { } public void setTopMargin ( float margin ) { } public void setUpPrintOperationDefaultValues ( ) { } public void setVerticalPagination ( int mode ) { } public void setVerticallyCentered ( boolean flag ) { } public static NSPrintInfo sharedPrintInfo ( ) { } public static NSSize sizeForPaperName ( NSString name ) { } public float topMargin ( ) { } public void updateFromPMPageFormat ( ) { } public void updateFromPMPrintSettings ( ) { } public int verticalPagination ( ) { } }

Fix:
OS . objc_msgSend_struct ( result , this . id , sel_paperSize ) ;
Buggy code:
public class WidgetActivity extends FragmentActivity { private int appWidgetId ; private IntentFilter intentFilter ; private BatteryInfoViewManager batteryInfoViewManager = new BatteryInfoViewManager ( ) ; public void onCreate ( Bundle savedInstanceState ) { } @ Override protected void onDestroy ( ) { } @ Override public void onPause ( ) { } @ Override protected void onResume ( ) { } @ Override protected Dialog onCreateDialog ( int id ) { } @ Override public boolean onCreateOptionsMenu ( Menu menu ) { MenuInflater inflater = getMenuInflater ( ) ; inflater . inflate ( widget_batteryinfo , menu ) ; inflater . inflate ( widget , menu ) ; if ( ! ( Constants . HAS_MARKET_BILLING ) ) <START_BUG> menu . findItem ( donate_market ) . setEnabled ( false ) ; <END_BUG> return true ; } @ Override public boolean onPrepareOptionsMenu ( Menu menu ) { } @ Override public boolean onOptionsItemSelected ( MenuItem item ) { } }

Fix:
menu . findItem ( donate ) . getSubMenu ( ) . findItem ( donate_market ) . setEnabled ( false ) ;
Buggy code:
public class MobileLog extends LogInstance { private static final String TAG = "JRDLogger//MobileLog" ; private Handler mServicehandler = null ; private MobileLog . MobileLogThread mMobileLogThread ; private final String mSocketName = "jrdlogd" ; private boolean bConnected = false ; public MobileLog ( Context paramContext , Handler paramHandler ) { } private void createMobileLogThread ( ) { } private void waitForHandlerCreation ( ) { } class MobileLogConnection extends LogConnection { public MobileLogConnection ( String paramString , Handler localHandler ) { } @ Override public void dealWithResponse ( byte [ ] rspbuff , Handler rspHandler ) { } } class MobileLogHandler extends LogInstance . LogHandler { public MobileLogHandler ( ) { } @ Override public void handleMessage ( Message paramMessage ) { if ( ! ( bConnected ) ) { bConnected = initLogConnection ( ) ; } if ( ! ( bConnected ) ) { Log . e ( MobileLog . TAG , "cannot<seq2seq4repair_space>connect<seq2seq4repair_space>with<seq2seq4repair_space>the<seq2seq4repair_space>mobilelog<seq2seq4repair_space>native<seq2seq4repair_space>service" ) ; } switch ( paramMessage . what ) { case MSG_LOG_START : <START_BUG> mLogConnection . sendCmd ( "mobilelog" , "startd" ) ; <END_BUG> break ; default : break ; } } } class MobileLogThread extends Thread { MobileLogThread ( ) { } @ Override public void run ( ) { } } }

Fix:
mLogConnection . sendCmd ( "mobilelog" , "start" ) ;
Buggy code:
public class ServerPathAdd extends AbstractServerModelUpdate < Void > { private static final long serialVersionUID = - 7255447870952892481L ; private final PathElementUpdate update ; public ServerPathAdd ( PathElementUpdate update ) { } protected ServerPathAdd ( final PathElement element ) { } protected void applyUpdate ( ServerModel element ) throws UpdateFailedException { } public AbstractServerModelUpdate < ? > getCompensatingUpdate ( ServerModel original ) { } public < P > void applyUpdate ( UpdateContext context , UpdateResultHandler < ? super Void , P > resultHandler , P param ) { <START_BUG> final ServiceTarget target = context . getBatchBuilder ( ) . subTarget ( ) ; <END_BUG> target . addListener ( new UpdateResultHandler . ServiceStartListener < P > ( resultHandler , param ) ) ; createService ( target ) ; } void createService ( final ServiceTarget target ) { } }

Fix:
final ServiceTarget target = context . getServiceTarget ( ) . subTarget ( ) ;
Buggy code:
public abstract class ServiceCommandDispatcher < C > implements CommandDispatcher < C > { private static final RspFilter FILTER = new RspFilter ( ) { @ Override public boolean isAcceptable ( Object response , Address sender ) { } @ Override public boolean needMoreResponses ( ) { } } ; private final MessageDispatcher dispatcher ; private final CommandMarshaller < C > marshaller ; private final NodeFactory < Address > factory ; private final long timeout ; public ServiceCommandDispatcher ( MessageDispatcher dispatcher , CommandMarshaller < C > marshaller , NodeFactory < Address > factory , long timeout ) { } @ Override public < R > Map < Node , CommandResponse < R > > executeOnCluster ( Command < R , C > command , Node ... excludedNodes ) { } @ Override public < R > Map < Node , Future < R > > submitOnCluster ( Command < R , C > command , Node ... excludedNodes ) { } @ Override public < R > CommandResponse < R > executeOnNode ( Command < R , C > command , Node node ) { } @ Override public < R > Future < R > submitOnNode ( Command < R , C > command , Node node ) { } private < R > Message createMessage ( Command < R , C > command ) { } private < R > Message createMessage ( Command < R , C > command , Node node ) { } private static Address getAddress ( Node node ) { } private RequestOptions createRequestOptions ( Node ... excludedNodes ) { } private RequestOptions createRequestOptions ( ) { <START_BUG> return new RequestOptions ( ResponseMode . GET_ALL , this . timeout , false , ServiceCommandDispatcher . FILTER , Flag . DONT_BUNDLE ) ; <END_BUG> } static < R > CommandResponse < R > createCommandResponse ( Rsp < R > response ) { } private Address getLocalAddress ( ) { } private static class SimpleCommandResponse < T > implements CommandResponse < T > { private final T value ; private final ExecutionException exception ; SimpleCommandResponse ( T value ) { } SimpleCommandResponse ( Throwable exception ) { } @ Override public T get ( ) throws ExecutionException { } } private static class SimpleFuture < T > extends ServiceCommandDispatcher . SimpleCommandResponse < T > implements Future < T > { SimpleFuture ( T value ) { } SimpleFuture ( Throwable exception ) { } @ Override public boolean cancel ( boolean mayInterruptIfRunning ) { } @ Override public boolean isCancelled ( ) { } @ Override public boolean isDone ( ) { } @ Override public T get ( long timeout , TimeUnit unit ) throws ExecutionException { } } }

Fix:
return new RequestOptions ( ResponseMode . GET_ALL , this . timeout , false , ServiceCommandDispatcher . FILTER ) ;
Buggy code:
public class HTTPArgumentsPanel extends ArgumentsPanel { private static final String ENCODE_OR_NOT = "encode?" ; private static final String INCLUDE_EQUALS = "include_equals" ; protected void initializeTableModel ( ) { <START_BUG> tableModel = new org . apache . jorphan . gui . ObjectTableModel ( new String [ ] { ArgumentsPanel . COLUMN_RESOURCE_NAMES_0 , ArgumentsPanel . COLUMN_RESOURCE_NAMES_1 , HTTPArgumentsPanel . ENCODE_OR_NOT , HTTPArgumentsPanel . INCLUDE_EQUALS } , HTTPArgument . class , new Functor [ ] { new Functor ( "getName" ) , new Functor ( "getValue" ) , new Functor ( "isAlwaysEncoded" ) , new Functor ( "isUseEquals" ) } , new Functor [ ] { new Functor ( "setName" ) , new Functor ( "setValue" ) , new Functor ( "setAlwaysEncoded" ) , new Functor ( "setUseEquals" ) } , new Class [ ] { String . class , String . class , Boolean . class , Boolean . class } , true ) ; <END_BUG> } public static boolean testFunctors ( ) { } protected void sizeColumns ( JTable table ) { } protected Object makeNewArgument ( ) { } private void fixSize ( TableColumn column ) { } public HTTPArgumentsPanel ( ) { } public TestElement createTestElement ( ) { } public void configure ( TestElement el ) { } protected boolean isMetaDataNormal ( HTTPArgument arg ) { } }

Fix:
tableModel = new org . apache . jorphan . gui . ObjectTableModel ( new String [ ] { ArgumentsPanel . COLUMN_RESOURCE_NAMES_0 , ArgumentsPanel . COLUMN_RESOURCE_NAMES_1 , HTTPArgumentsPanel . ENCODE_OR_NOT , HTTPArgumentsPanel . INCLUDE_EQUALS } , HTTPArgument . class , new Functor [ ] { new Functor ( "getName" ) , new Functor ( "getValue" ) , new Functor ( "isAlwaysEncoded" ) , new Functor ( "isUseEquals" ) } , new Functor [ ] { new Functor ( "setName" ) , new Functor ( "setValue" ) , new Functor ( "setAlwaysEncoded" ) , new Functor ( "setUseEquals" ) } , new Class [ ] { String . class , String . class , Boolean . class , Boolean . class } ) ;
Buggy code:
public class SimpleExecutionContext implements AsyncExecutionContext < JSON > { final AsyncExecutionContext < JSON > parent ; final boolean functionContext ; final Map < String , InstructionFuture < JSON > > functions = new ConcurrentHashMap < > ( ) ; ListeningExecutorService executorService = null ; JSON conf ; ListenableFuture < JSON > data ; File currentDirectory = new File ( "." ) ; JSONBuilder builder = null ; final Map < String , AsyncExecutionContext < JSON > > namedContexts = new ConcurrentHashMap < > ( ) ; public SimpleExecutionContext ( AsyncExecutionContext < JSON > parent , JSONBuilder builder , ListenableFuture < JSON > data , JSON conf , File f , boolean fc ) { } public SimpleExecutionContext ( JSONBuilder builder , ListenableFuture < JSON > data , JSON conf , File f ) { } public ListenableFuture < JSON > dataContext ( ) { } public ListenableFuture < JSON > config ( ) { } @ Override public JSONBuilder builder ( ) { } @ Override public AsyncExecutionContext < JSON > getParent ( ) { } @ Override public AsyncExecutionContext < JSON > getMasterContext ( ) { } @ Override public AsyncExecutionContext < JSON > getNamedContext ( String label ) { <START_BUG> return getNamedContext ( label , true ) ; <END_BUG> } public AsyncExecutionContext < JSON > getNamedContext ( String label , boolean create ) { } @ Override public void define ( String n , InstructionFuture < JSON > i ) { } @ Override public AsyncExecutionContext < JSON > createChild ( boolean fc , ListenableFuture < JSON > data ) { } @ Override public InstructionFuture < JSON > getdef ( String name ) { } @ Override public ListenableFuture < JSON > lookup ( String name , ListenableFuture < JSON > t ) throws ExecutionException { } public void setExecutionService ( ListeningExecutorService s ) { } @ Override public ListeningExecutorService executor ( ) { } @ Override public File currentDirectory ( ) { } public File file ( String f ) { } }

Fix:
return getNamedContext ( label , false ) ;
Buggy code:
public class HttpDefaultsGui extends AbstractConfigGui { private static final long serialVersionUID = 240L ; private JCheckBox imageParser ; private JCheckBox concurrentDwn ; private JTextField concurrentPool ; private UrlConfigGui urlConfig ; public HttpDefaultsGui ( ) { } public String getLabelResource ( ) { } public TestElement createTestElement ( ) { } public void modifyTestElement ( TestElement config ) { } @ Override public void clearGui ( ) { } @ Override public void configure ( TestElement el ) { } private void init ( ) { setLayout ( new BorderLayout ( 0 , 5 ) ) ; setBorder ( makeBorder ( ) ) ; add ( makeTitlePanel ( ) , BorderLayout . NORTH ) ; urlConfig = new UrlConfigGui ( false , true , false ) ; add ( urlConfig , BorderLayout . CENTER ) ; final JPanel optionalTasksPanel = new HorizontalPanel ( ) ; optionalTasksPanel . setBorder ( BorderFactory . createTitledBorder ( BorderFactory . createEtchedBorder ( ) , JMeterUtils . getResString ( "optional_tasks" ) ) ) ; final JPanel checkBoxPanel = new HorizontalPanel ( ) ; imageParser = new JCheckBox ( JMeterUtils . getResString ( "web_testing_retrieve_images" ) ) ; checkBoxPanel . add ( imageParser ) ; imageParser . addItemListener ( new ItemListener ( ) { public void itemStateChanged ( final ItemEvent e ) { if ( ( e . getStateChange ( ) ) == ( ItemEvent . SELECTED ) ) { enableConcurrentDwn ( true ) ; } else { enableConcurrentDwn ( false ) ; } } } ) ; concurrentDwn = new JCheckBox ( JMeterUtils . getResString ( "web_testing_concurrent_download" ) ) ; concurrentDwn . addItemListener ( new ItemListener ( ) { public void itemStateChanged ( final ItemEvent e ) { <START_BUG> if ( ( e . getStateChange ( ) ) == ( ItemEvent . SELECTED ) ) { <END_BUG> concurrentPool . setEnabled ( true ) ; } else { concurrentPool . setEnabled ( false ) ; } } } ) ; concurrentPool = new JTextField ( 2 ) ; concurrentPool . setMaximumSize ( new Dimension ( 30 , 20 ) ) ; checkBoxPanel . add ( concurrentDwn ) ; checkBoxPanel . add ( concurrentPool ) ; optionalTasksPanel . add ( checkBoxPanel ) ; add ( optionalTasksPanel , BorderLayout . SOUTH ) ; } @ Override public Dimension getPreferredSize ( ) { } private void enableConcurrentDwn ( final boolean enable ) { } public void itemStateChanged ( final ItemEvent event ) { } }

Fix:
if ( ( imageParser . isSelected ( ) ) && ( ( e . getStateChange ( ) ) == ( ItemEvent . SELECTED ) ) ) {
Buggy code:
public abstract class FortressBase { public World worldObj ; public int originX ; public int originY ; public int originZ ; public int orientation ; public FortressBase ( World par1World , int chunkX , int chunkZ ) { } public int GetYHeight ( int posX , int startY , int posZ ) { int y = startY ; <START_BUG> while ( ( ( y > 48 ) && ( ( this . worldObj . getBlock ( posX , y , posZ ) ) == ( Blocks . air ) ) ) && ( ( this . worldObj . getBlock ( posX , ( y - 1 ) , posZ ) ) != ( Blocks . air ) ) ) { <END_BUG> y -- ; } return y ; } public abstract boolean buildStructure ( ) { } protected void customFillWithBlocks ( World par1World , int par3 , int par4 , int par5 , int par6 , int par7 , int par8 , Block block1 , Block block2 , boolean par11 ) { } protected void customPlaceBlockAtCurrentPosition ( World par1World , Block block , int par3 , int par4 , int par5 , int par6 ) { } protected Block customGetBlockAtCurrentPosition ( World par1World , int par2 , int par3 , int par4 ) { } protected int customGetBlockSkyLightAtCurrentPosition ( World par1World , int par2 , int par3 , int par4 ) { } protected boolean customGenerateStructureChestContents ( World par1World , int par4 , int par5 , int par6 ) { } protected void customGenerateSpawner ( World par1World , int par3 , int par4 , int par5 , String par6 ) { } protected void customPlaceIronDoorAtCurrentPosition ( World par1World , int par4 , int par5 , int par6 , int par7 ) { } protected int getXWithOffset ( int x , int z ) { } protected int getYWithOffset ( int y ) { } protected int getZWithOffset ( int x , int z ) { } }

Fix:
while ( ( y > 48 ) && ( ! ( ( ( this . worldObj . getBlock ( posX , y , posZ ) ) == ( Blocks . air ) ) && ( ( this . worldObj . getBlock ( posX , ( y - 1 ) , posZ ) ) != ( Blocks . air ) ) ) ) ) {
Buggy code:
public class LockMethod extends HttpEntityEnclosingRequestBase { private final int timeout ; public LockMethod ( String uri , int timeout ) throws URISyntaxException { } @ Override public String getMethod ( ) { } public String getLockToken ( HttpResponse response ) { } public Document getResponseAsDocument ( HttpResponse response ) throws IOException { HttpEntity entity = response . getEntity ( ) ; if ( entity == null ) { return null ; } InputStream in = null ; try { in = entity . getContent ( ) ; <START_BUG> Document document = RespUtils . getJDomDocument ( in ) ; <END_BUG> return document ; } catch ( JDOMException ex ) { throw new RuntimeException ( ex ) ; } finally { IOUtils . closeQuietly ( in ) ; } } public Header [ ] getAllHeaders ( ) { } private String getTimeoutValue ( ) { } }

Fix:
Document document = Host . getJDomDocument ( in ) ;
Buggy code:
public class Request { private String response = "" ; private URI pageUrl ; private int responseCode ; private HttpURLConnection urlConnection ; private String requestMethod = "GET" ; private int connectionTimeout = 1000 ; private String userAgent = "" ; public Request ( URI pageUrl ) { } public void connect ( ) throws IOException { } private void readConnection ( ) throws IOException { responseCode = urlConnection . getResponseCode ( ) ; String message = urlConnection . getResponseMessage ( ) ; if ( ( responseCode ) == 200 ) { BufferedReader reader = new BufferedReader ( new InputStreamReader ( urlConnection . getInputStream ( ) ) ) ; String line ; while ( ( line = reader . readLine ( ) ) != null ) { <START_BUG> response += line ; <END_BUG> } reader . close ( ) ; } else { response = message ; } } public int getResponseCode ( ) { } public String getResponse ( ) { } public void setUserAgent ( String useragent ) { } public void setConnectionTimeout ( int connectionTimeout ) { } public void setRequestMethod ( String requestMethod ) { } No newline ; at end ; of file ; }

Fix:
response += line + "\n" ;
Buggy code:
public class EajcModuleTests extends TestCase { public static Test suite ( ) { TestSuite suite = new TestSuite ( EajcModuleTests . class . getName ( ) ) ; suite . addTest ( AjdtAjcTests . suite ( ) ) ; suite . addTest ( AjdtBatchTests . suite ( ) ) ; suite . addTest ( AjdtBuilderTests . suite ( ) ) ; <START_BUG> suite . addTestSuite ( MainTest . class ) ; <END_BUG> return suite ; } public EajcModuleTests ( String name ) { } }

Fix:
suite . addTest ( AjcTests . suite ( ) ) ;
Buggy code:
public class DBConnection { private static String account = "ccs108tjsavage" ; private static String password = "ieyeikoo" ; private static String server = "mysql-user-master.stanford.edu" ; private static String database = "c_cs108_tjsavage" ; private Connection connection ; public DBConnection ( ) { } public ResultSet performQuery ( String query ) { } public int insert ( String query ) { Statement stmt ; try { stmt = connection . createStatement ( ) ; <START_BUG> stmt . executeUpdate ( query ) ; <END_BUG> ResultSet generatedKeys = stmt . getGeneratedKeys ( ) ; if ( generatedKeys . next ( ) ) { return generatedKeys . getInt ( 1 ) ; } else { throw new SQLException ( "Didn't<seq2seq4repair_space>get<seq2seq4repair_space>back<seq2seq4repair_space>a<seq2seq4repair_space>key<seq2seq4repair_space>for<seq2seq4repair_space>the<seq2seq4repair_space>insert" ) ; } } catch ( SQLException e ) { e . printStackTrace ( ) ; } return - 1 ; } }

Fix:
stmt . executeUpdate ( query , Statement . RETURN_GENERATED_KEYS ) ;
Buggy code:
public class MainActivity extends Activity { Button signin ; Intent intent ; Context context = this ; String msg ; String uname ; String passwd ; String team_name ; String server_ip ; EditText username ; EditText password ; ProgressDialog progressDialog ; InputStream is ; ConnectServer cs ; SharedPreference sp ; @ Override protected void onCreate ( Bundle savedInstanceState ) { super . onCreate ( savedInstanceState ) ; setContentView ( activity_main ) ; signin = ( ( Button ) ( findViewById ( signIn ) ) ) ; username = ( ( EditText ) ( findViewById ( R . id . username ) ) ) ; password = ( ( EditText ) ( findViewById ( R . id . password ) ) ) ; <START_BUG> server_ip = "128.199.111.18" ; <END_BUG> sp = new SharedPreference ( ) ; signin . setOnClickListener ( new View . OnClickListener ( ) { @ Override public void onClick ( View v ) { if ( ( isValidate ( ) ) == true ) { progressDialog = new ProgressDialog ( v . getContext ( ) ) ; progressDialog . setMessage ( "Wait<seq2seq4repair_space>Please....." ) ; progressDialog . setIndeterminate ( true ) ; progressDialog . setProgressStyle ( STYLE_SPINNER ) ; progressDialog . show ( ) ; try { uname = username . getText ( ) . toString ( ) . trim ( ) ; passwd = password . getText ( ) . toString ( ) . trim ( ) ; sp . saveServerIP_Preference ( context , server_ip ) ; JSONObject jsonObject = new JSONObject ( ) ; jsonObject . put ( "username" , uname ) ; jsonObject . put ( "password" , passwd ) ; MainActivity . UserLogin ul = new MainActivity . UserLogin ( ) ; ul . execute ( jsonObject ) ; } catch ( Exception e ) { e . printStackTrace ( ) ; } } } } ) ; } @ Override public void onBackPressed ( ) { } public Boolean isValidate ( ) { } public class UserLogin extends AsyncTask < JSONObject , Void , String > { String error_msg ; @ Override protected void onPreExecute ( ) { } @ Override protected String doInBackground ( JSONObject ... jObj ) { } protected void onProgressUpdate ( ) { } @ Override protected void onPostExecute ( String json ) { } } private boolean isValidEmail ( String email ) { } public class GetTeamName { ConnectServer conn ; protected String getTeamDetails ( String username ) { } } }

Fix:
server_ip = "54.169.129.117" ;
Buggy code:
public class MultiThreadedJLanguageToolTest { @ Test public void testCheck ( ) throws IOException { } @ Test public void testTextAnalysis ( ) throws IOException { } @ Test public void testConfigurableThreadPoolSize ( ) throws IOException { } private List < String > getRuleMatchIds ( JLanguageTool langTool ) throws IOException { } @ Test public void testTwoRulesOnly ( ) throws IOException { MultiThreadedJLanguageTool langTool = new MultiThreadedJLanguageTool ( new FakeLanguage ( ) { @ Override <START_BUG> synchronized List < PatternRule > getPatternRules ( ) { <END_BUG> return Collections . emptyList ( ) ; } @ Override public List < Rule > getRelevantRules ( ResourceBundle messages ) { return Arrays . asList ( new UppercaseSentenceStartRule ( messages , this ) , new MultipleWhitespaceRule ( messages , this ) ) ; } } ) ; assertThat ( langTool . check ( "my<seq2seq4repair_space>test<seq2seq4repair_space>text" ) . size ( ) , is ( 2 ) ) ; } }

Fix:
protected synchronized List < PatternRule > getPatternRules ( ) {
Buggy code:
public class update { Message query ; Message response ; Resolver res ; String server = null ; Name origin ; Name zone ; int defaultTTL ; short defaultClass = DClass . IN ; PrintStream log = null ; void print ( Object o ) { } public update ( InputStream in ) throws IOException { } void sendUpdate ( ) throws IOException { } Record parseRR ( MyStringTokenizer st , short classValue , int TTLValue ) throws IOException { } Record parseSet ( MyStringTokenizer st , short classValue ) throws IOException { } Record parseName ( MyStringTokenizer st , short classValue ) throws IOException { } void doRequire ( MyStringTokenizer st ) throws IOException { } void doProhibit ( MyStringTokenizer st ) throws IOException { } void doAdd ( MyStringTokenizer st ) throws IOException { } void doDelete ( MyStringTokenizer st ) throws IOException { } void doGlue ( MyStringTokenizer st ) throws IOException { } void doQuery ( MyStringTokenizer st ) throws IOException { } void doFile ( MyStringTokenizer st , Vector inputs , Vector istreams ) { } void doLog ( MyStringTokenizer st ) { } boolean doAssert ( MyStringTokenizer st ) { String field = st . nextToken ( ) ; String expected = st . nextToken ( ) ; String value = null ; boolean flag = true ; int section ; if ( ( response ) == null ) { print ( "No<seq2seq4repair_space>response<seq2seq4repair_space>has<seq2seq4repair_space>been<seq2seq4repair_space>received" ) ; return true ; } if ( field . equalsIgnoreCase ( "rcode" ) ) { short rcode = response . getHeader ( ) . getRcode ( ) ; if ( rcode != ( Rcode . value ( expected ) ) ) { value = Rcode . string ( rcode ) ; flag = false ; } } else if ( field . equalsIgnoreCase ( "serial" ) ) { Record [ ] answers = response . getSectionArray ( ANSWER ) ; if ( ( ( answers . length ) < 1 ) || ( ! ( ( answers [ 0 ] ) instanceof SOARecord ) ) ) print ( "Invalid<seq2seq4repair_space>response<seq2seq4repair_space>(no<seq2seq4repair_space>SOA)" ) ; else { SOARecord soa = ( ( SOARecord ) ( answers [ 0 ] ) ) ; int serial = soa . getSerial ( ) ; <START_BUG> if ( serial != ( new Integer ( expected ) . intValue ( ) ) ) { <END_BUG> value = new Integer ( serial ) . toString ( ) ; flag = false ; } } } else if ( ( section = Section . value ( field ) ) >= 0 ) { short count = response . getHeader ( ) . getCount ( section ) ; if ( count != ( Short . parseShort ( expected ) ) ) { value = new Short ( count ) . toString ( ) ; flag = false ; } } else print ( ( "Invalid<seq2seq4repair_space>assertion<seq2seq4repair_space>keyword:<seq2seq4repair_space>" + field ) ) ; if ( flag == false ) { print ( ( ( ( ( ( "Expected<seq2seq4repair_space>" + field ) + "<seq2seq4repair_space>" ) + expected ) + ",<seq2seq4repair_space>received<seq2seq4repair_space>" ) + value ) ) ; if ( st . hasMoreTokens ( ) ) print ( st . nextToken ( ) ) ; } return flag ; } static void helpResolver ( ) { } static void helpAttributes ( ) { } static void helpData ( ) { } static void helpOperations ( ) { } static void help ( String topic ) { } public static void main ( String [ ] args ) throws IOException { } }

Fix:
if ( serial != ( Integer . parseInt ( expected ) ) ) {