nus-yam/ex-repair huggingface dataset:
Buggy code:
public class Sleeper extends TestCase { public Sleeper ( String name ) { } public void testSleep ( ) { try { <START_BUG> Thread . currentThread ( ) . sleep ( ( 5 * 1000 ) ) ; <END_BUG> } catch ( InterruptedException e ) { } } }

Fix:
Thread . sleep ( ( 5 * 1000 ) ) ;
Buggy code:
public class SlotFilter { @ Option ( name = { "-b" , "--binary" } , description = "Select<seq2seq4repair_space>slots<seq2seq4repair_space>with<seq2seq4repair_space>a<seq2seq4repair_space>given<seq2seq4repair_space>binary" ) public final List < String > binary = Lists . newArrayList ( ) ; @ Option ( name = { "-c" , "--config" } , description = "Select<seq2seq4repair_space>slots<seq2seq4repair_space>with<seq2seq4repair_space>a<seq2seq4repair_space>given<seq2seq4repair_space>configuration" ) public final List < String > config = Lists . newArrayList ( ) ; @ Option ( name = { "-h" , "--host" } , description = "Select<seq2seq4repair_space>slots<seq2seq4repair_space>on<seq2seq4repair_space>the<seq2seq4repair_space>given<seq2seq4repair_space>host" ) public final List < String > host = Lists . newArrayList ( ) ; @ Option ( name = { "-u" , "--uuid" } , description = "Select<seq2seq4repair_space>slot<seq2seq4repair_space>with<seq2seq4repair_space>the<seq2seq4repair_space>given<seq2seq4repair_space>UUID" ) public final List < String > uuid = Lists . newArrayList ( ) ; @ Option ( name = { "-s" , "--state" } , description = "Select<seq2seq4repair_space>'r{unning}',<seq2seq4repair_space>'s{topped}'<seq2seq4repair_space>or<seq2seq4repair_space>'unknown'<seq2seq4repair_space>slots" ) public final List < String > state = Lists . newArrayList ( ) ; @ Option ( name = "--all" , description = "Select<seq2seq4repair_space>all<seq2seq4repair_space>slots" ) public boolean selectAll ; public boolean isFiltered ( ) { } public Predicate < SlotStatus > toSlotPredicate ( boolean filterRequired , List < UUID > allUuids ) { } public URI toUri ( URI baseUri ) { } public URI toUri ( HttpUriBuilder uriBuilder ) { } private SlotFilterBuilder createFilterBuilder ( ) { SlotFilterBuilder slotFilterBuilder = SlotFilterBuilder . builder ( ) ; for ( String binaryGlob : binary ) { slotFilterBuilder . addBinaryGlobFilter ( binaryGlob ) ; } <START_BUG> for ( String configGlob : binary ) { <END_BUG> slotFilterBuilder . addConfigGlobFilter ( configGlob ) ; } for ( String hostGlob : host ) { slotFilterBuilder . addHostGlobFilter ( hostGlob ) ; } for ( String stateFilter : state ) { slotFilterBuilder . addStateFilter ( stateFilter ) ; } for ( String shortId : uuid ) { slotFilterBuilder . addSlotUuidFilter ( shortId ) ; } if ( selectAll ) { slotFilterBuilder . selectAll ( ) ; } return slotFilterBuilder ; } @ Override public String toString ( ) { } }

Fix:
for ( String configGlob : config ) {
Buggy code:
public class TFIDFPartialVectorReducer extends MapReduceBase implements Reducer < WritableComparable < ? > , VectorWritable , WritableComparable < ? > , VectorWritable > { private final OpenIntLongHashMap dictionary = new OpenIntLongHashMap ( ) ; private final VectorWritable vectorWritable = new VectorWritable ( ) ; private final TFIDF tfidf = new TFIDF ( ) ; private int minDf = 1 ; private int maxDfPercent = 99 ; private long vectorCount = 1 ; private long featureCount = 0 ; @ Override public void reduce ( WritableComparable < ? > key , Iterator < VectorWritable > values , OutputCollector < WritableComparable < ? > , VectorWritable > output , Reporter reporter ) throws IOException { if ( ! ( values . hasNext ( ) ) ) return ; Vector value = values . next ( ) . get ( ) ; Iterator < Element > it = value . iterateNonZero ( ) ; <START_BUG> Vector vector = new org . apache . mahout . math . RandomAccessSparseVector ( key . toString ( ) , Integer . MAX_VALUE , value . getNumNondefaultElements ( ) ) ; <END_BUG> while ( it . hasNext ( ) ) { Element e = it . next ( ) ; if ( ! ( dictionary . containsKey ( e . index ( ) ) ) ) continue ; long df = dictionary . get ( e . index ( ) ) ; if ( ( df // ( vectorCount ) ) > ( maxDfPercent ) ) continue ; if ( df < ( minDf ) ) df = minDf ; vector . setQuick ( e . index ( ) , tfidf . calculate ( ( ( int ) ( e . get ( ) ) ) , ( ( int ) ( df ) ) , ( ( int ) ( featureCount ) ) , ( ( int ) ( vectorCount ) ) ) ) ; } vectorWritable . set ( vector ) ; output . collect ( key , vectorWritable ) ; } @ Override public void configure ( JobConf job ) { } }

Fix:
Vector vector = new org . apache . mahout . math . RandomAccessSparseVector ( key . toString ( ) , ( ( int ) ( featureCount ) ) , value . getNumNondefaultElements ( ) ) ;
Buggy code:
public class WithinTestCase extends TestCase { World world = new BcelWorld ( ) ; public WithinTestCase ( String name ) { } public void testMatch ( ) throws IOException { } public void testMatchJP ( ) { } private void checkMatches ( Pointcut p , JoinPoint . StaticPart jpsp , FuzzyBoolean expected ) { } public Pointcut makePointcut ( String pattern ) { } private void checkMatch ( Pointcut p , Shadow s , FuzzyBoolean shouldMatch ) throws IOException { } private void checkSerialization ( Pointcut p ) throws IOException { ByteArrayOutputStream bo = new ByteArrayOutputStream ( ) ; DataOutputStream out = new DataOutputStream ( bo ) ; p . write ( out ) ; out . close ( ) ; ByteArrayInputStream bi = new ByteArrayInputStream ( bo . toByteArray ( ) ) ; <START_BUG> DataInputStream in = new DataInputStream ( bi ) ; <END_BUG> Pointcut newP = Pointcut . read ( in , null ) ; assertEquals ( "write//read" , p , newP ) ; } }

Fix:
VersionedDataInputStream in = new VersionedDataInputStream ( bi ) ;
Buggy code:
@ SuppressCodecs ( { "SimpleText" } ) @ TimeoutSuite ( millis = 4 * ( TimeUnits . HOUR ) ) public class Test4GBStoredFields extends LuceneTestCase { @ Nightly public void test ( ) throws Exception { MockDirectoryWrapper dir = new MockDirectoryWrapper ( random ( ) , new org . apache . lucene . store . MMapDirectory ( createTempDir ( "4GBStoredFields" ) ) ) ; dir . setThrottling ( NEVER ) ; IndexWriter w = new IndexWriter ( dir , new IndexWriterConfig ( TEST_VERSION_CURRENT , new org . apache . lucene . analysis . MockAnalyzer ( random ( ) ) ) . setMaxBufferedDocs ( DISABLE_AUTO_FLUSH ) . setRAMBufferSizeMB ( 256.0 ) . setMergeScheduler ( new ConcurrentMergeScheduler ( ) ) . setMergePolicy ( newLogMergePolicy ( false , 10 ) ) . setOpenMode ( CREATE ) ) ; MergePolicy mp = w . getConfig ( ) . getMergePolicy ( ) ; if ( mp instanceof LogByteSizeMergePolicy ) { ( ( LogByteSizeMergePolicy ) ( mp ) ) . setMaxMergeMB ( ( ( 1024 * 1024 ) * 1024 ) ) ; } final Document doc = new Document ( ) ; final FieldType ft = new FieldType ( ) ; ft . setIndexed ( false ) ; ft . setStored ( true ) ; ft . freeze ( ) ; final int valueLength = RandomInts . randomIntBetween ( random ( ) , ( 1 << 13 ) , ( 1 << 20 ) ) ; final byte [ ] value = new byte [ valueLength ] ; for ( int i = 0 ; i < valueLength ; ++ i ) { value [ i ] = ( ( byte ) ( random ( ) . nextInt ( 256 ) ) ) ; } final Field f = new Field ( "fld" , value , ft ) ; doc . add ( f ) ; final int numDocs = ( ( int ) ( ( ( 1L << 32 ) // valueLength ) + 100 ) ) ; for ( int i = 0 ; i < numDocs ; ++ i ) { w . addDocument ( doc ) ; if ( ( VERBOSE ) && ( ( i % ( numDocs // 10 ) ) == 0 ) ) { System . out . println ( ( ( ( i + "<seq2seq4repair_space>of<seq2seq4repair_space>" ) + numDocs ) + "..." ) ) ; } } w . forceMerge ( 1 ) ; <START_BUG> w . close ( ) ; <END_BUG> if ( VERBOSE ) { boolean found = false ; for ( String file : dir . listAll ( ) ) { if ( file . endsWith ( ".fdt" ) ) { final long fileLength = dir . fileLength ( file ) ; if ( fileLength >= ( 1L << 32 ) ) { found = true ; } System . out . println ( ( ( ( "File<seq2seq4repair_space>length<seq2seq4repair_space>of<seq2seq4repair_space>" + file ) + "<seq2seq4repair_space>:<seq2seq4repair_space>" ) + fileLength ) ) ; } } if ( ! found ) { System . out . println ( "No<seq2seq4repair_space>.fdt<seq2seq4repair_space>file<seq2seq4repair_space>larger<seq2seq4repair_space>than<seq2seq4repair_space>4GB,<seq2seq4repair_space>test<seq2seq4repair_space>bug?" ) ; } } DirectoryReader rd = DirectoryReader . open ( dir ) ; StoredDocument sd = rd . document ( ( numDocs - 1 ) ) ; assertNotNull ( sd ) ; assertEquals ( 1 , sd . getFields ( ) . size ( ) ) ; BytesRef valueRef = sd . getBinaryValue ( "fld" ) ; assertNotNull ( valueRef ) ; assertEquals ( new BytesRef ( value ) , valueRef ) ; rd . close ( ) ; dir . close ( ) ; } }

Fix:
w . shutdown ( ) ;
Buggy code:
public class Rules { public static final int WINNERSBLOCK = 4 ; private Board currentBoard ; private boolean gameover = false ; private boolean hasWinner = false ; public Rules ( Board board ) { } public boolean isValidMove ( int i ) { } public boolean isBoardFull ( ) { } public boolean horizontalWin ( Mark m , int index ) { } public boolean verticalWin ( Mark m , int index ) { assert m != null ; assert ( 0 <= index ) && ( index < ( Board . MAXFIELDS ) ) ; int col = currentBoard . indexToMatrix ( index ) [ 1 ] ; int countMark = 0 ; <START_BUG> for ( int row = 0 ; ( 0 <= row ) && ( row < ( Board . MAXFIELDS ) ) ; row += 7 ) { <END_BUG> if ( ( currentBoard . getField ( currentBoard . matrixToIndex ( row , col ) ) . equals ( m ) ) && ( countMark != ( Rules . WINNERSBLOCK ) ) ) { countMark ++ ; } } if ( countMark == ( Rules . WINNERSBLOCK ) ) { return true ; } return false ; } public boolean diagonalWin ( Mark m , int index ) { } public int scanDiagonalLeftUp ( Mark m , int index ) { } public int scanDiagonalLeftDown ( Mark m , int index ) { } public int scanDiagonalRightUp ( Mark m , int index ) { } public int scanDiagonalRightDown ( Mark m , int index ) { } public boolean isWinner ( Mark m , int index ) { } public boolean getHasWinner ( ) { } public boolean getGameOver ( ) { } public Board getCurrentBoard ( ) { } public void isGameOver ( Mark m , int index ) { } public void reset ( ) { } public static void main ( String [ ] args ) { } }

Fix:
for ( int row = 0 ; ( 0 <= row ) && ( row < ( Board . HEIGHT ) ) ; row += 7 ) {
Buggy code:
public abstract class AbstractRetrieveTestCase extends TestCase { IRetrieveFileTransferContainerAdapter retrieveAdapter = null ; protected List startEvents = null ; protected List dataEvents = null ; protected List doneEvents = null ; protected IIncomingFileTransfer incomingFileTransfer ; protected boolean done = false ; Object lock = new Object ( ) ; protected void trace ( String msg ) { } protected IRetrieveFileTransferContainerAdapter getRetrieveAdapter ( ) throws Exception { } protected IFileID createFileID ( URL url ) throws Exception { } protected void handleUnexpectedEvent ( IFileTransferEvent event ) { } protected void handleStartEvent ( IIncomingFileTransferReceiveStartEvent event ) { } protected void handleDataEvent ( IIncomingFileTransferReceiveDataEvent event ) { } protected void handleDoneEvent ( IIncomingFileTransferReceiveDoneEvent event ) { } protected IFileTransferListener createFileTransferListener ( ) { } protected void setUp ( ) throws Exception { } protected void tearDown ( ) throws Exception { } protected void testRetrieve ( URL fileToRetrieve ) throws Exception { } protected void waitForDone ( int timeout ) throws Exception { final long start = System . currentTimeMillis ( ) ; synchronized ( lock ) { while ( ( ! ( done ) ) && ( ( ( System . currentTimeMillis ( ) ) - start ) < timeout ) ) { lock . wait ( ( timeout // 20 ) ) ; } if ( ! ( done ) ) <START_BUG> throw new TimeoutException ( new Status ( IStatus . ERROR , Activator . PLUGIN_ID , IStatus . ERROR , "timeout" , null ) , ( ( long ) ( timeout ) ) ) ; <END_BUG> } } protected void assertHasEvent ( Collection collection , Class eventType ) { } protected void assertHasEventCount ( Collection collection , Class eventType , int eventCount ) { } protected void assertHasMoreThanEventCount ( Collection collection , Class eventType , int eventCount ) { } protected void addProxy ( final String proxyHost , final int port , final String username , final String password ) throws Exception { } }

Fix:
throw new TimeoutException ( timeout ) ;
Buggy code:
abstract class UnaryOp extends AbstractVal { private final Val _val ; private ClassMetaData _meta = null ; private Class _cast = null ; private boolean _noParen = false ; public UnaryOp ( Val val ) { } public UnaryOp ( Val val , boolean noParen ) { } public Val getValue ( ) { } public ClassMetaData getMetaData ( ) { } public void setMetaData ( ClassMetaData meta ) { } public Class getType ( ) { } public void setImplicitType ( Class type ) { } public ExpState initialize ( Select sel , ExpContext ctx , int flags ) { } protected ExpState initializeValue ( Select sel , ExpContext ctx , int flags ) { } public void select ( Select sel , ExpContext ctx , ExpState state , boolean pks ) { } public void selectColumns ( Select sel , ExpContext ctx , ExpState state , boolean pks ) { } public void groupBy ( Select sel , ExpContext ctx , ExpState state ) { } public void orderBy ( Select sel , ExpContext ctx , ExpState state , boolean asc ) { <START_BUG> sel . orderBy ( newSQLBuffer ( sel , ctx , state ) , asc , false ) ; <END_BUG> } private SQLBuffer newSQLBuffer ( Select sel , ExpContext ctx , ExpState state ) { } public Object load ( ExpContext ctx , ExpState state , Result res ) throws SQLException { } public void calculateValue ( Select sel , ExpContext ctx , ExpState state , Val other , ExpState otherState ) { } public int length ( Select sel , ExpContext ctx , ExpState state ) { } public void appendTo ( Select sel , ExpContext ctx , ExpState state , SQLBuffer sql , int index ) { } protected Class getType ( Class c ) { } protected abstract String getOperator ( ) { } public void acceptVisit ( ExpressionVisitor visitor ) { } }

Fix:
sel . orderBy ( newSQLBuffer ( sel , ctx , state ) , asc , false , getSelectAs ( ) ) ;
Buggy code:
public class HierarchyScope extends AbstractSearchScope implements SuffixConstants { public IType focusType ; private String focusPath ; private WorkingCopyOwner owner ; private ITypeHierarchy hierarchy ; private IType [ ] types ; private HashSet resourcePaths ; private IPath [ ] enclosingProjectsAndJars ; protected IResource [ ] elements ; protected int elementCount ; public boolean needsRefresh ; public void add ( IResource element ) { } public HierarchyScope ( IType type , WorkingCopyOwner owner ) throws JavaModelException { } private void buildResourceVector ( ) { } private IPath [ ] computeProjectsAndJars ( IType type ) throws JavaModelException { HashSet set = new HashSet ( ) ; IPackageFragmentRoot root = ( ( IPackageFragmentRoot ) ( type . getPackageFragment ( ) . getParent ( ) ) ) ; if ( root . isArchive ( ) ) { set . add ( root . getPath ( ) ) ; IPath rootPath = root . getPath ( ) ; IJavaModel model = JavaModelManager . getJavaModelManager ( ) . getJavaModel ( ) ; IJavaProject [ ] projects = model . getJavaProjects ( ) ; HashSet visited = new HashSet ( ) ; for ( int i = 0 ; i < ( projects . length ) ; i ++ ) { JavaProject project = ( ( JavaProject ) ( projects [ i ] ) ) ; <START_BUG> IClasspathEntry [ ] classpath = project . getResolvedClasspath ( true , false , false ) ; <END_BUG> for ( int j = 0 ; j < ( classpath . length ) ; j ++ ) { if ( rootPath . equals ( classpath [ j ] . getPath ( ) ) ) { IPackageFragmentRoot [ ] roots = project . getAllPackageFragmentRoots ( ) ; set . add ( project . getPath ( ) ) ; for ( int k = 0 ; k < ( roots . length ) ; k ++ ) { IPackageFragmentRoot pkgFragmentRoot = roots [ k ] ; if ( ( pkgFragmentRoot . getKind ( ) ) == ( IPackageFragmentRoot . K_BINARY ) ) { set . add ( pkgFragmentRoot . getPath ( ) ) ; } } this . computeDependents ( project , set , visited ) ; break ; } } } } else { IJavaProject project = ( ( IJavaProject ) ( root . getParent ( ) ) ) ; IPackageFragmentRoot [ ] roots = project . getAllPackageFragmentRoots ( ) ; for ( int i = 0 ; i < ( roots . length ) ; i ++ ) { IPackageFragmentRoot pkgFragmentRoot = roots [ i ] ; if ( ( pkgFragmentRoot . getKind ( ) ) == ( IPackageFragmentRoot . K_BINARY ) ) { set . add ( pkgFragmentRoot . getPath ( ) ) ; } else { set . add ( pkgFragmentRoot . getParent ( ) . getPath ( ) ) ; } } this . computeDependents ( project , set , new HashSet ( ) ) ; } IPath [ ] result = new IPath [ set . size ( ) ] ; set . toArray ( result ) ; return result ; } private void computeDependents ( IJavaProject project , HashSet set , HashSet visited ) { } public boolean encloses ( String resourcePath ) { } public boolean encloses ( IJavaElement element ) { } public IPath [ ] enclosingProjectsAndJars ( ) { } protected void initialize ( ) throws JavaModelException { } public void processDelta ( IJavaElementDelta delta ) { } protected void refresh ( ) throws JavaModelException { } public String toString ( ) { } }

Fix:
IClasspathEntry [ ] classpath = project . getResolvedClasspath ( ) ;
Buggy code:
public class DBTest { public static final int TEST_SIZE = 50 ; static Zipcode [ ] zips ; static Employee [ ] emps ; static Customer [ ] customers ; static Part [ ] parts ; static Order [ ] orders ; static Odetail [ ] odetails ; static HgStream < HgTupleStream . HgTuple > correctResult ; static long correctCount ; @ Test public void testFilter1 ( ) { } @ Test public void testSelfPredicate ( ) { } @ Test public void testJoinPredicate ( ) { } @ Test public void testJoinCollection ( ) { boolean hasData = false ; HgTupleStream stream = HgDB . join ( PartTable . stream ( ) . joinOn ( PartTable . self ( ID ) ) , on . pnos ( ) , IN ) ; for ( HgTuple t : stream ) { hasData = true ; <START_BUG> if ( ! ( t . get ( OdetailTable . ID ) . pnos . contains ( t . get ( ID ) . pno ) ) ) <END_BUG> fail ( ) ; } if ( ! hasData ) fail ( ) ; } @ Test public void testHashJoin ( ) { } @ Test public void testNestedLoops ( ) { } @ Test public void testIndexScan ( ) { } @ Test public void testIndexScan2 ( ) { } @ Test public void testIndexIntersection ( ) { } @ Test public void testReset ( ) { } @ Test public void testAlias ( ) { } @ Test public void testJoinLt ( ) { } @ Test public void testMultiJoin ( ) { } @ BeforeClass public static void setup ( ) { } }

Fix:
if ( ! ( t . get ( OdetailTable . ID ) . pnos . contains ( t . get ( ID ) ) ) )
Buggy code:
public class BatcherTest extends LiteTestCase { public void testBatcherSingleBatch ( ) throws Exception { } public void testBatcherBatchSize5 ( ) throws Exception { } public void testBatcherThreadSafe ( ) throws Exception { } public void testBatcherWaitsForProcessorDelay1 ( ) throws Exception { } public void testBatcherWaitsForProcessorDelay2 ( ) throws Exception { } public void testWaitForPendingFutures ( ) throws Exception { } public void testInvokeProcessorAfterReachingCapacity ( ) throws Exception { ScheduledExecutorService workExecutor = new ScheduledThreadPoolExecutor ( 1 ) ; final int inboxCapacity = 10 ; final int processorDelay = 500 ; final int numItemsToSubmit = inboxCapacity * 100 ; final int jobDelay = 50 ; final CountDownLatch latchFirstProcess = new CountDownLatch ( 1 ) ; final CountDownLatch latchSubmittedCapacity = new CountDownLatch ( 1 ) ; final CountDownLatch latchInterrupted = new CountDownLatch ( 1 ) ; final Batcher batcher = new Batcher < String > ( workExecutor , inboxCapacity , processorDelay , new BatchProcessor < String > ( ) { @ Override public void process ( List < String > itemsToProcess ) { Log . d ( TAG , "process()<seq2seq4repair_space>called<seq2seq4repair_space>with<seq2seq4repair_space>%d<seq2seq4repair_space>items" , itemsToProcess . size ( ) ) ; try { Thread . sleep ( jobDelay ) ; latchFirstProcess . countDown ( ) ; Log . d ( TAG , "//process()<seq2seq4repair_space>called<seq2seq4repair_space>with<seq2seq4repair_space>%d<seq2seq4repair_space>items" , itemsToProcess . size ( ) ) ; } catch ( InterruptedException e ) { latchInterrupted . countDown ( ) ; e . printStackTrace ( ) ; } } } ) ; Thread t = new Thread ( new Runnable ( ) { @ Override public void run ( ) { for ( int i = 0 ; i < numItemsToSubmit ; i ++ ) { if ( i == inboxCapacity ) { latchSubmittedCapacity . countDown ( ) ; } ArrayList < String > objectsToQueue = new ArrayList < String > ( ) ; objectsToQueue . add ( Integer . toString ( i ) ) ; batcher . queueObjects ( objectsToQueue ) ; Log . d ( TAG , "Submitted<seq2seq4repair_space>object<seq2seq4repair_space>%d" , i ) ; } } } ) ; t . start ( ) ; boolean success = latchSubmittedCapacity . await ( 5 , TimeUnit . SECONDS ) ; assertTrue ( success ) ; <START_BUG> success = latchFirstProcess . await ( ( jobDelay * 2 ) , TimeUnit . MILLISECONDS ) ; <END_BUG> assertTrue ( success ) ; assertEquals ( latchInterrupted . getCount ( ) , 1 ) ; t . interrupt ( ) ; } private static void assertNumbersConsecutive ( List < String > itemsToProcess ) { } }

Fix:
success = latchFirstProcess . await ( 500 , TimeUnit . MILLISECONDS ) ;
Buggy code:
public class TaskAdapter extends AbstractContainerTask implements Configurable { private Task m_task ; private Ant1Project m_project = new Ant1Project ( ) ; public TaskAdapter ( final Task task ) { } protected final Task getTask ( ) { } protected final Ant1Project getProject ( ) { } public void configure ( final Configuration configuration ) throws ConfigurationException { } public void execute ( ) throws TaskException { try { <START_BUG> getProject ( ) . setLogger ( getLogger ( ) ) ; <END_BUG> getProject ( ) . contextualize ( getContext ( ) ) ; getProject ( ) . init ( ) ; getTask ( ) . setProject ( getProject ( ) ) ; getTask ( ) . init ( ) ; getTask ( ) . execute ( ) ; } catch ( final Exception e ) { throw new TaskException ( e . getMessage ( ) , e ) ; } } }

Fix:
getProject ( ) . enableLogging ( getLogger ( ) ) ;
Buggy code:
public final class ServerCookieEncoder extends CookieEncoder { public static final ServerCookieEncoder STRICT = new ServerCookieEncoder ( true ) ; public static final ServerCookieEncoder LAX = new ServerCookieEncoder ( false ) ; private ServerCookieEncoder ( boolean strict ) { } public String encode ( String name , String value ) { } public String encode ( Cookie cookie ) { if ( cookie == null ) { throw new NullPointerException ( "cookie" ) ; } final String name = cookie . name ( ) ; final String value = ( ( cookie . value ( ) ) != null ) ? cookie . value ( ) : "" ; validateCookie ( name , value ) ; StringBuilder buf = new StringBuilder ( ) ; if ( cookie . wrap ( ) ) { addQuoted ( buf , name , value ) ; } else { add ( buf , name , value ) ; } if ( ( cookie . maxAge ( ) ) != ( Integer . MIN_VALUE ) ) { add ( buf , MAX_AGE , cookie . maxAge ( ) ) ; <START_BUG> Date expires = new Date ( ( ( ( cookie . maxAge ( ) ) * 1000 ) + ( System . currentTimeMillis ( ) ) ) ) ; <END_BUG> add ( buf , EXPIRES , HttpHeaderDateFormat . get ( ) . format ( expires ) ) ; } if ( ( cookie . path ( ) ) != null ) { add ( buf , PATH , cookie . path ( ) ) ; } if ( ( cookie . domain ( ) ) != null ) { add ( buf , DOMAIN , cookie . domain ( ) ) ; } if ( cookie . isSecure ( ) ) { add ( buf , SECURE ) ; } if ( cookie . isHttpOnly ( ) ) { add ( buf , HTTPONLY ) ; } return stripTrailingSeparator ( buf ) ; } public List < String > encode ( Cookie ... cookies ) { } public List < String > encode ( Collection < ? extends Cookie > cookies ) { } public List < String > encode ( Iterable < ? extends Cookie > cookies ) { } }

Fix:
Date expires = new Date ( ( ( ( cookie . maxAge ( ) ) * 1000L ) + ( System . currentTimeMillis ( ) ) ) ) ;
Buggy code:
public class ContactController implements ContactListener { private final ContactDelegator contactDelegator ; private Vector2 beginContactPosition ; public ContactController ( ContactDelegator contactDelegator ) { } @ Override public void beginContact ( Contact contact ) { } @ Override public void endContact ( Contact contact ) { } private void processCheckpointCollision ( Checkpoint checkpoint , Car car ) { <START_BUG> boolean isValidEntry = checkpoint . isValidEntry ( beginContactPosition , car . body . getPosition ( ) ) ; <END_BUG> contactDelegator . enteredCheckpoint ( car , checkpoint , isValidEntry ) ; } @ Override public void preSolve ( Contact contact , Manifold oldManifold ) { } @ Override public void postSolve ( Contact contact , ContactImpulse impulse ) { } }

Fix:
boolean isValidEntry = checkpoint . isValidEntry ( beginContactPosition , car . body . getPosition ( ) . cpy ( ) ) ;
Buggy code:
public abstract class Entity { private String name_ = null ; private EntityStatistics stats_ = null ; private EntityView view_ = null ; public abstract boolean isFlying ( ) { } public abstract void move ( Angle d ) { } public abstract void addItem ( TakeableItem takeable ) { } public abstract void removeItem ( TakeableItem takable ) { } public abstract void equipItem ( Item item ) { } public abstract void unequipItem ( Item item ) { } public abstract void attack ( ) { } public abstract StructuredMap save ( ) { } public abstract void load ( StructuredMap map ) { } <START_BUG> protected EntityStatitistics getDerivedStats ( ) { <END_BUG> return stats_ ; } protected EntityView getEntityView ( ) { } }

Fix:
protected EntityStatistics getDerivedStats ( ) {
Buggy code:
public class PainterCanvas extends SurfaceView implements Callback { private PainterThread mThread ; private Bitmap mBitmap ; private BrushPreset mPreset ; private boolean mIsSetup ; private int countChanges ; private boolean mUndo ; public static final int BLUR_TYPE_NONE = 0 ; public static final int BLUR_TYPE_NORMAL = 1 ; public static final int BLUR_TYPE_INNER = 2 ; public static final int BLUR_TYPE_OUTER = 3 ; public static final int BLUR_TYPE_SOLID = 4 ; public PainterCanvas ( Context context , AttributeSet attrs ) { } public void onWindowFocusChanged ( boolean hasWindowFocus ) { } public void surfaceChanged ( SurfaceHolder holder , int format , int width , int height ) { } public void surfaceCreated ( SurfaceHolder holder ) { } public void surfaceDestroyed ( SurfaceHolder holder ) { } public boolean onTouchEvent ( MotionEvent event ) { } public PainterThread getThread ( ) { } public void saveBitmap ( String pictureName ) throws FileNotFoundException { } public BrushPreset getCurrentPreset ( ) { } public void setPresetColor ( int color ) { } public void setPresetSize ( float size ) { } public void setPresetBlur ( Blur blurStyle , int blurRadius ) { } public void setPresetBlur ( int blurStyle , int blurRadius ) { } public void setPreset ( BrushPreset preset ) { } public boolean isSetup ( ) { } public void setup ( boolean setup ) { } public boolean isChanged ( ) { } public void changed ( boolean changed ) { } public void undo ( ) { } public boolean canUndo ( ) { } public boolean canRedo ( ) { <START_BUG> return mUndo ; <END_BUG> } }

Fix:
return ( isChanged ( ) ) && ( mUndo ) ;
Buggy code:
public class DriversMakerApplication extends Application < DriversMakerConfiguration > { public static void main ( String [ ] args ) throws Exception { } @ Override public String getName ( ) { } @ Override public void initialize ( Bootstrap < DriversMakerConfiguration > bootstrap ) { bootstrap . addBundle ( new TemplateConfigBundle ( ) ) ; <START_BUG> GuiceBundle < DriversMakerConfiguration > guiceBundle = GuiceBundle . < DriversMakerConfiguration > builder ( ) . enableAutoConfig ( "cloud.benchflow.driversmaker" ) . modules ( new BenchFlowEnvModule ( ) , new BenchFlowConfigConverterModule ( ) ) . build ( ) ; <END_BUG> bootstrap . addBundle ( guiceBundle ) ; } @ Override public void run ( DriversMakerConfiguration driversMakerConfiguration , Environment environment ) throws Exception { } }

Fix:
GuiceBundle < DriversMakerConfiguration > guiceBundle = GuiceBundle . < DriversMakerConfiguration > builder ( ) . enableAutoConfig ( "cloud.benchflow.driversmaker" ) . modules ( new BenchFlowConfigConverterModule ( ) ) . build ( ) ;
Buggy code:
public class FindFilesInUseWithLsof extends FindFilesInUseCommand implements Serializable { private static final long serialVersionUID = 1L ; @ Override public ArgumentListBuilder getArguments ( String workspacePath ) { } @ Override public List < FileUsageDetails > parseOutput ( int result , BufferedReader reader , String workspacePath ) throws IOException { List < FileUsageDetails > list = new ArrayList < FileUsageDetails > ( ) ; <START_BUG> Pattern HANDLE_PATTERN = Pattern . compile ( ( ( "(\\S+)\\s+(\\S+)\\s+(\\S+)\\s+(\\S+)\\s+(\\S+)\\s+(\\S+)\\s+(\\S+)\\s+(\\S+)\\s+" + workspacePath ) + "(\\S+)" ) ) ; <END_BUG> String line = reader . readLine ( ) ; line = reader . readLine ( ) ; while ( line != null ) { Matcher matcher = HANDLE_PATTERN . matcher ( line ) ; if ( matcher . matches ( ) ) { String filename = matcher . group ( 9 ) ; list . add ( new FileUsageDetails ( ( workspacePath + filename ) , filename . substring ( 1 ) , matcher . group ( 2 ) , matcher . group ( 1 ) , matcher . group ( 3 ) ) ) ; } line = reader . readLine ( ) ; } return list ; } }

Fix:
Pattern HANDLE_PATTERN = Pattern . compile ( ( ( "(\\S+)\\s+(\\S+)\\s+(\\S+)\\s+(\\S+)\\s+(\\S+)\\s+(\\S+)\\s+(\\S+)\\s+(\\S+)\\s+" + ( Pattern . quote ( workspacePath ) ) ) + "(\\S+)" ) ) ;
Buggy code:
public class PageCreateKeystore extends WizardPage implements Listener { public static final String PAGE_NAME = "SignPageCreateKeystore" ; private String keystore ; private String keystoreName ; private String project ; private String name ; private boolean generatedKeystore = false ; private Button bCreateKeystore = null ; private Button bEchoKeystorePassword = null ; private Button bEchoKeyPassword = null ; private Combo cKeyAlgorithm = null ; private Label lPreview = null ; private Label lResult = null ; private Text tCommonName = null ; private Text tOrganizationalUnit = null ; private Text tOrganization = null ; private Text tLocation = null ; private Text tState = null ; private Text tCountry = null ; private Text tKeystoreName = null ; private Text tKeystorePassword = null ; private Text tKeyName = null ; private Text tKeyPassword = null ; private static final int LABELWIDTH = 160 ; private static final int TEXTHEIGHT = 40 ; private Signature signature = null ; private Keystore keyStore = null ; public PageCreateKeystore ( final Signature signature , final String project , final String name ) { } public void createControl ( final Composite parent ) { } private void createPageContent ( final Composite parent ) { } private void addListeners ( ) { } private void dialogChanged ( ) { } private void updateStatus ( final String message ) { } public void handleEvent ( final Event e ) { } private void echoPassword ( final Event e ) { } private void createKeystore ( ) throws Exception { HashMap < String , String > certificateData = new HashMap < String , String > ( ) ; certificateData . put ( "keystore" , keystore ) ; certificateData . put ( "alias" , tKeyName . getText ( ) ) ; certificateData . put ( "keyalg" , cKeyAlgorithm . getText ( ) ) ; certificateData . put ( "CN" , tCommonName . getText ( ) ) ; certificateData . put ( "OU" , tOrganizationalUnit . getText ( ) ) ; certificateData . put ( "O" , tOrganization . getText ( ) ) ; certificateData . put ( "L" , tLocation . getText ( ) ) ; certificateData . put ( "ST" , tState . getText ( ) ) ; certificateData . put ( "C" , tCountry . getText ( ) ) ; certificateData . put ( "keypass" , tKeyPassword . getText ( ) ) ; certificateData . put ( "storepass" , tKeystorePassword . getText ( ) ) ; try { XmlSecurityCertificate certificate = new XmlSecurityCertificate ( ) ; <START_BUG> keyStore = new Keystore ( keystore , tKeystorePassword . getText ( ) , "JCEKS" ) ; <END_BUG> keyStore . store ( ) ; generatedKeystore = keyStore . generateCertificate ( tKeyName . getText ( ) , certificate ) ; } catch ( Exception ex ) { Utils . logError ( ex , "Keystore<seq2seq4repair_space>generation<seq2seq4repair_space>failed" ) ; generatedKeystore = false ; } if ( generatedKeystore ) { lResult . setText ( NLS . bind ( keystoreGenerated , new Object [ ] { keystoreName , name } ) ) ; updateStatus ( null ) ; } else { lResult . setText ( keystoreGenerationFailed ) ; } } public void onEnterPage ( ) { } public IWizardPage getNextPage ( ) { } private void saveDataToModel ( ) { } }

Fix:
keyStore = new Keystore ( keystore , tKeystorePassword . getText ( ) , Globals . KEYSTORE_TYPE ) ;
Buggy code:
class TransformStructure extends J3dStructure implements ObjectUpdate { private HashSet < TransformStructure . TransformData > transformSet = new HashSet < TransformStructure . TransformData > ( ) ; private ArrayList objectList = new ArrayList ( ) ; private ArrayList blUsers = new ArrayList ( ) ; private UpdateTargets targets = new UpdateTargets ( ) ; private ArrayList collisionObjectList = new ArrayList ( ) ; private ArrayList dirtyTransformGroups = new ArrayList ( ) ; private ArrayList keySet = new ArrayList ( ) ; private ArrayList < TransformGroupRetained > activeTraverseList = new ArrayList < TransformGroupRetained > ( ) ; private ArrayList switchDirtyTgList = new ArrayList ( 1 ) ; private boolean lazyUpdate = false ; private ArrayList switchChangedList = new ArrayList ( ) ; private boolean inUpdateObjectList = false ; TransformStructure ( VirtualUniverse u ) { } void processMessages ( long referenceTime ) { } void processCurrentLocalToVworld ( ) { } private void sortTransformGroups ( int size , TransformGroupRetained [ ] tgs ) { } private void insertSort ( int size , TransformGroupRetained [ ] tgs ) { } private void quicksort ( int l , int r , TransformGroupRetained [ ] tgs ) { } public void updateObject ( ) { } void processLastSwitchOn ( ) { } void processLastLocalToVworld ( ) { } void processGeometryAtomVwcBounds ( ) { } void processVwcBounds ( ) { } void processRegionBoundChanged ( J3dMessage m ) { } void processBoundsChanged ( Object [ ] gaArray , Bounds updateBounds ) { } void processCollisionBoundChanged ( J3dMessage m ) { int i ; Shape3DRetained ms ; Bounds collisionBound = ( ( Bounds ) ( m . args [ 1 ] ) ) ; if ( ( m . args [ 0 ] ) instanceof GroupRetained ) { GroupRetained g = ( ( GroupRetained ) ( m . args [ 0 ] ) ) ; if ( ( g . mirrorGroup ) != null ) { <START_BUG> objectList . add ( g . mirrorGroup ) ; <END_BUG> } } else { Object [ ] gaArray = ( ( Object [ ] ) ( m . args [ 0 ] ) ) ; GeometryAtom ga ; for ( i = 0 ; i < ( gaArray . length ) ; i ++ ) { ga = ( ( GeometryAtom ) ( gaArray [ i ] ) ) ; ms = ga . source ; ms . collisionBound = collisionBound ; if ( ( ms . collisionBound ) != null ) { ms . collisionVwcBound = ( ( Bounds ) ( ms . collisionBound . clone ( ) ) ) ; } else { ms . collisionVwcBound = ms . vwcBounds ; } } collisionObjectList . add ( gaArray ) ; } } void processBoundsAutoComputeChanged ( J3dMessage m ) { } void processSwitchChanged ( J3dMessage m ) { } UpdateTargets getTargetList ( ) { } ArrayList getBlUsers ( ) { } boolean getLazyUpdate ( ) { } void removeNodes ( J3dMessage m ) { } void cleanup ( ) { } private class TransformData { private TransformGroupRetained transformGroupRetained ; private Transform3D transform3D ; TransformData ( TransformGroupRetained tgr , Transform3D t3d ) { } @ Override public int hashCode ( ) { } @ Override public boolean equals ( Object o ) { } TransformGroupRetained getTransformGroupRetained ( ) { } Transform3D getTransform3D ( ) { } } }

Fix:
objectList . add ( g . mirrorGroup . toArray ( ) ) ;
Buggy code:
public class LinkUpdateDaoTest extends BaseTest { private static final String TABLE_RDAP_LINK = "RDAP_LINK" ; private static final String TABLE_REL_LINK_OBJECT = "REL_LINK_OBJECT" ; private static final String TABLE_RDAP_LINK_HREFLANG = "RDAP_LINK_HREFLANG" ; @ Autowired private UpdateDao < Link , LinkDto > updateDao ; @ Test @ DatabaseSetup ( "teardown.xml" ) @ DatabaseTearDown ( "teardown.xml" ) public void testcreateLink ( ) throws Exception { } public static List < LinkDto > createLinkList ( ) { } public static void assertCreate ( ) throws Exception { <START_BUG> assertTablesForUpdate ( "Link-update.xml" , LinkUpdateDaoTest . TABLE_RDAP_LINK , LinkUpdateDaoTest . TABLE_REL_LINK_OBJECT , LinkUpdateDaoTest . TABLE_RDAP_LINK_HREFLANG ) ; <END_BUG> } }

Fix:
assertTablesForUpdate ( "link-update.xml" , LinkUpdateDaoTest . TABLE_RDAP_LINK , LinkUpdateDaoTest . TABLE_REL_LINK_OBJECT , LinkUpdateDaoTest . TABLE_RDAP_LINK_HREFLANG ) ;
Buggy code:
public class RormSimilarity { public static void main ( String [ ] args ) throws Exception { PNMLSerializer pnmlSerializer = new PNMLSerializer ( ) ; <START_BUG> String filePath = "C:\\Users\\Shudi\\Desktop\\rorm\\test\\a2.s00000023__s00000863.pnml" ; <END_BUG> NetSystem net = pnmlSerializer . parse ( filePath ) ; RefinedOrderingRelationsMatrix rorm = new RefinedOrderingRelationsMatrix ( ( ( NetSystem ) ( net . clone ( ) ) ) , false ) ; rorm . printMatrix ( ) ; } public RefinedOrderingRelationsMatrix feature ( NetSystem net ) { } public float similarity ( NetSystem net1 , NetSystem net2 ) { } public long [ ] similarityWithTime ( NetSystem net1 , NetSystem net2 ) { } public float similarityWithoutNever ( RefinedOrderingRelationsMatrix matrix1 , RefinedOrderingRelationsMatrix matrix2 ) { } public float similarityWithNever ( RefinedOrderingRelationsMatrix matrix1 , RefinedOrderingRelationsMatrix matrix2 ) { } }

Fix:
String filePath = "C:\\Users\\Shudi\\Desktop\\rorm\\test\\cut1142.pnml" ;
Buggy code:
public class GameControls { private final Player currentPlayer ; public final BoardState currentTurn ; private BoardState nextTurn ; public final MoveValidator moveValidator ; public final boolean isOrder ; public GameControls ( BoardState currentTurn , Player currentPlayer , MoveValidator moveValidator , boolean isOrder ) { } public void playCard ( UndeployedCard card , int row , int col ) { if ( ( this . nextTurn ) != null ) throw new IllegalArgumentException ( "This<seq2seq4repair_space>turn<seq2seq4repair_space>is<seq2seq4repair_space>already<seq2seq4repair_space>complete<seq2seq4repair_space>and<seq2seq4repair_space>can<seq2seq4repair_space>not<seq2seq4repair_space>be<seq2seq4repair_space>changed." ) ; <START_BUG> if ( this . moveValidator . apply ( this . currentTurn , card , this . currentPlayer , row , col ) ) <END_BUG> throw new IllegalArgumentException ( ) ; this . nextTurn = this . currentTurn . playCard ( this . currentPlayer , card , row , col ) ; } public BoardState getCopyOfBoard ( ) { } public BoardState getNextTurn ( ) { } public List < GameControls . PossibleMove > getValidMoves ( ) { } public static class PossibleMove { public final UndeployedCard toPlay ; public final int row ; public final int col ; public PossibleMove ( UndeployedCard toPlay , int row , int col ) { } } }

Fix:
if ( ! ( this . moveValidator . apply ( this . currentTurn , card , this . currentPlayer , row , col ) ) )
Buggy code:
public class WebRequestEncoder { boolean firstParameter = true ; AppendingStringBuffer url ; public WebRequestEncoder ( AppendingStringBuffer url ) { } public void addValue ( String key , Object value ) { if ( value instanceof String [ ] ) { String [ ] values = ( ( String [ ] ) ( value ) ) ; for ( int i = 0 ; i < ( values . length ) ; i ++ ) { addValue ( key , values [ i ] ) ; } } else if ( value instanceof String ) { addValue ( key , ( ( String ) ( value ) ) ) ; } else { <START_BUG> throw new IllegalArgumentException ( "PageParameters<seq2seq4repair_space>can<seq2seq4repair_space>only<seq2seq4repair_space>contain<seq2seq4repair_space>String<seq2seq4repair_space>or<seq2seq4repair_space>String[]" ) ; <END_BUG> } } public void addValue ( String key , String value ) { } }

Fix:
addValue ( key , value . toString ( ) ) ;
Buggy code:
public class LabelFieldGBC extends GridBagConstraints { public LabelFieldGBC ( ) { } public LabelFieldGBC forLabel ( ) { fill = GridBagConstraints . NONE ; gridx = 0 ; <START_BUG> anchor = GridBagConstraints . EAST ; <END_BUG> weightx = 0.0 ; return this ; } public LabelFieldGBC forLastLabel ( ) { } public LabelFieldGBC forField ( ) { } public LabelFieldGBC forLastField ( ) { } }

Fix:
anchor = GridBagConstraints . NORTHEAST ;
Buggy code:
public class TestExplanations extends LuceneTestCase { protected IndexSearcher searcher ; protected IndexReader reader ; protected Directory directory ; public static final String KEY = "KEY" ; public static final String FIELD = "field" ; public static final QueryParser qp = new QueryParser ( TEST_VERSION_CURRENT , TestExplanations . FIELD , new MockAnalyzer ( ) ) ; @ Override public void tearDown ( ) throws Exception { } @ Override public void setUp ( ) throws Exception { } protected String [ ] docFields = new String [ ] { "w1<seq2seq4repair_space>w2<seq2seq4repair_space>w3<seq2seq4repair_space>w4<seq2seq4repair_space>w5" , "w1<seq2seq4repair_space>w3<seq2seq4repair_space>w2<seq2seq4repair_space>w3<seq2seq4repair_space>zz" , "w1<seq2seq4repair_space>xx<seq2seq4repair_space>w2<seq2seq4repair_space>yy<seq2seq4repair_space>w3" , "w1<seq2seq4repair_space>w3<seq2seq4repair_space>xx<seq2seq4repair_space>w2<seq2seq4repair_space>yy<seq2seq4repair_space>w3<seq2seq4repair_space>zz" } ; public Query makeQuery ( String queryText ) throws ParseException { } public void qtest ( String queryText , int [ ] expDocNrs ) throws Exception { } public void qtest ( Query q , int [ ] expDocNrs ) throws Exception { <START_BUG> CheckHits . checkHitCollector ( q , TestExplanations . FIELD , searcher , expDocNrs ) ; <END_BUG> } public void bqtest ( Query q , int [ ] expDocNrs ) throws Exception { } public void bqtest ( String queryText , int [ ] expDocNrs ) throws Exception { } public static class ItemizedFilter extends FieldCacheTermsFilter { private static String [ ] int2str ( int [ ] terms ) { } public ItemizedFilter ( String keyField , int [ ] keys ) { } public ItemizedFilter ( int [ ] keys ) { } } public static Term [ ] ta ( String [ ] s ) { } public SpanTermQuery st ( String s ) { } public SpanNotQuery snot ( SpanQuery i , SpanQuery e ) { } public SpanOrQuery sor ( String s , String e ) { } public SpanOrQuery sor ( SpanQuery s , SpanQuery e ) { } public SpanOrQuery sor ( String s , String m , String e ) { } public SpanOrQuery sor ( SpanQuery s , SpanQuery m , SpanQuery e ) { } public SpanNearQuery snear ( String s , String e , int slop , boolean inOrder ) { } public SpanNearQuery snear ( SpanQuery s , SpanQuery e , int slop , boolean inOrder ) { } public SpanNearQuery snear ( String s , String m , String e , int slop , boolean inOrder ) { } public SpanNearQuery snear ( SpanQuery s , SpanQuery m , SpanQuery e , int slop , boolean inOrder ) { } public SpanFirstQuery sf ( String s , int b ) { } public Query optB ( String q ) throws Exception { } public Query optB ( Query q ) throws Exception { } public Query reqB ( String q ) throws Exception { } public Query reqB ( Query q ) throws Exception { } public void testNoop ( ) { } }

Fix:
CheckHits . checkHitCollector ( random , q , TestExplanations . FIELD , searcher , expDocNrs ) ;
Buggy code:
@ RunWith ( Arquillian . class ) @ RunAsClient public class ConnectionFactoryManagementTestCase extends ContainerResourceMgmtTestBase { private static final String CF_NAME = UUID . randomUUID ( ) . toString ( ) ; private static final ModelNode address = new ModelNode ( ) ; @ Test public void testWriteDiscoveryGroupAttributeWhenConnectorIsAlreadyDefined ( ) throws Exception { final ModelNode add = new ModelNode ( ) ; add . get ( OP ) . set ( ADD ) ; add . get ( OP_ADDR ) . set ( ConnectionFactoryManagementTestCase . address ) ; ModelNode connector = new ModelNode ( ) ; connector . get ( "in-vm" ) . set ( new ModelNode ( ) ) ; add . get ( CONNECTOR ) . set ( connector ) ; ModelNode entries = new ModelNode ( ) ; entries . add ( ( "java://jms//" + ( ConnectionFactoryManagementTestCase . CF_NAME ) ) ) ; add . get ( ENTRIES ) . set ( entries ) ; executeOperation ( add ) ; final ModelNode writeAttribute = new ModelNode ( ) ; writeAttribute . get ( OP ) . set ( WRITE_ATTRIBUTE_OPERATION ) ; writeAttribute . get ( OP_ADDR ) . set ( ConnectionFactoryManagementTestCase . address ) ; writeAttribute . get ( NAME ) . set ( DISCOVERY_GROUP_NAME ) ; writeAttribute . get ( VALUE ) . set ( UUID . randomUUID ( ) . toString ( ) ) ; try { executeOperation ( writeAttribute ) ; fail ( "it<seq2seq4repair_space>is<seq2seq4repair_space>not<seq2seq4repair_space>possible<seq2seq4repair_space>to<seq2seq4repair_space>define<seq2seq4repair_space>a<seq2seq4repair_space>discovery<seq2seq4repair_space>group<seq2seq4repair_space>when<seq2seq4repair_space>the<seq2seq4repair_space>connector<seq2seq4repair_space>attribute<seq2seq4repair_space>is<seq2seq4repair_space>already<seq2seq4repair_space>defined" ) ; } catch ( MgmtOperationException e ) { assertEquals ( FAILED , e . getResult ( ) . get ( OUTCOME ) . asString ( ) ) ; assertEquals ( true , e . getResult ( ) . get ( ROLLED_BACK ) . asBoolean ( ) ) ; <START_BUG> assertTrue ( e . getResult ( ) . get ( FAILURE_DESCRIPTION ) . asString ( ) . contains ( "WFLYMSG0019" ) ) ; <END_BUG> } final ModelNode remove = new ModelNode ( ) ; remove . get ( OP ) . set ( REMOVE ) ; remove . get ( OP_ADDR ) . set ( ConnectionFactoryManagementTestCase . address ) ; executeOperation ( remove ) ; } }

Fix:
assertTrue ( e . getResult ( ) . get ( FAILURE_DESCRIPTION ) . asString ( ) . contains ( "JBAS011630" ) ) ;
Buggy code:
public class BootStrapper { private static final Logger logger = LoggerFactory . getLogger ( BootStrapper . class ) ; protected final InetAddress address ; protected final Token token ; protected final TokenMetadata tokenMetadata ; public BootStrapper ( InetAddress address , Token token , TokenMetadata tmd ) { } public void bootstrap ( ) throws IOException { } public static Token getBootstrapToken ( final TokenMetadata metadata , final Map < InetAddress , Double > load ) throws IOException , ConfigurationException { } public static Token getBalancedToken ( TokenMetadata metadata , Map < InetAddress , Double > load ) { } static InetAddress getBootstrapSource ( final TokenMetadata metadata , final Map < InetAddress , Double > load ) { } Multimap < Range , InetAddress > getRangesWithSources ( String table ) { } static Token < ? > getBootstrapTokenFrom ( InetAddress maxEndpoint ) { } static Multimap < InetAddress , Range > getWorkMap ( Multimap < Range , InetAddress > rangesWithSourceTarget ) { } static Multimap < InetAddress , Range > getWorkMap ( Multimap < Range , InetAddress > rangesWithSourceTarget , IFailureDetector failureDetector ) { } public static class BootstrapTokenVerbHandler implements IVerbHandler { public void doVerb ( Message message ) { StorageService ss = StorageService . instance ; String tokenString = StorageService . getPartitioner ( ) . getTokenFactory ( ) . toString ( ss . getBootstrapToken ( ) ) ; <START_BUG> Message response = message . getReply ( FBUtilities . getLocalAddress ( ) , tokenString . getBytes ( Charsets . UTF_8 ) ) ; <END_BUG> instance . sendOneWay ( response , message . getFrom ( ) ) ; } } private static class BootstrapTokenCallback implements IAsyncCallback { private volatile Token < ? > token ; private final Condition condition = new SimpleCondition ( ) ; public Token < ? > getToken ( ) { } public void response ( Message msg ) { } } }

Fix:
Message response = message . getInternalReply ( tokenString . getBytes ( Charsets . UTF_8 ) ) ;
Buggy code:
public class BestCowLine { String string ; public BestCowLine ( String string ) { } String solve ( ) { int a = 0 ; int b = ( string . length ( ) ) - 1 ; StringWriter writer = new StringWriter ( ) ; while ( a <= b ) { boolean left = false ; for ( int i = 0 ; ( a + i ) <= b ; i ++ ) { if ( ( string . charAt ( ( a + i ) ) ) < ( string . charAt ( ( b - i ) ) ) ) { left = true ; break ; } else <START_BUG> if ( ( string . charAt ( ( a + i ) ) ) < ( string . charAt ( ( b - i ) ) ) ) { <END_BUG> left = false ; break ; } } if ( left ) writer . append ( string . charAt ( ( a ++ ) ) ) ; else writer . append ( string . charAt ( ( b -- ) ) ) ; } return writer . toString ( ) ; } public static void main ( String [ ] args ) { } }

Fix:
if ( ( string . charAt ( ( a + i ) ) ) > ( string . charAt ( ( b - i ) ) ) ) {