nus-yam/ex-repair huggingface dataset:
Buggy code:
public class MapGenDeeperRavine2 extends MapGenBase { private float [ ] field_75046_d = new float [ 1024 ] ; private static final String __OBFID = "CL_00000390" ; protected void func_151540_a ( long p_151540_1_ , int p_151540_3_ , int p_151540_4_ , Block [ ] p_151540_5_ , double p_151540_6_ , double p_151540_8_ , double p_151540_10_ , float p_151540_12_ , float p_151540_13_ , float p_151540_14_ , int p_151540_15_ , int p_151540_16_ , double p_151540_17_ , int minHeight ) { } protected void func_151538_a ( World p_151538_1_ , int p_151538_2_ , int p_151538_3_ , int p_151538_4_ , int p_151538_5_ , Block [ ] p_151538_6_ ) { if ( ( this . rand . nextInt ( 7 ) ) == 0 ) { double d0 = ( ( double ) ( ( p_151538_2_ * 16 ) + ( this . rand . nextInt ( 16 ) ) ) ) ; <START_BUG> double d1 = ( ( double ) ( ( this . rand . nextInt ( ( ( this . rand . nextInt ( 228 ) ) + 8 ) ) ) + 20 ) ) ; <END_BUG> double d2 = ( ( double ) ( ( p_151538_3_ * 16 ) + ( this . rand . nextInt ( 16 ) ) ) ) ; byte b0 = 1 ; for ( int i1 = 0 ; i1 < b0 ; ++ i1 ) { float f = ( ( this . rand . nextFloat ( ) ) * ( ( float ) ( Math . PI ) ) ) * 2.0F ; float f1 = ( ( ( this . rand . nextFloat ( ) ) - 0.5F ) * 2.0F ) // 8.0F ; float f2 = ( ( ( this . rand . nextFloat ( ) ) * 2.0F ) + ( this . rand . nextFloat ( ) ) ) * 2.0F ; this . func_151540_a ( this . rand . nextLong ( ) , p_151538_4_ , p_151538_5_ , p_151538_6_ , d0 , d1 , d2 , f2 , f , f1 , 0 , 0 , 3.0 , ( ( this . rand . nextInt ( 11 ) ) + 5 ) ) ; } } } protected boolean isOceanBlock ( Block [ ] data , int index , int x , int y , int z , int chunkX , int chunkZ ) { } private boolean isExceptionBiome ( BiomeGenBase biome ) { } private boolean isTopBlock ( Block [ ] data , int index , int x , int y , int z , int chunkX , int chunkZ ) { } protected void digBlock ( Block [ ] data , int index , int x , int y , int z , int chunkX , int chunkZ , boolean foundTop , int minHeight ) { } No newline ; at end ; of file ; }

Fix:
double d1 = ( ( double ) ( ( this . rand . nextInt ( 234 ) ) + 20 ) ) ;
Buggy code:
public class Driver { private static boolean _idle = true ; private static synchronized boolean claimIdle ( ) { } public static boolean getIdle ( ) { } public static void main ( String [ ] args ) { Settings settings = null ; try { settings = new Settings ( args ) ; } catch ( ParseException e ) { <START_BUG> System . err . println ( ( "org.batfish:<seq2seq4repair_space>Parsing<seq2seq4repair_space>command-line<seq2seq4repair_space>failed.<seq2seq4repair_space>Reason:<seq2seq4repair_space>" + ( e . getMessage ( ) ) ) ) ; <END_BUG> System . exit ( 1 ) ; } if ( settings . runInServiceMode ( ) ) { URI baseUri = UriBuilder . fromUri ( settings . getServiceUrl ( ) ) . port ( settings . getServicePort ( ) ) . build ( ) ; System . out . println ( String . format ( "Starting<seq2seq4repair_space>server<seq2seq4repair_space>at<seq2seq4repair_space>%s\n" , baseUri ) ) ; ResourceConfig rc = new ResourceConfig ( Service . class ) . register ( new JettisonFeature ( ) ) ; HttpServer _server = GrizzlyHttpServerFactory . createHttpServer ( baseUri , rc ) ; try { System . in . read ( ) ; } catch ( IOException ex ) { Logger . getLogger ( Driver . class . getName ( ) ) . log ( Level . SEVERE , null , ex ) ; } _server . shutdownNow ( ) ; } else if ( settings . canExecute ( ) ) { Driver . RunBatfish ( settings ) ; } } private static void makeIdle ( ) { } private static void RunBatfish ( Settings settings ) { } public static List < String > RunBatfish ( String [ ] args ) { } }

Fix:
System . err . println ( ( "batfish:<seq2seq4repair_space>Parsing<seq2seq4repair_space>command-line<seq2seq4repair_space>failed.<seq2seq4repair_space>Reason:<seq2seq4repair_space>" + ( e . getMessage ( ) ) ) ) ;
Buggy code:
public final class ChecksumRandomAccessFile extends RandomAccessFile { private static enum ChecksumOperations { LOG , VERIFY ; } static final int LogBuffSz_ = 16 ; private static final int checksumSz_ = 1 << ( ChecksumRandomAccessFile . LogBuffSz_ ) ; public static final int BuffSz_ = 1 << ( ChecksumRandomAccessFile . LogBuffSz_ ) ; static final long BuffMask_ = ~ ( ( ( long ) ( ChecksumRandomAccessFile . BuffSz_ ) ) - 1L ) ; private boolean dirty_ ; private boolean closed_ ; private long curr_ ; private long lo_ ; private long hi_ ; private byte [ ] buff_ ; private long maxHi_ ; private boolean hitEOF_ ; private long diskPos_ ; private String filename_ ; public ChecksumRandomAccessFile ( File file , String mode ) throws IOException { } public ChecksumRandomAccessFile ( File file , String mode , int size ) throws IOException { } public ChecksumRandomAccessFile ( String name , String mode ) throws IOException { } public ChecksumRandomAccessFile ( String name , String mode , int size ) throws FileNotFoundException { } private void init ( String name , int size ) { } public void close ( ) throws IOException { } public void flush ( ) throws IOException { } private void doChecksumOperation ( ChecksumRandomAccessFile . ChecksumOperations chksumOps ) throws IOException { int buffSz = buff_ . length ; long currentPosition = ( ( ( diskPos_ ) % buffSz ) == 0 ) ? ( diskPos_ ) - 1 : diskPos_ ; long chunk = ( currentPosition // buffSz ) + 1 ; int chksumChunks = ( buff_ . length ) // ( ChecksumRandomAccessFile . checksumSz_ ) ; long pos = ( chunk == 0 ) ? 0 : ( chunk - 1 ) * buffSz ; int startOffset = 0 ; int chksumChunkId = ( ( int ) ( ( chksumChunks * ( chunk - 1 ) ) + 1 ) ) ; do { <START_BUG> int fId = SequenceFile . getFileId ( filename_ ) ; <END_BUG> switch ( chksumOps ) { case LOG : ChecksumManager . instance ( filename_ ) . logChecksum ( fId , ( chksumChunkId ++ ) , buff_ , startOffset , ChecksumRandomAccessFile . checksumSz_ ) ; break ; case VERIFY : ChecksumManager . instance ( filename_ ) . validateChecksum ( filename_ , ( chksumChunkId ++ ) , buff_ , startOffset , ChecksumRandomAccessFile . checksumSz_ ) ; break ; } pos += ChecksumRandomAccessFile . checksumSz_ ; startOffset += ChecksumRandomAccessFile . checksumSz_ ; } while ( pos < currentPosition ) ; } private void flushBuffer ( ) throws IOException { } private int fillBuffer ( ) throws IOException { } public void seek ( long pos ) throws IOException { } public long getFilePointer ( ) { } public long length ( ) throws IOException { } public int read ( ) throws IOException { } public int read ( byte [ ] b ) throws IOException { } public int read ( byte [ ] b , int off , int len ) throws IOException { } public void write ( int b ) throws IOException { } public void write ( byte [ ] b ) throws IOException { } public void write ( byte [ ] b , int off , int len ) throws IOException { } private int writeAtMost ( byte [ ] b , int off , int len ) throws IOException { } public static void main ( String [ ] args ) throws Throwable { } }

Fix:
int fId = ChecksumManager . getFileId ( filename_ ) ;
Buggy code:
public class FlyActivity extends BaseActivity { private View throttleBackgroundV ; private View throttleRL ; private View throttleTouchableRL ; private View throttleControlLL ; private TextView throttleControlPercentageTV ; private View disarmedLayout ; private SeekBar phoneHeading ; private SeekBar phonePitch ; private SeekBar phoneRoll ; private SeekBar droneHeading ; private SeekBar dronePitch ; private SeekBar droneRoll ; private SeekBar dataSentYaw ; private SeekBar dataSentPitch ; private SeekBar dataSentRoll ; private SeekBar delaySeekBar ; private TextView delayTV ; private boolean armed = DroneService . ARMED_DEFAULT ; @ Override protected void onCreate ( Bundle savedInstanceState ) { } @ Override protected void onResume ( ) { } private void updateArmedLayer ( ) { } @ Override protected void onPause ( ) { } @ Override public boolean onCreateOptionsMenu ( Menu menu ) { } @ Override public boolean onOptionsItemSelected ( MenuItem item ) { } public void onEventMainThread ( DroneSensorData data ) { Drone drone = KnownDronesDatabase . getSelectedDrone ( this ) ; DroneCalibrationData dcd = CalibrationDatabase . getDroneCalibrationData ( this , drone . nickName ) ; <START_BUG> droneHeading . setProgress ( ( ( ( ( int ) ( data . getHeading ( ) ) ) + 180 ) + ( ( int ) ( dcd . getHeadingDifference ( ) ) ) ) ) ; <END_BUG> dronePitch . setProgress ( ( ( ( int ) ( data . getPitch ( ) ) ) + 180 ) ) ; droneRoll . setProgress ( ( ( ( int ) ( data . getRoll ( ) ) ) + 180 ) ) ; } public void onEventMainThread ( PhoneSensorsData data ) { } public void onEventMainThread ( PhoneOutputData data ) { } public void onEventMainThread ( ActualArmedData armed ) { } public void onEventMainThread ( DelayData delay ) { } private void updateThrottleLabel ( ) { } @ Override public boolean onKeyDown ( int keyCode , KeyEvent event ) { } private void shutDownAndQuitActivity ( ) { } private void setThrottleToZero ( ) { } }

Fix:
droneHeading . setProgress ( ( ( ( ( ( ( int ) ( data . getHeading ( ) ) ) + 180 ) + 360 ) + ( ( int ) ( dcd . getHeadingDifference ( ) ) ) ) % 360 ) ) ;
Buggy code:
public final class ZXingMIDlet extends MIDlet { private static final int ALERT_TIMEOUT_MS = 5 * 1000 ; private Canvas canvas ; private Player player ; private VideoControl videoControl ; private Alert confirmation ; private Alert alert ; private Menu history ; private Vector resultHistory ; Displayable getCanvas ( ) { } Player getPlayer ( ) { } VideoControl getVideoControl ( ) { } static MultimediaManager buildMultimediaManager ( ) { } protected void startApp ( ) throws MIDletStateChangeException { } void splashDone ( ) { } private static Player createPlayer ( ) throws IOException , MediaException { } protected void pauseApp ( ) { } protected void destroyApp ( boolean unconditional ) { } void stop ( ) { } void historyRequest ( ) { } private void showOpenURL ( String title , String display , final String uri ) { } private void showAlert ( String title , String text ) { } void showError ( Throwable t ) { } void showError ( String message ) { } private void showAlert ( Alert alert ) { } void barcodeAction ( ParsedResult result ) { ParsedResultType type = result . getType ( ) ; if ( type . equals ( URI ) ) { String uri = ( ( com . google . zxing . client . result . URIParsedResult ) ( result ) ) . getURI ( ) ; showOpenURL ( "Open<seq2seq4repair_space>Web<seq2seq4repair_space>Page?" , uri , uri ) ; } else if ( type . equals ( EMAIL_ADDRESS ) ) { EmailAddressParsedResult emailResult = ( ( EmailAddressParsedResult ) ( result ) ) ; showOpenURL ( "Compose<seq2seq4repair_space>E-mail?" , emailResult . getEmailAddress ( ) , emailResult . getMailtoURI ( ) ) ; } else if ( type . equals ( SMS ) ) { SMSParsedResult smsResult = ( ( SMSParsedResult ) ( result ) ) ; <START_BUG> showOpenURL ( "Compose<seq2seq4repair_space>SMS?" , smsResult . getNumber ( ) , smsResult . getSMSURI ( ) ) ; <END_BUG> } else if ( type . equals ( PRODUCT ) ) { ProductParsedResult productResult = ( ( ProductParsedResult ) ( result ) ) ; String uri = "http:////www.upcdatabase.com//item.asp?upc=" + ( productResult . getNormalizedProductID ( ) ) ; showOpenURL ( "Look<seq2seq4repair_space>Up<seq2seq4repair_space>Barcode<seq2seq4repair_space>Online?" , productResult . getProductID ( ) , uri ) ; } else if ( type . equals ( TEL ) ) { TelParsedResult telResult = ( ( TelParsedResult ) ( result ) ) ; showOpenURL ( "Dial<seq2seq4repair_space>Number?" , telResult . getNumber ( ) , telResult . getTelURI ( ) ) ; } else { showAlert ( "Barcode<seq2seq4repair_space>Detected" , result . getDisplayResult ( ) ) ; } } void itemRequest ( ) { } void handleDecodedText ( Result theResult ) { } }

Fix:
showOpenURL ( "Compose<seq2seq4repair_space>SMS?" , smsResult . getNumbers ( ) [ 0 ] , smsResult . getSMSURI ( ) ) ;
Buggy code:
public class ToolFactory { public static ICodeFormatter createCodeFormatter ( ) { } public static ICodeFormatter createDefaultCodeFormatter ( Map options ) { } public static IClassFileDisassembler createDefaultClassFileDisassembler ( ) { } public static IClassFileReader createDefaultClassFileReader ( String fileName , int decodingFlag ) { } public static IClassFileReader createDefaultClassFileReader ( IClassFile classfile , int decodingFlag ) { } public static IClassFileReader createDefaultClassFileReader ( String zipFileName , String zipEntryName , int decodingFlag ) { } public static IScanner createScanner ( boolean tokenizeComments , boolean tokenizeWhiteSpace , boolean assertMode , boolean recordLineSeparator ) { <START_BUG> Scanner scanner = new Scanner ( tokenizeComments , tokenizeWhiteSpace , false , assertMode ) ; <END_BUG> scanner . recordLineSeparator = recordLineSeparator ; return scanner ; } }

Fix:
Scanner scanner = new Scanner ( tokenizeComments , tokenizeWhiteSpace , false , assertMode , null ) ;
Buggy code:
public class MarkupResourceStream implements IResourceStream { private static final long serialVersionUID = 1846489965076612828L ; private final IResourceStream resourceStream ; private final ContainerInfo containerInfo ; private final Class < ? extends MarkupContainer > markupClass ; public MarkupResourceStream ( final IResourceStream resourceStream , final ContainerInfo containerInfo , final Class < ? extends MarkupContainer > markupClass ) { } public final void close ( ) throws IOException { } public final String getContentType ( ) { } public final InputStream getInputStream ( ) throws ResourceStreamNotFoundException { } public final Locale getLocale ( ) { } public final Time lastModifiedTime ( ) { } public final long length ( ) { } <START_BUG> public final void setLocale ( Locale locale ) { <END_BUG> resourceStream . setLocale ( locale ) ; } public final Class < ? extends MarkupContainer > getMarkupClass ( ) { } public final ContainerInfo getContainerInfo ( ) { } @ Override public final String toString ( ) { } }

Fix:
public final void setLocale ( final Locale locale ) {
Buggy code:
public class OrientEdgeIterator extends OLazyWrapperIterator < OrientEdge > { private final OrientVertex sourceVertex ; private final OrientVertex targetVertex ; private final OPair < Direction , String > connection ; private final String [ ] labels ; public OrientEdgeIterator ( final OrientVertex iSourceVertex , final OrientVertex iTargetVertex , final Iterator < ? > iterator , final OPair < Direction , String > connection , final String [ ] iLabels , final int iSize ) { } @ Override public OrientEdge createWrapper ( final Object iObject ) { if ( iObject instanceof OrientEdge ) return ( ( OrientEdge ) ( iObject ) ) ; final OIdentifiable rec = ( ( OIdentifiable ) ( iObject ) ) ; final ORecord record = rec . getRecord ( ) ; if ( record == null ) { OLogManager . instance ( ) . warn ( this , "Record<seq2seq4repair_space>(%s)<seq2seq4repair_space>is<seq2seq4repair_space>null" , rec ) ; return null ; } if ( ! ( record instanceof ODocument ) ) { OLogManager . instance ( ) . warn ( this , "Found<seq2seq4repair_space>a<seq2seq4repair_space>record<seq2seq4repair_space>(%s)<seq2seq4repair_space>that<seq2seq4repair_space>is<seq2seq4repair_space>not<seq2seq4repair_space>an<seq2seq4repair_space>edge.<seq2seq4repair_space>Record:<seq2seq4repair_space>%s" , rec , record ) ; return null ; } final ODocument value = rec . getRecord ( ) ; if ( value == null ) { return null ; } OClass immutableSchema = ODocumentInternal . getImmutableSchemaClass ( value ) ; if ( immutableSchema == null ) { ODatabaseDocument db = value . getDatabaseIfDefined ( ) ; if ( db == null ) { return null ; } db . getMetadata ( ) . reload ( ) ; immutableSchema = ODocumentInternal . getImmutableSchemaClass ( value ) ; if ( immutableSchema == null ) { return null ; } } final OrientEdge edge ; if ( immutableSchema . isSubClassOf ( CLASS_NAME ) ) { if ( ( connection . getKey ( ) ) == ( Direction . OUT ) ) edge = new OrientEdge ( this . sourceVertex . getGraph ( ) , this . sourceVertex . getIdentity ( ) , rec . getIdentity ( ) , connection . getValue ( ) ) ; else edge = new OrientEdge ( this . sourceVertex . getGraph ( ) , rec . getIdentity ( ) , this . sourceVertex . getIdentity ( ) , connection . getValue ( ) ) ; } else if ( immutableSchema . isSubClassOf ( OrientEdgeType . CLASS_NAME ) ) { <START_BUG> edge = new OrientEdge ( this . sourceVertex . getGraph ( ) , rec . getIdentity ( ) ) ; <END_BUG> } else throw new IllegalStateException ( ( ( "Invalid<seq2seq4repair_space>content<seq2seq4repair_space>found<seq2seq4repair_space>while<seq2seq4repair_space>iterating<seq2seq4repair_space>edges,<seq2seq4repair_space>value<seq2seq4repair_space>'" + value ) + "'<seq2seq4repair_space>is<seq2seq4repair_space>not<seq2seq4repair_space>an<seq2seq4repair_space>edge" ) ) ; if ( ( this . sourceVertex . settings . isUseVertexFieldsForEdgeLabels ( ) ) || ( edge . isLabeled ( labels ) ) ) return edge ; return null ; } public boolean filter ( final OrientEdge iObject ) { } }

Fix:
edge = new OrientEdge ( this . sourceVertex . getGraph ( ) , rec . getIdentity ( ) , connection . getValue ( ) ) ;
Buggy code:
public class Converter { public static Object convert ( Object value , Class < ? > toType ) { if ( value == null ) { value = "" ; } else if ( toType . isAssignableFrom ( value . getClass ( ) ) ) { return value ; } else if ( ( toType . equals ( float . class ) ) || ( toType . equals ( Float . class ) ) ) { return new Float ( Converter . getFloat ( value ) ) ; } else if ( ( toType . equals ( double . class ) ) || ( toType . equals ( Double . class ) ) ) { return new Double ( Converter . getDouble ( value ) ) ; } else if ( toType . equals ( String . class ) ) { return Converter . getString ( value ) ; } else if ( ( toType . equals ( int . class ) ) || ( toType . equals ( Integer . class ) ) ) { return Integer . valueOf ( Converter . getInt ( value ) ) ; } else if ( ( toType . equals ( char . class ) ) || ( toType . equals ( Character . class ) ) ) { <START_BUG> return new Character ( Converter . getChar ( value ) ) ; <END_BUG> } else if ( ( toType . equals ( long . class ) ) || ( toType . equals ( Long . class ) ) ) { return Long . valueOf ( Converter . getLong ( value ) ) ; } else if ( ( toType . equals ( boolean . class ) ) || ( toType . equals ( Boolean . class ) ) ) { return Boolean . valueOf ( Converter . getBoolean ( value ) ) ; } else if ( toType . equals ( Date . class ) ) { return Converter . getDate ( value ) ; } else if ( toType . equals ( Calendar . class ) ) { return Converter . getCalendar ( value ) ; } else if ( toType . equals ( Class . class ) ) { try { return Class . forName ( value . toString ( ) ) ; } catch ( Exception e ) { } } return value ; } public static Calendar getCalendar ( Object date , Calendar defaultValue ) { } public static Calendar getCalendar ( Object o ) { } public static Date getDate ( Object date ) { } public static Date getDate ( Object date , Date defaultValue ) { } public static float getFloat ( Object o , float defaultValue ) { } public static float getFloat ( Object o ) { } public static double getDouble ( Object o , double defaultValue ) { } public static double getDouble ( Object o ) { } public static boolean getBoolean ( Object o ) { } public static boolean getBoolean ( Object o , boolean defaultValue ) { } public static int getInt ( Object o , int defaultValue ) { } public static char getChar ( Object o ) { } public static char getChar ( Object o , char defaultValue ) { } public static int getInt ( Object o ) { } public static long getLong ( Object o , long defaultValue ) { } public static long getLong ( Object o ) { } public static String formatDate ( Date date , String pattern ) { } public static String formatDate ( java . sql . Date date , String pattern ) { } public static String formatDate ( String date , String pattern ) { } public static String formatDate ( Calendar date , String pattern ) { } public static String formatCalendar ( Calendar date , String pattern ) { } public static String getString ( Object o , String defaultValue ) { } public static String insertLineBreaks ( String v , String insertion ) { } public static String getString ( Object o ) { } }

Fix:
return Character . valueOf ( Converter . getChar ( value ) ) ;
Buggy code:
public class TestComplexPhraseQuery extends LuceneTestCase { Directory rd ; Analyzer analyzer ; TestComplexPhraseQuery . DocData [ ] docsContent = new TestComplexPhraseQuery . DocData [ ] { new TestComplexPhraseQuery . DocData ( "john<seq2seq4repair_space>smith" , "1" , "developer" ) , new TestComplexPhraseQuery . DocData ( "johathon<seq2seq4repair_space>smith" , "2" , "developer" ) , new TestComplexPhraseQuery . DocData ( "john<seq2seq4repair_space>percival<seq2seq4repair_space>smith" , "3" , "designer" ) , new TestComplexPhraseQuery . DocData ( "jackson<seq2seq4repair_space>waits<seq2seq4repair_space>tom" , "4" , "project<seq2seq4repair_space>manager" ) } ; private IndexSearcher searcher ; private IndexReader reader ; String defaultFieldName = "name" ; boolean inOrder = true ; public void testComplexPhrases ( ) throws Exception { } public void testUnOrderedProximitySearches ( ) throws Exception { } private void checkBadQuery ( String qString ) { } private void checkMatches ( String qString , String expectedVals ) throws Exception { } public void testFieldedQuery ( ) throws Exception { } @ Override public void setUp ( ) throws Exception { super . setUp ( ) ; analyzer = new org . apache . lucene . analysis . MockAnalyzer ( random ( ) ) ; rd = newDirectory ( ) ; IndexWriter w = new IndexWriter ( rd , newIndexWriterConfig ( TEST_VERSION_CURRENT , analyzer ) ) ; for ( int i = 0 ; i < ( docsContent . length ) ; i ++ ) { Document doc = new Document ( ) ; doc . add ( newTextField ( "name" , docsContent [ i ] . name , YES ) ) ; doc . add ( newTextField ( "id" , docsContent [ i ] . id , YES ) ) ; doc . add ( newTextField ( "role" , docsContent [ i ] . role , YES ) ) ; w . addDocument ( doc ) ; } <START_BUG> w . close ( ) ; <END_BUG> reader = DirectoryReader . open ( rd ) ; searcher = newSearcher ( reader ) ; } @ Override public void tearDown ( ) throws Exception { } static class DocData { String name ; String id ; String role ; public DocData ( String name , String id , String role ) { } } }

Fix:
w . shutdown ( ) ;
Buggy code:
public class UnitsActivity extends AppCompatActivity implements AdapterView . OnItemClickListener { private Toolbar toolbar ; private RadioButton radioButton ; final Context context = this ; UnitAdapter mUnitAdapter ; ListView mainListView ; @ Override protected void onCreate ( Bundle savedInstanceState ) { } @ Override public boolean onCreateOptionsMenu ( Menu menu ) { getMenuInflater ( ) . inflate ( menu_main , menu ) ; Button addUnitBtn = ( ( Button ) ( findViewById ( addBtn ) ) ) ; addUnitBtn . setOnClickListener ( new View . OnClickListener ( ) { @ Override public void onClick ( View view ) { final Dialog d = new Dialog ( context ) ; d . setContentView ( add_dialog ) ; d . setTitle ( "Add<seq2seq4repair_space>unit" ) ; d . setCancelable ( true ) ; final EditText editUnit = ( ( EditText ) ( d . findViewById ( editTextUnit ) ) ) ; final RadioGroup radioDimensionGroup = ( ( RadioGroup ) ( d . findViewById ( radio_group ) ) ) ; LinearLayout . LayoutParams layoutParams = new RadioGroup . LayoutParams ( LayoutParams . WRAP_CONTENT , LayoutParams . WRAP_CONTENT ) ; String [ ] dimensions = getResources ( ) . getStringArray ( dimensions_array ) ; for ( int i = 0 ; i < ( dimensions . length ) ; i ++ ) { RadioButton rb = new RadioButton ( context ) ; rb . setText ( dimensions [ i ] ) ; rb . setId ( i ) ; radioDimensionGroup . addView ( rb , i , layoutParams ) ; } final EditText editFactor = ( ( EditText ) ( d . findViewById ( editTextFactor ) ) ) ; Button addBtn = ( ( Button ) ( d . findViewById ( button1 ) ) ) ; addBtn . setOnClickListener ( new View . OnClickListener ( ) { public void onClick ( View v ) { String unitName = editUnit . getText ( ) . toString ( ) ; int rgid = radioDimensionGroup . getCheckedRadioButtonId ( ) ; radioButton = ( ( RadioButton ) ( d . findViewById ( rgid ) ) ) ; String unitDimension = radioButton . getText ( ) . toString ( ) ; Float unitFactor = Float . valueOf ( editFactor . getText ( ) . toString ( ) ) ; <START_BUG> Unit addunit = new Unit ( unitName , unitDimension , unitFactor , getApplicationContext ( ) ) ; <END_BUG> DataBaseHelper myDbHelper = new DataBaseHelper ( context ) ; myDbHelper . addUnit ( addunit ) ; mUnitAdapter . updateData ( myDbHelper . getAllUnits ( ) ) ; myDbHelper . close ( ) ; d . dismiss ( ) ; } } ) ; d . show ( ) ; } } ) ; return true ; } @ Override public boolean onOptionsItemSelected ( MenuItem item ) { } @ Override public void onItemClick ( AdapterView < ? > parent , View view , int position , long id ) { } }

Fix:
Unit addunit = new Unit ( unitName , unitDimension , unitFactor , context ) ;
Buggy code:
public class Login extends AppCompatActivity implements View . OnClickListener , AsyncResponse { EditText userNameEditText ; EditText passwordEditText ; Button loginB ; Button signUpB ; DBcontroller dbController ; TextView forgotPasswordTV ; boolean userCanLogIn ; private static final String TAG_FLG = "flag" ; private ErrorHandler err ; private ProgressDialog progress ; @ Override protected void onCreate ( Bundle savedInstanceState ) { } public void onClick ( View v ) { } private boolean validateLoginFields ( ) { } public void sendDataToDBController ( ) { } @ Override public void preProcess ( ) { } @ Override public void handleResponse ( String jsonStr ) { progress . dismiss ( ) ; Log . d ( "handleResponse" , jsonStr ) ; if ( jsonStr != null ) { try { JSONObject jsonObj = new JSONObject ( jsonStr ) ; String flg = jsonObj . getString ( Login . TAG_FLG ) ; switch ( flg ) { case "user" : userNameEditText . setError ( "This<seq2seq4repair_space>user<seq2seq4repair_space>isn't<seq2seq4repair_space>exists" ) ; break ; case "password" : passwordEditText . setError ( "This<seq2seq4repair_space>password<seq2seq4repair_space>is<seq2seq4repair_space>incorrect" ) ; break ; case "already<seq2seq4repair_space>connected" : passwordEditText . setError ( "user<seq2seq4repair_space>already<seq2seq4repair_space>connected" ) ; break ; case "verified" : <START_BUG> startActivity ( new Intent ( this , MainScreen . class ) ) ; <END_BUG> break ; } } catch ( JSONException e ) { e . printStackTrace ( ) ; } } else { Log . d ( "ServiceHandler" , "Couldn't<seq2seq4repair_space>get<seq2seq4repair_space>any<seq2seq4repair_space>data<seq2seq4repair_space>from<seq2seq4repair_space>the<seq2seq4repair_space>url" ) ; } } }

Fix:
startActivity ( new Intent ( this , MainMapsActivity . class ) ) ;
Buggy code:
public class Branch { private BlockBank plugin ; private final Logger log ; private final Bank bank ; private final String name ; private ConfigurationSection config = null ; public Branch ( Bank bank , String name ) { } public void loadConfiguration ( ) { } @ Override public String toString ( ) { } public boolean isPlayerInBranch ( OfflinePlayer offlinePlayer ) { } public Bank getBank ( ) { } public String getName ( ) { } public String getTitle ( ) { } public String getWorld ( ) { } public void setTitle ( String title ) { } public void setWorld ( String world ) { } public boolean isAnnouncements ( ) { } public void setAnnouncements ( boolean announcements ) { } public int getOpenHour ( ) { } public void setOpenHour ( int openHour ) { } public int getCloseHour ( ) { } public void setCloseHour ( int closeHour ) { } public boolean isOpen ( ) { World world = plugin . getServer ( ) . getWorld ( this . config . getString ( "world" ) ) ; int hour = Utils . GetWorldHour ( world . getTime ( ) ) ; <START_BUG> return ( hour >= ( this . config . getInt ( "openHour" ) ) ) && ( hour <= ( this . config . getInt ( "closeHour" ) ) ) ; <END_BUG> } public boolean isClosed ( ) { } }

Fix:
return ( hour >= ( this . config . getInt ( "openHour" ) ) ) && ( hour < ( this . config . getInt ( "closeHour" ) ) ) ;
Buggy code:
public class BiopaxElement extends PathwayElement { public BiopaxElement ( ) { } private Document document ; private Random random = new Random ( ) ; private Map < String , BiopaxNode > biopax ; private Map < Class < ? extends BiopaxNode > , Map < String , Integer > > ordinal ; private void refresh ( ) { } public void removeElement ( BiopaxNode e ) { } public boolean hasReferences ( BiopaxNode e ) { } public BiopaxNode getElement ( String id ) { } public void addPassiveElement ( Element e ) { } public void addElement ( BiopaxNode elm ) { Document d = getDocument ( ) ; Element root = d . getRootElement ( ) ; if ( ! ( root . getNamespace ( ) . equals ( RDF ) ) ) { throw new IllegalArgumentException ( ( "Invalid<seq2seq4repair_space>root<seq2seq4repair_space>element:<seq2seq4repair_space>" + root ) ) ; } if ( ( ( elm . getId ( ) ) == null ) || ( ! ( isUniqueID ( elm . getId ( ) ) ) ) ) { elm . setId ( getUniqueID ( ) ) ; } for ( BiopaxNode e : getElements ( ) ) { if ( e . getName ( ) . equalsIgnoreCase ( elm . getName ( ) ) ) { if ( e instanceof PublicationXref ) { BiopaxProperty bp1 = e . getProperty ( ID . name ( ) ) ; BiopaxProperty bp2 = elm . getProperty ( ID . name ( ) ) ; <START_BUG> if ( ( ( bp1 != null ) && ( bp2 != null ) ) && ( bp1 . getValue ( ) . equals ( bp2 . getValue ( ) ) ) ) { <END_BUG> log . trace ( "Equal<seq2seq4repair_space>pubmed<seq2seq4repair_space>id!" ) ; elm . setId ( e . getId ( ) ) ; return ; } } log . trace ( "Equal<seq2seq4repair_space>properties!" ) ; if ( e . propertyEquals ( elm ) ) { elm . setId ( e . getId ( ) ) ; return ; } } } d . getRootElement ( ) . addContent ( elm . getWrapped ( ) ) ; biopax . put ( elm . getId ( ) , elm ) ; addToOrdinal ( elm ) ; } private void addToOrdinal ( BiopaxNode e ) { } private void rebuildOrdinal ( ) { } public int getOrdinal ( BiopaxNode bpe ) { } public Collection < BiopaxNode > getElements ( ) { } private boolean isUniqueID ( String id ) { } private String getUniqueID ( ) { } private Document getDocument ( ) { } public Document getBiopax ( ) { } public void setBiopax ( Document d ) { } public void mergeBiopax ( BiopaxElement bpnew ) { } @ Override public void copyValuesFrom ( PathwayElement src ) { } }

Fix:
if ( ( ( ! ( bp1 . getValue ( ) . equals ( "" ) ) ) && ( ! ( bp2 . getValue ( ) . equals ( "" ) ) ) ) && ( bp1 . getValue ( ) . equals ( bp2 . getValue ( ) ) ) ) {
Buggy code:
public class AnnotationsValuesEditingSupport extends EditingSupport { private AnnotationsView annotationsView ; private TreeViewer treeViewer ; private TextCellEditor textCellEditor ; private CheckboxCellEditor checkboxCellEditor ; private ComboBoxCellEditor comboBoxCellEditor ; private ClassDialogCellEditor classDialogCellEditor ; private AnnotationArrayCellEditor annotationArrayCellEditor ; public AnnotationsValuesEditingSupport ( AnnotationsView annotationsView , TreeViewer treeViewer ) { } @ Override protected boolean canEdit ( Object element ) { } @ Override protected CellEditor getCellEditor ( Object element ) { } @ Override protected Object getValue ( Object element ) { } private Object getValueForClass ( Class < ? > aClass ) { } private Object getValueForClass ( Class < ? > aClass , IAnnotatable annotatedElement ) { } private Object getValueForMethod ( Method method ) { } private Object getValueForMethod ( Method method , IAnnotatable annotatedElement ) throws JavaModelException { } private Object getDefaultValueForMethod ( Class < ? > returnType ) { } @ Override protected void setValue ( Object element , Object value ) { } private void setValueForClass ( Class < ? extends Annotation > annotationClass , Boolean annotate ) throws CoreException { } private org . eclipse . jdt . core . dom . Annotation getAnnotation ( AST ast , Class < ? extends Annotation > annotationClass , List < MemberValuePair > memberValuePairs ) { } private void setValueForClass ( Class < ? extends Annotation > annotationClass , Boolean annotate , IJavaElement javaElement , IAnnotationAttributeInitializer annotationAttributeInitializer ) throws CoreException { } private List < MemberValuePair > getMemberValuePairs ( IAnnotationAttributeInitializer annotationAttributeInitializer , IJavaElement javaElement , AST ast , Class < ? extends Annotation > annotationClass ) { } private void setValueForMethod ( Method method , Object value ) throws CoreException { } private void setValueForMethod ( Method method , Object value , IJavaElement javaElement ) throws CoreException { } private ASTNode getMemberValuePairValue ( AST ast , Method method , Object value ) { } private MemberValuePair getMemberValuePair ( AST ast , Method method , Object value ) { } private void executeChange ( IProgressMonitor monitor , Change change ) { if ( change == null ) { return ; } IUndoManager manager = RefactoringCore . getUndoManager ( ) ; boolean successful = false ; Change undoChange = null ; try { change . initializeValidationData ( monitor ) ; RefactoringStatus valid = change . isValid ( monitor ) ; if ( valid . isOK ( ) ) { manager . aboutToPerformChange ( change ) ; undoChange = change . perform ( monitor ) ; successful = true ; } } catch ( CoreException ce ) { JAXWSUIPlugin . log ( ce . getStatus ( ) ) ; } finally { manager . changePerformed ( change , successful ) ; } if ( undoChange != null ) { undoChange . initializeValidationData ( monitor ) ; manager . addUndo ( undoChange . getName ( ) , undoChange ) ; } <START_BUG> annotationsView . refresh ( ) ; <END_BUG> } }

Fix:
annotationsView . refreshLabels ( ) ;
Buggy code:
public class CXFCreationUIPlugin extends AbstractUIPlugin { public static final String PLUGIN_ID = "org.eclipse.jst.ws.cxf.creation.ui" ; private static CXFCreationUIPlugin plugin ; public CXFCreationUIPlugin ( ) { } public void start ( BundleContext context ) throws Exception { } public void stop ( BundleContext context ) throws Exception { } public static CXFCreationUIPlugin getDefault ( ) { } public static ImageDescriptor getImageDescriptor ( String path ) { } public static void logMessage ( int severity , String message ) { } public static void log ( IStatus status ) { } public static void log ( Throwable exception ) { <START_BUG> CXFCreationUIPlugin . log ( new Status ( IStatus . ERROR , CXFCreationUIPlugin . PLUGIN_ID , exception . getLocalizedMessage ( ) , exception ) ) ; <END_BUG> } }

Fix:
CXFCreationUIPlugin . log ( new Status ( IStatus . ERROR , CXFCreationUIPlugin . PLUGIN_ID , exception . toString ( ) , exception ) ) ;
Buggy code:
public class Duration extends AbstractTimeValue { private static final long serialVersionUID = 1L ; public static final Duration MAXIMUM = Duration . milliseconds ( Long . MAX_VALUE ) ; public static final Duration NONE = Duration . milliseconds ( 0 ) ; public static final Duration ONE_DAY = Duration . days ( 1 ) ; public static final Duration ONE_HOUR = Duration . hours ( 1 ) ; public static final Duration ONE_MINUTE = Duration . minutes ( 1 ) ; public static final Duration ONE_SECOND = Duration . seconds ( 1 ) ; public static final Duration ONE_WEEK = Duration . days ( 7 ) ; private static final Pattern pattern = Pattern . compile ( "([0-9]+([.,][0-9]+)?)\\s+(millisecond|second|minute|hour|day)s?" , Pattern . CASE_INSENSITIVE ) ; public static Duration benchmark ( final ICode code , final Logger log ) { } public static Duration benchmark ( final Runnable code ) { } public static Duration days ( final double days ) { } public static Duration days ( final int days ) { } public static Duration elapsed ( final Time start ) { } public static Duration hours ( final double hours ) { } public static Duration hours ( final int hours ) { } public static Duration milliseconds ( final double milliseconds ) { } public static Duration milliseconds ( final long milliseconds ) { } public static Duration minutes ( final double minutes ) { } public static Duration minutes ( final int minutes ) { } public static Duration seconds ( final double seconds ) { } public static Duration seconds ( final int seconds ) { } public static Duration valueOf ( final long time ) { } public static Duration valueOf ( final String string ) throws StringValueConversionException { } public static Duration valueOf ( final String string , final Locale locale ) throws StringValueConversionException { } protected Duration ( final long milliseconds ) { } public Duration add ( final Duration duration ) { } public final double days ( ) { } public final double hours ( ) { } public final double minutes ( ) { } public final double seconds ( ) { } public final void sleep ( ) { } public Duration subtract ( final Duration that ) { } <START_BUG> public void wait ( Object object ) { <END_BUG> try { object . wait ( getMilliseconds ( ) ) ; } catch ( InterruptedException e ) { throw new RuntimeException ( e ) ; } } @ Override public String toString ( ) { } public String toString ( final Locale locale ) { } private String unitString ( final double value , final String units , final Locale locale ) { } }

Fix:
public void wait ( final Object object ) {
Buggy code:
public class AssertStatement extends Statement { public static final ChildPropertyDescriptor EXPRESSION_PROPERTY = new ChildPropertyDescriptor ( AssertStatement . class , "expression" , Expression . class , ASTNode . MANDATORY , ASTNode . CYCLE_RISK ) ; public static final ChildPropertyDescriptor MESSAGE_PROPERTY = new ChildPropertyDescriptor ( AssertStatement . class , "message" , Expression . class , ASTNode . OPTIONAL , ASTNode . CYCLE_RISK ) ; private static final List PROPERTY_DESCRIPTORS ; public static List propertyDescriptors ( int apiLevel ) { } private Expression expression = null ; private Expression optionalMessageExpression = null ; AssertStatement ( AST ast ) { } final List internalStructuralPropertiesForType ( int apiLevel ) { } final ASTNode internalGetSetChildProperty ( ChildPropertyDescriptor property , boolean get , ASTNode child ) { } final int getNodeType0 ( ) { } ASTNode clone0 ( AST target ) { } final boolean subtreeMatch0 ( ASTMatcher matcher , Object other ) { } void accept0 ( ASTVisitor visitor ) { } public Expression getExpression ( ) { if ( ( this . expression ) == null ) { <START_BUG> synchronized ( this . ast ) { <END_BUG> if ( ( this . expression ) == null ) { preLazyInit ( ) ; this . expression = new SimpleName ( this . ast ) ; postLazyInit ( this . expression , AssertStatement . EXPRESSION_PROPERTY ) ; } } } return expression ; } public void setExpression ( Expression expression ) { } public Expression getMessage ( ) { } public void setMessage ( Expression expression ) { } int memSize ( ) { } int treeSize ( ) { } }

Fix:
synchronized ( this ) {
Buggy code:
public class TimeSeriesLogger implements PropertyChangeListener { private static final String separator = ",<seq2seq4repair_space>" ; private int logInterval = 2 ; private File file ; private UndoableEdit lastEdit ; private final UndoManager undoManager ; private HousePart actedPart ; private Object stateValue ; private String oldLine = null ; private String oldCameraPosition = null ; private String noteString = "" ; private boolean noteEditedFlag = false ; private boolean sceneEditedFlag = false ; private volatile boolean solarCalculationFinished = false ; private ArrayList < Building > buildings = new ArrayList < Building > ( ) ; private Object analysisRequester ; private Object analysisRequesterCopy ; private HousePart analyzedPart ; private PrintWriter writer ; private boolean firstLine = true ; private static final DecimalFormat ENERGY_FORMAT = new DecimalFormat ( "######.##" ) ; public TimeSeriesLogger ( final int logInterval ) { } private String getBuildingSolarEnergies ( ) { } private void log ( ) { } public void closeLog ( ) { } @ Override public void propertyChange ( final PropertyChangeEvent evt ) { } public boolean isEdited ( ) { } public void resetEditFlags ( ) { } public void start ( ) { final String timestamp = new SimpleDateFormat ( "yyyy-MM-dd-HH-mm-ss" ) . format ( Calendar . getInstance ( ) . getTime ( ) ) ; file = new File ( LoggerUtil . getLogFolder ( ) , ( timestamp + ".json" ) ) ; try { writer = new PrintWriter ( file ) ; } catch ( Exception e ) { e . printStackTrace ( ) ; JOptionPane . showMessageDialog ( MainFrame . getInstance ( ) , e . getMessage ( ) , "Logger<seq2seq4repair_space>Error" , JOptionPane . WARNING_MESSAGE ) ; } writer . write ( "{\n\"Activities\":<seq2seq4repair_space>[\n" ) ; final Thread t = new Thread ( "Time<seq2seq4repair_space>Series<seq2seq4repair_space>Logger" ) { @ Override public void run ( ) { while ( true ) { try { Thread . sleep ( ( 1000 * ( logInterval ) ) ) ; } catch ( final InterruptedException e ) { e . printStackTrace ( ) ; } try { log ( ) ; } catch ( Throwable t ) { t . printStackTrace ( ) ; <START_BUG> JOptionPane . showMessageDialog ( MainFrame . getInstance ( ) , ( ( "Error<seq2seq4repair_space>occured<seq2seq4repair_space>in<seq2seq4repair_space>logging:<seq2seq4repair_space>" + t ) + "\nPlease<seq2seq4repair_space>restart<seq2seq4repair_space>Energy3D." ) , "Logging<seq2seq4repair_space>Error" , JOptionPane . ERROR_MESSAGE ) ; <END_BUG> } } } } ; t . setPriority ( Thread . MIN_PRIORITY ) ; t . start ( ) ; } }

Fix:
JOptionPane . showMessageDialog ( MainFrame . getInstance ( ) , ( ( "Error<seq2seq4repair_space>occured<seq2seq4repair_space>in<seq2seq4repair_space>logging:<seq2seq4repair_space>" + ( t . getMessage ( ) ) ) + "\nPlease<seq2seq4repair_space>restart<seq2seq4repair_space>Energy3D." ) , "Logging<seq2seq4repair_space>Error" , JOptionPane . ERROR_MESSAGE ) ;
Buggy code:
public class Stats implements Saveable { protected int level ; protected int livesLeft ; protected int strength ; protected int agility ; protected int intellect ; protected int hardiness ; protected int experience ; protected int movement ; protected int hpCurrent ; protected int mpCurrent ; protected int defense ; protected int offense ; public Stats ( int levels , int livesLeft , int strength , int agility , int intellect , int hardiness , int experience , int movement , int hpCurrent , int mpCurrent , int defense , int offense ) { } public int getLevels ( ) { } public int getLivesLeft ( ) { } public int getStrength ( ) { } public int getAgility ( ) { } public int getIntellect ( ) { } public int getHardiness ( ) { } public int getExperience ( ) { } public int getMovement ( ) { } public int gethpCurrent ( ) { } public int getmpCurrent ( ) { } public int getOffense ( ) { } public int getDefense ( ) { } public void setLevelUps ( int levels ) { } public void setLivesLeft ( int nextLives ) { } public void setStrength ( int nextStr ) { } public void setAgility ( int nextAgi ) { } public void setIntellect ( int nextInt ) { } public void setHardiness ( int nextHard ) { } public void setExperience ( int nextExp ) { } public void setMovement ( int nextMove ) { } public void sethpCurrent ( int nextHP ) { } public void setmpCurrent ( int nextMP ) { } public void setDefense ( int nextDef ) { } public void setOffense ( int nextOff ) { } public void modLivesLeft ( int livesAdded ) { } public void modStrength ( int strAdded ) { } public void modAgility ( int agiAdded ) { } public void modIntellect ( int intAdded ) { } public void modHardiness ( int hardAdded ) { } public void modExperience ( int expAdded ) { } public void modMovement ( int moveAdded ) { } public void modhpCurrent ( int hpAdded ) { } public void modmpCurrent ( int mpAdded ) { } public void modOffense ( int offAdded ) { } public void modDefense ( int defAdded ) { } public void mergeStats ( Stats modifier ) { } public Stats inverted ( ) { <START_BUG> return new Stats ( ( ( level ) * ( - 1 ) ) , ( ( livesLeft ) * ( - 1 ) ) , ( ( strength ) * ( - 1 ) ) , ( ( agility ) * ( - 1 ) ) , ( ( intellect ) * ( - 1 ) ) , ( ( hardiness ) * ( - 1 ) ) , ( ( experience ) * ( - 1 ) ) , ( ( movement ) * ( - 1 ) ) , ( ( hpCurrent ) * ( - 1 ) ) , ( ( mpCurrent ) * ( - 1 ) ) , ( ( offense ) * ( - 1 ) ) , ( ( defense ) * ( - 1 ) ) ) ; <END_BUG> } protected boolean verifyBounds ( int value ) { } public String toXML ( ) { } private void modLevel ( int levels ) { } }

Fix:
return new Stats ( ( ( level ) * ( - 1 ) ) , ( ( livesLeft ) * ( - 1 ) ) , ( ( strength ) * ( - 1 ) ) , ( ( agility ) * ( - 1 ) ) , ( ( intellect ) * ( - 1 ) ) , ( ( hardiness ) * ( - 1 ) ) , ( ( experience ) * ( - 1 ) ) , ( ( movement ) * ( - 1 ) ) , ( ( hpCurrent ) * ( - 1 ) ) , ( ( mpCurrent ) * ( - 1 ) ) , ( ( defense ) * ( - 1 ) ) , ( ( offense ) * ( - 1 ) ) ) ;
Buggy code:
public class XSModelGroupImpl implements XSModelGroup { public static final short MODELGROUP_CHOICE = 101 ; public static final short MODELGROUP_SEQUENCE = 102 ; public static final short MODELGROUP_ALL = 103 ; public short fCompositor ; public XSParticleDecl [ ] fParticles = null ; public int fParticleCount = 0 ; public boolean isEmpty ( ) { } public int minEffectiveTotalRange ( ) { } private int minEffectiveTotalRangeAllSeq ( ) { } private int minEffectiveTotalRangeChoice ( ) { } public int maxEffectiveTotalRange ( ) { } private int maxEffectiveTotalRangeAllSeq ( ) { } private int maxEffectiveTotalRangeChoice ( ) { } private String fDescription = null ; public String toString ( ) { if ( ( fDescription ) == null ) { StringBuffer buffer = new StringBuffer ( ) ; if ( ( fCompositor ) == ( XSModelGroupImpl . MODELGROUP_ALL ) ) buffer . append ( "all(" ) ; else buffer . append ( '(' ) ; <START_BUG> if ( ( fParticles . length ) > 0 ) <END_BUG> buffer . append ( fParticles [ 0 ] . toString ( ) ) ; for ( int i = 1 ; i < ( fParticleCount ) ; i ++ ) { if ( ( fCompositor ) == ( XSModelGroupImpl . MODELGROUP_CHOICE ) ) buffer . append ( '|' ) ; else buffer . append ( ',' ) ; buffer . append ( fParticles [ i ] . toString ( ) ) ; } buffer . append ( ')' ) ; fDescription = buffer . toString ( ) ; } return fDescription ; } public void reset ( ) { } public short getType ( ) { } public String getName ( ) { } public String getNamespace ( ) { } public short getCompositor ( ) { } public XSObjectList getParticles ( ) { } public XSAnnotation getAnnotation ( ) { } public XSNamespaceItem getNamespaceItem ( ) { } }

Fix:
if ( ( fParticleCount ) > 0 )
Buggy code:
public class MergeFilterA extends FilterFramework { private PipedInputStream InputReadPort2 = new PipedInputStream ( ) ; public MergeFilterA ( HashSet < Integer > codesSet ) { } public void run ( ) { int MeasurementLength = 8 ; int IdLength = 4 ; byte databyte = 0 ; int bytesread = 0 ; long measurement ; long measurement2 ; int id ; int id2 ; int i ; byte [ ] id_bytes ; byte [ ] data_bytes ; byte [ ] id_bytes2 ; byte [ ] data_bytes2 ; int byteswritten = 0 ; System . out . print ( ( ( "\n" + ( this . getName ( ) ) ) + "::Middle<seq2seq4repair_space>Reading<seq2seq4repair_space>" ) ) ; while ( true ) { try { id2 = 0 ; id_bytes2 = new byte [ 4 ] ; for ( i = 0 ; i < IdLength ; i ++ ) { databyte = ReadFilterInputPort2 ( ) ; id2 = id2 | ( databyte & 255 ) ; if ( i != ( IdLength - 1 ) ) { id2 = id2 << 8 ; } id_bytes2 [ i ] = databyte ; bytesread ++ ; } id = 0 ; id_bytes = new byte [ 4 ] ; for ( i = 0 ; i < IdLength ; i ++ ) { databyte = ReadFilterInputPort ( ) ; id = id | ( databyte & 255 ) ; if ( i != ( IdLength - 1 ) ) { id = id << 8 ; } id_bytes [ i ] = databyte ; bytesread ++ ; } measurement2 = 0 ; data_bytes2 = new byte [ 8 ] ; for ( i = 0 ; i < MeasurementLength ; i ++ ) { databyte = ReadFilterInputPort2 ( ) ; measurement2 = measurement2 | ( databyte & 255 ) ; if ( i != ( MeasurementLength - 1 ) ) { measurement2 = measurement2 << 8 ; } data_bytes2 [ i ] = databyte ; bytesread ++ ; } measurement = 0 ; data_bytes = new byte [ 8 ] ; for ( i = 0 ; i < MeasurementLength ; i ++ ) { databyte = ReadFilterInputPort ( ) ; measurement = measurement | ( databyte & 255 ) ; if ( i != ( MeasurementLength - 1 ) ) { measurement = measurement << 8 ; } data_bytes [ i ] = databyte ; bytesread ++ ; } for ( i = 0 ; i < 4 ; i ++ ) { <START_BUG> WriteFilterOutputPort ( id_bytes [ i ] ) ; <END_BUG> byteswritten ++ ; } for ( i = 0 ; i < 8 ; i ++ ) { WriteFilterOutputPort ( data_bytes2 [ i ] ) ; byteswritten ++ ; } if ( id == 2 ) { for ( i = 0 ; i < 4 ; i ++ ) { WriteFilterOutputPort ( id_bytes [ i ] ) ; byteswritten ++ ; } for ( i = 0 ; i < 8 ; i ++ ) { WriteFilterOutputPort ( data_bytes [ i ] ) ; byteswritten ++ ; } } } catch ( EndOfStreamException e ) { ClosePorts ( ) ; ClosePorts2 ( ) ; System . out . print ( ( ( ( ( ( "\n" + ( this . getName ( ) ) ) + "::Middle<seq2seq4repair_space>Exiting;<seq2seq4repair_space>bytes<seq2seq4repair_space>read:<seq2seq4repair_space>" ) + bytesread ) + "<seq2seq4repair_space>bytes<seq2seq4repair_space>written:<seq2seq4repair_space>" ) + byteswritten ) ) ; break ; } } } byte ReadFilterInputPort2 ( ) throws EndOfStreamException { } void ClosePorts2 ( ) { } void Connect ( AltConverterA Filter ) { } void Connect ( TempConverterA Filter ) { } public PipedInputStream getInputReadPort2 ( ) { } }

Fix:
WriteFilterOutputPort ( id_bytes2 [ i ] ) ;