nus-yam/ex-repair huggingface dataset:
Buggy code:
public class Project implements DetailedProject { public static final List < Integer > NO_DEPENDENCIES = new ArrayList < > ( 0 ) ; public static final int NO_ALTERNATIVE = - 1 ; private static int nextId = 0 ; private boolean isFinished ; private final int id ; private final String name ; private final String description ; private final Timespan creationDueTime ; private final Map < Integer , Task > tasks = new TreeMap < > ( ) ; public Project ( String name , String descr , LocalDateTime creation , LocalDateTime due ) { } private static int generateId ( ) { } @ Override public int getId ( ) { } @ Override public String getName ( ) { } public final boolean canHaveAsName ( String name ) { } @ Override public String getDescription ( ) { } public final boolean canHaveAsDescription ( String descr ) { } @ Override public LocalDateTime getCreationTime ( ) { } @ Override public LocalDateTime getDueTime ( ) { } @ Override public List < Task > getTasks ( ) { } public boolean hasTask ( int tid ) { } public boolean hasTask ( Task task ) { } public Task getTask ( int tid ) { } public boolean canHaveAsTask ( Task t ) { } public void addTask ( Task t ) { } public Task createTask ( String descr , Duration estdur , int accdev , int altFor , List < Integer > prereqs , Map < ResourceType , Integer > requiredResources ) { } public List < Task > getAvailableTasks ( ) { } public List < Task > getCanBePlannedTasks ( ) { } public List < Task > getUnplannedTasks ( ) { List < Task > unplannedTasks = new ArrayList < > ( ) ; for ( Task t : getTasks ( ) ) <START_BUG> if ( t . isPlanned ( ) ) <END_BUG> unplannedTasks . add ( t ) ; return unplannedTasks ; } @ Override public Map < Task , Double > getUnacceptablyOverdueTasks ( LocalDateTime now ) { } @ Override public boolean isFinished ( ) { } @ Override public boolean isOnTime ( LocalDateTime now ) { } @ Override public Duration getDelay ( LocalDateTime now ) { } @ Override public Duration getTotalExecutionTime ( ) { } public Project . Memento createMemento ( ) { } public void setMemento ( Project . Memento memento ) { } @ Override public String toString ( ) { } public class Memento { private final boolean isFinished ; private final Map < Integer , Task > tasks ; private Memento ( boolean isFinished , Map < Integer , Task > tasks ) { } private boolean getIsFinished ( ) { } private Map < Integer , Task > getTasks ( ) { } } }

Fix:
if ( ! ( t . isPlanned ( ) ) )
Buggy code:
public class KafkaHighLevelConsumerBasedRoutingTableBuilder implements RoutingTableBuilder { @ Override public void init ( Configuration configuration ) { } @ Override public List < ServerToSegmentSetMap > computeRoutingTableFromExternalView ( String tableName , ExternalView externalView , List < InstanceConfig > instanceConfigList ) { RoutingTableInstancePruner pruner = new RoutingTableInstancePruner ( instanceConfigList ) ; Set < String > segments = externalView . getPartitionSet ( ) ; List < ServerToSegmentSetMap > routingTable = new ArrayList < ServerToSegmentSetMap > ( ) ; Map < String , Map < String , Set < String > > > groupIdToRouting = new HashMap < String , Map < String , Set < String > > > ( ) ; for ( String segment : segments ) { Map < String , String > instanceMap = externalView . getStateMap ( segment ) ; for ( String instance : instanceMap . keySet ( ) ) { <START_BUG> if ( ( instanceMap . get ( instance ) . equals ( OFFLINE ) ) || ( pruner . isInactive ( instance ) ) ) { <END_BUG> continue ; } String groupId = Realtime . extractGroupIdName ( segment ) ; if ( ! ( groupIdToRouting . containsKey ( groupId ) ) ) { groupIdToRouting . put ( groupId , new HashMap < String , Set < String > > ( ) ) ; } if ( ! ( groupIdToRouting . get ( groupId ) . containsKey ( instance ) ) ) { groupIdToRouting . get ( groupId ) . put ( instance , new HashSet < String > ( ) ) ; } groupIdToRouting . get ( groupId ) . get ( instance ) . add ( segment ) ; } } for ( Map < String , Set < String > > replicaRouting : groupIdToRouting . values ( ) ) { routingTable . add ( new ServerToSegmentSetMap ( replicaRouting ) ) ; } return routingTable ; } }

Fix:
if ( ( ! ( instanceMap . get ( instance ) . equals ( ONLINE ) ) ) || ( pruner . isInactive ( instance ) ) ) {
Buggy code:
public class ArrayInitializer extends Expression { public Expression [ ] expressions ; public ArrayBinding binding ; public ArrayInitializer ( ) { } public FlowInfo analyseCode ( BlockScope currentScope , FlowContext flowContext , FlowInfo flowInfo ) { } public void generateCode ( BlockScope currentScope , CodeStream codeStream , boolean valueRequired ) { int pc = codeStream . position ; int expressionLength = ( ( expressions ) == null ) ? 0 : expressions . length ; codeStream . generateInlinedValue ( expressionLength ) ; codeStream . newArray ( currentScope , binding ) ; if ( ( expressions ) != null ) { int elementsTypeID = ( ( binding . dimensions ) > 1 ) ? - 1 : binding . leafComponentType . id ; for ( int i = 0 ; i < expressionLength ; i ++ ) { Expression expr ; if ( ( ( expr = expressions [ i ] ) . constant ) != ( NotAConstant ) ) { switch ( elementsTypeID ) { case TypeIds . T_int : case TypeIds . T_short : case TypeIds . T_byte : case TypeIds . T_char : case TypeIds . T_float : case TypeIds . T_long : case TypeIds . T_double : if ( ( expr . constant . doubleValue ( ) ) != 0 ) { codeStream . dup ( ) ; codeStream . generateInlinedValue ( i ) ; expr . generateCode ( currentScope , codeStream , true ) ; codeStream . arrayAtPut ( elementsTypeID , false ) ; } break ; case TypeIds . T_boolean : if ( ( expr . constant . booleanValue ( ) ) != false ) { codeStream . dup ( ) ; codeStream . generateInlinedValue ( i ) ; expr . generateCode ( currentScope , codeStream , true ) ; codeStream . arrayAtPut ( elementsTypeID , false ) ; } break ; default : if ( ( expr . constant ) != ( NullConstant . Default ) ) { codeStream . dup ( ) ; codeStream . generateInlinedValue ( i ) ; expr . generateCode ( currentScope , codeStream , true ) ; codeStream . arrayAtPut ( elementsTypeID , false ) ; } } } else { codeStream . dup ( ) ; codeStream . generateInlinedValue ( i ) ; expr . generateCode ( currentScope , codeStream , true ) ; codeStream . arrayAtPut ( elementsTypeID , false ) ; } } } if ( ! valueRequired ) { codeStream . pop ( ) ; } <START_BUG> codeStream . recordPositionsFrom ( pc , this ) ; <END_BUG> } public TypeBinding resolveTypeExpecting ( BlockScope scope , TypeBinding expectedTb ) { } public String toStringExpression ( ) { } public void traverse ( IAbstractSyntaxTreeVisitor visitor , BlockScope scope ) { } }

Fix:
codeStream . recordPositionsFrom ( pc , this . sourceStart ) ;
Buggy code:
@ RegistrationClass @ RegEntity ( clientOnly = true ) @ RegEntity . HasRender public abstract class EntityTPMarking extends EntityX { @ RegEntity . Render public static EntityTPMarking . MarkRender render ; final AbilityData data ; protected final EntityPlayer player ; public EntityTPMarking ( EntityPlayer player ) { } @ Override public void onUpdate ( ) { } @ Override public boolean shouldRenderInPass ( int pass ) { } protected void updatePos ( ) { } public double getDist ( ) { } protected abstract double getMaxDistance ( ) { } @ SideOnly ( Side . CLIENT ) public static class MarkRender extends Render { protected ResourceLocation [ ] tex = ACClientProps . ANIM_TP_MARK ; protected IDrawable model = new SimpleModelBiped ( ) ; @ Override public void doRender ( Entity ent , double x , double y , double z , float var8 , float var9 ) { EntityTPMarking mark = ( ( EntityTPMarking ) ( ent ) ) ; <START_BUG> int texID = ( ( mark . ticksExisted ) // 2 ) % ( tex . length ) ; <END_BUG> GL11 . glEnable ( GL_BLEND ) ; GL11 . glDisable ( GL_LIGHTING ) ; GL11 . glDisable ( GL_CULL_FACE ) ; GL11 . glDisable ( GL_DEPTH_TEST ) ; GL11 . glColor4d ( 1 , 1 , 1 , 1 ) ; GL11 . glPushMatrix ( ) ; { GL11 . glTranslated ( x , y , z ) ; GL11 . glRotated ( ( - ( mark . rotationYaw ) ) , 0 , 1 , 0 ) ; GL11 . glScaled ( ( - 1 ) , ( - 1 ) , 1 ) ; OpenGlHelper . setLightmapTextureCoords ( lightmapTexUnit , 240.0F , 240.0F ) ; instance . setBrightness ( 15728880 ) ; RenderUtils . loadTexture ( tex [ texID ] ) ; model . draw ( ) ; } GL11 . glPopMatrix ( ) ; GL11 . glEnable ( GL_DEPTH_TEST ) ; GL11 . glEnable ( GL_LIGHTING ) ; GL11 . glEnable ( GL_CULL_FACE ) ; } @ Override protected ResourceLocation getEntityTexture ( Entity var1 ) { } } }

Fix:
int texID = ( ( int ) ( ( ( mark . ticksExisted ) // 2.5 ) % ( tex . length ) ) ) ;
Buggy code:
public class PdfDocument implements CodecDocument { private long docHandle ; private static final int FITZMEMORY = 512 * 1024 ; MuPDFCore core ; public void setCore ( MuPDFCore core ) { } public MuPDFCore getCore ( ) { } private PdfDocument ( long docHandle ) { } public CodecPage getPage ( int pageNumber ) { <START_BUG> return PdfPage . createPage ( core , ( pageNumber + 1 ) ) ; <END_BUG> } public int getPageCount ( ) { } static PdfDocument openDocument ( String fname , String pwd ) { } private static native long open ( int fitzmemory , String fname , String pwd ) { } private static native void free ( long handle ) { } private static native int getPageCount ( long handle ) { } @ Override protected void finalize ( ) throws Throwable { } public synchronized void recycle ( ) { } }

Fix:
return PdfPage . createPage ( core , pageNumber ) ;
Buggy code:
public class RemoveAnnotationFromFieldTest extends AbstractAnnotationTest { @ Override public String getPackageName ( ) { } @ Override public String getClassName ( ) { } @ Override public String getClassContents ( ) { } @ Override public Annotation getAnnotation ( ) { } public void testRemoveAnnotationFromField ( ) { try { assertNotNull ( annotation ) ; assertEquals ( WebServiceRef . class . getSimpleName ( ) , AnnotationUtils . getAnnotationName ( annotation ) ) ; IField field = source . findPrimaryType ( ) . getField ( "service" ) ; assertNotNull ( field ) ; assertTrue ( AnnotationUtils . isAnnotationPresent ( field , AnnotationUtils . getAnnotationName ( annotation ) ) ) ; assertNotNull ( source . getImport ( WebServiceRef . class . getCanonicalName ( ) ) ) ; textFileChange . addEdit ( AnnotationUtils . createRemoveAnnotationTextEdit ( field , annotation ) ) ; <START_BUG> textFileChange . addEdit ( AnnotationUtils . createRemoveImportTextEdit ( field , WebServiceRef . class ) ) ; <END_BUG> assertTrue ( executeChange ( new NullProgressMonitor ( ) , textFileChange ) ) ; assertFalse ( AnnotationUtils . isAnnotationPresent ( field , AnnotationUtils . getAnnotationName ( annotation ) ) ) ; assertFalse ( source . getImport ( WebServiceRef . class . getCanonicalName ( ) ) . exists ( ) ) ; } catch ( CoreException ce ) { fail ( ce . getLocalizedMessage ( ) ) ; } } }

Fix:
textFileChange . addEdit ( AnnotationUtils . createRemoveImportTextEdit ( field , WebServiceRef . class . getCanonicalName ( ) ) ) ;
Buggy code:
@ Component public class HighlightSubscribedConcept extends Extension { static volatile UpdateService service ; @ Autowired public void setService ( UpdateService service ) { } @ Override public MEDIA_TYPE getMediaType ( ) { } public String getOverrideContent ( String bodyContent ) { HttpServletRequest request = ( ( org . springframework . web . context . request . ServletRequestAttributes ) ( org . springframework . web . context . request . RequestContextHolder . getRequestAttributes ( ) ) ) . getRequest ( ) ; Concept concept = Context . getConceptService ( ) . getConcept ( Integer . parseInt ( request . getParameter ( "conceptId" ) ) ) ; String message = "" ; if ( HighlightSubscribedConcept . service . isSubscribedConcept ( concept . getUuid ( ) ) ) { <START_BUG> message = "<b>The<seq2seq4repair_space>concept<seq2seq4repair_space>comes<seq2seq4repair_space>from<seq2seq4repair_space>Open<seq2seq4repair_space>Concept<seq2seq4repair_space>Lab<seq2seq4repair_space>subscription<seq2seq4repair_space>and<seq2seq4repair_space>any<seq2seq4repair_space>changes<seq2seq4repair_space>to<seq2seq4repair_space>the<seq2seq4repair_space>concept<seq2seq4repair_space>may<seq2seq4repair_space>be<seq2seq4repair_space>reverted<seq2seq4repair_space>with<seq2seq4repair_space>the<seq2seq4repair_space>next<seq2seq4repair_space>update<//b>" ; <END_BUG> } return message ; } }

Fix:
message = "<div<seq2seq4repair_space>class=\"highlight\">This<seq2seq4repair_space>concept<seq2seq4repair_space>was<seq2seq4repair_space>downloaded<seq2seq4repair_space>from<seq2seq4repair_space>your<seq2seq4repair_space>Open<seq2seq4repair_space>Concept<seq2seq4repair_space>Lab<seq2seq4repair_space>subscription.<seq2seq4repair_space>Any<seq2seq4repair_space>local<seq2seq4repair_space>changes<seq2seq4repair_space>that<seq2seq4repair_space>you<seq2seq4repair_space>make<seq2seq4repair_space>to<seq2seq4repair_space>this<seq2seq4repair_space>concept<seq2seq4repair_space>here<seq2seq4repair_space>will<seq2seq4repair_space>be<seq2seq4repair_space>lost<seq2seq4repair_space>the<seq2seq4repair_space>next<seq2seq4repair_space>time<seq2seq4repair_space>you<seq2seq4repair_space>download<seq2seq4repair_space>updates<seq2seq4repair_space>from<seq2seq4repair_space>the<seq2seq4repair_space>OCL<seq2seq4repair_space>server.<seq2seq4repair_space>\n\n<seq2seq4repair_space>We<seq2seq4repair_space>strongly<seq2seq4repair_space>recommend<seq2seq4repair_space>that<seq2seq4repair_space>you<seq2seq4repair_space>do<seq2seq4repair_space>not<seq2seq4repair_space>edit<seq2seq4repair_space>this<seq2seq4repair_space>concept<seq2seq4repair_space>locally.<//div>" ;
Buggy code:
public class Well1024aTest extends RandomGeneratorAbstractTest { @ Override protected RandomGenerator makeGenerator ( ) { <START_BUG> return new Well1024a ( 100 ) ; <END_BUG> } @ Test public void testReferenceCode ( ) { } }

Fix:
return new Well1024a ( 1000 ) ;
Buggy code:
public class LocalHostNameOperationHandler implements OperationStepHandler { private final LocalHostControllerInfo info ; public LocalHostNameOperationHandler ( LocalHostControllerInfo info ) { } @ Override public void execute ( OperationContext context , ModelNode operation ) throws OperationFailedException { context . getResult ( ) . set ( info . getLocalHostName ( ) ) ; <START_BUG> context . completeStep ( ) ; <END_BUG> } }

Fix:
context . stepCompleted ( ) ;
Buggy code:
public class BreakStatement extends Statement { private SimpleName optionalLabel = null ; BreakStatement ( AST ast ) { } public int getNodeType ( ) { } ASTNode clone ( AST target ) { BreakStatement result = new BreakStatement ( target ) ; result . setSourceRange ( this . getStartPosition ( ) , this . getLength ( ) ) ; <START_BUG> result . setLeadingComment ( getLeadingComment ( ) ) ; <END_BUG> result . setLabel ( ( ( SimpleName ) ( ASTNode . copySubtree ( target , getLabel ( ) ) ) ) ) ; return result ; } public boolean subtreeMatch ( ASTMatcher matcher , Object other ) { } void accept0 ( ASTVisitor visitor ) { } public SimpleName getLabel ( ) { } public void setLabel ( SimpleName label ) { } int memSize ( ) { } int treeSize ( ) { } }

Fix:
result . copyLeadingComment ( this ) ;
Buggy code:
public class ServerRemoveHandler implements ModelRemoveOperationHandler , DescriptionProvider { public static final String OPERATION_NAME = REMOVE ; public static final ServerRemoveHandler INSTANCE = new ServerRemoveHandler ( ) ; protected ServerRemoveHandler ( ) { } @ Override public OperationResult execute ( final OperationContext context , final ModelNode operation , final ResultHandler resultHandler ) throws OperationFailedException { try { <START_BUG> ModelNode compensating = ServerAddHandler . getAddServerOperation ( operation . get ( OP_ADDR ) , operation . get ( NAME ) , operation . get ( GROUP ) ) ; <END_BUG> resultHandler . handleResultComplete ( ) ; return new org . jboss . as . controller . BasicOperationResult ( compensating ) ; } catch ( Exception e ) { throw new OperationFailedException ( new ModelNode ( ) . set ( e . getLocalizedMessage ( ) ) ) ; } } @ Override public ModelNode getModelDescription ( final Locale locale ) { } }

Fix:
ModelNode compensating = ServerAddHandler . getAddServerOperation ( operation . get ( OP_ADDR ) , context . getSubModel ( ) ) ;
Buggy code:
public class RelativeTimePatternConverter extends PatternConverter { StringBuffer buf ; public RelativeTimePatternConverter ( ) { } public StringBuffer convert ( LoggingEvent event ) { buf . setLength ( 0 ) ; <START_BUG> buf . append ( Long . toString ( ( ( event . timeStamp ) - ( LoggingEvent . getStartTime ( ) ) ) ) ) ; <END_BUG> return buf ; } }

Fix:
buf . append ( Long . toString ( ( ( event . getTimeStamp ( ) ) - ( LoggingEvent . getStartTime ( ) ) ) ) ) ;
Buggy code:
@ Repository public class AlfrescoCmisRepository implements CmisRepository { @ Autowired private RemoteConnection connection ; private String alfrescoHomePath ; public WebPage buildWebPage ( String id ) throws CmisObjectNotFoundException { WebPage wp = new WebPage ( ) ; Session session = connection . getSession ( ) ; if ( id . equals ( "home" ) ) { id = session . getObjectByPath ( alfrescoHomePath ) . getId ( ) ; } CmisObject obj = session . getObject ( id ) ; if ( obj . getType ( ) . getId ( ) . equals ( "cmis:folder" ) ) { Folder folder = ( ( Folder ) ( obj ) ) ; wp . setId ( id ) ; wp . setParentId ( folder . getParentId ( ) ) ; wp . setTitle ( obj . getName ( ) ) ; ItemIterable < CmisObject > children = folder . getChildren ( ) ; for ( CmisObject cmiso : children ) { if ( cmiso . getType ( ) . getId ( ) . equals ( "cmis:folder" ) ) { wp . addPage ( cmiso . getName ( ) , cmiso . getId ( ) ) ; } else if ( cmiso . getType ( ) . getId ( ) . equals ( "cmis:document" ) ) { Document doc = ( ( Document ) ( cmiso ) ) ; <START_BUG> wp . addContent ( cmiso . getName ( ) , cmiso . getId ( ) ) ; <END_BUG> } } } return wp ; } public RemoteConnection getConnection ( ) { } public void setConnection ( AlfrescoRemoteConnection connection ) { } public String getAlfrescoHomePath ( ) { } public void setAlfrescoHomePath ( String alfrescoHomePath ) { } }

Fix:
wp . addContent ( doc ) ;
Buggy code:
public class SwitchStatement extends Statement { public Expression expression ; public Statement [ ] statements ; public BlockScope scope ; public int explicitDeclarations ; public BranchLabel breakLabel ; public CaseStatement [ ] cases ; public CaseStatement defaultCase ; public int blockStart ; public int caseCount ; int [ ] constants ; public static final int CASE = 0 ; public static final int FALLTHROUGH = 1 ; public static final int ESCAPING = 2 ; public SyntheticMethodBinding synthetic ; int preSwitchInitStateIndex = - 1 ; int mergedInitStateIndex = - 1 ; public FlowInfo analyseCode ( BlockScope currentScope , FlowContext flowContext , FlowInfo flowInfo ) { } public void generateCode ( BlockScope currentScope , CodeStream codeStream ) { } public StringBuffer printStatement ( int indent , StringBuffer output ) { } public void resolve ( BlockScope upperScope ) { } public void traverse ( ASTVisitor visitor , BlockScope blockScope ) { if ( visitor . visit ( this , blockScope ) ) { <START_BUG> this . expression . traverse ( visitor , this . scope ) ; <END_BUG> if ( ( this . statements ) != null ) { int statementsLength = this . statements . length ; for ( int i = 0 ; i < statementsLength ; i ++ ) this . statements [ i ] . traverse ( visitor , this . scope ) ; } } visitor . endVisit ( this , blockScope ) ; } public void branchChainTo ( BranchLabel label ) { } }

Fix:
this . expression . traverse ( visitor , blockScope ) ;
Buggy code:
public class Chef extends Employee { private int cookingKnowledge ; public Chef ( ) { } public void setCookingKnowledge ( int i ) { <START_BUG> greediness = i ; <END_BUG> } public int getCookingKnowledge ( ) { } }

Fix:
cookingKnowledge = i ;
Buggy code:
public class Voter { private String [ ] urls ; private int maxTime ; private InsulineService factory ; public Voter ( String [ ] urls , int maxTime , InsulineService factory ) { } public Voter ( InsulineService factory ) { } private int [ ] invokeServices ( ) { ExecutorService executorService = Executors . newFixedThreadPool ( urls . length ) ; Set < Callable < ResultPair > > callables = new HashSet < > ( ) ; for ( String url : urls ) callables . add ( factory . constructNew ( ) . setUrl ( url ) ) ; try { List < Future < ResultPair > > futures ; String [ ] newUrls = new String [ urls . length ] ; futures = executorService . invokeAll ( callables , maxTime , TimeUnit . MILLISECONDS ) ; int [ ] results = new int [ futures . size ( ) ] ; for ( int i = 0 ; i < ( futures . size ( ) ) ; i ++ ) { try { <START_BUG> results [ i ] = ( futures . get ( i ) . isDone ( ) ) ? futures . get ( i ) . get ( ) . result : - 1 ; <END_BUG> newUrls [ i ] = futures . get ( i ) . get ( ) . url ; } catch ( Exception e ) { results [ i ] = - 1 ; newUrls [ i ] = null ; } } fixUrls ( newUrls , urls ) ; urls = newUrls ; return results ; } catch ( InterruptedException e ) { e . printStackTrace ( ) ; } int [ ] results = new int [ urls . length ] ; for ( int i = 0 ; i < ( results . length ) ; i ++ ) results [ i ] = - 1 ; return results ; } private boolean existsInArray ( String [ ] array , String elem ) { } private void fixUrls ( String [ ] newUrls , String [ ] urls ) { } private int [ ] getMajority ( int [ ] results ) { } private int countInvalid ( int [ ] results , int i ) { } private int findMinExcludeInvalid ( int [ ] results ) { } private ArrayList < Integer > findEquivalent ( int [ ] results , int val ) { } public ArrayList < Integer > findMajorityRangeWithEquivalence ( int [ ] results ) { } public int median ( ArrayList < Integer > results ) { } public VoterResults vote ( ) { } public static void main ( String [ ] args ) { } }

Fix:
results [ i ] = ( futures . get ( i ) . isCancelled ( ) ) ? futures . get ( i ) . get ( ) . result : - 1 ;
Buggy code:
public class VersionLockManager extends AbstractLockManager { private boolean _versionCheckOnReadLock = true ; private boolean _versionUpdateOnWriteLock = true ; public int getLockLevel ( OpenJPAStateManager sm ) { } protected void setLockLevel ( OpenJPAStateManager sm , int level ) { <START_BUG> sm . setLock ( Numbers . valueOf ( level ) ) ; <END_BUG> } public void release ( OpenJPAStateManager sm ) { } public void lock ( OpenJPAStateManager sm , int level , int timeout , Object sdata ) { } public void lock ( OpenJPAStateManager sm , int level , int timeout , Object sdata , boolean postLockVersionCheck ) { } protected void lockInternal ( OpenJPAStateManager sm , int level , int timeout , Object sdata , boolean postLockVersionCheck ) { } protected void optimisticLockInternal ( OpenJPAStateManager sm , int level , int timeout , Object sdata , boolean postLockVersionCheck ) { } public void setVersionCheckOnReadLock ( boolean versionCheckOnReadLock ) { } public boolean getVersionCheckOnReadLock ( ) { } public void setVersionUpdateOnWriteLock ( boolean versionUpdateOnWriteLock ) { } public boolean getVersionUpdateOnWriteLock ( ) { } }

Fix:
sm . setLock ( level ) ;
Buggy code:
public final class EmbeddedDeployableContainer extends CommonDeployableContainer < EmbeddedContainerConfiguration > { private static final String MODULE_ID_LOGMANAGER = "org.jboss.logmanager" ; private static final String MODULE_ID_VFS = "org.jboss.vfs" ; private static final String SYSPROP_KEY_CLASS_PATH = "java.class.path" ; private static final String SYSPROP_KEY_MODULE_PATH = "module.path" ; private static final String SYSPROP_KEY_BUNDLE_PATH = "jboss.bundles.dir" ; private static final String SYSPROP_KEY_LOGMANAGER = "java.util.logging.manager" ; private static final String SYSPROP_KEY_JBOSS_HOME_DIR = "jboss.home.dir" ; private static final String SYSPROP_VALUE_JBOSS_LOGMANAGER = "org.jboss.logmanager.LogManager" ; private StandaloneServerIndirection server ; @ Override public void setup ( final EmbeddedContainerConfiguration config ) { } private ModuleLoader setupModuleLoader ( final String modulePath ) { } private void setupBundlePath ( final String bundlePath ) { if ( ( bundlePath == null ) || ( bundlePath . isEmpty ( ) ) ) { throw new IllegalStateException ( "Bundle<seq2seq4repair_space>path<seq2seq4repair_space>must<seq2seq4repair_space>be<seq2seq4repair_space>defined<seq2seq4repair_space>in<seq2seq4repair_space>the<seq2seq4repair_space>configuration" ) ; } final File bundlesDir = new File ( bundlePath ) ; if ( ! ( bundlesDir . isDirectory ( ) ) ) { <START_BUG> throw new IllegalStateException ( ( "Invalid<seq2seq4repair_space>modules<seq2seq4repair_space>directory:<seq2seq4repair_space>" + bundlesDir ) ) ; <END_BUG> } SecurityActions . setSystemProperty ( EmbeddedDeployableContainer . SYSPROP_KEY_BUNDLE_PATH , bundlePath ) ; } private void setupVfsModule ( final ModuleLoader moduleLoader ) { } private void setupLoggingSystem ( ModuleLoader moduleLoader ) { } private void setupServer ( final ModuleLoader moduleLoader , final String jbossHomePath ) { } @ Override public Class < EmbeddedContainerConfiguration > getConfigurationClass ( ) { } @ Override protected void startInternal ( ) throws LifecycleException { } @ Override protected void stopInternal ( ) throws LifecycleException { } }

Fix:
throw new IllegalStateException ( ( "Invalid<seq2seq4repair_space>bundles<seq2seq4repair_space>directory:<seq2seq4repair_space>" + bundlesDir ) ) ;
Buggy code:
public class Utils { private static final Logger logger = Logger . getLogger ( Utils . class . getName ( ) ) ; public static JButton makeNavigationButton ( String imageName , String actionCommand , String toolTipText , String altText ) { } public static Object xml2entry ( String content ) { } public static String entry2xml ( Object eom ) { } public static void updateStatus ( final Component component ) { } public static byte [ ] serialize ( Object yourObject ) { } public static Object deserialize ( byte [ ] yourBytes ) { } public static String html2text ( String html ) { } public static String text2html ( String text ) { } public static Comparator < File > FILE_NAME_NUMBER_COMPARATOR = new Comparator < File > ( ) { @ Override public int compare ( File o1 , File o2 ) { } @ Override public boolean equals ( Object obj ) { } } ; public static Integer getInteger ( String str ) { } public static boolean textsEqual ( String s1 , String s2 ) { String tmp1 = s1 . replaceAll ( "\n" , "" ) . replaceAll ( "\r" , "" ) ; <START_BUG> String tmp2 = s1 . replaceAll ( "\n" , "" ) . replaceAll ( "\r" , "" ) ; <END_BUG> return tmp1 . equals ( tmp2 ) ; } }

Fix:
String tmp2 = s2 . replaceAll ( "\n" , "" ) . replaceAll ( "\r" , "" ) ;
Buggy code:
public final class Utils { private Utils ( ) { } public static String padString ( String original , int desiredLength ) { } public static boolean startsWithIgnoreCase ( String a , String b ) { } public static String [ ] split ( String string ) { } public static String join ( String delimiter , String ... elements ) { } public static void printLicense ( ) { } public static String stringArrayToString ( String [ ] strings , String separator ) { } public static String enumerate ( final List < ? > list ) { } public static < T extends Selectable > Matches < T > findBestMatches ( Collection < T > collection , String ... tokens ) { } public static < T extends Selectable > Matches < T > findBestCompleteMatches ( Collection < T > collection , String ... tokens ) { } private static < T extends Selectable > Matches < T > findMatches ( Collection < T > collection , boolean complete , String ... tokens ) { List < T > listOfMatches = new ArrayList < T > ( ) ; double maximumSimilarity = 1.0E-6 ; for ( T candidate : collection ) { String [ ] titleWords = Utils . split ( candidate . getName ( ) . getSingular ( ) ) ; int matches = Utils . countMatches ( tokens , titleWords ) ; <START_BUG> if ( ( ! complete ) || ( matches == ( tokens . length ) ) ) { <END_BUG> double matchesOverTitleWords = matches // ( ( double ) ( titleWords . length ) ) ; double matchesOverSearchArgs = matches // ( ( double ) ( tokens . length ) ) ; double similarity = DungeonMath . mean ( matchesOverTitleWords , matchesOverSearchArgs ) ; int comparisonResult = DungeonMath . fuzzyCompare ( similarity , maximumSimilarity ) ; if ( comparisonResult > 0 ) { maximumSimilarity = similarity ; listOfMatches . clear ( ) ; listOfMatches . add ( candidate ) ; } else if ( comparisonResult == 0 ) { listOfMatches . add ( candidate ) ; } } } return Matches . fromCollection ( listOfMatches ) ; } private static int countMatches ( String [ ] query , String [ ] entry ) { } }

Fix:
if ( ( ! complete ) || ( matches >= ( tokens . length ) ) ) {
Buggy code:
public class RequestCycleListenerTest extends BaseRequestHandlerStackTest { private IRequestHandler handler ; private int errorCode ; private int responses ; private int detaches ; private int exceptionsMapped ; @ Override protected void setUp ( ) throws Exception { } @ Override protected void tearDown ( ) throws Exception { } private RequestCycle newRequestCycle ( final boolean throwExceptionInRespond ) { } public void testBasicOperations ( ) throws Exception { } public void testExceptionRequestHandlers ( ) throws Exception { RequestCycleListenerTest . IncrementingListener incrementingListener = new RequestCycleListenerTest . IncrementingListener ( ) ; Application . get ( ) . getRequestCycleListeners ( ) . add ( incrementingListener ) ; Application . get ( ) . getRequestCycleListeners ( ) . add ( new RequestCycleListenerTest . ErrorCodeListener ( 401 ) ) ; RequestCycle cycle = newRequestCycle ( true ) ; cycle . processRequestAndDetach ( ) ; assertEquals ( 401 , errorCode ) ; assertEquals ( 1 , incrementingListener . exceptionResolutions ) ; <START_BUG> assertEquals ( 1 , incrementingListener . schedules ) ; <END_BUG> Application . get ( ) . getRequestCycleListeners ( ) . add ( new RequestCycleListenerTest . ErrorCodeListener ( 401 ) ) ; cycle = newRequestCycle ( true ) ; try { cycle . processRequestAndDetach ( ) ; fail ( "expected<seq2seq4repair_space>an<seq2seq4repair_space>exception<seq2seq4repair_space>because<seq2seq4repair_space>two<seq2seq4repair_space>request<seq2seq4repair_space>cycle<seq2seq4repair_space>listeners<seq2seq4repair_space>returned<seq2seq4repair_space>a<seq2seq4repair_space>request<seq2seq4repair_space>handler" ) ; } catch ( WicketRuntimeException e ) { assertEquals ( 2 , incrementingListener . resolutions ) ; } } public void testExceptionHandingInOnDetach ( ) throws Exception { } private void assertValues ( int exceptionsMapped , int responses , int detaches ) { } private class ErrorCodeListener extends AbstractRequestCycleListener { private final int code ; public ErrorCodeListener ( int code ) { } @ Override public IRequestHandler onException ( final RequestCycle cycle , Exception ex ) { } } private class IncrementingListener implements IRequestCycleListener { private int begins ; private int ends ; private int exceptions ; private int detachesnotified ; private int resolutions ; private int exceptionResolutions ; private int schedules = 0 ; public IRequestHandler onException ( final RequestCycle cycle , Exception ex ) { } public void onEndRequest ( final RequestCycle cycle ) { } public void onBeginRequest ( final RequestCycle cycle ) { } public void onDetach ( final RequestCycle cycle ) { } public void onRequestHandlerResolved ( IRequestHandler handler ) { } public void onExceptionRequestHandlerResolved ( IRequestHandler handler , Exception exception ) { } public void onRequestHandlerScheduled ( IRequestHandler handler ) { } private void assertValues ( int begins , int ends , int exceptions , int detachesnotified ) { } } }

Fix:
assertEquals ( 0 , incrementingListener . schedules ) ;
Buggy code:
public class ContainerFeedbackMessageFilter implements IFeedbackMessageFilter { private static final long serialVersionUID = 1L ; private final MarkupContainer container ; public ContainerFeedbackMessageFilter ( MarkupContainer container ) { } public boolean accept ( FeedbackMessage message ) { <START_BUG> return container . isAncestorOf ( message . getReporter ( ) ) ; <END_BUG> } }

Fix:
return container . getParent ( ) . contains ( message . getReporter ( ) , false ) ;
Buggy code:
public class PerfRunData { private Points points ; private Directory directory ; private Analyzer analyzer ; private DocMaker docMaker ; private HTMLParser htmlParser ; private HashMap readTaskQueryMaker ; private Class qmkrClass ; private IndexReader indexReader ; private IndexWriter indexWriter ; private Config config ; private long startTimeMillis ; public PerfRunData ( Config config ) throws Exception { } public void reinit ( boolean eraseIndex ) throws Exception { if ( ( indexWriter ) != null ) { indexWriter . close ( ) ; indexWriter = null ; } if ( ( indexReader ) != null ) { indexReader . close ( ) ; indexReader = null ; } if ( ( directory ) != null ) { directory . close ( ) ; } if ( "FSDirectory" . equals ( config . get ( "directory" , "RAMDirectory" ) ) ) { File workDir = new File ( config . get ( "work.dir" , "work" ) ) ; File indexDir = new File ( workDir , "index" ) ; if ( eraseIndex && ( indexDir . exists ( ) ) ) { FileUtils . fullyDelete ( indexDir ) ; } indexDir . mkdirs ( ) ; <START_BUG> final boolean doSync = config . get ( "fsdirectory.dosync" , true ) ; <END_BUG> directory = FSDirectory . getDirectory ( indexDir , null , doSync ) ; } else { directory = new RAMDirectory ( ) ; } resetInputs ( ) ; System . runFinalization ( ) ; System . gc ( ) ; } public long setStartTimeMillis ( ) { } public long getStartTimeMillis ( ) { } public Points getPoints ( ) { } public Directory getDirectory ( ) { } public void setDirectory ( Directory directory ) { } public IndexReader getIndexReader ( ) { } public void setIndexReader ( IndexReader indexReader ) { } public IndexWriter getIndexWriter ( ) { } public void setIndexWriter ( IndexWriter indexWriter ) { } public Analyzer getAnalyzer ( ) { } public void setAnalyzer ( Analyzer analyzer ) { } public DocMaker getDocMaker ( ) { } public Config getConfig ( ) { } public void resetInputs ( ) { } public QueryMaker getQueryMaker ( ReadTask readTask ) { } public HTMLParser getHtmlParser ( ) { } }

Fix:
final boolean doSync = config . get ( "fsdirectory.dosync" , false ) ;
Buggy code:
public class ArrayAllocationExpression extends Expression { public TypeReference type ; public Expression [ ] dimensions ; public ArrayInitializer initializer ; public ArrayAllocationExpression ( ) { } public FlowInfo analyseCode ( BlockScope currentScope , FlowContext flowContext , FlowInfo flowInfo ) { } public void generateCode ( BlockScope currentScope , CodeStream codeStream , boolean valueRequired ) { int pc = codeStream . position ; if ( ( initializer ) != null ) { initializer . generateCode ( currentScope , codeStream , valueRequired ) ; return ; } int nonNullDimensionsLength = 0 ; for ( int i = 0 , max = dimensions . length ; i < max ; i ++ ) if ( ( dimensions [ i ] ) != null ) { dimensions [ i ] . generateCode ( currentScope , codeStream , true ) ; nonNullDimensionsLength ++ ; } if ( ( this . resolvedType . dimensions ( ) ) == 1 ) { <START_BUG> codeStream . newArray ( currentScope , ( ( ArrayBinding ) ( this . resolvedType ) ) ) ; <END_BUG> } else { codeStream . multianewarray ( this . resolvedType , nonNullDimensionsLength ) ; } if ( valueRequired ) { codeStream . generateImplicitConversion ( implicitConversion ) ; } else { codeStream . pop ( ) ; } codeStream . recordPositionsFrom ( pc , this . sourceStart ) ; } public StringBuffer printExpression ( int indent , StringBuffer output ) { } public TypeBinding resolveType ( BlockScope scope ) { } public void traverse ( ASTVisitor visitor , BlockScope scope ) { } }

Fix:
codeStream . newArray ( ( ( ArrayBinding ) ( this . resolvedType ) ) ) ;
Buggy code:
public class WriteResponse { private static WriteResponse . WriteResponseSerializer serializer_ = new WriteResponse . WriteResponseSerializer ( ) ; public static WriteResponse . WriteResponseSerializer serializer ( ) { } public static Message makeWriteResponseMessage ( Message original , WriteResponse writeResponseMessage ) throws IOException { ByteArrayOutputStream bos = new ByteArrayOutputStream ( ) ; DataOutputStream dos = new DataOutputStream ( bos ) ; WriteResponse . serializer ( ) . serialize ( writeResponseMessage , dos ) ; <START_BUG> return original . getReply ( FBUtilities . getLocalAddress ( ) , bos . toByteArray ( ) ) ; <END_BUG> } private final String table_ ; private final ByteBuffer key_ ; private final boolean status_ ; public WriteResponse ( String table , ByteBuffer key , boolean bVal ) { } public String table ( ) { } public ByteBuffer key ( ) { } public boolean isSuccess ( ) { } public static class WriteResponseSerializer implements ICompactSerializer < WriteResponse > { public void serialize ( WriteResponse wm , DataOutputStream dos ) throws IOException { } public WriteResponse deserialize ( DataInputStream dis ) throws IOException { } } }

Fix:
return original . getReply ( FBUtilities . getLocalAddress ( ) , bos . toByteArray ( ) , original . getVersion ( ) ) ;
Buggy code:
@ ParametersAreNonnullByDefault public final class TypesExt { private TypesExt ( ) { } public static TypeMirror notPrimitive ( Types types , TypeMirror type ) { <START_BUG> if ( type instanceof PrimitiveType ) { <END_BUG> return types . boxedClass ( ( ( PrimitiveType ) ( type ) ) ) . asType ( ) ; } return type ; } private static final Set < TypeKind > PRIMITIVES = EnumSet . of ( TypeKind . BOOLEAN , TypeKind . BYTE , TypeKind . CHAR , TypeKind . DOUBLE , TypeKind . FLOAT , TypeKind . INT , TypeKind . LONG , TypeKind . SHORT ) ; public static TypeMirror maybePrimitive ( Types types , TypeMirror type ) { } }

Fix:
if ( type . getKind ( ) . isPrimitive ( ) ) {
Buggy code:
public class LoopController extends GenericController implements Serializable { private static final String LOOPS = "LoopController.loops" ; private static final String CONTINUE_FOREVER = "LoopController.continue_forever" ; private transient int loopCount = 0 ; public LoopController ( ) { } public void setLoops ( int loops ) { } public void setLoops ( String loopValue ) { } public int getLoops ( ) { } public String getLoopString ( ) { } public void setContinueForever ( boolean forever ) { } public boolean getContinueForever ( ) { } public boolean isDone ( ) { } private boolean endOfLoop ( ) { } protected Sampler nextIsNull ( ) throws NextIsNullException { reInitialize ( ) ; if ( endOfLoop ( ) ) { if ( ! ( getContinueForever ( ) ) ) { setDone ( true ) ; } else { resetLoopCount ( ) ; } return null ; } else { <START_BUG> return next ( ) ; <END_BUG> } } protected void incrementLoopCount ( ) { } protected void resetLoopCount ( ) { } protected int getIterCount ( ) { } protected void reInitialize ( ) { } public static class Test extends JMeterTestCase { public Test ( String name ) { } public void testProcessing ( ) throws Exception { } public void testLoopZeroTimes ( ) throws Exception { } public void testInfiniteLoop ( ) throws Exception { } } }

Fix:
return doNext ( ) ;
Buggy code:
public abstract class SessionBeanComponent extends EJBComponent implements org . jboss . ejb3 . context . spi . SessionBeanComponent { private static final Logger logger = Logger . getLogger ( SessionBeanComponent . class ) ; static final ServiceName ASYNC_EXECUTOR_SERVICE_NAME = EXECUTOR . append ( "ejb3-async" ) ; protected AccessTimeout beanLevelAccessTimeout ; private final Set < Method > asynchronousMethods ; protected Executor asyncExecutor ; private final Map < String , ServiceName > viewServices ; protected SessionBeanComponent ( final EJBComponentCreateService ejbComponentCreateService ) { } @ Override public < T > T getBusinessObject ( SessionContext ctx , Class < T > businessInterface ) throws IllegalStateException { final Serializable sessionId = ( ( SessionBeanComponentInstance . SessionBeanComponentInstanceContext ) ( ctx ) ) . getId ( ) ; if ( viewServices . containsKey ( businessInterface . getName ( ) ) ) { final ServiceController < ? > serviceController = CurrentServiceRegistry . getServiceRegistry ( ) . getRequiredService ( viewServices . get ( businessInterface . getName ( ) ) ) ; final ComponentView view = ( ( ComponentView ) ( serviceController . getValue ( ) ) ) ; final ComponentViewInstance instance ; if ( sessionId != null ) { instance = view . createInstance ( Collections . < Object , Object > singletonMap ( SESSION_ATTACH_KEY , sessionId ) ) ; } else { instance = view . createInstance ( ) ; } return ( ( T ) ( instance . createProxy ( ) ) ) ; } else { <START_BUG> throw new IllegalArgumentException ( ( ( ( "View<seq2seq4repair_space>of<seq2seq4repair_space>type<seq2seq4repair_space>" + businessInterface ) + "<seq2seq4repair_space>not<seq2seq4repair_space>found<seq2seq4repair_space>on<seq2seq4repair_space>bean<seq2seq4repair_space>" ) + ( this ) ) ) ; <END_BUG> } } @ Override public EJBLocalObject getEJBLocalObject ( SessionContext ctx ) throws IllegalStateException { } @ Override public EJBObject getEJBObject ( SessionContext ctx ) throws IllegalStateException { } public AccessTimeout getAccessTimeout ( ) { } public Executor getAsynchronousExecutor ( ) { } protected boolean isAsynchronous ( final Method method ) { } public abstract Object invoke ( Serializable sessionId , Map < String , Object > contextData , Class < ? > invokedBusinessInterface , Method implMethod , Object [ ] args ) throws Exception { } protected Object invokeAsynchronous ( final Method method , final InterceptorContext context ) throws Exception { } protected boolean isInvocationAllowed ( Method method ) { } @ Override protected boolean isSetRollbackOnlyAllowed ( TransactionAttributeType txAttrType ) { } @ Override protected boolean isGetRollbackOnlyAllowed ( TransactionAttributeType txAttrType ) { } }

Fix:
throw new IllegalStateException ( ( ( ( "View<seq2seq4repair_space>of<seq2seq4repair_space>type<seq2seq4repair_space>" + businessInterface ) + "<seq2seq4repair_space>not<seq2seq4repair_space>found<seq2seq4repair_space>on<seq2seq4repair_space>bean<seq2seq4repair_space>" ) + ( this ) ) ) ;
Buggy code:
public class CapabilitiesRequiredVerifier implements ClaimVerifier { private final String claim ; private final Capabilities capabilities ; public CapabilitiesRequiredVerifier ( String theClaim , Capabilities theCapabilities ) { } public String getClaim ( ) { } public Capabilities getCapabilities ( ) { } @ Override public void verify ( JsonWebToken theToken , AccessResult theResult ) { <START_BUG> Capabilities tokenCapabilities = ( ( Capabilities ) ( theToken . getClaims ( ) . get ( capabilities . getFamily ( ) ) ) ) ; <END_BUG> if ( tokenCapabilities == null ) { theResult . setResult ( MISSING_CLAIM , "claim<seq2seq4repair_space>'%s'<seq2seq4repair_space>is<seq2seq4repair_space>missing" , claim ) ; } else { BitSet clone = ( ( BitSet ) ( tokenCapabilities . getCapabilityBits ( ) . clone ( ) ) ) ; clone . and ( capabilities . getCapabilityBits ( ) ) ; if ( ! ( clone . equals ( capabilities . getCapabilityBits ( ) ) ) ) { theResult . setResult ( MISSING_CAPABILITIES , "capabilities<seq2seq4repair_space>in<seq2seq4repair_space>family<seq2seq4repair_space>'%s'<seq2seq4repair_space>are<seq2seq4repair_space>missing<seq2seq4repair_space>from<seq2seq4repair_space>claim<seq2seq4repair_space>'%s'" , capabilities . getFamily ( ) , claim ) ; } else { theResult . setResult ( VERIFIED ) ; } } } }

Fix:
Capabilities tokenCapabilities = ( ( Capabilities ) ( theToken . getClaims ( ) . get ( claim ) ) ) ;
Buggy code:
public abstract class AbstractBounds implements Serializable { private static final long serialVersionUID = 1L ; private static AbstractBounds . AbstractBoundsSerializer serializer = new AbstractBounds . AbstractBoundsSerializer ( ) ; public static ICompactSerializer2 < AbstractBounds > serializer ( ) { } private enum Type { RANGE , BOUNDS ; } public final Token left ; public final Token right ; protected transient final IPartitioner partitioner ; public AbstractBounds ( Token left , Token right , IPartitioner partitioner ) { } public Pair < AbstractBounds , AbstractBounds > split ( Token token ) { <START_BUG> assert contains ( token ) ; <END_BUG> AbstractBounds lb = createFrom ( token ) ; AbstractBounds rb = ( ( lb != null ) && ( token . equals ( right ) ) ) ? null : new Range ( token , right ) ; return new Pair < AbstractBounds , AbstractBounds > ( lb , rb ) ; } @ Override public int hashCode ( ) { } @ Override public abstract boolean equals ( Object obj ) { } public abstract boolean contains ( Token start ) { } public abstract AbstractBounds createFrom ( Token right ) { } private static class AbstractBoundsSerializer implements ICompactSerializer2 < AbstractBounds > { public void serialize ( AbstractBounds range , DataOutput out ) throws IOException { } public AbstractBounds deserialize ( DataInput in ) throws IOException { } } }

Fix:
assert ( left . equals ( token ) ) || ( contains ( token ) ) ;
Buggy code:
public class PluginActionContributionItem extends ActionContributionItem { private static final String PLUGIN_CONTRIBUTION_ITEM = "PLUGIN_CONTRIBUTION_ITEM" ; public PluginActionContributionItem ( PluginAction action ) { } private Object getActivityObject ( PluginAction action ) { } public void dispose ( ) { } public boolean isVisible ( ) { IObjectActivityManager objectManager = PlatformUI . getWorkbench ( ) . getObjectActivityManager ( PluginActionContributionItem . PLUGIN_CONTRIBUTION_ITEM , false ) ; if ( objectManager == null ) return super . isVisible ( ) ; Object activityObject = getActivityObject ( ( ( PluginAction ) ( getAction ( ) ) ) ) ; if ( activityObject == null ) return super . isVisible ( ) ; <START_BUG> Collection activeObjects = objectManager . getActiveObjects ( ) ; <END_BUG> if ( activeObjects . contains ( activityObject ) ) { return super . isVisible ( ) ; } else { return false ; } } }

Fix:
Collection activeObjects = objectManager . getEnabledObjects ( ) ;
Buggy code:
public class StyleTest extends BuildFileTest { private static final FileUtils FILE_UTILS = FileUtils . getFileUtils ( ) ; public StyleTest ( String s ) { } protected void setUp ( ) throws Exception { } protected void tearDown ( ) throws Exception { } public void testStyleIsSet ( ) throws Exception { } public void testTransferParameterSet ( ) throws Exception { } public void testTransferParameterEmpty ( ) throws Exception { } public void testTransferParameterUnset ( ) throws Exception { } public void testTransferParameterUnsetWithIf ( ) throws Exception { } public void testNewerStylesheet ( ) throws Exception { } public void testDefaultMapper ( ) throws Exception { } public void testExplicitFileset ( ) throws Exception { } public void testDefaultMapper ( String target ) throws Exception { } public void testCustomMapper ( ) throws Exception { } public void testTypedMapper ( ) throws Exception { } public void testDirectoryHierarchyWithDirMatching ( ) throws Exception { } public void testDirsWithSpaces ( ) throws Exception { } public void testWithStyleAttrAndResource ( ) throws Exception { } public void testWithFileResource ( ) throws Exception { } public void testWithUrlResource ( ) throws Exception { } public void testFilenameAsParam ( ) throws Exception { } public void testFilenameAsParamNoSetting ( ) throws Exception { } public void testFilenameAndFiledirAsParam ( ) throws Exception { executeTarget ( "testFilenameAndFiledirAsParam" ) ; assertFileContains ( "out//out//one.txt" , "filename='one.xml'" ) ; <START_BUG> assertFileContains ( "out//out//one.txt" , "filedir<seq2seq4repair_space>=''" ) ; <END_BUG> assertFileContains ( "out//out//dir//four.txt" , "filename='four.xml'" ) ; assertFileContains ( "out//out//dir//four.txt" , "filedir<seq2seq4repair_space>='dir'" ) ; } private String getFileString ( String filename ) throws IOException { } private void expectFileContains ( String target , String filename , String contains ) throws IOException { } private void assertFileContains ( String filename , String contains ) throws IOException { } }

Fix:
assertFileContains ( "out//out//one.txt" , "filedir<seq2seq4repair_space>='.'" ) ;