nus-yam/ex-repair huggingface dataset:
Buggy code:
public class HereComUploader extends BaseUploader { private static final String TAG = "HereComUploader" ; private String csrfToken ; public HereComUploader ( Context context , BaseUploaderHandler handler ) { } @ Override protected Boolean doUpload ( ) throws BackgroundTaskAbort { } private String preparePostData ( ) throws BackgroundTaskAbort { } private void populateHereComCookieAndCSRF ( ) { } private String parseCSRF ( String body ) { } private Boolean sendToCar ( String post ) throws BackgroundTaskAbort { try { populateHereComCookieAndCSRF ( ) ; URI postUri = new URI ( "https" , provider . host , "//api//sendToCar//message" , null , null ) ; httpPost . setURI ( postUri ) ; httpPost . addHeader ( "Content-Type" , "application//json;<seq2seq4repair_space>charset=UTF-8" ) ; httpPost . addHeader ( "x-csrf-token" , csrfToken ) ; httpPost . setHeader ( "User-Agent" , SENDTOCAR_USERAGENT ) ; httpPost . setEntity ( new ByteArrayEntity ( post . getBytes ( ) ) ) ; if ( Log . isEnabled ( ) ) Log . d ( HereComUploader . TAG , ( "Uploading<seq2seq4repair_space>to<seq2seq4repair_space>" + ( postUri . toString ( ) ) ) ) ; if ( ( isCancelled ( ) ) || ( httpPost . isAborted ( ) ) ) return Boolean . FALSE ; HttpResponse response = client . execute ( httpPost , httpContext ) ; int statusCode = response . getStatusLine ( ) . getStatusCode ( ) ; if ( Log . isEnabled ( ) ) Log . d ( HereComUploader . TAG , ( "Uploaded<seq2seq4repair_space>to<seq2seq4repair_space>car.<seq2seq4repair_space>Status:<seq2seq4repair_space>" + statusCode ) ) ; if ( isCancelled ( ) ) return Boolean . FALSE ; <START_BUG> if ( statusCode != ( HttpURLConnection . HTTP_OK ) ) { <END_BUG> switch ( statusCode ) { case 409 : throw new BackgroundTaskAbort ( string . statusInvalidAccount ) ; default : throw new BackgroundTaskAbort ( string . errorSendToCar ) ; } } String sendToCarHtml = EntityUtils . toString ( response . getEntity ( ) ) ; if ( Log . isEnabled ( ) ) Log . d ( HereComUploader . TAG , ( "Response:<seq2seq4repair_space>" + ( Utils . htmlSnippet ( sendToCarHtml ) ) ) ) ; return Boolean . TRUE ; } catch ( InterruptedIOException e ) { if ( Log . isEnabled ( ) ) Log . w ( HereComUploader . TAG , "Upload<seq2seq4repair_space>to<seq2seq4repair_space>Here.com<seq2seq4repair_space>aborted" ) ; return Boolean . FALSE ; } catch ( IOException | URISyntaxException e ) { if ( Log . isEnabled ( ) ) Log . e ( HereComUploader . TAG , "Exception<seq2seq4repair_space>while<seq2seq4repair_space>sending<seq2seq4repair_space>to<seq2seq4repair_space>Here.com" , e ) ; throw new BackgroundTaskAbort ( string . errorSendToCar ) ; } } }

Fix:
if ( statusCode != 201 ) {
Buggy code:
public class JarUtil { public static final String ADD_JAR_DDL = "ADD<seq2seq4repair_space>JAR" ; public static final String DROP_JAR_DDL = "DROP<seq2seq4repair_space>JAR" ; public static final String REPLACE_JAR_DDL = "REPLACE<seq2seq4repair_space>JAR" ; public static final String READ_JAR = "READ<seq2seq4repair_space>JAR" ; private UUID id ; private String schemaName ; private String sqlName ; private LanguageConnectionContext lcc ; private FileResource fr ; private DataDictionary dd ; private DataDescriptorGenerator ddg ; public JarUtil ( UUID id , String schemaName , String sqlName ) throws StandardException { } public static long add ( UUID id , String schemaName , String sqlName , String externalPath ) throws StandardException { } public long add ( InputStream is ) throws StandardException { } public static void drop ( UUID id , String schemaName , String sqlName , boolean purgeOnCommit ) throws StandardException { } public void drop ( boolean purgeOnCommit ) throws StandardException { } public static long replace ( UUID id , String schemaName , String sqlName , String externalPath , boolean purgeOnCommit ) throws StandardException { } public long replace ( InputStream is , boolean purgeOnCommit ) throws StandardException { } public static FileInfoDescriptor getInfo ( String schemaName , String sqlName , String statementType ) throws StandardException { } private FileInfoDescriptor getInfo ( ) throws StandardException { } public static Object getAsObject ( String schemaName , String sqlName ) throws StandardException { } private StorageFile getAsFile ( long generationId ) { } public static InputStream getAsStream ( String schemaName , String sqlName , long generationId ) throws StandardException { } private InputStream getAsStream ( long generationId ) throws StandardException { try { return fr . getAsStream ( JarDDL . mkExternalName ( schemaName , sqlName , fr . getSeparatorChar ( ) ) , generationId ) ; } catch ( IOException ioe ) { <START_BUG> throw StandardException . newException ( LANG_FILE_ERROR , ioe . toString ( ) , ioe ) ; <END_BUG> } } private void notifyLoader ( boolean reload ) throws StandardException { } }

Fix:
throw StandardException . newException ( LANG_FILE_ERROR , ioe , ioe . toString ( ) ) ;
Buggy code:
public abstract class JobManager implements Runnable { protected IJob [ ] awaitingJobs = new IJob [ 10 ] ; protected int jobStart = 0 ; protected int jobEnd = - 1 ; protected boolean executing = false ; protected Thread thread ; private boolean enabled = true ; public static boolean VERBOSE = false ; public boolean activated = false ; private int awaitingClients = 0 ; public static void verbose ( String log ) { } public void activateProcessing ( ) { } public synchronized int awaitingJobsCount ( ) { } public synchronized IJob currentJob ( ) { } public synchronized void disable ( ) { } public void discardJobs ( String jobFamily ) { } public synchronized void enable ( ) { } public synchronized boolean isEnabled ( ) { } protected synchronized void moveToNextJob ( ) { } protected void notifyIdle ( long idlingTime ) { } public boolean performConcurrentJob ( IJob searchJob , int waitingPolicy , IProgressMonitor progress ) { } public abstract String processName ( ) { } public synchronized void request ( IJob job ) { } public void reset ( ) { } public void run ( ) { } public void shutdown ( ) { } public String toString ( ) { StringBuffer buffer = new StringBuffer ( 10 ) ; buffer . append ( "Enabled:" ) . append ( this . enabled ) . append ( '\n' ) ; int numJobs = ( ( jobEnd ) - ( jobStart ) ) + 1 ; buffer . append ( "Jobs<seq2seq4repair_space>in<seq2seq4repair_space>queue:" ) . append ( numJobs ) . append ( '\n' ) ; if ( numJobs > 0 ) { <START_BUG> buffer . append ( "First<seq2seq4repair_space>job:<seq2seq4repair_space>" ) . append ( awaitingJobs [ jobStart ] . toString ( ) ) . append ( '\n' ) ; <END_BUG> } return buffer . toString ( ) ; } }

Fix:
buffer . append ( "First<seq2seq4repair_space>job:<seq2seq4repair_space>" ) . append ( awaitingJobs [ jobStart ] ) . append ( '\n' ) ;
Buggy code:
public class TextListener extends RunListener { private final PrintStream fWriter ; public TextListener ( JUnitSystem system ) { } public TextListener ( PrintStream writer ) { } @ Override public void testRunFinished ( Result result ) { } @ Override public void testStarted ( Description description ) { } @ Override public void testFailure ( Failure failure ) { } @ Override public void testIgnored ( Description description ) { } private PrintStream getWriter ( ) { } protected void printHeader ( long runTime ) { } protected void printFailures ( Result result ) { } private void printFailedAssumptions ( Result result ) { <START_BUG> printEvents ( "invalid<seq2seq4repair_space>assumption" , "INVALID<seq2seq4repair_space>ASSUMPTION<seq2seq4repair_space>" , result . getFailedAssumptions ( ) ) ; <END_BUG> } private void printIgnorances ( Result result ) { } private void printEvents ( String exceptionTypeName , String listPrefix , List < ? extends TestRunEvent > exceptions ) { } protected void printFailure ( TestRunEvent each , String prefix ) { } protected void printFooter ( Result result ) { } protected String elapsedTimeAsString ( long runTime ) { } }

Fix:
printEvents ( "invalid<seq2seq4repair_space>assumption" , "INVALID<seq2seq4repair_space>ASSUMPTION<seq2seq4repair_space>" , result . getInvalidAssumptions ( ) ) ;
Buggy code:
public class VariableFactoryTest { ClientInterfaceImpl client ; VariableFactory vf ; State sampleState ; TypeReference < Integer > intType = new TypeReference < Integer > ( ) { } ; TypeReference < List < String > > listType = new TypeReference < List < String > > ( ) { } ; TypeReference < String > stringType = new TypeReference < String > ( ) { } ; @ Before public void setUp ( ) { } public void initializeSampleState ( ) { } @ Test public void getsInitialValue ( ) { } @ Test public void updatesValue ( ) { } @ Test public void setsValue ( ) throws Exception { Variable < String > string = vf . create ( "X" , stringType ) ; assertNull ( string . get ( ) ) ; string . set ( "NewValue" ) ; <START_BUG> verify ( client ) . set ( "X" , "\"NewValue\"" , 0 ) ; <END_BUG> } @ Test public void addsListener ( ) throws Exception { } @ Test public void listenerNotifies ( ) throws Exception { } }

Fix:
verify ( client ) . set ( new State . Component ( "X" , 0 , "\"NewValue\"" ) ) ;
Buggy code:
public final class LaguerreSolverTest extends TestCase { public void testLinearFunction ( ) throws MathException { } public void testQuadraticFunction ( ) throws MathException { } public void testQuinticFunction ( ) throws MathException { } public void testQuinticFunction2 ( ) throws MathException { } public void testParameters ( ) throws Exception { double [ ] coefficients = new double [ ] { - 3.0 , 5.0 , 2.0 } ; PolynomialFunction f = new PolynomialFunction ( coefficients ) ; UnivariateRealSolver solver = new LaguerreSolver ( f ) ; try { solver . solve ( 1 , ( - 1 ) ) ; fail ( "Expecting<seq2seq4repair_space>IllegalArgumentException<seq2seq4repair_space>-<seq2seq4repair_space>bad<seq2seq4repair_space>interval" ) ; } catch ( IllegalArgumentException ex ) { } try { solver . solve ( 2 , 3 ) ; fail ( "Expecting<seq2seq4repair_space>IllegalArgumentException<seq2seq4repair_space>-<seq2seq4repair_space>no<seq2seq4repair_space>bracketing" ) ; } catch ( IllegalArgumentException ex ) { } try { UnivariateRealFunction f2 = new SinFunction ( ) ; <START_BUG> UnivariateRealSolver solver2 = new LaguerreSolver ( f2 ) ; <END_BUG> fail ( "Expecting<seq2seq4repair_space>IllegalArgumentException<seq2seq4repair_space>-<seq2seq4repair_space>bad<seq2seq4repair_space>function" ) ; } catch ( IllegalArgumentException ex ) { } } }

Fix:
new LaguerreSolver ( f2 ) ;
Buggy code:
public class BindingKeyResolver extends BindingKeyParser { Compiler compiler ; Binding compilerBinding ; char [ ] [ ] compoundName ; int dimension ; LookupEnvironment environment ; ReferenceBinding genericType ; MethodBinding methodBinding ; CompilationUnitDeclaration parsedUnit ; BlockScope scope ; TypeBinding typeBinding ; TypeDeclaration typeDeclaration ; ArrayList types = new ArrayList ( ) ; int rank = 0 ; int wildcardRank ; CompilationUnitDeclaration outerMostParsedUnit ; private BindingKeyResolver ( BindingKeyParser parser , Compiler compiler , LookupEnvironment environment , int wildcardRank , CompilationUnitDeclaration outerMostParsedUnit ) { } public BindingKeyResolver ( String key ) { } public BindingKeyResolver ( String key , Compiler compiler , LookupEnvironment environment ) { } public char [ ] [ ] compoundName ( ) { } public void consumeArrayDimension ( char [ ] brakets ) { } public void consumeBaseType ( char [ ] baseTypeSig ) { } public void consumeCapture ( final int position ) { } public void consumeField ( char [ ] fieldName ) { } public void consumeParameterizedGenericMethod ( ) { } public void consumeLocalType ( char [ ] uniqueKey ) { } public void consumeLocalVar ( char [ ] varName ) { } public void consumeMethod ( char [ ] selector , char [ ] signature ) { } public void consumeMemberType ( char [ ] simpleTypeName ) { } public void consumePackage ( char [ ] pkgName ) { } public void consumeParameterizedType ( char [ ] simpleTypeName , boolean isRaw ) { } public void consumeParser ( BindingKeyParser parser ) { } public void consumeScope ( int scopeNumber ) { } public void consumeRawType ( ) { if ( ( this . typeBinding ) == null ) return ; <START_BUG> this . typeBinding = this . environment . createRawType ( ( ( ReferenceBinding ) ( this . typeBinding ) ) , this . typeBinding . enclosingType ( ) ) ; <END_BUG> } public void consumeSecondaryType ( char [ ] simpleTypeName ) { } public void consumeFullyQualifiedName ( char [ ] fullyQualifiedName ) { } public void consumeTopLevelType ( ) { } public void consumeKey ( ) { } public void consumeTypeVariable ( char [ ] position , char [ ] typeVariableName ) { } public void consumeTypeWithCapture ( ) { } public void consumeWildCard ( int kind ) { } private TypeBinding getArrayBinding ( int dim , TypeBinding binding ) { } private TypeBinding getBaseTypeBinding ( char [ ] signature ) { } private TypeBinding getBinaryBinding ( ) { } public CompilationUnitDeclaration getCompilationUnitDeclaration ( ) { } public Binding getCompilerBinding ( ) { } private TypeBinding getTypeBinding ( char [ ] simpleTypeName ) { } private TypeBinding [ ] getTypeBindingArguments ( ) { } public void malformedKey ( ) { } public BindingKeyParser newParser ( ) { } public String toString ( ) { } }

Fix:
this . typeBinding = this . environment . convertToRawType ( this . typeBinding ) ;
Buggy code:
public class BlockRange { public int begin ; public int end ; public BlockRange ( ) { } public BlockRange ( int begin , int end ) { } @ Override public String toString ( ) { <START_BUG> return ( ( ( "[" + ( this . begin ) ) + ",<seq2seq4repair_space>" ) + ( this . end ) ) + "]" ; <END_BUG> } }

Fix:
return String . format ( "[%2d,<seq2seq4repair_space>%2d]" , this . begin , this . end ) ;
Buggy code:
public class LdapServerService implements LdapService { private static final Logger logger = LoggerFactory . getLogger ( LdapDevService . class ) ; @ Autowired private LdapTemplate ldapTemplate ; @ Autowired private UserService userService ; @ Override public User checkUser ( String login , String password ) { <START_BUG> LdapQuery query = query ( ) . where ( "objectClass" ) . is ( "person" ) . and ( "uid" ) . is ( "login" ) ; <END_BUG> try { ldapTemplate . authenticate ( query , password ) ; return userService . findOrCreateUser ( login , PUBLIC , WRITER ) ; } catch ( RuntimeException e ) { LdapServerService . logger . error ( "Error<seq2seq4repair_space>on<seq2seq4repair_space>login" , e ) ; throw new BadCredentialsException ( ) ; } } }

Fix:
LdapQuery query = query ( ) . where ( "objectClass" ) . is ( "person" ) . and ( "uid" ) . is ( login ) ;
Buggy code:
public class ConfirmedOrdersEnityFactory { public static ConfirmedOrdersEntity createBasedOn ( OrdersEntity oe ) { ConfirmedOrdersEntity coe = ConfirmedOrdersEnityFactory . empty ( ) ; coe . setCity ( oe . getCity ( ) ) ; coe . setComment ( oe . getComment ( ) ) ; coe . setConfirmationID ( oe . getId ( ) . toString ( ) ) ; coe . setCreationDate ( oe . getCreationDate ( ) ) ; coe . setEmail ( oe . getEmail ( ) ) ; coe . setFirstName ( oe . getFirstName ( ) ) ; coe . setLastName ( oe . getLastName ( ) ) ; coe . setLocation ( oe . getLocation ( ) ) ; coe . setPayPalNumber ( oe . getPayPalNumber ( ) ) ; coe . setPhone ( oe . getPhone ( ) ) ; coe . setState ( oe . getState ( ) ) ; coe . setUnit ( oe . getUnit ( ) ) ; coe . setZipCode ( oe . getZipCode ( ) ) ; coe . setCheckinDate ( oe . getCheckinDate ( ) ) ; for ( OrderLinesEntity ole : oe . getOrderLines ( ) ) { ConfirmedOrderLinesEntity cole = new ConfirmedOrderLinesEntity ( ) ; cole . setPrice ( ole . getPrice ( ) ) ; cole . setProduct ( ole . getProduct ( ) ) ; cole . setQuantity ( ole . getQuantity ( ) ) ; <START_BUG> cole . setConfirmedOrder ( coe ) ; <END_BUG> SortedSet < ConfirmedOrderLinesEntity > set = coe . getOrderLines ( ) ; set . add ( cole ) ; coe . setOrderLines ( set ) ; } return coe ; } public static ConfirmedOrdersEntity empty ( ) { } }

Fix:
cole . setConfirmedorder ( coe ) ;
Buggy code:
public class HintedHandOffManager { private static HintedHandOffManager instance_ ; private static Lock lock_ = new ReentrantLock ( ) ; private static Logger logger_ = Logger . getLogger ( HintedHandOffManager . class ) ; static final long INTERVAL_IN_MS = 3600 * 1000 ; private ExecutorService executor_ = new DebuggableThreadPoolExecutor ( "HINTED-HANDOFF-POOL" ) ; Timer timer = new Timer ( "HINTED-HANDOFF-TIMER" ) ; public static final String HINTS_CF = "HintsColumnFamily" ; public static HintedHandOffManager instance ( ) { } private static boolean sendMessage ( InetAddress endPoint , String tableName , String key ) throws IOException { } private static void deleteEndPoint ( byte [ ] endpointAddress , String tableName , byte [ ] key , long timestamp ) throws IOException { } private static void deleteHintKey ( String tableName , byte [ ] key ) throws IOException { } private static void deliverAllHints ( ColumnFamilyStore hintStore ) throws IOException , TimeoutException , DigestMismatchException , InvalidRequestException { } private static void deliverHintsToEndpoint ( InetAddress endPoint ) throws IOException , TimeoutException , DigestMismatchException , InvalidRequestException { if ( HintedHandOffManager . logger_ . isDebugEnabled ( ) ) HintedHandOffManager . logger_ . debug ( ( "Started<seq2seq4repair_space>hinted<seq2seq4repair_space>handoff<seq2seq4repair_space>for<seq2seq4repair_space>endPoint<seq2seq4repair_space>" + endPoint ) ) ; byte [ ] targetEPBytes = endPoint . getAddress ( ) ; Table systemTable = Table . open ( SYSTEM_TABLE ) ; for ( String tableName : DatabaseDescriptor . getTables ( ) ) { <START_BUG> ColumnFamily hintedColumnFamily = systemTable . get ( tableName , HintedHandOffManager . HINTS_CF ) ; <END_BUG> if ( hintedColumnFamily == null ) { continue ; } Collection < IColumn > keys = hintedColumnFamily . getSortedColumns ( ) ; for ( IColumn keyColumn : keys ) { String keyStr = new String ( keyColumn . name ( ) , "UTF-8" ) ; Collection < IColumn > endpoints = keyColumn . getSubColumns ( ) ; for ( IColumn hintEndPoint : endpoints ) { if ( ( Arrays . equals ( hintEndPoint . name ( ) , targetEPBytes ) ) && ( HintedHandOffManager . sendMessage ( endPoint , tableName , keyStr ) ) ) { if ( ( endpoints . size ( ) ) == 1 ) { HintedHandOffManager . deleteHintKey ( tableName , keyColumn . name ( ) ) ; } else { HintedHandOffManager . deleteEndPoint ( hintEndPoint . name ( ) , tableName , keyColumn . name ( ) , System . currentTimeMillis ( ) ) ; } break ; } } } } if ( HintedHandOffManager . logger_ . isDebugEnabled ( ) ) HintedHandOffManager . logger_ . debug ( ( "Finished<seq2seq4repair_space>hinted<seq2seq4repair_space>handoff<seq2seq4repair_space>for<seq2seq4repair_space>endpoint<seq2seq4repair_space>" + endPoint ) ) ; } public void scheduleHandoffsFor ( final ColumnFamilyStore columnFamilyStore ) { } public void deliverHints ( final InetAddress to ) { } }

Fix:
ColumnFamily hintedColumnFamily = ColumnFamilyStore . removeDeleted ( systemTable . get ( tableName , HintedHandOffManager . HINTS_CF ) , Integer . MAX_VALUE ) ;
Buggy code:
public class LevelState { public static final float TICK = 1.0F ; private static HashSet < Actor > actors = new HashSet < Actor > ( ) ; private static Actor currentActor ; private static Map < Integer , Actor > actorIds = new HashMap < Integer , Actor > ( ) ; private static float now = 0 ; protected static Char [ ] chars = new Char [ Level . LENGTH ] ; public static void clear ( ) { } public static void fixTime ( ) { } public static void init ( ) { } public static void next ( Actor actor ) { } public static void process ( ) { } public static HashSet < Actor > getActors ( ) { } public static void setActors ( HashSet < Actor > actors ) { } public static Map < Integer , Actor > getActorIds ( ) { } public static void setActorIds ( Map < Integer , Actor > actorIds ) { } public static float getNow ( ) { } public static void setNow ( float now ) { } public static Char findChar ( int pos ) { } public static Char [ ] getChars ( ) { } public static void setChars ( Char [ ] chars ) { } public static void add ( Actor actor , float time ) { } public static void addDelayed ( Actor actor , float delay ) { } public static void add ( Actor actor ) { <START_BUG> LevelState . addDelayed ( actor , LevelState . getNow ( ) ) ; <END_BUG> } }

Fix:
LevelState . add ( actor , LevelState . getNow ( ) ) ;
Buggy code:
public class PluginLoader { private static final String mainPluginCategory = "fr.univnantes.mgsframework.MGSApplication" ; private String pluginsPath ; private Map < String , RunnablePlugin > runnablePlugins ; private Map < String , Plugin > classicPlugins ; private Map < String , List < Plugin > > pluginsByCategories ; private URLClassLoader loader ; public PluginLoader ( ) { } protected void loadPluginsList ( ) { System . out . println ( "Plugins<seq2seq4repair_space>loading" ) ; List < URL > pluginsPaths = new ArrayList < URL > ( ) ; File pluginsDir = new File ( this . pluginsPath ) ; if ( ( ( pluginsDir != null ) && ( pluginsDir . exists ( ) ) ) && ( pluginsDir . isDirectory ( ) ) ) { File [ ] files = pluginsDir . listFiles ( ) ; for ( int i = 0 ; i < ( files . length ) ; i ++ ) { File currentPlugin = files [ i ] ; if ( ( currentPlugin . isFile ( ) ) && ( currentPlugin . getName ( ) . endsWith ( ".jar" ) ) ) { Plugin plugin = null ; try { plugin = this . loadPluginConfiguration ( currentPlugin . getName ( ) ) ; } catch ( IOException e1 ) { System . err . println ( ( "*<seq2seq4repair_space>" + ( e1 . getMessage ( ) ) ) ) ; continue ; } System . out . println ( ( ( "*<seq2seq4repair_space>Plugin<seq2seq4repair_space>" + ( plugin . getName ( ) ) ) + "<seq2seq4repair_space>loaded." ) ) ; if ( plugin . isRunnable ( ) ) { this . runnablePlugins . put ( currentPlugin . getName ( ) , ( ( RunnablePlugin ) ( plugin ) ) ) ; this . loadPluginInterfaces ( ( ( RunnablePlugin ) ( plugin ) ) ) ; } else { this . classicPlugins . put ( currentPlugin . getName ( ) , plugin ) ; List < Plugin > sameCategoryPlugins = this . pluginsByCategories . get ( plugin . getCategory ( ) ) ; if ( sameCategoryPlugins == null ) { sameCategoryPlugins = new ArrayList < Plugin > ( ) ; } sameCategoryPlugins . add ( plugin ) ; if ( ( sameCategoryPlugins . size ( ) ) == 1 ) { this . pluginsByCategories . put ( plugin . getCategory ( ) , sameCategoryPlugins ) ; } } try { pluginsPaths . add ( new URL ( ( "file:////" + ( currentPlugin . getAbsolutePath ( ) ) ) ) ) ; } catch ( MalformedURLException e ) { System . err . println ( ( ( "Cannot<seq2seq4repair_space>access<seq2seq4repair_space>to<seq2seq4repair_space>" + ( currentPlugin . getAbsolutePath ( ) ) ) + "plugin" ) ) ; e . printStackTrace ( ) ; } } } } URL [ ] pathArray = new URL [ pluginsPaths . size ( ) ] ; pathArray = pluginsPaths . toArray ( pathArray ) ; <START_BUG> this . loader = new URLClassLoader ( pathArray ) ; <END_BUG> } private Plugin loadPluginConfiguration ( String pluginName ) throws IOException { } public MGSApplication loadApplication ( String pluginName ) throws IOException { } private void loadPluginInterfaces ( RunnablePlugin plugin ) { } public Object loadPlugin ( Plugin plugin ) throws IOException { } public Object loadPlugin ( String pluginName ) throws IOException { } public Collection < RunnablePlugin > getRunnablePluginsList ( ) { } public Collection < Plugin > getClassicPlugins ( ) { } public List < Plugin > getClassicPluginsByCategory ( String category ) { } }

Fix:
this . loader = new URLClassLoader ( pathArray , PluginLoader . class . getClassLoader ( ) ) ;
Buggy code:
public class SampleViewPagerFragment extends Fragment { private static String LIST_DATA = "listdata" ; private static String POSITION = "position" ; private ViewPager mViewPager ; private int mDefaultPosition ; ArrayList < SampleData > mSamplelist ; public static SampleViewPagerFragment newInstance ( ArrayList < SampleData > list , int position ) { } @ Override public void onActivityCreated ( Bundle savedInstanceState ) { } @ Override public void onCreate ( Bundle savedInstanceState ) { } @ Override public View onCreateView ( LayoutInflater inflater , ViewGroup container , Bundle savedInstanceState ) { View view = inflater . inflate ( sample_viewpager , null ) ; mViewPager = ( ( ViewPager ) ( view . findViewById ( viewpager ) ) ) ; <START_BUG> FragmentManager fm = getActivity ( ) . getSupportFragmentManager ( ) ; <END_BUG> mViewPager . setAdapter ( new SampleViewPagerFragment . SampleDetailPagerAdapter ( fm ) ) ; mViewPager . setOnPageChangeListener ( mOnPageChangeListener ) ; mViewPager . setCurrentItem ( mDefaultPosition ) ; getActivity ( ) . setTitle ( mSamplelist . get ( mDefaultPosition ) . getName ( ) ) ; return view ; } @ Override public void onDestroy ( ) { } private OnPageChangeListener mOnPageChangeListener = new OnPageChangeListener ( ) { @ Override public void onPageScrollStateChanged ( int arg0 ) { } @ Override public void onPageScrolled ( int arg0 , float arg1 , int arg2 ) { } @ Override public void onPageSelected ( int postion ) { } } ; public class SampleDetailPagerAdapter extends FragmentPagerAdapter { public SampleDetailPagerAdapter ( FragmentManager fm ) { } @ Override public Fragment getItem ( int position ) { } @ Override public int getCount ( ) { } } }

Fix:
FragmentManager fm = getChildFragmentManager ( ) ;
Buggy code:
public class Knights { private int [ ] [ ] places ; private int next ; private int numX ; private int numY ; private int startX ; private int startY ; private boolean solved = false ; private int [ ] [ ] moves = new int [ ] [ ] { new int [ ] { - 2 , - 1 } , new int [ ] { - 2 , 1 } , new int [ ] { - 1 , 2 } , new int [ ] { 1 , 2 } , new int [ ] { 2 , 1 } , new int [ ] { 2 , - 1 } , new int [ ] { 1 , - 2 } , new int [ ] { - 1 , - 2 } } ; private int statesTried = 0 ; private int successes = 0 ; public Knights ( int x , int y , int startX , int startY ) { } public void solve ( int x , int y ) { ( statesTried ) ++ ; if ( ( ( ( ( x >= ( numX ) ) || ( x < 0 ) ) || ( y >= ( numY ) ) ) || ( y < 0 ) ) || ( ( places [ x ] [ y ] ) > 0 ) ) { return ; } if ( solved ) { System . out . println ( "You<seq2seq4repair_space>have<seq2seq4repair_space>solved<seq2seq4repair_space>it" ) ; System . exit ( 0 ) ; } Boolean notStupid = false ; for ( int i = 0 ; i < ( moves . length ) ; i ++ ) { try { if ( ( places [ ( x + ( moves [ i ] [ 0 ] ) ) ] [ ( y + ( moves [ i ] [ 1 ] ) ) ] ) == ( ( next ) - 1 ) ) { notStupid = true ; } } catch ( ArrayIndexOutOfBoundsException e ) { } } if ( notStupid ) { places [ x ] [ y ] = next ; ( next ) ++ ; <START_BUG> if ( ( next ) == 25 ) { <END_BUG> printBoard ( ) ; System . out . println ( statesTried ) ; solved = true ; } for ( int p = 0 ; p < ( moves . length ) ; p ++ ) { solve ( ( x + ( moves [ p ] [ 0 ] ) ) , ( y + ( moves [ p ] [ 1 ] ) ) ) ; } if ( ( x == ( startX ) ) && ( y == ( startY ) ) ) { System . out . println ( "there<seq2seq4repair_space>are<seq2seq4repair_space>no<seq2seq4repair_space>solutions<seq2seq4repair_space>here" ) ; } else { places [ x ] [ y ] = 0 ; ( next ) -- ; return ; } } else return ; } public void printBoard ( ) { } }

Fix:
if ( ( next ) == 26 ) {
Buggy code:
public class MemberFragment extends PageFragment { private SQLiteDatabase database ; private SimpleCursorAdapter cursorAdapter ; @ Override public void onCreate ( Bundle saved ) { } @ Override public View onCreateView ( LayoutInflater inflater , ViewGroup container , Bundle savedInstanceState ) { } private void refreshContent ( ) { <START_BUG> SwipeRefreshLayout swipeRefreshLayout = ( ( SwipeRefreshLayout ) ( getActivity ( ) . findViewById ( event_swipe_layout ) ) ) ; <END_BUG> IDownloadTask downloadMembers = new MemberDownloadTask ( getActivity ( ) , true ) ; BackgroundDownloader backgroundDownloader = new BackgroundDownloader ( getActivity ( ) ) ; backgroundDownloader . executeOnExecutor ( THREAD_POOL_EXECUTOR , downloadMembers ) ; swipeRefreshLayout . setRefreshing ( false ) ; } private OnItemClickListener clickHandler = new AdapterView . OnItemClickListener ( ) { @ Override public void onItemClick ( AdapterView < ? > parent , View view , int position , long id ) { } } ; @ Override protected String getTitle ( ) { } }

Fix:
SwipeRefreshLayout swipeRefreshLayout = ( ( SwipeRefreshLayout ) ( getActivity ( ) . findViewById ( membership_swipe_layout ) ) ) ;
Buggy code:
@ RunWith ( Arquillian . class ) public class DeployedXmlDataSourceTestCase { private static ModelControllerClient client ; private static ServerDeploymentManager manager ; public static final String TEST_DS_XML = "test-ds.xml" ; @ Deployment public static Archive < ? > deploy ( ) { <START_BUG> return ShrinkWrap . create ( JavaArchive . class , "testDsXmlDeployment.jar" ) . addPackage ( DeployedXmlDataSourceTestCase . class . getPackage ( ) ) . addAsManifestResource ( DeployedXmlDataSourceTestCase . class . getPackage ( ) , "MANIFEST.MF" , "MANIFEST.MF" ) ; <END_BUG> } @ ArquillianResource private InitialContext initialContext ; @ BeforeClass public static void deployDatasource ( ) throws Throwable { } @ AfterClass public static void undeployDatasource ( ) throws IOException { } @ Test public void testDeployedDataSource ( ) throws Throwable { } @ Test public void testDeployedXaDataSource ( ) throws Throwable { } }

Fix:
return ShrinkWrap . create ( JavaArchive . class , "testDsXmlDeployment.jar" ) . addClass ( DeployedXmlDataSourceTestCase . class ) . addAsManifestResource ( DeployedXmlDataSourceTestCase . class . getPackage ( ) , "MANIFEST.MF" , "MANIFEST.MF" ) ;
Buggy code:
public final class TTL { private TTL ( ) { } static void check ( long i ) { } public static long parseTTL ( String s ) { <START_BUG> if ( ( s == null ) || ( ! ( Character . isDigit ( s . charAt ( 0 ) ) ) ) ) <END_BUG> throw new NumberFormatException ( ) ; long value = 0 ; long ttl = 0 ; for ( int i = 0 ; i < ( s . length ( ) ) ; i ++ ) { char c = s . charAt ( i ) ; long oldvalue = value ; if ( Character . isDigit ( c ) ) { value = ( value * 10 ) + ( Character . getNumericValue ( c ) ) ; if ( value < oldvalue ) throw new NumberFormatException ( ) ; } else { switch ( Character . toUpperCase ( c ) ) { case 'W' : value *= 7 ; case 'D' : value *= 24 ; case 'H' : value *= 60 ; case 'M' : value *= 60 ; case 'S' : break ; default : throw new NumberFormatException ( ) ; } ttl += value ; value = 0 ; if ( ttl > 4294967295L ) throw new NumberFormatException ( ) ; } } if ( ttl == 0 ) { ttl = value ; if ( ttl > 4294967295L ) throw new NumberFormatException ( ) ; } return ttl ; } public static String format ( long ttl ) { } }

Fix:
if ( ( ( s == null ) || ( ( s . length ( ) ) == 0 ) ) || ( ! ( Character . isDigit ( s . charAt ( 0 ) ) ) ) )
Buggy code:
public class DummyFileTransferContainerInstantiator implements IContainerInstantiator { <START_BUG> public IContainer createInstance ( ContainerTypeDescription description , Class [ ] argTypes , Object [ ] args ) throws ContainerCreateException { <END_BUG> throw new ContainerCreateException ( "can't<seq2seq4repair_space>create<seq2seq4repair_space>an<seq2seq4repair_space>instance<seq2seq4repair_space>of<seq2seq4repair_space>dummy" ) ; } }

Fix:
public IContainer createInstance ( ContainerTypeDescription description , Object [ ] args ) throws ContainerCreateException {
Buggy code:
public class WeaponUpgrade extends Stage { private Dialog mainDialog ; private Choice a ; private Choice b ; private Choice c ; private int x = 0 ; private int y = 0 ; @ Override public void choiceClicked ( Element elementVar ) { } @ Override public void taskPerformed ( ) { } @ Override public void init ( ) { mainDialog = new Dialog ( "" ) ; <START_BUG> mainDialog . setText ( "Hi!" , "Weapon:<seq2seq4repair_space>" , ( "Level:<seq2seq4repair_space>" + ( player . getlevel ( ) ) ) , "Upgradeable:<seq2seq4repair_space>" ) ; <END_BUG> } }

Fix:
mainDialog . setText ( "Hi!" , "Weapon:<seq2seq4repair_space>" , ( "Level:<seq2seq4repair_space>" + ( player . getLevel ( ) ) ) , "Upgradeable:<seq2seq4repair_space>" ) ;
Buggy code:
public class SSTableImport { private static final String KEYSPACE_OPTION = "K" ; private static final String COLFAM_OPTION = "c" ; private static Options options ; private static CommandLine cmd ; private static class JsonColumn { private String name ; private String value ; private long timestamp ; private boolean isDeleted ; private JsonColumn ( Object obj ) throws ClassCastException { } } private static void addToStandardCF ( JSONArray row , ColumnFamily cfamily ) { } private static void addToSuperCF ( JSONObject row , ColumnFamily cfamily ) { } public static void importJson ( String jsonFile , String keyspace , String cf , String ssTablePath ) throws IOException , ParseException { ColumnFamily cfamily = ColumnFamily . create ( keyspace , cf ) ; ColumnFamilyType cfType = cfamily . getColumnFamilyType ( ) ; IPartitioner < ? > partitioner = DatabaseDescriptor . getPartitioner ( ) ; try { JSONObject json = ( ( JSONObject ) ( JSONValue . parseWithException ( new FileReader ( jsonFile ) ) ) ) ; <START_BUG> SSTableWriter writer = new SSTableWriter ( ssTablePath , json . size ( ) , partitioner ) ; <END_BUG> SortedMap < DecoratedKey , String > decoratedKeys = new TreeMap < DecoratedKey , String > ( ) ; for ( String key : ( ( Set < String > ) ( json . keySet ( ) ) ) ) decoratedKeys . put ( partitioner . decorateKey ( hexToBytes ( key ) ) , key ) ; for ( Map . Entry < DecoratedKey , String > rowKey : decoratedKeys . entrySet ( ) ) { if ( cfType == ( ColumnFamilyType . Super ) ) SSTableImport . addToSuperCF ( ( ( JSONObject ) ( json . get ( rowKey . getValue ( ) ) ) ) , cfamily ) ; else SSTableImport . addToStandardCF ( ( ( JSONArray ) ( json . get ( rowKey . getValue ( ) ) ) ) , cfamily ) ; writer . append ( rowKey . getKey ( ) , cfamily ) ; cfamily . clear ( ) ; } writer . closeAndOpenReader ( ) ; } catch ( ClassCastException cce ) { throw new RuntimeException ( "Invalid<seq2seq4repair_space>JSON<seq2seq4repair_space>input,<seq2seq4repair_space>or<seq2seq4repair_space>incorrect<seq2seq4repair_space>column<seq2seq4repair_space>family." , cce ) ; } } public static void main ( String [ ] args ) throws IOException , ConfigurationException , ParseException { } }

Fix:
SSTableWriter writer = new SSTableWriter ( ssTablePath , json . size ( ) ) ;
Buggy code:
public class EventPublicationInterceptorTests { private ApplicationEventPublisher publisher ; @ Before public void setUp ( ) { } @ Test ( expected = IllegalArgumentException . class ) public void testWithNoApplicationEventClassSupplied ( ) throws Exception { } @ Test ( expected = IllegalArgumentException . class ) public void testWithNonApplicationEventClassSupplied ( ) throws Exception { } @ Test ( expected = IllegalArgumentException . class ) public void testWithAbstractStraightApplicationEventClassSupplied ( ) throws Exception { } @ Test ( expected = IllegalArgumentException . class ) public void testWithApplicationEventClassThatDoesntExposeAValidCtor ( ) throws Exception { } @ Test public void testExpectedBehavior ( ) throws Exception { TestBean target = new TestBean ( ) ; final TestListener listener = new TestListener ( ) ; class TestContext extends StaticApplicationContext { @ Override protected void onRefresh ( ) throws BeansException { <START_BUG> addApplicationListener ( listener ) ; <END_BUG> } } StaticApplicationContext ctx = new TestContext ( ) ; MutablePropertyValues pvs = new MutablePropertyValues ( ) ; pvs . add ( "applicationEventClass" , EventPublicationInterceptorTests . TestEvent . class . getName ( ) ) ; ctx . registerSingleton ( "publisher" , EventPublicationInterceptor . class , pvs ) ; ctx . registerSingleton ( "otherListener" , EventPublicationInterceptorTests . FactoryBeanTestListener . class ) ; ctx . refresh ( ) ; EventPublicationInterceptor interceptor = ( ( EventPublicationInterceptor ) ( ctx . getBean ( "publisher" ) ) ) ; ProxyFactory factory = new ProxyFactory ( target ) ; factory . addAdvice ( 0 , interceptor ) ; ITestBean testBean = ( ( ITestBean ) ( factory . getProxy ( ) ) ) ; testBean . getAge ( ) ; assertTrue ( "Interceptor<seq2seq4repair_space>must<seq2seq4repair_space>have<seq2seq4repair_space>published<seq2seq4repair_space>2<seq2seq4repair_space>events" , ( ( listener . getEventCount ( ) ) == 2 ) ) ; TestListener otherListener = ( ( TestListener ) ( ctx . getBean ( "&otherListener" ) ) ) ; assertTrue ( "Interceptor<seq2seq4repair_space>must<seq2seq4repair_space>have<seq2seq4repair_space>published<seq2seq4repair_space>2<seq2seq4repair_space>events" , ( ( otherListener . getEventCount ( ) ) == 2 ) ) ; } @ SuppressWarnings ( "serial" ) public static class TestEvent extends ApplicationEvent { public TestEvent ( Object source ) { } } @ SuppressWarnings ( "serial" ) public static final class TestEventWithNoValidOneArgObjectCtor extends ApplicationEvent { public TestEventWithNoValidOneArgObjectCtor ( ) { } } public static class FactoryBeanTestListener extends TestListener implements FactoryBean < Object > { @ Override public Object getObject ( ) throws Exception { } @ Override public Class < String > getObjectType ( ) { } @ Override public boolean isSingleton ( ) { } } }

Fix:
addListener ( listener ) ;
Buggy code:
public final class Utils { private Utils ( ) { } public static void parse ( HashMap < String , String > hashMap , Attributes attributes , String ... strings ) { } public static String capitaliseEachFirstLetter ( String s ) { } public static boolean withinRangeInclusive ( float min , float max , float value ) { } public static boolean withinRangeExclusive ( float min , float max , float value ) { } public static boolean withinRangeInclusive ( int min , int max , int value ) { } public static boolean withinRangeExclusive ( int min , int max , int value ) { } public static boolean withinRangeInclusive ( double min , double max , double value ) { } public static boolean withinRangeExclusive ( double min , double max , double value ) { } public static boolean validARGB ( String string ) { } public static boolean validShadow ( String string ) { } public static boolean validAlignment ( String string ) { try { <START_BUG> return string . matches ( "left|right|centre|none" ) ; <END_BUG> } catch ( Exception e ) { return false ; } } public static boolean validFont ( String string ) { } public static boolean validShadingType ( String string ) { } public static boolean validShape ( String string ) { } }

Fix:
return string . matches ( "left|right|center|none" ) ;
Buggy code:
public class BlockValueCalculator { public int islandPoints ; private Map < String , Integer > poolValues = new HashMap < > ( ) ; private BlockValueMapping mapping ; public BlockValueCalculator ( ) { } public BlockValueCalculator ( BlockValueMapping mapping ) { } @ SuppressWarnings ( "deprecation" ) public void addBlock ( Block block ) { } @ SuppressWarnings ( "deprecation" ) public void addBlock ( int materialId ) { } @ SuppressWarnings ( "deprecation" ) public void addBlock ( int materialId , byte dataValue ) { } public void addBlock ( Material material ) { } public void addBlock ( Material material , byte dataValue ) { BlockValueData valueData = mapping . blockValues . getValueOrDefault ( material , dataValue ) ; if ( ! ( poolValues . containsKey ( valueData . maximumPool ) ) ) { poolValues . put ( valueData . maximumPool , 0 ) ; } <START_BUG> if ( ( ( poolValues . get ( valueData . maximumPool ) ) <= ( mapping . maximumPools . getValueOrDefault ( valueData . maximumPool ) . maximumValue ) ) || ( ( mapping . maximumPools . getValueOrDefault ( valueData . maximumPool ) . maximumValue ) == ( - 1 ) ) ) { <END_BUG> islandPoints += valueData . value ; } else { islandPoints += valueData . postPoolValue ; } poolValues . put ( valueData . maximumPool , ( ( poolValues . get ( valueData . maximumPool ) ) + ( valueData . poolChange ) ) ) ; } }

Fix:
if ( ( ( poolValues . get ( valueData . maximumPool ) ) < ( mapping . maximumPools . getValueOrDefault ( valueData . maximumPool ) . maximumValue ) ) || ( ( mapping . maximumPools . getValueOrDefault ( valueData . maximumPool ) . maximumValue ) == ( - 1 ) ) ) {
Buggy code:
public class ARPESGoldCalibrationCorrection extends AbstractOperation < ARPESGoldCalibrationCorrectionModel , OperationData > { String filename = "" ; IDataset goldData = null ; @ Override public String getId ( ) { } @ Override protected OperationData process ( IDataset input , IMonitor monitor ) throws OperationException { if ( ! ( ( ( ( filename ) != null ) && ( filename . equals ( model . getFilePath ( ) ) ) ) && ( ( goldData ) != null ) ) ) { try { filename = model . getFilePath ( ) ; goldData = LoaderFactory . getDataSet ( model . getFilePath ( ) , "//entry//calibration//fittedMu//data" , null ) ; } catch ( Exception e ) { throw new OperationException ( this , "Not<seq2seq4repair_space>an<seq2seq4repair_space>appropriate<seq2seq4repair_space>calibration<seq2seq4repair_space>file<seq2seq4repair_space>selected" ) ; } } Dataset differences = Maths . subtract ( goldData , goldData . mean ( ) ) ; AxesMetadata axesMetadata ; try { axesMetadata = input . getMetadata ( AxesMetadata . class ) . get ( 0 ) ; } catch ( Exception e ) { throw new OperationException ( this , "Metadata<seq2seq4repair_space>such<seq2seq4repair_space>as<seq2seq4repair_space>Axis<seq2seq4repair_space>not<seq2seq4repair_space>available<seq2seq4repair_space>in<seq2seq4repair_space>this<seq2seq4repair_space>dataset" ) ; } IDataset xAxis = null ; try { xAxis = DatasetUtils . convertToDataset ( axesMetadata . getAxis ( 1 ) [ 0 ] ) ; } catch ( Exception e ) { throw new OperationException ( this , "Cannot<seq2seq4repair_space>get<seq2seq4repair_space>Energy<seq2seq4repair_space>Axis<seq2seq4repair_space>information" ) ; } double meanSteps = ( ( xAxis . max ( ) . doubleValue ( ) ) - ( xAxis . min ( ) . doubleValue ( ) ) ) // ( ( float ) ( xAxis . getShape ( ) [ 1 ] ) ) ; Dataset differenceInts = Maths . floor ( Maths . divide ( differences , meanSteps ) ) ; int [ ] shape = input . getShape ( ) ; DoubleDataset result = new DoubleDataset ( shape ) ; for ( int y = 0 ; y < ( shape [ 0 ] ) ; y ++ ) { int min = Math . max ( differenceInts . getInt ( 0 , y ) , 0 ) ; int max = Math . min ( ( ( shape [ 1 ] ) + ( differenceInts . getInt ( 0 , y ) ) ) , shape [ 1 ] ) ; <START_BUG> int ref = 0 ; <END_BUG> for ( int xx = min ; xx < max ; xx ++ ) { result . set ( input . getObject ( y , xx ) , y , ref ) ; ref ++ ; } } copyMetadata ( input , result ) ; result . setName ( "Fermi<seq2seq4repair_space>Edge<seq2seq4repair_space>Corrected" ) ; Dataset newEnergyAxis = Maths . subtract ( xAxis , goldData . mean ( ) ) ; newEnergyAxis . imultiply ( ( - 1.0 ) ) ; newEnergyAxis . iadd ( model . getEnergyOffset ( ) ) ; newEnergyAxis . setName ( "Binding<seq2seq4repair_space>Energy" ) ; try { axesMetadata = result . getMetadata ( AxesMetadata . class ) . get ( 0 ) ; axesMetadata . setAxis ( 1 , newEnergyAxis ) ; } catch ( Exception e ) { throw new OperationException ( this , e ) ; } OperationData opData = new OperationData ( result ) ; return opData ; } @ Override public OperationRank getInputRank ( ) { } @ Override public OperationRank getOutputRank ( ) { } }

Fix:
int ref = ( Math . min ( differenceInts . getInt ( 0 , y ) , 0 ) ) * ( - 1 ) ;
Buggy code:
public final class XMLMemento implements IMemento { private Document factory ; private Element element ; public static XMLMemento createReadRoot ( Reader reader ) throws WorkbenchException { } public static XMLMemento createReadRoot ( Reader reader , String baseDir ) throws WorkbenchException { } public static XMLMemento createWriteRoot ( String type ) { } public XMLMemento ( Document document , Element element ) { } public IMemento createChild ( String type ) { } public IMemento createChild ( String type , String id ) { Element child = factory . createElement ( type ) ; <START_BUG> child . setAttribute ( TAG_ID , id ) ; <END_BUG> element . appendChild ( child ) ; return new XMLMemento ( factory , child ) ; } public IMemento copyChild ( IMemento child ) { } public IMemento getChild ( String type ) { } public IMemento [ ] getChildren ( String type ) { } public Float getFloat ( String key ) { } public String getID ( ) { } public Integer getInteger ( String key ) { } public String getString ( String key ) { } public String getTextData ( ) { } private Text getTextNode ( ) { } private void putElement ( Element element ) { } public void putFloat ( String key , float f ) { } public void putInteger ( String key , int n ) { } public void putMemento ( IMemento memento ) { } public void putString ( String key , String value ) { } public void putTextData ( String data ) { } public void save ( Writer writer ) throws IOException { } }

Fix:
child . setAttribute ( TAG_ID , ( id == null ? "" : id ) ) ;
Buggy code:
public class FileListBlock extends Block { protected int offset = 0 ; protected String prevPath = null ; protected String [ ] paths = null ; public FileListBlock ( int blockSize ) { } public boolean addFile ( IndexedFile indexedFile ) { int offset = this . offset ; if ( isEmpty ( ) ) { field . putInt4 ( offset , indexedFile . getFileNumber ( ) ) ; offset += 4 ; } <START_BUG> String path = ( indexedFile . getPath ( ) ) + ( indexedFile . propertiesToString ( ) ) ; <END_BUG> int prefixLen = ( ( prevPath ) == null ) ? 0 : Util . prefixLength ( prevPath , path ) ; int sizeEstimate = ( 2 + 2 ) + ( ( ( path . length ( ) ) - prefixLen ) * 3 ) ; if ( ( offset + sizeEstimate ) > ( ( blockSize ) - 2 ) ) return false ; field . putInt2 ( offset , prefixLen ) ; offset += 2 ; char [ ] chars = new char [ ( path . length ( ) ) - prefixLen ] ; path . getChars ( prefixLen , path . length ( ) , chars , 0 ) ; offset += field . putUTF ( offset , chars ) ; this . offset = offset ; prevPath = path ; return true ; } public void clear ( ) { } public void flush ( ) { } public IndexedFile getFile ( int fileNum ) throws IOException { } protected String [ ] getPaths ( ) throws IOException { } public boolean isEmpty ( ) { } public void reset ( ) { } }

Fix:
String path = indexedFile . getPath ( ) ;
Buggy code:
public class TestMethodTest { @ SuppressWarnings ( "all" ) public static class EverythingWrong { private EverythingWrong ( ) { } @ BeforeClass public void notStaticBC ( ) { } @ BeforeClass static void notPublicBC ( ) { } @ BeforeClass public static int nonVoidBC ( ) { } @ BeforeClass public static void argumentsBC ( int i ) { } @ BeforeClass public static void fineBC ( ) { } @ AfterClass public void notStaticAC ( ) { } @ AfterClass static void notPublicAC ( ) { } @ AfterClass public static int nonVoidAC ( ) { } @ AfterClass public static void argumentsAC ( int i ) { } @ AfterClass public static void fineAC ( ) { } @ After public static void staticA ( ) { } @ After void notPublicA ( ) { } @ After public int nonVoidA ( ) { } @ After public void argumentsA ( int i ) { } @ After public void fineA ( ) { } @ Before public static void staticB ( ) { } @ Before void notPublicB ( ) { } @ Before public int nonVoidB ( ) { } @ Before public void argumentsB ( int i ) { } @ Before public void fineB ( ) { } @ Test public static void staticT ( ) { } @ Test void notPublicT ( ) { } @ Test public int nonVoidT ( ) { } @ Test public void argumentsT ( int i ) { } @ Test public void fineT ( ) { } } @ Test public void testFailures ( ) throws Exception { } public static class SuperWrong { @ Test void notPublic ( ) { } } public static class SubWrong extends TestMethodTest . SuperWrong { @ Test public void justFine ( ) { } } @ Test public void validateInheritedMethods ( ) throws Exception { } public static class SubShadows extends TestMethodTest . SuperWrong { @ Override @ Test public void notPublic ( ) { } } @ Test public void dontValidateShadowedMethods ( ) throws Exception { } private List < Throwable > validateAllMethods ( Class < ? > clazz ) { } public static class IgnoredTest { @ Test public void valid ( ) { } @ Ignore @ Test public void ignored ( ) { } @ Ignore ( "For<seq2seq4repair_space>testing<seq2seq4repair_space>purposes" ) @ Test public void withReason ( ) { } } @ Test public void ignoreRunner ( ) { } @ Test public void compatibility ( ) { } public static class Confused { @ Test public void a ( Object b ) { } @ Test public void a ( ) { } } @ Test public void overloaded ( ) { MethodValidator validator = new MethodValidator ( TestMethodTest . Confused . class ) ; <START_BUG> List < Throwable > errors = validator . validateAllMethods ( ) ; <END_BUG> Assert . assertEquals ( 1 , errors . size ( ) ) ; } public static class OnlyTestIsIgnored { @ Ignore @ Test public void ignored ( ) { } } @ Test public void onlyIgnoredMethodsIsStillFineTestClass ( ) { } }

Fix:
List < Throwable > errors = validator . validateMethodsForDefaultRunner ( ) ;