nus-yam/ex-repair huggingface dataset:
Buggy code:
public class ARecord extends Record { private int addr ; ARecord ( ) { } Record getObject ( ) { } private static final int fromArray ( byte [ ] array ) { } private static final byte [ ] toArray ( int addr ) { } public ARecord ( Name name , int dclass , long ttl , InetAddress address ) { } void rrFromWire ( DNSInput in ) throws IOException { } void rdataFromString ( Tokenizer st , Name origin ) throws IOException { String s = st . getString ( ) ; byte [ ] array = Address . toByteArray ( s , IPv4 ) ; if ( array == null ) <START_BUG> throw st . exception ( "invalid<seq2seq4repair_space>dotted<seq2seq4repair_space>quad" ) ; <END_BUG> addr = ARecord . fromArray ( array ) ; } String rrToString ( ) { } public InetAddress getAddress ( ) { } void rrToWire ( DNSOutput out , Compression c , boolean canonical ) { } }

Fix:
throw st . exception ( ( "invalid<seq2seq4repair_space>dotted<seq2seq4repair_space>quad:" + s ) ) ;
Buggy code:
public class QRDecomposition { private double [ ] [ ] qrt ; private double [ ] rDiag ; private RealMatrix cachedQ ; private RealMatrix cachedQT ; private RealMatrix cachedR ; private RealMatrix cachedH ; private final double threshold ; public QRDecomposition ( RealMatrix matrix ) { } public QRDecomposition ( RealMatrix matrix , double threshold ) { } protected void decompose ( double [ ] [ ] matrix ) { } protected void performHouseholderReflection ( int minor , double [ ] [ ] matrix ) { } public RealMatrix getR ( ) { } public RealMatrix getQ ( ) { } public RealMatrix getQT ( ) { } public RealMatrix getH ( ) { } public DecompositionSolver getSolver ( ) { } private static class Solver implements DecompositionSolver { private final double [ ] [ ] qrt ; private final double [ ] rDiag ; private final double threshold ; private Solver ( final double [ ] [ ] qrt , final double [ ] rDiag , final double threshold ) { } public boolean isNonSingular ( ) { } public RealVector solve ( RealVector b ) { } public RealMatrix solve ( RealMatrix b ) { } public RealMatrix getInverse ( ) { <START_BUG> return solve ( MatrixUtils . createRealIdentityMatrix ( rDiag . length ) ) ; <END_BUG> } } }

Fix:
return solve ( MatrixUtils . createRealIdentityMatrix ( qrt [ 0 ] . length ) ) ;
Buggy code:
public class DormandPrince853StepInterpolatorTest { @ Test public void derivativesConsistency ( ) { } @ Test public void serialization ( ) throws IOException , ClassNotFoundException { } @ Test public void checklone ( ) { TestProblem3 pb = new TestProblem3 ( 0.9 ) ; double minStep = 0 ; double maxStep = ( pb . getFinalTime ( ) ) - ( pb . getInitialTime ( ) ) ; double scalAbsoluteTolerance = 1.0E-8 ; double scalRelativeTolerance = scalAbsoluteTolerance ; DormandPrince853Integrator integ = new DormandPrince853Integrator ( minStep , maxStep , scalAbsoluteTolerance , scalRelativeTolerance ) ; integ . addStepHandler ( new StepHandler ( ) { public void handleStep ( StepInterpolator interpolator , boolean isLast ) { StepInterpolator cloned = interpolator . copy ( ) ; double tA = cloned . getPreviousTime ( ) ; double tB = cloned . getCurrentTime ( ) ; double halfStep = ( FastMath . abs ( ( tB - tA ) ) ) // 2 ; Assert . assertEquals ( interpolator . getPreviousTime ( ) , tA , 1.0E-12 ) ; Assert . assertEquals ( interpolator . getCurrentTime ( ) , tB , 1.0E-12 ) ; for ( int i = 0 ; i < 10 ; ++ i ) { double t = ( ( i * tB ) + ( ( 9 - i ) * tA ) ) // 9 ; interpolator . setInterpolatedTime ( t ) ; Assert . assertTrue ( ( ( FastMath . abs ( ( ( cloned . getInterpolatedTime ( ) ) - t ) ) ) > ( halfStep // 10 ) ) ) ; cloned . setInterpolatedTime ( t ) ; Assert . assertEquals ( t , cloned . getInterpolatedTime ( ) , 1.0E-12 ) ; double [ ] referenceState = interpolator . getInterpolatedState ( ) ; double [ ] cloneState = cloned . getInterpolatedState ( ) ; for ( int j = 0 ; j < ( referenceState . length ) ; ++ j ) { Assert . assertEquals ( referenceState [ j ] , cloneState [ j ] , 1.0E-12 ) ; } } } <START_BUG> public void reset ( ) { <END_BUG> } } ) ; integ . integrate ( pb , pb . getInitialTime ( ) , pb . getInitialState ( ) , pb . getFinalTime ( ) , new double [ pb . getDimension ( ) ] ) ; } }

Fix:
public void init ( double t0 , double [ ] y0 , double t ) {
Buggy code:
public abstract class WicketTestCase extends TestCase { public MockWebApplication application ; public WicketTestCase ( String name ) { } protected void setUp ( ) throws Exception { } protected void executeTest ( final Class pageClass , final String filename ) throws Exception { System . out . println ( ( ( "===<seq2seq4repair_space>" + ( pageClass . getName ( ) ) ) + "<seq2seq4repair_space>===" ) ) ; <START_BUG> application . getRequiredPageSettings ( ) . setHomePage ( pageClass ) ; <END_BUG> application . setupRequestAndResponse ( ) ; application . processRequestCycle ( ) ; assertEquals ( pageClass , application . getLastRenderedPage ( ) . getClass ( ) ) ; String document = application . getServletResponse ( ) . getDocument ( ) ; assertTrue ( DiffUtil . validatePage ( document , this . getClass ( ) , filename ) ) ; } }

Fix:
application . setHomePage ( pageClass ) ;
Buggy code:
@ Service public class MolgenisSecurityWebAppDatabasePopulatorServiceImpl implements MolgenisSecurityWebAppDatabasePopulatorService { private static final String USERNAME_ADMIN = "admin" ; @ Value ( "${admin.password:@null}" ) private String adminPassword ; @ Value ( "${admin.email:molgenis+admin@gmail.com}" ) private String adminEmail ; @ Value ( "${anonymous.email:molgenis+anonymous@gmail.com}" ) private String anonymousEmail ; private MolgenisUser userAdmin ; private MolgenisUser anonymousUser ; private MolgenisGroup allUsersGroup ; @ Override @ Transactional @ RunAsSystem public void populateDatabase ( DataService dataService , String homeControllerId ) { if ( ( adminPassword ) == null ) throw new RuntimeException ( "please<seq2seq4repair_space>configure<seq2seq4repair_space>the<seq2seq4repair_space>admin.password<seq2seq4repair_space>property<seq2seq4repair_space>in<seq2seq4repair_space>your<seq2seq4repair_space>molgenis-server.properties" ) ; userAdmin = new MolgenisUser ( ) ; userAdmin . setUsername ( MolgenisSecurityWebAppDatabasePopulatorServiceImpl . USERNAME_ADMIN ) ; userAdmin . setPassword ( adminPassword ) ; userAdmin . setEmail ( adminEmail ) ; userAdmin . setActive ( true ) ; userAdmin . setSuperuser ( true ) ; userAdmin . setChangePassword ( false ) ; dataService . add ( ENTITY_NAME , userAdmin ) ; anonymousUser = new MolgenisUser ( ) ; anonymousUser . setUsername ( ANONYMOUS_USERNAME ) ; anonymousUser . setPassword ( ANONYMOUS_USERNAME ) ; anonymousUser . setEmail ( anonymousEmail ) ; anonymousUser . setActive ( true ) ; <START_BUG> anonymousUser . setSuperuser ( true ) ; <END_BUG> anonymousUser . setChangePassword ( false ) ; dataService . add ( ENTITY_NAME , anonymousUser ) ; UserAuthority anonymousAuthority = new UserAuthority ( ) ; anonymousAuthority . setMolgenisUser ( anonymousUser ) ; anonymousAuthority . setRole ( AUTHORITY_ANONYMOUS ) ; dataService . add ( UserAuthority . ENTITY_NAME , anonymousAuthority ) ; allUsersGroup = new MolgenisGroup ( ) ; allUsersGroup . setName ( ALL_USER_GROUP ) ; dataService . add ( MolgenisGroup . ENTITY_NAME , allUsersGroup ) ; GroupAuthority usersGroupHomeAuthority = new GroupAuthority ( ) ; usersGroupHomeAuthority . setMolgenisGroup ( allUsersGroup ) ; usersGroupHomeAuthority . setRole ( ( ( SecurityUtils . AUTHORITY_PLUGIN_READ_PREFIX ) + ( homeControllerId . toUpperCase ( ) ) ) ) ; dataService . add ( GroupAuthority . ENTITY_NAME , usersGroupHomeAuthority ) ; GroupAuthority usersGroupUserAccountAuthority = new GroupAuthority ( ) ; usersGroupUserAccountAuthority . setMolgenisGroup ( allUsersGroup ) ; usersGroupUserAccountAuthority . setRole ( ( ( SecurityUtils . AUTHORITY_PLUGIN_WRITE_PREFIX ) + ( ID . toUpperCase ( ) ) ) ) ; dataService . add ( GroupAuthority . ENTITY_NAME , usersGroupUserAccountAuthority ) ; } @ Override public MolgenisUser getAnonymousUser ( ) { } @ Override public MolgenisUser getUserAdmin ( ) { } @ Override public MolgenisGroup getAllUsersGroup ( ) { } No newline ; at end ; of file ; }

Fix:
anonymousUser . setSuperuser ( false ) ;
Buggy code:
public class TestReverseStringFilter extends BaseTokenStreamTestCase { public void testFilter ( ) throws Exception { } public void testFilterWithMark ( ) throws Exception { } public void testReverseString ( ) throws Exception { } public void testReverseChar ( ) throws Exception { } public void testReverseSupplementary ( ) throws Exception { } public void testReverseSupplementaryChar ( ) throws Exception { } public void testRandomStrings ( ) throws Exception { Analyzer a = new Analyzer ( ) { @ Override protected TokenStreamComponents createComponents ( String fieldName , Reader reader ) { Tokenizer tokenizer = new MockTokenizer ( reader , MockTokenizer . WHITESPACE , false ) ; return new TokenStreamComponents ( tokenizer , new ReverseStringFilter ( TEST_VERSION_CURRENT , tokenizer ) ) ; } } ; <START_BUG> checkRandomData ( random ( ) , a , ( 10000 * ( RANDOM_MULTIPLIER ) ) ) ; <END_BUG> } public void testEmptyTerm ( ) throws IOException { } }

Fix:
checkRandomData ( random ( ) , a , ( 1000 * ( RANDOM_MULTIPLIER ) ) ) ;
Buggy code:
public class RecipeRecommendationDAO { final RecipeDAO recipeDAO = DAOManager . createRecipeDAO ( ) ; final UserFavoriteRecipeDAO favoriteRecipeDAO = DAOManager . createUserFavoriteRecipeDAO ( ) ; final UserProfileDAO userProfileDAO = DAOManager . createUserProfileDAO ( ) ; final ReicpesRecommendationGenerator reicpesRecommendationGenerator = new ReicpesRecommendationGenerator ( ) ; public List < Recipe > getUserRecipeRecommendation ( String userId ) { } private List < Recipe > getUserRecommendation ( String userId ) { List < Recipe > recipes = null ; List < UserFavoriteRecipe > favoriteList = getUserFavoriteRecipes ( userId ) ; Integer threshold = 10 ; if ( favoriteList . isEmpty ( ) ) { recipes = getPopularRecipes ( ) ; } else { List < UserFavoriteRecipe > userFavoriteRecipes = getUserFavoriteRecipes ( userId ) ; List < UserFavoriteRecipe > otherUserFavoriteRecipes = getAllUserFavoriteRecipesExpcept ( userId ) ; List < Integer > recipesId = reicpesRecommendationGenerator . generateRecommendations ( userId , userFavoriteRecipes , otherUserFavoriteRecipes ) ; recipes = getRecipes ( recipesId , threshold ) ; <START_BUG> if ( ( recipes . isEmpty ( ) ) && ( ( recipes . size ( ) ) < threshold ) ) { <END_BUG> recipes . addAll ( getPopularRecipes ( ) ) ; } } return recipes ; } private List < Recipe > getPopularRecipes ( ) { } private List < UserFavoriteRecipe > getUserFavoriteRecipes ( String userId ) { } private List < UserFavoriteRecipe > getAllUserFavoriteRecipesExpcept ( String userId ) { } private List < Recipe > getRecipes ( List < Integer > recipesId , Integer threshold ) { } }

Fix:
if ( ( recipes . isEmpty ( ) ) || ( ( recipes . size ( ) ) < threshold ) ) {
Buggy code:
public class Timer extends BukkitRunnable { private final Main pl ; public Timer ( Main pl ) { } Date d = new Date ( ) ; @ SuppressWarnings ( "deprecation" ) @ Override public void run ( ) { ( pl . ticks ) ++ ; if ( ( ( pl . ticks ) % 20 ) == 0 ) { if ( ( ( d . getMinutes ( ) ) == 50 ) && ( ( d . getSeconds ( ) ) == 0 ) ) { Bukkit . broadcastMessage ( ( ( ChatColor . GREEN ) + "Det<seq2seq4repair_space>er<seq2seq4repair_space>10<seq2seq4repair_space>minutter<seq2seq4repair_space>til<seq2seq4repair_space>raid<seq2seq4repair_space>starter!" ) ) ; } if ( ( ( d . getMinutes ( ) ) == 59 ) && ( ( d . getSeconds ( ) ) == 0 ) ) { Bukkit . broadcastMessage ( ( ( ChatColor . GREEN ) + "Det<seq2seq4repair_space>er<seq2seq4repair_space>1<seq2seq4repair_space>minutt<seq2seq4repair_space>til<seq2seq4repair_space>raid<seq2seq4repair_space>starter!" ) ) ; } if ( ( ( d . getMinutes ( ) ) == 59 ) && ( ( d . getSeconds ( ) ) == 30 ) ) { Bukkit . broadcastMessage ( ( ( ChatColor . GREEN ) + "Det<seq2seq4repair_space>er<seq2seq4repair_space>30<seq2seq4repair_space>sekunder<seq2seq4repair_space>til<seq2seq4repair_space>raid<seq2seq4repair_space>starter!" ) ) ; } if ( ( ( d . getMinutes ( ) ) == 59 ) && ( ( d . getSeconds ( ) ) == 57 ) ) { Bukkit . broadcastMessage ( ( ( ChatColor . GREEN ) + "Det<seq2seq4repair_space>er<seq2seq4repair_space>3<seq2seq4repair_space>sekunder<seq2seq4repair_space>til<seq2seq4repair_space>raid<seq2seq4repair_space>starter!" ) ) ; } <START_BUG> if ( ( d . getMinutes ( ) ) == 0 ) { <END_BUG> if ( ! ( pl . isRaiding ) ) { pl . isRaiding = true ; Bukkit . broadcastMessage ( ( ( ChatColor . GREEN ) + "Raid<seq2seq4repair_space>har<seq2seq4repair_space>started<seq2seq4repair_space>og<seq2seq4repair_space>varer<seq2seq4repair_space>i<seq2seq4repair_space>1<seq2seq4repair_space>time!" ) ) ; for ( Player p : Bukkit . getOnlinePlayers ( ) ) { p . playSound ( p . getLocation ( ) , ENDERDRAGON_GROWL , 1 , 1 ) ; } } } else { if ( ( pl . isRaiding ) == true ) { pl . isRaiding = false ; Bukkit . broadcastMessage ( ( ( ChatColor . GREEN ) + "Raid<seq2seq4repair_space>er<seq2seq4repair_space>skrudd<seq2seq4repair_space>av!" ) ) ; } } } if ( ( ( pl . ticks ) % ( 20L * 1 ) ) == 0 ) { } if ( ( ( pl . ticks ) % ( 20L * 30 ) ) == 0 ) { } if ( ( ( pl . ticks ) % ( 20L * 60 ) ) == 0 ) { } if ( ( ( pl . ticks ) % ( ( 20L * 60 ) * 5 ) ) == 0 ) { } if ( ( ( pl . ticks ) % ( ( 20L * 60 ) * 15 ) ) == 0 ) { } } No newline ; at end ; of file ; }

Fix:
if ( ( ( d . getHours ( ) ) == 18 ) && ( ( d . getMinutes ( ) ) == 0 ) ) {
Buggy code:
public class TrackScheduler extends Thread { private YTJBServer server ; private boolean running ; private MusicPlayer player ; private MusicTrack current ; private Semaphore playableTrack = new Semaphore ( 0 ) ; private Semaphore playerAvailable = new Semaphore ( 0 ) ; public TrackScheduler ( YTJBServer server ) { } public void notifyPlayableTrack ( ) { } public void notifyPlayerAvailable ( ) { } public synchronized void setRunning ( boolean r ) { } public boolean skip ( ) { } public boolean pauseResume ( ) { } public boolean seekForward ( ) { } public boolean seekBackward ( ) { ArrayList < String > args = new ArrayList < String > ( ) ; <START_BUG> args . add ( ( "" + true ) ) ; <END_BUG> server . notifyClients ( SEEKNOTIFY , args ) ; return player . seekBackward ( ) ; } public boolean isPlaying ( ) { } public MusicTrack getCurrentTrack ( ) { } @ Override public void run ( ) { } }

Fix:
args . add ( ( "" + false ) ) ;
Buggy code:
public class DeleteElementsOperation extends MultiOperation { protected Map fChildrenToRemove ; protected DOMFactory fFactory ; public DeleteElementsOperation ( IJavaElement [ ] elementsToDelete , boolean force ) { } protected String getMainTaskName ( ) { } protected void groupElements ( ) throws JavaModelException { } protected void processElement ( IJavaElement element ) throws JavaModelException { } protected void processElements ( ) throws JavaModelException { } protected void verify ( IJavaElement element ) throws JavaModelException { IJavaElement [ ] children = ( ( IRegion ) ( fChildrenToRemove . get ( element ) ) ) . getElements ( ) ; for ( int i = 0 ; i < ( children . length ) ; i ++ ) { IJavaElement child = children [ i ] ; <START_BUG> if ( ( child . getResource ( ) ) != null ) <END_BUG> error ( IJavaModelStatusConstants . INVALID_ELEMENT_TYPES , child ) ; if ( child . isReadOnly ( ) ) error ( IJavaModelStatusConstants . READ_ONLY , child ) ; } } }

Fix:
if ( ( child . getCorrespondingResource ( ) ) != null )
Buggy code:
public class Event { private HashMap < String , String > myFields = new HashMap < String , String > ( ) ; public static final String dateFormat = "yyyy-MM-dd<seq2seq4repair_space>HH:mm:ss" ; public Event ( HashMap < String , String > map ) { } public String get ( String key ) { String toReturn = myFields . get ( key ) ; if ( toReturn == null ) { <START_BUG> throw new TivooEventKeywordNotFound ( key ) ; <END_BUG> } else { return toReturn ; } } public boolean containsKeyword ( String key , String keyword ) { } public boolean containsKeywordInAllFields ( String keyword ) { } }

Fix:
throw new TivooEventKeywordNotFound ( String . format ( "%s<seq2seq4repair_space>is<seq2seq4repair_space>not<seq2seq4repair_space>found<seq2seq4repair_space>in<seq2seq4repair_space>field" , key ) ) ;
Buggy code:
public class VoiceCallActivity extends CallActivity implements OnClickListener { private LinearLayout comingBtnContainer ; private Button hangupBtn ; private Button refuseBtn ; private Button answerBtn ; private ImageView muteImage ; private ImageView handsFreeImage ; private boolean isMuteState ; private boolean isHandsfreeState ; private TextView callStateTextView ; private int streamID ; private boolean endCallTriggerByMe = false ; private Handler handler = new Handler ( ) ; private TextView nickTextView ; private TextView durationTextView ; private Chronometer chronometer ; String st1 ; private boolean isAnswered ; private LinearLayout voiceContronlLayout ; @ Override protected void onCreate ( Bundle savedInstanceState ) { } void addCallStateListener ( ) { } @ Override public void onClick ( View v ) { switch ( v . getId ( ) ) { case id . btn_refuse_call : refuseBtn . setEnabled ( false ) ; if ( ( ringtone ) != null ) ringtone . stop ( ) ; try { EMChatManager . getInstance ( ) . rejectCall ( ) ; } catch ( Exception e1 ) { e1 . printStackTrace ( ) ; saveCallRecord ( 0 ) ; finish ( ) ; } callingState = CallingState . REFUESD ; break ; case id . btn_answer_call : answerBtn . setEnabled ( false ) ; if ( ( ringtone ) != null ) ringtone . stop ( ) ; if ( isInComingCall ) { try { callStateTextView . setText ( "正在接听..." ) ; EMChatManager . getInstance ( ) . answerCall ( ) ; isAnswered = true ; } catch ( Exception e ) { e . printStackTrace ( ) ; saveCallRecord ( 0 ) ; finish ( ) ; return ; } } comingBtnContainer . setVisibility ( INVISIBLE ) ; hangupBtn . setVisibility ( VISIBLE ) ; voiceContronlLayout . setVisibility ( VISIBLE ) ; closeSpeakerOn ( ) ; break ; case id . btn_hangup_call : hangupBtn . setEnabled ( false ) ; if ( ( soundPool ) != null ) soundPool . stop ( streamID ) ; chronometer . stop ( ) ; endCallTriggerByMe = true ; <START_BUG> callStateTextView . setText ( "正在挂断..." ) ; <END_BUG> try { EMChatManager . getInstance ( ) . endCall ( ) ; } catch ( Exception e ) { e . printStackTrace ( ) ; saveCallRecord ( 0 ) ; finish ( ) ; } break ; case id . iv_mute : if ( isMuteState ) { muteImage . setImageResource ( icon_mute_normal ) ; audioManager . setMicrophoneMute ( false ) ; isMuteState = false ; } else { muteImage . setImageResource ( icon_mute_on ) ; audioManager . setMicrophoneMute ( true ) ; isMuteState = true ; } break ; case id . iv_handsfree : if ( isHandsfreeState ) { handsFreeImage . setImageResource ( icon_speaker_normal ) ; closeSpeakerOn ( ) ; isHandsfreeState = false ; } else { handsFreeImage . setImageResource ( icon_speaker_on ) ; openSpeakerOn ( ) ; isHandsfreeState = true ; } break ; default : break ; } } @ Override protected void onDestroy ( ) { } @ Override public void onBackPressed ( ) { } }

Fix:
callStateTextView . setText ( getResources ( ) . getString ( hanging_up ) ) ;
Buggy code:
public class Invoice { public BigDecimal value = BigDecimal . valueOf ( 0 ) . setScale ( 2 , RoundingMode . HALF_UP ) ; public BigDecimal total = BigDecimal . valueOf ( 0 ) . setScale ( 2 , RoundingMode . HALF_UP ) ; public Invoice ( BigDecimal initValue , BigDecimal initTotal ) { } <START_BUG> public BigDecimal getValue ( ) { <END_BUG> return value ; } public BigDecimal getTotal ( ) { } public void addTotal ( BigDecimal addend ) { } public void subtractTotal ( BigDecimal subtrahend ) { } public void setTotal ( BigDecimal newTotal ) { } public void addValue ( BigDecimal addend ) { } public void subtractValue ( BigDecimal subtrahend ) { } }

Fix:
public double getValue ( ) {
Buggy code:
public class TestNearSpansOrdered extends LuceneTestCase { protected IndexSearcher searcher ; protected Directory directory ; protected IndexReader reader ; public static final String FIELD = "field" ; public static final QueryParser qp = new QueryParser ( TEST_VERSION_CURRENT , TestNearSpansOrdered . FIELD , new MockAnalyzer ( ) ) ; @ Override public void tearDown ( ) throws Exception { } @ Override public void setUp ( ) throws Exception { } protected String [ ] docFields = new String [ ] { "w1<seq2seq4repair_space>w2<seq2seq4repair_space>w3<seq2seq4repair_space>w4<seq2seq4repair_space>w5" , "w1<seq2seq4repair_space>w3<seq2seq4repair_space>w2<seq2seq4repair_space>w3<seq2seq4repair_space>zz" , "w1<seq2seq4repair_space>xx<seq2seq4repair_space>w2<seq2seq4repair_space>yy<seq2seq4repair_space>w3" , "w1<seq2seq4repair_space>w3<seq2seq4repair_space>xx<seq2seq4repair_space>w2<seq2seq4repair_space>yy<seq2seq4repair_space>w3<seq2seq4repair_space>zz" } ; protected SpanNearQuery makeQuery ( String s1 , String s2 , String s3 , int slop , boolean inOrder ) { } protected SpanNearQuery makeQuery ( ) { } public void testSpanNearQuery ( ) throws Exception { SpanNearQuery q = makeQuery ( ) ; <START_BUG> CheckHits . checkHits ( q , TestNearSpansOrdered . FIELD , searcher , new int [ ] { 0 , 1 } ) ; <END_BUG> } public String s ( Spans span ) { } public String s ( int doc , int start , int end ) { } public void testNearSpansNext ( ) throws Exception { } public void testNearSpansSkipToLikeNext ( ) throws Exception { } public void testNearSpansNextThenSkipTo ( ) throws Exception { } public void testNearSpansNextThenSkipPast ( ) throws Exception { } public void testNearSpansSkipPast ( ) throws Exception { } public void testNearSpansSkipTo0 ( ) throws Exception { } public void testNearSpansSkipTo1 ( ) throws Exception { } public void testSpanNearScorerSkipTo1 ( ) throws Exception { } public void testSpanNearScorerExplain ( ) throws Exception { } }

Fix:
CheckHits . checkHits ( random , q , TestNearSpansOrdered . FIELD , searcher , new int [ ] { 0 , 1 } ) ;
Buggy code:
public final class BayesUtils { private BayesUtils ( ) { } public static NaiveBayesModel readModelFromDir ( Path base , Configuration conf ) { } public static int writeLabelIndex ( Configuration conf , Iterable < String > labels , Path indexPath ) throws IOException { } public static int writeLabelIndex ( Configuration conf , Path indexPath , Iterable < Pair < Text , IntWritable > > labels ) throws IOException { FileSystem fs = FileSystem . get ( indexPath . toUri ( ) , conf ) ; SequenceFile . Writer writer = new SequenceFile . Writer ( fs , conf , indexPath , Text . class , IntWritable . class ) ; Collection < String > seen = new HashSet < String > ( ) ; int i = 0 ; try { for ( Object label : labels ) { <START_BUG> String theLabel = ( ( Pair < ? , ? > ) ( label ) ) . getFirst ( ) . toString ( ) ; <END_BUG> if ( ! ( seen . contains ( theLabel ) ) ) { writer . append ( new Text ( theLabel ) , new IntWritable ( ( i ++ ) ) ) ; seen . add ( theLabel ) ; } } } finally { Closeables . closeQuietly ( writer ) ; } return i ; } public static Map < Integer , String > readLabelIndex ( Configuration conf , Path indexPath ) { } public static OpenObjectIntHashMap < String > readIndexFromCache ( Configuration conf ) throws IOException { } public static Map < String , Vector > readScoresFromCache ( Configuration conf ) throws IOException { } }

Fix:
String theLabel = ( ( Pair < ? , ? > ) ( label ) ) . getFirst ( ) . toString ( ) . split ( "//" ) [ 1 ] ;
Buggy code:
public class KingsCorner extends Game { private static final long serialVersionUID = 4654549203834433105L ; public List < Player > turnOrder ; private int currentPlayer ; public KingsCorner ( int gameId , List < Player > players ) { } private KingsCorner ( KingsCorner . KingsCornerGenerator kc ) { } @ Override public boolean applyMove ( Move move ) { } public boolean endTurn ( ) { KCGameState gs = getGameState ( ) ; Pile curUserHand = gs . userHands . get ( getCurrentPlayer ( ) ) ; <START_BUG> Pile drawPile = gs . piles . get ( DRAW_PILE ) ; <END_BUG> curUserHand . add ( drawPile . removeTop ( ) ) ; currentPlayer = ( ( currentPlayer ) + 1 ) % ( turnOrder . size ( ) ) ; return save ( ) ; } public Player getCurrentPlayer ( ) { } public KCGameState getGameState ( ) { } @ Override protected final GameState newGameState ( List < Player > players ) { } public static class KingsCornerGenerator { public int gameId ; public GameState gs ; public List < Move > moves ; public List < Player > players ; public int currentPlayer ; public List < Player > getTurnOrder ( ) { } } @ Override protected boolean save ( ) { } }

Fix:
Pile drawPile = gs . piles . get ( DRAW_PILE . ordinal ( ) ) ;
Buggy code:
public class XMLLayout extends Layout { private boolean locationInfo = false ; public XMLLayout ( ) { } public void setLocationInfo ( boolean flag ) { } public boolean getLocationInfo ( ) { } public void activateOptions ( ) { } public void format ( Writer output , LoggingEvent event ) throws IOException { output . write ( "<log4j:event<seq2seq4repair_space>logger=\"" ) ; output . write ( event . getLoggerName ( ) ) ; output . write ( "\"<seq2seq4repair_space>timestamp=\"" ) ; output . write ( Long . toString ( event . getTimeStamp ( ) ) ) ; output . write ( "\"<seq2seq4repair_space>sequenceNumber=\"" ) ; output . write ( Long . toString ( event . getSequenceNumber ( ) ) ) ; output . write ( "\"<seq2seq4repair_space>level=\"" ) ; output . write ( event . getLevel ( ) . toString ( ) ) ; output . write ( "\"<seq2seq4repair_space>thread=\"" ) ; output . write ( event . getThreadName ( ) ) ; output . write ( "\">\r\n" ) ; output . write ( "<log4j:message><![CDATA[" ) ; Transform . appendEscapingCDATA ( output , event . getRenderedMessage ( ) ) ; output . write ( "]]><//log4j:message>\r\n" ) ; String ndc = event . getNDC ( ) ; if ( ndc != null ) { output . write ( "<log4j:NDC><![CDATA[" ) ; output . write ( ndc ) ; output . write ( "]]><//log4j:NDC>\r\n" ) ; } if ( ! ( ignoresThrowable ) ) { String [ ] s = event . getThrowableStrRep ( ) ; if ( s != null ) { output . write ( "<log4j:throwable><![CDATA[" ) ; for ( int i = 0 ; i < ( s . length ) ; i ++ ) { output . write ( s [ i ] ) ; output . write ( "\r\n" ) ; } output . write ( "]]><//log4j:throwable>\r\n" ) ; } } if ( locationInfo ) { LocationInfo locationInfo = event . getLocationInformation ( ) ; output . write ( "<log4j:locationInfo<seq2seq4repair_space>class=\"" ) ; <START_BUG> output . write ( locationInfo . getClassName ( ) ) ; <END_BUG> output . write ( "\"<seq2seq4repair_space>method=\"" ) ; Transform . escapeTags ( locationInfo . getMethodName ( ) , output ) ; output . write ( "\"<seq2seq4repair_space>file=\"" ) ; output . write ( locationInfo . getFileName ( ) ) ; output . write ( "\"<seq2seq4repair_space>line=\"" ) ; output . write ( locationInfo . getLineNumber ( ) ) ; output . write ( "\"//>\r\n" ) ; } Set propertySet = event . getPropertyKeySet ( ) ; if ( ( propertySet != null ) && ( ( propertySet . size ( ) ) > 0 ) ) { output . write ( "<log4j:properties>\r\n" ) ; Iterator propIter = propertySet . iterator ( ) ; while ( propIter . hasNext ( ) ) { String propName = propIter . next ( ) . toString ( ) ; output . write ( ( "<seq2seq4repair_space><log4j:data<seq2seq4repair_space>name=\"" + propName ) ) ; String propValue = event . getProperty ( propName ) . toString ( ) ; output . write ( ( "\"<seq2seq4repair_space>value=\"" + propValue ) ) ; output . write ( "\"//>\r\n" ) ; } output . write ( "<//log4j:properties>\r\n" ) ; } output . write ( "<//log4j:event>\r\n\r\n" ) ; } }

Fix:
Transform . escapeTags ( locationInfo . getClassName ( ) , output ) ;
Buggy code:
public final class LengthValidator extends AbstractValidator { private final boolean checkMin ; private final boolean checkMax ; private final int min ; private final int max ; private LengthValidator ( final boolean checkMin , final int min , final boolean checkMax , final int max ) { } public static LengthValidator min ( final int min ) { } public static LengthValidator max ( final int max ) { } public static LengthValidator range ( final int min , final int max ) { } public ValidationErrorMessage validate ( final FormComponent component ) { <START_BUG> final String value = component . getStringValue ( ) ; <END_BUG> if ( ( ( checkMin ) && ( ( value . length ( ) ) < ( min ) ) ) || ( ( checkMax ) && ( ( value . length ( ) ) > ( max ) ) ) ) { return errorMessage ( value , component ) ; } return NO_ERROR ; } public String toString ( ) { } }

Fix:
final String value = component . getRequestString ( ) ;
Buggy code:
public abstract class GeneratedCodec { protected final BlinkCodec codec ; public GeneratedCodec ( BlinkCodec codec ) { } protected abstract void writeStaticGroupWithId ( ByteSink out , Object group ) throws IOException , IllegalArgumentException { } protected abstract Object readStaticGroup ( int groupId , ByteSource in ) throws DecodeException , IOException { } public void writeDynamicGroup ( ByteSink out , Object group ) throws IOException , IllegalArgumentException { if ( out instanceof ByteBuf ) { ByteBuf buf = ( ( ByteBuf ) ( out ) ) ; int start = buf . position ( ) ; buf . skip ( 2 ) ; writeStaticGroupWithId ( buf , group ) ; int end = buf . position ( ) ; int size = ( end - start ) - 2 ; <START_BUG> if ( size < ( 1 << 6 ) ) { <END_BUG> buf . shift ( ( start + 2 ) , size , ( - 1 ) ) ; buf . position ( start ) ; BlinkOutput . writeVLC ( buf , size , 1 ) ; buf . position ( ( end - 1 ) ) ; } else if ( size < ( 1 << 14 ) ) { buf . position ( start ) ; BlinkOutput . writeVLC ( buf , size , 2 ) ; buf . position ( end ) ; } else { int sizeOfSize = BlinkOutput . sizeOfUnsignedVLC ( size ) ; buf . shift ( ( start + 2 ) , size , ( sizeOfSize - 2 ) ) ; buf . position ( start ) ; BlinkOutput . writeVLC ( buf , size , sizeOfSize ) ; buf . position ( ( ( end + sizeOfSize ) - 2 ) ) ; } } else { byte [ ] tmpBuf = codec . bufferPool ( ) . get ( ) ; try { ByteArrayBuf tmpOut = new ByteArrayBuf ( tmpBuf ) ; writeDynamicGroup ( tmpOut , group ) ; tmpOut . flip ( ) ; tmpOut . copyTo ( out ) ; } finally { codec . bufferPool ( ) . release ( tmpBuf ) ; } } } public void writeDynamicGroupNull ( ByteSink out , Object group ) throws IOException { } public Object readDynamicGroup ( ByteSource in ) throws IOException { } public Object readDynamicGroupNull ( ByteSource in ) throws IOException { } private Object readDynamicGroup ( int size , ByteSource in ) throws IOException { } protected static IllegalArgumentException missingRequiredValue ( String valueName ) { } protected static DecodeException unmappableEnumSymbolId ( String valueName , int symbolId , Class < ? extends Enum > enumClass ) { } protected static DecodeException unknownEnumSymbol ( String valueName , int symbolId ) { } protected static < E extends Enum < E > > IllegalArgumentException unmappableEnumSymbolValue ( String valueName , E enumValue ) { } protected static IllegalArgumentException unknownGroupType ( Object groupType ) { } protected static DecodeException unknownGroupId ( int groupId ) { } }

Fix:
if ( size < ( 1 << 7 ) ) {
Buggy code:
public class AggregateDataset implements ILazyDataset { private ILazyDataset [ ] data = null ; private int [ ] map = null ; private int [ ] offset = null ; private int [ ] shape ; private int size ; private String name ; private int dtype = - 1 ; public static int [ ] [ ] calcShapes ( boolean extend , ILazyDataset ... datasets ) { } public AggregateDataset ( boolean extend , ILazyDataset ... datasets ) { } @ Override public Class < ? > elementClass ( ) { } @ Override public String getName ( ) { } @ Override public void setName ( String name ) { } @ Override public int getSize ( ) { } @ Override public int [ ] getShape ( ) { <START_BUG> return shape ; <END_BUG> } @ Override public void setShape ( int ... shape ) { } @ Override public int getRank ( ) { } @ Override public ILazyDataset squeeze ( ) { } @ Override public ILazyDataset squeeze ( boolean onlyFromEnd ) { } @ Override public IDataset getSlice ( int [ ] start , int [ ] stop , int [ ] step ) { } public int getDtype ( ) { } @ Override public IDataset getSlice ( IMonitor monitor , int [ ] start , int [ ] stop , int [ ] step ) throws ScanFileHolderException { } @ Override public IDataset getSlice ( Slice ... slice ) { } @ Override public IDataset getSlice ( IMonitor monitor , Slice ... slice ) throws ScanFileHolderException { } @ Override public IMetaData getMetadata ( ) throws Exception { } @ Override public void setMetadata ( IMetaData metadata ) { } @ Override public AggregateDataset clone ( ) { } @ Override public String toString ( ) { } }

Fix:
return shape . clone ( ) ;
Buggy code:
@ ParametersAreNonnullByDefault @ ThreadSafe public class ClasspathTemplateFilesResolver implements InitializingBean , TemplateFilesResolver { private static final Logger logger = LoggerFactory . getLogger ( DefaultTemplateFilesResolver . class ) ; private String templatesLocation = null ; private boolean recursive = true ; private boolean hotReloadMode = SoyViewConfigDefaults . DEFAULT_HOT_RELOAD_MODE ; private PathMatchingResourcePatternResolver resolver ; private ResourceLoader resourceLoader = new DefaultResourceLoader ( getClass ( ) . getClassLoader ( ) ) ; Collection < URL > cachedFiles ; private String filesExtension = SoyViewConfigDefaults . DEFAULT_FILES_EXTENSION ; @ Override public void afterPropertiesSet ( ) { } @ Override public Collection < URL > resolve ( ) throws IOException { } @ Override public Optional < URL > resolve ( @ Nullable final String templateFileName ) throws IOException { } protected Collection < URL > handleResolution ( ) throws IOException { } private Collection < URL > resolveSoyResources ( final String templatesLocation ) throws IOException { } private String normalizePathRoot ( String root ) { } private String normalizeTemplateName ( final String templateFileName ) { } private String templateSearchStrings ( String resource ) { if ( recursive ) { <START_BUG> return ( resource + "//**//" ) + ( dotWithExtension ( ) ) ; <END_BUG> } return ( resource + "//*" ) + ( dotWithExtension ( ) ) ; } private String dotWithExtension ( ) { } public void setTemplatesLocation ( String templatesLocation ) { } public void setRecursive ( boolean recursive ) { } public void setHotReloadMode ( boolean hotReloadMode ) { } public String getTemplatesLocation ( ) { } public boolean isRecursive ( ) { } public boolean isHotReloadMode ( ) { } public String getFilesExtension ( ) { } public void setFilesExtension ( String filesExtension ) { } }

Fix:
return ( resource + "//**//*" ) + ( dotWithExtension ( ) ) ;
Buggy code:
public class JdrReportService implements JdrReportCollector , Service < JdrReportCollector > { public static final ServiceName SERVICE_NAME = JBOSS . append ( "jdr" , "collector" ) ; public static ServiceController < JdrReportCollector > addService ( final ServiceTarget target , final ServiceVerificationHandler verificationHandler ) { } private final InjectedValue < ServerEnvironment > serverEnvironmentValue = new InjectedValue < ServerEnvironment > ( ) ; private final InjectedValue < ModelController > modelControllerValue = new InjectedValue < ModelController > ( ) ; private ExecutorService executorService ; private ServerEnvironment serverEnvironment ; private ModelControllerClient controllerClient ; public JdrReport standaloneCollect ( String protocol , String host , String port ) throws OperationFailedException { } public JdrReport collect ( ) throws OperationFailedException { <START_BUG> JdrRunner runner = new JdrRunner ( ) ; <END_BUG> serverEnvironment = serverEnvironmentValue . getValue ( ) ; runner . setJbossHomeDir ( serverEnvironment . getHomeDir ( ) . getAbsolutePath ( ) ) ; runner . setReportLocationDir ( serverEnvironment . getServerTempDir ( ) . getAbsolutePath ( ) ) ; runner . setControllerClient ( controllerClient ) ; runner . setHostControllerName ( serverEnvironment . getHostControllerName ( ) ) ; runner . setServerName ( serverEnvironment . getServerName ( ) ) ; return runner . collect ( ) ; } public synchronized void start ( StartContext context ) throws StartException { } public synchronized void stop ( StopContext context ) { } public JdrReportService getValue ( ) throws IllegalArgumentException , IllegalStateException { } }

Fix:
JdrRunner runner = new JdrRunner ( true ) ;
Buggy code:
class XSDNotationTraverser extends XSDAbstractTraverser { XSDNotationTraverser ( XSDHandler handler , XMLErrorReporter errorReporter , XSAttributeChecker gAttrCheck ) { } int traverse ( Element elmNode , XSDocumentInfo schemaDoc , SchemaGrammar grammar ) { <START_BUG> return XSDHandler . I_EMPTY_DECL ; <END_BUG> } }

Fix:
return SchemaGrammar . I_EMPTY_DECL ;
Buggy code:
public class ImageViewer extends JPanel implements IMimePartViewer { private MessageController mediator ; private byte [ ] data ; private ImageIcon image ; private int width ; public ImageViewer ( MessageController mediator ) { } public void view ( IMailbox folder , Object uid , Integer [ ] address , MailFrameMediator mediator ) throws Exception { } public void updateGUI ( ) throws Exception { removeAll ( ) ; image = new ImageIcon ( Toolkit . getDefaultToolkit ( ) . createImage ( data ) ) ; <START_BUG> Container parent = mediator . getViewport ( ) ; <END_BUG> int cwidth = ( ( int ) ( parent . getWidth ( ) ) ) ; if ( cwidth < ( image . getIconWidth ( ) ) ) { float scaling = ( ( float ) ( cwidth ) ) // ( image . getIconWidth ( ) ) ; image = new ImageIcon ( image . getImage ( ) . getScaledInstance ( ( ( int ) ( ( image . getIconWidth ( ) ) * scaling ) ) , ( ( int ) ( ( image . getIconHeight ( ) ) * scaling ) ) , Image . SCALE_FAST ) ) ; } JLabel label = new JLabel ( image ) ; add ( label , BorderLayout . CENTER ) ; revalidate ( ) ; } public JComponent getView ( ) { } public boolean isVisible ( ) { } }

Fix:
Container parent = mediator ;
Buggy code:
@ Slf4j public class ChefDirSynchronizer extends CompositeBufferedFilesystemWatcher { public static final long CHEF_FS_EVENTS_TIMEOUT = TimeUnit . SECONDS . toMillis ( 60 ) ; public static final int MAX_CHEF_FS_EVENTS = 1000 ; public static final int MAX_CHEF_SYNC_ERRORS = 10 ; @ Getter private File target ; private int errorCount = 0 ; public ChefDirSynchronizer ( String [ ] paths , File target ) { } public ChefDirSynchronizer ( String paths , File target ) { } public void fire ( ) { } @ Override public synchronized void fire ( List < WatchEvent < ? > > events ) { try { <START_BUG> if ( ! ( isEmpty ( ) ) ) { <END_BUG> ChefSolo . merge ( dirsWatching ( ) , target ) ; errorCount = 0 ; } } catch ( IOException e ) { log . warn ( ( "Error<seq2seq4repair_space>merging<seq2seq4repair_space>chef<seq2seq4repair_space>dir:<seq2seq4repair_space>" + e ) , e ) ; if ( ( ( errorCount ) ++ ) > ( ChefDirSynchronizer . MAX_CHEF_SYNC_ERRORS ) ) { final String msg = ( "Too<seq2seq4repair_space>many<seq2seq4repair_space>errors<seq2seq4repair_space>sync'ing<seq2seq4repair_space>chef<seq2seq4repair_space>dir<seq2seq4repair_space>(" + ( ChefDirSynchronizer . MAX_CHEF_SYNC_ERRORS ) ) + "),<seq2seq4repair_space>dying" ; log . error ( msg ) ; try { close ( ) ; } catch ( IOException e1 ) { log . error ( ( "error<seq2seq4repair_space>closing<seq2seq4repair_space>self:<seq2seq4repair_space>" + e1 ) , e1 ) ; } die ( msg , e ) ; } } } }

Fix:
if ( ( ! ( isEmpty ( ) ) ) || ( events == null ) ) {
Buggy code:
public class QueueAdd extends AbstractMessagingSubsystemUpdate < Void > { private static final long serialVersionUID = 2210829361890051692L ; private final String name ; private String address ; private String filter ; private Boolean durable ; public QueueAdd ( final String name ) { } protected void applyUpdate ( MessagingSubsystemElement element ) throws UpdateFailedException { } protected < P > void applyUpdate ( UpdateContext context , UpdateResultHandler < ? super Void , P > resultHandler , P param ) { final QueueService service = new QueueService ( address , name , filter , ( ( durable ) != null ? true : durable ) , false ) ; <START_BUG> context . getBatchBuilder ( ) . addService ( CORE_QUEUE_BASE . append ( name ) , service ) . addDependency ( JBOSS_MESSAGING , HornetQServer . class , service . getHornetQService ( ) ) . addListener ( new UpdateResultHandler . ServiceStartListener < P > ( resultHandler , param ) ) . setInitialMode ( IMMEDIATE ) ; <END_BUG> } public AbstractSubsystemUpdate < MessagingSubsystemElement , ? > getCompensatingUpdate ( MessagingSubsystemElement original ) { } public String getAddress ( ) { } public void setAddress ( String address ) { } public String getFilter ( ) { } public void setFilter ( String filter ) { } public Boolean getDurable ( ) { } public void setDurable ( Boolean durable ) { } public String getName ( ) { } }

Fix:
context . getBatchBuilder ( ) . addService ( CORE_QUEUE_BASE . append ( name ) , service ) . addDependency ( JBOSS_MESSAGING , HornetQServer . class , service . getHornetQService ( ) ) . addListener ( new UpdateResultHandler . ServiceStartListener < P > ( resultHandler , param ) ) . setInitialMode ( ACTIVE ) ;
Buggy code:
class AdviceSignatureImpl extends CodeSignatureImpl implements AdviceSignature { Class returnType ; private Method adviceMethod = null ; AdviceSignatureImpl ( int modifiers , String name , Class declaringType , Class [ ] parameterTypes , String [ ] parameterNames , Class [ ] exceptionTypes , Class returnType ) { } AdviceSignatureImpl ( String stringRep ) { } public Class getReturnType ( ) { } protected String createToString ( StringMaker sm ) { } public Method getAdvice ( ) { if ( ( adviceMethod ) == null ) { try { <START_BUG> adviceMethod = declaringType . getDeclaredMethod ( getName ( ) , getParameterTypes ( ) ) ; <END_BUG> } catch ( Exception ex ) { } } return adviceMethod ; } }

Fix:
adviceMethod = getDeclaringType ( ) . getDeclaredMethod ( getName ( ) , getParameterTypes ( ) ) ;
Buggy code:
public class TestRunner { @ Test public void runPaxml ( ) { <START_BUG> new PaxmlRunner ( ) . run ( "restfulTest" , null , "" ) ; <END_BUG> } }

Fix:
new PaxmlRunner ( ) . run ( "xmlTest" , null , "" ) ;
Buggy code:
public class DayDV extends AbstractDateTimeDV { private static final int DAY_SIZE = 5 ; public Object getActualValue ( String content , ValidationContext context ) throws InvalidDatatypeValueException { } protected DateTimeData parse ( String str ) throws SchemaDateTimeException { <START_BUG> DateTimeData date = new DateTimeData ( this ) ; <END_BUG> int len = str . length ( ) ; if ( ( ( ( str . charAt ( 0 ) ) != '-' ) || ( ( str . charAt ( 1 ) ) != '-' ) ) || ( ( str . charAt ( 2 ) ) != '-' ) ) { throw new SchemaDateTimeException ( "Error<seq2seq4repair_space>in<seq2seq4repair_space>day<seq2seq4repair_space>parsing" ) ; } date . year = YEAR ; date . month = MONTH ; date . day = parseInt ( str , 3 , 5 ) ; if ( ( DayDV . DAY_SIZE ) < len ) { int sign = findUTCSign ( str , DayDV . DAY_SIZE , len ) ; if ( sign < 0 ) { throw new SchemaDateTimeException ( "Error<seq2seq4repair_space>in<seq2seq4repair_space>day<seq2seq4repair_space>parsing" ) ; } else { getTimeZone ( str , date , sign , len ) ; } } validateDateTime ( date ) ; if ( ( ( date . utc ) != 0 ) && ( ( date . utc ) != 'Z' ) ) { normalize ( date ) ; } date . position = 2 ; return date ; } protected String dateToString ( DateTimeData date ) { } }

Fix:
DateTimeData date = new DateTimeData ( str , this ) ;
Buggy code:
public class TicketClient { private Window currentWindow ; private ClientWorker w ; private Thread worker ; private Thread updater ; public static void main ( String [ ] args ) { } public TicketClient ( ) { } public synchronized void setCurrentWindow ( Window currentWindow ) { } public void connect ( String ip , String name ) throws TicketException { } public void getTicket ( ) throws TicketException { } public void done ( ) throws TicketException { try { <START_BUG> w . getTicket ( ) ; <END_BUG> } catch ( IOException e ) { throw new TicketException ( e . getMessage ( ) , e ) ; } } }

Fix:
w . done ( ) ;
Buggy code:
public class JUnitCoreTest { public static class Fail { @ Test public void kaboom ( ) { } } @ Test public void failureCausesExitCodeOf1 ( ) throws Exception { } @ Test public void missingClassCausesExitCodeOf1 ( ) throws Exception { } public static class Succeed { @ Test public void peacefulSilence ( ) { } } @ Test public void successCausesExitCodeOf0 ( ) throws Exception { <START_BUG> runClass ( "org.junit.tests.JUnitCoreTest$Succeed" , 0 ) ; <END_BUG> } private void runClass ( String className , int returnCode ) throws IOException , InterruptedException { } }

Fix:
runClass ( "org.junit.tests.running.core.JUnitCoreTest$Succeed" , 0 ) ;
Buggy code:
public class ChannelMetricsHandler extends AbstractRuntimeOnlyHandler { @ Override protected void executeRuntimeStep ( OperationContext context , ModelNode operation ) throws OperationFailedException { <START_BUG> String channelName = Operations . getPathAddress ( operation ) . getLastElement ( ) . getValue ( ) ; <END_BUG> String name = Operations . getAttributeName ( operation ) ; ChannelMetric metric = ChannelMetric . forName ( name ) ; if ( metric == null ) { context . getFailureDescription ( ) . set ( ROOT_LOGGER . unknownMetric ( name ) ) ; } else { JChannel channel = ServiceContainerHelper . findValue ( context . getServiceRegistry ( false ) , CHANNEL . getServiceName ( channelName ) ) ; if ( channel != null ) { context . getResult ( ) . set ( metric . getValue ( channel ) ) ; } } context . completeStep ( NOOP_RESULT_HANDLER ) ; } }

Fix:
String channelName = context . getCurrentAddressValue ( ) ;
Buggy code:
public class GameScreen implements Screen { final DogeDodge game ; Texture dogeImage ; Texture grumpyImage ; Texture background ; OrthographicCamera camera ; Rectangle doge ; Array < Rectangle > grumpies ; long lastDropTime ; private int dogesDodged ; public GameScreen ( DogeDodge game ) { } private void spawnGrumpies ( ) { } @ Override public void render ( float delta ) { gl . glClearColor ( 0 , 0 , 0.2F , 1 ) ; gl . glClear ( GL_COLOR_BUFFER_BIT ) ; camera . update ( ) ; game . batch . setProjectionMatrix ( camera . combined ) ; game . batch . begin ( ) ; game . batch . draw ( background , 0 , 0 , graphics . getWidth ( ) , graphics . getHeight ( ) ) ; game . batch . draw ( dogeImage , doge . x , doge . y ) ; for ( Rectangle grumpyCat : grumpies ) { game . batch . draw ( grumpyImage , grumpyCat . x , grumpyCat . y ) ; } game . font . draw ( game . batch , ( "Score:<seq2seq4repair_space>" + ( Integer . toString ( dogesDodged ) ) ) , 50 , 450 ) ; game . batch . end ( ) ; if ( input . isTouched ( ) ) { Vector3 touchPos = new Vector3 ( ) ; touchPos . set ( input . getX ( ) , input . getY ( ) , 0 ) ; camera . unproject ( touchPos ) ; doge . x = ( touchPos . x ) - ( 64 // 2 ) ; } if ( input . isKeyPressed ( LEFT ) ) doge . x -= 200 * ( graphics . getDeltaTime ( ) ) ; if ( input . isKeyPressed ( RIGHT ) ) doge . x += 200 * ( graphics . getDeltaTime ( ) ) ; if ( ( doge . x ) < 0 ) doge . x = 0 ; if ( ( doge . x ) > ( 800 - 64 ) ) doge . x = 800 - 64 ; if ( ( ( TimeUtils . nanoTime ( ) ) - ( lastDropTime ) ) > 500000000 ) spawnGrumpies ( ) ; Iterator < Rectangle > iter = grumpies . iterator ( ) ; while ( iter . hasNext ( ) ) { Rectangle raindrop = iter . next ( ) ; raindrop . y -= 200 * ( graphics . getDeltaTime ( ) ) ; if ( ( ( raindrop . y ) + 64 ) < 0 ) { iter . remove ( ) ; ( dogesDodged ) ++ ; <START_BUG> } <END_BUG> if ( raindrop . overlaps ( doge ) ) { iter . remove ( ) ; game . setScreen ( new DeadScreen ( game , dogesDodged ) ) ; } } } @ Override public void resize ( int width , int height ) { } @ Override public void show ( ) { } @ Override public void hide ( ) { } @ Override public void pause ( ) { } @ Override public void resume ( ) { } @ Override public void dispose ( ) { } }

Fix:
} else