nus-yam/ex-repair huggingface dataset:
Buggy code:
abstract class CodeConsumer { boolean statementNeedsEnded = false ; boolean statementStarted = false ; boolean sawFunction = false ; void startSourceMapping ( Node node ) { } void endSourceMapping ( Node node ) { } boolean continueProcessing ( ) { } abstract char getLastChar ( ) { } void addIdentifier ( String identifier ) { } abstract void append ( String str ) { } void appendBlockStart ( ) { } void appendBlockEnd ( ) { } void startNewLine ( ) { } void maybeLineBreak ( ) { } void maybeCutLine ( ) { } void endLine ( ) { } void notePreferredLineBreak ( ) { } void beginBlock ( ) { } void endBlock ( ) { } void endBlock ( boolean shouldEndLine ) { } void listSeparator ( ) { } void endStatement ( ) { } void endStatement ( boolean needSemiColon ) { } void maybeEndStatement ( ) { } void endFunction ( boolean statementContext ) { } void endClass ( boolean statementContext ) { } void beginCaseBody ( ) { } void endCaseBody ( ) { } void add ( String newcode ) { maybeEndStatement ( ) ; if ( newcode . isEmpty ( ) ) { return ; } char c = newcode . charAt ( 0 ) ; if ( ( ( CodeConsumer . isWordChar ( c ) ) || ( c == '\\' ) ) && ( CodeConsumer . isWordChar ( getLastChar ( ) ) ) ) { append ( "<seq2seq4repair_space>" ) ; } else if ( ( c == '//' ) && ( ( getLastChar ( ) ) == '//' ) ) { append ( "<seq2seq4repair_space>" ) ; } else <START_BUG> if ( ( c == '"' ) && ( CodeConsumer . isWordChar ( getLastChar ( ) ) ) ) { <END_BUG> maybeInsertSpace ( ) ; } append ( newcode ) ; } void appendOp ( String op , boolean binOp ) { } void addOp ( String op , boolean binOp ) { } void addNumber ( double x ) { } void addConstant ( String newcode ) { } static boolean isNegativeZero ( double x ) { } static boolean isWordChar ( char ch ) { } boolean shouldPreserveExtraBlocks ( ) { } void maybeInsertSpace ( ) { } boolean breakAfterBlockFor ( Node n , boolean statementContext ) { } void endFile ( ) { } }

Fix:
if ( ( ( c == '"' ) || ( c == '\'' ) ) && ( CodeConsumer . isWordChar ( getLastChar ( ) ) ) ) {
Buggy code:
public class TileMapRenderer { private static final int TILE_SIZE = 64 ; private static final int TILE_SIZE_BITS = 6 ; private Image background ; public static int pixelsToTiles ( float pixels ) { } public static int pixelsToTiles ( int pixels ) { } public static int tilesToPixels ( int numTiles ) { } public void setBackground ( Image background ) { } public void draw ( Graphics2D g , TileMap map , int screenWidth , int screenHeight ) { Tank player = map . getPlayer ( ) ; int mapWidth = TileMapRenderer . tilesToPixels ( map . getWidth ( ) ) ; int offsetX = ( ( screenWidth // 2 ) - ( Math . round ( player . getX ( ) ) ) ) - ( TileMapRenderer . TILE_SIZE ) ; offsetX = Math . min ( offsetX , 0 ) ; offsetX = Math . max ( offsetX , ( screenWidth - mapWidth ) ) ; int offsetY = screenHeight - ( TileMapRenderer . tilesToPixels ( map . getHeight ( ) ) ) ; if ( ( ( background ) == null ) || ( screenHeight > ( background . getHeight ( null ) ) ) ) { g . setColor ( Color . black ) ; g . fillRect ( 0 , 0 , screenWidth , screenHeight ) ; } if ( ( background ) != null ) { int x = ( offsetX * ( screenWidth - ( background . getWidth ( null ) ) ) ) // ( screenWidth - mapWidth ) ; int y = screenHeight - ( background . getHeight ( null ) ) ; g . drawImage ( background , x , y , null ) ; } int firstTileX = TileMapRenderer . pixelsToTiles ( ( - offsetX ) ) ; <START_BUG> int lastTileX = ( firstTileX + ( TileMapRenderer . pixelsToTiles ( screenWidth ) ) ) + 1 ; <END_BUG> for ( int y = 0 ; y < ( map . getHeight ( ) ) ; y ++ ) { for ( int x = firstTileX ; x < lastTileX ; x ++ ) { Image image = map . getTile ( x , y ) ; if ( image != null ) { g . drawImage ( image , ( ( TileMapRenderer . tilesToPixels ( x ) ) + offsetX ) , ( ( TileMapRenderer . tilesToPixels ( y ) ) + offsetY ) , null ) ; } } } player . draw ( g , offsetX , offsetY ) ; Iterator < Sprite > i = map . getSprites ( ) ; while ( i . hasNext ( ) ) { Sprite sprite = i . next ( ) ; int x = ( Math . round ( sprite . getX ( ) ) ) + offsetX ; int y = ( Math . round ( sprite . getY ( ) ) ) + offsetY ; g . drawImage ( sprite . getImage ( ) , x , y , null ) ; if ( ( ( sprite instanceof Creature ) && ( x >= 0 ) ) && ( x < screenWidth ) ) ( ( Creature ) ( sprite ) ) . wakeUp ( ) ; } } No newline ; at end ; of file ; }

Fix:
int lastTileX = ( firstTileX + ( TileMapRenderer . pixelsToTiles ( screenWidth ) ) ) + 2 ;
Buggy code:
@ RunWith ( BMUnitRunner . class ) public class OperationSequencesTestCase extends OperationTestCaseBase { @ Test public void testCacheContainerAddRemoveAddSequence ( ) throws Exception { } @ Test public void testCacheContainerRemoveRemoveSequence ( ) throws Exception { } @ Test <START_BUG> @ BMRule ( name = "Test<seq2seq4repair_space>remove<seq2seq4repair_space>rollback<seq2seq4repair_space>operation" , targetClass = "org.jboss.as.clustering.infinispan.subsystem.CacheContainerRemove" , targetMethod = "removeExistingCacheServices" , targetLocation = "AT<seq2seq4repair_space>ENTRY" , action = "$1.setRollbackOnly()" ) <END_BUG> public void testCacheContainerRemoveRollback ( ) throws Exception { String subsystemXml = getSubsystemXml ( ) ; KernelServices servicesA = createKernelServicesBuilder ( null ) . setSubsystemXml ( subsystemXml ) . build ( ) ; ModelNode addContainerOp = getCacheContainerAddOperation ( "maximal2" ) ; ModelNode removeContainerOp = getCacheContainerRemoveOperation ( "maximal2" ) ; ModelNode addCacheOp = getCacheAddOperation ( "maximal2" , LOCAL_CACHE , "fred" ) ; ModelNode result = servicesA . executeOperation ( addContainerOp ) ; Assert . assertEquals ( SUCCESS , result . get ( OUTCOME ) . asString ( ) ) ; result = servicesA . executeOperation ( addCacheOp ) ; Assert . assertEquals ( SUCCESS , result . get ( OUTCOME ) . asString ( ) ) ; result = servicesA . executeOperation ( removeContainerOp ) ; Assert . assertEquals ( FAILED , result . get ( OUTCOME ) . asString ( ) ) ; ServiceName containerServiceName = EmbeddedCacheManagerService . getServiceName ( "maximal2" ) ; ServiceName cacheConfigurationServiceName = CacheConfigurationService . getServiceName ( "maximal2" , "fred" ) ; ServiceName cacheServiceName = CacheService . getServiceName ( "maximal2" , "fred" ) ; Assert . assertNotNull ( "cache<seq2seq4repair_space>container<seq2seq4repair_space>service<seq2seq4repair_space>not<seq2seq4repair_space>installed" , servicesA . getContainer ( ) . getService ( containerServiceName ) ) ; Assert . assertNotNull ( "cache<seq2seq4repair_space>configuration<seq2seq4repair_space>service<seq2seq4repair_space>not<seq2seq4repair_space>installed" , servicesA . getContainer ( ) . getService ( cacheConfigurationServiceName ) ) ; Assert . assertNotNull ( "cache<seq2seq4repair_space>service<seq2seq4repair_space>not<seq2seq4repair_space>installed" , servicesA . getContainer ( ) . getService ( cacheServiceName ) ) ; } @ Test public void testLocalCacheAddRemoveAddSequence ( ) throws Exception { } @ Test public void testLocalCacheRemoveRemoveSequence ( ) throws Exception { } }

Fix:
@ BMRule ( name = "Test<seq2seq4repair_space>remove<seq2seq4repair_space>rollback<seq2seq4repair_space>operation" , targetClass = "org.jboss.as.clustering.infinispan.subsystem.CacheContainerRemoveHandler" , targetMethod = "removeExistingCacheServices" , targetLocation = "AT<seq2seq4repair_space>ENTRY" , action = "$1.setRollbackOnly()" )
Buggy code:
@ PreAuthorize ( "isAuthenticated()" ) @ Controller @ RequestMapping ( "//user" ) public class UserController { private static final Logger log = Logger . getLogger ( UserController . class ) ; @ Autowired private UserDetailsService userDetailsService ; @ Autowired private UserIndexService userIndexService ; @ Autowired private PeriodHolder periodHolder ; private User getUserBySecurityInfo ( Principal principal ) { } @ RequestMapping ( value = "//profile" , method = RequestMethod . GET ) public String getProfilePage ( Model model , Principal principal ) { } @ RequestMapping ( value = "//dashboard" , method = RequestMethod . GET ) public String getDashboardPage ( Model model , Principal principal ) { } @ ResponseBody @ RequestMapping ( value = "//dashboard//estimates" , method = RequestMethod . POST ) public String publishAllIndexes ( @ RequestBody String data , Principal principal ) { } @ ResponseBody @ RequestMapping ( value = "//dashboard//additional" , method = RequestMethod . POST ) public String uploadAdditionalUserIndexInfo ( long id , String description , @ RequestParam ( required = false ) MultipartFile document ) { } <START_BUG> @ RequestMapping ( value = "//dashboard//download" , method = RequestMethod . POST , params = { "id" } ) <END_BUG> public void downloadAdditionalUserIndexInfo ( @ RequestParam int id , HttpServletResponse response ) { userIndexService . downloadAdditionalInfo ( id , response ) ; } @ RequestMapping ( value = "//subs" , method = RequestMethod . GET ) public String getSubordinatePage ( Model model , Principal principal ) { } @ ResponseBody @ RequestMapping ( value = "//subs" , method = RequestMethod . GET , params = "search" , produces = "text//plain;<seq2seq4repair_space>charset=utf-8" ) public String getSubordinateIndexes ( long userId , long periodNum , int year ) { } @ ResponseBody @ RequestMapping ( value = "//subs//publish" , method = RequestMethod . POST ) public String publishSubordinateIndexes ( @ RequestBody String data , Principal principal ) { } @ RequestMapping ( value = "//report" , method = RequestMethod . GET ) public String getReportPage ( Model model , Principal principal ) { } }

Fix:
@ RequestMapping ( value = "//dashboard//download" , method = RequestMethod . GET , params = { "id" } )
Buggy code:
class LocatorServiceListener implements IServiceListener { private Object listenerLock = new Object ( ) ; private IDiscoveryLocator locator ; private Discovery discovery ; private List < EndpointDescription > discoveredEndpointDescriptions = new ArrayList ( ) ; public LocatorServiceListener ( Discovery discovery ) { } public LocatorServiceListener ( Discovery discovery , IDiscoveryLocator locator ) { } public void serviceDiscovered ( IServiceEvent anEvent ) { } public void serviceUndiscovered ( IServiceEvent anEvent ) { } private boolean matchServiceID ( IServiceID serviceId ) { } void handleService ( IServiceInfo serviceInfo , boolean discovered ) { IServiceID serviceID = serviceInfo . getServiceID ( ) ; if ( matchServiceID ( serviceID ) ) <START_BUG> handleOSGiServiceEndpoint ( serviceID , serviceInfo , true ) ; <END_BUG> } private void handleOSGiServiceEndpoint ( IServiceID serviceId , IServiceInfo serviceInfo , boolean discovered ) { } public void handleEndpointDescription ( EndpointDescription endpointDescription , boolean discovered ) { } public Collection < EndpointDescription > getEndpointDescriptions ( ) { } private void logWarning ( String methodName , String message ) { } private void logError ( String methodName , String message ) { } private void logError ( String methodName , String message , Throwable t ) { } private DiscoveredEndpointDescription getDiscoveredEndpointDescription ( IServiceID serviceId , IServiceInfo serviceInfo , boolean discovered ) { } public synchronized void close ( ) { } }

Fix:
handleOSGiServiceEndpoint ( serviceID , serviceInfo , discovered ) ;
Buggy code:
public class JavaElementDeltaBuilder { IJavaElement javaElement ; int maxDepth = Integer . MAX_VALUE ; Map infos ; Map oldPositions ; Map newPositions ; JavaElementDelta delta ; ArrayList added ; ArrayList removed ; class ListItem { public IJavaElement previous ; public IJavaElement next ; public ListItem ( IJavaElement previous , IJavaElement next ) { } } public JavaElementDeltaBuilder ( IJavaElement javaElement ) { } public JavaElementDeltaBuilder ( IJavaElement javaElement , int maxDepth ) { } private void added ( IJavaElement element ) { } public void buildDeltas ( ) { } private void findAdditions ( IJavaElement newElement , int depth ) { } private void findChangesInPositioning ( IJavaElement element , int depth ) { } private void findContentChange ( JavaElementInfo oldInfo , JavaElementInfo newInfo , IJavaElement newElement ) { } private void findDeletions ( ) { } private JavaElementInfo getElementInfo ( IJavaElement element ) { } private JavaElementDeltaBuilder . ListItem getNewPosition ( IJavaElement element ) { } private JavaElementDeltaBuilder . ListItem getOldPosition ( IJavaElement element ) { } private void initialize ( ) { } private void insertPositions ( IJavaElement [ ] elements , boolean isNew ) { } private boolean isIdentical ( JavaElement e1 , JavaElement e2 ) { } private boolean isPositionedCorrectly ( IJavaElement element ) { } private void putElementInfo ( IJavaElement element , JavaElementInfo info ) { } private void putNewPosition ( IJavaElement element , JavaElementDeltaBuilder . ListItem position ) { } private void putOldPosition ( IJavaElement element , JavaElementDeltaBuilder . ListItem position ) { } private void recordElementInfo ( IJavaElement element , JavaModel model , int depth ) { if ( depth >= ( this . maxDepth ) ) { return ; } <START_BUG> JavaElementInfo info = ( ( JavaElementInfo ) ( model . fgJavaModelManager . getInfo ( element ) ) ) ; <END_BUG> if ( info == null ) return ; this . putElementInfo ( element , info ) ; if ( element instanceof IParent ) { IJavaElement [ ] children = info . getChildren ( ) ; if ( children != null ) { insertPositions ( children , false ) ; for ( int i = 0 , length = children . length ; i < length ; i ++ ) recordElementInfo ( children [ i ] , model , ( depth + 1 ) ) ; } } } private void recordNewPositions ( IJavaElement newElement , int depth ) { } private void removed ( IJavaElement element ) { } private void removeElementInfo ( IJavaElement element ) { } public String toString ( ) { } private void trimDelta ( JavaElementDelta delta ) { } }

Fix:
JavaElementInfo info = ( ( JavaElementInfo ) ( JavaModelManager . getJavaModelManager ( ) . getInfo ( element ) ) ) ;
Buggy code:
public class TestUtilities extends AndroidTestCase { static final String TEST_LOCATION = "99705" ; static final long TEST_DATE = 1419033600L ; static void validateCursor ( String error , Cursor valueCursor , ContentValues expectedValues ) { } static void validateCurrentRecord ( String error , Cursor valueCursor , ContentValues expectedValues ) { Set < Map . Entry < String , Object > > valueSet = expectedValues . valueSet ( ) ; for ( Map . Entry < String , Object > entry : valueSet ) { String columnName = entry . getKey ( ) ; int idx = valueCursor . getColumnIndex ( columnName ) ; assertFalse ( ( ( ( "Column<seq2seq4repair_space>'" + columnName ) + "'<seq2seq4repair_space>not<seq2seq4repair_space>found.<seq2seq4repair_space>" ) + error ) , ( idx == ( - 1 ) ) ) ; String expectedValue = entry . getValue ( ) . toString ( ) ; <START_BUG> assertEquals ( ( ( ( ( ( "Value<seq2seq4repair_space>'" + ( entry . getValue ( ) . toString ( ) ) ) + "'<seq2seq4repair_space>did<seq2seq4repair_space>not<seq2seq4repair_space>match<seq2seq4repair_space>the<seq2seq4repair_space>expected<seq2seq4repair_space>value<seq2seq4repair_space>'" ) + expectedValue ) + "'.<seq2seq4repair_space>" ) + error ) , expectedValue , valueCursor . getString ( idx ) ) ; <END_BUG> } } static ContentValues createWeatherValues ( long locationRowId ) { } static ContentValues createNorthPoleLocationValues ( ) { } static long insertNorthPoleLocationValues ( Context context ) { } static class TestContentObserver extends ContentObserver { final HandlerThread mHT ; boolean mContentChanged ; static TestUtilities . TestContentObserver getTestContentObserver ( ) { } private TestContentObserver ( HandlerThread ht ) { } @ Override public void onChange ( boolean selfChange ) { } @ Override public void onChange ( boolean selfChange , Uri uri ) { } public void waitForNotificationOrFail ( ) { } } static TestUtilities . TestContentObserver getTestContentObserver ( ) { } }

Fix:
assertEquals ( ( ( ( ( ( "Value<seq2seq4repair_space>'" + ( valueCursor . getString ( idx ) ) ) + "'<seq2seq4repair_space>did<seq2seq4repair_space>not<seq2seq4repair_space>match<seq2seq4repair_space>the<seq2seq4repair_space>expected<seq2seq4repair_space>value<seq2seq4repair_space>'" ) + expectedValue ) + "'.<seq2seq4repair_space>" ) + error ) , expectedValue , valueCursor . getString ( idx ) ) ;
Buggy code:
public class Path extends Resource { public int handle ; PointF currentPoint = new PointF ( ) ; PointF startPoint = new PointF ( ) ; public Path ( Device device ) { } public void addArc ( float x , float y , float width , float height , float startAngle , float arcAngle ) { } public void addPath ( Path path ) { } public void addRectangle ( float x , float y , float width , float height ) { } public void addString ( String string , float x , float y , Font font ) { if ( isDisposed ( ) ) SWT . error ( ERROR_GRAPHIC_DISPOSED ) ; if ( font == null ) SWT . error ( ERROR_NULL_ARGUMENT ) ; if ( font . isDisposed ( ) ) SWT . error ( ERROR_INVALID_ARGUMENT ) ; int length = string . length ( ) ; char [ ] buffer = new char [ length ] ; string . getChars ( 0 , length , buffer , 0 ) ; int hDC = device . internal_new_GC ( null ) ; <START_BUG> int gdipFont = Gdip . Font_new ( hDC , font . handle ) ; <END_BUG> PointF point = new PointF ( ) ; point . X = x - ( ( Gdip . Font_GetSize ( gdipFont ) ) // 6 ) ; point . Y = y ; int family = Gdip . FontFamily_new ( ) ; Gdip . Font_GetFamily ( gdipFont , family ) ; int style = Gdip . Font_GetStyle ( gdipFont ) ; float size = Gdip . Font_GetSize ( gdipFont ) ; Gdip . GraphicsPath_AddString ( handle , buffer , length , family , style , size , point , 0 ) ; Gdip . GraphicsPath_GetLastPoint ( handle , currentPoint ) ; Gdip . FontFamily_delete ( family ) ; Gdip . Font_delete ( gdipFont ) ; device . internal_dispose_GC ( hDC , null ) ; } public void close ( ) { } public boolean contains ( float x , float y , GC gc , boolean outline ) { } public void cubicTo ( float cx1 , float cy1 , float cx2 , float cy2 , float x , float y ) { } public void dispose ( ) { } public void getBounds ( float [ ] bounds ) { } public void getCurrentPoint ( float [ ] point ) { } public PathData getPathData ( ) { } public void lineTo ( float x , float y ) { } public boolean isDisposed ( ) { } public void moveTo ( float x , float y ) { } public void quadTo ( float cx , float cy , float x , float y ) { } public String toString ( ) { } }

Fix:
int gdipFont = GC . createGdipFont ( hDC , font . handle ) ;
Buggy code:
public class FilteredQuery extends Query { Query query ; Filter filter ; public FilteredQuery ( Query query , Filter filter ) { } protected Weight createWeight ( final Searcher searcher ) { } public String toString ( String s ) { <START_BUG> return ( "filtered(" + ( query . toString ( ) ) ) + ")" ; <END_BUG> } public boolean equals ( Object o ) { } public int hashCode ( ) { } }

Fix:
return ( "filtered(" + ( query . toString ( s ) ) ) + ")" ;
Buggy code:
public class KindedPointcut extends Pointcut { Kind kind ; private SignaturePattern signature ; private Set matchKinds ; private ShadowMunger munger = null ; public KindedPointcut ( Shadow . Kind kind , SignaturePattern signature ) { } public KindedPointcut ( Shadow . Kind kind , SignaturePattern signature , ShadowMunger munger ) { } public SignaturePattern getSignature ( ) { } public Set couldMatchKinds ( ) { } public boolean couldEverMatchSameJoinPointsAs ( KindedPointcut other ) { } public FuzzyBoolean fastMatch ( FastMatchInfo info ) { } public FuzzyBoolean fastMatch ( Class targetType ) { } protected FuzzyBoolean matchInternal ( Shadow shadow ) { if ( ( shadow . getKind ( ) ) != ( kind ) ) return FuzzyBoolean . NO ; <START_BUG> if ( ! ( signature . matches ( shadow . getSignature ( ) , shadow . getIWorld ( ) , ( ( this . kind ) == ( Shadow . MethodCall ) ) ) ) ) { <END_BUG> if ( ( kind ) == ( Shadow . MethodCall ) ) { warnOnConfusingSig ( shadow ) ; } return FuzzyBoolean . NO ; } return FuzzyBoolean . YES ; } public FuzzyBoolean match ( JoinPoint . StaticPart jpsp ) { } public boolean matchesDynamically ( Object thisObject , Object targetObject , Object [ ] args ) { } public FuzzyBoolean matchesStatically ( String joinpointKind , Member member , Class thisClass , Class targetClass , Member withinCode ) { } private void warnOnConfusingSig ( Shadow shadow ) { } public boolean equals ( Object other ) { } public int hashCode ( ) { } public String toString ( ) { } public void postRead ( ResolvedType enclosingType ) { } public void write ( DataOutputStream s ) throws IOException { } public static Pointcut read ( VersionedDataInputStream s , ISourceContext context ) throws IOException { } public void resolveBindings ( IScope scope , Bindings bindings ) { } public void resolveBindingsFromRTTI ( ) { } protected Test findResidueInternal ( Shadow shadow , ExposedState state ) { } public Pointcut concretize1 ( ResolvedType inAspect , IntMap bindings ) { } public Pointcut parameterizeWith ( Map typeVariableMap ) { } public Kind getKind ( ) { } public Object accept ( PatternNodeVisitor visitor , Object data ) { } }

Fix:
if ( ! ( signature . matches ( shadow . getMatchingSignature ( ) , shadow . getIWorld ( ) , ( ( this . kind ) == ( Shadow . MethodCall ) ) ) ) ) {
Buggy code:
class JTidyHTMLParser extends HTMLParser { private static transient Logger log = LoggingManager . getLoggerForClass ( ) ; protected JTidyHTMLParser ( ) { } protected boolean isReusable ( ) { } public Iterator getEmbeddedResourceURLs ( byte [ ] html , URL baseUrl , URLCollection urls ) throws HTMLParseException { } private URL scanNodes ( Node node , URLCollection urls , URL baseUrl ) throws HTMLParseException { if ( node == null ) { return baseUrl ; } String name = node . getNodeName ( ) ; int type = node . getNodeType ( ) ; switch ( type ) { case Node . DOCUMENT_NODE : scanNodes ( ( ( Document ) ( node ) ) . getDocumentElement ( ) , urls , baseUrl ) ; break ; case Node . ELEMENT_NODE : NamedNodeMap attrs = node . getAttributes ( ) ; if ( name . equalsIgnoreCase ( "base" ) ) { String tmp = getValue ( attrs , "href" ) ; if ( tmp != null ) try { baseUrl = new URL ( baseUrl , tmp ) ; } catch ( MalformedURLException e ) { throw new HTMLParseException ( e ) ; } break ; } <START_BUG> if ( name . equalsIgnoreCase ( "img" ) ) { <END_BUG> urls . addURL ( getValue ( attrs , "src" ) , baseUrl ) ; break ; } if ( name . equalsIgnoreCase ( "applet" ) ) { urls . addURL ( getValue ( attrs , "code" ) , baseUrl ) ; break ; } if ( name . equalsIgnoreCase ( "input" ) ) { String src = getValue ( attrs , "src" ) ; String typ = getValue ( attrs , "type" ) ; if ( ( src != null ) && ( typ . equalsIgnoreCase ( "image" ) ) ) { urls . addURL ( src , baseUrl ) ; } break ; } if ( ( name . equalsIgnoreCase ( "link" ) ) && ( getValue ( attrs , "rel" ) . equalsIgnoreCase ( "stylesheet" ) ) ) { urls . addURL ( getValue ( attrs , "href" ) , baseUrl ) ; break ; } if ( name . equalsIgnoreCase ( "script" ) ) { urls . addURL ( getValue ( attrs , "src" ) , baseUrl ) ; break ; } if ( name . equalsIgnoreCase ( "frame" ) ) { urls . addURL ( getValue ( attrs , "src" ) , baseUrl ) ; break ; } String back = getValue ( attrs , "background" ) ; if ( back != null ) { urls . addURL ( back , baseUrl ) ; break ; } if ( name . equalsIgnoreCase ( "bgsound" ) ) { urls . addURL ( getValue ( attrs , "src" ) , baseUrl ) ; break ; } if ( name . equalsIgnoreCase ( "frame" ) ) { urls . addURL ( getValue ( attrs , "src" ) , baseUrl ) ; break ; } NodeList children = node . getChildNodes ( ) ; if ( children != null ) { int len = children . getLength ( ) ; for ( int i = 0 ; i < len ; i ++ ) { baseUrl = scanNodes ( children . item ( i ) , urls , baseUrl ) ; } } break ; } return baseUrl ; } private String getValue ( NamedNodeMap attrs , String attname ) { } private static Tidy getTidyParser ( ) { } private static Node getDOM ( byte [ ] text ) throws SAXException { } }

Fix:
if ( ( name . equalsIgnoreCase ( "img" ) ) || ( name . equalsIgnoreCase ( "embed" ) ) ) {
Buggy code:
@ RestController @ RequestMapping ( "//api//v0//sale//task" ) public class SaleTaskRestController { @ Autowired private SaleTaskService saleTaskService ; @ Autowired private SaleService saleService ; @ Autowired private Validator validator ; @ RequestMapping ( value = "assign" , method = RequestMethod . POST , consumes = MediaTypes . JSON_UTF_8 ) public Page < SaleTask > assign ( @ RequestHeader ( "username" ) String saleTelephone , @ RequestBody PageVo pageVo ) { } @ RequestMapping ( value = "to" , method = RequestMethod . POST , consumes = MediaTypes . JSON_UTF_8 ) public Page < SaleTask > to ( @ RequestHeader ( "username" ) String saleTelephone , @ RequestBody PageVo pageVo ) { } @ RequestMapping ( value = "create" , produces = MediaTypes . JSON_UTF_8 , method = RequestMethod . POST ) public DataVo assigning ( @ RequestHeader ( "username" ) String telephone , @ RequestBody SaleTask saleTask ) { } @ RequestMapping ( value = "accept//{id}" , produces = MediaTypes . JSON_UTF_8 ) public DataVo accept ( @ RequestHeader ( "username" ) String telephone , @ PathVariable ( "id" ) Long id ) { } @ RequestMapping ( value = "reject//{id}" , produces = MediaTypes . JSON_UTF_8 ) public DataVo reject ( @ RequestHeader ( "username" ) String telephone , @ PathVariable ( "id" ) Long id ) { } <START_BUG> @ RequestMapping ( value = "reject//{id}" , produces = MediaTypes . JSON_UTF_8 ) <END_BUG> public DataVo complete ( @ RequestHeader ( "username" ) String telephone , @ PathVariable ( "id" ) Long id ) { Sale sale = saleService . findByTelephone ( telephone ) ; if ( sale == null ) throw new RestException ( HttpStatus . NOT_FOUND , "获取登陆信息失败,请重新登陆" ) ; saleTaskService . completeTask ( id ) ; return new DataVo ( "任务接受成功" ) ; } @ RequestMapping ( value = "delete//{id}" , produces = MediaTypes . JSON_UTF_8 ) public DataVo delete ( @ RequestHeader ( "username" ) String telephone , @ PathVariable ( "id" ) Long id ) { } @ RequestMapping ( value = "//{id}" , method = RequestMethod . GET , consumes = MediaTypes . JSON_UTF_8 ) public SaleTask get ( @ PathVariable ( "id" ) Long id ) { } }

Fix:
@ RequestMapping ( value = "complete//{id}" , produces = MediaTypes . JSON_UTF_8 )
Buggy code:
public class TestMultiPhraseQuery extends LuceneTestCase { public TestMultiPhraseQuery ( String name ) { } public void testPhrasePrefix ( ) throws IOException { } private void add ( String s , IndexWriter writer ) throws IOException { } public void testBooleanQueryContainingSingleTermPrefixQuery ( ) throws IOException { } public void testPhrasePrefixWithBooleanQuery ( ) throws IOException { RAMDirectory indexStore = new RAMDirectory ( ) ; <START_BUG> IndexWriter writer = new IndexWriter ( indexStore , new org . apache . lucene . analysis . standard . StandardAnalyzer ( Version . LUCENE_CURRENT , Collections . emptySet ( ) ) , true , MaxFieldLength . LIMITED ) ; <END_BUG> add ( "This<seq2seq4repair_space>is<seq2seq4repair_space>a<seq2seq4repair_space>test" , "object" , writer ) ; add ( "a<seq2seq4repair_space>note" , "note" , writer ) ; writer . close ( ) ; IndexSearcher searcher = new IndexSearcher ( indexStore , true ) ; BooleanQuery q = new BooleanQuery ( ) ; q . add ( new TermQuery ( new Term ( "type" , "note" ) ) , MUST ) ; MultiPhraseQuery trouble = new MultiPhraseQuery ( ) ; trouble . add ( new Term ( "body" , "a" ) ) ; trouble . add ( new Term [ ] { new Term ( "body" , "test" ) , new Term ( "body" , "this" ) } ) ; q . add ( trouble , MUST ) ; ScoreDoc [ ] hits = searcher . search ( q , null , 1000 ) . scoreDocs ; assertEquals ( "Wrong<seq2seq4repair_space>number<seq2seq4repair_space>of<seq2seq4repair_space>hits" , 0 , hits . length ) ; searcher . close ( ) ; } public void testHashCodeAndEquals ( ) { } private void add ( String s , String type , IndexWriter writer ) throws IOException { } }

Fix:
IndexWriter writer = new IndexWriter ( indexStore , new org . apache . lucene . analysis . standard . StandardAnalyzer ( TEST_VERSION_CURRENT , Collections . emptySet ( ) ) , true , MaxFieldLength . LIMITED ) ;
Buggy code:
public class PluginTree extends TreeTable { static final String [ ] columns = new String [ ] { "Description" , "Version" , "Enabled" } ; static final String [ ] CATEGORIES = new String [ ] { "Look<seq2seq4repair_space>and<seq2seq4repair_space>Feel" , "Filter" , "Filter<seq2seq4repair_space>Action" , "Spam" , "Mail<seq2seq4repair_space>Import" , "Addressbook<seq2seq4repair_space>Import" , "Interpreter<seq2seq4repair_space>Language" , "Examples" , "Uncategorized" } ; protected Map map ; protected PluginTreeTableModel model ; private JCheckBox enabledCheckBox ; public PluginTree ( ) { } public void addPlugin ( XmlElement pluginElement ) { if ( pluginElement == null ) return ; String category = pluginElement . getAttribute ( "category" ) ; if ( category == null ) { category = "Uncategorized" ; } PluginNode childNode = new PluginNode ( ) ; childNode . setCategory ( false ) ; childNode . setId ( pluginElement . getAttribute ( "id" ) ) ; childNode . setTooltip ( pluginElement . getAttribute ( "description" ) ) ; childNode . setVersion ( pluginElement . getAttribute ( "version" ) ) ; String enabled = pluginElement . getAttribute ( "enabled" ) ; if ( enabled == null ) enabled = "true" ; <START_BUG> childNode . setEnabled ( new Boolean ( enabled ) . booleanValue ( ) ) ; <END_BUG> System . out . println ( ( "adding<seq2seq4repair_space>plugin<seq2seq4repair_space>to<seq2seq4repair_space>table:<seq2seq4repair_space>" + enabled ) ) ; PluginNode node = ( ( PluginNode ) ( map . get ( category ) ) ) ; if ( node == null ) { category = "Uncategorized" ; node = ( ( PluginNode ) ( map . get ( category ) ) ) ; } node . add ( childNode ) ; model . fireTableDataChanged ( ) ; } public void initTree ( ) { } protected void initCategories ( PluginNode root ) { } public void removePluginNode ( PluginNode node ) { } }

Fix:
childNode . setEnabled ( Boolean . valueOf ( enabled ) . booleanValue ( ) ) ;
Buggy code:
public class TriggerInventory extends BCStatement implements ITriggerExternal { public enum State { Empty , Contains , Space , Full ; } public TriggerInventory . State state ; public TriggerInventory ( TriggerInventory . State state ) { } @ Override public int maxParameters ( ) { } @ Override public String getDescription ( ) { } @ Override public boolean isTriggerActive ( TileEntity tile , ForgeDirection side , IStatementContainer container , IStatementParameter [ ] parameters ) { ItemStack searchedStack = null ; <START_BUG> if ( ( parameters != null ) && ( ( parameters . length ) >= 1 ) ) { <END_BUG> searchedStack = parameters [ 0 ] . getItemStack ( ) ; } if ( tile instanceof IInventory ) { boolean hasSlots = false ; boolean foundItems = false ; boolean foundSpace = false ; for ( IInvSlot slot : InventoryIterator . getIterable ( ( ( IInventory ) ( tile ) ) , side . getOpposite ( ) ) ) { hasSlots = true ; ItemStack stack = slot . getStackInSlot ( ) ; foundItems |= ( stack != null ) && ( ( searchedStack == null ) || ( StackHelper . canStacksOrListsMerge ( stack , searchedStack ) ) ) ; foundSpace |= ( ( stack == null ) || ( ( StackHelper . canStacksOrListsMerge ( stack , searchedStack ) ) && ( ( stack . stackSize ) < ( stack . getMaxStackSize ( ) ) ) ) ) && ( ( ( searchedStack == null ) || ( ( searchedStack . getItem ( ) ) instanceof ItemList ) ) || ( slot . canPutStackInSlot ( searchedStack ) ) ) ; } if ( ! hasSlots ) { return false ; } switch ( state ) { case Empty : return ! foundItems ; case Contains : return foundItems ; case Space : return foundSpace ; default : return ! foundSpace ; } } return false ; } @ Override public int getIconIndex ( ) { } }

Fix:
if ( ( ( parameters != null ) && ( ( parameters . length ) >= 1 ) ) && ( ( parameters [ 0 ] ) != null ) ) {
Buggy code:
public class JMeterTest extends JMeterTestCase { private static Logger log = LoggingManager . getLoggerForClass ( ) ; private static Map guiTitles ; private static Map guiTags ; private static Map funcTitles ; private static Properties nameMap ; public JMeterTest ( String name ) { } private TestElement testItem ; public JMeterTest ( String testName , TestElement te ) { } private Serializable serObj ; public JMeterTest ( String testName , Serializable ser ) { } private JMeterGUIComponent guiItem ; public JMeterTest ( String testName , JMeterGUIComponent gc ) { } private Function funcItem ; private static boolean classPathShown = false ; public JMeterTest ( String testName , Function fi ) { } public static Test suite ( ) throws Exception { } public void createTitleSet ( ) throws Exception { } public void createTagSet ( ) throws Exception { } public void createFunctionSet ( ) throws Exception { } private int scanprintMap ( Map m , String t ) { } public void checkGuiSet ( ) throws Exception { JMeterTest . guiTitles . remove ( "Example<seq2seq4repair_space>Sampler" ) ; <START_BUG> JMeterTest . guiTitles . remove ( "Sample_Result_Configuration" ) ; <END_BUG> assertEquals ( "Should<seq2seq4repair_space>not<seq2seq4repair_space>have<seq2seq4repair_space>any<seq2seq4repair_space>names<seq2seq4repair_space>left<seq2seq4repair_space>over" , 0 , scanprintMap ( JMeterTest . guiTitles , "GUI" ) ) ; } public void checkFunctionSet ( ) throws Exception { } private static Test suiteGUIComponents ( ) throws Exception { } private static Test suiteFunctions ( ) throws Exception { } private static Test suiteBeanComponents ( ) throws Exception { } public void runGUITitle ( ) throws Exception { } public void runFunction ( ) throws Exception { } public void runFunction2 ( ) throws Exception { } public void GUIComponents1 ( ) throws Exception { } public void GUIComponents2 ( ) throws Exception { } private static Test suiteSerializableElements ( ) throws Exception { } public void runSerialTest ( ) throws Exception { } private static Test suiteTestElements ( ) throws Exception { } public void runTestElement ( ) throws Exception { } public void readAliases ( ) throws Exception { } private void checkElementAlias ( Object item ) { } private static Collection getObjects ( Class extendsClass ) throws Exception { } private static void cloneTesting ( TestElement item , TestElement clonedItem ) { } private static void checkElementCloning ( TestElement item ) { } }

Fix:
JMeterTest . guiTitles . remove ( "Sample_Result_Save_Configuration" ) ;
Buggy code:
public class PrefixHandler extends CommandHandlerWithHelp { public PrefixHandler ( ) { } public PrefixHandler ( String command ) { } @ Override protected void doHandle ( CommandContext ctx ) { OperationRequestAddress prefix = ctx . getPrefix ( ) ; if ( ! ( ctx . hasArguments ( ) ) ) { ctx . printLine ( ctx . getPrefixFormatter ( ) . format ( prefix ) ) ; return ; } OperationRequestParser . CallbackHandler handler = new org . jboss . as . cli . operation . impl . DefaultOperationCallbackHandler ( ctx . getPrefix ( ) ) ; try { <START_BUG> ctx . getOperationRequestParser ( ) . parse ( ctx . getCommandArguments ( ) , handler ) ; <END_BUG> } catch ( CommandFormatException e ) { ctx . printLine ( e . getLocalizedMessage ( ) ) ; } } }

Fix:
ctx . getOperationRequestParser ( ) . parse ( ctx . getArgumentsString ( ) , handler ) ;
Buggy code:
public class FrgSLTTReport extends FrgReport { @ Override protected void initView ( ) { } @ Override protected int defineLayout ( ) { } @ Override protected void requestData ( ) { if ( ( customer ) == null ) { Toast . makeText ( mActivity , "customer<seq2seq4repair_space>not<seq2seq4repair_space>define" , LENGTH_SHORT ) . show ( ) ; return ; } mActivity . showLoading ( true ) ; AsyncHttpClient client = new AsyncHttpClient ( ) ; client . setCookieStore ( mActivity . getCookieStore ( ) ) ; <START_BUG> client . get ( String . format ( SLTT_URL , customer . getCustNo ( ) , Utility . convertSimpleDate ( fromDate ) , Utility . convertSimpleDate ( toDate ) ) , new JsonHttpResponseHandler ( ) { <END_BUG> @ Override public void onSuccess ( int statusCode , Header [ ] headers , JSONObject response ) { super . onSuccess ( statusCode , headers , response ) ; mActivity . showLoading ( false ) ; Log . d ( "minh" , response . toString ( ) ) ; if ( Parser . isSuccess ( response ) ) { try { TextView txName = ( ( TextView ) ( findViewById ( tx_name ) ) ) ; txName . setText ( response . optJSONObject ( "Result" ) . optString ( "sale_ename" ) ) ; reportLayout . setDataAndLayout ( Parser . parseSLTT ( response . optJSONObject ( "Result" ) ) ) ; } catch ( ReportLayout e ) { e . printStackTrace ( ) ; } } else { Toast . makeText ( mActivity , Parser . getError ( response ) , LENGTH_SHORT ) . show ( ) ; } } @ Override public void onFailure ( int statusCode , Header [ ] headers , String responseString , Throwable throwable ) { super . onFailure ( statusCode , headers , responseString , throwable ) ; mActivity . showLoading ( false ) ; Toast . makeText ( mActivity , responseString , LENGTH_SHORT ) . show ( ) ; } } ) ; } }

Fix:
client . get ( String . format ( SLTT_URL , customer . getSaleNo ( ) , Utility . convertSimpleDate ( fromDate ) , Utility . convertSimpleDate ( toDate ) ) , new JsonHttpResponseHandler ( ) {
Buggy code:
public class RawTypeBinding extends ParameterizedTypeBinding { public RawTypeBinding ( ReferenceBinding type , ReferenceBinding enclosingType , LookupEnvironment environment ) { } public char [ ] computeUniqueKey ( boolean isLeaf ) { } public ParameterizedMethodBinding createParameterizedMethod ( MethodBinding originalMethod ) { } public int kind ( ) { } public String debugName ( ) { } public char [ ] genericTypeSignature ( ) { } public boolean isEquivalentTo ( TypeBinding otherType ) { } public boolean isProvablyDistinct ( TypeBinding otherType ) { <START_BUG> if ( ( this ) == otherType ) <END_BUG> return false ; if ( otherType == null ) return true ; switch ( otherType . kind ( ) ) { case Binding . GENERIC_TYPE : case Binding . PARAMETERIZED_TYPE : case Binding . RAW_TYPE : return ( erasure ( ) ) != ( otherType . erasure ( ) ) ; } return true ; } protected void initializeArguments ( ) { } public char [ ] readableName ( ) { } public char [ ] shortReadableName ( ) { } }

Fix:
if ( ( ( this ) == otherType ) || ( ( erasure ( ) ) == otherType ) )
Buggy code:
public class BusStop implements Serializable { private static final long serialVersionUID = - 1979170903096663321L ; String name ; Map < Integer , Schedule > schedules ; public BusStop ( String name ) { } public String getName ( ) { } public void putSchedule ( int weekday , Schedule schedule ) { } public int getNextArrival ( Calendar date ) { int weekday = date . get ( Calendar . DAY_OF_WEEK ) ; <START_BUG> int currTime = ( ( date . get ( Calendar . HOUR ) ) * 60 ) + ( date . get ( Calendar . MINUTE ) ) ; <END_BUG> int arrivalTime = - 1 ; Schedule schedule ; int addDays = - 1 ; for ( ; arrivalTime == ( - 1 ) ; addDays ++ ) { schedule = schedules . get ( weekday ) ; arrivalTime = schedule . nextArrival ( currTime ) ; weekday = nextWeekday ( weekday ) ; } return ( ( ( addDays * 24 ) * 60 ) + arrivalTime ) - currTime ; } private int nextWeekday ( int weekday ) { } }

Fix:
int currTime = ( ( date . get ( Calendar . HOUR_OF_DAY ) ) * 60 ) + ( date . get ( Calendar . MINUTE ) ) ;
Buggy code:
public class SearchAPI { private static SearchPhrase searchPhrase ; private static List < ChartListItem > resultList ; private static SearchAPI instance ; private ChartSearchSearcher searcher = getComponent ( ChartSearchSearcher . class ) ; private static List < String > selectedCategoryNames ; private static double retrievalTime ; private static Integer patientId ; public static SearchAPI getInstance ( ) { } private SearchAPI ( ) { } public List < ChartListItem > showResults ( List < ChartListItem > results ) { } public List < ChartListItem > getResults ( ) { } public void setResults ( List < ChartListItem > results ) { } public void clearResults ( ) { } public List < ChartListItem > search ( Integer patientId , SearchPhrase searchPhrase , List < String > selectedCategoryNames , boolean reloadWholePage ) { SearchAPI . patientId = patientId ; List < String > categories = null ; ChartSearchCache cache = new ChartSearchCache ( ) ; <START_BUG> if ( ( reloadWholePage || ( searchPhrase . getPhrase ( ) . equals ( "," ) ) ) || ( searchPhrase . getPhrase ( ) . equals ( "" ) ) ) { <END_BUG> JSONObject defaultSearchProps = cache . returnDefaultSearchPhrase ( searchPhrase . getPhrase ( ) , SearchAPI . getPatientId ( ) ) ; String phrase = ( ( String ) ( defaultSearchProps . get ( "searchPhrase" ) ) ) ; List < String > cats = ( ( List < String > ) ( defaultSearchProps . get ( "selectedCategories" ) ) ) ; SearchAPI . searchPhrase = new SearchPhrase ( phrase ) ; searchPhrase . setPhrase ( phrase ) ; if ( ( cats != null ) && ( ! ( cats . isEmpty ( ) ) ) ) { categories = cats ; } else { categories = new ArrayList < String > ( ) ; } } else { SearchAPI . searchPhrase = searchPhrase ; categories = selectedCategoryNames ; } SearchAPI . selectedCategoryNames = categories ; String searchPhraseStr = searchPhrase . getPhrase ( ) ; Integer length = Integer . valueOf ( 999999999 ) ; Integer start = Integer . valueOf ( 0 ) ; List < ChartListItem > items = new ArrayList < ChartListItem > ( ) ; String finalPhrase ; finalPhrase = SynonymsAPI . getSynonymsForSearch ( searchPhraseStr ) ; System . out . println ( ( "finalPhrase<seq2seq4repair_space>:" + finalPhrase ) ) ; double startSearchingTime = new Date ( ) . getTime ( ) ; try { items = searcher . getDocumentList ( patientId , finalPhrase , start , length , SearchAPI . getSelectedCategoryNames ( ) ) ; cache . saveOrUpdateSearchHistory ( finalPhrase , patientId ) ; } catch ( Exception e ) { e . printStackTrace ( ) ; } double endSearchingTime = new Date ( ) . getTime ( ) ; SearchAPI . retrievalTime = ( endSearchingTime - startSearchingTime ) // 1000.0 ; return items ; } public SearchPhrase getSearchPhrase ( ) { } public void setSearchPhrase ( SearchPhrase searchPhrase ) { } public static List < String > getSelectedCategoryNames ( ) { } public static void setSelectedCategoryNames ( List < String > selectedCategoryNames ) { } private < T > T getComponent ( Class < T > clazz ) { } public static double getRetrievalTime ( ) { } public static Integer getPatientId ( ) { } }

Fix:
if ( reloadWholePage && ( ( searchPhrase . getPhrase ( ) . equals ( "," ) ) || ( searchPhrase . getPhrase ( ) . equals ( "" ) ) ) ) {
Buggy code:
public class InfinispanSubsystemTestCase extends ClusteringSubsystemTest { public InfinispanSubsystemTestCase ( ) { } @ Override protected ValidationConfiguration getModelValidationConfiguration ( ) { } @ Test public void testParseSubsystem ( ) throws Exception { List < ModelNode > operations = super . parse ( getSubsystemXml ( ) ) ; <START_BUG> Assert . assertEquals ( 11 , operations . size ( ) ) ; <END_BUG> ModelNode addSubsystem = operations . get ( 0 ) ; Assert . assertEquals ( ADD , addSubsystem . get ( OP ) . asString ( ) ) ; PathAddress addr = PathAddress . pathAddress ( addSubsystem . get ( OP_ADDR ) ) ; Assert . assertEquals ( 1 , addr . size ( ) ) ; PathElement element = addr . getElement ( 0 ) ; Assert . assertEquals ( SUBSYSTEM , element . getKey ( ) ) ; Assert . assertEquals ( getMainSubsystemName ( ) , element . getValue ( ) ) ; } @ Test public void testInstallIntoController ( ) throws Exception { } @ Test public void testParseAndMarshalModel ( ) throws Exception { } @ Test public void testDescribeHandler ( ) throws Exception { } }

Fix:
Assert . assertEquals ( 9 , operations . size ( ) ) ;
Buggy code:
@ RunWith ( MockitoJUnitRunner . class ) public class PageDesignerMappingCompositeTest { @ Rule public RealmWithDisplay realmWithDisplay = new RealmWithDisplay ( ) ; @ Mock private RepositoryAccessor repositoryAccessor ; @ Mock private IEclipsePreferences preferenceStore ; @ Mock private FormReferenceExpressionValidator formReferenceExpressionValidator ; @ Mock private WebPageRepositoryStore webPageRepositoryStore ; @ Mock private WebPageFileStore selectedPage ; @ Before public void setUp ( ) throws Exception { } @ Test public void should_open_file_store_on_edit ( ) throws Exception { final PageDesignerMappingComposite pageDesignerMappingComposite = makeComposite ( ) ; <START_BUG> when ( webPageRepositoryStore . getChild ( "a-page-id.json" ) ) . thenReturn ( selectedPage ) ; <END_BUG> pageDesignerMappingComposite . editForm ( new org . eclipse . core . databinding . observable . value . WritableValue ( aFormMapping ( ) . havingTargetForm ( anExpression ( ) . withContent ( "a-page-id" ) ) . build ( ) , FormMapping . class ) ) ; verify ( selectedPage ) . open ( ) ; } private PageDesignerMappingComposite makeComposite ( ) { } }

Fix:
when ( webPageRepositoryStore . getChild ( "a-page-id" ) ) . thenReturn ( selectedPage ) ;
Buggy code:
public class ModClusterEnableContext implements OperationStepHandler , DescriptionProvider { static final ModClusterEnableContext INSTANCE = new ModClusterEnableContext ( ) ; @ Override public ModelNode getModelDescription ( Locale locale ) { } @ Override public void execute ( OperationContext context , ModelNode operation ) throws OperationFailedException { <START_BUG> if ( context . isNormalServer ( ) ) { <END_BUG> context . addStep ( new OperationStepHandler ( ) { @ Override public void execute ( OperationContext context , ModelNode operation ) throws OperationFailedException { ServiceController < ? > controller = context . getServiceRegistry ( false ) . getService ( NAME ) ; ModCluster modcluster = ( ( ModCluster ) ( controller . getValue ( ) ) ) ; ModClusterLogger . ROOT_LOGGER . debugf ( "enable-context:<seq2seq4repair_space>%s" , operation ) ; ContextHost contexthost = new ContextHost ( operation ) ; modcluster . enableContext ( contexthost . webhost , contexthost . webcontext ) ; context . completeStep ( ) ; } } , RUNTIME ) ; } context . completeStep ( ) ; } }

Fix:
if ( ( context . isNormalServer ( ) ) && ( ( context . getServiceRegistry ( false ) . getService ( NAME ) ) != null ) ) {
Buggy code:
public class MultiThreadedExperimentRunner { private final int threads ; private int threadCount ; private RunnableExperiment experiment ; private static final double DEF_STEPSIZE = 0.1 ; private final double stepSize ; private static final int SLEEP_TIME = 500 ; private final double factor ; public MultiThreadedExperimentRunner ( RunnableExperiment exp , int threads ) { } public MultiThreadedExperimentRunner ( RunnableExperiment exp , int threads , double stepsize ) { } public MultiThreadedExperimentRunner ( RunnableExperiment exp ) { } public void runExperiments ( ) { for ( int d = 0 ; d <= ( 1 * ( factor ) ) ; d += ( stepSize ) * ( factor ) ) { while ( ( getThreadCount ( ) ) >= ( threads ) ) { try { Thread . sleep ( MultiThreadedExperimentRunner . SLEEP_TIME ) ; } catch ( InterruptedException e ) { <START_BUG> LoggerFactory . getLogger ( MultiThreadedExperimentRunner . class ) . error ( e . getStackTrace ( ) . toString ( ) ) ; <END_BUG> } } final double dd = d // ( factor ) ; new Thread ( new Runnable ( ) { @ Override public void run ( ) { experiment . doExperimentRun ( dd ) ; decreaseThreadCount ( ) ; } } ) . start ( ) ; increaseThreadCount ( ) ; } } private synchronized void increaseThreadCount ( ) { } private synchronized void decreaseThreadCount ( ) { } private synchronized int getThreadCount ( ) { } public boolean hasThreadsRunning ( ) { } }

Fix:
LoggerFactory . getLogger ( MultiThreadedExperimentRunner . class ) . error ( "Interrupt<seq2seq4repair_space>called!" , e ) ;