nus-yam/ex-repair huggingface dataset:
Buggy code:
public class BuildCommandExecutor extends CommandExecutor { public static final String GWAS_INPUT_FILE_NAME = "gwas_catalog.tsv" ; public static final String CADD_INPUT_FILE_NAME = "whole_genome_SNVs.tsv.gz" ; public static final String DISGENET_INPUT_FILE_NAME = "all_gene_disease_associations.txt.gz" ; public static final String HPO_INPUT_FILE_NAME = "ALL_SOURCES_ALL_FREQUENCIES_diseases_to_genes_to_phenotypes.txt" ; public static final String DBSNP_INPUT_FILE_NAME = "All.vcf.gz" ; private BuildCommandOptions buildCommandOptions ; private Path input = null ; private Path output = null ; private Path common = null ; private File ensemblScriptsFolder ; private File proteinScriptsFolder ; private Species species ; public BuildCommandExecutor ( CliOptionsParser . BuildCommandOptions buildCommandOptions ) { } public void execute ( ) { } private void checkParameters ( ) throws IOException { } private void buildGenomeInfo ( ) { } private CellBaseParser buildGenomeSequence ( ) { } private CellBaseParser buildGene ( ) { } private CellBaseParser buildVariation ( ) { Path variationFolderPath = input . resolve ( "variation" ) ; <START_BUG> CellBaseFileSerializer serializer = new CellBaseJsonFileSerializer ( output ) ; <END_BUG> return new org . opencb . cellbase . app . transform . variation . VariationParser ( variationFolderPath , serializer ) ; } private CellBaseParser buildCadd ( ) { } private CellBaseParser buildRegulation ( ) { } private CellBaseParser buildProtein ( ) { } private void getProteinFunctionPredictionMatrices ( CellBaseConfiguration . SpeciesProperties . Species sp , Path geneFolder ) throws IOException , InterruptedException { } private CellBaseParser getInteractionParser ( ) { } private CellBaseParser buildDrugParser ( ) { } private CellBaseParser buildConservation ( ) { } private CellBaseParser buildClinvar ( ) { } private CellBaseParser buildCosmic ( ) { } private CellBaseParser buildGwas ( ) throws IOException { } private CellBaseParser buildDisgenet ( ) throws IOException { } private CellBaseParser buildHpo ( ) throws IOException { } private Path getInputDirFromCommandLine ( ) { } private Path getFastaReferenceGenome ( ) { } private void checkMandatoryOption ( String option , String value ) { } }

Fix:
CellBaseFileSerializer serializer = new CellBaseJsonFileSerializer ( output , null , true , true , true ) ;
Buggy code:
public class SimpleDOMBuilder extends AbstractDOMBuilder implements ISourceElementRequestor { public void acceptProblem ( IProblem problem ) { } public void acceptImport ( int declarationStart , int declarationEnd , char [ ] name , boolean onDemand , int modifiers ) { } public void acceptPackage ( int declarationStart , int declarationEnd , char [ ] name ) { } public IDOMCompilationUnit createCompilationUnit ( String sourceCode , String name ) { } public IDOMCompilationUnit createCompilationUnit ( ICompilationUnit compilationUnit ) { } protected void enterAbstractMethod ( ISourceElementRequestor . MethodInfo methodInfo ) { } public void enterConstructor ( ISourceElementRequestor . MethodInfo methodInfo ) { } public void enterField ( ISourceElementRequestor . FieldInfo fieldInfo ) { } public void enterInitializer ( int declarationSourceStart , int modifiers ) { } public void enterMethod ( ISourceElementRequestor . MethodInfo methodInfo ) { } public void enterType ( ISourceElementRequestor . TypeInfo typeInfo ) { } public void exitConstructor ( int declarationEnd ) { } public void exitField ( int initializationStart , int declarationEnd , int declarationSourceEnd ) { } public void exitInitializer ( int declarationEnd ) { } protected void exitMember ( int declarationEnd ) { } public void exitMethod ( int declarationEnd , int defaultValueStart , int defaultValueEnd ) { } public void exitType ( int declarationEnd ) { } protected SourceElementParser getParser ( Map settings ) { <START_BUG> return new SourceElementParser ( this , new DefaultProblemFactory ( ) , new CompilerOptions ( settings ) ) ; <END_BUG> } }

Fix:
return new SourceElementParser ( this , new DefaultProblemFactory ( ) , new CompilerOptions ( settings ) , false , true ) ;
Buggy code:
public class MineFragment extends DLFragment implements AdapterView . OnItemClickListener , AccountChangeListener { private View rootView ; private boolean rebuild ; private TitleBar titleBar ; private ListView listView ; private MineFragment . Adapter adapter ; @ Override public View onCreateView ( LayoutInflater inflater , ViewGroup container , Bundle savedInstanceState ) { } @ Override public void onViewCreated ( View view , Bundle savedInstanceState ) { } @ Override public void onDestroy ( ) { } @ Override public void onAccountChange ( AccountService service ) { } @ Override public void onItemClick ( AdapterView < ? > parent , View view , int position , long id ) { } class Adapter extends GroupStyleAdapter { public Adapter ( ) { } @ Override public int getCountInSection ( int section ) { } @ Override public int getSectionCount ( ) { } @ Override public View getViewForRow ( View convertView , ViewGroup parent , int section , int row ) { View view = null ; if ( section == 0 ) { if ( AccountService . instance ( ) . isLogin ( ) ) { MineHeaderView headerView = MineHeaderView . create ( getActivity ( ) ) ; Account account = AccountService . instance ( ) . account ( ) ; headerView . getAvartaIv ( ) . setImageUrl ( account . getAvatar ( ) ) ; headerView . getNameTv ( ) . setText ( account . getNickName ( ) ) ; <START_BUG> headerView . getAgeTv ( ) . setText ( ( ( ( account . getSex ( ) ) + "孩" ) + ( account . getAgeOfChild ( ) ) ) ) ; <END_BUG> view = headerView ; } else { view = LayoutInflater . from ( getActivity ( ) ) . inflate ( layout_mine_header_not_login , null ) ; view . findViewById ( login_btn ) . setOnClickListener ( new View . OnClickListener ( ) { @ Override public void onClick ( View v ) { Intent intent = new Intent ( Intent . ACTION_VIEW , Uri . parse ( "duola:////login" ) ) ; startActivity ( intent ) ; } } ) ; } } else { SimpleListItem simpleListItem = SimpleListItem . create ( getActivity ( ) ) ; simpleListItem . setShowArrow ( true ) ; if ( section == 1 ) { if ( row == 0 ) { simpleListItem . setTitle ( "我的订单" ) ; simpleListItem . setIcon ( ic_mine_order ) ; } else { simpleListItem . setTitle ( "我的红包" ) ; simpleListItem . setIcon ( ic_mine_coupon ) ; } } else if ( section == 2 ) { simpleListItem . setTitle ( "我要爆料" ) ; simpleListItem . setIcon ( ic_mine_recommend ) ; } else if ( section == 3 ) { if ( row == 0 ) { simpleListItem . setTitle ( "我的收藏" ) ; simpleListItem . setIcon ( ic_mine_collect ) ; } else { simpleListItem . setTitle ( "常用出行人" ) ; simpleListItem . setIcon ( ic_mine_people ) ; } } else if ( section == 4 ) { if ( row == 0 ) { simpleListItem . setTitle ( "意见反馈" ) ; simpleListItem . setIcon ( ic_mine_feedback ) ; } else { simpleListItem . setTitle ( "关于我们" ) ; simpleListItem . setIcon ( ic_mine_setting ) ; } } view = simpleListItem ; } return view ; } } }

Fix:
headerView . getAgeTv ( ) . setText ( account . getAgeOfChild ( ) ) ;
Buggy code:
public class RunSpec implements ITestStep { private List expected = new ArrayList ( ) ; private String classToRun ; private String baseDir ; private String options ; private String cpath ; private AjcTest myTest ; private OutputSpec stdErrSpec ; private OutputSpec stdOutSpec ; private String ltwFile ; public RunSpec ( ) { } public void execute ( AjcTestCase inTestCase ) { } public void addExpectedMessage ( ExpectedMessageSpec message ) { } public void setBaseDir ( String dir ) { } public void setTest ( AjcTest test ) { } public String getOptions ( ) { } public void setOptions ( String options ) { } public String getClasspath ( ) { } public void setClasspath ( String cpath ) { } public void addStdErrSpec ( OutputSpec spec ) { } public void addStdOutSpec ( OutputSpec spec ) { } public String getClassToRun ( ) { } public void setClassToRun ( String classToRun ) { } public String getLtwFile ( ) { } public void setLtwFile ( String ltwFile ) { } private String [ ] buildArgs ( ) { } private boolean copyLtwFile ( File sandboxDirectory ) { boolean useLtw = false ; if ( ( ltwFile ) != null ) { if ( ( ltwFile . trim ( ) . length ( ) ) == 0 ) return true ; File from = new File ( baseDir , ltwFile ) ; File to = new File ( sandboxDirectory , ( ( "META-INF" + ( File . separator ) ) + "aop.xml" ) ) ; try { FileUtil . copyFile ( from , to ) ; useLtw = true ; } catch ( IOException ex ) { <START_BUG> ex . printStackTrace ( ) ; <END_BUG> } } return useLtw ; } }

Fix:
AjcTestCase . fail ( ex . toString ( ) ) ;
Buggy code:
public class HostContainerSelector extends AbstractHostContainerSelector implements IHostContainerSelector { private boolean autoCreateContainer = false ; public HostContainerSelector ( String [ ] defaultConfigTypes , boolean autoCreateContainer ) { } public IRemoteServiceContainer [ ] selectHostContainers ( ServiceReference serviceReference , String [ ] serviceExportedInterfaces , String [ ] serviceExportedConfigs , String [ ] serviceIntents ) { Collection rsContainers = findExistingHostContainers ( serviceReference , serviceExportedInterfaces , serviceExportedConfigs , serviceIntents ) ; if ( ( ( rsContainers . size ( ) ) == 0 ) && ( autoCreateContainer ) ) { rsContainers = createAndConfigureHostContainers ( serviceReference , serviceExportedInterfaces , serviceExportedConfigs , serviceIntents ) ; <START_BUG> Object target = serviceReference . getProperty ( EXPORTED_CONTAINER_CONNECT_TARGET ) ; <END_BUG> if ( target != null ) { for ( Iterator i = rsContainers . iterator ( ) ; i . hasNext ( ) ; ) { IContainer container = ( ( IRemoteServiceContainer ) ( i . next ( ) ) ) . getContainer ( ) ; try { connectHostContainer ( serviceReference , container , target ) ; } catch ( Exception e ) { logException ( ( ( ( "doConnectContainer<seq2seq4repair_space>failure<seq2seq4repair_space>containerID=" + ( container . getID ( ) ) ) + "<seq2seq4repair_space>target=" ) + target ) , e ) ; } } } } return ( ( IRemoteServiceContainer [ ] ) ( rsContainers . toArray ( new IRemoteServiceContainer [ ] { } ) ) ) ; } public void close ( ) { } }

Fix:
Object target = serviceReference . getProperty ( ENDPOINT_CONNECTTARGET_ID ) ;
Buggy code:
public class MainActivity extends ActionBarActivity { private String date_format = "dd-MM-yyyy" ; private Toolbar toolbar_menu ; private DrawerLayout drawer_widget ; private ListView left_menu ; private ActionBarDrawerToggle drawer_toggle ; @ Override protected void onCreate ( Bundle savedInstanceState ) { super . onCreate ( savedInstanceState ) ; setContentView ( activity_main ) ; initMenus ( ) ; setTitle ( getString ( transactions_title ) ) ; <START_BUG> setFragmentParams ( new CategoriesFragment ( ) ) ; <END_BUG> } public void setFragmentParams ( Fragment fragment ) { } public void initMenus ( ) { } @ Override public void setTitle ( CharSequence title ) { } @ Override protected void onPostCreate ( Bundle savedInstanceState ) { } private class DrawerItemClickListener implements ListView . OnItemClickListener { @ Override public void onItemClick ( AdapterView < ? > parent , View view , int position , long id ) { } } }

Fix:
setFragmentParams ( new TransactionsFragment ( ) ) ;
Buggy code:
public final class Section { private static StringValueTable sections = new StringValueTable ( ) ; private static StringValueTable longSections = new StringValueTable ( ) ; private static StringValueTable updSections = new StringValueTable ( ) ; public static final byte QUESTION = 0 ; public static final byte ANSWER = 1 ; public static final byte AUTHORITY = 2 ; public static final byte ADDITIONAL = 3 ; public static final byte ZONE = 0 ; public static final byte PREREQ = 1 ; public static final byte UPDATE = 2 ; private Section ( ) { } public static String string ( int i ) { } public static String longString ( int i ) { } public static String updString ( int i ) { } public static byte value ( String s ) { <START_BUG> byte i = ( ( byte ) ( Section . sections . getValue ( s . toUpperCase ( ) ) ) ) ; <END_BUG> if ( i >= 0 ) return i ; try { return Byte . parseByte ( s ) ; } catch ( Exception e ) { return - 1 ; } } }

Fix:
byte i = ( ( byte ) ( Section . sections . getValue ( s . toLowerCase ( ) ) ) ) ;
Buggy code:
public class TestFilterIndexReader extends LuceneTestCase { private static class TestReader extends FilterIndexReader { private static class TestTermEnum extends FilterTermEnum { public TestTermEnum ( TermEnum termEnum ) { } public boolean next ( ) throws IOException { } } private static class TestTermPositions extends FilterTermPositions { public TestTermPositions ( TermPositions in ) { } public boolean next ( ) throws IOException { } } public TestReader ( IndexReader reader ) { } public TermEnum terms ( ) throws IOException { } public TermPositions termPositions ( ) throws IOException { } } public static void main ( String [ ] args ) { } public void testFilterIndexReader ( ) throws Exception { RAMDirectory directory = new MockRAMDirectory ( ) ; IndexWriter writer = new IndexWriter ( directory , new WhitespaceAnalyzer ( ) , true , MaxFieldLength . LIMITED ) ; Document d1 = new Document ( ) ; d1 . add ( new org . apache . lucene . document . Field ( "default" , "one<seq2seq4repair_space>two" , Store . YES , Index . ANALYZED ) ) ; writer . addDocument ( d1 ) ; Document d2 = new Document ( ) ; d2 . add ( new org . apache . lucene . document . Field ( "default" , "one<seq2seq4repair_space>three" , Store . YES , Index . ANALYZED ) ) ; writer . addDocument ( d2 ) ; Document d3 = new Document ( ) ; d3 . add ( new org . apache . lucene . document . Field ( "default" , "two<seq2seq4repair_space>four" , Store . YES , Index . ANALYZED ) ) ; writer . addDocument ( d3 ) ; writer . close ( ) ; <START_BUG> IndexReader reader = new TestFilterIndexReader . TestReader ( IndexReader . open ( directory ) ) ; <END_BUG> assertTrue ( reader . isOptimized ( ) ) ; TermEnum terms = reader . terms ( ) ; while ( terms . next ( ) ) { assertTrue ( ( ( terms . term ( ) . text ( ) . indexOf ( 'e' ) ) != ( - 1 ) ) ) ; } terms . close ( ) ; TermPositions positions = reader . termPositions ( new Term ( "default" , "one" ) ) ; while ( positions . next ( ) ) { assertTrue ( ( ( ( positions . doc ( ) ) % 2 ) == 1 ) ) ; } int NUM_DOCS = 3 ; TermDocs td = reader . termDocs ( null ) ; for ( int i = 0 ; i < NUM_DOCS ; i ++ ) { assertTrue ( td . next ( ) ) ; assertEquals ( i , td . doc ( ) ) ; assertEquals ( 1 , td . freq ( ) ) ; } td . close ( ) ; reader . close ( ) ; directory . close ( ) ; } }

Fix:
IndexReader reader = new TestFilterIndexReader . TestReader ( IndexReader . open ( directory , true ) ) ;
Buggy code:
public abstract class WorkbenchWizardListSelectionPage extends WorkbenchWizardSelectionPage implements IDoubleClickListener , ISelectionChangedListener { private static final String DIALOG_SETTING_SECTION_NAME = "WizardListSelectionPage." ; private static final int SIZING_LISTS_HEIGHT = 200 ; private static final String STORE_SELECTED_WIZARD_ID = ( WorkbenchWizardListSelectionPage . DIALOG_SETTING_SECTION_NAME ) + "STORE_SELECTED_WIZARD_ID" ; private TableViewer viewer ; private String message ; protected WorkbenchWizardListSelectionPage ( IWorkbench aWorkbench , IStructuredSelection currentSelection , AdaptableList wizardElements , String message ) { } public void createControl ( Composite parent ) { } private void createViewer ( Composite parent ) { } protected abstract IWizardNode createWizardNode ( WorkbenchWizardElement element ) { } public void doubleClick ( DoubleClickEvent event ) { } private void layoutTopControl ( Control control ) { } private void restoreWidgetValues ( ) { } public void saveWidgetValues ( ) { IStructuredSelection sel = ( ( IStructuredSelection ) ( viewer . getSelection ( ) ) ) ; if ( ( sel . size ( ) ) > 0 ) { WorkbenchWizardElement selectedWizard = ( ( WorkbenchWizardElement ) ( sel . getFirstElement ( ) ) ) ; <START_BUG> getDialogSettings ( ) . put ( WorkbenchWizardListSelectionPage . STORE_SELECTED_WIZARD_ID , selectedWizard . getID ( ) ) ; <END_BUG> } } public void selectionChanged ( SelectionChangedEvent event ) { } }

Fix:
getDialogSettings ( ) . put ( WorkbenchWizardListSelectionPage . STORE_SELECTED_WIZARD_ID , selectedWizard . getId ( ) ) ;
Buggy code:
public abstract class IRCAbstractContainer extends AbstractContainer { protected static final String ROOT_ROOMNAME = "//" ; protected static final String COMMAND_PREFIX = "//" ; protected static final String COMMAND_DELIM = "<seq2seq4repair_space>" ; protected static final String JOIN_COMMAND = "JOIN" ; protected static final String LIST_COMMAND = "LIST" ; protected static final String PART_COMMAND = "PART" ; protected static final String NICK_COMMAND = "NICK" ; protected static final String MSG_COMMAND = "MSG" ; protected static final String NOTICE_COMMAND = "NOTICE" ; protected static final String WHOIS_COMMAND = "WHOIS" ; protected static final String QUIT_COMMAND = "QUIT" ; protected static final String AWAY_COMMAND = "AWAY" ; protected static final String TOPIC_COMMAND = "TOPIC" ; protected static final String INVITE_COMMAND = "INVITE" ; protected static final String OPERATOR_PREFIX = "@" ; protected ID localID = null ; protected ID targetID = null ; protected List msgListeners = new ArrayList ( ) ; protected ID unknownID = null ; private ArrayList subjectListeners = new ArrayList ( ) ; public IRCAbstractContainer ( ) { } protected void trace ( String msg ) { } protected void traceStack ( Throwable t , String msg ) { } public void fireMessageListeners ( ID sender , String msg ) { for ( Iterator i = msgListeners . iterator ( ) ; i . hasNext ( ) ; ) { IIMMessageListener l = ( ( IIMMessageListener ) ( i . next ( ) ) ) ; <START_BUG> l . handleMessageEvent ( new org . eclipse . ecf . presence . chatroom . ChatRoomMessageEvent ( sender , new org . eclipse . ecf . presence . chatroom . ChatRoomMessage ( sender , msg ) ) ) ; <END_BUG> } } public ID getID ( ) { } public ID getConnectedID ( ) { } protected String [ ] parseUsers ( String usergroup ) { } protected String [ ] parseUserNames ( String list ) { } protected String concat ( String [ ] args , int start , String suffix ) { } protected ID createIDFromString ( String str ) { } protected String trimOperator ( String user ) { } public abstract void disconnect ( ) { } public void dispose ( ) { } protected String [ ] parseCommandTokens ( String message ) { } protected boolean isCommand ( String message ) { } public void addMessageListener ( IIMMessageListener l ) { } public void removeMessageListener ( IIMMessageListener l ) { } public void addChatRoomAdminListener ( IChatRoomAdminListener subjectListener ) { } public void removeChatRoomAdminListener ( IChatRoomAdminListener subjectListener ) { } public void fireSubjectListeners ( ID fromID , String newSubject ) { } }

Fix:
l . handleMessageEvent ( new org . eclipse . ecf . presence . chatroom . ChatRoomMessageEvent ( sender , new org . eclipse . ecf . presence . chatroom . ChatRoomMessage ( sender , targetID , msg ) ) ) ;
Buggy code:
public class ProcessRunnerFactory { private static ArrayList < ProcessRunner > processRunners ; private static Logger tbfLogger = Logger . getLogger ( ProcessRunnerFactory . class ) ; private static String processOutputFolder ; public void createTestRunners ( String templateFolder , String templateFile , String outputFolder , String outputFile , String testScriptPath , String startingRule , int timeout , int instanceCount ) { } public void createScenarioRunners ( String templateFolder , String templateFile , String outputFolder , String outputFile , String testScriptPath , String startingRule , int timeout , int instanceCount ) { } private void createProcessRunners ( String outputFolder ) { } public void assignProgramsToProcessRunners ( ArrayList < String > programs , int startingProgram ) { int numProcessRunners = ProcessRunnerFactory . processRunners . size ( ) ; for ( int i = 0 ; i < ( programs . size ( ) ) ; i ++ ) { ProcessRunnerFactory . processRunners . get ( ( i % numProcessRunners ) ) . addProgramToPrograms ( programs . get ( i ) ) ; } for ( ProcessRunner pr : ProcessRunnerFactory . processRunners ) { <START_BUG> if ( startingProgram > ( pr . getPrograms ( ) . size ( ) ) ) { <END_BUG> pr . setPrograms ( new ArrayList ( pr . getPrograms ( ) . subList ( startingProgram , pr . getPrograms ( ) . size ( ) ) ) ) ; } } } public TreeMap < String , String > runAllProcessesInSerial ( ) { } public TreeMap < String , String > runAllProcessesInParallel ( ) { } public void cleanupProcessOutputFolder ( ) { } public ProcessRunner getFirstProcessRunner ( ) { } public String getProcessOutputFolder ( ) { } public void setProcessOutputFolder ( String processOutputFolder ) { } }

Fix:
if ( startingProgram < ( pr . getPrograms ( ) . size ( ) ) ) {
Buggy code:
public class LocalHeaderCacheFolder extends LocalFolder { protected HeaderItemList headerList ; protected TableItem headerTableItemList ; protected File headerFile ; protected boolean headerCacheAlreadyLoaded ; public LocalHeaderCacheFolder ( FolderItem item ) { } public void add ( DefaultCard item ) { } public boolean exists ( String email ) { } public void remove ( Object uid ) { } public void modify ( DefaultCard card , Object uid ) { } public DataStorage getDataStorageInstance ( ) { } protected int getMessageFileCount ( ) { } public boolean isHeaderCacheAlreadyLoaded ( ) { } public HeaderItemList getHeaderItemList ( ) { } public HeaderItemList getHeaderItemList ( Object [ ] uids ) { } protected void addHeaderItem ( ContactCard card , Object uid ) { } protected void addHeaderItem ( GroupListCard card , Object uid ) { } public void load ( WorkerStatusController worker ) throws Exception { } public void save ( WorkerStatusController worker ) throws Exception { <START_BUG> log . info ( ( "saveing<seq2seq4repair_space>header-cache=" + ( headerFile ) ) ) ; <END_BUG> FileOutputStream istream = new FileOutputStream ( headerFile . getPath ( ) ) ; ObjectOutputStream p = new ObjectOutputStream ( istream ) ; int count = headerList . count ( ) ; p . writeInt ( count ) ; HeaderItem item ; for ( int i = 0 ; i < count ; i ++ ) { p . writeInt ( ( i + 1 ) ) ; item = headerList . get ( i ) ; if ( item == null ) { System . out . println ( "there<seq2seq4repair_space>appears<seq2seq4repair_space>to<seq2seq4repair_space>be<seq2seq4repair_space>a<seq2seq4repair_space>card<seq2seq4repair_space>file," ) ; System . out . println ( "but<seq2seq4repair_space>associated<seq2seq4repair_space>card<seq2seq4repair_space>index<seq2seq4repair_space>in<seq2seq4repair_space>folder" ) ; throw new Exception ( "addressbookfolder->save()<seq2seq4repair_space>==<seq2seq4repair_space>message<seq2seq4repair_space>is<seq2seq4repair_space>null!" ) ; } p . writeObject ( item . getUid ( ) ) ; String column ; Object o ; for ( int j = 0 ; j < ( headerTableItemList . count ( ) ) ; j ++ ) { org . columba . core . config . HeaderItem h = headerTableItemList . getHeaderItem ( j ) ; column = ( ( String ) ( h . get ( "name" ) ) ) ; o = item . get ( column ) ; p . writeObject ( o ) ; } } p . close ( ) ; } public void recreateIndex ( ) { } public HeaderItemList searchPattern ( String pattern ) { } }

Fix:
log . info ( ( "saving<seq2seq4repair_space>header-cache=" + ( headerFile ) ) ) ;
Buggy code:
@ TargetApi ( VERSION_CODES . FROYO ) public class InstagramSharePlugin extends CordovaPlugin { private static final FilenameFilter OLD_IMAGE_FILTER = new FilenameFilter ( ) { @ Override public boolean accept ( File dir , String name ) { } } ; CallbackContext cbContext ; @ Override public boolean execute ( String action , JSONArray args , CallbackContext callbackContext ) throws JSONException { } private void isInstalled ( ) { } public void test ( ) { <START_BUG> System . out . println ( "***************<seq2seq4repair_space>SAMUEL<seq2seq4repair_space>CASTRO<seq2seq4repair_space>SILVA<seq2seq4repair_space>*******************" ) ; <END_BUG> } private void share ( String imageString , String captionString ) { } @ Override public void onActivityResult ( int requestCode , int resultCode , Intent data ) { } }

Fix:
Log . v ( "Instagram" , "***************<seq2seq4repair_space>SAMUEL<seq2seq4repair_space>CASTRO<seq2seq4repair_space>SILVA<seq2seq4repair_space>*******************" ) ;
Buggy code:
@ SuppressWarnings ( "deprecation" ) public abstract class AbstractContainerEntityManagerFactoryIntegrationTests extends AbstractEntityManagerFactoryIntegrationTests { @ Transactional ( propagation = Propagation . NOT_SUPPORTED ) public void testEntityManagerFactoryImplementsEntityManagerFactoryInfo ( ) { } public void testStateClean ( ) { } public void testJdbcTx1_1 ( ) { } public void testJdbcTx1_2 ( ) { } public void testJdbcTx1_3 ( ) { } public void testJdbcTx2 ( ) { } @ SuppressWarnings ( { "unused" , "unchecked" } ) public void testEntityManagerProxyIsProxy ( ) { } public void testBogusQuery ( ) { } public void testGetReferenceWhenNoRow ( ) { } public void testLazyLoading ( ) { try { Person tony = new Person ( ) ; tony . setFirstName ( "Tony" ) ; tony . setLastName ( "Blair" ) ; tony . setDriversLicense ( new DriversLicense ( "8439DK" ) ) ; sharedEntityManager . persist ( tony ) ; setComplete ( ) ; endTransaction ( ) ; startNewTransaction ( ) ; sharedEntityManager . clear ( ) ; Person newTony = entityManagerFactory . createEntityManager ( ) . getReference ( Person . class , tony . getId ( ) ) ; assertNotSame ( newTony , tony ) ; endTransaction ( ) ; assertNotNull ( newTony . getDriversLicense ( ) ) ; newTony . getDriversLicense ( ) . getSerialNumber ( ) ; } finally { <START_BUG> deleteFromTables ( new String [ ] { "person" , "drivers_license" } ) ; <END_BUG> } } @ SuppressWarnings ( "unchecked" ) public void testMultipleResults ( ) { } protected final void insertPerson ( String firstName ) { } public void testEntityManagerProxyRejectsProgrammaticTxManagement ( ) { } public void testInstantiateAndSaveWithSharedEmProxy ( ) { } protected void testInstantiateAndSave ( EntityManager em ) { } @ SuppressWarnings ( "unchecked" ) public void testQueryNoPersons ( ) { } @ Transactional ( propagation = Propagation . NOT_SUPPORTED ) @ SuppressWarnings ( "unchecked" ) public void testQueryNoPersonsNotTransactional ( ) { } @ SuppressWarnings ( { "unused" , "unchecked" } ) public void testQueryNoPersonsShared ( ) { } @ Transactional ( propagation = Propagation . NOT_SUPPORTED ) @ SuppressWarnings ( "unchecked" ) public void testQueryNoPersonsSharedNotTransactional ( ) { } public void testCanSerializeProxies ( ) throws Exception { } }

Fix:
deleteFromTables ( "person" , "drivers_license" ) ;
Buggy code:
public class FileFragment extends Fragment implements OnItemClickListener { private ListView mList ; private FileBaseAdapter mAdapter ; private Context mContext ; private String SdPath ; private File [ ] filesList ; private static File RECOVERY_DIR = new File ( "//cache//recovery" ) ; private static File COMMAND_FILE = new File ( FileFragment . RECOVERY_DIR , "command" ) ; @ Override public void onCreate ( Bundle savedInstanceState ) { } @ Override public View onCreateView ( LayoutInflater inflater , ViewGroup container , Bundle savedInstanceState ) { } @ Override public void onItemClick ( AdapterView < ? > arg0 , View parent , final int position , long id ) { if ( filesList [ position ] . isDirectory ( ) ) { File [ ] childs = filesList [ position ] . listFiles ( ) ; Arrays . sort ( childs ) ; Fragment fragment = new FileFragment ( ) ; Bundle bundle = new Bundle ( ) ; bundle . putString ( "FILEPATH" , filesList [ position ] . getAbsolutePath ( ) ) ; fragment . setArguments ( bundle ) ; FragmentTransaction ft = getFragmentManager ( ) . beginTransaction ( ) ; <START_BUG> ft . replace ( activity_container , fragment ) ; <END_BUG> ft . commit ( ) ; } else if ( filesList [ position ] . getName ( ) . endsWith ( ".apk" ) ) { Intent intent = new Intent ( Intent . ACTION_VIEW ) ; intent . setDataAndType ( Uri . fromFile ( filesList [ position ] ) , "application//vnd.android.package-archive" ) ; startActivity ( intent ) ; } else if ( filesList [ position ] . getName ( ) . endsWith ( ".zip" ) ) { AlertDialog . Builder builder = new AlertDialog . Builder ( mContext ) ; builder . setTitle ( filesList [ position ] . getName ( ) ) ; builder . setItems ( flash_dialog , new DialogInterface . OnClickListener ( ) { @ Override public void onClick ( DialogInterface dialog , int which ) { bootCommand ( ( "--update_package=" + ( filesList [ position ] . getAbsolutePath ( ) ) ) ) ; } } ) ; AlertDialog dialog = builder . create ( ) ; dialog . show ( ) ; } else if ( filesList [ position ] . getName ( ) . endsWith ( ".img" ) ) { AlertDialog . Builder builder = new AlertDialog . Builder ( mContext ) ; builder . setTitle ( filesList [ position ] . getName ( ) ) ; builder . setItems ( install_image_dialog , new DialogInterface . OnClickListener ( ) { @ Override public void onClick ( DialogInterface dialog , int which ) { switch ( which ) { case 0 : installBoot ( filesList [ position ] . getAbsolutePath ( ) ) ; break ; case 1 : installRecovery ( filesList [ position ] . getAbsolutePath ( ) ) ; break ; } } } ) ; AlertDialog dialog = builder . create ( ) ; dialog . show ( ) ; } } public void bootCommand ( String command ) { } public void installBoot ( String bootPath ) { } public void installRecovery ( String recoveryPath ) { } }

Fix:
activity_container . fragment = $missing$ ;
Buggy code:
public class NewExtXptResourceWizardPage extends WizardNewFileCreationPage { private String extension ; private String initialContents ; public NewExtXptResourceWizardPage ( String pageName , IStructuredSelection selection , String initial , String extension , String initialContents ) { } @ Override public String getErrorMessage ( ) { if ( ! ( getFileName ( ) . endsWith ( ( "." + ( extension ) ) ) ) ) <START_BUG> return ( Messages . NewOAWResourcePage_Error ) + ( extension ) ; <END_BUG> return null ; } @ Override protected InputStream getInitialContents ( ) { } }

Fix:
return ( Messages . NewExtXptResourceWizardPage_Error ) + ( extension ) ;
Buggy code:
public class MarkupParserPerformanceTest { private static final Log log = LogFactory . getLog ( MarkupParserPerformanceTest . class ) ; private static List < String > exclude ; private List < File > files ; private List < MarkupResourceStream > resources ; private WicketTester application = new WicketTester ( null ) { @ Override protected void init ( ) { } } ; private double [ ] duration ; private List < File > getFileListing ( final File startDir ) throws FileNotFoundException { } private List < MarkupResourceStream > loadFiles ( final List < File > files ) throws IOException { } private void init ( final String [ ] srcDirs ) throws IOException { } private void parseAllSequentially ( final int count ) { } private int internalParseAllSequentially ( ) { } private void parseAllSequentiallyWithMarkupCache ( final int count ) { } private int internalParseAllSequentiallyWithMarkupCache ( ) { MarkupParserPerformanceTest . log . debug ( "Sequentially<seq2seq4repair_space>parse<seq2seq4repair_space>all<seq2seq4repair_space>markups<seq2seq4repair_space>(with<seq2seq4repair_space>MarkupCache)" ) ; long overallTime = System . currentTimeMillis ( ) ; this . duration = new double [ this . files . size ( ) ] ; int i = 0 ; int failures = 0 ; File markupFile = null ; MarkupCache cache = this . application . getMarkupCache ( ) ; DummyPage page = new DummyPage ( ) ; DummyContainer container = new DummyContainer ( page ) ; for ( final File file : this . files ) { markupFile = file ; container . setMarkupFile ( file ) ; try { long time = System . currentTimeMillis ( ) ; <START_BUG> cache . getMarkupStream ( container , true ) ; <END_BUG> this . duration [ i ] = ( System . currentTimeMillis ( ) ) - time ; } catch ( Exception ex ) { failures += 1 ; MarkupParserPerformanceTest . log . debug ( ( "Failed<seq2seq4repair_space>to<seq2seq4repair_space>load<seq2seq4repair_space>markup:<seq2seq4repair_space>" + ( this . files . get ( i ) . toString ( ) ) ) ) ; } if ( ( ( ++ i ) % 100 ) == 0 ) { MarkupParserPerformanceTest . log . debug ( ( "...<seq2seq4repair_space>" + i ) ) ; } } long diff = ( System . currentTimeMillis ( ) ) - overallTime ; i -= failures ; MarkupParserPerformanceTest . log . info ( ( ( ( ( ( ( i + "<seq2seq4repair_space>files;<seq2seq4repair_space>duration:<seq2seq4repair_space>" ) + diff ) + "ms;<seq2seq4repair_space>avg<seq2seq4repair_space>per<seq2seq4repair_space>file:<seq2seq4repair_space>" ) + ( ( ( double ) ( diff ) ) // i ) ) + "ms;<seq2seq4repair_space>failures:<seq2seq4repair_space>" ) + failures ) ) ; return i ; } private int parseRandomly ( final int count ) { } private void stats ( ) { } public void run ( ) { } public static void main ( String [ ] args ) { } }

Fix:
cache . getMarkup ( container , true ) ;
Buggy code:
public class SkypeLocalLibrary extends Functions { private boolean videoStatus = true ; private ConnectorListener listener ; private GUI g ; public Friend [ ] getContacts ( ) throws SkypeException { } private Comparator < Friend > getContactComparator ( ) { } public String sendCommand ( String command , String responseHeader ) throws ConnectorException { } public ConnectorListener getConnectorListener ( ) { } private String contactToString ( Friend contact ) { } public JButton createIntoButton ( Friend friend , ActionListener listener ) throws SkypeException { } public Chat getChat ( String friendId ) throws SkypeException { } public Chat getChat ( ) throws SkypeException { } public Friend getFriend ( String friendId ) throws SkypeException , FriendNotFoundException { } public Call startCall ( String friendId ) throws SkypeException , FriendNotFoundException { } public void toggleVideo ( Call call ) throws SkypeException { } private void checkConditions ( ) throws SkypeException { } public Friend [ ] getContacts ( String skypeId ) throws SkypeException { } public void initSkype ( ) throws SkypeException { try { checkConditions ( ) ; } catch ( exceptions e ) { errorHandler ( e ) ; } Skype . addCallListener ( new CallListener ( ) { @ Override public void callReceived ( Call receivedCall ) throws SkypeException { <START_BUG> TangibleVirtualGame . lastCall = receivedCall ; <END_BUG> if ( GUIFunctions . confimationMessage ( ( ( "You<seq2seq4repair_space>are<seq2seq4repair_space>being<seq2seq4repair_space>called<seq2seq4repair_space>by<seq2seq4repair_space>" + ( receivedCall . getPartner ( ) . getFullName ( ) ) ) + ".<seq2seq4repair_space>Would<seq2seq4repair_space>you<seq2seq4repair_space>like<seq2seq4repair_space>to<seq2seq4repair_space>play<seq2seq4repair_space>a<seq2seq4repair_space>game<seq2seq4repair_space>with<seq2seq4repair_space>him//her?" ) ) ) { receivedCall . answer ( ) ; GUIFunctions . createFrame ( g . gf . gameScreen ( ) ) ; } else { receivedCall . cancel ( ) ; TangibleVirtualGame . lastCall = null ; } System . out . println ( ( "callReceived<seq2seq4repair_space>triggered:<seq2seq4repair_space>" + ( receivedCall . getPartnerId ( ) ) ) ) ; } @ Override public void callMaked ( Call makedCall ) throws SkypeException { System . out . println ( ( "callMaked<seq2seq4repair_space>triggered:<seq2seq4repair_space>" + ( makedCall . getPartnerId ( ) ) ) ) ; } } ) ; if ( ( chatMessageListeners . size ( ) ) == 0 ) { Skype . addChatMessageListener ( getDefaultChatMessageListener ( ) ) ; System . out . println ( Arrays . toString ( chatMessageListeners . toArray ( ) ) ) ; } } private ChatMessageListener getDefaultChatMessageListener ( ) { } protected void sendMessageToGame ( ChatMessage receivedChatMessage ) { } private void printStreamInfo ( Stream stream ) { } public SkypeLocalLibrary ( GUI g ) throws SkypeException { } public void setVideoOn ( boolean status ) throws SkypeException { } }

Fix:
g . lastCall = receivedCall ;
Buggy code:
public final class HighscoreServer { public static final int PORT = 42042 ; private static boolean running = true ; private static ServerSocket ss ; private HighscoreServer ( ) { } public static void main ( final String ... args ) throws IOException { } static void quit ( ) { } static void logError ( final String message ) { } static void log ( final String message ) { } static class CLIThread implements Runnable { @ Override public void run ( ) { <START_BUG> final Scanner sc = new Scanner ( System . in ) ; <END_BUG> String command ; HighscoreServer . log ( "Type<seq2seq4repair_space>\"stop\"<seq2seq4repair_space>to<seq2seq4repair_space>exit." ) ; while ( HighscoreServer . running ) { command = sc . nextLine ( ) ; switch ( command ) { case "q" : case "stop" : case "exit" : case "evacuate" : case "implode" : HighscoreServer . quit ( ) ; try { HighscoreServer . ss . close ( ) ; HighscoreServer . log ( "Stopping<seq2seq4repair_space>the<seq2seq4repair_space>server." ) ; } catch ( IOException e ) { HighscoreServer . logError ( "Could<seq2seq4repair_space>not<seq2seq4repair_space>stop<seq2seq4repair_space>server?<seq2seq4repair_space>Exiting<seq2seq4repair_space>anyway<seq2seq4repair_space>:D" ) ; } break ; default : break ; } } sc . close ( ) ; } } }

Fix:
final Scanner sc = new Scanner ( System . in , "UTF-8" ) ;
Buggy code:
public class HtmlProblemFinderTest extends TestCase { public void testProblemFinder ( ) { <START_BUG> final MarkupParser parser = new MarkupParser ( null , new XmlPullParser ( ) ) { <END_BUG> public void initFilterChain ( ) { appendMarkupFilter ( new HtmlProblemFinder ( HtmlProblemFinder . ERR_THROW_EXCEPTION ) ) ; } } ; try { parser . parse ( "<img<seq2seq4repair_space>src=\"\"//>" ) ; assertTrue ( "Should<seq2seq4repair_space>have<seq2seq4repair_space>thrown<seq2seq4repair_space>an<seq2seq4repair_space>exception" , false ) ; } catch ( Exception ex ) { } } }

Fix:
final MarkupParser parser = new MarkupParser ( new XmlPullParser ( ) ) {
Buggy code:
public class SpecialSymbolToken extends Token { public SpecialSymbolToken ( Source source ) throws IOException { } @ Override protected void extract ( ) throws IOException { char firstChar = currentChar ( ) ; text = Character . toString ( firstChar ) ; type = null ; if ( ( source . atEol ( ) ) || ( source . atEof ( ) ) ) { type = TokenType . END_OF_LINE ; <START_BUG> nextChar ( ) ; <END_BUG> return ; } switch ( firstChar ) { case '(' : case ')' : case '{' : case '}' : case '[' : case ']' : case ':' : case ',' : case '?' : case '~' : { nextChar ( ) ; break ; } case '+' : case '-' : case '*' : case '//' : case '%' : case '<' : case '>' : case '=' : case '!' : case '&' : case '^' : case '|' : { char secondChar = nextChar ( ) ; if ( secondChar == '=' ) { text += secondChar ; nextChar ( ) ; } else if ( ( firstChar == '*' ) && ( secondChar == '*' ) ) { text += secondChar ; nextChar ( ) ; } else if ( ( firstChar == '<' ) && ( secondChar == '<' ) ) { text += secondChar ; char thirdChar = nextChar ( ) ; if ( thirdChar == '=' ) { text += thirdChar ; nextChar ( ) ; } } else if ( ( firstChar == '>' ) && ( secondChar == '>' ) ) { text += secondChar ; char thirdChar = nextChar ( ) ; if ( thirdChar == '=' ) { text += thirdChar ; nextChar ( ) ; } } else if ( ( firstChar == '//' ) && ( secondChar == '//' ) ) { text += secondChar ; nextChar ( ) ; } else if ( ( firstChar == '&' ) && ( secondChar == '&' ) ) { text += secondChar ; nextChar ( ) ; } else if ( ( firstChar == '|' ) && ( secondChar == '|' ) ) { text += secondChar ; nextChar ( ) ; } break ; } case '.' : { char secondChar = nextChar ( ) ; if ( secondChar == '.' ) { text += secondChar ; char thirdChar = nextChar ( ) ; if ( thirdChar == '.' ) { text += thirdChar ; nextChar ( ) ; } } break ; } default : { nextChar ( ) ; type = TokenType . ERROR ; value = ErrorCode . INVALID_CHARACTER ; } } if ( ( type ) == null ) { type = TokenType . SPECIAL_SYMBOLS . get ( text ) ; } } No newline ; at end ; of file ; }

Fix:
source . addPosition ( ) ;
Buggy code:
public abstract class Lob implements UnitOfWorkListener { public static final int STRING = 2 ; public static final int ASCII_STREAM = 4 ; public static final int UNICODE_STREAM = 8 ; public static final int CHARACTER_STREAM = 16 ; public static final int BINARY_STREAM = 32 ; public static final int BINARY_STRING = 64 ; protected Agent agent_ ; protected int dataType_ = 0 ; protected long sqlLength_ ; protected boolean lengthObtained_ ; protected Lob ( Agent agent ) { } protected void finalize ( ) throws Throwable { } public long sqlLength ( ) throws SqlException { } public void listenToUnitOfWork ( ) { <START_BUG> agent_ . connection_ . CommitAndRollbackListeners_ . put ( this , null ) ; <END_BUG> } public void completeLocalCommit ( Iterator listenerIterator ) { } public void completeLocalRollback ( Iterator listenerIterator ) { } public Agent getAgent ( ) { } void checkForClosedConnection ( ) throws SqlException { } void completeLocalRollback ( ) { } void completeLocalCommit ( ) { } }

Fix:
agent_ . connection_ . CommitAndRollbackListeners_ . add ( this ) ;
Buggy code:
public class GenericSignatureParser { private String [ ] tokenStream ; private int tokenIndex = 0 ; public ClassSignature parseAsClassSignature ( String sig ) { } public MethodTypeSignature parseAsMethodSignature ( String sig ) { } public FieldTypeSignature parseAsFieldSignature ( String sig ) { } private FormalTypeParameter parseFormalTypeParameter ( ) { } private FieldTypeSignature parseFieldTypeSignature ( boolean isOptional ) { } private ArrayTypeSignature parseArrayTypeSignature ( ) { } private ClassTypeSignature parseClassTypeSignature ( ) { SimpleClassTypeSignature outerType = null ; SimpleClassTypeSignature [ ] nestedTypes = new SimpleClassTypeSignature [ 0 ] ; StringBuffer ret = new StringBuffer ( ) ; String identifier = eatIdentifier ( ) ; ret . append ( identifier ) ; while ( maybeEat ( "//" ) ) { ret . append ( "//" ) ; ret . append ( eatIdentifier ( ) ) ; } identifier = ret . toString ( ) ; while ( ! ( maybeEat ( ";" ) ) ) { if ( maybeEat ( "." ) ) { outerType = new SimpleClassTypeSignature ( identifier ) ; List nestedTypeList = new ArrayList ( ) ; do { ret . append ( "." ) ; SimpleClassTypeSignature sig = parseSimpleClassTypeSignature ( ) ; ret . append ( sig . toString ( ) ) ; <START_BUG> nestedTypeList . add ( ret ) ; <END_BUG> } while ( maybeEat ( "." ) ) ; nestedTypes = new SimpleClassTypeSignature [ nestedTypeList . size ( ) ] ; nestedTypeList . toArray ( nestedTypes ) ; } else if ( tokenStream [ tokenIndex ] . equals ( "<" ) ) { ret . append ( "<" ) ; TypeArgument [ ] tArgs = maybeParseTypeArguments ( ) ; for ( int i = 0 ; i < ( tArgs . length ) ; i ++ ) { ret . append ( tArgs [ i ] . toString ( ) ) ; } ret . append ( ">" ) ; outerType = new SimpleClassTypeSignature ( identifier , tArgs ) ; List nestedTypeList = new ArrayList ( ) ; while ( maybeEat ( "." ) ) { ret . append ( "." ) ; SimpleClassTypeSignature sig = parseSimpleClassTypeSignature ( ) ; ret . append ( sig . toString ( ) ) ; nestedTypeList . add ( sig ) ; } nestedTypes = new SimpleClassTypeSignature [ nestedTypeList . size ( ) ] ; nestedTypeList . toArray ( nestedTypes ) ; } else { throw new IllegalStateException ( ( "Expecting<seq2seq4repair_space>.,<,<seq2seq4repair_space>or<seq2seq4repair_space>;,<seq2seq4repair_space>but<seq2seq4repair_space>found<seq2seq4repair_space>" + ( tokenStream [ tokenIndex ] ) ) ) ; } } ret . append ( ";" ) ; if ( outerType == null ) outerType = new SimpleClassTypeSignature ( ret . toString ( ) ) ; return new ClassTypeSignature ( ret . toString ( ) , outerType , nestedTypes ) ; } private SimpleClassTypeSignature parseSimpleClassTypeSignature ( ) { } private TypeArgument parseTypeArgument ( ) { } private TypeArgument [ ] maybeParseTypeArguments ( ) { } private TypeVariableSignature parseTypeVariableSignature ( ) { } private boolean maybeEat ( String token ) { } private void eat ( String token ) { } private String eatIdentifier ( ) { } public String [ ] tokenize ( String signatureString ) { } }

Fix:
nestedTypeList . add ( sig ) ;
Buggy code:
public class JSONPathAssertionTest { public JSONPathAssertionTest ( ) { } @ BeforeClass public static void setUpClass ( ) { } @ AfterClass public static void tearDownClass ( ) { } @ Before public void setUp ( ) { } @ After public void tearDown ( ) { } @ Test public void testGetJsonPath ( ) { } @ Test public void testSetJsonPath ( ) { } @ Test public void testGetExpectedValue ( ) { } @ Test public void testSetExpectedValue ( ) { } @ Test public void testSetJsonValidationBool ( ) { } @ Test public void testIsJsonValidationBool ( ) { } @ Test public void testGetResult_positive ( ) { } @ Test public void testGetResult_negative ( ) { } @ Test public void testGetResult_null ( ) { } @ Test public void testGetResult_null_not_found ( ) { } @ Test public void testGetResult_null_novalidate ( ) { } @ Test public void testGetResult_no_such_path ( ) { } @ Test public void testGetResult_list_val ( ) { } @ Test public void testGetResult_list_negative ( ) { } @ Test public void testGetResult_list_empty_novalidate ( ) { } @ Test public void testGetResult_dict ( ) { System . out . println ( "getResult<seq2seq4repair_space>notexist" ) ; SampleResult samplerResult = new SampleResult ( ) ; samplerResult . setResponseData ( "{\"myval\":<seq2seq4repair_space>{\"key\":<seq2seq4repair_space>\"val\"}}" . getBytes ( ) ) ; JSONPathAssertion instance = new JSONPathAssertion ( ) ; instance . setJsonPath ( "$.myval" ) ; instance . setJsonValidationBool ( true ) ; <START_BUG> instance . setExpectedValue ( "{key=val}" ) ; <END_BUG> AssertionResult expResult = new AssertionResult ( "" ) ; AssertionResult result = instance . getResult ( samplerResult ) ; assertEquals ( expResult . getName ( ) , result . getName ( ) ) ; assertEquals ( false , result . isFailure ( ) ) ; } }

Fix:
instance . setExpectedValue ( "{\"key\":\"val\"}" ) ;
Buggy code:
public class AddAnnotationToMethodTest extends AbstractAnnotationTest { @ Override public String getPackageName ( ) { } @ Override public String getClassName ( ) { } @ Override public String getClassContents ( ) { } @ Override public Annotation getAnnotation ( ) { } public void testAddAnnotationToMethod ( ) { try { assertNotNull ( annotation ) ; assertEquals ( WebMethod . class . getSimpleName ( ) , AnnotationUtils . getAnnotationName ( annotation ) ) ; IMethod method = source . findPrimaryType ( ) . getMethod ( "add" , new String [ ] { "I" , "I" } ) ; assertNotNull ( method ) ; <START_BUG> textFileChange . addEdit ( AnnotationUtils . createAddImportTextEdit ( method , WebMethod . class ) ) ; <END_BUG> textFileChange . addEdit ( AnnotationUtils . createAddAnnotationTextEdit ( method , annotation ) ) ; assertTrue ( executeChange ( new NullProgressMonitor ( ) , textFileChange ) ) ; assertTrue ( AnnotationUtils . isAnnotationPresent ( method , AnnotationUtils . getAnnotationName ( annotation ) ) ) ; assertTrue ( source . getImport ( WebMethod . class . getCanonicalName ( ) ) . exists ( ) ) ; } catch ( CoreException ce ) { fail ( ce . getLocalizedMessage ( ) ) ; } } }

Fix:
textFileChange . addEdit ( AnnotationUtils . createAddImportTextEdit ( method , WebMethod . class . getCanonicalName ( ) ) ) ;
Buggy code:
public class WeightedEuclideanDistance implements DistanceMetric { private static final long serialVersionUID = 2959997330647828673L ; private Vec w ; public WeightedEuclideanDistance ( Vec w ) { } public Vec getWeight ( ) { } public void setWeight ( Vec w ) { } @ Override public double dist ( Vec a , Vec b ) { } @ Override public boolean isSymmetric ( ) { } @ Override public boolean isSubadditive ( ) { } @ Override public boolean isIndiscemible ( ) { } @ Override public double metricBound ( ) { } @ Override <START_BUG> public DistanceMetric clone ( ) { <END_BUG> return new WeightedEuclideanDistance ( w . clone ( ) ) ; } @ Override public boolean supportsAcceleration ( ) { } @ Override public List < Double > getAccelerationCache ( List < ? extends Vec > vecs ) { } @ Override public List < Double > getAccelerationCache ( final List < ? extends Vec > vecs , ExecutorService threadpool ) { } @ Override public double dist ( int a , int b , List < ? extends Vec > vecs , List < Double > cache ) { } @ Override public double dist ( int a , Vec b , List < ? extends Vec > vecs , List < Double > cache ) { } @ Override public List < Double > getQueryInfo ( Vec q ) { } @ Override public double dist ( int a , Vec b , List < Double > qi , List < ? extends Vec > vecs , List < Double > cache ) { } }

Fix:
public WeightedEuclideanDistance clone ( ) {