nus-yam/ex-repair huggingface dataset:
Buggy code:
public class PersistenceExceptions extends Exceptions { public static final RuntimeExceptionTranslator TRANSLATOR = new RuntimeExceptionTranslator ( ) { public RuntimeException translate ( RuntimeException re ) { } } ; public static RuntimeExceptionTranslator getRollbackTranslator ( final OpenJPAEntityManager em ) { return new RuntimeExceptionTranslator ( ) { private boolean throwing = false ; public RuntimeException translate ( RuntimeException re ) { RuntimeException ex = PersistenceExceptions . toPersistenceException ( re ) ; if ( ( ( ! ( ex instanceof NonUniqueResultException ) ) && ( ! ( ex instanceof NoResultException ) ) ) && ( ! ( throwing ) ) ) { try { throwing = true ; if ( ( em . isOpen ( ) ) && ( em . isActive ( ) ) ) <START_BUG> em . setRollbackOnly ( ) ; <END_BUG> } finally { throwing = false ; } } return ex ; } } ; } public static RuntimeException toPersistenceException ( Throwable t ) { } private static Throwable translateException ( Throwable t , boolean checked ) { } private static Throwable translateStoreException ( OpenJPAException ke ) { } private static Exception translateUserException ( OpenJPAException ke ) { } private static Throwable translateGeneralException ( OpenJPAException ke ) { } private static boolean isPersistenceException ( Throwable t ) { } private static Throwable [ ] getNestedThrowables ( OpenJPAException ke ) { } private static Object getFailedObject ( OpenJPAException ke ) { } static Throwable getCause ( Throwable [ ] nested ) { } }

Fix:
em . setRollbackOnly ( re ) ;
Buggy code:
@ SuppressWarnings ( "restriction" ) public class LiferayTomcatRuntime extends TomcatRuntime implements ILiferayTomcatRuntime { public static final String PROP_BUNDLE_SOURCE_LOCATION = "bundle-source-location" ; public static final String PROP_BUNDLE_ZIP_LOCATION = "bundle-zip-location" ; private IStatus runtimeDelegateStatus ; protected HashMap < IPath , ReleaseHelper > releaseHelpers ; public LiferayTomcatRuntime ( ) { } public IVMInstall findPortalBundledJRE ( boolean addVM ) { } public IPath [ ] getAllUserClasspathLibraries ( ) { } public IPath getAppServerDir ( ) { } public String getAppServerType ( ) { } public IPath getBundleZipLocation ( ) { } public Properties getPortletCategories ( ) { } public IPath getDeployDir ( ) { } public IPath getLibGlobalDir ( ) { } public IPath getPortalDir ( ) { } public IPath getPortalSourceLocation ( ) { } public String getPortalVersion ( ) { } public IPath getRuntimeLocation ( ) { } public String getServerInfo ( ) { } public String [ ] getSupportedHookProperties ( ) { } public String [ ] getServletFilterNames ( ) { try { <START_BUG> return LiferayTomcatUtil . getServletFilterNames ( getRuntimeLocation ( ) , getPortalDir ( ) ) ; <END_BUG> } catch ( Exception e ) { return new String [ 0 ] ; } } @ Override public ITomcatVersionHandler getVersionHandler ( ) { } public IVMInstall getVMInstall ( ) { } public void setBundleZipLocation ( IPath path ) { } public void setPortalSourceLocation ( IPath path ) { } @ Override public IStatus validate ( ) { } private IPath findBundledJREPath ( IPath location ) { } protected String getExpectedServerInfo ( ) { } protected Version getLeastSupportedVersion ( ) { } protected ReleaseHelper getReleaseHelper ( IPath serviceJar ) { } protected void loadServerInfoFile ( IPath location , File versionInfoFile , File errorFile ) { } }

Fix:
return LiferayTomcatUtil . getServletFilterNames ( getPortalDir ( ) ) ;
Buggy code:
public abstract class SearchEquivalenceTestBase extends LuceneTestCase { protected static IndexSearcher s1 ; protected static IndexSearcher s2 ; protected static Directory directory ; protected static IndexReader reader ; protected static Analyzer analyzer ; protected static String stopword ; @ BeforeClass public static void beforeClass ( ) throws Exception { Random random = random ( ) ; SearchEquivalenceTestBase . directory = newDirectory ( ) ; SearchEquivalenceTestBase . stopword = "" + ( SearchEquivalenceTestBase . randomChar ( ) ) ; CharacterRunAutomaton stopset = new CharacterRunAutomaton ( BasicAutomata . makeString ( SearchEquivalenceTestBase . stopword ) ) ; SearchEquivalenceTestBase . analyzer = new org . apache . lucene . analysis . MockAnalyzer ( random , MockTokenizer . WHITESPACE , false , stopset ) ; RandomIndexWriter iw = new RandomIndexWriter ( random , SearchEquivalenceTestBase . directory , SearchEquivalenceTestBase . analyzer ) ; Document doc = new Document ( ) ; Field id = new org . apache . lucene . document . StringField ( "id" , "" , Store . NO ) ; Field field = new org . apache . lucene . document . TextField ( "field" , "" , Store . NO ) ; doc . add ( id ) ; doc . add ( field ) ; int numDocs = atLeast ( 1000 ) ; for ( int i = 0 ; i < numDocs ; i ++ ) { id . setStringValue ( Integer . toString ( i ) ) ; field . setStringValue ( SearchEquivalenceTestBase . randomFieldContents ( ) ) ; iw . addDocument ( doc ) ; } int numDeletes = numDocs // 20 ; for ( int i = 0 ; i < numDeletes ; i ++ ) { Term toDelete = new Term ( "id" , Integer . toString ( random . nextInt ( numDocs ) ) ) ; if ( random . nextBoolean ( ) ) { iw . deleteDocuments ( toDelete ) ; } else { iw . deleteDocuments ( new TermQuery ( toDelete ) ) ; } } SearchEquivalenceTestBase . reader = iw . getReader ( ) ; SearchEquivalenceTestBase . s1 = newSearcher ( SearchEquivalenceTestBase . reader ) ; SearchEquivalenceTestBase . s2 = newSearcher ( SearchEquivalenceTestBase . reader ) ; <START_BUG> iw . close ( ) ; <END_BUG> } @ AfterClass public static void afterClass ( ) throws Exception { } static String randomFieldContents ( ) { } static char randomChar ( ) { } protected Term randomTerm ( ) { } protected Filter randomFilter ( ) { } public void assertSameSet ( Query q1 , Query q2 ) throws Exception { } public void assertSubsetOf ( Query q1 , Query q2 ) throws Exception { } protected void assertSubsetOf ( Query q1 , Query q2 , Filter filter ) throws Exception { } }

Fix:
iw . shutdown ( ) ;
Buggy code:
public class TestNativeSeqGenerator extends SQLListenerTestCase { OpenJPAEntityManager em ; JDBCConfiguration conf ; DBDictionary dict ; boolean supportsNativeSequence = false ; EntityE2 entityE2 ; @ Override public void setUp ( ) throws Exception { } public void createEntityE2 ( ) { } public void testGetIdGeneratorSeqGen ( ) { if ( ! ( supportsNativeSequence ) ) { System . out . println ( "Does<seq2seq4repair_space>not<seq2seq4repair_space>support<seq2seq4repair_space>native<seq2seq4repair_space>sequence" ) ; return ; } createEntityE2 ( ) ; em . getTransaction ( ) . begin ( ) ; em . persist ( entityE2 ) ; em . getTransaction ( ) . commit ( ) ; int genId = entityE2 . getId ( ) ; int nextId = ( ( int ) ( ( ( Long ) ( em . getIdGenerator ( EntityE2 . class ) . next ( ) ) ) . longValue ( ) ) ) ; <START_BUG> assertTrue ( "Next<seq2seq4repair_space>value<seq2seq4repair_space>should<seq2seq4repair_space>depend<seq2seq4repair_space>on<seq2seq4repair_space>previous<seq2seq4repair_space>genid" , ( nextId == ( genId + 1 ) ) ) ; <END_BUG> em . close ( ) ; } }

Fix:
assertTrue ( "Next<seq2seq4repair_space>value<seq2seq4repair_space>should<seq2seq4repair_space>depend<seq2seq4repair_space>on<seq2seq4repair_space>previous<seq2seq4repair_space>genid" , ( nextId >= ( genId + 1 ) ) ) ;
Buggy code:
public class PerlInternalParser { private static int sum ; public static void parseAllSources ( Module module ) { } private static void firstPass ( Module module ) { } private static void secondPass ( ) { } private static void parseFiles ( File [ ] files ) { } public static void parse ( String filePath ) { } private static void addPendingPackageParent ( Package packageObj , String packageParent ) { } private static void addImportedPackagesFromContent ( Package packageObj , String content ) { } private static void addSubsFromContent ( Package packageObj , String content ) { } private static ArrayList < Argument > getArgumentsFromContent ( String content ) { } private static String getPackageNameFromContent ( String content ) { } private static String getPackageParentFromContent ( String content ) { <START_BUG> Matcher packageNameRegexNoQW = Utils . applyRegex ( "(\\s*?use\\s+parent\\s+\'((\\w|::)+)\\s*?\';)" , content ) ; <END_BUG> if ( ( packageNameRegexNoQW . find ( ) ) && ( ! ( packageNameRegexNoQW . group ( 2 ) . isEmpty ( ) ) ) ) { return packageNameRegexNoQW . group ( 2 ) ; } Matcher packageNameRegexWithQW = Utils . applyRegex ( "(\\s*?use\\s+parent\\s+qw\\s*?\\(\\s*?((\\w|::)+)\\s*?\\)\\s*?;)" , content ) ; if ( ( packageNameRegexWithQW . find ( ) ) && ( ! ( packageNameRegexWithQW . group ( 2 ) . isEmpty ( ) ) ) ) { return packageNameRegexWithQW . group ( 2 ) ; } return null ; } }

Fix:
Matcher packageNameRegexNoQW = Utils . applyRegex ( "(\\s*?use\\s*?parent\\s*?((\\w+\\:\\:)*\\w+))" , content ) ;
Buggy code:
public class JGroupsSubsystemAdd extends AbstractAddStepHandler implements DescriptionProvider { static ModelNode createOperation ( ModelNode address , ModelNode existing ) { } private static void populate ( ModelNode source , ModelNode target ) { } @ Override public ModelNode getModelDescription ( final Locale locale ) { <START_BUG> return LocalDescriptions . getSubsystemAddDescription ( locale ) ; <END_BUG> } protected void populateModel ( ModelNode operation , ModelNode model ) { } protected void performRuntime ( OperationContext context , ModelNode operation , ModelNode model , ServiceVerificationHandler verificationHandler , List < ServiceController < ? > > newControllers ) { } protected boolean requiresRuntimeVerification ( ) { } }

Fix:
return JGroupsDescriptions . getSubsystemAddDescription ( locale ) ;
Buggy code:
public class OtherServicesSubsystemExtension implements Extension { public static final String NAMESPACE = "urn:mycompany:mysubsystem:1.0" ; public static final String SUBSYSTEM_NAME = "mysubsystem" ; private final OtherServicesSubsystemExtension . SubsystemParser parser = new OtherServicesSubsystemExtension . SubsystemParser ( ) ; private volatile OperationStepHandler addHandler ; public OtherServicesSubsystemExtension ( ) { } public void setAddHandler ( OperationStepHandler addHandler ) { } @ Override public void initializeParsers ( ExtensionParsingContext context ) { } @ Override public void initialize ( ExtensionContext context ) { } private static ModelNode createAddSubsystemOperation ( ) { } private static class SubsystemParser implements XMLStreamConstants , XMLElementReader < List < ModelNode > > , XMLElementWriter < SubsystemMarshallingContext > { @ Override public void writeContent ( XMLExtendedStreamWriter writer , SubsystemMarshallingContext context ) throws XMLStreamException { } @ Override public void readElement ( XMLExtendedStreamReader reader , List < ModelNode > list ) throws XMLStreamException { } } private static class SubsystemDescribeHandler implements OperationStepHandler , DescriptionProvider { static final OtherServicesSubsystemExtension . SubsystemDescribeHandler INSTANCE = new OtherServicesSubsystemExtension . SubsystemDescribeHandler ( ) ; public void execute ( OperationContext context , ModelNode operation ) throws OperationFailedException { context . getResult ( ) . add ( OtherServicesSubsystemExtension . createAddSubsystemOperation ( ) ) ; <START_BUG> context . completeStep ( ) ; <END_BUG> } @ Override public ModelNode getModelDescription ( Locale locale ) { } } }

Fix:
context . stepCompleted ( ) ;
Buggy code:
public class JavaBeansStrategyTest extends TestCase { private ExecutionContextImpl ec ; private JavaBeansStrategy strategy ; @ Override protected void setUp ( ) throws Exception { } @ Override protected void tearDown ( ) throws Exception { } public final void testLowerCase ( ) { } public final void testFinalStaticField ( ) { } public final void testFinalStaticField2 ( ) { } public void testGetterAndSetterForProperty ( ) { Type javaBeansMetaType = ec . getTypeForName ( JavaBeansMetaType . class . getName ( ) . replaceAll ( "\\." , "::" ) ) ; Type string = ec . getTypeForName ( String . class . getName ( ) . replaceAll ( "\\." , "::" ) ) ; assertNotNull ( string ) ; <START_BUG> assertNotNull ( javaBeansMetaType . getOperation ( "getMyProp" , null ) ) ; <END_BUG> assertNotNull ( javaBeansMetaType . getOperation ( "setMyProp" , new Type [ ] { string } ) ) ; } }

Fix:
assertNull ( javaBeansMetaType . getOperation ( "getMyProp" , null ) ) ;
Buggy code:
public class WebServiceDefaultPublicConstructorRule extends AbstractAnnotationProcessor { @ Override public void process ( ) { AnnotationTypeDeclaration annotationDeclaration = ( ( AnnotationTypeDeclaration ) ( environment . getTypeDeclaration ( WebService . class . getName ( ) ) ) ) ; Collection < Declaration > annotatedTypes = environment . getDeclarationsAnnotatedWith ( annotationDeclaration ) ; for ( Declaration declaration : annotatedTypes ) { if ( declaration instanceof ClassDeclaration ) { boolean hasDefaultConstructor = false ; ClassDeclaration classDeclaration = ( ( ClassDeclaration ) ( declaration ) ) ; Collection < ConstructorDeclaration > constructors = classDeclaration . getConstructors ( ) ; if ( ( constructors . size ( ) ) == 0 ) { hasDefaultConstructor = true ; } else { for ( ConstructorDeclaration constructorDeclaration : constructors ) { if ( ( constructorDeclaration . getModifiers ( ) . contains ( PUBLIC ) ) && ( ( constructorDeclaration . getParameters ( ) . size ( ) ) == 0 ) ) { hasDefaultConstructor = true ; break ; } } } if ( ! hasDefaultConstructor ) { Collection < AnnotationMirror > annotationMirrors = declaration . getAnnotationMirrors ( ) ; for ( AnnotationMirror mirror : annotationMirrors ) { if ( mirror . getAnnotationType ( ) . toString ( ) . equals ( annotationDeclaration . getQualifiedName ( ) ) ) { <START_BUG> printError ( mirror . getPosition ( ) , WEBSERVICE_DEFAULT_PUBLIC_CONSTRUCTOR ) ; <END_BUG> } } } } } } }

Fix:
printFixableError ( declaration . getPosition ( ) , WEBSERVICE_DEFAULT_PUBLIC_CONSTRUCTOR ) ;
Buggy code:
public class AlarmReceiver extends BroadcastReceiver { @ Override public void onReceive ( Context context , Intent intent ) { long id = intent . getExtras ( ) . getLong ( "requestCode" ) ; System . out . println ( id ) ; AlarmsDataSource dataSource = new AlarmsDataSource ( context ) ; dataSource . open ( ) ; dataSource . updateActive ( id , "<seq2seq4repair_space>" ) ; AlarmListAdapter adapter = new AlarmListAdapter ( context , dataSource . getAllAlarms ( ) ) ; adapter . refreshList ( dataSource . getAllAlarms ( ) ) ; dataSource . close ( ) ; Intent isnt = new Intent ( context , EnterText . class ) ; <START_BUG> isnt . addFlags ( ( ( Intent . FLAG_ACTIVITY_NEW_TASK ) | ( Intent . FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS ) ) ) ; <END_BUG> context . startActivity ( isnt ) ; } No newline ; at end ; of file ; }

Fix:
isnt . addFlags ( FLAG_ACTIVITY_NEW_TASK ) ;
Buggy code:
public class Car { private String color ; private int speed ; private int maxSpeed ; public Car ( String color , int maxSpeed ) { } public int getSpeed ( ) { } public void accelerate ( int amount ) { } public void decelerate ( int amount ) { <START_BUG> int speed = ( this . maxSpeed ) - amount ; <END_BUG> if ( speed <= 0 ) { this . speed = 0 ; } else { this . speed = speed ; } } public String toString ( ) { } }

Fix:
int speed = ( this . speed ) - amount ;
Buggy code:
public class WasherService { private static boolean initialized = false ; private static String baseUrl ; public static void init ( String baseUrl , int port ) { } public static boolean isInitialized ( ) { } public static void getLiveRecord ( CallBack < LiveRecord > callBack ) { } public static void getHistoryByAmount ( int amount , CallBack < WashRecords > callBack ) { } public static void getHistoryByTime ( long time , CallBack < WashRecords > callBack ) { } public static void stop ( CallBack < Status > callBack ) { } public static void startAt ( long time , int washTime , String name , String degree , CallBack < StartStatus > callBack ) { } public static void startReadyAt ( long time , int washTime , String name , String degree , boolean lowPrice , boolean useWind , CallBack < StartStatus > callBack ) { } public static void setSettings ( boolean push , int reminderTime , boolean staticPrice , float price , CallBack < Status > callBack ) { <START_BUG> GetExecutor executor = new GetExecutor ( ( ( ( ( ( ( ( ( ( WasherService . baseUrl ) + "set//settings?push=" ) + push ) + "&reminderTime=" ) + reminderTime ) + "&static=" ) + staticPrice ) + "&price=" ) + price ) , callBack ) { <END_BUG> @ Override public Object parse ( String json ) throws Exception { Status status = GetExecutor . getMapper ( ) . readValue ( json , Status . class ) ; return status ; } } ; } public static void getSettings ( CallBack < Settings > callBack ) { } public static void setDone ( CallBack < Status > callBack ) { } public static void register ( String id , CallBack < Status > callBack ) { } }

Fix:
GetExecutor executor = new GetExecutor ( ( ( ( ( ( ( ( ( ( WasherService . baseUrl ) + "set//settings?push=" ) + ( push ? 1 : 0 ) ) + "&reminderTime=" ) + reminderTime ) + "&static=" ) + ( staticPrice ? 1 : 0 ) ) + "&price=" ) + price ) , callBack ) {
Buggy code:
@ RunWith ( MongoDBTestCaseRunner . class ) public abstract class MongoDBTestBase { private static final Random rand = new Random ( ) ; private boolean useStreamParser = true ; protected Mongo mongo ; protected DB db ; private Set < String > collections ; @ Before public void connectToDb ( ) throws Exception { } @ After public void disconnectFromDb ( ) throws Exception { } protected DBCollection getCollection ( String name ) { } protected DBCollection getCollection ( ) { } protected < T , K > JacksonDBCollection < T , K > getCollection ( Class < T > type , Class < K > keyType ) { JacksonDBCollection < T , K > collection = JacksonDBCollection . wrap ( getCollection ( ) , type , keyType ) ; if ( useStreamParser ) { collection . enable ( USE_STREAM_DESERIALIZATION ) ; } else { <START_BUG> collection . enable ( USE_STREAM_DESERIALIZATION ) ; <END_BUG> } return collection ; } protected < T , K > JacksonDBCollection < T , K > getCollection ( Class < T > type , Class < K > keyType , String collectionName ) { } public void setUseStreamParser ( boolean useStreamParser ) { } }

Fix:
collection . disable ( USE_STREAM_DESERIALIZATION ) ;
Buggy code:
public class StandardDirectoryFactory extends CachingDirectoryFactory { @ Override protected Directory create ( String path , DirContext dirContext ) throws IOException { } @ Override public String normalize ( String path ) throws IOException { } public boolean isPersistent ( ) { } @ Override public void remove ( Directory dir ) throws IOException { } @ Override public void remove ( String path ) throws IOException { } @ Override public void move ( Directory fromDir , Directory toDir , String fileName , IOContext ioContext ) throws IOException { Directory baseFromDir = getBaseDir ( fromDir ) ; <START_BUG> Directory baseToDir = getBaseDir ( fromDir ) ; <END_BUG> if ( ( baseFromDir instanceof FSDirectory ) && ( baseToDir instanceof FSDirectory ) ) { File dir1 = ( ( FSDirectory ) ( baseFromDir ) ) . getDirectory ( ) ; File dir2 = ( ( FSDirectory ) ( baseToDir ) ) . getDirectory ( ) ; File indexFileInTmpDir = new File ( dir1 , fileName ) ; File indexFileInIndex = new File ( dir2 , fileName ) ; boolean success = indexFileInTmpDir . renameTo ( indexFileInIndex ) ; if ( success ) { return ; } } super . move ( fromDir , toDir , fileName , ioContext ) ; } private Directory getBaseDir ( Directory dir ) { } }

Fix:
Directory baseToDir = getBaseDir ( toDir ) ;
Buggy code:
public class ObjectProperty extends AbstractProperty { private static final long serialVersionUID = 1 ; private Object value ; private Object savedValue ; public void recoverRunningVersion ( TestElement owner ) { } @ Override public void setRunningVersion ( boolean runningVersion ) { } @ Override <START_BUG> public Object clone ( ) { <END_BUG> ObjectProperty p = ( ( ObjectProperty ) ( super . clone ( ) ) ) ; p . value = value ; return p ; } public ObjectProperty ( ) { } public ObjectProperty ( String name ) { } public ObjectProperty ( String name , Object p ) { } public String getStringValue ( ) { } public Object getObjectValue ( ) { } public void setObjectValue ( Object value ) { } }

Fix:
public ObjectProperty clone ( ) {
Buggy code:
public class UnicodeUnescaperTest extends TestCase { public void testUPlus ( ) { UnicodeUnescaper uu = new UnicodeUnescaper ( ) ; String input = "\\u+0047" ; try { uu . translate ( input ) ; fail ( "Default<seq2seq4repair_space>behaviour<seq2seq4repair_space>should<seq2seq4repair_space>not<seq2seq4repair_space>parse<seq2seq4repair_space>u+" ) ; } catch ( IllegalArgumentException iae ) { } <START_BUG> uu = new UnicodeUnescaper ( PARAM . escapePlus ) ; <END_BUG> assertEquals ( "Failed<seq2seq4repair_space>to<seq2seq4repair_space>unescape<seq2seq4repair_space>unicode<seq2seq4repair_space>characters<seq2seq4repair_space>with<seq2seq4repair_space>'u+'<seq2seq4repair_space>notation" , "G" , uu . translate ( input ) ) ; } public void testUuuuu ( ) { } public void testLessThanFour ( ) { } }

Fix:
uu = new UnicodeUnescaper ( OPTION . escapePlus ) ;
Buggy code:
public abstract class CommandTestCase extends TestCase { public CommandTestCase ( String name ) { } public static final int [ ] NO_ERRORS = new int [ 0 ] ; public static final int [ ] TOP_ERROR = new int [ 0 ] ; public static void checkCompile ( String source , int [ ] expectedErrors ) { } public void checkMultipleCompile ( String source ) throws InterruptedException { } public void rerunCompiler ( ICommand command ) { } public static ICommand runCompiler ( List args , int [ ] expectedErrors ) { ICommand command = new AjdtCommand ( ) ; MessageHandler myHandler = new MessageHandler ( ) ; myHandler . setInterceptor ( TERSE ) ; boolean result = command . runCommand ( ( ( String [ ] ) ( args . toArray ( new String [ args . size ( ) ] ) ) ) , myHandler ) ; System . out . println ( ( "result:<seq2seq4repair_space>" + result ) ) ; int nErrors = myHandler . numMessages ( ERROR , EQUAL ) ; if ( expectedErrors == ( CommandTestCase . NO_ERRORS ) ) { if ( 0 != nErrors ) { String s = "" + ( Arrays . asList ( myHandler . getErrors ( ) ) ) ; assertTrue ( ( "unexpected<seq2seq4repair_space>errors:<seq2seq4repair_space>" + s ) , false ) ; } } else if ( expectedErrors == ( CommandTestCase . TOP_ERROR ) ) { assertTrue ( "expected<seq2seq4repair_space>error" , ( nErrors > 0 ) ) ; } else { List errors = new ArrayList ( Arrays . asList ( myHandler . getErrors ( ) ) ) ; for ( int i = 0 , len = expectedErrors . length ; i < len ; i ++ ) { int line = expectedErrors [ i ] ; boolean found = false ; for ( Iterator iter = errors . iterator ( ) ; iter . hasNext ( ) ; ) { IMessage m = ( ( IMessage ) ( iter . next ( ) ) ) ; <START_BUG> if ( ( ( m . getISourceLocation ( ) ) != null ) && ( ( m . getISourceLocation ( ) . getLine ( ) ) == line ) ) { <END_BUG> found = true ; iter . remove ( ) ; } } assertTrue ( ( "didn't<seq2seq4repair_space>find<seq2seq4repair_space>error<seq2seq4repair_space>on<seq2seq4repair_space>line<seq2seq4repair_space>" + line ) , found ) ; } if ( ( errors . size ( ) ) > 0 ) { assertTrue ( ( "didn't<seq2seq4repair_space>expect<seq2seq4repair_space>errors:<seq2seq4repair_space>" + errors ) , false ) ; } } return command ; } public static void printGenerated ( String path , String name ) throws IOException { } public class IncCase extends IncrementalCase { protected void fail ( IMessageHandler handler , String mssg ) { } protected void message ( IMessage . Kind kind , String mssg , IMessageHandler handler ) { } } }

Fix:
if ( ( ( m . getSourceLocation ( ) ) != null ) && ( ( m . getSourceLocation ( ) . getLine ( ) ) == line ) ) {
Buggy code:
public class WorkbenchEditorsDialog extends SelectionDialog { private IWorkbenchWindow window ; private Table editorsTable ; private Button saveSelected ; private Button closeSelected ; private Button selectClean ; private Button invertSelection ; private Button allSelection ; private boolean showAllPersp = false ; private int sortColumn ; private List elements = new ArrayList ( ) ; private HashMap imageCache = new HashMap ( 11 ) ; private HashMap disabledImageCache = new HashMap ( 11 ) ; private boolean reverse = false ; private Collator collator = Collator . getInstance ( ) ; private Rectangle bounds ; private int [ ] columnsWidth ; private static final String SORT = "sort" ; private static final String ALLPERSP = "allPersp" ; private static final String BOUNDS = "bounds" ; private static final String COLUMNS = "columns" ; private SelectionListener headerListener = new SelectionAdapter ( ) { public void widgetSelected ( SelectionEvent e ) { } } ; public WorkbenchEditorsDialog ( IWorkbenchWindow window ) { } protected void configureShell ( Shell newShell ) { } protected void createButtonsForButtonBar ( Composite parent ) { } protected void initializeBounds ( ) { } protected Control createDialogArea ( Composite parent ) { } private void updateButtons ( ) { } private void closeItems ( TableItem [ ] items ) { if ( ( items . length ) == 0 ) { return ; } List selectedEditors = new ArrayList ( ) ; for ( int i = 0 ; i < ( items . length ) ; i ++ ) { WorkbenchEditorsDialog . Adapter e = ( ( WorkbenchEditorsDialog . Adapter ) ( items [ i ] . getData ( ) ) ) ; if ( ( e . editorRef ) != null ) { IWorkbenchPart part = e . editorRef . getPart ( false ) ; if ( part != null ) { selectedEditors . add ( part ) ; } } } SaveablesList saveablesList = ( ( SaveablesList ) ( window . getService ( ISaveablesLifecycleListener . class ) ) ) ; <START_BUG> if ( ( saveablesList . preCloseParts ( selectedEditors , true , window ) ) != null ) { <END_BUG> for ( int i = 0 ; i < ( items . length ) ; i ++ ) { WorkbenchEditorsDialog . Adapter e = ( ( WorkbenchEditorsDialog . Adapter ) ( items [ i ] . getData ( ) ) ) ; e . close ( ) ; } updateItems ( ) ; } } private void saveItems ( TableItem [ ] items ) { } private TableItem [ ] selectClean ( TableItem [ ] items ) { } private TableItem [ ] invertedSelection ( TableItem [ ] allItems , TableItem [ ] selectedItems ) { } private void updateItem ( TableItem item , WorkbenchEditorsDialog . Adapter editor ) { } private void updateEditors ( IWorkbenchPage [ ] pages ) { } private void updateItems ( ) { } private void sort ( ) { } protected void okPressed ( ) { } private void saveDialogSettings ( ) { } private IDialogSettings getDialogSettings ( ) { } private class Adapter implements Comparable { IEditorReference editorRef ; IEditorInput input ; IEditorDescriptor desc ; String [ ] text ; Image image ; Adapter ( IEditorReference ref ) { } boolean isDirty ( ) { } void close ( ) { } String [ ] getText ( ) { } Image getImage ( ) { } private void activate ( ) { } public int compareTo ( Object another ) { } } }

Fix:
if ( ( saveablesList . preCloseParts ( selectedEditors , true , this , window ) ) != null ) {
Buggy code:
public class Embedded extends AbstractBackend { private String srcPath ; @ Override protected void doInitializeOptions ( ) { } @ Override protected Result doGenerateNetwork ( Network network ) { } @ Override protected Result doGenerateInstance ( Instance instance ) { } protected Result doGenerateActor ( Actor actor ) { } @ Override protected Result doLibrariesExtraction ( ) { String target = ( ( outputPath ) + ( File . separator ) ) + "lib" ; OrccLogger . trace ( ( ( "Export<seq2seq4repair_space>libraries<seq2seq4repair_space>sources<seq2seq4repair_space>into<seq2seq4repair_space>" + target ) + "...<seq2seq4repair_space>" ) ) ; <START_BUG> Result result = FilesManager . extract ( "//bundle//embedded" , target ) ; <END_BUG> return result ; } }

Fix:
Result result = FilesManager . extract ( "//bundle//embedded//lib" , outputPath ) ;
Buggy code:
public class SpelUtilities { public static void printAbstractSyntaxTree ( PrintStream printStream , SpelExpression expression ) { } private static void printAST ( PrintStream out , SpelNode t , String indent ) { if ( t != null ) { <START_BUG> StringBuffer sb = new StringBuffer ( ) ; <END_BUG> String s = ( ( t . getType ( ) ) == ( - 1 ) ) ? "EOF" : t . getClass ( ) . getSimpleName ( ) ; sb . append ( indent ) . append ( s ) ; sb . append ( "<seq2seq4repair_space>value=" ) . append ( t . getText ( ) ) ; sb . append ( ( ( t . getChildCount ( ) ) < 2 ? "" : "<seq2seq4repair_space>children=#" + ( t . getChildCount ( ) ) ) ) ; out . println ( sb . toString ( ) ) ; for ( int i = 0 ; i < ( t . getChildCount ( ) ) ; i ++ ) { SpelUtilities . printAST ( out , t . getChild ( i ) , ( indent + "<seq2seq4repair_space>" ) ) ; } } } }

Fix:
StringBuilder sb = new StringBuilder ( ) ;
Buggy code:
public class StreamWriterActionTest extends TestSupport { private final XMLInputFactory xmlInputFactory = XMLInputFactory . newFactory ( ) ; private final XMLOutputFactory xmlOutputFactory = XMLOutputFactory . newFactory ( ) ; @ Test ( dataProvider = "files" ) public void testCopy ( String inputResource ) throws Exception { final File actualFile = File . createTempFile ( "test1." , "xml" ) ; final String input = this . readResource ( inputResource ) ; this . copy ( input , actualFile ) ; final String actual = this . readResource ( actualFile ) ; final String expected = this . readResource ( inputResource ) ; <START_BUG> Assert . assertEquals ( actual . trim ( ) . replaceAll ( "(?s)\\r\\n?" , "\\n" ) , expected . trim ( ) ) ; <END_BUG> actualFile . delete ( ) ; } private void copy ( String input , File outputFile ) throws Exception { } @ DataProvider ( name = "files" ) public Object [ ] [ ] generateFiles ( ) { } }

Fix:
Assert . assertEquals ( actual . trim ( ) . replaceAll ( "(?s)\\r\\n?" , "\n" ) , expected . trim ( ) ) ;
Buggy code:
public class DomainServerCommunicationServices implements Serializable , ServiceActivator { private static final OptionMap DEFAULTS = OptionMap . create ( RECEIVE_WINDOW_SIZE , WINDOW_SIZE ) ; private static final long serialVersionUID = 1593964083902839384L ; private static volatile int initialOperationID ; private final ModelNode endpointConfig ; private final InetSocketAddress managementSocket ; private final String serverName ; private final String serverProcessName ; private final byte [ ] authKey ; private final boolean managementSubsystemEndpoint ; DomainServerCommunicationServices ( ModelNode endpointConfig , InetSocketAddress managementSocket , String serverName , String serverProcessName , byte [ ] authKey , boolean managementSubsystemEndpoint ) { } static void updateOperationID ( final int operationID ) { } @ Override public void activate ( final ServiceActivatorContext serviceActivatorContext ) throws ServiceRegistryException { final ServiceTarget serviceTarget = serviceActivatorContext . getServiceTarget ( ) ; final ServiceName endpointName = ( managementSubsystemEndpoint ) ? RemotingServices . SUBSYSTEM_ENDPOINT : ManagementRemotingServices . MANAGEMENT_ENDPOINT ; final EndpointService . EndpointType endpointType = ( managementSubsystemEndpoint ) ? EndpointType . SUBSYSTEM : EndpointType . MANAGEMENT ; try { @ SuppressWarnings ( "deprecation" ) final OptionMap options = EndpointConfigFactory . create ( DEFAULT , endpointConfig , DomainServerCommunicationServices . DEFAULTS ) ; <START_BUG> ManagementRemotingServices . installRemotingEndpoint ( serviceTarget , endpointName , WildFlySecurityManager . getPropertyPrivileged ( NODE_NAME , null ) , endpointType , options , null , null ) ; <END_BUG> final int port = managementSocket . getPort ( ) ; final String host = managementSocket . getAddress ( ) . getHostAddress ( ) ; HostControllerConnectionService service = new HostControllerConnectionService ( host , port , serverName , serverProcessName , authKey , DomainServerCommunicationServices . initialOperationID , managementSubsystemEndpoint ) ; serviceTarget . addService ( SERVICE_NAME , service ) . addDependency ( endpointName , Endpoint . class , service . getEndpointInjector ( ) ) . addDependency ( ControlledProcessStateService . SERVICE_NAME , ControlledProcessStateService . class , service . getProcessStateServiceInjectedValue ( ) ) . setInitialMode ( ACTIVE ) . install ( ) ; } catch ( OperationFailedException e ) { throw new ServiceRegistryException ( e ) ; } } public static ServiceActivator create ( final ModelNode endpointConfig , final InetSocketAddress managementSocket , final String serverName , final String serverProcessName , final byte [ ] authKey , final boolean managementSubsystemEndpoint ) { } public interface OperationIDUpdater { void updateOperationID ( int operationID ) { } } }

Fix:
ManagementRemotingServices . installRemotingManagementEndpoint ( serviceTarget , endpointName , WildFlySecurityManager . getPropertyPrivileged ( NODE_NAME , null ) , endpointType , options , null , null ) ;
Buggy code:
public class MainApp extends Application { private Stage primaryStage ; private BorderPane rootLayout ; private ObservableList < Movie > movies = FXCollections . observableArrayList ( ) ; private ObservableList < Channel > channels = FXCollections . observableArrayList ( ) ; private Set < Path > moviePaths = new HashSet < > ( ) ; public MainApp ( ) { } @ Override public void start ( Stage primaryStage ) { } public void initRoot ( ) { try { FXMLLoader loader = new FXMLLoader ( ) ; loader . setLocation ( MainApp . class . getResource ( "view//RootLayout.fxml" ) ) ; rootLayout = ( ( BorderPane ) ( loader . load ( ) ) ) ; Scene scene = new Scene ( rootLayout ) ; primaryStage . setScene ( scene ) ; <START_BUG> RootLayoutController controller = new RootLayoutController ( ) ; <END_BUG> controller . setMainApp ( this ) ; primaryStage . show ( ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } } public void displayChannels ( ) { } public void displayLibrary ( ) { } public void setLibrary ( LibraryWrapper wrapper ) { } public Stage getPrimaryStage ( ) { } public ObservableList < Movie > getMovies ( ) { } public ObservableList < Channel > getChannels ( ) { } public Set < Path > getMoviePaths ( ) { } public static void main ( String [ ] args ) { } }

Fix:
RootLayoutController controller = loader . getController ( ) ;
Buggy code:
public class Debug { public static HT_ItemDurable itemDurable ; public static HT_Item itemMulti ; public static HT_MultiBlock blockMulti ; public static HT_Block blockTE ; public static CreativeTabs tabHTLib = HT_CreativeTabsUtil . create ( "hokutoLib" , "test" , iron_sword ) ; public static HT_ItemDurable itemArmor ; private static HT_BlockFalling blockFall ; private static HT_ModEntityList entityList ; public static void preinit ( ) { } public static void init ( ) { HT_Registries . registerCommonTileEntity ( TestTE . class , "htTest" ) ; HT_Registries . registerCommonTileEntity ( DummyTE . class , "ht_dummy" ) ; new HT_GuiHandler ( ) . register ( INSTANCE ) . addGui ( 0 , new com . github . hokutomc . lib . client . gui . HT_GuiAction < ContainerSampleTE > ( ) { @ Override public ContainerSampleTE get ( EntityPlayer player , World world , int x , int y , int z ) { return new ContainerSampleTE ( player , ( ( TestTE ) ( world . getTileEntity ( x , y , z ) ) ) ) ; } } , new com . github . hokutomc . lib . client . gui . HT_GuiAction < ContainerSampleTE . GuiSampleTE > ( ) { @ Override public GuiSampleTE get ( EntityPlayer player , World world , int x , int y , int z ) { return new ContainerSampleTE . GuiSampleTE ( player , ( ( TestTE ) ( world . getTileEntity ( x , y , z ) ) ) ) ; } } ) ; <START_BUG> Debug . entityList . register ( TestMob . class , "httestentity" ) ; <END_BUG> HT_Registries . registerEntityRenderer ( TestMob . class , new RenderTestEntity ( new ModelTestEntity ( ) , 0.5F ) ) ; } }

Fix:
Debug . entityList . register ( TestMob . class , "httestentity" , 8421440 , 15790288 ) ;
Buggy code:
public class Client implements Serializable , Comparable < Client > { private static final long serialVersionUID = 1L ; private String name ; private int clientID ; private String address ; private String phone ; private double balance ; private static int nextClientId = 2000 ; public Client ( int clientID , String name , String address , String phone ) { } public void setClientID ( int clientID ) { } public void setName ( String name ) { } public void setAddress ( String address ) { } public void setPhone ( String phone ) { } public void setBalance ( Double balance ) { } public static int createClientID ( ) { } public static int getClientId ( ) { } public static void setClientId ( int nextClientId ) { } public String getName ( ) { } public int getClientID ( ) { } public String getAddress ( ) { } public String getPhone ( ) { } <START_BUG> public Double getBalance ( ) { <END_BUG> return balance ; } public int compareTo ( Client client ) { } @ Override public boolean equals ( Object object ) { } @ Override public String toString ( ) { } }

Fix:
public double getBalance ( ) {
Buggy code:
class Sum extends AggregateVal { public Sum ( Val val ) { } protected Class getType ( Class c ) { } protected Object operate ( Collection os , Class c ) { if ( os . isEmpty ( ) ) return null ; Class type = getType ( c ) ; <START_BUG> Object sum = Filters . convert ( Numbers . valueOf ( 0 ) , type ) ; <END_BUG> Object cur ; for ( Iterator itr = os . iterator ( ) ; itr . hasNext ( ) ; ) { cur = itr . next ( ) ; if ( cur != null ) sum = Filters . add ( sum , type , cur , c ) ; } return sum ; } }

Fix:
Object sum = Filters . convert ( 0 , type ) ;
Buggy code:
public class HomeActivity extends Activity { @ Override protected void onCreate ( Bundle savedInstanceState ) { } public void logOUT ( ) { Session session = Session . getActiveSession ( ) ; if ( session != null ) { session . close ( ) ; session . closeAndClearTokenInformation ( ) ; } else { <START_BUG> Session session2 = Session . openActiveSession ( ( ( Activity ) ( this ) ) , false , null ) ; <END_BUG> if ( session2 != null ) session2 . close ( ) ; session2 . closeAndClearTokenInformation ( ) ; } Session . setActiveSession ( null ) ; } @ Override public boolean onCreateOptionsMenu ( Menu menu ) { } @ Override public boolean onOptionsItemSelected ( MenuItem item ) { } }

Fix:
Session session2 = Session . openActiveSession ( this , false , null ) ;
Buggy code:
public class NonCachingImage extends Image { private static final long serialVersionUID = 1L ; public NonCachingImage ( String id , IModel < ? > model ) { } public NonCachingImage ( String id , Resource imageResource ) { } public NonCachingImage ( String id , ResourceReference resourceReference , ValueMap resourceParameters ) { } public NonCachingImage ( String id , ResourceReference resourceReference ) { } public NonCachingImage ( String id , String string ) { } public NonCachingImage ( String id ) { } @ Override protected void onComponentTag ( ComponentTag tag ) { super . onComponentTag ( tag ) ; String url = tag . getAttributes ( ) . getString ( "src" ) ; <START_BUG> url = url + ( ( url . indexOf ( "?" ) ) >= 0 ? "&" : "?" ) ; <END_BUG> url = ( url + "wicket:antiCache=" ) + ( System . currentTimeMillis ( ) ) ; tag . put ( "src" , url ) ; } }

Fix:
url = url + ( ( url . indexOf ( "?" ) ) >= 0 ? "&amp;" : "?" ) ;
Buggy code:
class TextTab extends ScrollableTab { Text text ; Group textGroup ; Button wrapButton ; Button readOnlyButton ; Button passwordButton ; Button searchButton ; Button cancelButton ; Button leftButton ; Button centerButton ; Button rightButton ; TextTab ( ControlExample instance ) { } void createExampleGroup ( ) { } void createExampleWidgets ( ) { } void createStyleGroup ( ) { } Composite createTabFolderPage ( TabFolder tabFolder ) { } Widget [ ] getExampleWidgets ( ) { } String [ ] getMethodNames ( ) { <START_BUG> return new String [ ] { "DoubleClickEnabled" , "EchoChar" , "Editable" , "Orientation" , "Selection" , "Tabs" , "Text" , "TextLimit" , "ToolTipText" , "TopIndex" } ; <END_BUG> } String getTabText ( ) { } void setExampleWidgetState ( ) { } }

Fix:
return new String [ ] { "DoubleClickEnabled" , "EchoChar" , "Editable" , "Message" , "Orientation" , "Selection" , "Tabs" , "Text" , "TextLimit" , "ToolTipText" , "TopIndex" } ;
Buggy code:
public interface ConfigurationFile { <START_BUG> public void saveConfiguration ( String hostIP , List < String [ ] > antennaList , List < String > serverInfo ) ; <END_BUG> public boolean loadConfiguration ( ) throws LoadCancelledException { } public String getConfigFilePath ( ) { } }

Fix:
public void saveConfiguration ( String hostIP , List < Antenna > antennaList , ServerInfo serverInfo ) ;
Buggy code:
@ SuppressWarnings ( "unused" ) class AlertTimer extends TimerTask { private Calendar next ; private String message ; private AlertTimer ( Calendar n , String m ) { } public AlertTimer ( Alerts al ) { } private Calendar setAlertDate ( int day , int time ) { } private Calendar setTime ( Calendar c , int t ) { c . set ( Calendar . HOUR_OF_DAY , ( t // 100 ) ) ; <START_BUG> c . set ( Calendar . MINUTE , ( t - ( ( ( int ) ( t // 100 ) ) * 100 ) ) ) ; <END_BUG> return c ; } @ Override public void run ( ) { } No newline ; at end ; of file ; }

Fix:
c . set ( Calendar . MINUTE , ( t % 100 ) ) ;
Buggy code:
@ SuppressWarnings ( "serial" ) public class UrlTag extends HtmlEscapingAwareTag implements ParamAware { private static final String URL_TEMPLATE_DELIMITER_PREFIX = "{" ; private static final String URL_TEMPLATE_DELIMITER_SUFFIX = "}" ; private static final String URL_TYPE_ABSOLUTE = ":////" ; private List < Param > params ; private Set < String > templateParams ; private UrlTag . UrlType type ; private String value ; private String context ; private String var ; private int scope = PageContext . PAGE_SCOPE ; private boolean javaScriptEscape = false ; public void setValue ( String value ) { } public void setContext ( String context ) { } public void setVar ( String var ) { } public void setScope ( String scope ) { } public void setJavaScriptEscape ( boolean javaScriptEscape ) throws JspException { } @ Override public void addParam ( Param param ) { } @ Override public int doStartTagInternal ( ) throws JspException { } @ Override public int doEndTag ( ) throws JspException { } private String createUrl ( ) throws JspException { HttpServletRequest request = ( ( HttpServletRequest ) ( pageContext . getRequest ( ) ) ) ; HttpServletResponse response = ( ( HttpServletResponse ) ( pageContext . getResponse ( ) ) ) ; StringBuilder url = new StringBuilder ( ) ; if ( ( this . type ) == ( UrlTag . UrlType . CONTEXT_RELATIVE ) ) { if ( ( this . context ) == null ) { url . append ( request . getContextPath ( ) ) ; } else { url . append ( this . context ) ; } } if ( ( ( ( this . type ) != ( UrlTag . UrlType . RELATIVE ) ) && ( ( this . type ) != ( UrlTag . UrlType . ABSOLUTE ) ) ) && ( ! ( this . value . startsWith ( "//" ) ) ) ) { url . append ( "//" ) ; } url . append ( replaceUriTemplateParams ( this . value , this . params , this . templateParams ) ) ; url . append ( createQueryString ( this . params , this . templateParams , ( ( url . indexOf ( "?" ) ) == ( - 1 ) ) ) ) ; String urlStr = url . toString ( ) ; if ( ( this . type ) != ( UrlTag . UrlType . ABSOLUTE ) ) { urlStr = response . encodeURL ( urlStr ) ; } <START_BUG> urlStr = ( isHtmlEscape ( ) ) ? HtmlUtils . htmlEscape ( urlStr ) : urlStr ; <END_BUG> urlStr = ( this . javaScriptEscape ) ? JavaScriptUtils . javaScriptEscape ( urlStr ) : urlStr ; return urlStr ; } protected String createQueryString ( List < Param > params , Set < String > usedParams , boolean includeQueryStringDelimiter ) throws JspException { } protected String replaceUriTemplateParams ( String uri , List < Param > params , Set < String > usedParams ) throws JspException { } private enum UrlType { CONTEXT_RELATIVE , RELATIVE , ABSOLUTE ; } }

Fix:
urlStr = htmlEscape ( urlStr ) ;
Buggy code:
public class OrFileFilter extends AbstractFileFilter implements Serializable , ConditionalFileFilter { private List < IOFileFilter > fileFilters ; public OrFileFilter ( ) { } public OrFileFilter ( final List < IOFileFilter > fileFilters ) { } public OrFileFilter ( IOFileFilter filter1 , IOFileFilter filter2 ) { } public void addFileFilter ( final IOFileFilter ioFileFilter ) { } public List < IOFileFilter > getFileFilters ( ) { } public boolean removeFileFilter ( IOFileFilter ioFileFilter ) { } public void setFileFilters ( final List < IOFileFilter > fileFilters ) { } public boolean accept ( final File file ) { } public boolean accept ( final File file , final String name ) { } public String toString ( ) { <START_BUG> StringBuffer buffer = new StringBuffer ( ) ; <END_BUG> buffer . append ( super . toString ( ) ) ; buffer . append ( "(" ) ; if ( ( fileFilters ) != null ) { for ( int i = 0 ; i < ( fileFilters . size ( ) ) ; i ++ ) { if ( i > 0 ) { buffer . append ( "," ) ; } Object filter = fileFilters . get ( i ) ; buffer . append ( ( filter == null ? "null" : filter . toString ( ) ) ) ; } } buffer . append ( ")" ) ; return buffer . toString ( ) ; } }

Fix:
StringBuilder buffer = new StringBuilder ( ) ;
Buggy code:
public class TestPhoneticFilterFactory extends BaseTokenStreamTestCase { public void testFactoryDefaults ( ) throws IOException { } public void testInjectFalse ( ) throws IOException { } public void testMaxCodeLength ( ) throws IOException { } public void testMissingEncoder ( ) throws IOException { try { new PhoneticFilterFactory ( new HashMap < String , String > ( ) ) ; fail ( ) ; } catch ( IllegalArgumentException expected ) { <START_BUG> assertTrue ( expected . getMessage ( ) . contains ( "Missing<seq2seq4repair_space>required<seq2seq4repair_space>parameter" ) ) ; <END_BUG> } } public void testUnknownEncoder ( ) throws IOException { } public void testUnknownEncoderReflection ( ) throws IOException { } public void testFactoryReflection ( ) throws IOException { } public void testFactoryReflectionCaverphone2 ( ) throws IOException { } public void testFactoryReflectionCaverphone ( ) throws IOException { } public void testAlgorithms ( ) throws Exception { } public void testBogusArguments ( ) throws Exception { } static void assertAlgorithm ( String algName , String inject , String input , String [ ] expected ) throws Exception { } }

Fix:
assertTrue ( expected . getMessage ( ) . contains ( "Configuration<seq2seq4repair_space>Error:<seq2seq4repair_space>missing<seq2seq4repair_space>parameter<seq2seq4repair_space>'encoder'" ) ) ;
Buggy code:
public final class GroupLensDataModel extends FileDataModel { private Map < String , Movie > movieMap ; private final File moviesFile ; public GroupLensDataModel ( ) throws IOException { } public GroupLensDataModel ( File ratingsFile , File moviesFile ) throws IOException { } @ Override protected Item buildItem ( String id ) { } @ Override protected void reload ( ) { } private static File convertGLFile ( File originalFile , boolean ratings ) throws IOException { <START_BUG> File resultFile = new File ( new File ( System . getProperty ( "java.io.tmpdir" ) ) , ( ( "taste." + ( ratings ? "ratings" : "movies" ) ) + ".txt" ) ) ; <END_BUG> if ( ! ( resultFile . exists ( ) ) ) { PrintWriter writer = null ; try { writer = new PrintWriter ( new OutputStreamWriter ( new FileOutputStream ( resultFile ) , Charset . forName ( "UTF-8" ) ) ) ; for ( String line : new FileLineIterable ( originalFile , false ) ) { String convertedLine ; if ( ratings ) { convertedLine = line . substring ( 0 , line . lastIndexOf ( "::" ) ) . replace ( "::" , "," ) ; } else { convertedLine = line . replace ( "," , "" ) . replace ( "::" , "," ) ; } writer . println ( convertedLine ) ; } writer . flush ( ) ; } catch ( IOException ioe ) { resultFile . delete ( ) ; throw ioe ; } finally { IOUtils . quietClose ( writer ) ; } } return resultFile ; } public static File readResourceToTempFile ( String resourceName ) throws IOException { } @ Override public String toString ( ) { } }

Fix:
File resultFile = new File ( new File ( System . getProperty ( "java.io.tmpdir" ) ) , ( ( ratings ? "ratings" : "movies" ) + ".txt" ) ) ;