nus-yam/ex-repair huggingface dataset:
Buggy code:
public class Database { private static final String persistenceUnitName = "persistanceunit" ; private EntityManagerFactory emf = null ; private EntityManager em = null ; public Database ( ) throws RuntimeException { } public synchronized void open ( ) { } public synchronized void close ( ) { } public void createScenario ( ScenarioBean scenarioBean ) { } public void createScenario ( Scenario scenario ) { } public void createSequence ( SequenceBean sequenceBean ) { } public void updateScenario ( String name , ArrayList < MySequence > seqs ) { } public void updateScenarioResult ( String name , List < MyResult > res ) { } public Scenario getScenarioByName ( String name ) { } public ArrayList < Scenario > getScenarios ( ) { } public void addConsumer ( String name ) { } public void addConsumer ( Consumer c ) { } public void addProvider ( String name ) { if ( ( ! ( name . equals ( "" ) ) ) && ( ( getProviderByName ( name ) ) == null ) ) { Provider toAdd = new Provider ( ) ; toAdd . setName ( name ) ; toAdd . setSequences ( null ) ; <START_BUG> System . out . println ( ( "Creating<seq2seq4repair_space>Consumer<seq2seq4repair_space>" + ( toAdd . getId ( ) ) ) ) ; <END_BUG> em . getTransaction ( ) . begin ( ) ; em . persist ( toAdd ) ; em . getTransaction ( ) . commit ( ) ; } } public void addProvider ( Provider p ) { } public void addResult ( MyResult rt ) { } public void deleteConsumer ( Consumer toDelete ) { } public void deleteResult ( long id ) { } public void deleteProvider ( Provider toDelete ) { } public void deleteScenarios ( ) { } public void deleteAllSequence ( ) { } public void deleteSequence ( MySequence toDelete ) { } public Consumer getConsumerById ( long id ) { } public Consumer getConsumerByName ( String name ) { } public Provider getProviderById ( long id ) { } public Provider getProviderByName ( String name ) { } public MyResult getResultById ( long id ) { } public ArrayList < Consumer > getConsumers ( ) { } public ArrayList < Provider > getProviders ( ) { } public ArrayList < MySequence > getSequences ( ) { } public ArrayList < MySequence > getSequenceByConsumer ( Consumer c ) { } public ArrayList < MySequence > getSequenceByProvider ( Provider p ) { } public MySequence getSequenceByParam ( int begin , int dataSize , int end , int processTime , int requestPerSecond , Provider p , Consumer c ) { } public void hardReset ( ) { } }

Fix:
System . out . println ( ( "Creating<seq2seq4repair_space>Provider<seq2seq4repair_space>" + ( toAdd . getId ( ) ) ) ) ;
Buggy code:
public class GoStimulusAction implements TreeModelPrereqs { public String toString ( ) { <START_BUG> return Localizer . localize ( "Tree" , "Stimulus->Action" ) ; <END_BUG> } public Object getRoot ( ) { } public void setRoot ( Object r ) { } public Object getChild ( Object parent , int index ) { } public int getChildCount ( Object parent ) { } public int getIndexOfChild ( Object parent , Object child ) { } public Vector getChildren ( Object parent ) { } public boolean isLeaf ( Object node ) { } public void valueForPathChanged ( TreePath path , Object newValue ) { } public void addTreeModelListener ( TreeModelListener l ) { } public void removeTreeModelListener ( TreeModelListener l ) { } public Vector getPrereqs ( ) { } public Vector getProvidedTypes ( ) { } }

Fix:
return Localizer . localize ( "Tree" , "misc.stimulus.action" ) ;
Buggy code:
public class TestRollingUpdates extends LuceneTestCase { @ Test public void testRollingUpdates ( ) throws Exception { Random random = new Random ( random ( ) . nextLong ( ) ) ; <START_BUG> final MockDirectoryWrapper dir = newDirectory ( ) ; <END_BUG> dir . setCheckIndexOnClose ( false ) ; final LineFileDocs docs = new LineFileDocs ( random , defaultCodecSupportsDocValues ( ) ) ; if ( ( ! ( "Lucene3x" . equals ( Codec . getDefault ( ) . getName ( ) ) ) ) && ( random ( ) . nextBoolean ( ) ) ) { Codec . setDefault ( _TestUtil . alwaysPostingsFormat ( new org . apache . lucene . codecs . memory . MemoryPostingsFormat ( random ( ) . nextBoolean ( ) , random . nextFloat ( ) ) ) ) ; } final IndexWriter w = new IndexWriter ( dir , newIndexWriterConfig ( TEST_VERSION_CURRENT , new org . apache . lucene . analysis . MockAnalyzer ( random ( ) ) ) ) ; final int SIZE = atLeast ( 20 ) ; int id = 0 ; IndexReader r = null ; final int numUpdates = ( ( int ) ( SIZE * ( 2 + ( TEST_NIGHTLY ? 200 * ( random ( ) . nextDouble ( ) ) : 5 * ( random ( ) . nextDouble ( ) ) ) ) ) ) ; if ( VERBOSE ) { System . out . println ( ( "TEST:<seq2seq4repair_space>numUpdates=" + numUpdates ) ) ; } for ( int docIter = 0 ; docIter < numUpdates ; docIter ++ ) { final Document doc = docs . nextDoc ( ) ; final String myID = "" + id ; if ( id == ( SIZE - 1 ) ) { id = 0 ; } else { id ++ ; } ( ( Field ) ( doc . getField ( "docid" ) ) ) . setStringValue ( myID ) ; w . updateDocument ( new Term ( "docid" , myID ) , doc ) ; if ( ( docIter >= SIZE ) && ( ( random ( ) . nextInt ( 50 ) ) == 17 ) ) { if ( r != null ) { r . close ( ) ; } final boolean applyDeletions = random ( ) . nextBoolean ( ) ; r = w . getReader ( applyDeletions ) ; assertTrue ( ( ( ( ( ( "applyDeletions=" + applyDeletions ) + "<seq2seq4repair_space>r.numDocs()=" ) + ( r . numDocs ( ) ) ) + "<seq2seq4repair_space>vs<seq2seq4repair_space>SIZE=" ) + SIZE ) , ( ( ! applyDeletions ) || ( ( r . numDocs ( ) ) == SIZE ) ) ) ; } } if ( r != null ) { r . close ( ) ; } w . commit ( ) ; assertEquals ( SIZE , w . numDocs ( ) ) ; w . close ( ) ; docs . close ( ) ; _TestUtil . checkIndex ( dir ) ; dir . close ( ) ; } public void testUpdateSameDoc ( ) throws Exception { } static class IndexingThread extends Thread { final LineFileDocs docs ; final IndexWriter writer ; final int num ; public IndexingThread ( LineFileDocs docs , IndexWriter writer , int num ) { } public void run ( ) { } } }

Fix:
final BaseDirectoryWrapper dir = newDirectory ( ) ;
Buggy code:
public class MarkAsNotSpamAction extends FrameAction implements SelectionListener { public MarkAsNotSpamAction ( AbstractFrameController frameController ) { } public void actionPerformed ( ActionEvent evt ) { <START_BUG> FolderCommandReference [ ] r = ( ( org . columba . mail . gui . frame . AbstractMailFrameController ) ( getFrameController ( ) ) ) . getTableSelection ( ) ; <END_BUG> r [ 0 ] . setMarkVariant ( MARK_AS_NOTSPAM ) ; MarkMessageCommand c = new MarkMessageCommand ( r ) ; processor . addOp ( c ) ; } public void selectionChanged ( SelectionChangedEvent e ) { } }

Fix:
FolderCommandReference [ ] r = ( ( org . columba . mail . gui . frame . AbstractMailFrameController ) ( getFrameMediator ( ) ) ) . getTableSelection ( ) ;
Buggy code:
public class LockscreenSetupActivity extends BaseActivity implements Lockscreen . LockscreenCallbacks , LockscreenSetupView { public static final String EXTRA_LOCKSCREEN_TYPE = "extra_lockscreen_type" ; private static final long SUCCESS_DELAY = 500L ; @ InjectView ( id . container ) FrameLayout mContainer ; @ Inject LockscreenSetupPresenter mPresenter ; @ Inject @ VideoLock IntPreference mVideoLock ; private Lockscreen mLockscreen ; private String mInput ; @ Override protected void onCreate ( Bundle savedInstanceState ) { } @ Override public boolean onOptionsItemSelected ( MenuItem item ) { } @ Override protected void onDestroy ( ) { } private void tintTextViews ( ViewGroup parent ) { <START_BUG> int color = getResources ( ) . getColor ( textPrimary ) ; <END_BUG> int N = parent . getChildCount ( ) ; for ( int i = 0 ; i < N ; i ++ ) { View child = parent . getChildAt ( i ) ; if ( child instanceof TextView ) { ( ( TextView ) ( child ) ) . setTextColor ( color ) ; } else if ( child instanceof ImageView ) { ( ( ImageView ) ( child ) ) . getDrawable ( ) . setColorFilter ( color , SRC_IN ) ; } else if ( child instanceof ViewGroup ) { tintTextViews ( ( ( ViewGroup ) ( child ) ) ) ; } else if ( child . getTag ( ) . equals ( "inverse" ) ) { child . getBackground ( ) . setColorFilter ( color , SRC_IN ) ; } } } @ Override public void onSuccess ( ) { } @ Override public void onFailure ( ) { } @ Override public void setupUI ( Lockscreen lockscreen ) { } @ Override public Activity getActivity ( ) { } @ Override public void showSnackBar ( String text ) { } @ Override public void showLoading ( ) { } @ Override public void hideLoading ( ) { } @ Override public void closeKeyboard ( ) { } @ Override protected Object [ ] getModules ( ) { } }

Fix:
int color = getResources ( ) . getColor ( textLockSetup ) ;
Buggy code:
public class SSTableColumnScanner { private static final Logger LOG = LoggerFactory . getLogger ( SSTableColumnScanner . class ) ; private final Serializer serializer = Serializer . instance ; private long end = - 1 ; private DataInputStream input ; private long pos = 0 ; private Version version = null ; public SSTableColumnScanner ( InputStream is , long end , Descriptor . Version version ) { } public void close ( ) { } void deserialize ( Subscriber < ? super AtomWritable > subscriber ) { <START_BUG> SSTableColumnScanner . LOG . info ( "current<seq2seq4repair_space>pos({})<seq2seq4repair_space>done<seq2seq4repair_space>({})" , pos , ( hasMore ( ) ? "has<seq2seq4repair_space>more" : "no<seq2seq4repair_space>more" ) ) ; <END_BUG> while ( hasMore ( ) ) { try { int keysize = input . readUnsignedShort ( ) ; long rowSize = 2 ; byte [ ] rowKey = new byte [ keysize ] ; input . readFully ( rowKey ) ; rowSize += keysize ; if ( version . hasRowSizeAndColumnCount ) { rowSize += ( input . readLong ( ) ) + 8 ; this . pos += rowSize ; } @ SuppressWarnings ( { "unused" , "UnusedAssignment" } ) int localDeletionTime = input . readInt ( ) ; rowSize += 4 ; long markedForDeleteAt = input . readLong ( ) ; rowSize += 8 ; int columnCount = Integer . MAX_VALUE ; if ( version . hasRowSizeAndColumnCount ) { columnCount = input . readInt ( ) ; } try { rowSize += deserializeColumns ( subscriber , rowKey , markedForDeleteAt , columnCount , input ) ; } catch ( CorruptColumnException e ) { subscriber . onError ( new IOException ( ( "Error<seq2seq4repair_space>in<seq2seq4repair_space>row<seq2seq4repair_space>for<seq2seq4repair_space>key<seq2seq4repair_space>" + ( instance . getString ( ByteBuffer . wrap ( rowKey ) ) ) ) , e ) ) ; } if ( ! ( version . hasRowSizeAndColumnCount ) ) { this . pos += rowSize ; } } catch ( IOException e ) { subscriber . onError ( e ) ; break ; } } } long deserializeColumns ( Subscriber < ? super AtomWritable > subscriber , byte [ ] rowKey , long deletedAt , int count , DataInput columns ) throws IOException { } @ Override protected void finalize ( ) throws Throwable { } boolean hasMore ( ) { } public Observable < AtomWritable > observable ( ) { } public void skipUnsafe ( long bytes ) throws IOException { } }

Fix:
SSTableColumnScanner . LOG . debug ( "current<seq2seq4repair_space>pos({})<seq2seq4repair_space>done<seq2seq4repair_space>({})" , pos , ( hasMore ( ) ? "has<seq2seq4repair_space>more" : "no<seq2seq4repair_space>more" ) ) ;
Buggy code:
public class BrokerFactoryValue extends PluginValue { public static final String KEY = "BrokerFactory" ; private static final List _aliases = new ArrayList ( ) ; private static final List _prefixes = new ArrayList ( 2 ) ; public static void addDefaultAlias ( String alias , String cls ) { if ( BrokerFactoryValue . _aliases . contains ( alias ) ) { <START_BUG> BrokerFactoryValue . _aliases . set ( BrokerFactoryValue . _aliases . indexOf ( alias ) , cls ) ; <END_BUG> } else { BrokerFactoryValue . _aliases . add ( alias ) ; BrokerFactoryValue . _aliases . add ( cls ) ; } } public static Object get ( ConfigurationProvider cp ) { } public static void set ( ConfigurationProvider cp , String value ) { } public BrokerFactoryValue ( ) { } }

Fix:
BrokerFactoryValue . _aliases . set ( ( ( BrokerFactoryValue . _aliases . indexOf ( alias ) ) + 1 ) , cls ) ;
Buggy code:
public class Game { public static final int MAX_TURNS = 10 ; public static final int MAX_PLAYERS = 4 ; public static final int NB_CARDS_SECRET_HAND = 6 ; private Player [ ] players = null ; private LinkedList < Turn > turns = null ; private int indexPlayerBetWinner = - 1 ; private int indexPlayerNextBet = 0 ; private Deck deck = null ; public Game ( Player [ ] players , Deck deck ) throws GameException { } private void createHands ( ) throws EmptyDeckException { } public Player [ ] getPlayers ( ) { } public Suit getGameSuit ( ) { } public Player getBestPlayerBet ( ) { } public ArrayList < Bet > getPlayableBets ( Player player ) { } public void addBet ( Bet bet , Player player ) throws GameException { } public Player getNextPlayerToBet ( ) { } public boolean areBetsFinished ( ) { } public boolean isValidBet ( Bet bet , Player player ) { } private int findIndexPlayer ( Player player ) { } public Player [ ] getWinners ( ) { } public Card [ ] createSecretHand ( ) { } public void newTurn ( ) throws TurnException { } private Turn currentTurn ( ) { } public Suit getTurnSuit ( ) { } public void playCard ( Player player , Card card ) throws GameException { } public boolean isTurnFinished ( ) { } public Player getTurnWinner ( ) throws TurnException { } public Player nextPlayer ( ) { } public void newHandAfterSecretBet ( Player player , ArrayList < Card > cards ) throws GameException { } public boolean isGameFinished ( ) { <START_BUG> return ( this . turns . size ( ) ) == ( Game . MAX_TURNS ) ; <END_BUG> } }

Fix:
return ( this . turns . size ( ) ) > ( Game . MAX_TURNS ) ;
Buggy code:
public class HtmlFormatter extends HighlightingPluginBase implements SolrFormatter { public Formatter getFormatter ( String fieldName , SolrParams params ) { } @ Override public String getDescription ( ) { <START_BUG> return "GapFragmenter" ; <END_BUG> } @ Override public String getVersion ( ) { } @ Override public String getSourceId ( ) { } @ Override public String getSource ( ) { } }

Fix:
return "HtmlFormatter" ;
Buggy code:
public final class SarSubsystemAdd extends AbstractSubsystemAdd < SarSubsystemElement > { private static final long serialVersionUID = 7065406809630792436L ; public SarSubsystemAdd ( ) { } protected < P > void applyUpdate ( UpdateContext updateContext , UpdateResultHandler < ? super Void , P > resultHandler , P param ) { } @ Override protected void applyUpdateBootAction ( final BootUpdateContext updateContext ) { <START_BUG> updateContext . addDeploymentProcessor ( STRUCTURE , STRUCTURE_SAR_DEPLOY_CHECK , new SarSubDeploymentProcessor ( ) ) ; <END_BUG> updateContext . addDeploymentProcessor ( DEPENDENCIES , DEPENDENCIES_SAR_MODULE , new SarModuleDependencyProcessor ( ) ) ; updateContext . addDeploymentProcessor ( PARSE , PARSE_SERVICE_DEPLOYMENT , new ServiceDeploymentParsingProcessor ( ) ) ; updateContext . addDeploymentProcessor ( INSTALL , INSTALL_SERVICE_DEPLOYMENT , new ParsedServiceDeploymentProcessor ( ) ) ; } @ Override protected SarSubsystemElement createSubsystemElement ( ) { } }

Fix:
updateContext . addDeploymentProcessor ( STRUCTURE , STRUCTURE_SAR_SUB_DEPLOY_CHECK , new SarSubDeploymentProcessor ( ) ) ;
Buggy code:
public class TestBulgarianAnalyzer extends BaseTokenStreamTestCase { public void testResourcesAvailable ( ) { } public void testStopwords ( ) throws IOException { } public void testCustomStopwords ( ) throws IOException { } public void testReusableTokenStream ( ) throws IOException { } public void testBasicExamples ( ) throws IOException { } public void testWithStemExclusionSet ( ) throws IOException { } public void testRandomStrings ( ) throws Exception { <START_BUG> checkRandomData ( random ( ) , new BulgarianAnalyzer ( TEST_VERSION_CURRENT ) , ( 10000 * ( RANDOM_MULTIPLIER ) ) ) ; <END_BUG> } }

Fix:
checkRandomData ( random ( ) , new BulgarianAnalyzer ( TEST_VERSION_CURRENT ) , ( 1000 * ( RANDOM_MULTIPLIER ) ) ) ;
Buggy code:
public class ValueServer { public static final int DIGEST_MODE = 0 ; public static final int REPLAY_MODE = 1 ; public static final int UNIFORM_MODE = 2 ; public static final int EXPONENTIAL_MODE = 3 ; public static final int GAUSSIAN_MODE = 4 ; public static final int CONSTANT_MODE = 5 ; private int mode = 5 ; private URL valuesFileURL = null ; private double mu = 0.0 ; private double sigma = 0.0 ; private EmpiricalDistribution empiricalDistribution = null ; private BufferedReader filePointer = null ; private final RandomDataImpl randomData ; public ValueServer ( ) { } @ Deprecated public ValueServer ( RandomDataImpl randomData ) { } public ValueServer ( RandomGenerator generator ) { } public double getNext ( ) throws IOException , MathIllegalArgumentException , MathIllegalStateException { } public void fill ( double [ ] values ) throws IOException , MathIllegalArgumentException , MathIllegalStateException { } public double [ ] fill ( int length ) throws IOException , MathIllegalArgumentException , MathIllegalStateException { } public void computeDistribution ( ) throws IOException , NullArgumentException , ZeroException { } public void computeDistribution ( int binCount ) throws IOException , NullArgumentException , ZeroException { } public int getMode ( ) { } public void setMode ( int mode ) { } public URL getValuesFileURL ( ) { } public void setValuesFileURL ( String url ) throws MalformedURLException { } public void setValuesFileURL ( URL url ) { } public EmpiricalDistribution getEmpiricalDistribution ( ) { } public void resetReplayFile ( ) throws IOException { } public void closeReplayFile ( ) throws IOException { } public double getMu ( ) { } public void setMu ( double mu ) { } public double getSigma ( ) { } public void setSigma ( double sigma ) { } public void reSeed ( long seed ) { } private double getNextDigest ( ) throws MathIllegalStateException { } private double getNextReplay ( ) throws IOException , MathIllegalStateException { String str = null ; if ( ( filePointer ) == null ) { resetReplayFile ( ) ; } if ( ( str = filePointer . readLine ( ) ) == null ) { closeReplayFile ( ) ; resetReplayFile ( ) ; if ( ( str = filePointer . readLine ( ) ) == null ) { throw new MathIllegalStateException ( LocalizedFormats . URL_CONTAINS_NO_DATA , valuesFileURL ) ; } } <START_BUG> return Double . valueOf ( str ) . doubleValue ( ) ; <END_BUG> } private double getNextUniform ( ) throws MathIllegalArgumentException { } private double getNextExponential ( ) throws MathIllegalArgumentException { } private double getNextGaussian ( ) throws MathIllegalArgumentException { } }

Fix:
return Double . parseDouble ( str ) ;
Buggy code:
public class LongID extends BaseID { private static final long serialVersionUID = 4049072748317914423L ; Long value = null ; public static class LongNamespace extends Namespace { private static final long serialVersionUID = - 1580533392719331665L ; public LongNamespace ( ) { } <START_BUG> public ID createInstance ( Class [ ] argTypes , Object [ ] args ) throws IDCreateException { <END_BUG> return new LongID ( this , ( ( Long ) ( args [ 0 ] ) ) ) ; } public String getScheme ( ) { } } protected LongID ( Namespace n , Long v ) { } protected LongID ( Namespace n , long v ) { } protected int namespaceCompareTo ( BaseID o ) { } protected boolean namespaceEquals ( BaseID o ) { } protected String namespaceGetName ( ) { } protected int namespaceHashCode ( ) { } protected URI namespaceToURI ( ) throws URISyntaxException { } public long longValue ( ) { } }

Fix:
public ID createInstance ( Object [ ] args ) throws IDCreateException {
Buggy code:
public final class JOrphanUtils { private JOrphanUtils ( ) { } public static String [ ] split ( String splittee , String splitChar , boolean truncate ) { } public static String [ ] split ( String splittee , String splitChar ) { } public static String [ ] split ( String splittee , String delims , String def ) { } private static final String SPACES = "<seq2seq4repair_space>" ; private static final int SPACES_LEN = JOrphanUtils . SPACES . length ( ) ; public static StringBuffer rightAlign ( StringBuffer in , int len ) { } public static StringBuffer leftAlign ( StringBuffer in , int len ) { } public static String booleanToString ( boolean value ) { } public static String booleanToSTRING ( boolean value ) { } public static Boolean valueOf ( boolean value ) { } public static String replaceFirst ( String source , String search , String replace ) { } public static String replaceAllChars ( String source , char search , String replace ) { } public static String substitute ( final String input , final String pattern , final String sub ) { } public static String trim ( final String input , final String delims ) { } public static byte [ ] getByteArraySlice ( byte [ ] array , int begin , int end ) { } public static void closeQuietly ( InputStream is ) { } public static void closeQuietly ( OutputStream os ) { } public static void closeQuietly ( Writer wr ) { } public static void closeQuietly ( Reader rd ) { } public static void closeQuietly ( Socket sock ) { } public static void closeQuietly ( ServerSocket sock ) { } public static boolean startsWith ( byte [ ] target , byte [ ] search , int offset ) { } private static final byte [ ] XML_PFX = "<?xml<seq2seq4repair_space>" . getBytes ( ) ; public static boolean isXML ( byte [ ] target ) { } public static String baToHexString ( byte [ ] ba ) { <START_BUG> StrBuilder sb = new StrBuilder ( ba . length ) ; <END_BUG> for ( int i = 0 ; i < ( ba . length ) ; i ++ ) { int j = ( ba [ i ] ) & 255 ; if ( j < 16 ) { sb . append ( "0" ) ; } sb . append ( Integer . toHexString ( j ) ) ; } return sb . toString ( ) ; } }

Fix:
StrBuilder sb = new StrBuilder ( ( ( ba . length ) * 2 ) ) ;
Buggy code:
public class FloatLiteral extends NumberLiteral { float value ; static final float Float_MIN_VALUE = Float . intBitsToFloat ( 1 ) ; public FloatLiteral ( char [ ] token , int s , int e ) { } public void computeConstant ( ) { } public void generateCode ( BlockScope currentScope , CodeStream codeStream , boolean valueRequired ) { } public TypeBinding literalType ( BlockScope scope ) { <START_BUG> return FloatBinding ; <END_BUG> } public void traverse ( ASTVisitor visitor , BlockScope blockScope ) { } }

Fix:
return TypeBinding . FLOAT ;
Buggy code:
public final class GenericUserBasedRecommenderTest extends TasteTestCase { @ Test public void testRecommender ( ) throws Exception { } @ Test public void testHowMany ( ) throws Exception { } @ Test public void testRescorer ( ) throws Exception { } @ Test public void testEstimatePref ( ) throws Exception { } @ Test public void testBestRating ( ) throws Exception { } @ Test public void testMostSimilar ( ) throws Exception { UserBasedRecommender recommender = GenericUserBasedRecommenderTest . buildRecommender ( ) ; long [ ] similar = recommender . mostSimilarUserIDs ( 1 , 2 ) ; assertNotNull ( similar ) ; assertEquals ( 2 , similar . length ) ; assertEquals ( 2 , similar [ 0 ] ) ; <START_BUG> assertEquals ( 4 , similar [ 1 ] ) ; <END_BUG> } @ Test public void testIsolatedUser ( ) throws Exception { } private static UserBasedRecommender buildRecommender ( ) throws TasteException { } }

Fix:
assertEquals ( 3 , similar [ 1 ] ) ;
Buggy code:
public class IssueTypePeer extends org . tigris . scarab . om . BaseIssueTypePeer { public static NumberKey ROOT_KEY = new NumberKey ( "0" ) ; private static final String ISSUE_TYPE_PEER = "IssueTypePeer" ; private static final String GET_ALL_ISSUE_TYPES = "getAllIssueTypes" ; private static final String RETRIEVE_BY_PK = "retrieveByPK" ; public static IssueType retrieveByPK ( ObjectKey pk ) throws TorqueException { } public static List getAllIssueTypes ( boolean deleted , String sortColumn , String sortPolarity ) throws Exception { } public static List getAllIssueTypes ( boolean includeDeleted ) throws Exception { } public static List getDefaultIssueTypes ( ) throws Exception { } private static Criteria addSortOrder ( Criteria crit , String sortColumn , String sortPolarity ) { <START_BUG> if ( sortPolarity . equals ( "desc" ) ) { <END_BUG> crit . addDescendingOrderByColumn ( sortColumn ) ; } else { crit . addAscendingOrderByColumn ( sortColumn ) ; } return crit ; } public static boolean isUnique ( String name , ObjectKey id ) throws Exception { } }

Fix:
if ( ( sortPolarity != null ) && ( sortPolarity . equals ( "desc" ) ) ) {
Buggy code:
} break ; case a . O : if ( inventory [ a . KEY ] ) { msg = "Press<seq2seq4repair_space>space<seq2seq4repair_space>to<seq2seq4repair_space>lock<seq2seq4repair_space>door." ; if ( ( b_cooldown <= 0 ) && ( key [ KeyEvent . VK_SPACE ] ) ) { t_type [ ny ] [ nx ] = a . D ; b_cooldown = a . B_COOLDOWN ; } } break ; case a . D : if ( inventory [ a . KEY ] ) { msg = "Press<seq2seq4repair_space>space<seq2seq4repair_space>to<seq2seq4repair_space>open<seq2seq4repair_space>door." ; if ( ( b_cooldown <= 0 ) && ( key [ KeyEvent . VK_SPACE ] ) ) { t_type [ ny ] [ nx ] = a . O ; b_cooldown = a . B_COOLDOWN ; } } break ; } } for ( int y = 0 ; y < ( a . T_H ) ; y ++ ) { for ( int x = 0 ; x < ( a . T_W ) ; x ++ ) { v_map [ y ] [ x ] = 100000 ; } } LinkedList < Point > queue = new LinkedList < Point > ( ) ; v_map [ ( ( int ) ( v_b_y ) ) ] [ ( ( int ) ( v_b_x ) ) ] = 0 ; queue . add ( new Point ( ( ( int ) ( v_b_x ) ) , ( ( int ) ( v_b_y ) ) ) ) ; while ( ! ( queue . isEmpty ( ) ) ) { Point p = queue . pop ( ) ; for ( int i = 0 ; i < 4 ; i ++ ) { int py2 = ( p . y ) + ( a . Y_DIRS [ i ] ) ; int px2 = ( p . x ) + ( a . X_DIRS [ i ] ) ; if ( ( ( ( py2 >= 0 ) && ( px2 >= 0 ) ) && ( py2 < ( a . T_H ) ) ) && ( px2 < ( a . T_W ) ) ) { int newV = ( ( v_map [ p . y ] [ p . x ] ) + 1 ) + ( ( t_type [ py2 ] [ px2 ] ) >= ( a . SOLIDS ) ? t_hp [ py2 ] [ px2 ] : 0 ) ; if ( newV < ( v_map [ py2 ] [ px2 ] ) ) { v_map [ py2 ] [ px2 ] = newV ; queue . add ( new Point ( px2 , py2 ) ) ; } } } } int dir = - 1 ; int least = v_map [ ( ( int ) ( v_y ) ) ] [ ( ( int ) ( v_x ) ) ] ; sp = ( a . V_SPEED ) - ( ( v_dmg * v_dmg ) * 2.0E-7 ) ; for ( int i = 0 ; i < 8 ; i ++ ) { int ny = ( ( int ) ( v_y ) ) + ( a . Y_DIRS [ i ] ) ; int nx = ( ( int ) ( v_x ) ) + ( a . X_DIRS [ i ] ) ; int ny2 = ( ( int ) ( v_y + ( ( a . Y_DIRS [ i ] ) * sp ) ) ) ; int nx2 = ( ( int ) ( v_x + ( ( a . X_DIRS [ i ] ) * sp ) ) ) ; if ( ( ( ( nx < 0 ) || ( ny < 0 ) ) || ( nx >= ( a . T_W ) ) ) || ( ny >= ( a . T_H ) ) ) { continue ; } <START_BUG> if ( ( ( ( t_type [ ny2 ] [ nx2 ] ) < ( a . SOLIDS ) ) && ( ( t_type [ ny2 ] [ ( ( int ) ( v_x ) ) ] ) >= ( a . SOLIDS ) ) ) && ( ( t_type [ ( ( int ) ( v_y ) ) ] [ nx2 ] ) >= ( a . SOLIDS ) ) ) { <END_BUG> continue ; } int value = v_map [ ny ] [ nx ] ; if ( ( ny2 != ( ( int ) ( v_y ) ) ) || ( nx2 != ( ( int ) ( v_x ) ) ) ) { value = Math . max ( value , v_map [ ny2 ] [ nx2 ] ) ; } if ( value < least ) { dir = i ; least = value ; } } double dy = 0 ; double dx = 0 ; double dist = ( ( b_y - v_y ) * ( b_y - v_y ) ) + ( ( b_x - v_x ) * ( b_x - v_x ) ) ; if ( dir == ( - 1 ) ) { if ( dist > ( ( a . P_R ) * ( a . P_R ) ) ) { dy = ( ( b_y - v_y ) // dist ) * sp ; dx = ( ( b_x - v_x ) // dist ) * sp ; } if ( ! v_seen ) { v_b_y = a . Y_VANTAGES [ ( vantage_index % 12 ) ] ; v_b_x = a . X_VANTAGES [ ( ( vantage_index ++ ) % 12 ) ] ; } } else { dy = ( a . Y_DIRS [ dir ] ) * sp ; dx = ( a . X_DIRS [ dir ] ) * sp ; } v_y += dy ; v_y = ( v_y < ( a . P_R ) ) ? a . P_R : v_y ;

Fix:
if ( ( ( ( t_type [ ny ] [ nx ] ) < ( a . SOLIDS ) ) && ( ( t_type [ ny ] [ ( ( int ) ( v_x ) ) ] ) >= ( a . SOLIDS ) ) ) && ( ( t_type [ ( ( int ) ( v_y ) ) ] [ nx ] ) >= ( a . SOLIDS ) ) ) {
Buggy code:
public class GoogleFitUploader extends GooglePlus implements Uploader { public static final String NAME = "GoogleFit" ; public static final String REST_URL = "https:////www.googleapis.com//fitness//v1//users//me//" ; public static final String REST_DATASOURCE = "dataSources" ; public static final String REST_DATASETS = "datasets" ; public static final String REST_SESSIONS = "sessions" ; private static final String SCOPES = "<seq2seq4repair_space>https:////www.googleapis.com//auth//fitness.activity.write<seq2seq4repair_space>" + ( ( ( ( "https:////www.googleapis.com//auth//fitness.activity.read<seq2seq4repair_space>" + "https:////www.googleapis.com//auth//fitness.body.write<seq2seq4repair_space>" ) + "https:////www.googleapis.com//auth//fitness.body.read<seq2seq4repair_space>" ) + "https:////www.googleapis.com//auth//fitness.location.write<seq2seq4repair_space>" ) + "https:////www.googleapis.com//auth//fitness.location.read" ) ; private static final int MAX_ATTEMPTS = 3 ; private final Context context ; private enum RequestMethod { GET , POST , PATCH , PUT ; } GoogleFitUploader ( Context ctx , UploadManager uploadManager ) { } @ Override public String getScopes ( ) { } @ Override public String getName ( ) { } public Context getContext ( ) { } @ Override public boolean checkSupport ( Feature f ) { } @ Override public String getAuthExtra ( ) { } @ Override public Status upload ( SQLiteDatabase db , long mID ) { } private Status exportActivityDataSourceTypes ( GoogleFitData gfd , List < String > presentDataSources , List < GoogleFitData . DataSourceType > activitySources ) { Status status = Status . OK ; try { for ( GoogleFitData . DataSourceType type : activitySources ) { <START_BUG> if ( ! ( presentDataSources . contains ( type . getDataStreamId ( ) ) ) ) { <END_BUG> StringWriter w = new StringWriter ( ) ; gfd . exportDataSource ( type , w ) ; status = sendData ( w , GoogleFitUploader . REST_DATASOURCE , GoogleFitUploader . RequestMethod . POST ) ; if ( status == ( Status . ERROR ) ) { return status ; } } } } catch ( IOException e ) { e . printStackTrace ( ) ; status = Status . ERROR ; } return status ; } private Status exportActivityData ( GoogleFitData gfd , GoogleFitData . DataSourceType source , long activityId ) { } private Status exportActivitySession ( GoogleFitData gfd , long mID ) { } private Status sendData ( StringWriter w , String suffix , GoogleFitUploader . RequestMethod method ) throws IOException { } private HttpURLConnection getHttpURLConnection ( String suffix , GoogleFitUploader . RequestMethod requestMethod ) throws IOException { } public List < String > listExistingDataSources ( ) throws Exception { } }

Fix:
if ( ! ( presentDataSources . contains ( type . getDataStreamId ( gfd ) ) ) ) {
Buggy code:
public class ShapefileParserTest { @ Test public void test ( ) throws Exception { LuceneService luceneService = new LuceneService ( ) ; <START_BUG> luceneService . parse ( ) ; <END_BUG> } }

Fix:
luceneService . indexShapefile ( ) ;
Buggy code:
public class XmlRecordReaderTest { private XmlRecordReader xmlRecordReader ; @ Before public void setUp ( ) throws Exception { } @ Test public void testGetTotalRecords ( ) throws Exception { } @ Test public void testHasNextRecord ( ) throws Exception { } @ Test public void testReadNextRecord ( ) throws Exception { } @ Test public void testReadingEscapedXml ( ) throws Exception { xmlRecordReader . close ( ) ; xmlRecordReader = new XmlRecordReader ( "website" , getDataSource ( "//websites.xml" ) ) ; xmlRecordReader . open ( ) ; assertThat ( xmlRecordReader . hasNextRecord ( ) ) . isTrue ( ) ; XmlRecord record = xmlRecordReader . readNextRecord ( ) ; assertThat ( record . getPayload ( ) ) . isXmlEqualTo ( "<website<seq2seq4repair_space>name=\"google\"<seq2seq4repair_space>url=\"http:////www.google.com?query=test&amp;sort=asc\"//>" ) ; assertThat ( xmlRecordReader . hasNextRecord ( ) ) . isTrue ( ) ; record = xmlRecordReader . readNextRecord ( ) ; <START_BUG> assertThat ( record . getPayload ( ) ) . isXmlEqualTo ( "<website<seq2seq4repair_space>name=\"l&apos;équipe\"<seq2seq4repair_space>url=\"http:////www.lequipe.fr\"//>" ) ; <END_BUG> assertThat ( xmlRecordReader . hasNextRecord ( ) ) . isTrue ( ) ; record = xmlRecordReader . readNextRecord ( ) ; assertThat ( record . getPayload ( ) ) . isXmlEqualTo ( "<website<seq2seq4repair_space>name=\"l&quot;internaute.com\"<seq2seq4repair_space>url=\"http:////www.linternaute.com\"//>" ) ; assertThat ( xmlRecordReader . hasNextRecord ( ) ) . isFalse ( ) ; } @ Test public void testReadingXmlWithCustomNamespace ( ) throws Exception { } @ Test public void testGetTotalRecordsForEmptyPersonsFile ( ) throws Exception { } @ Test public void testHasNextRecordForEmptyPersonsFile ( ) throws Exception { } @ Test public void testGetTotalRecordsForEmptyFile ( ) throws Exception { } @ Test public void testHasNextRecordForEmptyFile ( ) throws Exception { } @ Test public void testReadNextNestedRecord ( ) throws Exception { } @ After public void tearDown ( ) throws Exception { } private String getXmlFromFile ( String file ) { } private InputStream getDataSource ( String name ) { } }

Fix:
assertThat ( record . getPayload ( ) ) . isXmlEqualTo ( "<website<seq2seq4repair_space>name=\"l&apos;equipe\"<seq2seq4repair_space>url=\"http:////www.lequipe.fr\"//>" ) ;
Buggy code:
public class SemanticException extends Exception { private static final long serialVersionUID = 1L ; String err_msg ; int line = 0 ; public SemanticException ( String err_msg ) { } public SemanticException ( String err_msg , int line ) { } public String toString ( ) { <START_BUG> String tmp = "Semantic<seq2seq4repair_space>Error:<seq2seq4repair_space>" ; <END_BUG> if ( ( this . err_msg ) != null ) { if ( ( this . line ) > 0 ) { tmp += ( "line<seq2seq4repair_space>" + ( this . line ) ) + ":<seq2seq4repair_space>" ; } tmp += err_msg ; } return tmp ; } }

Fix:
String tmp = "\nSemantic<seq2seq4repair_space>Error:<seq2seq4repair_space>" ;
Buggy code:
public class GraphPanel extends JPanel { public ChartPanel panel ; public GraphPanel ( Vector < ElectricalValue > values ) { } private static JFreeChart createChart ( XYDataset dataset ) { JFreeChart chart = ChartFactory . createTimeSeriesChart ( "data<seq2seq4repair_space>on<seq2seq4repair_space>date" , "Date" , "Current" , dataset , false , false , false ) ; chart . setBackgroundPaint ( Color . white ) ; XYPlot plot = ( ( XYPlot ) ( chart . getPlot ( ) ) ) ; XYSplineRenderer renderer = new XYSplineRenderer ( 5 ) ; plot . setRenderer ( renderer ) ; renderer . setBaseShapesVisible ( false ) ; DateAxis axis = ( ( DateAxis ) ( plot . getDomainAxis ( ) ) ) ; <START_BUG> axis . setDateFormatOverride ( new SimpleDateFormat ( "HH-mm" ) ) ; <END_BUG> return chart ; } }

Fix:
axis . setDateFormatOverride ( new SimpleDateFormat ( "HH-mm<seq2seq4repair_space>MM-dd" ) ) ;
Buggy code:
public class ResourceURIImpl extends UrlImpl implements ResourceURI { private static final long serialVersionUID = - 686750395794924219L ; protected String id = null ; protected Site site = null ; protected String type = null ; protected long version = Resource . LIVE ; private String external = null ; public ResourceURIImpl ( ResourceURI uri , long version ) { } public ResourceURIImpl ( String type , Site site , String path ) throws MalformedResourceURIException { } public ResourceURIImpl ( String type , Site site , String path , long version ) throws MalformedResourceURIException { } public ResourceURIImpl ( String type , Site site , String path , String id ) throws MalformedResourceURIException { } public ResourceURIImpl ( String type , Site site , String path , String id , long version ) throws MalformedResourceURIException { } @ Override public String getUID ( ) { } public void setIdentifier ( String id ) { } public String getIdentifier ( ) throws MalformedResourceURIException { } public ResourceURI getParentURI ( ) throws MalformedResourceURIException { String parentPath = getParentPath ( ) ; if ( parentPath == null ) return null ; <START_BUG> return new ResourceURIImpl ( type , site , parentPath , id , version ) ; <END_BUG> } @ Override public String getPath ( ) throws MalformedResourceURIException { } @ Override public void setPath ( String path ) { } public Site getSite ( ) throws MalformedResourceURIException { } public void setVersion ( long version ) { } public long getVersion ( ) throws MalformedResourceURIException { } public ResourceURI getVersion ( long version ) throws MalformedResourceURIException { } public void setType ( String type ) { } public String getType ( ) { } @ Override public int hashCode ( ) { } @ Override public boolean equals ( Object obj ) { } private boolean pathEquals ( ResourceURI uri ) { } @ Override public String toString ( ) { } }

Fix:
return new ResourceURIImpl ( type , site , parentPath , null , version ) ;
Buggy code:
public class CompoundAssignment extends Assignment implements OperatorIds { public int operator ; public int preAssignImplicitConversion ; public CompoundAssignment ( Expression lhs , Expression expression , int operator , int sourceEnd ) { } public FlowInfo analyseCode ( BlockScope currentScope , FlowContext flowContext , FlowInfo flowInfo ) { if ( ( this . resolvedType . id ) != ( TypeIds . T_JavaLangString ) ) { this . lhs . checkNPE ( currentScope , flowContext , flowInfo ) ; } flowInfo = ( ( Reference ) ( this . lhs ) ) . analyseAssignment ( currentScope , flowContext , flowInfo , this , true ) . unconditionalInits ( ) ; if ( ( this . resolvedType . id ) == ( TypeIds . T_JavaLangString ) ) { LocalVariableBinding local = this . lhs . localVariableBinding ( ) ; <START_BUG> if ( ( local != null ) && ( ( this . resolvedType . id ) == ( TypeIds . T_JavaLangString ) ) ) { <END_BUG> flowInfo . markAsDefinitelyNonNull ( local ) ; if ( ( flowContext . initsOnFinally ) != null ) flowContext . initsOnFinally . markAsDefinitelyNonNull ( local ) ; } } return flowInfo ; } public boolean checkCastCompatibility ( ) { } public void generateCode ( BlockScope currentScope , CodeStream codeStream , boolean valueRequired ) { } public int nullStatus ( FlowInfo flowInfo ) { } public String operatorToString ( ) { } public StringBuffer printExpressionNoParenthesis ( int indent , StringBuffer output ) { } public TypeBinding resolveType ( BlockScope scope ) { } public boolean restrainUsageToNumericTypes ( ) { } public void traverse ( ASTVisitor visitor , BlockScope scope ) { } }

Fix:
if ( local != null ) {
Buggy code:
public class Random extends AbstractFunction implements Serializable { private static final List desc = new LinkedList ( ) ; private static final String KEY = "__Random" ; private transient CompoundVariable varName ; private transient CompoundVariable minimum ; private transient CompoundVariable maximum ; public Random ( ) { } public Object clone ( ) { } public synchronized String execute ( SampleResult previousResult , Sampler currentSampler ) throws InvalidVariableException { JMeterVariables vars = getVariables ( ) ; long min = Long . parseLong ( minimum . execute ( ) . trim ( ) ) ; long max = Long . parseLong ( maximum . execute ( ) . trim ( ) ) ; <START_BUG> long rand = Math . round ( ( min + ( ( Math . random ( ) ) * ( max - min ) ) ) ) ; <END_BUG> String randString = Long . toString ( rand ) ; vars . put ( varName . execute ( ) , randString ) ; return randString ; } public synchronized void setParameters ( Collection parameters ) throws InvalidVariableException { } public String getReferenceKey ( ) { } public List getArgumentDesc ( ) { } }

Fix:
long rand = min + ( ( ( long ) ( Math . random ( ) ) ) * ( ( max - min ) + 1 ) ) ;
Buggy code:
public class MultiRetrieveFileTransferTest extends ContainerAbstractTestCase { private static final String TESTSRCPATH = "test.src" ; private static final String TESTTARGETPATH = "test.target" ; private static List srcFiles = new ArrayList ( ) ; protected IContainer createClient ( int index ) throws Exception { } protected int getClientCount ( ) { } protected void setUp ( ) throws Exception { } protected void tearDown ( ) throws Exception { } protected void printFileInfo ( String prefix , IFileTransferEvent event , File targetFile ) { } protected void testReceive ( String url ) throws Exception { } public void testReceives ( ) throws Exception { for ( Iterator i = MultiRetrieveFileTransferTest . srcFiles . iterator ( ) ; i . hasNext ( ) ; ) { testReceive ( ( ( String ) ( i . next ( ) ) ) ) ; } <START_BUG> sleep ( 50000 , "Starting<seq2seq4repair_space>sleeping" , "Ending<seq2seq4repair_space>sleeping" ) ; <END_BUG> } }

Fix:
sleep ( 10000 , "Starting<seq2seq4repair_space>sleeping" , "Ending<seq2seq4repair_space>sleeping" ) ;
Buggy code:
public class VisitsManager extends BaseManager { private static final String VISIT_QUERY = "visit?patient=" ; private static final String SENDING_REQUEST = "Sending<seq2seq4repair_space>request<seq2seq4repair_space>to<seq2seq4repair_space>:<seq2seq4repair_space>" ; private int mExpectedResponses ; private boolean mErrorOccurred ; public VisitsManager ( Context context ) { } public void getLastVitals ( final String patientUUID ) { } public void findVisitsByPatientUUID ( final String patientUUID , final long patientID ) { } public void findVisitByUUID ( final String visitUUID , final long patientID ) { } public void getVisitDiagnosesByUUID ( final String diagnosesUUID , final long patientID ) { } public void inactivateVisitByUUID ( final String visitUUID , final long patientID , final long visitID ) { } public void createVisit ( final Patient patient ) { } public void getVisitType ( ) { } public void subtractExpectedResponses ( boolean errorOccurred ) { ( mExpectedResponses ) -- ; if ( errorOccurred ) { mErrorOccurred = errorOccurred ; } if ( ( mExpectedResponses ) <= 0 ) { if ( ( mContext ) instanceof PatientDashboardActivity ) { <START_BUG> ( ( PatientDashboardActivity ) ( mContext ) ) . updatePatientVisitsData ( mErrorOccurred ) ; <END_BUG> } else if ( ( ( mContext ) instanceof FindPatientsSearchActivity ) || ( ( mContext ) instanceof FindPatientsActivity ) ) { ( ( ACBaseActivity ) ( mContext ) ) . dismissProgressDialog ( errorOccurred , find_patients_row_toast_patient_saved , find_patients_row_toast_patient_save_error ) ; } } } }

Fix:
( ( PatientDashboardActivity ) ( org . openmrs . mobile . application . OpenMRS . getInstance ( ) . getCurrentActivity ( ) ) ) . updatePatientVisitsData ( mErrorOccurred ) ;
Buggy code:
public class FractionTest extends TestCase { private void assertFraction ( int expectedNumerator , int expectedDenominator , Fraction actual ) { } public void testConstructor ( ) { } public void testGoldenRatio ( ) { } public void testDoubleConstructor ( ) throws ConvergenceException { } public void testDigitLimitConstructor ( ) throws ConvergenceException { } public void testIntegerOverflow ( ) { } private void checkIntegerOverflow ( double a ) { } public void testEpsilonLimitConstructor ( ) throws ConvergenceException { } public void testCompareTo ( ) { } public void testDoubleValue ( ) { } public void testFloatValue ( ) { } public void testIntValue ( ) { } public void testLongValue ( ) { } public void testConstructorDouble ( ) { } public void testAbs ( ) { } public void testReciprocal ( ) { } public void testNegate ( ) { } public void testAdd ( ) { } public void testDivide ( ) { } public void testMultiply ( ) { } public void testSubtract ( ) { } public void testEqualsAndHashCode ( ) { Fraction zero = new Fraction ( 0 , 1 ) ; Fraction nullFraction = null ; assertTrue ( zero . equals ( zero ) ) ; assertFalse ( zero . equals ( nullFraction ) ) ; <START_BUG> assertFalse ( zero . equals ( new Double ( 0 ) ) ) ; <END_BUG> Fraction zero2 = new Fraction ( 0 , 2 ) ; assertTrue ( zero . equals ( zero2 ) ) ; assertEquals ( zero . hashCode ( ) , zero2 . hashCode ( ) ) ; Fraction one = new Fraction ( 1 , 1 ) ; assertFalse ( ( ( one . equals ( zero ) ) || ( zero . equals ( one ) ) ) ) ; } public void testGetReducedFraction ( ) { } }

Fix:
assertFalse ( zero . equals ( Double . valueOf ( 0 ) ) ) ;
Buggy code:
public class StatefulSessionObjectReferenceImpl implements Serializable , SessionObjectReference { private volatile boolean removed = false ; private final Map < String , ServiceName > viewServices ; private final ServiceName createServiceName ; private final SessionID id ; private final StatefulSessionComponent ejbComponent ; public StatefulSessionObjectReferenceImpl ( final SessionID id , final ServiceName createServiceName , final Map < String , ServiceName > viewServices ) { } public StatefulSessionObjectReferenceImpl ( EjbDescriptorImpl < ? > descriptor ) { } private static Map < String , ServiceName > buildViews ( final EjbDescriptorImpl < ? > descriptor ) { } @ Override @ SuppressWarnings ( { "unchecked" } ) public synchronized < S > S getBusinessObject ( Class < S > businessInterfaceType ) { if ( isRemoved ( ) ) { throw new NoSuchEJBException ( "Bean<seq2seq4repair_space>has<seq2seq4repair_space>been<seq2seq4repair_space>removed" ) ; } if ( viewServices . containsKey ( businessInterfaceType . getName ( ) ) ) { final ServiceController < ? > serviceController = CurrentServiceContainer . getServiceContainer ( ) . getRequiredService ( viewServices . get ( businessInterfaceType . getName ( ) ) ) ; final ComponentView view = ( ( ComponentView ) ( serviceController . getValue ( ) ) ) ; try { <START_BUG> return ( ( S ) ( view . createInstance ( Collections . < Object , Object > singletonMap ( SESSION_ID_KEY , id ) ) . getInstance ( ) ) ) ; <END_BUG> } catch ( Exception e ) { throw new RuntimeException ( e ) ; } } else { throw new IllegalStateException ( ( ( ( "View<seq2seq4repair_space>of<seq2seq4repair_space>type<seq2seq4repair_space>" + businessInterfaceType ) + "<seq2seq4repair_space>not<seq2seq4repair_space>found<seq2seq4repair_space>on<seq2seq4repair_space>bean<seq2seq4repair_space>" ) + ( ejbComponent ) ) ) ; } } protected Object writeReplace ( ) throws IOException { } @ Override public void remove ( ) { } @ Override public boolean isRemoved ( ) { } }

Fix:
return ( ( S ) ( view . createInstance ( Collections . < Object , Object > singletonMap ( SessionID . class , id ) ) . getInstance ( ) ) ) ;
Buggy code:
public class AddUnitView implements ViewBuilder { private final PresentationModel < Unit > d_model ; private JTextField d_name ; private NotEmptyValidator d_validator ; private JTextField d_symbol ; private JPanel d_panel ; public AddUnitView ( PresentationModel < Unit > presentationModel , JButton okButton ) { } public void initComponents ( ) { } @ Override public JComponent buildPanel ( ) { initComponents ( ) ; FormLayout layout = new FormLayout ( "right:pref,<seq2seq4repair_space>3dlu,<seq2seq4repair_space>pref,<seq2seq4repair_space>3dlu,<seq2seq4repair_space>pref" , "p,<seq2seq4repair_space>3dlu,<seq2seq4repair_space>p,<seq2seq4repair_space>3dlu,<seq2seq4repair_space>p" ) ; PanelBuilder builder = new PanelBuilder ( layout ) ; builder . setDefaultDialogBorder ( ) ; CellConstraints cc = new CellConstraints ( ) ; <START_BUG> builder . addSeparator ( "Drug" , cc . xyw ( 1 , 1 , 5 ) ) ; <END_BUG> builder . addLabel ( "Name:" , cc . xy ( 1 , 3 ) ) ; builder . add ( d_name , cc . xy ( 3 , 3 ) ) ; builder . addLabel ( "Symbol:" , cc . xy ( 1 , 5 ) ) ; builder . add ( d_symbol , cc . xyw ( 3 , 5 , 3 ) ) ; d_panel = builder . getPanel ( ) ; return d_panel ; } }

Fix:
builder . addSeparator ( "Unit" , cc . xyw ( 1 , 1 , 5 ) ) ;
Buggy code:
public class CellBaseMain { public static void main ( String [ ] args ) { CliOptionsParser cliOptionsParser = new CliOptionsParser ( ) ; cliOptionsParser . parse ( args ) ; String parsedCommand = cliOptionsParser . getCommand ( ) ; if ( ( parsedCommand == null ) || ( parsedCommand . isEmpty ( ) ) ) { if ( cliOptionsParser . getGeneralOptions ( ) . help ) { cliOptionsParser . printUsage ( ) ; } if ( cliOptionsParser . getGeneralOptions ( ) . version ) { System . out . println ( "version<seq2seq4repair_space>=<seq2seq4repair_space>3.1.0" ) ; } } else { CommandParser commandParser = null ; switch ( parsedCommand ) { case "download" : if ( cliOptionsParser . getDownloadCommandOptions ( ) . commonOptions . help ) { cliOptionsParser . printUsage ( ) ; } else { commandParser = new DownloadCommandParser ( cliOptionsParser . getDownloadCommandOptions ( ) ) ; } break ; case "build" : if ( cliOptionsParser . getBuildCommandOptions ( ) . commonOptions . help ) { cliOptionsParser . printUsage ( ) ; } else { commandParser = new BuildCommandParser ( cliOptionsParser . getBuildCommandOptions ( ) ) ; } break ; case "load" : if ( cliOptionsParser . getLoadCommandOptions ( ) . commonOptions . help ) { cliOptionsParser . printUsage ( ) ; } else { commandParser = new LoadCommandParser ( cliOptionsParser . getLoadCommandOptions ( ) ) ; } break ; case "query" : if ( cliOptionsParser . getQueryCommandOptions ( ) . commonOptions . help ) { cliOptionsParser . printUsage ( ) ; } else { <START_BUG> commandParser = new LoadCommandParser ( cliOptionsParser . getLoadCommandOptions ( ) ) ; <END_BUG> } break ; default : break ; } if ( commandParser != null ) { try { commandParser . readCellBaseConfiguration ( ) ; commandParser . parse ( ) ; } catch ( IOException | URISyntaxException ex ) { commandParser . getLogger ( ) . error ( ( "Error<seq2seq4repair_space>reading<seq2seq4repair_space>cellbase<seq2seq4repair_space>configuration:<seq2seq4repair_space>" + ( ex . getMessage ( ) ) ) ) ; } } } } }

Fix:
commandParser = new QueryCommandParser ( cliOptionsParser . getQueryCommandOptions ( ) ) ;