nus-yam/ex-repair huggingface dataset:
Buggy code:
public class NestedQueryParser implements QueryParser { public static final String NAME = "nested" ; private final InnerHitsQueryParserHelper innerHitsQueryParserHelper ; @ Inject public NestedQueryParser ( InnerHitsQueryParserHelper innerHitsQueryParserHelper ) { } @ Override public String [ ] names ( ) { } @ Override public Query parse ( QueryParseContext parseContext ) throws IOException , QueryParsingException { } public static class ToBlockJoinQueryBuilder extends NestedInnerQueryParseSupport { private ScoreMode scoreMode ; private Tuple < String , SubSearchContext > innerHits ; public ToBlockJoinQueryBuilder ( QueryParseContext parseContext ) throws IOException { } public void setScoreMode ( ScoreMode scoreMode ) { } public void setInnerHits ( Tuple < String , SubSearchContext > innerHits ) { } @ Nullable public ToParentBlockJoinQuery build ( ) throws IOException { Query innerQuery ; if ( queryFound ) { innerQuery = getInnerQuery ( ) ; } else if ( filterFound ) { Filter innerFilter = getInnerFilter ( ) ; if ( innerFilter != null ) { innerQuery = new org . elasticsearch . common . lucene . search . XConstantScoreQuery ( getInnerFilter ( ) ) ; } else { innerQuery = null ; } } else { throw new QueryParsingException ( parseContext . index ( ) , "[nested]<seq2seq4repair_space>requires<seq2seq4repair_space>either<seq2seq4repair_space>'query'<seq2seq4repair_space>or<seq2seq4repair_space>'filter'<seq2seq4repair_space>field" ) ; } if ( ( innerHits ) != null ) { <START_BUG> InnerHitsContext . NestedInnerHits nestedInnerHits = new InnerHitsContext . NestedInnerHits ( innerHits . v2 ( ) , getInnerQuery ( ) , null , getParentObjectMapper ( ) , nestedObjectMapper ) ; <END_BUG> String name = ( ( innerHits . v1 ( ) ) != null ) ? innerHits . v1 ( ) : path ; parseContext . addInnerHits ( name , nestedInnerHits ) ; } if ( innerQuery != null ) { return new ToParentBlockJoinQuery ( new org . elasticsearch . common . lucene . search . XFilteredQuery ( innerQuery , childFilter ) , parentFilter , scoreMode ) ; } else { return null ; } } } }

Fix:
InnerHitsContext . NestedInnerHits nestedInnerHits = new InnerHitsContext . NestedInnerHits ( innerHits . v2 ( ) , innerQuery , null , getParentObjectMapper ( ) , nestedObjectMapper ) ;
Buggy code:
public class World extends Actor implements Disposable { private final float TIMESTEP = 1 // 60.0F ; private final int VELOCITYITERATIONS = 8 ; private final int POSITIONITERATIONS = 3 ; private Stage worldStage ; private Stage stage ; private ShapeRenderer shapeRenderer ; private Vector2 sky ; public com . badlogic . gdx . physics . box2d . World box2dWorld ; private GameContactListener gameContactListener ; private Random random ; public Ground ground ; public Catapult catapult ; private Sprite darkness ; public CaveMan caveman ; private Box2DDebugRenderer debugRenderer ; private int skyColorHeight = 0 ; private Color skyColor ; private int sunColorHeight = 40 ; private Color sunColor ; private int spaceColorHeight = 80 ; private Color spaceColor ; private int finalSpaceColorHeight = 120 ; public float zoom = 1 ; private int i = 0 ; private float scrollTimer ; private float camPosX ; private float camPosY ; private boolean debug ; public boolean flying ; public boolean remove ; private float shootStateTime ; private Array < Entity > entities ; private Space space ; public boolean gameOver ; public Area area ; private ObstacleSpawner obstacleSpawner ; public PowerUpSpawner powerUpSpawner ; public CoinSpawner coinSpawner ; private Title title ; public World ( Stage worldStage , Stage stage , boolean debug ) { } @ Override public void draw ( Batch batch , float parentAlpha ) { } public void update ( float delta ) { coinSpawner . update ( delta , caveman , this ) ; gameContactListener . update ( ) ; title . update ( delta ) ; updateCamera ( ) ; updateSky ( ) ; space . update ( delta , worldStage . getCamera ( ) . position ) ; updateBackground ( ) ; updateGround ( ) ; updateObstacles ( ) ; caveman . update ( delta ) ; powerUpSpawner . update ( delta ) ; updateWorld ( ) ; if ( flying ) shootStateTime += delta ; if ( ( ( shootStateTime ) > 1 ) && ( remove ) ) { if ( ( caveman . body . getPosition ( ) . x ) > ( Core . BOX2D_VIRTUAL_WIDTH ) ) { box2dWorld . destroyBody ( catapult . armBody ) ; box2dWorld . destroyBody ( catapult . baseBody ) ; remove = false ; } } <START_BUG> area . update ( caveman . body ) ; <END_BUG> checkGameOver ( ) ; } private Color toColor ( float percentage , Color cur , Color target ) { } private void updateCamera ( ) { } private void updateSky ( ) { } private void updateBackground ( ) { } private void updateGround ( ) { } private void updateObstacles ( ) { } private void updateWorld ( ) { } private void checkGameOver ( ) { } public boolean isGameOver ( ) { } @ Override public void dispose ( ) { } No newline ; at end ; of file ; }

Fix:
area . update ( worldStage . getCamera ( ) . position ) ;
Buggy code:
class XSDNotationTraverser extends XSDAbstractTraverser { XSDNotationTraverser ( XSDHandler handler , XSAttributeChecker gAttrCheck ) { } XSNotationDecl traverse ( Element elmNode , XSDocumentInfo schemaDoc , SchemaGrammar grammar ) { Object [ ] attrValues = fAttrChecker . checkAttributes ( elmNode , true , schemaDoc ) ; String nameAttr = ( ( String ) ( attrValues [ XSAttributeChecker . ATTIDX_NAME ] ) ) ; String publicAttr = ( ( String ) ( attrValues [ XSAttributeChecker . ATTIDX_PUBLIC ] ) ) ; String systemAttr = ( ( String ) ( attrValues [ XSAttributeChecker . ATTIDX_SYSTEM ] ) ) ; if ( nameAttr == null ) { reportSchemaError ( "s4s-att-must-appear" , new Object [ ] { SchemaSymbols . ELT_NOTATION , SchemaSymbols . ATT_NAME } , elmNode ) ; fAttrChecker . returnAttrArray ( attrValues , schemaDoc ) ; return null ; } if ( ( systemAttr == null ) && ( publicAttr == null ) ) <START_BUG> reportSchemaError ( "s4s-att-must-appear" , new Object [ ] { SchemaSymbols . ELT_NOTATION , "system<seq2seq4repair_space>or<seq2seq4repair_space>public" } , elmNode ) ; <END_BUG> XSNotationDecl notation = new XSNotationDecl ( ) ; notation . fName = nameAttr ; notation . fTargetNamespace = schemaDoc . fTargetNamespace ; notation . fPublicId = publicAttr ; notation . fSystemId = systemAttr ; Element content = DOMUtil . getFirstChildElement ( elmNode ) ; XSAnnotationImpl annotation = null ; if ( content != null ) { if ( DOMUtil . getLocalName ( content ) . equals ( ELT_ANNOTATION ) ) { annotation = traverseAnnotationDecl ( content , attrValues , false , schemaDoc ) ; content = DOMUtil . getNextSiblingElement ( content ) ; } } notation . fAnnotation = annotation ; if ( content != null ) { Object [ ] args = new Object [ ] { SchemaSymbols . ELT_NOTATION , "(annotation?)" , DOMUtil . getLocalName ( content ) } ; reportSchemaError ( "s4s-elt-must-match.1" , args , content ) ; } grammar . addGlobalNotationDecl ( notation ) ; fAttrChecker . returnAttrArray ( attrValues , schemaDoc ) ; return notation ; } }

Fix:
reportSchemaError ( "PublicSystemOnNotation" , null , elmNode ) ;
Buggy code:
public class DRPCSpout implements IRichSpout { public static Logger LOG = Logger . getLogger ( DRPCSpout . class ) ; SpoutOutputCollector _collector ; List < DRPCInvocationsClient > _clients = new ArrayList < DRPCInvocationsClient > ( ) ; String _function ; String _local_drpc_id = null ; private static class DRPCMessageId { String id ; int index ; public DRPCMessageId ( String id , int index ) { } } public DRPCSpout ( String function ) { } public DRPCSpout ( String function , ILocalDRPC drpc ) { } @ Override public boolean isDistributed ( ) { } @ Override public void open ( Map conf , TopologyContext context , SpoutOutputCollector collector ) { _collector = collector ; if ( ( _local_drpc_id ) == null ) { int numTasks = context . getComponentTasks ( context . getThisComponentId ( ) ) . size ( ) ; int index = context . getThisTaskIndex ( ) ; int port = Utils . getInt ( conf . get ( DRPC_INVOCATIONS_PORT ) ) ; List < String > servers = ( ( List < String > ) ( conf . get ( DRPC_SERVERS ) ) ) ; <START_BUG> if ( ( servers == null ) || ( servers . isEmpty ( ) ) ) { <END_BUG> throw new RuntimeException ( "No<seq2seq4repair_space>DRPC<seq2seq4repair_space>servers<seq2seq4repair_space>configured<seq2seq4repair_space>for<seq2seq4repair_space>topology" ) ; } if ( numTasks < ( servers . size ( ) ) ) { for ( String s : servers ) { _clients . add ( new DRPCInvocationsClient ( s , port ) ) ; } } else { int i = index % ( servers . size ( ) ) ; _clients . add ( new DRPCInvocationsClient ( servers . get ( i ) , port ) ) ; } } } @ Override public void close ( ) { } @ Override public void nextTuple ( ) { } @ Override public void ack ( Object msgId ) { } @ Override public void fail ( Object msgId ) { } @ Override public void declareOutputFields ( OutputFieldsDeclarer declarer ) { } }

Fix:
if ( servers . isEmpty ( ) ) {
Buggy code:
public class EAPRepositoryReachableUtil { private static String TEST_TRANSFORMERS_EAP = "jboss.test.transformers.eap" ; private static final String EAP_REPOSITORY_HOST = "download.lab.bos.redhat.com" ; static Boolean reachable ; public static boolean isReachable ( ) { if ( ( EAPRepositoryReachableUtil . reachable ) == null ) { <START_BUG> if ( System . getProperties ( ) . contains ( EAPRepositoryReachableUtil . TEST_TRANSFORMERS_EAP ) ) { <END_BUG> try { InetAddress . getByName ( EAPRepositoryReachableUtil . EAP_REPOSITORY_HOST ) ; EAPRepositoryReachableUtil . reachable = true ; } catch ( UnknownHostException e ) { EAPRepositoryReachableUtil . reachable = false ; } } else { EAPRepositoryReachableUtil . reachable = false ; } } return EAPRepositoryReachableUtil . reachable ; } }

Fix:
if ( System . getProperties ( ) . containsKey ( EAPRepositoryReachableUtil . TEST_TRANSFORMERS_EAP ) ) {
Buggy code:
public class TagTester { private final XmlTag openTag ; private final XmlTag closeTag ; private final XmlPullParser parser ; private TagTester ( XmlPullParser parser , XmlTag openTag , XmlTag closeTag ) { } public String getName ( ) { } public boolean hasAttribute ( String attribute ) { } public String getAttribute ( String attribute ) { } public boolean getAttributeContains ( String attribute , String partialValue ) { boolean contains = false ; if ( partialValue != null ) { String value = getAttribute ( attribute ) ; if ( value != null ) { <START_BUG> if ( ( value . indexOf ( partialValue ) ) > ( - 1 ) ) { <END_BUG> contains = true ; } } } return contains ; } public boolean getAttributeIs ( String attribute , String expected ) { } public boolean getAttributeEndsWith ( String attribute , String expected ) { } public boolean hasChildTag ( String tagName ) { } public TagTester getChild ( String attribute , String value ) { } public String getMarkup ( ) { } public String getValue ( ) { } public static TagTester createTagByAttribute ( String markup , String attribute , String value ) { } public static TagTester createTagsByAttribute ( String markup , String attribute , String value ) { } public static List < TagTester > createTagsByAttribute ( String markup , String attribute , String value , boolean stopAfterFirst ) { } }

Fix:
if ( value . contains ( partialValue ) ) {
Buggy code:
public class Application extends Controller { public static void index ( ) { } public static void register ( ) { <START_BUG> render ( ) ; <END_BUG> } public static void newUser ( String email , String password , String fullname ) { } No newline ; at end ; of file ; }

Fix:
render ( "//Users//register.html" ) ;
Buggy code:
public class ServerGui implements View { private ActionListener controller ; private JFrame serverFrame ; private JTextField portTextField ; private JTextField textField ; private JTextArea mainTextArea ; private JTextArea activePlayersTextArea ; private JTextArea currentGamesTextArea ; private String inet ; public ServerGui ( ActionListener newController ) { } private void initialize ( ) { } public synchronized void printText ( String message ) { } public synchronized void appendActivePlayers ( String player ) { } public synchronized void appendCurrentGames ( String game ) { } public synchronized void clearActivePlayers ( ) { } public synchronized void clearCurrentGames ( ) { currentGamesTextArea . setText ( "refreshing..." ) ; <START_BUG> activePlayersTextArea . setText ( "" ) ; <END_BUG> } public void startScherm ( ) { } public void update ( Observable arg0 , Object arg1 ) { } }

Fix:
currentGamesTextArea . setText ( "" ) ;
Buggy code:
public class CarTable { public static final String CAR_ID = "CAR_ID" ; public static final String NAME = "NAME" ; public static final String BRAND = "BRAND" ; public static final String REGISTER = "REGISTER" ; public static final String LATITUDE = "LATITUDE" ; public static final String LONGITUDE = "LONGITUDE" ; public static final String IS_PARKED = "ISPARKED" ; public static final String TIMESTAMP = "TIMESTAMP" ; public static final String LAST_DRIVER = "LAST_DRIVER" ; public static final String BLUETOOTH_NAME = "BLUETOOTH_NAME" ; public static final String BLUETOOTH_MAC = "BLUETOOTH_MAC" ; public static final String [ ] COLUMNS = new String [ ] { CarTable . CAR_ID , CarTable . NAME , CarTable . BRAND , CarTable . REGISTER , CarTable . LATITUDE , CarTable . LONGITUDE , CarTable . IS_PARKED , CarTable . TIMESTAMP , CarTable . LAST_DRIVER , CarTable . BLUETOOTH_NAME , CarTable . BLUETOOTH_MAC } ; public static final String TABLE = "car_table" ; public static void insertCar ( SQLiteDatabase db , Car car ) { } public static ArrayList < Car > getAllCar ( SQLiteDatabase db ) throws SQLException { ArrayList < Car > car_list = new ArrayList < > ( ) ; <START_BUG> Cursor c = db . query ( true , CarTable . TABLE , CarTable . COLUMNS , null , null , null , null , null , null ) ; <END_BUG> if ( ( c != null ) && ( ( c . getCount ( ) ) > 0 ) ) { while ( c . moveToNext ( ) ) { Car car = new Car ( c . getString ( 0 ) , c . getString ( 1 ) , c . getString ( 2 ) , c . getString ( 3 ) , c . getString ( 4 ) , c . getString ( 5 ) , Boolean . parseBoolean ( c . getString ( 6 ) ) , c . getString ( 7 ) , c . getString ( 9 ) , c . getString ( 10 ) ) ; String last_driver = c . getString ( 8 ) ; if ( last_driver != null ) car . setLast_driver ( last_driver ) ; car . setUsers ( GroupTable . getContact_ByCarID ( db , car . getId ( ) ) ) ; car_list . add ( car ) ; } } c . close ( ) ; return car_list ; } public static ArrayList < Car > getAllCarForBluetoothMAC ( SQLiteDatabase db , String bluetoothMAC ) throws SQLException { } public static boolean deleteCar ( SQLiteDatabase db , String carID ) { } public static boolean deleteCarTable ( SQLiteDatabase db ) { } public static int updateCar ( SQLiteDatabase db , Car car ) { } public static int updateBluetooth ( SQLiteDatabase db , Car car ) { } }

Fix:
Cursor c = db . query ( true , CarTable . TABLE , CarTable . COLUMNS , null , null , null , null , CarTable . NAME , null ) ;
Buggy code:
class CSVLexer1 extends Lexer { private final StringBuilder wsBuf = new StringBuilder ( ) ; public CSVLexer1 ( final CSVFormat format , final ExtendedBufferedReader in ) { } @ Override Token nextToken ( Token tkn ) throws IOException { } private Token simpleTokenLexer ( final Token tkn , int c ) throws IOException { } private Token encapsulatedTokenLexer ( final Token tkn , int c ) throws IOException { <START_BUG> final int startLineNumber = getLineNumber ( ) ; <END_BUG> while ( true ) { c = in . read ( ) ; if ( c == ( format . getEscape ( ) ) ) { tkn . content . append ( ( ( char ) ( readEscape ( ) ) ) ) ; } else if ( c == ( format . getEncapsulator ( ) ) ) { if ( ( in . lookAhead ( ) ) == ( format . getEncapsulator ( ) ) ) { c = in . read ( ) ; tkn . content . append ( ( ( char ) ( c ) ) ) ; } else { while ( true ) { c = in . read ( ) ; if ( c == ( format . getDelimiter ( ) ) ) { tkn . type = Type . TOKEN ; tkn . isReady = true ; return tkn ; } else if ( isEndOfFile ( c ) ) { tkn . type = Type . EOF ; tkn . isReady = true ; return tkn ; } else if ( isEndOfLine ( c ) ) { tkn . type = Type . EORECORD ; tkn . isReady = true ; return tkn ; } else if ( ! ( isWhitespace ( c ) ) ) { throw new IOException ( ( ( "(line<seq2seq4repair_space>" + ( getLineNumber ( ) ) ) + ")<seq2seq4repair_space>invalid<seq2seq4repair_space>char<seq2seq4repair_space>between<seq2seq4repair_space>encapsulated<seq2seq4repair_space>token<seq2seq4repair_space>and<seq2seq4repair_space>delimiter" ) ) ; } } } } else if ( isEndOfFile ( c ) ) { throw new IOException ( ( ( "(startline<seq2seq4repair_space>" + startLineNumber ) + ")<seq2seq4repair_space>EOF<seq2seq4repair_space>reached<seq2seq4repair_space>before<seq2seq4repair_space>encapsulated<seq2seq4repair_space>token<seq2seq4repair_space>finished" ) ) ; } else { tkn . content . append ( ( ( char ) ( c ) ) ) ; } } } }

Fix:
final long startLineNumber = getLineNumber ( ) ;
Buggy code:
public class SolrExampleJettyTest extends SolrExampleTests { @ BeforeClass public static void beforeTest ( ) throws Exception { } @ Test public void testBadSetup ( ) { try { <START_BUG> String url = "http:////127.0.0.1//?core=xxx" ; <END_BUG> HttpSolrServer s = new HttpSolrServer ( url ) ; Assert . fail ( ( "CommonsHttpSolrServer<seq2seq4repair_space>should<seq2seq4repair_space>not<seq2seq4repair_space>allow<seq2seq4repair_space>a<seq2seq4repair_space>path<seq2seq4repair_space>with<seq2seq4repair_space>a<seq2seq4repair_space>parameter:<seq2seq4repair_space>" + ( s . getBaseURL ( ) ) ) ) ; } catch ( Exception ex ) { } } }

Fix:
String url = ( "http" + ( isSSLMode ( ) ? "s" : "" ) ) + ":////127.0.0.1//?core=xxx" ;
Buggy code:
public class Main { public static void main ( String [ ] args ) { <START_BUG> Debug . println ( "MAIN" , "Init..." ) ; <END_BUG> ResourcePool resources = new ResourcePool ( ) ; resources . register ( new ResourcePlugin ( "10.10.10.2" , 80 , "WebServer_1" ) ) ; resources . register ( new ResourcePlugin ( "10.10.10.3" , 80 , "Webserver_2" ) ) ; LoadBalancingAlgorithm LBA = new LoadBalancingAlgorithm ( resources ) ; try { LoadBalancingService svc = new LoadBalancingService ( 80 , LBA ) ; Debug . println ( "MAIN" , "Start<seq2seq4repair_space>balancing..." ) ; svc . start ( ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } Debug . println ( "MAIN" , "Stop<seq2seq4repair_space>balancing." ) ; } }

Fix:
Debug . println ( "MAIN<seq2seq4repair_space>1" , "Init..." ) ;
Buggy code:
class TextureTab extends OpenGLTab { private float yrot = 0 ; private float zrot = 0 ; private float xPos = 0.0F ; private float yPos = 0.0F ; private float zPos = - 20 ; private int texture = 0 ; private float [ ] [ ] [ ] points = new float [ 45 ] [ 45 ] [ 3 ] ; private static final String IMAGE = "images//splash.bmp" ; private static final int SLEEP_LENGTH = 50 ; void createControls ( Composite composite ) { } int getSleepLength ( ) { } String getTabText ( ) { } void init ( ) { GL . glClearColor ( 1.0F , 1.0F , 1.0F , 1.0F ) ; GL . glClearDepth ( 1.0F ) ; int [ ] textureOut = new int [ 1 ] ; GL . glGenTextures ( 1 , textureOut ) ; <START_BUG> loadTexture ( getContext ( ) , TextureTab . IMAGE , 0 , textureOut ) ; <END_BUG> texture = textureOut [ 0 ] ; GL . glDepthFunc ( GL_LEQUAL ) ; GL . glPolygonMode ( GL_BACK , GL_FILL ) ; GL . glPolygonMode ( GL_FRONT , GL_LINE ) ; GL . glEnable ( GL_LIST_MODE ) ; GL . glEnable ( GL_TEXTURE_2D ) ; GL . glEnable ( GL_DEPTH_TEST ) ; for ( int x = 0 ; x < 45 ; x ++ ) { for ( int y = 0 ; y < 45 ; y ++ ) { points [ x ] [ y ] [ 0 ] = ( x // 5.0F ) - 4.5F ; points [ x ] [ y ] [ 1 ] = ( y // 5.0F ) - 4.5F ; points [ x ] [ y ] [ 2 ] = ( ( float ) ( Math . sin ( ( ( ( ( ( x // 5.0F ) * 40.0F ) // 360.0F ) * ( Math . PI ) ) * 2 ) ) ) ) ; } } } void renderScene ( ) { } }

Fix:
loadTexture ( getGlCanvas ( ) , TextureTab . IMAGE , 0 , textureOut ) ;
Buggy code:
public class ProjectController { private DatabaseConnector db ; private Mapper < Project > mapper ; public ProjectController ( ) { } public JSONObject create ( String projectInfo ) throws CreationException { } public JSONObject get ( String id ) throws GetException { } @ SuppressWarnings ( "unchecked" ) private Project getProject ( String id ) throws GetException { } public void delete ( String id ) throws DeletionException { } @ SuppressWarnings ( "unchecked" ) public JSONObject searchProjectTags ( String tags ) throws GetException { } public void addFollower ( String projectId , String userId ) throws UpdateException { try { Project project = mapper . get ( UUID . fromString ( projectId ) ) ; if ( project . getIsPrivate ( ) ) { <START_BUG> throw new UpdateException ( "Project<seq2seq4repair_space>can't<seq2seq4repair_space>be<seq2seq4repair_space>followed" ) ; <END_BUG> } List < String > followers = project . getFollowers ( ) ; followers . add ( userId ) ; project . setFollowers ( followers ) ; mapper . save ( project ) ; } catch ( IllegalArgumentException e ) { throw new UpdateException ( "Invalid<seq2seq4repair_space>input<seq2seq4repair_space>data" ) ; } finally { db . close ( ) ; } } public JSONObject update ( String id , String update ) throws UpdateException { } }

Fix:
throw new UpdateException ( "Project<seq2seq4repair_space>is<seq2seq4repair_space>private<seq2seq4repair_space>and<seq2seq4repair_space>can't<seq2seq4repair_space>be<seq2seq4repair_space>followed" ) ;
Buggy code:
public final class UpdateScript { public static void main ( String [ ] args ) { } static void update ( Map < String , List < String > > updateInstructions , String currentVersion ) { List < String > versions = updateInstructions . get ( "VERSIONS" ) ; int currentVersionIndex = versions . indexOf ( currentVersion ) ; int numberOfUpdates = ( ( versions . size ( ) ) - 1 ) - currentVersionIndex ; if ( numberOfUpdates == 0 ) { <START_BUG> Output . print ( "No<seq2seq4repair_space>updates<seq2seq4repair_space>found,<seq2seq4repair_space>ply<seq2seq4repair_space>is<seq2seq4repair_space>^green^up<seq2seq4repair_space>to<seq2seq4repair_space>date^r^!" ) ; <END_BUG> return ; } else { Output . print ( "Found<seq2seq4repair_space>%d<seq2seq4repair_space>updates<seq2seq4repair_space>to<seq2seq4repair_space>ply." , numberOfUpdates ) ; } String plyHome = PlyUtil . INSTALL_DIRECTORY ; File plyHomeDir ; if ( ( plyHome == null ) || ( ! ( ( plyHomeDir = new File ( plyHome ) ) . exists ( ) ) ) ) { Output . print ( "^error^<seq2seq4repair_space>Could<seq2seq4repair_space>not<seq2seq4repair_space>find<seq2seq4repair_space>the<seq2seq4repair_space>PLY_HOME<seq2seq4repair_space>environment<seq2seq4repair_space>variable.<seq2seq4repair_space>Cannot<seq2seq4repair_space>update<seq2seq4repair_space>ply." ) ; throw new SystemExit ( 1 ) ; } File backupTar = UpdateScript . backup ( plyHomeDir , currentVersion ) ; try { for ( int i = currentVersionIndex ; i < ( versions . size ( ) ) ; i ++ ) { String version = versions . get ( i ) ; List < String > instructions = updateInstructions . get ( version ) ; UpdateScript . update ( version , instructions , plyHomeDir ) ; } Output . print ( "Successfully<seq2seq4repair_space>updated<seq2seq4repair_space>ply<seq2seq4repair_space>from<seq2seq4repair_space>^yellow^%s^r^<seq2seq4repair_space>to<seq2seq4repair_space>^green^%s^r^%s!" , currentVersion , versions . get ( ( ( versions . size ( ) ) - 1 ) ) , ( numberOfUpdates > 1 ? String . format ( "<seq2seq4repair_space>(^b^%d^r^<seq2seq4repair_space>updates)" , numberOfUpdates ) : "" ) ) ; } catch ( Exception e ) { Output . print ( e ) ; UpdateScript . restore ( plyHomeDir , backupTar , currentVersion ) ; throw new SystemExit ( 1 , e ) ; } } static void update ( String version , List < String > instructions , File plyHomeDir ) { } static void executeInstruction ( String instruction ) { } static File backup ( File plyHomeDir , String currentVersion ) { } static void restore ( File plyHomeDir , File backupTar , String currentVersion ) { } static ProcessBuilder createProcess ( String execution ) { } static Map < String , List < String > > downloadUpdateInstr ( String updateUrl ) throws SystemExit { } @ SuppressWarnings ( "fallthrough" ) static void updateProperty ( String instruction , File configDirectory ) { } }

Fix:
Output . print ( "No<seq2seq4repair_space>updates<seq2seq4repair_space>needed,<seq2seq4repair_space>ply<seq2seq4repair_space>is<seq2seq4repair_space>already<seq2seq4repair_space>up<seq2seq4repair_space>to<seq2seq4repair_space>date." ) ;
Buggy code:
public final class PeatioAdapters { private PeatioAdapters ( ) { } public static Collection < CurrencyPair > adaptCurrencyPairs ( Market [ ] markets ) { } public static CurrencyPair adaptCurrencyPair ( Market market ) { } public static CurrencyPair adaptCurrencyPair ( String marketId ) { } public static String adaptMarketId ( CurrencyPair currencyPair ) { } public static Ticker adaptTicker ( CurrencyPair currencyPair , MarketTicker ticker ) { } public static OrderBook adaptOrderBook ( CurrencyPair currencyPair , Depth depth ) { } public static List < LimitOrder > adaptLimitOrders ( CurrencyPair currencyPair , OrderType orderType , BigDecimal [ ] [ ] items ) { } public static List < LimitOrder > adaptLimitOrders ( Order [ ] orders ) { } public static List < LimitOrder > adaptLimitOrders ( Market market , Order [ ] orders ) { } public static List < LimitOrder > adaptLimitOrders ( CurrencyPair currencyPair , Order [ ] orders ) { } public static LimitOrder adaptLimitOrder ( Order order ) { } public static LimitOrder adaptLimitOrder ( CurrencyPair currencyPair , Order order ) { } public static OrderType adaptOrderType ( String side ) { } public static String adaptSide ( OrderType orderType ) { } public static Trades adaptTrades ( org . oxerr . peatio . rest . dto [ ] tradeArray ) { List < Trade > tradeList = Arrays . stream ( tradeArray ) . map ( ( trade ) -> adaptTrade ( trade ) ) . collect ( Collectors . toList ( ) ) ; <START_BUG> return new Trades ( tradeList , ( ( tradeList . size ( ) ) > 0 ? new Long ( tradeList . get ( 0 ) . getId ( ) ) : null ) , TradeSortType . SortByID ) ; <END_BUG> } public static Trade adaptTrade ( org . oxerr . peatio . rest . dto . Trade trade ) { } public static AccountInfo adaptMember ( Member member ) { } public static OpenOrders adaptOpenOrders ( Map < Market , Order [ ] > ordersMap ) { } public static UserTrade adaptUserTrade ( CurrencyPair currencyPair , org . oxerr . peatio . rest . dto . Trade trade ) { } public static List < UserTrade > adaptUserTradeList ( Market market , org . oxerr . peatio . rest . dto [ ] trade ) { } public static List < UserTrade > adaptUserTradeList ( CurrencyPair currencyPair , org . oxerr . peatio . rest . dto [ ] trades ) { } public static UserTrades adaptUserTrades ( CurrencyPair currencyPair , org . oxerr . peatio . rest . dto [ ] trades ) { } public static UserTrades adaptUserTrades ( Map < Market , org . oxerr . peatio . rest . dto [ ] > tradesMap ) { } }

Fix:
return new Trades ( tradeList , ( ( tradeList . size ( ) ) > 0 ? Long . valueOf ( tradeList . get ( 0 ) . getId ( ) ) : null ) , TradeSortType . SortByID ) ;
Buggy code:
public class SDSlaveHeartbreatsJob implements Runnable { private SDSlaveIO slaveIO ; private Registry registry ; public SDSlaveHeartbreatsJob ( SDSlaveIO IO , Registry registry ) { } @ Override public void run ( ) { System . out . println ( "Heart<seq2seq4repair_space>beat" ) ; try { SDMasterService masterService = ( ( SDMasterService ) ( registry . lookup ( SDMasterService . class . getCanonicalName ( ) ) ) ) ; <START_BUG> masterService . heartbeat ( "slave" , "localhost" , DEFAULT__SLAVE_REGISTRY_PORT , slaveIO . getChunkNumber ( ) ) ; <END_BUG> } catch ( RemoteException e ) { System . err . println ( "master<seq2seq4repair_space>node<seq2seq4repair_space>error" ) ; } catch ( NotBoundException e ) { System . err . println ( "master<seq2seq4repair_space>service<seq2seq4repair_space>not<seq2seq4repair_space>found" ) ; } } }

Fix:
masterService . heartbeat ( "slave" , "localhost" , DEFAULT__SLAVE_REGISTRY_PORT , slaveIO . getChunkNumber ( ) , true ) ;
Buggy code:
public class CreateEmployee extends JFrame { HotelSystem hs = null ; public CreateEmployee ( HotelSystem hs ) { } @ SuppressWarnings ( "unchecked" ) private void initComponents ( ) { } private void jButton1ActionPerformed ( ActionEvent evt ) { } private void jButton2ActionPerformed ( ActionEvent evt ) { <START_BUG> Login . main ( null ) ; <END_BUG> this . setVisible ( false ) ; } public static void main ( HotelSystem hs ) { } private JCheckBox can_change_room_price ; private JCheckBox can_checkin_occupant ; private JCheckBox can_checkout_occupant ; private JCheckBox can_create_employee ; private JCheckBox can_modify_building ; private JCheckBox can_modify_floor ; private JCheckBox can_modify_room ; private JCheckBox can_see_employee_info ; private JCheckBox can_set_discount ; private JCheckBox can_set_employee_info ; private JCheckBox can_set_occupant ; private JTextField confirm_password ; private JTextField email ; private JTextField first_name ; private JButton jButton1 ; private JButton jButton2 ; private JLabel jLabel1 ; private JLabel jLabel2 ; private JLabel jLabel3 ; private JLabel jLabel4 ; private JLabel jLabel5 ; private JTextField last_name ; private JTextField password ; }

Fix:
MainMenu . main ( hs ) ;
Buggy code:
public class AddFunctionBreakpointActionDelegate extends ActionDelegate implements IViewActionDelegate { private IViewPart fView ; private ISelection fSelection ; private ToggleBreakpointAdapter fDefaultToggleTarget = new ToggleBreakpointAdapter ( ) ; @ Override public void init ( IViewPart view ) { } private void setView ( IViewPart view ) { } protected IViewPart getView ( ) { } @ Override public void selectionChanged ( IAction action , ISelection selection ) { } @ Override public void run ( IAction action ) { IToggleBreakpointsTarget toggleTarget = DebugUITools . getToggleBreakpointsTargetManager ( ) . getToggleBreakpointsTarget ( fView , fSelection ) ; IToggleBreakpointsTargetCExtension cToggleTarget = null ; if ( toggleTarget instanceof IToggleBreakpointsTargetCExtension ) { cToggleTarget = ( ( IToggleBreakpointsTargetCExtension ) ( toggleTarget ) ) ; } else { cToggleTarget = fDefaultToggleTarget ; } try { cToggleTarget . createFunctionBreakpointInteractive ( fView , fSelection ) ; } catch ( CoreException e ) { <START_BUG> CDebugUIPlugin . errorDialog ( ActionMessages . getString ( "AddWatchpointActionDelegate1.0" ) , e ) ; <END_BUG> } } }

Fix:
CDebugUIPlugin . errorDialog ( ActionMessages . getString ( "AddFunctionBreakpointActionDelegate.0" ) , e ) ;
Buggy code:
public class PackageTestSuite { public static void main ( String [ ] args ) { } public static Test suite ( ) { TestSuite suite = new TestSuite ( "IO<seq2seq4repair_space>Utilities" ) ; <START_BUG> suite . addTest ( new TestSuite ( CausedIOExceptionTestCase . class ) ) ; <END_BUG> suite . addTest ( new TestSuite ( CopyUtilsTest . class ) ) ; suite . addTest ( new TestSuite ( DemuxTestCase . class ) ) ; suite . addTest ( new TestSuite ( DirectoryWalkerTestCase . class ) ) ; suite . addTest ( new TestSuite ( EndianUtilsTest . class ) ) ; suite . addTest ( new TestSuite ( FileCleanerTestCase . class ) ) ; suite . addTest ( new TestSuite ( FileDeleteStrategyTestCase . class ) ) ; suite . addTest ( new TestSuite ( FilenameUtilsTestCase . class ) ) ; suite . addTest ( new TestSuite ( FilenameUtilsWildcardTestCase . class ) ) ; suite . addTest ( new TestSuite ( FileSystemUtilsTestCase . class ) ) ; suite . addTest ( new TestSuite ( FileUtilsFileNewerTestCase . class ) ) ; suite . addTest ( new TestSuite ( FileUtilsListFilesTestCase . class ) ) ; suite . addTest ( new TestSuite ( FileUtilsCleanDirectoryTestCase . class ) ) ; suite . addTest ( new TestSuite ( FileUtilsTestCase . class ) ) ; suite . addTest ( new TestSuite ( HexDumpTest . class ) ) ; suite . addTest ( new TestSuite ( IOCaseTestCase . class ) ) ; suite . addTest ( new TestSuite ( IOUtilsCopyTestCase . class ) ) ; suite . addTest ( new TestSuite ( IOUtilsTestCase . class ) ) ; suite . addTest ( new TestSuite ( IOUtilsWriteTestCase . class ) ) ; suite . addTest ( new TestSuite ( LineIteratorTestCase . class ) ) ; suite . addTest ( new TestSuite ( FileUtilsWaitForTestCase . class ) ) ; return suite ; } }

Fix:
suite . addTest ( new TestSuite ( IOExceptionWithCauseTestCase . class ) ) ;
Buggy code:
public class EditDistance { public int minDistance ( String word1 , String word2 ) { if ( word1 . isEmpty ( ) ) { return word2 . length ( ) ; } if ( word2 . isEmpty ( ) ) { return word1 . length ( ) ; } int [ ] [ ] dp = new int [ ( word1 . length ( ) ) + 1 ] [ ( word2 . length ( ) ) + 1 ] ; for ( int row = 0 ; row <= ( word1 . length ( ) ) ; ++ row ) { dp [ row ] [ 0 ] = row ; } for ( int col = 1 ; col <= ( word2 . length ( ) ) ; ++ col ) { dp [ 0 ] [ col ] = col ; } for ( int row = 1 ; row <= ( word1 . length ( ) ) ; ++ row ) { for ( int col = 1 ; col <= ( word2 . length ( ) ) ; ++ col ) { int rowMinus = row - 1 ; int colMinus = col - 1 ; int distByReplace = dp [ rowMinus ] [ colMinus ] ; if ( ( word1 . charAt ( rowMinus ) ) != ( word2 . charAt ( colMinus ) ) ) { ++ distByReplace ; } int distByAdd = ( dp [ row ] [ colMinus ] ) + 1 ; int distByDel = ( dp [ rowMinus ] [ col ] ) + 1 ; <START_BUG> dp [ row ] [ col ] = Math . max ( distByReplace , Math . max ( distByAdd , distByDel ) ) ; <END_BUG> } } return dp [ word1 . length ( ) ] [ word2 . length ( ) ] ; } }

Fix:
dp [ row ] [ col ] = Math . min ( distByReplace , Math . min ( distByAdd , distByDel ) ) ;
Buggy code:
public class MainFragment extends Fragment implements SwipeRefreshLayout . OnRefreshListener , GoogleMap . OnMarkerClickListener , OnMapReadyCallback { private static final String TAG = "MainFragment" ; private View view ; private GoogleMap gMap ; private List < Marker > markers ; private BroadcastReceiver receiver ; private MSwipeRefreshLayout srl ; private FragmentActivity myContext ; @ Override public void onCreate ( Bundle savedInstanceState ) { } @ Override public void onAttach ( Activity activity ) { } @ Override public View onCreateView ( LayoutInflater inflater , @ Nullable ViewGroup container , @ Nullable Bundle savedInstanceState ) { } @ Override public void onDestroy ( ) { } @ Override public void onMapReady ( GoogleMap googleMap ) { } private void updateMarkersOnMap ( ) { } private boolean isDiscoverModeEnabled ( ) { <START_BUG> SharedPreferences preferences = PreferenceManager . getDefaultSharedPreferences ( getActivity ( ) ) ; <END_BUG> boolean discoverMode = preferences . getBoolean ( "discoverMode" , true ) ; return discoverMode ; } @ Override public boolean onMarkerClick ( Marker selectedMarker ) { } @ Override public void onRefresh ( ) { } }

Fix:
SharedPreferences preferences = PreferenceManager . getDefaultSharedPreferences ( PlacesApplication . getPlacesAppContext ( ) ) ;
Buggy code:
public class BackgroundGpsPlugin extends CordovaPlugin { Messenger mService = null ; boolean mIsBound = false ; TextView mCallbackText ; class IncomingHandler extends Handler { @ Override public void handleMessage ( Message msg ) { } } final Messenger mMessenger = new Messenger ( new BackgroundGpsPlugin . IncomingHandler ( ) ) ; private ServiceConnection mConnection = new ServiceConnection ( ) { public void onServiceConnected ( ComponentName className , IBinder service ) { } public void onServiceDisconnected ( ComponentName className ) { } } ; private enum Event { ACTIVATE , DEACTIVATE , FAILURE , RUNINBACKGROUND , RUNINFOREGROUND , MESSAGE ; } private static final String JS_NAMESPACE = "window.plugins.backgroundGeoLocation" ; private static final String TAG = "BackgroundGpsPlugin" ; public static final String ACTION_START = "start" ; public static final String ACTION_STOP = "stop" ; public static final String ACTION_CONFIGURE = "configure" ; public static final String ACTION_SET_CONFIG = "setConfig" ; private Intent updateServiceIntent ; private Boolean isEnabled = false ; private String url ; private String params ; private String headers ; private String stationaryRadius = "30" ; private String desiredAccuracy = "100" ; private String distanceFilter = "30" ; private String locationTimeout = "60" ; private String isDebugging = "false" ; private String notificationTitle = "Background<seq2seq4repair_space>tracking" ; private String notificationText = "ENABLED" ; private String stopOnTerminate = "false" ; public boolean execute ( String action , JSONArray data , CallbackContext callbackContext ) { } @ Override public void onPause ( boolean multitasking ) { } @ Override public void onResume ( boolean multitasking ) { } @ Override public int onStartCommand ( Intent intent , int flags , int startId ) { <START_BUG> super . onStartCommand ( Intent , flags , startId ) ; <END_BUG> fireEvent ( BackgroundGpsPlugin . Event . MESSAGE , "StartBackGroundActivity" ) ; return START_REDELIVER_INTENT ; } public void onDestroy ( ) { } private void fireEvent ( BackgroundGpsPlugin . Event event , String params ) { } private void geolocationfound ( String params ) { } }

Fix:
super . onStartCommand ( intent , flags , startId ) ;
Buggy code:
public class CompilerAdapter { private static final Set DEFAULT__AJDE_WARNINGS ; private AjBuildManager buildManager = null ; private IMessageHandler messageHandler = null ; private BuildNotifierAdapter currNotifier = null ; private boolean initialized = false ; private boolean structureDirty = true ; private boolean showInfoMessages = false ; private boolean nextBuild = false ; public CompilerAdapter ( ) { } public void showInfoMessages ( boolean show ) { } public boolean getShowInfoMessages ( ) { } public void nextBuildFresh ( ) { } public void requestCompileExit ( ) { } public boolean isStructureDirty ( ) { } public void setStructureDirty ( boolean structureDirty ) { } public boolean compile ( String configFile , BuildProgressMonitor progressMonitor , boolean buildModel ) { } public AjBuildConfig genBuildConfig ( String configFilePath ) { } protected void signalText ( String text ) { } protected void signalThrown ( Throwable t ) { } private static boolean configureBuildOptions ( AjBuildConfig config , BuildOptionsAdapter options , IMessageHandler handler ) { } private static void disableWarnings ( Map options ) { } private static void enableWarnings ( Map options , Set warnings ) { } private static List tokenizeString ( String str ) { } private static boolean configureNonStandardOptions ( AjBuildConfig config , String nonStdOptions , IMessageHandler messageHandler ) { } private void configureProjectOptions ( AjBuildConfig config , ProjectPropertiesAdapter properties ) { } void join ( Collection target , Collection source ) { } private void init ( ) { } class MessageHandlerAdapter extends MessageHandler { private TaskListManager taskListManager ; public MessageHandlerAdapter ( ) { } public boolean handleMessage ( IMessage message ) throws AbortException { IMessage . Kind kind = message . getKind ( ) ; if ( kind == ( IMessage . ABORT ) ) return handleAbort ( message ) ; if ( ( isIgnoring ( kind ) ) || ( ( ! ( showInfoMessages ) ) && ( INFO . equals ( kind ) ) ) ) { return true ; } taskListManager . addSourcelineTask ( message ) ; <START_BUG> return super . handleMessage ( message ) ; <END_BUG> } private boolean handleAbort ( IMessage abortMessage ) { } } public void setState ( AjState buildState ) { } public IMessageHandler getMessageHandler ( ) { } public boolean wasFullBuild ( ) { } }

Fix:
return true ;
Buggy code:
@ Plugin ( id = "MChat" , name = "MChat" , version = VersionUtil . VERSION , dependencies = "after:GeoIPTools,Heroes,Towny,Vault,SimpleClans2,SimpleClansChat;" ) public class MChat { @ Subscribe public void onEnable ( ServerStartingEvent event ) { } @ Subscribe public void onDisable ( ServerStoppingEvent event ) { Timer timer = new Timer ( ) ; <START_BUG> event . getGame ( ) . getScheduler ( ) . getScheduledTasks ( ) . clear ( ) ; <END_BUG> ConfigManager . unload ( ) ; timer . stop ( ) ; long diff = timer . difference ( ) ; MessageUtil . log ( ( ( ( ( "[MChat]<seq2seq4repair_space>MChat<seq2seq4repair_space>v" + ( VersionUtil . VERSION ) ) + "<seq2seq4repair_space>is<seq2seq4repair_space>disabled!<seq2seq4repair_space>[" ) + diff ) + "ms]" ) ) ; } private void registerEvents ( EventManager mn ) { } private void setupCommands ( CommandService cd ) { } private void regCommands ( CommandService cd , CommandCallable callable , String ... aliases ) { } private void initializeClasses ( ) { } No newline ; at end ; of file ; }

Fix:
event . getGame ( ) . getSyncScheduler ( ) . getScheduledTasks ( ) . clear ( ) ;
Buggy code:
public class RemoveMentionFilter implements StatusFilter { private static final Logger log = Logger . getLogger ( RemoveMentionFilter . class . getName ( ) ) ; public String filter ( String input ) { input = input . replaceAll ( "\\n" , "" ) ; input = input . replaceAll ( "\\r" , "" ) ; if ( ( ( input . matches ( "\\s*@\\w+.*" ) ) || ( input . matches ( "\\s*\".*" ) ) ) || ( ( input . matches ( ".*([RrQq][Tt])+.*" ) ) && ( ! ( input . matches ( "\\s*([RrQq][Tt]).*" ) ) ) ) ) { RemoveMentionFilter . log . info ( ( ( "Dropped<seq2seq4repair_space>" + input ) + "<seq2seq4repair_space>with<seq2seq4repair_space>@somebody<seq2seq4repair_space>or<seq2seq4repair_space>\"<seq2seq4repair_space>at<seq2seq4repair_space>first" ) ) ; return null ; } else { <START_BUG> return input . replaceAll ( "\\s*([RrQq][Tt])*\\s*@\\w+(?!\\.\\w+)[\\s:]*" , "<seq2seq4repair_space>" ) ; <END_BUG> } } }

Fix:
return input . replaceAll ( "\\s*([RrQq][Tt])*\\s*@\\w+[\\s:]*" , "<seq2seq4repair_space>" ) ;
Buggy code:
public class Master { private Name origin ; private BufferedReader br ; private File file ; private Record last = null ; private int defaultTTL = 3600 ; private Master included = null ; Master ( File _file , Name defaultOrigin ) throws IOException { } public Master ( String filename , Name origin ) throws IOException { } public Master ( String filename ) throws IOException { } public Master ( BufferedReader in , Name defaultOrigin ) { } public Master ( BufferedReader in ) { } public Record nextRecord ( ) throws IOException { } private Name parseOrigin ( MyStringTokenizer st ) throws IOException { } private int parseTTL ( MyStringTokenizer st ) throws IOException { } private void parseInclude ( MyStringTokenizer st ) throws IOException { } private Record parseRR ( MyStringTokenizer st , boolean useLast , Record last , Name origin ) throws IOException { Name name ; int ttl ; short type ; short dclass ; if ( ! useLast ) name = Name . fromString ( st . nextToken ( ) , origin ) ; else name = last . getName ( ) ; String s = st . nextToken ( ) ; try { ttl = TTL . parseTTL ( s ) ; s = st . nextToken ( ) ; } catch ( NumberFormatException e ) { if ( ( ! useLast ) || ( last == null ) ) ttl = defaultTTL ; else ttl = last . getTTL ( ) ; } if ( ( dclass = DClass . value ( s ) ) > 0 ) s = st . nextToken ( ) ; else dclass = DClass . IN ; if ( ( type = Type . value ( s ) ) < 0 ) <START_BUG> throw new IOException ( "Parse<seq2seq4repair_space>error" ) ; <END_BUG> return Record . fromString ( name , type , dclass , ttl , st , origin ) ; } private static String stripTrailing ( String s ) { } public static String readExtendedLine ( BufferedReader br ) throws IOException { } }

Fix:
throw new IOException ( ( ( "Parse<seq2seq4repair_space>error:<seq2seq4repair_space>invalid<seq2seq4repair_space>type<seq2seq4repair_space>'" + s ) + "'" ) ) ;
Buggy code:
public class Map { TileManager tiles = new TileManager ( ) ; public Map ( ) { } public void init ( ) { BufferedImage map = null ; try { map = loadImageFrom . LoadImageFrom ( Main . class , "map.png" ) ; } catch ( Exception e ) { } for ( int x = 0 ; x < 100 ; x ++ ) { for ( int y = 0 ; y < 100 ; y ++ ) { int col = map . getRGB ( x , y ) ; switch ( col & 16777215 ) { case 8421504 : <START_BUG> tiles . blocks . add ( new Block ( new Vector2F ( ( x * 32 ) , ( y * 32 ) ) . STONE_1 ) ) ; <END_BUG> break ; } } } } public void tick ( double deltaTime ) { } public void render ( Graphics2D g ) { } }

Fix:
tiles . blocks . add ( new Block ( new Vector2F ( ( x * 48 ) , ( y * 48 ) ) , BlockType . STONE_1 ) ) ;
Buggy code:
public class LogFragment extends Fragment { public static final String TAG = "AKAKAKADOUHF" ; public LogFragment . ViewHolder _views ; private LogOpenHelper sqlLogger ; private LogFragment . LogObserver logObserver ; private ThreadHandler updaterThread ; public static LogFragment newInstance ( Bundle bundle ) { } @ Override public void onActivityCreated ( @ Nullable Bundle savedInstanceState ) { } @ Override public View onCreateView ( LayoutInflater inflater , ViewGroup container , Bundle savedInstanceState ) { } @ Override public void onStart ( ) { } @ Override public void onStop ( ) { } private class GetAllEntries implements Runnable { @ Override public void run ( ) { final String out = sqlLogger . getAllEntries ( ) ; <START_BUG> if ( out != null ) <END_BUG> getActivity ( ) . runOnUiThread ( new LogFragment . ScrollViewUpdater ( out ) ) ; } } private class ScrollViewUpdater implements Runnable { String text ; public ScrollViewUpdater ( String in ) { } @ Override public void run ( ) { { _views . scrollView . post ( new Runnable ( ) { @ Override public void run ( ) { _views . textView . append ( text ) ; _views . scrollView . post ( new LogFragment . ScrollToBottom ( ) ) ; } } ) ; } } } private static class ViewHolder { public TextView textView ; public ScrollView scrollView ; } protected class ScrollToBottom implements Runnable { @ Override public void run ( ) { _views . scrollView . fullScroll ( FOCUS_DOWN ) ; } } public class LogObserver implements Observer { @ Override public void update ( Observable observable , Object data ) { } } private class ContentChangedRunnable implements Runnable { Long entry ; public ContentChangedRunnable ( Long K ) { } @ Override public void run ( ) { _views . scrollView . post ( new LogFragment . ScrollViewUpdater ( sqlLogger . getEntry ( entry ) ) ) ; } } }

Fix:
if ( ( out != null ) && ( ( getActivity ( ) ) != null ) )
Buggy code:
public class AccessInterceptor extends BaseInterceptor { ContextManager cm ; int secMapNote ; int reqRolesNote ; int reqTransportNote ; public AccessInterceptor ( ) { } public void engineInit ( ContextManager cm ) throws TomcatException { } public void contextInit ( Context ctx ) throws TomcatException { } public void removeContainer ( Container ct ) throws TomcatException { } public void addContainer ( Container ct ) throws TomcatException { } public int requestMap ( Request req ) { } public int authorize ( Request req , Response response , String [ ] roles ) { if ( ( roles == null ) || ( ( roles . length ) == 0 ) ) { return OK ; } String user = req . getRemoteUser ( ) ; if ( user == null ) return DECLINED ; if ( ( debug ) > 0 ) log ( ( ( ( ( ( "Controled<seq2seq4repair_space>access<seq2seq4repair_space>for<seq2seq4repair_space>" + user ) + "<seq2seq4repair_space>" ) + req ) + "<seq2seq4repair_space>" ) + ( req . getContainer ( ) ) ) ) ; String [ ] userRoles = req . getUserRoles ( ) ; if ( userRoles == null ) return DECLINED ; for ( int i = 0 ; i < ( userRoles . length ) ; i ++ ) { <START_BUG> for ( int j = 0 ; j < ( roles . length ) ; i ++ ) <END_BUG> if ( ( ( userRoles [ i ] ) != null ) && ( userRoles [ i ] . equals ( roles [ j ] ) ) ) return OK ; } if ( ( debug ) > 0 ) log ( ( "UnAuthorized<seq2seq4repair_space>" + ( roles [ 0 ] ) ) ) ; return DECLINED ; } boolean match ( Container ct , String path , String method ) { } }

Fix:
for ( int j = 0 ; j < ( roles . length ) ; j ++ )
Buggy code:
public class CommandLineArgumentUsageImpl extends CommandLineArgumentUsage { public static void init ( ) { } public static void printUsage ( final PrintStream out ) { CommandLineArgumentUsageImpl . init ( ) ; <START_BUG> out . print ( usage ( ) ) ; <END_BUG> } }

Fix:
out . print ( usage ( "appclient" ) ) ;