nus-yam/ex-repair huggingface dataset:
Buggy code:
public class DiscoveryView extends ViewPart { protected static final int TREE_EXPANSION_LEVELS = 2 ; private TreeViewer viewer ; private Action doubleClickAction ; IDiscoveryContainer container = null ; public void setDiscoveryContainer ( IDiscoveryContainer container ) { } class TreeObject implements IAdaptable { private String name ; private DiscoveryView . TreeParent parent ; public TreeObject ( String name ) { } public String getName ( ) { } public void setParent ( DiscoveryView . TreeParent parent ) { } public DiscoveryView . TreeParent getParent ( ) { } public String toString ( ) { } public Object getAdapter ( Class key ) { } } class TreeParent extends DiscoveryView . TreeObject { private ArrayList children ; private ServiceID id ; public TreeParent ( ServiceID id , String name ) { } public ServiceID getID ( ) { } public void addChild ( DiscoveryView . TreeObject child ) { } public void removeChild ( DiscoveryView . TreeObject child ) { } public DiscoveryView . TreeObject [ ] getChildren ( ) { } public boolean hasChildren ( ) { } } class ViewContentProvider implements IStructuredContentProvider , ITreeContentProvider { private DiscoveryView . TreeParent invisibleRoot ; public void inputChanged ( Viewer v , Object oldInput , Object newInput ) { } public void dispose ( ) { } public Object [ ] getElements ( Object parent ) { } public Object getParent ( Object child ) { } public Object [ ] getChildren ( Object parent ) { } public boolean hasChildren ( Object parent ) { } private void initialize ( ) { } void replaceOrAdd ( DiscoveryView . TreeParent newEntry ) { } void addServiceInfo ( ServiceID id ) { } void addServiceInfo ( IServiceInfo serviceInfo ) { } void removeServiceInfo ( IServiceInfo serviceInfo ) { } } class ViewLabelProvider extends LabelProvider { public String getText ( Object obj ) { } public Image getImage ( Object obj ) { <START_BUG> String imageKey = ISharedImages . IMG_OBJ_ELEMENT ; <END_BUG> if ( obj instanceof DiscoveryView . TreeParent ) imageKey = ISharedImages . IMG_OBJ_FOLDER ; return org . eclipse . ui . PlatformUI . getWorkbench ( ) . getSharedImages ( ) . getImage ( imageKey ) ; } } public DiscoveryView ( ) { } public void addServiceInfo ( final IServiceInfo serviceInfo ) { } public void addServiceInfo ( final ServiceID id ) { } public void removeServiceInfo ( final IServiceInfo serviceInfo ) { } protected void refreshView ( ) { } protected void expandAll ( ) { } protected DiscoveryView . TreeObject getSelectedTreeObject ( ) { } public void createPartControl ( Composite parent ) { } private void hookDoubleClickAction ( ) { } public void dispose ( ) { } public void setFocus ( ) { } }

Fix:
String imageKey = null ;
Buggy code:
} if ( ( ( ( t_type [ ny2 ] [ nx2 ] ) < ( a . SOLIDS ) ) && ( ( t_type [ ny2 ] [ ( ( int ) ( v_x ) ) ] ) >= ( a . SOLIDS ) ) ) && ( ( t_type [ ( ( int ) ( v_y ) ) ] [ nx2 ] ) >= ( a . SOLIDS ) ) ) { continue ; } int value = v_map [ ny ] [ nx ] ; if ( ( ny2 != ( ( int ) ( v_y ) ) ) || ( nx2 != ( ( int ) ( v_x ) ) ) ) { value = Math . max ( value , v_map [ ny2 ] [ nx2 ] ) ; } if ( value < least ) { dir = i ; least = value ; } } double dy = 0 ; double dx = 0 ; double dist = ( ( b_y - v_y ) * ( b_y - v_y ) ) + ( ( b_x - v_x ) * ( b_x - v_x ) ) ; if ( dir == ( - 1 ) ) { if ( dist > ( ( a . P_R ) * ( a . P_R ) ) ) { dy = ( ( b_y - v_y ) // dist ) * sp ; dx = ( ( b_x - v_x ) // dist ) * sp ; } if ( ! v_seen ) { v_b_y = a . Y_VANTAGES [ ( vantage_index % 12 ) ] ; v_b_x = a . X_VANTAGES [ ( ( vantage_index ++ ) % 12 ) ] ; } } else { dy = ( a . Y_DIRS [ dir ] ) * sp ; dx = ( a . X_DIRS [ dir ] ) * sp ; } v_y += dy ; v_y = ( v_y < ( a . P_R ) ) ? a . P_R : v_y ; v_y = ( v_y > ( ( a . T_H ) - ( a . P_R ) ) ) ? ( a . T_H ) - ( a . P_R ) : v_y ; v_x += dx ; v_x = ( v_x < ( a . P_R ) ) ? a . P_R : v_x ; v_x = ( v_x > ( ( a . T_W ) - ( a . P_R ) ) ) ? ( a . T_W ) - ( a . P_R ) : v_x ; if ( ( t_type [ ( ( int ) ( v_y ) ) ] [ ( ( int ) ( v_x ) ) ] ) >= ( a . SOLIDS ) ) { if ( v_cooldown <= 0 ) { t_hp [ ( ( int ) ( v_y ) ) ] [ ( ( int ) ( v_x ) ) ] -= ( v_dmg > 0 ) ? 1 : 2 ; for ( int i = 20 ; i < 40 ; i ++ ) { particles [ ( i * 5 ) ] = ( r . nextDouble ( ) ) * 5 ; particles [ ( ( i * 5 ) + 1 ) ] = ( ( ( int ) ( v_x ) ) * ( a . TILE_SIZE ) ) + ( ( a . TILE_SIZE ) // 2 ) ; particles [ ( ( i * 5 ) + 2 ) ] = ( ( ( int ) ( v_y ) ) * ( a . TILE_SIZE ) ) + ( ( a . TILE_SIZE ) // 2 ) ; particles [ ( ( i * 5 ) + 3 ) ] = ( ( r . nextDouble ( ) ) * 4 ) - 2 ; particles [ ( ( i * 5 ) + 4 ) ] = ( ( r . nextDouble ( ) ) * 4 ) - 2 ; } v_cooldown = a . V_COOLDOWN ; if ( ( t_hp [ ( ( int ) ( v_y ) ) ] [ ( ( int ) ( v_x ) ) ] ) <= 0 ) { <START_BUG> t_type [ ( ( int ) ( v_y ) ) ] [ ( ( int ) ( v_x ) ) ] = a . _ ; <END_BUG> } } v_y -= dy ; v_x -= dx ; } if ( ( dist < ( ( a . P_R ) * 2 ) ) && ( v_cooldown <= 0 ) ) { v_cooldown = 20 ; off = 80 ; if ( ( inventory [ a . LEATHER_JACKET ] ) && ( jacket_hp > 0 ) ) { jacket_hp -- ; off = 40 ; } else { b_fatigue += ( v_dmg > 0 ) ? 50 : 100 ; b_exhaustion += ( v_dmg > 0 ) ? 50 : 100 ; } for ( int i = off ; i < ( off + 40 ) ; i ++ ) { particles [ ( i * 5 ) ] = ( r . nextDouble ( ) ) * 4 ; particles [ ( ( i * 5 ) + 1 ) ] = ( b_x * ( a . TILE_SIZE ) ) + 1 ; particles [ ( ( i * 5 ) + 2 ) ] = ( b_y * ( a . TILE_SIZE ) ) - 5 ; particles [ ( ( i * 5 ) + 3 ) ] = ( ( r . nextDouble ( ) ) * 2 ) - 1 ; particles [ ( ( i * 5 ) + 4 ) ] = ( ( r . nextDouble ( ) ) * 3 ) - 1 ;

Fix:
t_type [ ( ( int ) ( v_y ) ) ] [ ( ( int ) ( v_x ) ) ] = ( ( t_type [ ( ( int ) ( v_y ) ) ] [ ( ( int ) ( v_x ) ) ] ) == ( a . F ) ) ? a . G : a . _ ;
Buggy code:
public class MimeMessageHelper { private static final Logger LOGGER = LoggerFactory . getLogger ( MimeMessageHelper . class ) ; private static final String TEMP = ( System . getProperty ( "java.io.tmpdir" ) ) + ( File . separatorChar ) ; private static final String ATTACH_ICON_PATH = ( MimeMessageHelper . TEMP ) + "fishermail-attachment.png" ; private static boolean copied = false ; private final Map < String , String > cidFilenames ; private final List < String > attachments ; public MimeMessageHelper ( ) { } public String toHtml ( final MimeMessage message ) throws IOException , MessagingException { } private String addAttachments ( final String html , final List < String > attachNames ) { if ( attachNames . isEmpty ( ) ) { return html ; } String attHtml = "" ; attHtml += "<br>" ; <START_BUG> attHtml += "<div<seq2seq4repair_space>style='POSITION:<seq2seq4repair_space>absolute;<seq2seq4repair_space>BOTTOM:<seq2seq4repair_space>0;'><table<seq2seq4repair_space>style='cursor:<seq2seq4repair_space>hand'><tr>" ; <END_BUG> for ( final String name : attachNames ) { attHtml += ( ( ( "<td<seq2seq4repair_space>align=\'center\'<seq2seq4repair_space>onClick=\'attLoader.start(\"" + name ) + "\")\'><img<seq2seq4repair_space>src=\'file:////" ) + ( MimeMessageHelper . ATTACH_ICON_PATH ) ) + "'><//td>" ; } attHtml += "<//tr><tr>" ; for ( final String name : attachNames ) { attHtml += ( ( ( "<td<seq2seq4repair_space>align=\'center\'<seq2seq4repair_space>onClick=\'attLoader.start(\"" + name ) + "\")\'>" ) + name ) + "<//td>" ; } attHtml += "<//tr><//table><//div>" ; MimeMessageHelper . LOGGER . debug ( attHtml ) ; final String start ; final String end ; final int pos = Math . max ( html . lastIndexOf ( "<//body>" ) , html . lastIndexOf ( "<//BODY>" ) ) ; if ( pos == ( - 1 ) ) { start = html ; end = "" ; } else { start = html . substring ( 0 , pos ) ; end = html . substring ( pos ) ; } return ( start + attHtml ) + end ; } private String replaceCids ( String html , final Map < String , String > cidFilenames ) { } private StringBuilder toHtml ( final Part part , boolean isHtml ) throws IOException , MessagingException { } }

Fix:
attHtml += "<div<seq2seq4repair_space>style='position:<seq2seq4repair_space>absolute;<seq2seq4repair_space>bottom:<seq2seq4repair_space>0;'><table<seq2seq4repair_space>style='cursor:<seq2seq4repair_space>hand'><tr>" ;
Buggy code:
public class Spring3JNDITestCase extends ASIntegrationTest { private TestUserMode userMode ; private WebAppAdminClient webAppAdminClient ; private SqlDataSourceUtil sqlDataSource ; private final String webAppName = "spring3-restful-jndi-service" ; private final String endpointURL = "//student" ; private final String contentType = "application//json" ; @ Factory ( dataProvider = "userModeProvider" ) public Spring3JNDITestCase ( TestUserMode userMode ) { } @ DataProvider private static TestUserMode [ ] [ ] userModeProvider ( ) { } @ BeforeClass ( alwaysRun = true ) public void init ( ) throws Exception { } @ Test ( groups = "wso2.as" , description = "Upload<seq2seq4repair_space>Spring<seq2seq4repair_space>3<seq2seq4repair_space>WAR<seq2seq4repair_space>and<seq2seq4repair_space>verify<seq2seq4repair_space>deployment" ) public void testSpringWARUpload ( ) throws Exception { } @ Test ( groups = "wso2.as" , description = "Verify<seq2seq4repair_space>Get<seq2seq4repair_space>Operation" , dependsOnMethods = "testSpringWARUpload" ) public void testGetOperation ( ) throws Exception { } @ Test ( groups = "wso2.as" , description = "Verify<seq2seq4repair_space>Put<seq2seq4repair_space>Operation" , dependsOnMethods = "testGetOperation" ) public void testPutOperation ( ) throws Exception { } @ Test ( groups = "wso2.as" , description = "Verify<seq2seq4repair_space>Update<seq2seq4repair_space>Operation" , dependsOnMethods = "testPutOperation" ) public void testUpdateOperation ( ) throws Exception { } @ Test ( groups = "wso2.as" , description = "Verify<seq2seq4repair_space>Update<seq2seq4repair_space>Operation" , dependsOnMethods = "testUpdateOperation" ) public void testDeleteOperation ( ) throws Exception { } @ Test ( groups = "wso2.as" , description = "Verfiy<seq2seq4repair_space>if<seq2seq4repair_space>the<seq2seq4repair_space>webapp<seq2seq4repair_space>is<seq2seq4repair_space>unpacked<seq2seq4repair_space>for<seq2seq4repair_space>Tenants" , dependsOnMethods = "testDeleteOperation" ) public void testTenantWebappUnpack ( ) throws Exception { } @ AfterClass ( alwaysRun = true ) public void deteleteWebApp ( ) throws Exception { } private void createTable ( ) throws Exception { sqlDataSource = new SqlDataSourceUtil ( sessionCookie , asServer . getContextUrls ( ) . getBackEndUrl ( ) ) ; File sqlFile = new File ( ( ( ( ( ( ( ( ( TestConfigurationProvider . getResourceLocation ( ) ) + "artifacts" ) + ( File . separator ) ) + "AS" ) + ( File . separator ) ) + "spring" ) + ( File . separator ) ) + "studentDb.sql" ) ) ; List < File > sqlFileList = new ArrayList < > ( ) ; sqlFileList . add ( sqlFile ) ; <START_BUG> sqlDataSource . createDataSource ( sqlFileList ) ; <END_BUG> } private static int sendDeleteRequest ( URL endpoint , String contentType ) throws AutomationFrameworkException { } }

Fix:
sqlDataSource . createDataSource ( sqlFileList , "dataService" ) ;
Buggy code:
public final class FontData { public String name ; public float height ; public int style ; public String nsName ; String lang ; String country ; String variant ; public FontData ( ) { } public FontData ( String string ) { } public FontData ( String name , int height , int style ) { } FontData ( String name , float height , int style ) { } public boolean equals ( Object object ) { } public int getHeight ( ) { } float getHeightF ( ) { } public String getLocale ( ) { } public String getName ( ) { } public int getStyle ( ) { } public int hashCode ( ) { } public void setHeight ( int height ) { } void setHeight ( float height ) { } public void setLocale ( String locale ) { } public void setName ( String name ) { } public void setStyle ( int style ) { } public String toString ( ) { <START_BUG> StringBuffer buffer = new StringBuffer ( ) ; <END_BUG> buffer . append ( "1|" ) ; buffer . append ( getName ( ) ) ; buffer . append ( "|" ) ; buffer . append ( getHeightF ( ) ) ; buffer . append ( "|" ) ; buffer . append ( getStyle ( ) ) ; buffer . append ( "|" ) ; buffer . append ( "COCOA|1|" ) ; if ( ( nsName ) != null ) buffer . append ( nsName ) ; return buffer . toString ( ) ; } }

Fix:
StringBuffer buffer = new StringBuffer ( 128 ) ;
Buggy code:
public class DBManager { public static final String JDBC_DRIVER = "com.mysql.jdbc.Driver" ; public static final String DB_URL = "jdbc:mysql:////localhost//crawler" ; public static final String USER = "root" ; public static final String PASS = "password" ; public DBManager ( ) { } public void readWalkingData ( int [ ] [ ] distanceData ) { } public void readBusData ( int [ ] [ ] distanceData ) { Connection conn = null ; Statement statement = null ; try { Class . forName ( "com.mysql.jdbc.Driver" ) ; conn = DriverManager . getConnection ( DBManager . DB_URL , DBManager . USER , DBManager . PASS ) ; statement = conn . createStatement ( ) ; String sqlSBS ; <START_BUG> sqlSBS = "SELECT<seq2seq4repair_space>bus_stop_distance.*,<seq2seq4repair_space>area.grid_index<seq2seq4repair_space>FROM<seq2seq4repair_space>bus_stop_distance<seq2seq4repair_space>" + ( ( "INNER<seq2seq4repair_space>JOIN<seq2seq4repair_space>bus_stop<seq2seq4repair_space>ON<seq2seq4repair_space>bus_stop_distance.bus_stop_id<seq2seq4repair_space>=<seq2seq4repair_space>bus_stop.bus_stop_id<seq2seq4repair_space>" + "INNER<seq2seq4repair_space>JOIN<seq2seq4repair_space>area<seq2seq4repair_space>ON<seq2seq4repair_space>bus_stop.area_id<seq2seq4repair_space>=<seq2seq4repair_space>area.area_id<seq2seq4repair_space>" ) + "ORDER<seq2seq4repair_space>BY<seq2seq4repair_space>direction,<seq2seq4repair_space>bus_service_no" ) ; <END_BUG> try ( ResultSet resultSet = statement . executeQuery ( sqlSBS ) ) { this . buildBusGraph ( resultSet , distanceData ) ; } statement . close ( ) ; conn . close ( ) ; } catch ( SQLException | ClassNotFoundException se ) { } finally { try { if ( statement != null ) { statement . close ( ) ; } } catch ( SQLException se2 ) { } try { if ( conn != null ) { conn . close ( ) ; } } catch ( SQLException se ) { } } } public void readMRTData ( int [ ] [ ] distanceData ) { } public void insertDistance ( int [ ] [ ] distanceData , ArrayList < Integer > connectedVertices ) { } private void buildWalkingGraph ( ResultSet resultSet , int [ ] [ ] distanceData ) throws SQLException { } private void buildBusGraph ( ResultSet resultSet , int [ ] [ ] distanceData ) throws SQLException { } private void buildMRTGraph ( ResultSet resultSet , int [ ] [ ] distanceData ) throws SQLException { } }

Fix:
sqlSBS = "SELECT<seq2seq4repair_space>bus_stop_distance.*,<seq2seq4repair_space>area.grid_index<seq2seq4repair_space>FROM<seq2seq4repair_space>bus_stop_distance<seq2seq4repair_space>" + ( ( "INNER<seq2seq4repair_space>JOIN<seq2seq4repair_space>bus_stop<seq2seq4repair_space>ON<seq2seq4repair_space>bus_stop_distance.bus_stop_id<seq2seq4repair_space>=<seq2seq4repair_space>bus_stop.bus_stop_id<seq2seq4repair_space>" + "INNER<seq2seq4repair_space>JOIN<seq2seq4repair_space>area<seq2seq4repair_space>ON<seq2seq4repair_space>bus_stop.area_id<seq2seq4repair_space>=<seq2seq4repair_space>area.area_id<seq2seq4repair_space>" ) + "ORDER<seq2seq4repair_space>BY<seq2seq4repair_space>direction,<seq2seq4repair_space>bus_service_no,<seq2seq4repair_space>distance_km" ) ;
Buggy code:
public class DataGraphSharingManager implements IDataGraphSharingManager { public synchronized IDataGraphSharing getInstance ( ISharedObjectContainer container ) throws ECFException { ISharedObjectManager mgr = container . getSharedObjectManager ( ) ; ID id = IDFactory . makeStringID ( DATA_GRAPH_SHARING_ID ) ; DataGraphSharing result = ( ( DataGraphSharing ) ( mgr . getSharedObject ( id ) ) ) ; if ( result == null ) { result = new DataGraphSharing ( ) ; <START_BUG> mgr . addSharedObject ( id , result , null , null ) ; <END_BUG> } return result ; } }

Fix:
mgr . addSharedObject ( id , result , null ) ;
Buggy code:
public class LocalDescriptions { private LocalDescriptions ( ) { } static ModelNode getSubsystemDescription ( Locale locale ) { } static ModelNode getSubsystemAddDescription ( Locale locale ) { } static ModelNode getSubsystemDescribeDescription ( Locale locale ) { } static ModelNode getProtocolStackDescription ( Locale locale ) { } static ModelNode getProtocolStackAddDescription ( Locale locale ) { } static ModelNode getProtocolStackRemoveDescription ( Locale locale ) { } private static ResourceBundle getResources ( Locale locale ) { } private static ModelNode createDescription ( ResourceBundle resources , String key ) { } private static ModelNode createOperationDescription ( String operation , ResourceBundle resources , String key ) { } private static ModelNode createSubsystemOperationDescription ( String operation , ResourceBundle resources ) { } private static ModelNode createProtocolStackOperationDescription ( String operation , ResourceBundle resources ) { <START_BUG> return LocalDescriptions . createOperationDescription ( operation , resources , ( "jgroups.stack" + operation ) ) ; <END_BUG> } }

Fix:
return LocalDescriptions . createOperationDescription ( operation , resources , ( "jgroups.stack." + operation ) ) ;
Buggy code:
public class ServerMT { static ConcurrentLinkedQueue inBuffer = new ConcurrentLinkedQueue < InBufferInstruction > ( ) ; static ArrayList < ConcurrentLinkedQueue > outBuffers = new ArrayList ( ) ; ServerMTSockListen listener = new ServerMTSockListen ( ) ; GameInstance currentGame ; boolean needViewUpdate = false ; boolean [ ] playerUpdate = new boolean [ ] { false , false , false , false , false , false , false , false } ; public ServerMT ( GameInstance game ) { } public boolean lobby ( ) { } public void step ( ) { } private void generateViews ( ) { } private void processVision ( int playerNumber ) { int x = currentGame . tanks . get ( playerNumber ) . xCoord ; int y = currentGame . tanks . get ( playerNumber ) . yCoord ; OutBufferInstruction outInstruction ; for ( int i = 0 ; i < ( socketList . size ( ) ) ; i ++ ) { outInstruction = new OutBufferInstruction ( 2 , playerNumber , x , y ) ; ServerMT . outBuffers . get ( playerNumber ) . add ( outInstruction ) ; } for ( int i = - 2 ; i <= 2 ; i ++ ) { for ( int j = - 2 ; j <= 2 ; j ++ ) { <START_BUG> if ( ( ( x + j ) >= 0 ) && ( ( y + i ) >= 0 ) ) { <END_BUG> outInstruction = new OutBufferInstruction ( 3 , ( y + j ) , ( x + i ) , currentGame . gameMap . baseLayer [ ( y + i ) ] [ ( x + j ) ] , currentGame . gameMap . topLayer [ ( y + i ) ] [ ( x + j ) ] , currentGame . gameMap . spriteStyle [ ( y + i ) ] [ ( x + j ) ] , currentGame . gameMap . corners [ ( y + i ) ] [ ( x + j ) ] ) ; ServerMT . outBuffers . get ( playerNumber ) . add ( outInstruction ) ; } } } } private void inProcess ( InBufferInstruction instruction ) { } private boolean validateMove ( InBufferInstruction instruction ) { } private boolean validateAttack ( InBufferInstruction instruction ) { } private void conductAttack ( InBufferInstruction instruction ) { } }

Fix:
if ( ( ( y + j ) >= 0 ) && ( ( x + i ) >= 0 ) ) {
Buggy code:
public class PersonCourseRelationRowMapper implements RowMapper < PersonCourseRelation > { @ Override public PersonCourseRelation mapRow ( ResultSet rs , int rowNum ) throws SQLException { PersonCourseRelation relation = new PersonCourseRelation ( ) ; relation . setPid ( rs . getInt ( "pid" ) ) ; relation . setCid ( rs . getInt ( "cid" ) ) ; relation . setSection ( rs . getInt ( "section" ) ) ; relation . setRole ( rs . getString ( "role" ) ) ; relation . setNickId ( rs . getString ( "nickId" ) ) ; <START_BUG> relation . setCname ( rs . getString ( "cname" ) ) ; <END_BUG> return relation ; } }

Fix:
relation . setCourseName ( rs . getString ( "courseName" ) ) ;
Buggy code:
public class ExceptionOutcome implements StepOutcome { private Throwable ex ; public ExceptionOutcome ( Throwable ex ) { } @ Override public boolean matches ( Object expected ) { } @ Override public String toString ( ) { if ( ( ex ) instanceof UnsupportedOperationException ) { return "Unsupported<seq2seq4repair_space>operation<seq2seq4repair_space>" + ( ex . getMessage ( ) ) ; } else { <START_BUG> return ex . getMessage ( ) ; <END_BUG> } } }

Fix:
return ex . getMessage ( ) . split ( "[\\r\\n]+" ) [ 0 ] ;
Buggy code:
public class TestSwift { private OpenstackStoreImpl osi ; @ Before public void setup ( ) { } @ Test public void test ( ) throws IOException { } @ Test public void testCreateContainer ( ) throws IOException { URL u = new URL ( "https:////www.google.com//images//branding//googlelogo//1x//googlelogo_color_272x92dp.png" ) ; Binary b = new Binary ( u , true , true ) ; <START_BUG> osi . set ( "tic//tac//toe//dexlogo.png" , b , Collections . emptyMap ( ) ) ; <END_BUG> Assert . assertNotNull ( osi . getContainer ( ) ) ; } }

Fix:
osi . set ( "tic//tac//toe//dexlogo.png" , b , new HashMap < String , String > ( ) ) ;
Buggy code:
public class EventManager { private Context context ; private Random random ; private ArrayList < Event > activeEvents ; private boolean testCase ; public EventManager ( ) { } public void giveContext ( Context context ) { } public void turnChanged ( ) { } public int getNumberOfEventsActive ( ) { } public ArrayList < Event > getActiveEvents ( ) { } private void createNewEvent ( ) { <START_BUG> switch ( random . nextInt ( 5 ) ) { <END_BUG> case 0 : createJunctionFailureEvent ( false , testCase ) ; break ; case 1 : createJunctionFailureEvent ( true , testCase ) ; break ; case 2 : createTeleportEvent ( false , testCase ) ; break ; case 3 : createTeleportEvent ( true , testCase ) ; break ; case 4 : createFreeGoldEvent ( testCase ) ; break ; default : throw new IllegalArgumentException ( "Random<seq2seq4repair_space>number<seq2seq4repair_space>was<seq2seq4repair_space>out<seq2seq4repair_space>of<seq2seq4repair_space>bounds<seq2seq4repair_space>in<seq2seq4repair_space>CreateNewEvent()" ) ; } } public void runTestEvent ( ) { } private void createJunctionFailureEvent ( boolean wideSpread , boolean testCase ) { } public Station getUnaffectedStation ( ) { } private void createTeleportEvent ( boolean wideSpread , boolean testCase ) { } private void createFreeGoldEvent ( boolean testCase ) { } public void setToTestCase ( ) { } }

Fix:
switch ( random . nextInt ( 2 ) ) {
Buggy code:
public class TicTacToeBoard { private TicTacToeCell [ ] [ ] myBoard ; public TicTacToeBoard ( ) { } public boolean makeXMove ( int row , int col ) { } public boolean makeOMove ( int row , int col ) { } public boolean isXWin ( ) { } public boolean isOWin ( ) { } private boolean winChecker ( char xo ) { for ( int row = 0 ; row < 3 ; row ++ ) { boolean allXorO = true ; for ( int col = 0 ; col < 3 ; col ++ ) { if ( ! ( xo == 'X' ? myBoard [ row ] [ col ] . isX ( ) : myBoard [ row ] [ col ] . isO ( ) ) ) { allXorO = false ; } } if ( allXorO ) { return true ; } } for ( int row = 0 ; row < 3 ; row ++ ) { boolean allXorO = true ; <START_BUG> for ( int row = 0 ; row < 3 ; row ++ ) { <END_BUG> if ( ! ( xo == 'X' ? myBoard [ row ] [ col ] . isX ( ) : myBoard [ row ] [ col ] . isO ( ) ) ) { allXorO = false ; } } if ( allXorO ) { return true ; } } boolean allXorO1 = true ; boolean allXorO2 = true ; for ( int i = 0 ; i < 3 ; i ++ ) { if ( ! ( xo == 'X' ? myBoard [ i ] [ i ] . isX ( ) : myBoard [ i ] [ i ] . isO ( ) ) ) { allXorO1 = false ; } if ( ! ( xo == 'X' ? myBoard [ i ] [ ( 2 - i ) ] . isX ( ) : myBoard [ i ] [ ( 2 - i ) ] . isO ( ) ) ) { allXorO2 = false ; } } if ( allXorO1 || allXorO2 ) { return true ; } return false ; } No newline ; at end ; of file ; }

Fix:
for ( int col = 0 ; col < 3 ; col ++ ) {
Buggy code:
public class BootstrapContextAdd extends AbstractAddStepHandler { public static final BootstrapContextAdd INSTANCE = new BootstrapContextAdd ( ) ; @ Override protected void populateModel ( final ModelNode operation , final ModelNode model ) throws OperationFailedException { } @ Override protected void performRuntime ( final OperationContext context , final ModelNode operation , final ModelNode model ) throws OperationFailedException { String name = NAME . getAttribute ( ) . resolveModelAttribute ( context , model ) . asString ( ) ; String workmanager = WORKMANAGER . getAttribute ( ) . resolveModelAttribute ( context , model ) . asString ( ) ; boolean usingDefaultWm = false ; if ( Constants . DEFAULT_NAME . equals ( workmanager ) ) { usingDefaultWm = true ; } ServiceTarget serviceTarget = context . getServiceTarget ( ) ; CloneableBootstrapContext ctx = new NamedBootstrapContext ( name ) ; final BootStrapContextService bootCtxService = new BootStrapContextService ( ctx , name , usingDefaultWm ) ; <START_BUG> serviceTarget . addService ( BOOTSTRAP_CONTEXT_SERVICE . append ( name ) , bootCtxService ) . addDependency ( OPTIONAL , WORKMANAGER_SERVICE . append ( workmanager ) , WorkManager . class , bootCtxService . getWorkManagerValueInjector ( ) ) . addDependency ( JBOSS_TXN_XA_TERMINATOR , JBossXATerminator . class , bootCtxService . getXaTerminatorInjector ( ) ) . addDependency ( JBOSS_TXN_ARJUNA_TRANSACTION_MANAGER , TransactionManagerService . class , bootCtxService . getTxManagerInjector ( ) ) . addDependency ( CONNECTOR_CONFIG_SERVICE , JcaSubsystemConfiguration . class , bootCtxService . getJcaConfigInjector ( ) ) . setInitialMode ( ACTIVE ) . install ( ) ; <END_BUG> } }

Fix:
serviceTarget . addService ( BOOTSTRAP_CONTEXT_SERVICE . append ( name ) , bootCtxService ) . addDependency ( REQUIRED , WORKMANAGER_SERVICE . append ( workmanager ) , WorkManager . class , bootCtxService . getWorkManagerValueInjector ( ) ) . addDependency ( JBOSS_TXN_XA_TERMINATOR , JBossXATerminator . class , bootCtxService . getXaTerminatorInjector ( ) ) . addDependency ( JBOSS_TXN_ARJUNA_TRANSACTION_MANAGER , TransactionManagerService . class , bootCtxService . getTxManagerInjector ( ) ) . addDependency ( CONNECTOR_CONFIG_SERVICE , JcaSubsystemConfiguration . class , bootCtxService . getJcaConfigInjector ( ) ) . setInitialMode ( ACTIVE ) . install ( ) ;
Buggy code:
public class WebMethodCheckForWebServiceRule extends AbstractAnnotationProcessor { private static final String WEB_METHOD = "javax.jws.WebMethod" ; private static final String WEB_SERVICE = "javax.jws.WebService" ; public WebMethodCheckForWebServiceRule ( ) { } @ Override public void process ( ) { Messager messager = environment . getMessager ( ) ; AnnotationTypeDeclaration annotationDeclaration = ( ( AnnotationTypeDeclaration ) ( environment . getTypeDeclaration ( WebMethodCheckForWebServiceRule . WEB_METHOD ) ) ) ; Collection < Declaration > annotatedTypes = environment . getDeclarationsAnnotatedWith ( annotationDeclaration ) ; for ( Declaration declaration : annotatedTypes ) { Collection < AnnotationMirror > annotationMirrors = declaration . getAnnotationMirrors ( ) ; for ( AnnotationMirror mirror : annotationMirrors ) { if ( ( mirror . getAnnotationType ( ) . getDeclaration ( ) . getQualifiedName ( ) . equals ( WebMethodCheckForWebServiceRule . WEB_METHOD ) ) && ( ! ( checkForWebServiceAnnotation ( ( ( com . sun . mirror . declaration . MethodDeclaration ) ( declaration ) ) . getDeclaringType ( ) ) ) ) ) { <START_BUG> messager . printError ( mirror . getPosition ( ) , WEBMETHOD_ANNOTATION_PROCESSOR_ONLY_SUPPORTED_ON_CLASSES_WITH_WEBSERVICE_MESSAGE ) ; <END_BUG> } } } } private boolean checkForWebServiceAnnotation ( TypeDeclaration typeDeclaration ) { } }

Fix:
messager . printError ( mirror . getPosition ( ) , WEBMETHOD_ONLY_SUPPORTED_ON_CLASSES_WITH_WEBSERVICE_MESSAGE ) ;
Buggy code:
@ RestController public class LoginController { @ Autowired private UserService service ; @ RequestMapping ( value = "login" , method = RequestMethod . POST ) public LoginController . LoginResponse login ( @ RequestBody final LoginController . UserLogin model ) throws TripperException { if ( ( ( model . login ) == null ) || ( ( service . findByLogin ( model . login ) ) == null ) ) { throw new TripperException ( "Invalid<seq2seq4repair_space>login" ) ; } User user = service . findByLogin ( model . login ) ; <START_BUG> if ( ! ( new BCryptPasswordEncoder ( ) . matches ( model . password , user . getPassword ( ) ) ) ) { <END_BUG> throw new TripperUnauthorizedException ( "Wrong<seq2seq4repair_space>user//password<seq2seq4repair_space>combination." ) ; } return new LoginController . LoginResponse ( Jwts . builder ( ) . setSubject ( model . login ) . claim ( "roles" , user ) . setIssuedAt ( new Date ( ) ) . signWith ( HS256 , "secretkey" ) . compact ( ) ) ; } @ SuppressWarnings ( "unused" ) private static class UserLogin { public String login ; public String password ; } @ SuppressWarnings ( "unused" ) private static class LoginResponse { public String token ; public LoginResponse ( final String token ) { } } }

Fix:
if ( ( ! ( new BCryptPasswordEncoder ( ) . matches ( model . password , user . getPassword ( ) ) ) ) || ( ! ( user . getActive ( ) ) ) ) {
Buggy code:
class DefaultEvaluator implements TriggeringEventEvaluator { public boolean isTriggeringEvent ( LoggingEvent event ) { <START_BUG> return event . level . isGreaterOrEqual ( Level . ERROR ) ; <END_BUG> } }

Fix:
return event . getLevel ( ) . isGreaterOrEqual ( Level . ERROR ) ;
Buggy code:
public class ComponentRequestTarget implements IComponentRequestTarget { private final Component component ; public ComponentRequestTarget ( final Component component ) { } public void respond ( final RequestCycle requestCycle ) { Page page = component . getPage ( ) ; if ( page != null ) { page . startComponentRender ( component ) ; } try { if ( ( component ) instanceof Page ) { new PageRequestTarget ( ( ( Page ) ( component ) ) ) . respond ( requestCycle ) ; } else { <START_BUG> component . renderComponent ( ) ; <END_BUG> } } finally { if ( page != null ) { try { page . endComponentRender ( component ) ; } finally { page . detach ( ) ; } } } } public final Component getComponent ( ) { } public void detach ( final RequestCycle requestCycle ) { } @ Override public boolean equals ( final Object obj ) { } @ Override public int hashCode ( ) { } @ Override public String toString ( ) { } }

Fix:
component . render ( ) ;
Buggy code:
public class NewWizardMenu extends ContributionItem { private Action showDlgAction ; private Action newProjectAction ; private Action newExampleAction ; private Map actions = new HashMap ( 21 ) ; private NewWizardsRegistryReader reader = new NewWizardsRegistryReader ( ) ; private boolean enabled = true ; private IWorkbenchWindow window ; private boolean dirty = true ; private IMenuListener menuListener = new IMenuListener ( ) { public void menuAboutToShow ( IMenuManager manager ) { } } ; public NewWizardMenu ( IMenuManager innerMgr , IWorkbenchWindow window , boolean register ) { } public NewWizardMenu ( IWorkbenchWindow window ) { } private void fillMenu ( IContributionManager innerMgr ) { innerMgr . removeAll ( ) ; if ( this . enabled ) { innerMgr . add ( newProjectAction ) ; List actions = null ; IWorkbenchPage page = window . getActivePage ( ) ; if ( page != null ) actions = new ArrayList ( ( ( org . eclipse . ui . internal . WorkbenchPage ) ( page ) ) . getNewWizardActionIds ( ) ) ; if ( actions != null ) { <START_BUG> IObjectActivityManager manager = window . getWorkbench ( ) . getActivityManager ( PL_NEW , false ) ; <END_BUG> if ( manager != null ) { actions . retainAll ( manager . getActiveObjects ( ) ) ; } if ( ( actions . size ( ) ) > 0 ) innerMgr . add ( new Separator ( ) ) ; for ( Iterator i = actions . iterator ( ) ; i . hasNext ( ) ; ) { String id = ( ( String ) ( i . next ( ) ) ) ; IAction action = getAction ( id ) ; if ( action != null ) innerMgr . add ( action ) ; } } if ( hasExamples ( ) ) { innerMgr . add ( new Separator ( ) ) ; innerMgr . add ( newExampleAction ) ; } innerMgr . add ( new Separator ( ) ) ; innerMgr . add ( showDlgAction ) ; } } private IAction getAction ( String id ) { } public boolean isEnabled ( ) { } public boolean isDynamic ( ) { } public boolean isDirty ( ) { } public void setEnabled ( boolean enabledValue ) { } public void deregisterListeners ( ) { } public void fill ( Menu menu , int index ) { } private boolean hasExamples ( ) { } }

Fix:
IObjectActivityManager manager = window . getWorkbench ( ) . getObjectActivityManager ( PL_NEW , false ) ;
Buggy code:
public class Options implements Serializable , Cloneable { private static final long serialVersionUID = 1L ; public enum LearningMode { Basic , Standard , Full ; } public String trainFile = null ; public String testFile = null ; public String unimapFile = null ; public String outFile = null ; public boolean train = false ; public boolean test = false ; public String wordVectorFile = null ; public String modelFile = "model.out" ; public String format = "CONLL" ; public int maxNumSent = - 1 ; public int numPretrainIters = 1 ; public int maxNumIters = 10 ; public boolean initTensorWithPretrain = true ; public Options . LearningMode learningMode = Options . LearningMode . Standard ; public boolean projective = false ; public boolean learnLabel = false ; public boolean pruning = true ; public double pruningCoeff = 0.1 ; public int labelLossType = 0 ; public int numHcThreads = 10 ; public int numHcConverge = 300 ; public boolean average = true ; public double C = 0.01 ; public double gamma = 1 ; public double gammaLabel = 1 ; public int R = 50 ; public boolean useCS = true ; public boolean useGP = true ; public boolean useHB = true ; public boolean useGS = true ; public boolean useTS = true ; public boolean useGGP = true ; public boolean usePSC = true ; public boolean useHO = true ; public enum PossibleLang { Arabic , Bulgarian , Chinese , Czech , Danish , Dutch , English08 , German , Japanese , Portuguese , Slovene , Spanish , Swedish , Turkish , Unknown ; } Options . PossibleLang lang ; static final String [ ] langString = new String [ ] { "arabic" , "bulgarian" , "chinese" , "czech" , "danish" , "dutch" , "english08" , "german" , "japanese" , "portuguese" , "slovene" , "spanish" , "swedish" , "turkish" } ; public Options ( ) { } @ Override public Object clone ( ) throws CloneNotSupportedException { } public void processArguments ( String [ ] args ) { } public void printOptions ( ) { } Options . PossibleLang findLang ( String file ) { for ( Options . PossibleLang lang : Options . PossibleLang . values ( ) ) <START_BUG> if ( ( file . indexOf ( Options . langString [ lang . ordinal ( ) ] ) ) != ( - 1 ) ) { <END_BUG> return lang ; } System . out . println ( "Warning:<seq2seq4repair_space>unknow<seq2seq4repair_space>language" ) ; return Options . PossibleLang . Unknown ; } }

Fix:
if ( ( lang != ( Options . PossibleLang . Unknown ) ) && ( ( file . indexOf ( Options . langString [ lang . ordinal ( ) ] ) ) != ( - 1 ) ) ) {
Buggy code:
public class Drawer { protected RaffleDao raffleDao ; protected RaffleDynamicDao rdDao ; protected RaffleDynamicCache rdCache ; protected AwardedDao awardedDao ; protected Random rand ; public Drawer ( ) { } private static class Singleton { public static Drawer instance = new Drawer ( ) ; } public static Drawer getInstance ( ) { } public int draw ( Raffle rf , RaffleDynamic rd ) { int peerConsumed = ( rd . getPeerConsumed ( ) ) + 1 ; int length = rf . getAwardName ( ) . length ; for ( int i = 1 ; i < length ; i ++ ) { if ( ( rd . getAwardConsumed ( ) [ i ] ) >= ( rf . getAwardCapacity ( ) [ i ] ) ) continue ; int r = ( rd . getAwardTorn ( ) [ i ] ) - peerConsumed ; if ( r <= 0 ) <START_BUG> continue ; <END_BUG> int p = this . rand . nextInt ( r ) ; if ( p == 0 ) return i ; } return 0 ; } public Awarded draw ( Long raffleId ) throws IllegalStateException { } public Map < Integer , Integer > evaluate ( Long raffleId ) { } }

Fix:
return i ;
Buggy code:
public class PentiDetailActivity extends Activity { private static final String TEXT_HTML_CHARSET_UTF_8 = "text//html;<seq2seq4repair_space>charset=UTF-8" ; public class MyWebViewClient extends WebViewClient { @ Override public WebResourceResponse shouldInterceptRequest ( WebView view , String url ) { } } private static final String TAG = PentiDetailActivity . class . getSimpleName ( ) ; TextView titleView ; WebView tuguaWebView ; String title ; String url ; String link ; long id ; ProgressBar progressBar ; private DBHelper dbhelper ; private ShareActionProvider mShareActionProvider ; private Intent mShareIntent ; private boolean optimizeHTML = true ; @ Override protected void onCreate ( Bundle savedInstanceState ) { } private void getOverflowMenu ( ) { } class LoadPageTask extends AsyncTask < String , Void , String > { @ Override protected String doInBackground ( String ... params ) { String lines = null ; try { lines = NetUtil . getContentOfURL ( params [ 0 ] , optimizeHTML ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } if ( lines == null ) { lines = getResources ( ) . getString ( get_data_failed ) ; } <START_BUG> String content = ( "<html<seq2seq4repair_space>xmlns=\"http:////www.w3.org//1999//xhtml\"<seq2seq4repair_space>><head><meta<seq2seq4repair_space>http-equiv=\'content-type\'<seq2seq4repair_space>content=\'text//html;<seq2seq4repair_space>charset=utf-8\'<seq2seq4repair_space>//><style<seq2seq4repair_space>type=\"text//css\">img<seq2seq4repair_space>{\twidth:<seq2seq4repair_space>100%;}<//style><//head><body>" + lines ) + "<//body>" ; <END_BUG> lines = null ; return content ; } @ Override protected void onPostExecute ( String result ) { } } @ Override public boolean onCreateOptionsMenu ( Menu menu ) { } @ Override public boolean onOptionsItemSelected ( MenuItem item ) { } private void setShareIntent ( Intent shareIntent ) { } public class AddToFavTask extends AsyncTask < String , Void , Void > { @ Override protected void onPostExecute ( Void result ) { } @ Override protected Void doInBackground ( String ... params ) { dbhelper . addToFav ( params [ 0 ] ) ; return null ; } } }

Fix:
String content = ( "<html<seq2seq4repair_space>xmlns=\"http:////www.w3.org//1999//xhtml\"<seq2seq4repair_space>><head><meta<seq2seq4repair_space>http-equiv=\'content-type\'<seq2seq4repair_space>content=\'text//html;<seq2seq4repair_space>charset=utf-8\'<seq2seq4repair_space>//><//head><body>" + lines ) + "<//body>" ;
Buggy code:
@ RunWith ( Arquillian . class ) public class StatelessBeanIntegrationTestCase { @ Inject public Bundle bundle ; @ Inject public DeploymentProvider provider ; @ Inject public ArchiveDeployer deployer ; @ Deployment public static JavaArchive createDeployment ( ) { } @ Test public void testTargetBundle ( ) throws Exception { } @ Test public void testStatelessBean ( ) throws Exception { Archive < ? > ejbArchive = provider . getClientDeployment ( "ejb3-osgi.jar" ) ; String ejbName = deployer . deploy ( ejbArchive ) ; try { <START_BUG> String jndiname = "java:global//ejb3-osgi//SimpleClientServlet!org.jboss.as.testsuite.integration.osgi.ejb3.SimpleStatelessSessionBean" ; <END_BUG> Echo service = ( ( Echo ) ( new InitialContext ( ) . lookup ( jndiname ) ) ) ; assertNotNull ( "StatelessBean<seq2seq4repair_space>not<seq2seq4repair_space>null" , service ) ; assertEquals ( "ejb3-osgi-target" , service . echo ( Constants . BUNDLE_SYMBOLICNAME ) ) ; assertEquals ( "foo" , service . echo ( "foo" ) ) ; } finally { deployer . undeploy ( ejbName ) ; } } @ ArchiveProvider public static JavaArchive getTestArchive ( String name ) { } }

Fix:
String jndiname = "java:global//ejb3-osgi//SimpleStatelessSessionBean!org.jboss.as.testsuite.integration.osgi.ejb3.SimpleStatelessSessionBean" ;
Buggy code:
public class RefactoredNestedExceptionTest { static class ExceptionOne extends Exception { private static final long serialVersionUID = - 6723739469084198030L ; } static class ExceptionTwo extends Exception { private static final long serialVersionUID = 2383431696698789083L ; } public void raise ( final Exception e ) throws Exception { } public String exceptional ( final int n ) throws Exception { } private int call2 ( final int n ) throws Exception { } private int call1 ( final int n ) throws Exception { <START_BUG> if ( ( n % 2 ) == 1 ) { <END_BUG> if ( n == 1 ) { raise ( new RefactoredNestedExceptionTest . ExceptionOne ( ) ) ; } else throw new RuntimeException ( ) ; } return 1 ; } @ Test ( expected = RefactoredNestedExceptionTest . ExceptionOne . class ) public void test1 ( ) throws Exception { } @ Test ( expected = RefactoredNestedExceptionTest . ExceptionTwo . class ) public void test2 ( ) throws Exception { } @ Test ( expected = RefactoredNestedExceptionTest . ExceptionTwo . class ) public void test3 ( ) throws Exception { } @ Test public void test4 ( ) throws Exception { } }

Fix:
if ( ( n == 1 ) || ( n == 3 ) ) {
Buggy code:
public class DefaultErrorPage extends HttpServlet { public void service ( HttpServletRequest requestH , HttpServletResponse responseH ) throws IOException , ServletException { Request request = ( ( HttpServletRequestFacade ) ( requestH ) ) . getRealRequest ( ) ; Response response = request . getResponse ( ) ; int status = response . getStatus ( ) ; String msg = ( ( String ) ( request . getAttribute ( "javax.servlet.error.message" ) ) ) ; <START_BUG> Throwable e = ( ( Throwable ) ( request . getAttribute ( "tomcat.error.throwable" ) ) ) ; <END_BUG> if ( e != null ) { sendError ( request , response , 500 , exceptionString ( e ) ) ; return ; } if ( status == ( HttpServletResponse . SC_MOVED_TEMPORARILY ) ) { redirect ( request , response , msg ) ; } else { sendError ( request , response , status , msg ) ; } } public void sendError ( Request request , Response response , int sc , String msg ) throws IOException { } private void sendPrivateError ( Request request , Response response , int sc , String msg ) throws IOException { } public void redirect ( Request request , Response response , String location ) throws IOException { } private String makeAbsolute ( Request request , String location ) { } public String exceptionString ( Throwable e ) { } void printRootCause ( ServletException e , PrintWriter out ) { } }

Fix:
Throwable e = ( ( Throwable ) ( request . getAttribute ( "tomcat.servlet.error.throwable" ) ) ) ;
Buggy code:
public class GetMarkdownClient implements Callback < String > , Client { private final Handler handler ; private Context context ; private RequestMarkdownDTO readme ; private BaseClient . OnResultCallback < String > onResultCallback ; public GetMarkdownClient ( Context context , RequestMarkdownDTO readme , Handler handler ) { } public void execute ( ) { } private void executeService ( RestAdapter restAdapter ) { } @ Override public void success ( String s , Response response ) { } @ Override public void failure ( RetrofitError error ) { } @ Override public Response execute ( Request request ) throws IOException { StoreCredentials storeCredentials = new StoreCredentials ( context ) ; HttpClient httpclient = new DefaultHttpClient ( ) ; HttpPost httppost = new HttpPost ( request . getUrl ( ) ) ; httppost . setHeader ( "Accept" , "application//json" ) ; httppost . setHeader ( "Content-type" , "text//plain" ) ; httppost . setHeader ( "Authorization" , ( "token<seq2seq4repair_space>" + ( storeCredentials . token ( ) ) ) ) ; <START_BUG> httppost . setEntity ( new org . apache . http . entity . StringEntity ( readme . text ) ) ; <END_BUG> HttpResponse response = httpclient . execute ( httppost ) ; final String inputStreamString = new Scanner ( response . getEntity ( ) . getContent ( ) , "UTF-8" ) . useDelimiter ( "\\A" ) . next ( ) ; handler . post ( new Runnable ( ) { @ Override public void run ( ) { if ( ( onResultCallback ) != null ) { onResultCallback . onResponseOk ( inputStreamString , null ) ; } } } ) ; return null ; } public void setOnResultCallback ( BaseClient . OnResultCallback < String > onResultCallback ) { } }

Fix:
httppost . setEntity ( new org . apache . http . entity . StringEntity ( readme . text , "UTF-8" ) ) ;
Buggy code:
public class SIGRecord extends Record { private short covered ; private byte alg ; private byte labels ; private int origttl ; private Date expire ; private Date timeSigned ; private short footprint ; private Name signer ; private byte [ ] signature ; private SIGRecord ( ) { } public SIGRecord ( Name _name , short _dclass , int _ttl , int _covered , int _alg , int _origttl , Date _expire , Date _timeSigned , int _footprint , Name _signer , byte [ ] _signature ) { } SIGRecord ( Name _name , short _dclass , int _ttl , int length , DataByteInputStream in , Compression c ) throws IOException { } SIGRecord ( Name _name , short _dclass , int _ttl , MyStringTokenizer st , Name origin ) throws IOException { } public String toString ( ) { } public short getTypeCovered ( ) { } public byte getAlgorithm ( ) { } public byte getLabels ( ) { } public int getOrigTTL ( ) { } public Date getExpire ( ) { } public Date getTimeSigned ( ) { } public short getFootprint ( ) { } public Name getSigner ( ) { } public byte [ ] getSignature ( ) { } void rrToWire ( DataByteOutputStream out , Compression c ) throws IOException { } void rrToWireCanonical ( DataByteOutputStream out ) throws IOException { } static String formatDate ( Date d ) { } static Date parseDate ( String s ) { Calendar c = new GregorianCalendar ( TimeZone . getTimeZone ( "UTC" ) ) ; int year = Integer . parseInt ( s . substring ( 0 , 4 ) ) ; <START_BUG> int month = Integer . parseInt ( s . substring ( 4 , 6 ) ) ; <END_BUG> int date = Integer . parseInt ( s . substring ( 6 , 8 ) ) ; int hour = Integer . parseInt ( s . substring ( 8 , 10 ) ) ; int minute = Integer . parseInt ( s . substring ( 10 , 12 ) ) ; int second = Integer . parseInt ( s . substring ( 12 , 14 ) ) ; c . set ( year , month , date , hour , minute , second ) ; return c . getTime ( ) ; } }

Fix:
int month = ( Integer . parseInt ( s . substring ( 4 , 6 ) ) ) - 1 ;
Buggy code:
@ Configuration @ EnableWebSocket public class JsonRpcConfiguration implements WebSocketConfigurer { @ Autowired protected ApplicationContext ctx ; private final List < JsonRpcConfigurer > configurers = new ArrayList < > ( ) ; private DefaultJsonRpcHandlerRegistry instanceRegistry ; private DefaultJsonRpcHandlerRegistry getJsonRpcHandlersRegistry ( ) { } @ Autowired ( required = false ) public void setConfigurers ( List < JsonRpcConfigurer > configurers ) { } @ Bean public JsonRpcProperties jsonRpcProperties ( ) { } @ Bean public HandlerMapping jsonRpcHandlerMapping ( ) { } private void putHandlersMappings ( Map < String , Object > urlMap , JsonRpcHandler < ? > handler , List < String > paths ) { } @ Override public void registerWebSocketHandlers ( WebSocketHandlerRegistry wsHandlerRegistry ) { } private void publishWebSocketEndpoint ( WebSocketHandlerRegistry wsHandlerRegistry , JsonRpcHandler < ? > handler , List < String > paths ) { ProtocolManager protocolManager = ( ( ProtocolManager ) ( ctx . getBean ( "protocolManager" , handler ) ) ) ; JsonRpcWebSocketHandler wsHandler = new JsonRpcWebSocketHandler ( protocolManager ) ; <START_BUG> protocolManager . setPingWachdog ( handler . isPingWachdog ( ) ) ; <END_BUG> for ( String path : paths ) { WebSocketHandlerRegistration registration = wsHandlerRegistry . addHandler ( wsHandler , path ) ; if ( handler . isSockJSEnabled ( ) ) { registration . withSockJS ( ) ; } if ( ( handler . getLabel ( ) ) != null ) { wsHandler . setLabel ( handler . getLabel ( ) ) ; } } } @ Bean public TomcatEmbeddedServletContainerFactory tomcatContainerFactory ( ) { } @ Bean public TomcatContextCustomizer tomcatContextCustomizer ( ) { } @ Bean public SessionsManager sessionsManager ( ) { } @ Bean @ Scope ( "prototype" ) public ProtocolManager protocolManager ( JsonRpcHandler < ? > key ) { } @ Bean @ Scope ( "prototype" ) @ SuppressWarnings ( { "rawtypes" , "unchecked" } ) public PerSessionJsonRpcHandler < ? > perSessionJsonRpcHandler ( String beanName , Class < ? extends JsonRpcHandler < ? > > beanClass ) { } @ Bean ( destroyMethod = "shutdown" ) public TaskScheduler jsonrpcTaskScheduler ( ) { } }

Fix:
protocolManager . setPingWachdog ( handler . isPingWatchdog ( ) ) ;
Buggy code:
@ Repository public class DishDiscoveryDAOImpl implements IDishDiscoveryDAO { @ Autowired SessionFactory sessionFactory ; public List < DishCategoriesVO > getAllDishCategories ( ) throws DAOException { } private List < DishCategoriesVO > convertDBObjectToBusinessObject ( List < DshCat > dishCategories ) { } @ SuppressWarnings ( "unchecked" ) public List < DishSummaryVO > getDishSummaryListByName ( String name , int pageSize , int pageNo ) throws DAOException { } public DishDetailVO getDishDetails ( String dishId ) throws DAOException { <START_BUG> DshDtl dishDetailBO = ( ( DshDtl ) ( sessionFactory . openSession ( ) . createCriteria ( DshDtl . class ) . add ( Restrictions . idEq ( dishId ) ) ) ) ; <END_BUG> return DishDetailMapper . convertDBObjectToBusinessObject ( dishDetailBO ) ; } }

Fix:
DshDtl dishDetailBO = ( ( DshDtl ) ( sessionFactory . openSession ( ) . createCriteria ( DshDtl . class ) . add ( Restrictions . idEq ( Long . valueOf ( dishId ) ) ) . uniqueResult ( ) ) ) ;