nus-yam/ex-repair huggingface dataset:
Buggy code:
public class NotLogging { static int runLength ; static final int INITIAL_HASH_SIZE = 101 ; static String SHORT_MSG = "Hello<seq2seq4repair_space>World" ; static Category SHORT_CAT = Category . getInstance ( "A0123456789" ) ; static Category MEDIUM_CAT = Category . getInstance ( "A0123456789.B0123456789" ) ; static Category LONG_CAT = Category . getInstance ( "A0123456789.B0123456789.C0123456789" ) ; static Category INEXISTENT_SHORT_CAT = Category . getInstance ( "I0123456789" ) ; static Category INEXISTENT_MEDIUM_CAT = Category . getInstance ( "I0123456789.B0123456789" ) ; static Category INEXISTENT_LONG_CAT = Category . getInstance ( "I0123456789.B0123456789.C0123456789" ) ; static Category [ ] CAT_ARRAY = new Category [ ] { NotLogging . SHORT_CAT , NotLogging . MEDIUM_CAT , NotLogging . LONG_CAT , NotLogging . INEXISTENT_SHORT_CAT , NotLogging . INEXISTENT_MEDIUM_CAT , NotLogging . INEXISTENT_LONG_CAT } ; static void Usage ( ) { } public static void main ( String [ ] argv ) { } static void ProgramInit ( String [ ] args ) { try { NotLogging . runLength = Integer . parseInt ( args [ 1 ] ) ; } catch ( NumberFormatException e ) { System . err . println ( e ) ; NotLogging . Usage ( ) ; } FileAppender appender = new FileAppender ( new SimpleLayout ( ) , System . err ) ; if ( "false" . equals ( args [ 0 ] ) ) if ( "true" . equals ( args [ 0 ] ) ) { System . out . println ( "Flagging<seq2seq4repair_space>as<seq2seq4repair_space>shipped<seq2seq4repair_space>code." ) ; <START_BUG> org . apache . log4j . BasicConfigurator . disableInfo ( ) ; <END_BUG> } else NotLogging . Usage ( ) ; NotLogging . SHORT_CAT . setPriority ( Priority . INFO ) ; Category . getRoot ( ) . setPriority ( Priority . INFO ) ; } static double SimpleMessage ( Category category , String msg , long runLength ) { } static double FullyOptimizedComplexMessage ( Category category , long runLength ) { } static double ComplexMessage ( Category category , long runLength ) { } }

Fix:
Category . getDefaultHierarchy ( ) . disableInfo ( ) ;
Buggy code:
public abstract class DefaultUtil { protected String outputString ; protected String errorString ; protected InputStream outputStream ; protected InputStream errorStream ; protected Process executeCommand ( String [ ] cmd ) throws Exception { } protected abstract String parse ( String str ) { } public String getErrorString ( ) { } public String getOutputString ( ) { } public String getResult ( ) { } public InputStream getStreamResult ( ) { } public InputStream getErrorStream ( ) { } protected abstract String [ ] getRawCommandString ( int type ) { } protected String getPath ( String type ) { } protected String [ ] getCommandString ( int type , PGPItem item ) { } private String getValue ( String name , PGPItem item ) { if ( name . equals ( "user" ) ) { return item . get ( "id" ) ; } if ( name . equals ( "recipients" ) ) { <START_BUG> return item . get ( "recipients" ) ; <END_BUG> } if ( name . equals ( "sigfile" ) ) { return item . get ( "sigfile" ) ; } return null ; } public int verify ( PGPItem item , InputStream message , InputStream signature ) throws Exception { } public int sign ( PGPItem item , InputStream pgpMessage ) throws Exception { } public int sign ( PGPItem item , String input ) throws Exception { } public int encrypt ( PGPItem item , InputStream message ) throws Exception { } public int decrypt ( PGPItem item , InputStream cryptMessage ) throws Exception { } }

Fix:
return item . get ( "id" ) ;
Buggy code:
public class PromptNewUserState implements State { private final StateValues stateValues ; private ConsoleWrapper theConsole ; public PromptNewUserState ( ConsoleWrapper theConsole , final StateValues stateValues ) { } @ Override public State execute ( ) { State continuingState = new ValidateUserState ( theConsole , stateValues ) ; if ( ( stateValues . isSilentOrNonInteractive ( ) ) == false ) { stateValues . setPassword ( null ) ; String existingUsername = stateValues . getUserName ( ) ; String usernamePrompt = ( existingUsername == null ) ? ROOT_LOGGER . usernamePrompt ( ) : ROOT_LOGGER . usernamePrompt ( existingUsername ) ; theConsole . printf ( usernamePrompt ) ; String temp = theConsole . readLine ( "<seq2seq4repair_space>:<seq2seq4repair_space>" ) ; if ( ( temp != null ) && ( ( temp . length ( ) ) > 0 ) ) { existingUsername = temp ; } if ( ( ( temp == null ) || ( existingUsername == null ) ) || ( ( existingUsername . length ( ) ) == 0 ) ) { <START_BUG> return new ErrorState ( theConsole , ROOT_LOGGER . noUsernameExiting ( ) , stateValues ) ; <END_BUG> } stateValues . setUserName ( existingUsername ) ; } return continuingState ; } }

Fix:
return new ErrorState ( theConsole , ROOT_LOGGER . noUsernameExiting ( ) ) ;
Buggy code:
public class DistConfig implements Serializable { private static final long serialVersionUID = 1L ; private static DistConfig distConf = null ; private boolean useGlobalPathTable = false ; private boolean useGlobalNodeTable = false ; private int MAXNODES = 40 ; private int CURRNODES = 0 ; private int ServPortNumber = 8956 ; private String rootpath = null ; private int bufferSize = 1024 ; private int servertimeout = 300000 ; private DistConfig ( ) { } public static DistConfig get_Instance ( ) { } public static DistConfig set_Instance ( DistConfig distconfiguration ) { } public int get_MaxNodes ( ) { } public boolean get_UseGlobalNodeTable ( ) { } public int get_CurrNodes ( ) { } public int increment_CurrNodes ( ) { } public int decrement_CurrNodes ( ) { } public int get_servPortNumber ( ) { } public int set_servPortNumber ( int port ) { } public boolean get_useGlobalPathTable ( ) { } public String get_rootPath ( ) { <START_BUG> return this . rootpath ; <END_BUG> } public int getBufferSize ( ) { } public void setBufferSize ( int bufferSize ) { } public int getServertimeout ( ) { } public void setServertimeout ( int servertimeout ) { } }

Fix:
return ( this . rootpath ) + ( System . getProperty ( "file.separator" ) ) ;
Buggy code:
public class ResourcesTest extends BaseTest { private static Resource [ ] resourceList ; private static ResourceDao resourceDao ; private static Category category ; @ BeforeClass public static void setUp ( ) { } @ Test public void testSimpleSearch ( ) throws JSONException { } @ Test public void testPagination ( ) throws JSONException { } @ Test public void testSearchResourceType ( ) throws JSONException { } @ Test public void testSearchCategory ( ) throws JSONException { } @ Test public void testSearchQuery ( ) throws JSONException { } @ Test public void testSearchEmpty ( ) throws JSONException { } @ Test public void testAddAndRemoveCateogry ( ) { Resource resource = new Resource ( ) ; Category category = new Category ( ) ; resource . id = 5 ; category . id = 10 ; CategoryDao categoryDao = mock ( CategoryDao . class ) ; Dependencies . setCategoryDao ( categoryDao ) ; when ( ResourcesTest . resourceDao . findById ( 5 ) ) . thenReturn ( resource ) ; when ( categoryDao . findById ( 10 ) ) . thenReturn ( category ) ; final String EXPERT_EMAIL = "expert@expert.com" ; User expert = newUser ( 1 , EXPERT_EMAIL , "hispassword" ) ; Role expertRole = new Role ( "expert" ) ; <START_BUG> expert . assignRole ( expertRole ) ; <END_BUG> UserDao userDao = mock ( UserDao . class ) ; Dependencies . setUserDao ( userDao ) ; when ( userDao . findByEmail ( EXPERT_EMAIL ) ) . thenReturn ( expert ) ; Result result = makeRequest ( Resources . addCategory ( ) , ImmutableMap . of ( "category" , "10" , "resource" , "5" ) , EXPERT_EMAIL ) ; assertSuccess ( result ) ; assertTrue ( resource . categories . contains ( category ) ) ; result = makeRequest ( Resources . removeCategory ( ) , ImmutableMap . of ( "category" , "10" , "resource" , "5" ) , EXPERT_EMAIL ) ; assertSuccess ( result ) ; assertFalse ( resource . categories . contains ( category ) ) ; } private void assertResults ( Result result , List < Resource > resources ) throws JSONException { } private void assertResults ( Result result , Resource [ ] resources ) throws JSONException { } private void assertSuccess ( String message , Result result ) { } private void assertSuccess ( Result result ) { } private List < Resource > select ( int ... resourceIndices ) { } }

Fix:
expert . assignRole ( expertRole , false ) ;
Buggy code:
@ Deprecated public class IntruderParser { public IntruderParser ( ) { } private Map < String , ClassInfo > classMap = new HashMap < String , ClassInfo > ( ) ; protected ClassInfo findClassName ( String className ) { } @ Deprecated protected MethodInfo findMethodCall ( String methodCompleteName ) { } private Map < Long , MethodStack > perThreadStack = new HashMap < Long , MethodStack > ( ) ; protected MethodStack getPerThreadStack ( long pid ) { } public void parse ( File file ) throws IOException { } private Map < Integer , MethodInfo > methodReferenceMap = new ConcurrentHashMap < Integer , MethodInfo > ( ) ; @ Deprecated public void registerMethodReference ( int referenceId , String className , String methodName ) { } @ Deprecated public synchronized void addCall ( long time , long pid , boolean enter , int referenceId ) { } @ Deprecated public synchronized void addCall ( long time , long pid , boolean enter , String method ) { } @ Deprecated public final synchronized void addCall ( long time , long pid , boolean enter , MethodInfo methodCall ) { } private void doParse ( BufferedReader br ) throws IOException , NumberFormatException { } private String protectMethodName ( String methodName ) { } private String protectClassName ( String className ) { } private void dump ( PrintStream printStream , MethodInfo methodCall ) { printStream . println ( ( "fn=" + ( protectMethodName ( methodCall . getMethodName ( ) ) ) ) ) ; printStream . println ( ( "0<seq2seq4repair_space>" + ( methodCall . getPrivateTime ( ) ) ) ) ; for ( Map . Entry < MethodInfo , CallInfo > entry : methodCall . getSubCalls ( ) ) { MethodInfo subCall = entry . getKey ( ) ; <START_BUG> printStream . println ( ( "cfl=" + ( protectClassName ( subCall . getClassName ( ) . getClassName ( ) ) ) ) ) ; <END_BUG> printStream . println ( ( "cfn=" + ( protectMethodName ( subCall . getMethodName ( ) ) ) ) ) ; printStream . println ( ( ( ( "calls=" + ( entry . getValue ( ) . getNumber ( ) ) ) + "<seq2seq4repair_space>" ) + "0" ) ) ; long timeSpent = entry . getValue ( ) . getTimeSpent ( ) ; if ( timeSpent <= 0 ) { System . err . println ( ( ( ( ( ( "Spurious!dump()<seq2seq4repair_space>timeSpent=" + timeSpent ) + "<seq2seq4repair_space>in<seq2seq4repair_space>call<seq2seq4repair_space>:<seq2seq4repair_space>" ) + methodCall ) + "=>" ) + subCall ) ) ; timeSpent = 1 ; } printStream . println ( ( "0<seq2seq4repair_space>" + timeSpent ) ) ; } } public synchronized void dump ( String fileName ) throws FileNotFoundException { } }

Fix:
printStream . println ( ( "cfl=" + ( protectClassName ( subCall . getClassInfo ( ) . getClassName ( ) ) ) ) ) ;
Buggy code:
public class ZipArchiveInputStream extends ArchiveInputStream { private final ZipInputStream input ; public ZipArchiveInputStream ( InputStream inputStream ) { } public ArchiveEntry getNextEntry ( ) throws IOException { ZipEntry entry = input . getNextEntry ( ) ; if ( entry == null ) { return null ; } <START_BUG> return ( ( ArchiveEntry ) ( new ZipEntry ( entry ) ) ) ; <END_BUG> } public int read ( byte [ ] b , int off , int len ) throws IOException { } public int read ( ) throws IOException { } public static boolean matches ( byte [ ] signature , int length ) { } }

Fix:
return ( ( ArchiveEntry ) ( new ZipArchiveEntry ( entry ) ) ) ;
Buggy code:
public abstract class GameBot { protected boolean isRunning = false ; private Move move = new Move ( ) ; private int version = 0 ; private String name = "Unknown" ; private String creator = "Unknown" ; public abstract void calculateNextMove ( ReversiBoard board , int color , ArrayList < Move > allPreviousMoves ) { } protected void setMove ( Move move ) { } public Move getMove ( ) { <START_BUG> return this . move ; <END_BUG> } public void stopCalculating ( ) { } public int getVersion ( ) { } protected void setVersion ( int v ) { } public String getName ( ) { } protected void setName ( String n ) { } public String getCreator ( ) { } protected void setCreator ( String c ) { } public String toString ( ) { } }

Fix:
return this . move . copy ( ) ;
Buggy code:
public class DateUtils { private static final String AM_SYMBOL = "a" ; private static final String PM_SYMBOL = "p" ; public static Calendar getMinCalendarDate ( ) { } public static Calendar getMaxCalendarDate ( ) { } public static Calendar convertToCalendar ( String date ) { } public static String convertToString ( Calendar calendar ) { <START_BUG> SimpleDateFormat sdf = new SimpleDateFormat ( Defined . SEARCH_SERVER_DATE_FORMAT ) ; <END_BUG> return sdf . format ( calendar . getTime ( ) ) ; } public static DateFormatSymbols getDateFormatSymbols ( ) { } public static DateFormatSymbols getFormatSymbolsShort ( Context context ) { } public static boolean isDateBeforeDateShiftLine ( Calendar checkDate ) { } public static Date getAmPmTime ( Integer hr , Integer min ) { } }

Fix:
SimpleDateFormat sdf = new SimpleDateFormat ( Defined . SEARCH_SERVER_DATE_FORMAT , Locale . US ) ;
Buggy code:
public class LibMysqlConnector { public Connection getConnection ( ) { String usr = "ywpu" ; String pwd = "" ; try { <START_BUG> File file = new File ( "resources//passwd" ) ; <END_BUG> Scanner scanner = new Scanner ( file ) ; pwd = scanner . nextLine ( ) ; scanner . close ( ) ; } catch ( FileNotFoundException exception ) { String message = "Load<seq2seq4repair_space>password<seq2seq4repair_space>file<seq2seq4repair_space>failed." ; JOptionPane . showMessageDialog ( null , message , "Error" , JOptionPane . ERROR_MESSAGE ) ; System . exit ( 1 ) ; } String jdbcDriver = "com.mysql.jdbc.Driver" ; String jdbcUrl = "jdbc:mysql:////ckeisc.nctucs.net:3306//personal_calendar" ; jdbcUrl += "?user=" + usr ; jdbcUrl += "&password=" + pwd ; jdbcUrl += "&useUnicode=true&characterEncoding=UTF-8" ; Connection connection = null ; try { Class . forName ( jdbcDriver ) . newInstance ( ) ; } catch ( Exception exception ) { String message = "Load<seq2seq4repair_space>MySQL<seq2seq4repair_space>driver<seq2seq4repair_space>failed." ; JOptionPane . showMessageDialog ( null , message , "Error" , JOptionPane . ERROR_MESSAGE ) ; System . exit ( 1 ) ; } try { connection = DriverManager . getConnection ( jdbcUrl ) ; } catch ( SQLException exception ) { String message = "SQL<seq2seq4repair_space>Exception:<seq2seq4repair_space>" + ( exception . getMessage ( ) ) ; message += "\nSQL<seq2seq4repair_space>State:<seq2seq4repair_space>" + ( exception . getSQLState ( ) ) ; message += "\nVendor<seq2seq4repair_space>Error:<seq2seq4repair_space>" + ( exception . getErrorCode ( ) ) ; JOptionPane . showMessageDialog ( null , message , "Error" , JOptionPane . ERROR_MESSAGE ) ; System . exit ( 1 ) ; } return connection ; } }

Fix:
File file = new File ( "..//resources//passwd" ) ;
Buggy code:
public class JobManager implements JobManagerService { private final NodeConfiguration config ; private final AtomicInteger counter ; private final Map < JobID , Job > jobs ; private Node node ; public JobManager ( NodeConfiguration config ) { } @ Override public void start ( Node node ) { } @ Override public void stop ( ) { } public JobID [ ] getJobIDs ( ) { synchronized ( jobs ) { <START_BUG> return ( ( JobID [ ] ) ( jobs . keySet ( ) . toArray ( ) ) ) ; <END_BUG> } } @ Override public JobStatus getJobStatus ( JobID jobID ) throws IOException { } public Iterable < JobStatus > getJobStatuses ( ) { } @ Override public JobID submitJob ( File jarFile , File inputFile ) throws IOException { } private void submitMapTasks ( Job job , File jarFile , File inputFile ) throws IOException , InterruptedException { } private Partition writePartition ( final Partitioner < ? > partitioner , Path inputPath , final FileSystemService fs ) throws IOException , InterruptedException { } private void submitMapTaskAttempt ( Job job , MapTask task , Attempt attempt ) throws IOException { } private void submitReduceTasks ( Job job ) throws IOException { } private void submitReduceTaskAttemp ( Job job , ReduceTask task , Attempt attempt ) throws IOException { } @ Override public boolean updateStatus ( AttemptStatus [ ] statuses ) throws IOException { } private boolean updateJobStatus ( JobID jobId , AttemptStatus [ ] statuses , int offset , int length ) throws IOException { } public void migrateTask ( NodeID target , AttemptStatus attempt ) throws IOException { } }

Fix:
return jobs . keySet ( ) . toArray ( new JobID [ 0 ] ) ;
Buggy code:
public class OnChangeAjaxBehaviorPage extends BasePage { protected String getValue ( String input ) { if ( Strings . isEmpty ( input ) ) { return "" ; } <START_BUG> StringBuffer buffer = new StringBuffer ( ) ; <END_BUG> Locale [ ] locales = Locale . getAvailableLocales ( ) ; for ( int i = 0 ; i < ( locales . length ) ; i ++ ) { final Locale locale = locales [ i ] ; final String country = locale . getDisplayCountry ( ) ; if ( country . toUpperCase ( ) . startsWith ( input . toUpperCase ( ) ) ) { buffer . append ( country ) ; buffer . append ( "<seq2seq4repair_space>" ) ; } } return buffer . toString ( ) ; } public OnChangeAjaxBehaviorPage ( ) { } }

Fix:
StringBuilder buffer = new StringBuilder ( ) ;
Buggy code:
@ RunAsClient @ RunWith ( Arquillian . class ) public class DeploymentTestCase { private static final long TIMEOUT = 10000 ; private static final String WAR_JBOSS_FILE = "jboss-web.xml" ; private static final String JAR_JBOSS_FILE = "jboss.xml" ; private static final String EAR_JBOSS_FILE = "jboss-app.xml" ; @ ArquillianResource private ManagementClient managementClient ; @ Deployment public static Archive < ? > fakeDeployment ( ) { } @ Test public void testDeployUndeployEAR ( ) throws Exception { } private DeploymentManager getDeploymentManager ( ) throws Exception { } private ProgressObject jsr88Deploy ( DeploymentManager manager , Archive < ? > archive ) throws Exception { } private ProgressObject jsr88Undeploy ( DeploymentManager manager , TargetModuleID [ ] resultTargetModuleIDs ) throws Exception { } private StateType awaitCompletion ( ProgressObject progress , long timeout ) throws InterruptedException { } private void assertServletAccess ( String context ) throws IOException { <START_BUG> URL servletURL = new URL ( ( ( ( "http:////" + ( managementClient . getMgmtAddress ( ) ) ) + ":8080//" ) + context ) ) ; <END_BUG> BufferedReader br = new BufferedReader ( new InputStreamReader ( servletURL . openStream ( ) ) ) ; String message = br . readLine ( ) ; assertEquals ( "Hello<seq2seq4repair_space>World!" , message ) ; } private InputStream createDeploymentPlan ( String deploymentFile ) throws Exception { } private Archive < ? > getWebArchive ( ) { } private Archive < ? > getEjbArchive ( ) { } private Archive < ? > getEarArchive ( ) { } }

Fix:
URL servletURL = new URL ( ( ( ( managementClient . getWebUri ( ) ) + "//" ) + context ) ) ;
Buggy code:
public abstract class AbstractClasspathResource extends Resource { private Path classpath ; private Reference loader ; private boolean parentFirst = true ; public void setClasspath ( Path classpath ) { } public Path createClasspath ( ) { } public void setClasspathRef ( Reference r ) { } public Path getClasspath ( ) { } public Reference getLoader ( ) { } public void setLoaderRef ( Reference r ) { } public void setParentFirst ( boolean b ) { } public void setRefid ( Reference r ) { } public boolean isExists ( ) { } public InputStream getInputStream ( ) throws IOException { if ( isReference ( ) ) { return ( ( Resource ) ( getCheckedRef ( ) ) ) . getInputStream ( ) ; } dieOnCircularReference ( ) ; ClassLoader cl = null ; boolean clNeedsCleanup = false ; if ( ( loader ) != null ) { cl = ( ( ClassLoader ) ( loader . getReferencedObject ( ) ) ) ; } if ( cl == null ) { if ( ( getClasspath ( ) ) != null ) { Path p = getClasspath ( ) . concatSystemClasspath ( "ignore" ) ; if ( parentFirst ) { cl = getProject ( ) . createClassLoader ( p ) ; } else { cl = AntClassLoader . newAntClassLoader ( getProject ( ) . getCoreLoader ( ) , getProject ( ) , p , false ) ; } <START_BUG> clNeedsCleanup = ( loader ) != null ; <END_BUG> } else { cl = JavaResource . class . getClassLoader ( ) ; } if ( ( ( loader ) != null ) && ( cl != null ) ) { getProject ( ) . addReference ( loader . getRefId ( ) , cl ) ; } } final ClassLoader classLoader = cl ; return ! clNeedsCleanup ? openInputStream ( cl ) : new FilterInputStream ( openInputStream ( cl ) ) { public void close ( ) throws IOException { FileUtils . close ( in ) ; ( ( AntClassLoader ) ( classLoader ) ) . cleanup ( ) ; } protected void finalize ( ) throws Throwable { try { close ( ) ; } finally { super . finalize ( ) ; } } } ; } protected abstract InputStream openInputStream ( ClassLoader cl ) throws IOException { } protected synchronized void dieOnCircularReference ( Stack stk , Project p ) { } }

Fix:
clNeedsCleanup = ( loader ) == null ;
Buggy code:
public class IronJacamarDeploymentParsingProcessor implements DeploymentUnitProcessor { public IronJacamarDeploymentParsingProcessor ( ) { } @ Override public void deploy ( DeploymentPhaseContext phaseContext ) throws DeploymentUnitProcessingException { final ResourceRoot resourceRoot = phaseContext . getDeploymentUnit ( ) . getAttachment ( DEPLOYMENT_ROOT ) ; final VirtualFile deploymentRoot = resourceRoot . getRoot ( ) ; if ( ( deploymentRoot == null ) || ( ! ( deploymentRoot . exists ( ) ) ) ) return ; final String deploymentRootName = deploymentRoot . getName ( ) ; VirtualFile serviceXmlFile = null ; if ( deploymentRootName . endsWith ( ".rar" ) ) { serviceXmlFile = deploymentRoot . getChild ( "//META-INF//ironjacamar.xml" ) ; } if ( ( serviceXmlFile == null ) || ( ! ( serviceXmlFile . exists ( ) ) ) ) return ; InputStream xmlStream = null ; IronJacamar result = null ; try { xmlStream = serviceXmlFile . openStream ( ) ; result = new IronJacamarParser ( ) . parse ( xmlStream ) ; if ( result != null ) { IronJacamarXmlDescriptor xmlDescriptor = new IronJacamarXmlDescriptor ( result ) ; <START_BUG> phaseContext . putAttachment ( ATTACHMENT_KEY , xmlDescriptor ) ; <END_BUG> } else throw new DeploymentUnitProcessingException ( ( ( "Failed<seq2seq4repair_space>to<seq2seq4repair_space>parse<seq2seq4repair_space>service<seq2seq4repair_space>xml<seq2seq4repair_space>[" + serviceXmlFile ) + "]" ) ) ; } catch ( Exception e ) { throw new DeploymentUnitProcessingException ( ( ( "Failed<seq2seq4repair_space>to<seq2seq4repair_space>parse<seq2seq4repair_space>service<seq2seq4repair_space>xml<seq2seq4repair_space>[" + serviceXmlFile ) + "]" ) , e ) ; } finally { VFSUtils . safeClose ( xmlStream ) ; } } public void undeploy ( final DeploymentUnit context ) { } }

Fix:
phaseContext . getDeploymentUnit ( ) . putAttachment ( ATTACHMENT_KEY , xmlDescriptor ) ;
Buggy code:
public class Register extends FragmentActivity implements SubscribedActivities { private TextView nameView ; private TextView emailView ; private TextView passwordView ; private TextView passwordConfirmationView ; private Calendar birthday ; private TextView birthdayView ; private String name ; private String email ; private String password ; private String passwordConfirmation ; private String gender ; private RadioGroup genderRadio ; private final int maleOptionId = id . male ; private final int femaleOptionId = id . female ; private HttpHandler httpHandler = new HttpHandler ( ) ; public static final String ACTION_REGISTER = "//users" ; private Map < String , String > params = new HashMap < String , String > ( ) ; @ Override protected void onCreate ( Bundle savedInstanceState ) { } public void onAlreadyHaveAccountClicked ( View v ) { } public void onRegisterClicked ( View v ) { } public boolean validateGender ( ) { } public void showDatePickerDialog ( View v ) { } public static class DatePickerFragment extends DialogFragment implements DatePickerDialog . OnDateSetListener { @ Override public Dialog onCreateDialog ( Bundle savedInstanceState ) { } public void onDateSet ( DatePicker view , int year , int month , int day ) { } } public Calendar getBirthday ( ) { } public void setBirthday ( Calendar birthday ) { } public void updateBirthdayView ( ) { } public void setParamsForRegister ( ) { } public void sendRequest ( String request ) { } public void saveUserData ( int id , String email , String name , String gender , String birthday ) { SharedPreferencesManager . saveIntegerValue ( USER_ID , id ) ; SharedPreferencesManager . saveStringValue ( USER_EMAIL , email ) ; SharedPreferencesManager . saveStringValue ( USER_NAME , name ) ; SharedPreferencesManager . saveStringValue ( USER_GENDER , gender ) ; SharedPreferencesManager . saveStringValue ( USER_BIRTHDAY , birthday ) ; <START_BUG> User . setUserData ( id , email , name , gender , birthday , null ) ; <END_BUG> } public void openNowerMap ( ) { } @ Override public void notify ( String action , JSONObject responseJson ) { } @ Override public boolean onCreateOptionsMenu ( Menu menu ) { } @ Override public boolean onOptionsItemSelected ( MenuItem item ) { } }

Fix:
User . setUserData ( id , email , name , gender , birthday ) ;
Buggy code:
public class PageFactoryTest extends WicketTestCase { private DefaultPageFactory factory ; public PageFactoryTest ( String message ) { } protected void setUp ( ) throws Exception { } public void testNewPageClass ( ) { } public void testNewPageClassPageParameters ( ) { assertEquals ( MyPage0 . class , factory . newPage ( MyPage0 . class , ( ( PageParameters ) ( null ) ) ) . getClass ( ) ) ; assertEquals ( MyPage0 . class , factory . newPage ( MyPage0 . class , new PageParameters ( ) ) . getClass ( ) ) ; assertEquals ( MyPage1 . class , factory . newPage ( MyPage1 . class , new PageParameters ( ) ) . getClass ( ) ) ; assertEquals ( MyPage2 . class , factory . newPage ( MyPage2 . class , new PageParameters ( ) ) . getClass ( ) ) ; Exception e = null ; try { factory . newPage ( MyPage3 . class , new PageParameters ( ) ) . getClass ( ) ; } catch ( WicketRuntimeException ex ) { e = ex ; } assertNotNull ( "MyPage4<seq2seq4repair_space>should<seq2seq4repair_space>have<seq2seq4repair_space>thrown<seq2seq4repair_space>an<seq2seq4repair_space>exception<seq2seq4repair_space>as<seq2seq4repair_space>it<seq2seq4repair_space>does<seq2seq4repair_space>not<seq2seq4repair_space>have<seq2seq4repair_space>a<seq2seq4repair_space>default<seq2seq4repair_space>or<seq2seq4repair_space>no<seq2seq4repair_space>constructor" , e ) ; e = null ; try { factory . newPage ( MyPage4 . class , new PageParameters ( ) ) . getClass ( ) ; } catch ( WicketRuntimeException ex ) { e = ex ; } assertNotNull ( "MyPage4<seq2seq4repair_space>should<seq2seq4repair_space>have<seq2seq4repair_space>thrown<seq2seq4repair_space>an<seq2seq4repair_space>exception<seq2seq4repair_space>as<seq2seq4repair_space>it<seq2seq4repair_space>does<seq2seq4repair_space>not<seq2seq4repair_space>have<seq2seq4repair_space>a<seq2seq4repair_space>default<seq2seq4repair_space>or<seq2seq4repair_space>no<seq2seq4repair_space>constructor" , e ) ; assertEquals ( MyPage5 . class , factory . newPage ( MyPage5 . class , new PageParameters ( ) ) . getClass ( ) ) ; e = null ; try { factory . newPage ( String . class , new PageParameters ( ) ) . getClass ( ) ; } catch ( ClassCastException ex ) { e = ex ; } <START_BUG> assertNotNull ( "String<seq2seq4repair_space>does<seq2seq4repair_space>not<seq2seq4repair_space>extend<seq2seq4repair_space>Page.<seq2seq4repair_space>Should<seq2seq4repair_space>habe<seq2seq4repair_space>thrown<seq2seq4repair_space>an<seq2seq4repair_space>exception" , e ) ; <END_BUG> } }

Fix:
assertNotNull ( "String<seq2seq4repair_space>does<seq2seq4repair_space>not<seq2seq4repair_space>extend<seq2seq4repair_space>Page.<seq2seq4repair_space>Should<seq2seq4repair_space>have<seq2seq4repair_space>thrown<seq2seq4repair_space>an<seq2seq4repair_space>exception" , e ) ;
Buggy code:
public class WorkbenchPresentationFactory extends AbstractPresentationFactory { public StackPresentation createEditorPresentation ( Composite parent , IStackPresentationSite site ) { } public StackPresentation createViewPresentation ( Composite parent , IStackPresentationSite site ) { } public StackPresentation createStandaloneViewPresentation ( Composite parent , IStackPresentationSite site , boolean showTitle ) { if ( showTitle ) { return createViewPresentation ( parent , site ) ; } else { <START_BUG> EmptyTabFolder folder = new EmptyTabFolder ( parent ) ; <END_BUG> TabbedStackPresentation presentation = new TabbedStackPresentation ( site , folder , new org . eclipse . ui . internal . presentations . util . StandardViewSystemMenu ( site ) ) ; return presentation ; } } }

Fix:
EmptyTabFolder folder = new EmptyTabFolder ( parent , true ) ;
Buggy code:
@ Entity public class UserEntity { private Long userID ; private String username ; private List < TweetEntity > tweets = new ArrayList < TweetEntity > ( ) ; private List < HashtagEntity > hashtags = new ArrayList < HashtagEntity > ( ) ; private Integer numberOfTweets ; private Map < String , Integer > hashtagCount = new HashMap < String , Integer > ( ) ; public UserEntity ( ) { } private void calculateTweets ( ) { } private void calculateHashtagCount ( ) { } @ Id public Long getUserID ( ) { } public void setUserID ( Long userID ) { } public String getUsername ( ) { } public void setUsername ( String username ) { } <START_BUG> @ OneToMany ( fetch = FetchType . LAZY , cascade = CascadeType . ALL , mappedBy = "userEntity" ) <END_BUG> public List < TweetEntity > getTweets ( ) { return tweets ; } public void setTweets ( List < TweetEntity > tweets ) { } @ Transient public Integer getNumberOfTweets ( ) { } public void setNumberOfTweets ( Integer numberOfTweets ) { } @ ManyToMany ( fetch = FetchType . LAZY , cascade = CascadeType . ALL ) public List < HashtagEntity > getHashtags ( ) { } public void setHashtags ( List < HashtagEntity > hashtags ) { } @ Transient @ ElementCollection public Map < String , Integer > getHashtagCount ( ) { } public void setHashtagCount ( Map < String , Integer > hashtagCount ) { } }

Fix:
@ OneToMany ( fetch = FetchType . LAZY , cascade = CascadeType . ALL , mappedBy = "author" )
Buggy code:
public abstract class AndPattern extends SearchPattern { public AndPattern ( int matchMode , boolean isCaseSensitive ) { } public void findIndexMatches ( IndexInput input , IIndexSearchRequestor requestor , int detailLevel , IProgressMonitor progressMonitor , IJavaSearchScope scope ) throws IOException { if ( ( progressMonitor != null ) && ( progressMonitor . isCanceled ( ) ) ) throw new OperationCanceledException ( ) ; long [ ] potentialRefs = null ; int maxRefs = - 1 ; this . resetQuery ( ) ; do { <START_BUG> IEntryResult [ ] entries = input . queryEntriesPrefixedBy ( indexEntryPrefix ( ) ) ; <END_BUG> if ( entries == null ) break ; int numFiles = input . getNumFiles ( ) ; long [ ] references = null ; int referencesLength = - 1 ; for ( int i = 0 , max = entries . length ; i < max ; i ++ ) { if ( ( progressMonitor != null ) && ( progressMonitor . isCanceled ( ) ) ) throw new OperationCanceledException ( ) ; IEntryResult entry = entries [ i ] ; decodeIndexEntry ( entry ) ; if ( matchIndexEntry ( ) ) { int [ ] fileReferences = entry . getFileReferences ( ) ; for ( int j = 0 , refLength = fileReferences . length ; j < refLength ; j ++ ) { int fileReference = fileReferences [ j ] ; int vectorIndex = fileReference // 64 ; if ( references == null ) { referencesLength = ( numFiles // 64 ) + 1 ; references = new long [ referencesLength ] ; } long mask = 1L << ( fileReference % 64 ) ; references [ vectorIndex ] |= mask ; } } } if ( references == null ) { return ; } else { if ( potentialRefs == null ) { potentialRefs = references ; maxRefs = numFiles ; } else { for ( int i = 0 , length = references . length ; i < length ; i ++ ) { if ( i < ( potentialRefs . length ) ) { potentialRefs [ i ] &= references [ i ] ; } else { potentialRefs [ i ] = 0 ; } } } } } while ( this . hasNextQuery ( ) ) ; if ( potentialRefs != null ) { int [ ] refs = new int [ maxRefs ] ; int refsLength = 0 ; for ( int reference = 1 ; reference <= maxRefs ; reference ++ ) { int vectorIndex = reference // 64 ; if ( ( ( potentialRefs [ vectorIndex ] ) & ( 1L << ( reference % 64 ) ) ) != 0 ) { refs [ ( refsLength ++ ) ] = reference ; } } System . arraycopy ( refs , 0 , ( refs = new int [ refsLength ] ) , 0 , refsLength ) ; this . feedIndexRequestor ( requestor , detailLevel , refs , input , scope ) ; } } protected abstract boolean hasNextQuery ( ) { } protected abstract void resetQuery ( ) { } }

Fix:
IEntryResult [ ] entries = input . queryEntriesPrefixedBy ( indexEntryPrefix ( ) , isCaseSensitive ) ;
Buggy code:
public class Blotto { Environment env ; public Blotto ( ) { } public BlottoReport runBlottoEvolution ( int B , double Rf , double Lf ) { FitnessCalculator < double [ ] > fitCalc = new BlottoFitnessCalculator ( Rf , Lf ) ; AdultSelector < double [ ] > adultSelector = new edu . ntnu . EASY . selection . adult . FullGenerationalReplacement < double [ ] > ( env . elitism ) ; ParentSelector < double [ ] > parentSelector = new edu . ntnu . EASY . selection . parent . FitnessProportionateSelector < double [ ] > ( env . numParents ) ; <START_BUG> Incubator < double [ ] , double [ ] > incubator = new BlottoIncubator ( new BlottoReplicator ( B ) , env . numChildren ) ; <END_BUG> Evolution < double [ ] , double [ ] > evo = new Evolution < double [ ] , double [ ] > ( fitCalc , adultSelector , parentSelector , incubator ) ; BlottoReport report = new BlottoReport ( env . maxGenerations ) ; evo . runEvolution ( env , report ) ; return report ; } }

Fix:
Incubator < double [ ] , double [ ] > incubator = new BlottoIncubator ( new BlottoReplicator ( B , env . mutationRate , env . crossoverRate ) , env . numChildren ) ;
Buggy code:
public class XmiFileReader { public static void main ( String [ ] args ) { <START_BUG> final String fileName = "project4.xmi" ; <END_BUG> Document jdomDoc ; try { jdomDoc = XmiFileReader . useDOMParser ( fileName ) ; Element root = jdomDoc . getRootElement ( ) ; List < Element > empListElements = root . getChildren ( "packagedElement" ) ; List < ActorsXmi > empList = new ArrayList < > ( ) ; for ( Element empElement : empListElements ) { ActorsXmi emp = new ActorsXmi ( ) ; emp . setId ( empElement . getAttributeValue ( "id" ) ) ; emp . setName ( empElement . getAttributeValue ( "name" ) ) ; emp . setType ( empElement . getAttributeValue ( "type" ) ) ; empList . add ( emp ) ; } for ( ActorsXmi emp : empList ) System . out . println ( emp ) ; } catch ( Exception e ) { e . printStackTrace ( ) ; } } private static org . w3c . dom . Document useDOMParser ( String fileName ) throws IOException , ParserConfigurationException , SAXException { } No newline ; at end ; of file ; }

Fix:
final String fileName = "Example.xmi" ;
Buggy code:
public final class BaseTypeBinding extends TypeBinding { public char [ ] simpleName ; private char [ ] constantPoolName ; BaseTypeBinding ( int id , char [ ] name , char [ ] constantPoolName ) { } <START_BUG> public char [ ] computeUniqueKey ( boolean withAccessFlags ) { <END_BUG> return constantPoolName ( ) ; } public char [ ] constantPoolName ( ) { } public PackageBinding getPackage ( ) { } public final boolean isCompatibleWith ( TypeBinding right ) { } public static final boolean isNarrowing ( int left , int right ) { } public boolean isUncheckedException ( boolean includeSupertype ) { } public static final boolean isWidening ( int left , int right ) { } public int kind ( ) { } public char [ ] qualifiedSourceName ( ) { } public char [ ] readableName ( ) { } public char [ ] shortReadableName ( ) { } public char [ ] sourceName ( ) { } public String toString ( ) { } }

Fix:
public char [ ] computeUniqueKey ( boolean isLeaf ) {
Buggy code:
@ Guice ( modules = { MockModule . class } ) public class TestBasic { private static final Logger log = LoggerFactory . getLogger ( TestBasic . class ) ; private static long AT_LEAST_ONE_MONTH_MS = ( ( 31L * 24L ) * 3600L ) * 1000L ; @ Inject IDBI dbi ; @ Inject private ClockMock clock ; @ Inject private Lifecycle lifecycle ; @ Inject private BusService busService ; @ Inject private EntitlementService entitlementService ; @ Inject private InvoiceService invoiceService ; @ Inject private AccountService accountService ; @ Inject private MysqlTestingHelper helper ; private EntitlementUserApi entitlementUserApi ; private InvoiceUserApi invoiceUserApi ; private AccountUserApi accountUserApi ; private TestBusHandler busHandler ; private void setupMySQL ( ) throws IOException { } @ BeforeSuite ( alwaysRun = true ) public void setup ( ) throws Exception { } @ AfterSuite ( alwaysRun = true ) public void tearDown ( ) throws Exception { } @ BeforeMethod ( alwaysRun = true ) public void setupTest ( ) { } @ AfterMethod ( alwaysRun = true ) public void cleanupTest ( ) { } private void cleanupData ( ) { } private void verifyTestResult ( UUID accountId , UUID subscriptionId , DateTime startDate , DateTime endDate , BigDecimal amount , DateTime chargeThroughDate ) { } private DateTime removeMillis ( DateTime input ) { } @ Test ( groups = "fast" , enabled = false ) public void testBasePlanCompleteWithBillingDayInPast ( ) throws Exception { } @ Test ( groups = "fast" , enabled = false ) public void testBasePlanCompleteWithBillingDayPresent ( ) throws Exception { } @ Test ( groups = "fast" , enabled = false ) public void testBasePlanCompleteWithBillingDayAlignedWithTrial ( ) throws Exception { } <START_BUG> @ Test ( groups = "fast" , enabled = true ) <END_BUG> public void testBasePlanCompleteWithBillingDayInFuture ( ) throws Exception { DateTime startDate = new DateTime ( 2012 , 2 , 1 , 0 , 3 , 42 , 0 ) ; testBasePlanComplete ( startDate , 3 , true ) ; } private void waitForDebug ( ) throws Exception { } @ Test ( groups = "stress" , enabled = false ) public void stressTest ( ) throws Exception { } private void testBasePlanComplete ( DateTime initialCreationDate , int billingDay , boolean proRationExpected ) throws Exception { } @ Test ( enabled = false ) public void testHappyPath ( ) throws AccountApiException , EntitlementUserApiException { } protected AccountData getAccountData ( final int billingDay ) { } }

Fix:
@ Test ( groups = "fast" , enabled = false )
Buggy code:
public class AllocationExpression extends Expression implements InvocationSite { public TypeReference type ; public Expression [ ] arguments ; public MethodBinding binding ; protected MethodBinding codegenBinding ; MethodBinding syntheticAccessor ; public TypeReference [ ] typeArguments ; public TypeBinding [ ] genericTypeArguments ; public FieldDeclaration enumConstant ; public FlowInfo analyseCode ( BlockScope currentScope , FlowContext flowContext , FlowInfo flowInfo ) { } public void checkCapturedLocalInitializationIfNecessary ( ReferenceBinding checkedType , BlockScope currentScope , FlowInfo flowInfo ) { } public Expression enclosingInstance ( ) { } public void generateCode ( BlockScope currentScope , CodeStream codeStream , boolean valueRequired ) { } public TypeBinding [ ] genericTypeArguments ( ) { } public boolean isSuperAccess ( ) { } public boolean isTypeAccess ( ) { } public void manageEnclosingInstanceAccessIfNecessary ( BlockScope currentScope , FlowInfo flowInfo ) { } public void manageSyntheticAccessIfNecessary ( BlockScope currentScope , FlowInfo flowInfo ) { if ( ! ( flowInfo . isReachable ( ) ) ) return ; this . codegenBinding = this . binding . original ( ) ; if ( ( this . codegenBinding . isPrivate ( ) ) && ( ( currentScope . enclosingSourceType ( ) ) != ( this . codegenBinding . declaringClass ) ) ) { <START_BUG> if ( currentScope . environment ( ) . options . isPrivateConstructorAccessChangingVisibility ) { <END_BUG> this . codegenBinding . tagForClearingPrivateModifier ( ) ; } else { syntheticAccessor = ( ( SourceTypeBinding ) ( this . codegenBinding . declaringClass ) ) . addSyntheticMethod ( this . codegenBinding , isSuperAccess ( ) ) ; currentScope . problemReporter ( ) . needToEmulateMethodAccess ( this . codegenBinding , this ) ; } } } public StringBuffer printExpression ( int indent , StringBuffer output ) { } public TypeBinding resolveType ( BlockScope scope ) { } public void setActualReceiverType ( ReferenceBinding receiverType ) { } public void setDepth ( int i ) { } public void setFieldIndex ( int i ) { } public void traverse ( ASTVisitor visitor , BlockScope scope ) { } }

Fix:
if ( currentScope . compilerOptions ( ) . isPrivateConstructorAccessChangingVisibility ) {
Buggy code:
public class BSCommunicator { private static final Logger log = Logger . getLogger ( BSCommunicator . class . getName ( ) ) ; public static final BSCommunicator INSTANCE = new BSCommunicator ( ) ; private Properties properties = null ; private String BSAddress ; private String nodeIP ; private String nodeUsername ; private int BSPort ; private int nodePort ; private BSCommunicator ( ) { } public String init ( ) { } public String leave ( ) { } private String sendandRecieve ( String query ) { Socket clientSocket = null ; <START_BUG> String sentence = query + "\n" ; <END_BUG> String modifiedSentence ; try { clientSocket = new Socket ( BSAddress , BSPort ) ; DataOutputStream outToServer = new DataOutputStream ( clientSocket . getOutputStream ( ) ) ; outToServer . writeBytes ( sentence ) ; } catch ( UnknownHostException e ) { BSCommunicator . log . severe ( "Connection<seq2seq4repair_space>to<seq2seq4repair_space>boostrap<seq2seq4repair_space>server<seq2seq4repair_space>failed" ) ; System . exit ( 0 ) ; } catch ( IOException e ) { System . out . println ( sentence ) ; System . out . println ( sentence . length ( ) ) ; BSCommunicator . log . severe ( "Failed<seq2seq4repair_space>to<seq2seq4repair_space>connect<seq2seq4repair_space>boostrap<seq2seq4repair_space>server" ) ; try { if ( clientSocket != null ) { clientSocket . close ( ) ; } } catch ( IOException e1 ) { BSCommunicator . log . warning ( "Closing<seq2seq4repair_space>the<seq2seq4repair_space>connection<seq2seq4repair_space>to<seq2seq4repair_space>boostrap<seq2seq4repair_space>server<seq2seq4repair_space>failed" ) ; } System . exit ( 0 ) ; } BufferedReader inFromServer ; try { inFromServer = new BufferedReader ( new InputStreamReader ( clientSocket . getInputStream ( ) ) ) ; while ( ! ( inFromServer . ready ( ) ) ) { } modifiedSentence = inFromServer . readLine ( ) ; return modifiedSentence ; } catch ( IOException e ) { BSCommunicator . log . severe ( "Query<seq2seq4repair_space>error" ) ; System . exit ( 1 ) ; } finally { try { clientSocket . close ( ) ; } catch ( IOException e1 ) { BSCommunicator . log . warning ( "Closing<seq2seq4repair_space>the<seq2seq4repair_space>connection<seq2seq4repair_space>to<seq2seq4repair_space>boostrap<seq2seq4repair_space>server<seq2seq4repair_space>failed" ) ; } } return null ; } }

Fix:
String sentence = query ;
Buggy code:
public class Pawn implements ChessPiece { private int blackOrWhite = 0 ; private int numberOfMoves = 0 ; private List < Vector2 > possibleMoves = new ArrayList < Vector2 > ( ) ; public Pawn ( int blackOrWhite ) { } public List < Vector2 > getPossibleMoves ( int [ ] [ ] board , Vector2 location ) { if ( ( ( blackOrWhite ) > 0 ) && ( ( location . y ) == 1 ) ) { numberOfMoves = 2 ; } else if ( ( ( blackOrWhite ) < 0 ) && ( ( location . y ) == 6 ) ) { numberOfMoves = 2 ; } else { numberOfMoves = 1 ; } possibleMoves . clear ( ) ; for ( int i = 1 ; i <= ( numberOfMoves ) ; i ++ ) { Vector2 possibleMove = new Vector2 ( location . x , ( ( location . y ) + ( i * ( blackOrWhite ) ) ) ) ; if ( ( ( possibleMove . y ) < 0 ) || ( ( possibleMove . y ) > 7 ) ) { break ; } if ( ( board [ ( ( int ) ( possibleMove . x ) ) ] [ ( ( int ) ( possibleMove . y ) ) ] ) == 0 ) { possibleMoves . add ( possibleMove ) ; } else { break ; } } if ( ( ( ( location . y ) + ( 1 * ( blackOrWhite ) ) ) < 8 ) && ( ( ( location . y ) + ( 1 * ( blackOrWhite ) ) ) >= 0 ) ) { if ( ( ( location . x ) + 1 ) < 8 ) { Vector2 potentialCapture = new Vector2 ( ( ( location . x ) + 1 ) , ( ( location . y ) + ( 1 * ( blackOrWhite ) ) ) ) ; if ( validCapture ( board , potentialCapture ) ) { possibleMoves . add ( potentialCapture ) ; } } <START_BUG> if ( ( ( location . x ) - 1 ) > 0 ) { <END_BUG> Vector2 potentialCapture = new Vector2 ( ( ( location . x ) - 1 ) , ( ( location . y ) + ( 1 * ( blackOrWhite ) ) ) ) ; if ( validCapture ( board , potentialCapture ) ) { possibleMoves . add ( potentialCapture ) ; } } } return possibleMoves ; } private boolean validCapture ( int [ ] [ ] board , Vector2 location ) { } }

Fix:
if ( ( ( location . x ) - 1 ) >= 0 ) {
Buggy code:
public class AjdtCommandTestCase extends TestCase { private StreamPrintWriter outputWriter = new StreamPrintWriter ( new PrintWriter ( System . out ) ) ; private AjdtCommand command = new AjdtCommand ( ) ; private MessageWriter messageWriter = new MessageWriter ( outputWriter , false ) ; public AjdtCommandTestCase ( String name ) { } public void testIncrementalOption ( ) throws InvalidInputException { AjBuildConfig config = command . genBuildConfig ( new String [ ] { "-incremental" } , messageWriter ) ; assertTrue ( "didn't<seq2seq4repair_space>specify<seq2seq4repair_space>source<seq2seq4repair_space>root" , ( ( outputWriter . getContents ( ) . indexOf ( "specify<seq2seq4repair_space>a<seq2seq4repair_space>source<seq2seq4repair_space>root" ) ) != ( - 1 ) ) ) ; outputWriter . flushBuffer ( ) ; config = command . genBuildConfig ( new String [ ] { "-incremental" , "-sourceroots" , "testdata//src1" } , messageWriter ) ; assertTrue ( outputWriter . getContents ( ) , outputWriter . getContents ( ) . equals ( "" ) ) ; outputWriter . flushBuffer ( ) ; config = command . genBuildConfig ( new String [ ] { "-incremental" , "testdata//src1//Hello.java" } , messageWriter ) ; <START_BUG> assertTrue ( "specified<seq2seq4repair_space>a<seq2seq4repair_space>file" , ( ( outputWriter . getContents ( ) . indexOf ( "can<seq2seq4repair_space>not<seq2seq4repair_space>directly<seq2seq4repair_space>specify<seq2seq4repair_space>files" ) ) != ( - 1 ) ) ) ; <END_BUG> } public void testBadOptionAndUsagePrinting ( ) throws InvalidInputException { } public void testHelpUsagePrinting ( ) { } public void testVersionOutput ( ) throws InvalidInputException { } public void testNonExistingLstFile ( ) { } protected void setUp ( ) throws Exception { } protected void tearDown ( ) throws Exception { } }

Fix:
assertTrue ( "specified<seq2seq4repair_space>a<seq2seq4repair_space>file" , ( ( outputWriter . getContents ( ) . indexOf ( "incremental<seq2seq4repair_space>mode<seq2seq4repair_space>only<seq2seq4repair_space>handles<seq2seq4repair_space>source<seq2seq4repair_space>files<seq2seq4repair_space>using<seq2seq4repair_space>-sourceroots" ) ) != ( - 1 ) ) ) ;
Buggy code:
@ RunWith ( Arquillian . class ) public class EjbNamespaceInvocationTestCase { public static final String ARCHIVE_NAME = "RemoteInvocationTest" ; @ Deployment public static Archive < ? > deploy ( ) { } @ ArquillianResource private InitialContext iniCtx ; @ Test public void testDirectLookup ( ) throws Exception { } @ Test public void testAnnotationInjection ( ) throws Exception { } protected < T > T lookupEjb ( String beanName , Class < T > interfaceType ) throws NamingException { <START_BUG> return interfaceType . cast ( iniCtx . lookup ( ( ( ( ( ( ( ( "ejb:" + ( EjbNamespaceInvocationTestCase . ARCHIVE_NAME ) ) + "//" ) + ( EjbNamespaceInvocationTestCase . ARCHIVE_NAME ) ) + "//" ) + beanName ) + "!" ) + ( interfaceType . getName ( ) ) ) ) ) ; <END_BUG> } protected < T > T lookup ( String beanName , Class < T > interfaceType ) throws NamingException { } }

Fix:
return interfaceType . cast ( iniCtx . lookup ( ( ( ( ( ( ( ( "ejb:" + ( EjbNamespaceInvocationTestCase . ARCHIVE_NAME ) ) + "//" ) + ( EjbNamespaceInvocationTestCase . ARCHIVE_NAME ) ) + "////" ) + beanName ) + "!" ) + ( interfaceType . getName ( ) ) ) ) ) ;
Buggy code:
public class BatchClearHandler extends CommandHandlerWithHelp { public BatchClearHandler ( ) { } @ Override public boolean isAvailable ( CommandContext ctx ) { } @ Override protected void doHandle ( CommandContext ctx ) { Batch batch = ctx . getBatchManager ( ) . getActiveBatch ( ) ; if ( batch == null ) { <START_BUG> ctx . printLine ( "No<seq2seq4repair_space>active<seq2seq4repair_space>batch." ) ; <END_BUG> return ; } batch . clear ( ) ; } }

Fix:
ctx . error ( "No<seq2seq4repair_space>active<seq2seq4repair_space>batch." ) ;