nus-yam/ex-repair huggingface dataset:
Buggy code:
public abstract class GenericItem implements ActiveItem { protected EventPublisher eventPublisher ; protected Set < StateChangeListener > listeners = new CopyOnWriteArraySet < StateChangeListener > ( Collections . newSetFromMap ( new WeakHashMap < StateChangeListener , Boolean > ( ) ) ) ; protected List < String > groupNames = new ArrayList < String > ( ) ; protected Set < String > tags = new HashSet < String > ( ) ; protected final String name ; protected final String type ; protected State state = UnDefType . NULL ; protected String label ; protected String category ; private StateDescriptionProvider stateDescriptionProvider ; public GenericItem ( String type , String name ) { } @ Override public State getState ( ) { } @ Override public State getStateAs ( Class < ? extends State > typeClass ) { } public void initialize ( ) { } public void dispose ( ) { } @ Override public String getName ( ) { } @ Override public String getType ( ) { } @ Override public List < String > getGroupNames ( ) { } @ Override public void addGroupName ( String groupItemName ) { } @ Override public void addGroupNames ( String ... groupItemNames ) { } @ Override public void addGroupNames ( List < String > groupItemNames ) { } @ Override public void removeGroupName ( String groupItemName ) { } public void setEventPublisher ( EventPublisher eventPublisher ) { } public void setStateDescriptionProvider ( StateDescriptionProvider stateDescriptionProvider ) { } protected void internalSend ( Command command ) { } public void setState ( State state ) { } public void send ( RefreshType command ) { } private void notifyListeners ( State oldState , State newState ) { Set < StateChangeListener > clonedListeners = null ; clonedListeners = new CopyOnWriteArraySet < StateChangeListener > ( listeners ) ; for ( StateChangeListener listener : clonedListeners ) { listener . stateUpdated ( this , newState ) ; } <START_BUG> if ( ! ( oldState . equals ( newState ) ) ) { <END_BUG> for ( StateChangeListener listener : clonedListeners ) { listener . stateChanged ( this , oldState , newState ) ; } } } @ Override public String toString ( ) { } public void addStateChangeListener ( StateChangeListener listener ) { } public void removeStateChangeListener ( StateChangeListener listener ) { } @ Override public int hashCode ( ) { } @ Override public boolean equals ( Object obj ) { } @ Override public Set < String > getTags ( ) { } @ Override public boolean hasTag ( String tag ) { } @ Override public void addTag ( String tag ) { } @ Override public void addTags ( Collection < String > tags ) { } @ Override public void addTags ( String ... tags ) { } @ Override public void removeTag ( String tag ) { } @ Override public void removeAllTags ( ) { } @ Override public String getLabel ( ) { } @ Override public void setLabel ( String label ) { } @ Override public String getCategory ( ) { } @ Override public void setCategory ( String category ) { } @ Override public StateDescription getStateDescription ( ) { } @ Override public StateDescription getStateDescription ( Locale locale ) { } }

Fix:
if ( ( newState != null ) && ( ! ( newState . equals ( oldState ) ) ) ) {
Buggy code:
class MapleEngineImpl implements MapleEngine { private Log log = LogFactory . getLog ( MapleEngineImpl . class ) ; private final class EngineCallback implements InvocationHandler { @ Override public Object invoke ( Object proxy , Method method , Object [ ] args ) throws Throwable { } } private static final String MAPLE_CALLBACK_INTERFACE = "com.maplesoft.openmaple.EngineCallBacks" ; private static final String MAPLE_ENGINE_CLASS = "com.maplesoft.openmaple.Engine" ; private Class < ? > mapleCallbackInterface ; private Constructor < ? > engineConstructor ; private Method evaluateMethod ; private List < String > errorMessages = new ArrayList < String > ( ) ; private Object engine ; private StringBuffer outputBuffer = new StringBuffer ( ) ; private void onError ( String text , int type ) { } private void onText ( String text , int type ) { } MapleEngineImpl ( MapleClassLoader mapleClassLoader ) throws IllegalArgumentException { } private Object createEngineCallback ( ) { } private Object createEngine ( Object callback ) { } @ Override public String evaluate ( String command ) throws MapleEngineException { } @ Override public void reset ( ) throws MapleEngineException { } @ Override public void loadModule ( InputStream input ) throws MapleEngineException { try { <START_BUG> File tempFile = File . createTempFile ( "gaalop" , ".m" ) ; <END_BUG> try { FileOutputStream output = new FileOutputStream ( tempFile ) ; byte [ ] buffer = new byte [ 1024 ] ; int read ; while ( ( read = input . read ( buffer ) ) != ( - 1 ) ) { output . write ( buffer , 0 , read ) ; } output . close ( ) ; evaluate ( ( ( "read<seq2seq4repair_space>\"" + ( tempFile . getAbsolutePath ( ) ) ) + "\";" ) ) ; } finally { tempFile . delete ( ) ; } } catch ( IOException e ) { throw new MapleEngineException ( "Unable<seq2seq4repair_space>to<seq2seq4repair_space>load<seq2seq4repair_space>module<seq2seq4repair_space>in<seq2seq4repair_space>Maple." , e ) ; } } private void disposeMapleObject ( Object obj ) { } }

Fix:
File tempFile = File . createTempFile ( "module" , ".m" ) ;
Buggy code:
public class TabFolder extends Composite { TabItem [ ] items ; ImageList imageList ; public TabFolder ( Composite parent , int style ) { } static int checkStyle ( int style ) { } protected void checkSubclass ( ) { } public void addSelectionListener ( SelectionListener listener ) { } int clientHandle ( ) { } public Point computeSize ( int wHint , int hHint , boolean changed ) { } public Rectangle computeTrim ( int x , int y , int width , int height ) { } void createHandle ( int index ) { } void createWidget ( int index ) { } void createItem ( TabItem item , int index ) { } void destroyItem ( TabItem item ) { } int eventHandle ( ) { } public TabItem getItem ( int index ) { } public int getItemCount ( ) { } public TabItem [ ] getItems ( ) { } public TabItem [ ] getSelection ( ) { } public int getSelectionIndex ( ) { } int gtk_focus ( int widget , int directionType ) { } int gtk_switch_page ( int widget , int page , int page_num ) { } void hookEvents ( ) { } public int indexOf ( TabItem item ) { } Point minimumSize ( int wHint , int hHint , boolean flushCache ) { } boolean mnemonicHit ( char key ) { } boolean mnemonicMatch ( char key ) { } void releaseChildren ( boolean destroy ) { if ( ( items ) != null ) { for ( int i = 0 ; i < ( items . length ) ; i ++ ) { TabItem item = items [ i ] ; if ( ( item != null ) && ( ! ( item . isDisposed ( ) ) ) ) { <START_BUG> item . releaseChildren ( false ) ; <END_BUG> } } items = null ; } super . releaseChildren ( destroy ) ; } void releaseWidget ( ) { } void removeControl ( Control control ) { } public void removeSelectionListener ( SelectionListener listener ) { } int setBounds ( int x , int y , int width , int height , boolean move , boolean resize ) { } void setFontDescription ( int font ) { } void setForegroundColor ( GdkColor color ) { } public void setSelection ( int index ) { } void setSelection ( int index , boolean notify ) { } public void setSelection ( TabItem [ ] items ) { } boolean traversePage ( boolean next ) { } }

Fix:
item . release ( false ) ;
Buggy code:
public class ExtractDate extends DateComputation < DateTimeValue , DateValue > { public ExtractDate ( DataDescriber < DateTimeValue > dateTimeValue ) { } @ Override protected DateValue compute ( Row row ) { <START_BUG> return new DateValue ( getRight ( ) . resolve ( row ) . getValue ( ) . toLocalTime ( ) ) ; <END_BUG> } }

Fix:
return new DateValue ( getRight ( ) . resolve ( row ) . getValue ( ) . toLocalDate ( ) ) ;
Buggy code:
public class SentenceFeatureExtractor { private static List < String > determiners ; private static List < String > workNouns ; private static List < String > thirdPersonPronouns ; private static List < String > connectors ; public static final String HEADER_PATTERN = "\\d+\\.\\d+.*" ; public SentenceFeatureExtractor ( ) { } public void writeInstancesToFile ( List < Instance > instances , Path path ) { try ( FileWriter writer = new FileWriter ( path . toFile ( ) ) ) { writer . write ( "@RELATION<seq2seq4repair_space>sentence\n" ) ; for ( Feature feature : Feature . values ( ) ) { writer . write ( ( ( "@ATTRIBUTE<seq2seq4repair_space>" + ( feature . toString ( ) ) ) + "<seq2seq4repair_space>{true,<seq2seq4repair_space>false}\n" ) ) ; } <START_BUG> writer . write ( ( ( ( ( ( ( "@ATTRIBUTE<seq2seq4repair_space>class<seq2seq4repair_space>{" + ( SentenceType . EXPLICIT_REFERENCE ) ) + "," ) + ( SentenceType . IMPLICIT_REFERENCE ) ) + "," ) + ( SentenceType . NOT_REFERENCE ) ) + "\n" ) ) ; <END_BUG> writer . write ( "@DATA\n" ) ; instances . forEach ( ( instance ) -> { try { for ( Feature feature : Feature . values ( ) ) { writer . write ( ( ( instance . features . get ( feature ) ) + "," ) ) ; } writer . write ( ( instance . instanceClass + "\n" ) ) ; } catch ( e ) { e . printStackTrace ( ) ; } } ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; System . exit ( 0 ) ; } } private void setup ( ) throws IOException { } public List < Instance > extractInstances ( List < Sentence > sentences , Set < String > mainAuthors ) { } public Map < Feature , Boolean > extractFeatures ( Sentence previousSentence , Sentence sentence , Sentence nextSentence , Set < String > mainAuthors ) { } public boolean containsDetWork ( String [ ] words ) { } public boolean startsWith3rdPersonPronoun ( String [ ] words ) { } public boolean startsWithConnector ( String [ ] words ) { } public boolean isAfterExplicitReference ( Sentence previousSentence ) { } public boolean startsWithSectionHeader ( Sentence sentence ) { } public boolean containsMainAuthor ( String [ ] words , Set < String > allCited ) { } private List < String > readLines ( String filePath ) throws IOException { } private boolean looseContains ( List < String > list , String str ) { } }

Fix:
writer . write ( ( ( ( ( ( ( "@ATTRIBUTE<seq2seq4repair_space>class<seq2seq4repair_space>{" + ( SentenceType . EXPLICIT_REFERENCE ) ) + "," ) + ( SentenceType . IMPLICIT_REFERENCE ) ) + "," ) + ( SentenceType . NOT_REFERENCE ) ) + "}\n" ) ) ;
Buggy code:
public abstract class MTType { private final TypeGraph typeGraph ; public MTType ( TypeGraph typeGraph ) { } public TypeGraph getTypeGraph ( ) { } public abstract List < ? extends MTType > getComponentTypes ( ) { } public MTType getType ( ) { } public abstract void accept ( TypeVisitor v ) { } public abstract void acceptOpen ( TypeVisitor v ) { } public abstract void acceptClose ( TypeVisitor v ) { } public boolean isKnownToContainOnlyMathTypes ( ) { } public boolean membersKnownToContainOnlyMTypes ( ) { } public final MTType getCopyWithVariablesSubstituted ( Map < String , MTType > substitutions ) { } @ Override public boolean equals ( Object o ) { <START_BUG> System . err . println ( ( ( ( "mttype:<seq2seq4repair_space>" + ( this . toString ( ) ) ) + "<seq2seq4repair_space>==<seq2seq4repair_space>" ) + ( o . toString ( ) ) ) ) ; <END_BUG> if ( ( this ) == o ) { return true ; } else { return false ; } } }

Fix:
System . err . println ( ( ( ( ( "mttype:<seq2seq4repair_space>" + ( this . toString ( ) ) ) + "<seq2seq4repair_space>alph<seq2seq4repair_space>equiv<seq2seq4repair_space>to<seq2seq4repair_space>" ) + ( o . toString ( ) ) ) + "?" ) ) ;
Buggy code:
public class Cat { private static Cat s_instance = new Cat ( ) ; private MessageProducer m_producer ; private MessageManager m_manager ; private PlexusContainer m_container ; private static void checkAndInitialize ( ) { } public static String createMessageId ( ) { } public static void destroy ( ) { } public static String getCatHome ( ) { } public static Cat getInstance ( ) { } public static MessageManager getManager ( ) { } public static MessageProducer getProducer ( ) { } public static void initialize ( File configFile ) { } public static void initialize ( PlexusContainer container , File configFile ) { } public static void initialize ( String ... servers ) { } public static boolean isInitialized ( ) { } static void log ( String severity , String message ) { } public static void logError ( String message , Throwable cause ) { } public static void logError ( Throwable cause ) { } public static void logEvent ( String type , String name ) { } public static void logEvent ( String type , String name , String status , String nameValuePairs ) { } public static void logHeartbeat ( String type , String name , String status , String nameValuePairs ) { } public static void logMetric ( String name , Object ... keyValues ) { } public static void logMetricForCount ( String name ) { } public static void logMetricForCount ( String name , int quantity ) { } public static void logMetricForDuration ( String name , long durationInMillis ) { } public static void logMetricForSum ( String name , double value ) { } public static void logMetricForSum ( String name , double sum , int quantity ) { <START_BUG> Cat . logMetricInternal ( name , "S,C" , String . format ( "%.2f,%s" , sum , quantity ) ) ; <END_BUG> } private static void logMetricInternal ( String name , String status , String keyValuePairs ) { } public static void logTrace ( String type , String name ) { } public static void logTrace ( String type , String name , String status , String nameValuePairs ) { } public static < T > T lookup ( Class < T > role ) throws ComponentLookupException { } public static < T > T lookup ( Class < T > role , String hint ) throws ComponentLookupException { } public static Event newEvent ( String type , String name ) { } public static ForkedTransaction newForkedTransaction ( String type , String name ) { } public static Heartbeat newHeartbeat ( String type , String name ) { } public static TaggedTransaction newTaggedTransaction ( String type , String name , String tag ) { } public static Trace newTrace ( String type , String name ) { } public static Transaction newTransaction ( String type , String name ) { } public static void reset ( ) { } public static void setup ( String sessionToken ) { } private Cat ( ) { } void setContainer ( PlexusContainer container ) { } }

Fix:
Cat . logMetricInternal ( name , "S,C" , String . format ( "%s,%.2f" , sum , quantity ) ) ;
Buggy code:
public abstract class Map { private Card [ ] [ ] mapArray ; private MapTile startingTile ; private MapTile finishTile ; private MapTile currentPlayerLocation ; private Color defaultTileColor ; private int mapSize ; protected Map ( int mapSize ) { } public int getSize ( ) { } public MapTile getStart ( ) { } public MapTile getFinish ( ) { } protected void setCardArray ( Card [ ] [ ] cards ) { } protected void setStart ( MapTile start ) { } protected void setFinish ( MapTile finish ) { } protected void setCard ( MapTile tile , Card card ) { } protected void setCurrentPlayerLocation ( MapTile currentPlayerLocation ) { } public boolean isFinished ( ) { } public void displayConsole ( ) { } public MapTile getPlayerLocation ( ) { } public boolean movePlayer ( Direction movementDirection ) { MapTile newPlayerLocation = null ; boolean successfullyMoved = true ; switch ( movementDirection ) { case NORTH : newPlayerLocation = new MapTile ( ( ( this . currentPlayerLocation . getYCoordinate ( ) ) - 1 ) , this . currentPlayerLocation . getXCoordinate ( ) ) ; break ; case EAST : newPlayerLocation = new MapTile ( this . currentPlayerLocation . getYCoordinate ( ) , ( ( this . currentPlayerLocation . getXCoordinate ( ) ) + 1 ) ) ; break ; case SOUTH : newPlayerLocation = new MapTile ( ( ( this . currentPlayerLocation . getYCoordinate ( ) ) + 1 ) , this . currentPlayerLocation . getXCoordinate ( ) ) ; break ; case WEST : newPlayerLocation = new MapTile ( this . currentPlayerLocation . getYCoordinate ( ) , ( ( this . currentPlayerLocation . getXCoordinate ( ) ) - 1 ) ) ; break ; } if ( isLocationValid ( newPlayerLocation ) ) { this . currentPlayerLocation = newPlayerLocation ; try { int y = this . currentPlayerLocation . getYCoordinate ( ) ; int x = this . currentPlayerLocation . getXCoordinate ( ) ; Card currentCard = this . mapArray [ y ] [ x ] ; this . mapArray [ y ] [ x ] . setShown ( true ) ; if ( currentCard instanceof ScenarioCard ) { ( ( ScenarioCard ) ( currentCard ) ) . runScript ( ) ; } } catch ( Exception error ) { <START_BUG> WildernessSurvival . log ( error . getMessage ( ) ) ; <END_BUG> } } else { if ( isLocationInBounds ( newPlayerLocation ) ) { this . mapArray [ newPlayerLocation . getYCoordinate ( ) ] [ newPlayerLocation . getXCoordinate ( ) ] . setShown ( true ) ; } successfullyMoved = false ; } return successfullyMoved ; } public boolean isLocationInBounds ( int y , int x ) { } public boolean isLocationInBounds ( MapTile location ) { } public boolean isLocationValid ( int y , int x ) { } public boolean isLocationValid ( MapTile location ) { } public Card getCard ( int x , int y ) { } public Card getCard ( MapTile tile ) { } public JPanel getMapPanel ( ) { } }

Fix:
gui . log ( error . getMessage ( ) ) ;
Buggy code:
public class EqualsBuilder { private boolean isEquals = true ; public EqualsBuilder ( ) { } public static boolean reflectionEquals ( Object lhs , Object rhs ) { } public static boolean reflectionEquals ( Object lhs , Object rhs , Collection < String > excludeFields ) { } public static boolean reflectionEquals ( Object lhs , Object rhs , String [ ] excludeFields ) { } public static boolean reflectionEquals ( Object lhs , Object rhs , boolean testTransients ) { } public static boolean reflectionEquals ( Object lhs , Object rhs , boolean testTransients , Class < ? > reflectUpToClass ) { } public static boolean reflectionEquals ( Object lhs , Object rhs , boolean testTransients , Class < ? > reflectUpToClass , String [ ] excludeFields ) { } private static void reflectionAppend ( Object lhs , Object rhs , Class < ? > clazz , EqualsBuilder builder , boolean useTransients , String [ ] excludeFields ) { Field [ ] fields = clazz . getDeclaredFields ( ) ; <START_BUG> List excludedFieldList = ( excludeFields != null ) ? Arrays . asList ( excludeFields ) : Collections . EMPTY_LIST ; <END_BUG> AccessibleObject . setAccessible ( fields , true ) ; for ( int i = 0 ; ( i < ( fields . length ) ) && ( builder . isEquals ) ; i ++ ) { Field f = fields [ i ] ; if ( ( ( ( ! ( excludedFieldList . contains ( f . getName ( ) ) ) ) && ( ( f . getName ( ) . indexOf ( '$' ) ) == ( - 1 ) ) ) && ( useTransients || ( ! ( Modifier . isTransient ( f . getModifiers ( ) ) ) ) ) ) && ( ! ( Modifier . isStatic ( f . getModifiers ( ) ) ) ) ) { try { builder . append ( f . get ( lhs ) , f . get ( rhs ) ) ; } catch ( IllegalAccessException e ) { throw new InternalError ( "Unexpected<seq2seq4repair_space>IllegalAccessException" ) ; } } } } public EqualsBuilder appendSuper ( boolean superEquals ) { } public EqualsBuilder append ( Object lhs , Object rhs ) { } public EqualsBuilder append ( long lhs , long rhs ) { } public EqualsBuilder append ( int lhs , int rhs ) { } public EqualsBuilder append ( short lhs , short rhs ) { } public EqualsBuilder append ( char lhs , char rhs ) { } public EqualsBuilder append ( byte lhs , byte rhs ) { } public EqualsBuilder append ( double lhs , double rhs ) { } public EqualsBuilder append ( float lhs , float rhs ) { } public EqualsBuilder append ( boolean lhs , boolean rhs ) { } public EqualsBuilder append ( Object [ ] lhs , Object [ ] rhs ) { } public EqualsBuilder append ( long [ ] lhs , long [ ] rhs ) { } public EqualsBuilder append ( int [ ] lhs , int [ ] rhs ) { } public EqualsBuilder append ( short [ ] lhs , short [ ] rhs ) { } public EqualsBuilder append ( char [ ] lhs , char [ ] rhs ) { } public EqualsBuilder append ( byte [ ] lhs , byte [ ] rhs ) { } public EqualsBuilder append ( double [ ] lhs , double [ ] rhs ) { } public EqualsBuilder append ( float [ ] lhs , float [ ] rhs ) { } public EqualsBuilder append ( boolean [ ] lhs , boolean [ ] rhs ) { } public boolean isEquals ( ) { } protected void setEquals ( boolean isEquals ) { } }

Fix:
List < String > excludedFieldList = ( excludeFields != null ) ? Arrays . asList ( excludeFields ) : Collections . < String > emptyList ( ) ;
Buggy code:
public class EbeanService extends DbService { private EbeanServer ebean ; private ConcurrentMap < Class < ? > , Dao > daoMap ; private Map < String , Object > conf ; private static Set < Class < ? > > modelTypes = C . newSet ( ) ; public EbeanService ( final String dbId , final App app , Map < String , Object > config ) { } @ Override protected void releaseResources ( ) { <START_BUG> ebean . shutdown ( true , true ) ; <END_BUG> } @ Override public < DAO extends Dao > DAO dao ( Class < ? > modelType ) { } @ Override protected < DAO extends Dao > DAO defaultDao ( Class < ? > modelType ) { } public EbeanServer ebean ( ) { } private ServerConfig serverConfig ( String id , Map < String , Object > conf ) { } private DataSourceConfig datasourceConfig ( Map < String , Object > conf ) { } public static void registerModelType ( Class < ? > modelType ) { } }

Fix:
ebean . shutdown ( false , false ) ;
Buggy code:
public class DataSyncer { private static final String TAG = "DataSyncer" ; public static final long PERSIST_PERIOD = 2678400000L ; private long mPersistPeriod = DataSyncer . PERSIST_PERIOD ; private SensorDataProxy mProxy = null ; private DatabaseHandler mDatabaseHandler ; private SensorProfiles mSensorProfiles ; private Context mContext ; private Object mLock = new Object ( ) ; public DataSyncer ( Context context , DatabaseHandler databaseHandler , SensorDataProxy proxy ) { } public void initialize ( ) throws IOException , DatabaseHandlerException , SensorException , SensorProfileException , SchemaException , ValidationException , JSONException { } public void sync ( ProgressCallback progressCallback ) throws IOException , DatabaseHandlerException , SensorException , SensorProfileException , SchemaException , ValidationException , JSONException { } public void sync ( ) throws IOException , DatabaseHandlerException , SensorException , SensorProfileException , SchemaException , ValidationException , JSONException { } protected void downloadSensorProfiles ( ) throws IOException , SensorProfileException , JSONException { } protected void deletionInRemote ( ) throws IOException { } protected void downloadSensorsFromRemote ( ) throws IOException , DatabaseHandlerException , SensorException , SensorProfileException , SchemaException , ValidationException , JSONException { JSONArray sensorList = mProxy . getSensors ( ) ; if ( ( sensorList . length ( ) ) != 0 ) { for ( int i = 0 ; i < ( sensorList . length ( ) ) ; i ++ ) { JSONObject sensorFromRemote = sensorList . getJSONObject ( i ) ; <START_BUG> SensorOptions sensorOptions = DefaultSensorOptions . getSensorOptions ( mContext , sensorFromRemote . getString ( "source_name" ) ) ; <END_BUG> sensorOptions . setMeta ( sensorFromRemote . getJSONObject ( "meta" ) ) ; if ( ! ( mDatabaseHandler . hasSensor ( sensorFromRemote . getString ( "source_name" ) , sensorFromRemote . getString ( "sensor_name" ) ) ) ) { mDatabaseHandler . createSensor ( sensorFromRemote . getString ( "source_name" ) , sensorFromRemote . getString ( "sensor_name" ) , sensorOptions ) ; } } } } protected void downloadSensorDataFromRemote ( ) throws IOException , DatabaseHandlerException , SensorException , SensorProfileException , SchemaException , ValidationException , JSONException { } protected void cleanupLocal ( ) throws DatabaseHandlerException , SensorException , SensorProfileException , SchemaException , JSONException { } protected void uploadToRemote ( ) throws IOException , DatabaseHandlerException , SensorException , SensorProfileException , SchemaException , ValidationException , JSONException { } public Set < String > getSensorProfilesSensorNames ( ) throws SensorProfileException , JSONException { } public long getPersistPeriod ( ) { } public void setPersistPeriod ( long persistPeriod ) { } }

Fix:
SensorOptions sensorOptions = DefaultSensorOptions . getSensorOptions ( mContext , sensorFromRemote . getString ( "sensor_name" ) ) ;
Buggy code:
public class DataSeter extends ActionBarActivity { private String selectedNode = null ; List < String > childrens ; XMLPullParserHandler xmlPullParserHandler ; Context context = this ; Dialog dialog ; LivingEntityData livingEntity ; String userMail ; @ Override protected void onCreate ( Bundle savedInstanceState ) { } public void caracterize ( View v ) throws Exception { } public void valider ( View v ) { } public void annuler ( View v ) { } public void send ( View v ) { EditText textView = ( ( EditText ) ( findViewById ( nameET ) ) ) ; livingEntity . setName ( textView . getText ( ) . toString ( ) ) ; textView = ( ( EditText ) ( findViewById ( comET ) ) ) ; livingEntity . setComment ( textView . getText ( ) . toString ( ) ) ; <START_BUG> livingEntity . setNode ( "Plant" ) ; <END_BUG> ConnectivityManager connectivityManager = ( ( ConnectivityManager ) ( getSystemService ( CONNECTIVITY_SERVICE ) ) ) ; NetworkInfo activeNetworkInfo = connectivityManager . getActiveNetworkInfo ( ) ; if ( ( activeNetworkInfo != null ) && ( activeNetworkInfo . isConnected ( ) ) ) { DataSeter . SendActivity send = new DataSeter . SendActivity ( ) ; send . execute ( livingEntity ) ; } else showSettingsAlert ( ) ; } public void showSettingsAlert ( ) { } @ Override public boolean onCreateOptionsMenu ( Menu menu ) { } @ Override public boolean onOptionsItemSelected ( MenuItem item ) { } public String getSelectedNode ( ) { } private class SendActivity extends AsyncTask < LivingEntityData , Void , Void > { @ Override protected void onPreExecute ( ) { } @ Override protected Void doInBackground ( LivingEntityData ... params ) { } @ Override protected void onPostExecute ( Void result ) { } } No newline ; at end ; of file ; }

Fix:
livingEntity . setNode ( selectedNode ) ;
Buggy code:
@ Deprecated public class SortableFloatField extends FieldType { @ Override protected void init ( IndexSchema schema , Map < String , String > args ) { } @ Override public SortField getSortField ( SchemaField field , boolean reverse ) { } @ Override public ValueSource getValueSource ( SchemaField field , QParser qparser ) { } @ Override public String toInternal ( String val ) { } @ Override public String toExternal ( IndexableField f ) { } @ Override public Float toObject ( IndexableField f ) { } @ Override public String indexedToReadable ( String indexedForm ) { } public CharsRef indexedToReadable ( BytesRef input , CharsRef charsRef ) { final char [ ] indexedToReadable = indexedToReadable ( input . utf8ToChars ( charsRef ) . toString ( ) ) . toCharArray ( ) ; <START_BUG> charsRef . copy ( indexedToReadable , 0 , indexedToReadable . length ) ; <END_BUG> return charsRef ; } @ Override public void write ( TextResponseWriter writer , String name , IndexableField f ) throws IOException { } }

Fix:
charsRef . copyChars ( indexedToReadable , 0 , indexedToReadable . length ) ;
Buggy code:
public class Kjc extends DefaultCompilerAdapter { public boolean execute ( ) throws BuildException { } protected Commandline setupKjcCommand ( ) { Commandline cmd = new Commandline ( ) ; Path classpath = getCompileClasspath ( ) ; if ( ( deprecation ) == true ) { cmd . createArgument ( ) . setValue ( "-deprecation" ) ; } if ( ( destDir ) != null ) { cmd . createArgument ( ) . setValue ( "-d" ) ; cmd . createArgument ( ) . setFile ( destDir ) ; } cmd . createArgument ( ) . setValue ( "-classpath" ) ; Path cp = new Path ( project ) ; if ( ( bootclasspath ) != null ) { cp . append ( bootclasspath ) ; } if ( ( extdirs ) != null ) { <START_BUG> addExtdirsToClasspath ( cp ) ; <END_BUG> } cp . append ( classpath ) ; cp . append ( src ) ; cmd . createArgument ( ) . setPath ( cp ) ; if ( ( encoding ) != null ) { cmd . createArgument ( ) . setValue ( "-encoding" ) ; cmd . createArgument ( ) . setValue ( encoding ) ; } if ( debug ) { cmd . createArgument ( ) . setValue ( "-g" ) ; } if ( optimize ) { cmd . createArgument ( ) . setValue ( "-O2" ) ; } if ( verbose ) { cmd . createArgument ( ) . setValue ( "-verbose" ) ; } addCurrentCompilerArgs ( cmd ) ; logAndAddFilesToCompile ( cmd ) ; return cmd ; } }

Fix:
cp . addExtdirs ( extdirs ) ;
Buggy code:
public class CaseSensitiveToCaseInsensitiveFilter implements Function < String , String > { @ Override public String apply ( final String input ) { String res = "" ; for ( int i = 0 ; i < ( input . length ( ) ) ; i ++ ) { final char testChar = input . charAt ( i ) ; if ( ( Character . isLowerCase ( testChar ) ) || ( testChar == '_' ) ) { res += testChar ; } else { <START_BUG> res += "^" + testChar ; <END_BUG> } } return res ; } }

Fix:
res += "^" + ( Character . toLowerCase ( testChar ) ) ;
Buggy code:
public final class Printer extends Device { public int handle ; PrinterData data ; boolean isGCCreated = false ; static TCHAR profile ; static TCHAR appName ; static TCHAR keyName ; public static PrinterData [ ] getPrinterList ( ) { } public static PrinterData getDefaultPrinterData ( ) { } static DeviceData checkNull ( PrinterData data ) { } public Printer ( ) { } public Printer ( PrinterData data ) { } protected void create ( DeviceData deviceData ) { } public int internal_new_GC ( GCData data ) { if ( ( handle ) == 0 ) SWT . error ( ERROR_NO_HANDLES ) ; if ( data != null ) { if ( isGCCreated ) SWT . error ( ERROR_INVALID_ARGUMENT ) ; int mask = ( SWT . LEFT_TO_RIGHT ) | ( SWT . RIGHT_TO_LEFT ) ; if ( ( ( data . style ) & mask ) != 0 ) { data . layout = ( ( ( data . style ) & ( SWT . RIGHT_TO_LEFT ) ) != 0 ) ? OS . LAYOUT_RTL : 0 ; } else { data . style |= SWT . LEFT_TO_RIGHT ; } data . device = this ; <START_BUG> data . hFont = OS . GetCurrentObject ( handle , OBJ_FONT ) ; <END_BUG> isGCCreated = true ; } return handle ; } public void internal_dispose_GC ( int hDC , GCData data ) { } public boolean startJob ( String jobName ) { } public void endJob ( ) { } public void cancelJob ( ) { } public boolean startPage ( ) { } public void endPage ( ) { } public Point getDPI ( ) { } public Rectangle getBounds ( ) { } public Rectangle getClientArea ( ) { } public Rectangle computeTrim ( int x , int y , int width , int height ) { } public PrinterData getPrinterData ( ) { } protected void checkDevice ( ) { } protected void release ( ) { } protected void destroy ( ) { } }

Fix:
data . font = Font . win32_new ( this , OS . GetCurrentObject ( handle , OBJ_FONT ) ) ;
Buggy code:
public class XMLStoreManager extends AbstractStoreManager { private XMLConfiguration _conf ; private XMLStore _store ; private Collection _updates ; private Collection _deletes ; protected Collection getUnsupportedOptions ( ) { } protected OpenJPAConfiguration newConfiguration ( ) { } protected void open ( ) { } public boolean exists ( OpenJPAStateManager sm , Object context ) { } private static void incrementVersion ( OpenJPAStateManager sm ) { long version = 0 ; if ( ( sm . getVersion ( ) ) != null ) version = ( ( ( Long ) ( sm . getVersion ( ) ) ) . longValue ( ) ) + 1 ; <START_BUG> sm . setNextVersion ( Numbers . valueOf ( version ) ) ; <END_BUG> } public boolean initialize ( OpenJPAStateManager sm , PCState state , FetchConfiguration fetch , Object context ) { } public boolean load ( OpenJPAStateManager sm , BitSet fields , FetchConfiguration fetch , int lockLevel , Object context ) { } public boolean syncVersion ( OpenJPAStateManager sm , Object context ) { } public void begin ( ) { } public void commit ( ) { } public void rollback ( ) { } protected Collection flush ( Collection pNew , Collection pNewUpdated , Collection pNewFlushedDeleted , Collection pDirty , Collection pDeleted ) { } public ResultObjectProvider executeExtent ( ClassMetaData meta , boolean subclasses , FetchConfiguration fetch ) { } }

Fix:
sm . setNextVersion ( version ) ;
Buggy code:
@ SuppressWarnings ( "serial" ) public class StaticApp implements Serializable { private File apkFile ; public String outPath ; private String packageName ; private List < StaticClass > classes = new ArrayList < StaticClass > ( ) ; public String getPackageName ( ) { } public void setPackageName ( String packageName ) { } public List < StaticClass > getClasses ( ) { } public void addClass ( StaticClass c ) { } public File getApkFile ( ) { } public void setApkFile ( File apkFile ) { } public StaticClass findClassByJavaName ( String cN ) { } public StaticClass findClassByDexName ( String cN ) { } public StaticMethod findMethod ( String sig ) { if ( ! ( sig . contains ( "->" ) ) ) return null ; String cN = sig . split ( "->" ) [ 0 ] ; StaticClass c = findClassByDexName ( cN ) ; if ( c == null ) return null ; <START_BUG> return c . getMethod ( sig ) ; <END_BUG> } public StaticField findField ( String sig ) { } public StaticClass getMainActivity ( ) { } public ArrayList < StaticClass > getActivities ( ) { } public ArrayList < PathSummary > getAllPathSummaries ( ) { } public ArrayList < PathSummary > getPathSummariesOfMethod ( String methodSig ) { } public ArrayList < PathSummary > getPathSummariesOfMethod ( StaticMethod m ) { } public String getSmaliAppPath ( ) { } public String getSootAppPath ( ) { } }

Fix:
return c . getMethodByFullSig ( sig ) ;
Buggy code:
public class Application extends Controller { private static String SUPER_USER = "root" ; private static String SUPER_PASSWORD = "fu" ; private static Map < String , GameSession > sessions = new HashMap < String , GameSession > ( ) ; public static Result index ( ) { } public static Result init ( String game , String player ) { } public static Result doDice ( String game ) { } public static WebSocket < String > socket ( String game , String player ) { } public static Result gameGrid ( String game ) { } public static Result chooseFigure ( String game , Integer fig ) { } public static Result getLobby ( ) { } public static Result begin ( String game ) { } public static Result exit ( String game , String player ) { if ( ( Application . sessions . get ( game ) . removePlayer ( player ) ) < 1 ) Application . sessions . remove ( game ) ; <START_BUG> return ok ( "Game<seq2seq4repair_space>restarted" ) ; <END_BUG> } public static Result tui ( String game , String input ) { } public static Result login ( ) { } public static Result authenticate ( ) { } public static Result auth ( ) { } public Result verify ( ) { } public static class Login { public String user ; public String password ; public String validate ( ) { } } }

Fix:
return ok ( ) ;
Buggy code:
public class MyServiceActivator implements ServiceActivator { private static final String CONTAINER_NAME = "server" ; private static final String CACHE_NAME = "default" ; public static final String PREFERRED_NODE = ClusteringTestConstants . NODE_2 ; @ Override public void activate ( ServiceActivatorContext context ) { } private static void install ( ServiceName name , int quorum , ServiceActivatorContext context ) { InjectedValue < ServerEnvironment > env = new InjectedValue ( ) ; MyService service = new MyService ( env ) ; ServiceController < ? > factoryService = context . getServiceRegistry ( ) . getRequiredService ( SERVICE_NAME . append ( MyServiceActivator . CONTAINER_NAME , MyServiceActivator . CACHE_NAME ) ) ; SingletonServiceBuilderFactory factory = ( ( SingletonServiceBuilderFactory ) ( factoryService . getValue ( ) ) ) ; <START_BUG> factory . createSingletonServiceBuilder ( name , service ) . electionPolicy ( new org . wildfly . clustering . singleton . election . PreferredSingletonElectionPolicy ( new org . wildfly . clustering . singleton . election . SimpleSingletonElectionPolicy ( ) , new org . wildfly . clustering . singleton . election . NamePreference ( MyServiceActivator . PREFERRED_NODE ) ) ) . requireQuorum ( quorum ) . build ( context . getServiceTarget ( ) ) . addDependency ( ServerEnvironmentService . SERVICE_NAME , ServerEnvironment . class , env ) . setInitialMode ( ServiceController . Mode . ACTIVE ) . install ( ) ; <END_BUG> } }

Fix:
factory . createSingletonServiceBuilder ( name , service ) . electionPolicy ( new org . wildfly . clustering . singleton . election . PreferredSingletonElectionPolicy ( new org . wildfly . clustering . singleton . election . SimpleSingletonElectionPolicy ( ) , new org . wildfly . clustering . singleton . election . NamePreference ( ( ( MyServiceActivator . PREFERRED_NODE ) + "//ee" ) ) ) ) . requireQuorum ( quorum ) . build ( context . getServiceTarget ( ) ) . addDependency ( ServerEnvironmentService . SERVICE_NAME , ServerEnvironment . class , env ) . setInitialMode ( ServiceController . Mode . ACTIVE ) . install ( ) ;
Buggy code:
public class DeadZone extends View { public static final String TAG = "DeadZone" ; public static final boolean DEBUG = false ; public static final int HORIZONTAL = 0 ; public static final int VERTICAL = 1 ; private static final boolean CHATTY = true ; private boolean mShouldFlash ; private float mFlashFrac = 0.0F ; private int mSizeMax ; private int mSizeMin ; private int mHold ; private int mDecay ; private boolean mVertical ; private boolean mStartFromRight ; private long mLastPokeTime ; private final Runnable mDebugFlash = new Runnable ( ) { @ Override public void run ( ) { } } ; public DeadZone ( Context context , AttributeSet attrs ) { } public DeadZone ( Context context , AttributeSet attrs , int defStyle ) { } static float lerp ( float a , float b , float f ) { } private float getSize ( long now ) { if ( ( mSizeMax ) == 0 ) return 0 ; long dt = now - ( mLastPokeTime ) ; if ( dt > ( ( mHold ) + ( mDecay ) ) ) <START_BUG> return mSizeMin ; <END_BUG> if ( dt < ( mHold ) ) return mSizeMax ; return ( ( int ) ( DeadZone . lerp ( mSizeMax , mSizeMin , ( ( ( float ) ( dt - ( mHold ) ) ) // ( mDecay ) ) ) ) ) ; } public void setFlashOnTouchCapture ( boolean dbg ) { } @ Override public boolean onTouchEvent ( MotionEvent event ) { } public void poke ( MotionEvent event ) { } public void setFlash ( float f ) { } public float getFlash ( ) { } public void setStartFromRight ( boolean startFromRight ) { } @ Override public void onDraw ( Canvas can ) { } }

Fix:
return 0 ;
Buggy code:
public class StructureModelRegressionTest extends AjdeTestCase { public StructureModelRegressionTest ( String name ) { } public static void main ( String [ ] args ) { } public static TestSuite suite ( ) { } public void test ( ) { } public boolean verifyAgainstSavedModel ( String lstFile ) { } private boolean structureNodesEqual ( StructureNode s1 , StructureNode s2 ) { } private StructureModel getModelForFile ( String lstFile ) { Ajde . getDefault ( ) . getConfigurationManager ( ) . setActiveConfigFile ( lstFile ) ; <START_BUG> Ajde . getDefault ( ) . getBuildManager ( ) . buildStructure ( ) ; <END_BUG> while ( ! ( testerBuildListener . getBuildFinished ( ) ) ) { try { Thread . sleep ( 300 ) ; } catch ( InterruptedException ie ) { } } return Ajde . getDefault ( ) . getStructureModelManager ( ) . getStructureModel ( ) ; } protected void setUp ( ) throws Exception { } public void testModelExists ( ) { } protected void tearDown ( ) throws Exception { } }

Fix:
Ajde . getDefault ( ) . getBuildManager ( ) . build ( ) ;
Buggy code:
public class SendToMethodReturnValueHandler implements HandlerMethodReturnValueHandler { private final SimpMessageSendingOperations messagingTemplate ; private final boolean annotationRequired ; public SendToMethodReturnValueHandler ( SimpMessageSendingOperations messagingTemplate , boolean annotationRequired ) { } @ Override public boolean supportsReturnType ( MethodParameter returnType ) { } @ Override public void handleReturnValue ( Object returnValue , MethodParameter returnType , Message < ? > inputMessage ) throws Exception { } private String [ ] getDestinations ( Annotation annot , String inputDestination ) { } private final class SessionHeaderPostProcessor implements MessagePostProcessor { private final String sessionId ; public SessionHeaderPostProcessor ( String sessionId ) { } @ Override public Message < ? > postProcessMessage ( Message < ? > message ) { SimpMessageHeaderAccessor headers = SimpMessageHeaderAccessor . wrap ( message ) ; headers . setSessionId ( this . sessionId ) ; <START_BUG> return MessageBuilder . withPayloadAndHeaders ( message . getPayload ( ) , headers ) . build ( ) ; <END_BUG> } } @ Override public String toString ( ) { } }

Fix:
return MessageBuilder . withPayload ( message . getPayload ( ) ) . setHeaders ( headers ) . build ( ) ;
Buggy code:
public class BoardUtils { public static enum Colors { BLACK , BLUE , GREEN , PINK , RED , YELLOW , NONE ; public static BoardUtils . Colors getRandomColor ( RiskBoard board ) { } } public static void setup ( RiskBoard board , String fileName ) { } private static void setupRegions ( RiskBoard board , BufferedReader br ) throws IOException { } private static void setupRoutes ( RiskBoard board , BufferedReader br ) throws IOException { } public static void addConnection ( RiskBoard board , String from , String to ) { } private static void setupPlayers ( RiskBoard board , BufferedReader br ) throws IOException { } private static void addPlayers ( RiskBoard board , int num ) { } private int [ ] getRolls ( int num ) { } private static int rollDice ( int i ) { } private static boolean uniquePlayer ( RiskBoard board , BoardUtils . Colors playerColor ) { } public static void randomStart ( RiskBoard board ) { List < BoardUtils . Colors > players = board . getPlayerList ( ) ; List < Territory > territories = board . getTerritories ( ) ; if ( ( players . size ( ) ) < 3 ) { return ; } int count = 0 ; Collections . shuffle ( territories ) ; for ( Territory terra : territories ) { <START_BUG> board . setFaction ( terra . toString ( ) , players . get ( count ) ) ; <END_BUG> count ++ ; if ( count >= ( players . size ( ) ) ) { count = 0 ; } } } }

Fix:
board . setFaction ( terra . getName ( ) , players . get ( count ) ) ;
Buggy code:
public class TestUmlActor extends GenericObjectTestFixture { public TestUmlActor ( String arg0 ) { } public void testNamespace ( ) { <START_BUG> Object o = getFactory ( ) . create ( ACTOR ) ; <END_BUG> assertNotNull ( "Didn't<seq2seq4repair_space>create<seq2seq4repair_space>object" , o ) ; assertTrue ( "Should<seq2seq4repair_space>be<seq2seq4repair_space>a<seq2seq4repair_space>base" , ModelFacade . isABase ( o ) ) ; assertTrue ( "Should<seq2seq4repair_space>be<seq2seq4repair_space>a<seq2seq4repair_space>actor" , ModelFacade . isAActor ( o ) ) ; runTruthTests ( o ) ; } protected void initializeTruth ( ) { } }

Fix:
Object o = ModelFacade . getFacade ( ) . create ( ACTOR ) ;
Buggy code:
public class Client extends UnicastClient { public Client ( ) { } private static final class ClientImpl extends EndpointBasedClient { private static EndpointInternals epi = AccessController . doPrivileged ( new PrivilegedAction < EndpointInternals > ( ) { public EndpointInternals run ( ) { } } ) ; ClientImpl ( ) { } protected Endpoint getEndpoint ( SocketFactory factory , InvocationConstraints constraints ) throws UnsupportedConstraintException { } @ Override protected MessageDigest handshakeHashAlgorithm ( ) { } @ Override protected UnicastResponse readUnicastResponse ( InputStream in , ClassLoader defaultLoader , boolean verifyCodebaseIntegrity , ClassLoader verifierLoader , Collection context ) throws IOException , ClassNotFoundException { <START_BUG> return super . readUnicastResponse ( in , defaultLoader , grantDownloadPermission ( in , verifyCodebaseIntegrity ) , verifierLoader , context ) ; <END_BUG> } } }

Fix:
return super . readUnicastResponse ( in , defaultLoader , readAnnotationCertsGrantPerm ( in , verifyCodebaseIntegrity ) , verifierLoader , context ) ;
Buggy code:
public abstract class AbstractImageBuilder implements ICompilerRequestor { protected JavaBuilder javaBuilder ; protected IContainer outputFolder ; protected IContainer [ ] sourceFolders ; protected BuildNotifier notifier ; protected boolean hasSeparateOutputFolder ; protected NameEnvironment nameEnvironment ; protected Compiler compiler ; protected State newState ; protected WorkQueue workQueue ; protected ArrayList problemTypeLocations ; private boolean inCompiler ; public static int MAX_AT_ONCE = 1000 ; static final String ProblemMarkerTag = IJavaModelMarker . JAVA_MODEL_PROBLEM_MARKER ; protected AbstractImageBuilder ( JavaBuilder javaBuilder ) { } public void acceptResult ( CompilationResult result ) { } protected void cleanUp ( ) { } protected void compile ( String [ ] filenames , String [ ] initialTypeNames ) { } void compile ( CompilationUnit [ ] units , String [ ] initialTypeNames , String [ ] additionalFilenames ) { if ( ( units . length ) == 0 ) return ; <START_BUG> notifier . compiled ( units [ 0 ] ) ; <END_BUG> if ( ! ( problemTypeLocations . isEmpty ( ) ) ) { int toAdd = problemTypeLocations . size ( ) ; int length = ( additionalFilenames == null ) ? 0 : additionalFilenames . length ; if ( length == 0 ) additionalFilenames = new String [ toAdd ] ; else System . arraycopy ( additionalFilenames , 0 , ( additionalFilenames = new String [ length + toAdd ] ) , 0 , length ) ; for ( int i = 0 ; i < toAdd ; i ++ ) additionalFilenames [ ( length + i ) ] = ( ( String ) ( problemTypeLocations . get ( i ) ) ) ; } nameEnvironment . setNames ( initialTypeNames , additionalFilenames ) ; notifier . checkCancel ( ) ; try { inCompiler = true ; compiler . compile ( units ) ; } finally { inCompiler = false ; } notifier . checkCancel ( ) ; } protected void finishedWith ( char [ ] fileId , CompilationResult result , char [ ] [ ] additionalTypeNames ) throws CoreException { } protected RuntimeException internalException ( Throwable t ) { } protected Compiler newCompiler ( ) { } protected IMarker [ ] getProblemsFor ( IResource resource ) { } protected void removeProblemsFor ( IResource resource ) { } protected void storeProblemsFor ( IResource resource , IProblem [ ] problems ) { } protected void updateProblemsFor ( CompilationResult result ) { } protected IContainer getOutputFolder ( IPath packagePath ) throws CoreException { } protected boolean isClassFileChanged ( IFile file , String fileName , byte [ ] bytes , boolean isSecondaryType ) throws CoreException { } protected char [ ] writeClassFile ( ClassFile classFile , boolean isSecondaryType ) throws CoreException { } }

Fix:
notifier . aboutToCompile ( units [ 0 ] ) ;
Buggy code:
@ SuppressCodecs ( "Lucene3x" ) public class TestExpressionValueSource extends LuceneTestCase { DirectoryReader reader ; Directory dir ; @ Override public void setUp ( ) throws Exception { super . setUp ( ) ; dir = newDirectory ( ) ; IndexWriterConfig iwc = newIndexWriterConfig ( TEST_VERSION_CURRENT , new org . apache . lucene . analysis . MockAnalyzer ( random ( ) ) ) ; iwc . setMergePolicy ( newLogMergePolicy ( ) ) ; RandomIndexWriter iw = new RandomIndexWriter ( random ( ) , dir , iwc ) ; Document doc = new Document ( ) ; doc . add ( newStringField ( "id" , "1" , YES ) ) ; doc . add ( newTextField ( "body" , "some<seq2seq4repair_space>contents<seq2seq4repair_space>and<seq2seq4repair_space>more<seq2seq4repair_space>contents" , NO ) ) ; doc . add ( new NumericDocValuesField ( "popularity" , 5 ) ) ; iw . addDocument ( doc ) ; doc = new Document ( ) ; doc . add ( newStringField ( "id" , "2" , YES ) ) ; doc . add ( newTextField ( "body" , "another<seq2seq4repair_space>document<seq2seq4repair_space>with<seq2seq4repair_space>different<seq2seq4repair_space>contents" , NO ) ) ; doc . add ( new NumericDocValuesField ( "popularity" , 20 ) ) ; iw . addDocument ( doc ) ; doc = new Document ( ) ; doc . add ( newStringField ( "id" , "3" , YES ) ) ; doc . add ( newTextField ( "body" , "crappy<seq2seq4repair_space>contents" , NO ) ) ; doc . add ( new NumericDocValuesField ( "popularity" , 2 ) ) ; iw . addDocument ( doc ) ; iw . forceMerge ( 1 ) ; reader = iw . getReader ( ) ; <START_BUG> iw . close ( ) ; <END_BUG> } @ Override public void tearDown ( ) throws Exception { } public void testTypes ( ) throws Exception { } public void testRangeScorer ( ) throws Exception { } public void testEquals ( ) throws Exception { } }

Fix:
iw . shutdown ( ) ;