nus-yam/ex-repair huggingface dataset:
Buggy code:
public class JMSRemoteCommitProvider extends AbstractRemoteCommitProvider implements ExceptionListener , Configurable , GenericConfigurable { private static Localizer s_loc = Localizer . forPackage ( JMSRemoteCommitProvider . class ) ; private String _topicName = "topic//OpenJPACommitProviderTopic" ; private String _tcfName = "java://ConnectionFactory" ; private Properties _ctxProps = null ; private int _reconnectAttempts = 0 ; private TopicConnection _connection ; private TopicSession _session ; private TopicPublisher _publisher ; public void setTopic ( String name ) { } public void setTopicConnectionFactory ( String name ) { } public void setExceptionReconnectAttempts ( int attempts ) { } public void setInto ( Options opts ) { } protected Context newContext ( ) throws NamingException { } public void broadcast ( RemoteCommitEvent event ) { } public void close ( ) { } public void endConfiguration ( ) { } private void connect ( ) { } protected MessageListener getMessageListener ( ) { } protected Message createMessage ( RemoteCommitEvent event ) throws JMSException { } public void onException ( JMSException ex ) { if ( log . isWarnEnabled ( ) ) log . warn ( JMSRemoteCommitProvider . s_loc . get ( "jms-listener-error" , _topicName ) , ex ) ; if ( ( _reconnectAttempts ) <= 0 ) return ; close ( ) ; boolean connected = false ; <START_BUG> for ( int i = 0 ; i < ( _reconnectAttempts ) ; i ++ ) { <END_BUG> try { if ( log . isInfoEnabled ( ) ) log . info ( JMSRemoteCommitProvider . s_loc . get ( "jms-reconnect-attempt" , _topicName , String . valueOf ( ( i + 1 ) ) ) ) ; connect ( ) ; connected = true ; } catch ( Exception e ) { if ( log . isInfoEnabled ( ) ) log . info ( JMSRemoteCommitProvider . s_loc . get ( "jms-reconnect-fail" , _topicName ) , e ) ; try { Thread . sleep ( 1000 ) ; } catch ( InterruptedException ie ) { break ; } } } if ( ( ! connected ) && ( log . isErrorEnabled ( ) ) ) log . error ( JMSRemoteCommitProvider . s_loc . get ( "jms-cant-reconnect" , _topicName , String . valueOf ( _reconnectAttempts ) ) ) ; else if ( connected && ( log . isInfoEnabled ( ) ) ) log . info ( JMSRemoteCommitProvider . s_loc . get ( "jms-reconnected" , _topicName ) ) ; } }

Fix:
for ( int i = 0 ; ( ! connected ) && ( i < ( _reconnectAttempts ) ) ; i ++ ) {
Buggy code:
public class TableCellEditorFactory { public static final TableCellEditor createBooleanTableCellEditor ( ) { } private TableCellEditorFactory ( ) { } public static Object createLevelTableCellEditor ( ) { <START_BUG> JComboBox comboBox = new JComboBox ( new Level [ ] { Level . DEBUG , Level . INFO , Level . WARN , Level . ERROR , Level . FATAL , Level . OFF , Level . ALL } ) ; <END_BUG> return new DefaultCellEditor ( comboBox ) ; } }

Fix:
JComboBox comboBox = new JComboBox ( new Level [ ] { Level . TRACE , Level . DEBUG , Level . INFO , Level . WARN , Level . ERROR , Level . FATAL , Level . OFF , Level . ALL } ) ;
Buggy code:
public class ListBuilder { public static List createFlatList ( List list ) { IFolderFacade folderFacade ; try { folderFacade = ServiceConnector . getFolderFacade ( ) ; } catch ( ServiceNotFoundException e1 ) { e1 . printStackTrace ( ) ; return new ArrayList ( ) ; } if ( list == null ) return null ; List result = new Vector ( ) ; for ( Iterator it = list . iterator ( ) ; it . hasNext ( ) ; ) { String s = ( ( String ) ( it . next ( ) ) ) ; <START_BUG> IFolder f = folderFacade . getFolder ( s ) ; <END_BUG> if ( f != null ) { IContactItemMap map = null ; try { map = ( ( org . columba . addressbook . folder . IGroupFolder ) ( f ) ) . getContactItemMap ( ) ; } catch ( Exception e ) { e . printStackTrace ( ) ; } if ( map == null ) continue ; Iterator it2 = map . iterator ( ) ; while ( it2 . hasNext ( ) ) { IContactItem i = ( ( IContactItem ) ( it2 . next ( ) ) ) ; String address = i . getAddress ( ) ; if ( address == null ) { continue ; } result . add ( address ) ; } } else { IContactStorage personal = ( ( IContactStorage ) ( folderFacade . getLocalAddressbook ( ) ) ) ; IContactStorage collected = ( ( IContactStorage ) ( folderFacade . getCollectedAddresses ( ) ) ) ; IContactModel item = null ; try { Object uid = personal . exists ( s ) ; if ( uid != null ) { item = personal . get ( uid ) ; } uid = collected . exists ( s ) ; if ( uid != null ) item = collected . get ( uid ) ; } catch ( Exception e ) { if ( Logging . DEBUG ) e . printStackTrace ( ) ; } if ( item != null ) { Iterator it2 = item . getEmailIterator ( ) ; if ( it2 . hasNext ( ) ) result . add ( ( ( org . columba . addressbook . model . IEmailModel ) ( it2 . next ( ) ) ) . getAddress ( ) ) ; } else result . add ( s ) ; } } return result ; } public static List createStringListFromItemList ( IHeaderItemList list ) { } }

Fix:
IFolder f = folderFacade . getFolderByName ( s ) ;
Buggy code:
public class TableViewAnchorRetriever { public static TablePosition getAnchor ( TableView tableView ) { <START_BUG> return ( ( TablePosition ) ( TableCellBehavior . getAnchor ( tableView ) ) ) ; <END_BUG> } }

Fix:
return ( ( TablePosition ) ( TableCellBehaviorBase . getAnchor ( tableView , null ) ) ) ;
Buggy code:
public class ModClusterGetProxyInfo implements OperationStepHandler , DescriptionProvider { static final ModClusterGetProxyInfo INSTANCE = new ModClusterGetProxyInfo ( ) ; @ Override public ModelNode getModelDescription ( Locale locale ) { } @ Override public void execute ( OperationContext context , ModelNode operation ) throws OperationFailedException { <START_BUG> if ( context . getProcessType ( ) . isServer ( ) ) { <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 ( ) ) ) ; Map < InetSocketAddress , String > map = modcluster . getProxyInfo ( ) ; ModClusterLogger . ROOT_LOGGER . debugf ( "Mod_cluster<seq2seq4repair_space>ProxyInfo<seq2seq4repair_space>%s" , map ) ; if ( ! ( map . isEmpty ( ) ) ) { final ModelNode result = new ModelNode ( ) ; Object [ ] addr = map . keySet ( ) . toArray ( ) ; for ( int i = 0 ; i < ( addr . length ) ; i ++ ) { InetSocketAddress address = ( ( InetSocketAddress ) ( addr [ i ] ) ) ; result . add ( ( ( ( address . getHostName ( ) ) + ":" ) + ( address . getPort ( ) ) ) ) ; result . add ( map . get ( addr [ i ] ) ) ; } context . getResult ( ) . set ( result ) ; } context . completeStep ( ) ; } } , RUNTIME ) ; } context . completeStep ( ) ; } }

Fix:
if ( context . isNormalServer ( ) ) {
Buggy code:
public class ArraysUtil { public static String toString ( Object [ ] array , String separator , String starter , String ender ) { String toString = ( starter == null ) ? "" : starter ; for ( int i = 0 ; i < ( ( array . length ) - 1 ) ; i ++ ) { toString += ( array [ i ] ) + separator ; } <START_BUG> return toString += ( separator + ( array [ ( ( array . length ) - 1 ) ] ) ) + ( ender == null ? "" : ender ) ; <END_BUG> } public static void shiftLeft ( String [ ] args , int offset ) { } No newline ; at end ; of file ; }

Fix:
return toString += ( array [ ( ( array . length ) - 1 ) ] ) + ( ender == null ? "" : ender ) ;
Buggy code:
public class CopyPackageFragmentRootOperation extends JavaModelOperation { IPath destination ; int updateResourceFlags ; int updateModelFlags ; IClasspathEntry sibling ; public CopyPackageFragmentRootOperation ( IPackageFragmentRoot root , IPath destination , int updateResourceFlags , int updateModelFlags , IClasspathEntry sibling ) { } protected void executeOperation ( ) throws JavaModelException { } protected void copyResource ( IPackageFragmentRoot root , IClasspathEntry rootEntry , final IWorkspaceRoot workspaceRoot ) throws JavaModelException { } protected void addEntryToClasspath ( IClasspathEntry rootEntry , IWorkspaceRoot workspaceRoot ) throws JavaModelException { } protected IClasspathEntry copy ( IClasspathEntry entry ) throws JavaModelException { switch ( entry . getEntryKind ( ) ) { case IClasspathEntry . CPE_CONTAINER : return JavaCore . newContainerEntry ( entry . getPath ( ) , entry . getAccessibleFiles ( ) , entry . getNonAccessibleFiles ( ) , entry . getExtraAttributes ( ) , entry . isExported ( ) ) ; case IClasspathEntry . CPE_LIBRARY : try { return JavaCore . newLibraryEntry ( this . destination , entry . getSourceAttachmentPath ( ) , entry . getSourceAttachmentRootPath ( ) , entry . getAccessibleFiles ( ) , entry . getNonAccessibleFiles ( ) , entry . getExtraAttributes ( ) , entry . isExported ( ) ) ; } catch ( Assert e ) { IJavaModelStatus status = new JavaModelStatus ( IJavaModelStatusConstants . INVALID_PATH , e . getMessage ( ) ) ; throw new JavaModelException ( status ) ; } case IClasspathEntry . CPE_PROJECT : <START_BUG> return JavaCore . newProjectEntry ( entry . getPath ( ) , entry . getAccessibleFiles ( ) , entry . getNonAccessibleFiles ( ) , entry . getExtraAttributes ( ) , entry . isExported ( ) ) ; <END_BUG> case IClasspathEntry . CPE_SOURCE : return JavaCore . newSourceEntry ( this . destination , entry . getInclusionPatterns ( ) , entry . getExclusionPatterns ( ) , entry . getOutputLocation ( ) , entry . getExtraAttributes ( ) ) ; case IClasspathEntry . CPE_VARIABLE : try { return JavaCore . newVariableEntry ( entry . getPath ( ) , entry . getSourceAttachmentPath ( ) , entry . getSourceAttachmentRootPath ( ) , entry . getAccessibleFiles ( ) , entry . getNonAccessibleFiles ( ) , entry . getExtraAttributes ( ) , entry . isExported ( ) ) ; } catch ( Assert e ) { IJavaModelStatus status = new JavaModelStatus ( IJavaModelStatusConstants . INVALID_PATH , e . getMessage ( ) ) ; throw new JavaModelException ( status ) ; } default : throw new JavaModelException ( new JavaModelStatus ( IJavaModelStatusConstants . ELEMENT_DOES_NOT_EXIST , this . getElementToProcess ( ) ) ) ; } } public IJavaModelStatus verify ( ) { } }

Fix:
return JavaCore . newProjectEntry ( entry . getPath ( ) , entry . getAccessibleFiles ( ) , entry . getNonAccessibleFiles ( ) , entry . combineAccessRestrictions ( ) , entry . getExtraAttributes ( ) , entry . isExported ( ) ) ;
Buggy code:
public class TestHelper { public static void setTestInjector ( ) { MyMusicApplication application = ( ( MyMusicApplication ) ( RuntimeEnvironment . application ) ) ; <START_BUG> MyMusicApplicationComponent injector = DaggerTestComponent . builder ( ) . testModule ( new TestModul ( application . getApplicationContext ( ) ) ) . build ( ) ; <END_BUG> application . setInjector ( injector ) ; } }

Fix:
MyMusicApplicationComponent injector = DaggerTestComponent . builder ( ) . testModul ( new TestModul ( application . getApplicationContext ( ) ) ) . build ( ) ;
Buggy code:
public class Worker extends SwingWorker implements WorkerStatusController { private static final int CLEAR_DELAY = 500 ; protected Command op ; protected int operationMode ; protected DefaultProcessor boss ; protected String displayText ; protected int progressBarMax ; protected int progressBarValue ; protected boolean cancelled ; protected List workerStatusChangeListeners ; private int timeStamp ; public Worker ( DefaultProcessor parent ) { } public void process ( Command op , int operationMode , int timeStamp ) { } public int getPriority ( ) { } private void returnLocks ( int opMode ) { } public Object construct ( ) { try { op . process ( this , operationMode ) ; if ( ( ! ( cancelled ( ) ) ) && ( ( operationMode ) == ( Command . FIRST_EXECUTION ) ) ) { boss . getUndoManager ( ) . addToUndo ( op ) ; } } catch ( CommandCancelledException e ) { <START_BUG> log . debug ( "Command<seq2seq4repair_space>cancelled" ) ; <END_BUG> } catch ( Exception e ) { e . printStackTrace ( ) ; ExceptionDialog dialog = new ExceptionDialog ( ) ; dialog . showDialog ( e ) ; } returnLocks ( operationMode ) ; return null ; } public void finished ( ) { } public void register ( TaskManager t ) { } public void unregister ( ) { } public void setProgressBarMaximum ( int max ) { } public void setProgressBarValue ( int value ) { } public void resetProgressBar ( ) { } public int getProgessBarMaximum ( ) { } public int getProgressBarValue ( ) { } public String getDisplayText ( ) { } public void setDisplayText ( String text ) { } public void clearDisplayText ( ) { } public void clearDisplayTextWithDelay ( ) { } private void clearDisplayText ( int delay ) { } public void addWorkerStatusChangeListener ( WorkerStatusChangeListener l ) { } public void removeWorkerStatusChangeListener ( WorkerStatusChangeListener l ) { } protected void fireWorkerStatusChanged ( WorkerStatusChangedEvent e ) { } public void cancel ( ) { } public boolean cancelled ( ) { } public int getTimeStamp ( ) { } }

Fix:
log . info ( "Command<seq2seq4repair_space>cancelled" ) ;
Buggy code:
public final class TestEigenSeedGenerator extends MahoutTestCase { private static final double [ ] [ ] RAW = new double [ ] [ ] { new double [ ] { 1 , 0 , 0 } , new double [ ] { 1 , 0 , 0 } , new double [ ] { 0 , 1 , 0 } , new double [ ] { 0 , 1 , 0 } , new double [ ] { 0 , 1 , 0 } , new double [ ] { 0 , 0 , 1 } , new double [ ] { 0 , 0 , 1 } } ; private FileSystem fs ; private static List < VectorWritable > getPoints ( ) { } @ Override @ Before public void setUp ( ) throws Exception { super . setUp ( ) ; <START_BUG> Configuration conf = new Configuration ( ) ; <END_BUG> fs = FileSystem . get ( conf ) ; } @ Test public void testEigenSeedGenerator ( ) throws Exception { } }

Fix:
Configuration conf = getConfiguration ( ) ;
Buggy code:
public class CoarseSessionCacheEntryExternalizer extends AbstractSimpleExternalizer < CoarseSessionCacheEntry < Object > > { private static final long serialVersionUID = - 2139534042196807460L ; private final SimpleSessionMetaDataExternalizer externalizer = new SimpleSessionMetaDataExternalizer ( ) ; public CoarseSessionCacheEntryExternalizer ( ) { } @ SuppressWarnings ( { "rawtypes" , "unchecked" } ) private CoarseSessionCacheEntryExternalizer ( Class targetClass ) { } @ Override public void writeObject ( ObjectOutput output , CoarseSessionCacheEntry < Object > entry ) throws IOException { } @ Override public CoarseSessionCacheEntry < Object > readObject ( ObjectInput input ) throws IOException , ClassNotFoundException { <START_BUG> return new CoarseSessionCacheEntry < Object > ( this . externalizer . readObject ( input ) ) ; <END_BUG> } }

Fix:
return new CoarseSessionCacheEntry ( this . externalizer . readObject ( input ) ) ;
Buggy code:
@ Component public class RandomFileNameGenerator implements FileNameGenerator { private RandomIdentifierGenerator identifierGenerator ; private String rootPath ; private String tempFolderName ; @ Autowired public RandomFileNameGenerator ( RandomIdentifierGenerator identifierGenerator ) { } @ Value ( "#{AppSettings['upload.home']}" ) public void setRootPath ( String rootPath ) { } <START_BUG> @ Value ( "#{AppSettings[tempFolderName']}" ) <END_BUG> public void setTempFolderName ( String tempFolderName ) { this . tempFolderName = tempFolderName ; } @ Override public File getFile ( ) { } private String getFileName ( ) { } private String getDirPath ( ) { } }

Fix:
@ Value ( "#{AppSettings['tempFolderName']}" )
Buggy code:
public class DriveLeft extends Command { public DriveLeft ( ) { } @ Override protected void initialize ( ) { } @ Override protected void execute ( ) { <START_BUG> chassis . driveLeft ( ) ; <END_BUG> } @ Override protected boolean isFinished ( ) { } @ Override protected void end ( ) { } @ Override protected void interrupted ( ) { } }

Fix:
chassis . driveLeft ( oi . getChassisJoystick ( ) ) ;
Buggy code:
public abstract class AFileManager < T > implements IEventManager , IFileManager , IResourceChangeListener { private final IEventManager eventManager = new DefaultEventManager ( ) ; private final List < Problem > lastProblems = new LinkedList < > ( ) ; private final Object syncObject = new Object ( ) ; protected final IPersistentFormat < T > format ; protected final String absolutePath ; protected final Path path ; private final IPath eclipseFile ; protected T persistentObject ; protected T variableObject ; private boolean saveFlag = false ; public IPersistentFormat < T > getFormat ( ) { } protected AFileManager ( String absolutePath , IPersistentFormat < T > format ) { } public void init ( ) { } public T getObject ( ) { } public T editObject ( ) { } public List < Problem > getLastProblems ( ) { } public synchronized boolean read ( ) { } protected abstract T createNewObject ( ) { } protected abstract T copyObject ( T oldObject ) { } public boolean save ( ) { lastProblems . clear ( ) ; try { synchronized ( syncObject ) { saveFlag = true ; } final byte [ ] content = format . getInstance ( ) . write ( variableObject ) . getBytes ( Charset . availableCharsets ( ) . get ( "UTF-8" ) ) ; <START_BUG> Files . write ( path , content , StandardOpenOption . CREATE , StandardOpenOption . WRITE ) ; <END_BUG> synchronized ( syncObject ) { persistentObject = variableObject ; variableObject = copyObject ( persistentObject ) ; } fireEvent ( new FeatureModelEvent ( persistentObject , FeatureModelEvent . MODEL_DATA_SAVED ) ) ; } catch ( Exception e ) { handleException ( e ) ; } return lastProblems . isEmpty ( ) ; } private void handleException ( Exception e ) { } @ Override public void addListener ( IFeatureModelListener listener ) { } @ Override public void fireEvent ( FeatureModelEvent event ) { } @ Override public void removeListener ( IFeatureModelListener listener ) { } @ Override public void resourceChanged ( IResourceChangeEvent event ) { } public void dispose ( ) { } @ Override public String getAbsolutePath ( ) { } @ Override public String toString ( ) { } }

Fix:
Files . write ( path , content , StandardOpenOption . CREATE , StandardOpenOption . TRUNCATE_EXISTING , StandardOpenOption . WRITE ) ;
Buggy code:
public final class AriesFrameworkUtil { private static FrameworkUtilWorker worker ; public static ClassLoader getClassLoader ( Bundle b ) { } private static boolean isEquinox ( String bundleClassName ) { <START_BUG> if ( bundleClassName . startsWith ( "org.eclipse.equinox" ) ) { <END_BUG> try { Class . forName ( "org.eclipse.osgi.framework.internal.core.BundleHost" ) ; return true ; } catch ( ClassNotFoundException e ) { } } return false ; } public static ClassLoader getClassLoaderForced ( Bundle b ) { } public static void safeUnregisterService ( ServiceRegistration reg ) { } }

Fix:
if ( bundleClassName . startsWith ( "org.eclipse.osgi" ) ) {
Buggy code:
public class InstanceOfExpression extends OperatorExpression { public Expression expression ; public TypeReference type ; public InstanceOfExpression ( Expression expression , TypeReference type , int operator ) { } public FlowInfo analyseCode ( BlockScope currentScope , FlowContext flowContext , FlowInfo flowInfo ) { } public void generateCode ( BlockScope currentScope , CodeStream codeStream , boolean valueRequired ) { } public StringBuffer printExpressionNoParenthesis ( int indent , StringBuffer output ) { } public TypeBinding resolveType ( BlockScope scope ) { constant = NotAConstant ; TypeBinding expressionType = expression . resolveType ( scope ) ; TypeBinding checkedType = type . resolveType ( scope , true ) ; if ( ( expressionType == null ) || ( checkedType == null ) ) return null ; <START_BUG> if ( ( ( checkedType . isTypeVariable ( ) ) || ( checkedType . isBoundParameterizedType ( ) ) ) || ( checkedType . isGenericType ( ) ) ) { <END_BUG> scope . problemReporter ( ) . illegalInstanceOfGenericType ( checkedType , this ) ; } else { boolean isLegal = checkCastTypesCompatibility ( scope , checkedType , expressionType , null ) ; if ( ! isLegal ) { scope . problemReporter ( ) . notCompatibleTypesError ( this , expressionType , checkedType ) ; } } return this . resolvedType = BooleanBinding ; } public void tagAsUnnecessaryCast ( Scope scope , TypeBinding castType ) { } public void traverse ( ASTVisitor visitor , BlockScope scope ) { } }

Fix:
if ( ! ( checkedType . isReifiable ( ) ) ) {
Buggy code:
public final class UnmodifiableBoundedCollection < E > extends AbstractCollectionDecorator < E > implements BoundedCollection < E > { private static final long serialVersionUID = - 7112672385450340330L ; public static < E > BoundedCollection < E > unmodifiableBoundedCollection ( final BoundedCollection < E > coll ) { } @ SuppressWarnings ( "unchecked" ) public static < E > BoundedCollection < E > unmodifiableBoundedCollection ( Collection < ? extends E > coll ) { if ( coll == null ) { throw new IllegalArgumentException ( "The<seq2seq4repair_space>collection<seq2seq4repair_space>must<seq2seq4repair_space>not<seq2seq4repair_space>be<seq2seq4repair_space>null" ) ; } for ( int i = 0 ; i < 1000 ; i ++ ) { if ( coll instanceof BoundedCollection ) { break ; } if ( coll instanceof AbstractCollectionDecorator ) { <START_BUG> coll = ( ( AbstractCollectionDecorator < E > ) ( coll ) ) . collection ; <END_BUG> } else if ( coll instanceof SynchronizedCollection ) { coll = ( ( SynchronizedCollection < E > ) ( coll ) ) . decorated ( ) ; } } if ( ( coll instanceof BoundedCollection ) == false ) { throw new IllegalArgumentException ( "The<seq2seq4repair_space>collection<seq2seq4repair_space>is<seq2seq4repair_space>not<seq2seq4repair_space>a<seq2seq4repair_space>bounded<seq2seq4repair_space>collection" ) ; } return new UnmodifiableBoundedCollection < E > ( ( ( BoundedCollection < E > ) ( coll ) ) ) ; } private UnmodifiableBoundedCollection ( final BoundedCollection < E > coll ) { } @ Override public Iterator < E > iterator ( ) { } @ Override public boolean add ( final E object ) { } @ Override public boolean addAll ( final Collection < ? extends E > coll ) { } @ Override public void clear ( ) { } @ Override public boolean remove ( final Object object ) { } @ Override public boolean removeAll ( final Collection < ? > coll ) { } @ Override public boolean retainAll ( final Collection < ? > coll ) { } public boolean isFull ( ) { } public int maxSize ( ) { } @ Override protected BoundedCollection < E > decorated ( ) { } }

Fix:
coll = ( ( AbstractCollectionDecorator < E > ) ( coll ) ) . decorated ( ) ;
Buggy code:
public class TestFilterIterator < E > extends AbstractTestIterator < E > { public TestFilterIterator ( String name ) { } private String [ ] array ; private List < E > list ; private FilterIterator < E > iterator ; @ Override public void setUp ( ) { } @ Override public void tearDown ( ) throws Exception { } @ Override public FilterIterator < E > makeEmptyIterator ( ) { } @ Override @ SuppressWarnings ( "unchecked" ) public FilterIterator < E > makeObject ( ) { } public void testRepeatedHasNext ( ) { } public void testRepeatedNext ( ) { } public void testReturnValues ( ) { } @ SuppressWarnings ( "unchecked" ) public void testSetIterator ( ) { } public void testSetPredicate ( ) { Iterator < E > iter = Collections . singleton ( ( ( E ) ( null ) ) ) . iterator ( ) ; FilterIterator < E > filterIterator = new FilterIterator < E > ( iter ) ; filterIterator . setPredicate ( TestFilterIterator . truePredicate ( ) ) ; assertEquals ( true , filterIterator . hasNext ( ) ) ; <START_BUG> filterIterator . setPredicate ( NotNullPredicate . getInstance ( ) ) ; <END_BUG> assertEquals ( false , filterIterator . hasNext ( ) ) ; } private void verifyNoMoreElements ( ) { } private void verifyElementsInPredicate ( final String [ ] elements ) { } private void initIterator ( ) { } protected FilterIterator < E > makePassThroughFilter ( Iterator < E > i ) { } protected FilterIterator < E > makeBlockAllFilter ( Iterator < E > i ) { } }

Fix:
filterIterator . setPredicate ( org . apache . commons . collections . functors . NotNullPredicate . notNullPredicate ( ) ) ;
Buggy code:
public class ExchangeRateTest { @ Test public void testBasicConstruction ( ) throws ExchangeRateCalculatorException { } @ Test ( expected = ExchangeRateCalculatorException . class ) public void testNullCurrency1 ( ) throws ExchangeRateCalculatorException { } @ Test ( expected = ExchangeRateCalculatorException . class ) public void testNullCurrency2 ( ) throws ExchangeRateCalculatorException { } @ Test ( expected = ExchangeRateCalculatorException . class ) public void testNullValue ( ) throws ExchangeRateCalculatorException { } @ Test ( expected = ExchangeRateCalculatorException . class ) public void testSameCurr ( ) throws ExchangeRateCalculatorException { } @ Test ( expected = ExchangeRateCalculatorException . class ) public void testNegativeCurr ( ) throws ExchangeRateCalculatorException { } @ Test ( expected = ExchangeRateCalculatorException . class ) public void testZeroCurr ( ) throws ExchangeRateCalculatorException { } @ Test public void testCanConvert ( ) throws ExchangeRateCalculatorException { } @ Test public void testCanNotConvert ( ) throws ExchangeRateCalculatorException { } @ Test public void testCanNotConvertNulls ( ) throws ExchangeRateCalculatorException { } @ Test public void testEquals ( ) throws ExchangeRateCalculatorException { } @ Test public void testAlsoEquals ( ) throws ExchangeRateCalculatorException { } @ Test public void testNotEquals ( ) throws ExchangeRateCalculatorException { BigDecimal dollarForOneEuroGiven1 = new BigDecimal ( 1.0 ) ; Currency givenCurrency1 = new Currency ( "EUR" ) ; Currency givenCurrency2 = new Currency ( "USD" ) ; ExchangeRate rate1 = new ExchangeRate ( dollarForOneEuroGiven1 , givenCurrency1 , givenCurrency2 ) ; BigDecimal dollarForOneEuroGiven2 = new BigDecimal ( 2.0 ) ; Currency givenCurrency3 = new Currency ( "USD" ) ; Currency givenCurrency4 = new Currency ( "EUR" ) ; <START_BUG> ExchangeRate rate2 = new ExchangeRate ( dollarForOneEuroGiven2 , givenCurrency1 , givenCurrency2 ) ; <END_BUG> Assert . assertFalse ( rate1 . equals ( rate2 ) ) ; } }

Fix:
ExchangeRate rate2 = new ExchangeRate ( dollarForOneEuroGiven2 , givenCurrency3 , givenCurrency4 ) ;
Buggy code:
public class ModClusterStopContext implements OperationStepHandler { static final ModClusterStopContext INSTANCE = new ModClusterStopContext ( ) ; static OperationDefinition getDefinition ( ResourceDescriptionResolver descriptionResolver ) { } @ Override public void execute ( OperationContext context , ModelNode operation ) throws OperationFailedException { if ( ( context . isNormalServer ( ) ) && ( ( context . getServiceRegistry ( false ) . getService ( SERVICE_NAME ) ) != null ) ) { context . addStep ( new OperationStepHandler ( ) { @ Override public void execute ( OperationContext context , ModelNode operation ) throws OperationFailedException { ServiceController < ? > controller = context . getServiceRegistry ( false ) . getService ( SERVICE_NAME ) ; final ModClusterServiceMBean service = ( ( ModClusterServiceMBean ) ( controller . getValue ( ) ) ) ; ModClusterLogger . ROOT_LOGGER . debugf ( "stop-context:<seq2seq4repair_space>%s" , operation ) ; final String webHost = ModClusterSubsystemResourceDefinition . VIRTUAL_HOST . resolveModelAttribute ( context , operation ) . asString ( ) ; final String webContext = ModClusterSubsystemResourceDefinition . CONTEXT . resolveModelAttribute ( context , operation ) . asString ( ) ; final int waitTime = ModClusterSubsystemResourceDefinition . WAIT_TIME . resolveModelAttribute ( context , operation ) . asInt ( ) ; try { service . stopContext ( webHost , webContext , waitTime , TimeUnit . SECONDS ) ; } catch ( IllegalArgumentException e ) { <START_BUG> throw new OperationFailedException ( new ModelNode ( ) . set ( ROOT_LOGGER . contextOrHostNotFound ( webHost , webContext ) ) ) ; <END_BUG> } context . completeStep ( new OperationContext . RollbackHandler ( ) { @ Override public void handleRollback ( OperationContext context , ModelNode operation ) { service . enableContext ( webHost , webContext ) ; } } ) ; } } , RUNTIME ) ; } context . stepCompleted ( ) ; } }

Fix:
throw new OperationFailedException ( ROOT_LOGGER . contextOrHostNotFound ( webHost , webContext ) ) ;
Buggy code:
public class Client { private final ExecutorService workerPool = Executors . newFixedThreadPool ( NUM_THREADS_CLIENT_WORKER_POOL ) ; private final Logger log = Logger . getLogger ( NETWORK_LOGGER_NAME ) ; public void sendUDPMessage ( final Message message ) { } public void sendUDPRequest ( final Request request , boolean async ) { } public void sendUDPResponse ( final Response response ) { } public void sendTCPRequest ( final Request request , boolean async ) { Runnable runnable = new Runnable ( ) { @ Override public void run ( ) { try { long start ; long end ; String requestMessage = request . getRequestMessage ( ) ; log . info ( ( ( ( "TCP<seq2seq4repair_space>Client:<seq2seq4repair_space>" + requestMessage ) + "<seq2seq4repair_space>to<seq2seq4repair_space>" ) + ( request . getRecipientNode ( ) . toString ( ) ) ) ) ; Socket socket = new Socket ( request . getRecipientNode ( ) . getIpaddress ( ) , request . getRecipientNode ( ) . getPortNumber ( ) ) ; socket . setTcpNoDelay ( true ) ; BufferedReader inputStream = new BufferedReader ( new InputStreamReader ( socket . getInputStream ( ) ) ) ; BufferedWriter outputStream = new BufferedWriter ( new OutputStreamWriter ( socket . getOutputStream ( ) ) ) ; String responseLine = null ; if ( socket != null ) { outputStream . write ( requestMessage ) ; start = System . currentTimeMillis ( ) ; outputStream . flush ( ) ; responseLine = inputStream . readLine ( ) ; end = System . currentTimeMillis ( ) ; <START_BUG> GlobalState . setRoundTripTime ( ( ( end - start ) + 1000 ) ) ; <END_BUG> log . info ( ( ( ( "TCP<seq2seq4repair_space>Client<seq2seq4repair_space>Message<seq2seq4repair_space>Received:<seq2seq4repair_space>" + responseLine ) + "<seq2seq4repair_space>from<seq2seq4repair_space>" ) + ( request . getRecipientNode ( ) . toString ( ) ) ) ) ; } inputStream . close ( ) ; outputStream . close ( ) ; socket . close ( ) ; ResponseHandler responseHandler = new ResponseHandler ( ) ; responseHandler . handle ( responseLine , request . getRecipientNode ( ) ) ; } catch ( UnknownHostException ex ) { log . severe ( "Unknown<seq2seq4repair_space>Host" ) ; } catch ( IOException ex ) { log . severe ( ( "IO<seq2seq4repair_space>exception:<seq2seq4repair_space>" + ( ex . getMessage ( ) ) ) ) ; log . severe ( Util . getStackTrace ( ex ) ) ; System . out . println ( "Could<seq2seq4repair_space>not<seq2seq4repair_space>connect<seq2seq4repair_space>to<seq2seq4repair_space>boostrap<seq2seq4repair_space>server" ) ; } catch ( Exception ex ) { log . severe ( Util . getStackTrace ( ex ) ) ; } } } ; if ( async ) { workerPool . submit ( runnable ) ; } else { runnable . run ( ) ; } } public void stop ( ) { } }

Fix:
GlobalState . setRoundTripTime ( ( ( end - start ) + 200 ) ) ;
Buggy code:
public class DeleteCachedImageReceiver extends BroadcastReceiver { public DeleteCachedImageReceiver ( ) { } @ Override public void onReceive ( Context context , Intent intent ) { String cachedImageName = intent . getExtras ( ) . getString ( KEY_HIGHRES_IMAGE_NAME ) ; File localCache = new File ( context . getCacheDir ( ) , cachedImageName ) ; boolean success = localCache . delete ( ) ; <START_BUG> Logger . Log ( ( ( ( "Deleting<seq2seq4repair_space>" + success ) + "<seq2seq4repair_space>" ) + ( intent . getExtras ( ) . getString ( PATH_KEY_MESSAGE ) ) ) ) ; <END_BUG> } }

Fix:
Logger . Log ( ( "Deleting<seq2seq4repair_space>" + success ) ) ;
Buggy code:
public final class LookupInjectionSource extends InjectionSource { private final String lookupName ; public LookupInjectionSource ( final String lookupName ) { } public void getResourceValue ( final ResolutionContext resolutionContext , final ServiceBuilder < ? > serviceBuilder , final DeploymentPhaseContext phaseContext , final Injector < ManagedReferenceFactory > injector ) { final String applicationName = resolutionContext . getApplicationName ( ) ; final String moduleName = resolutionContext . getModuleName ( ) ; final String componentName = resolutionContext . getComponentName ( ) ; final boolean compUsesModule = resolutionContext . isCompUsesModule ( ) ; final String lookupName ; if ( ! ( this . lookupName . contains ( "java:" ) ) ) { if ( ( componentName != null ) && ( ! compUsesModule ) ) { lookupName = "java:comp//env//" + ( this . lookupName ) ; } else if ( compUsesModule ) { lookupName = "java:module//env//" + ( this . lookupName ) ; } else { lookupName = "java:jboss//env" + ( this . lookupName ) ; } } else if ( ( this . lookupName . startsWith ( "java:comp//" ) ) && compUsesModule ) { lookupName = "java:module//" + ( this . lookupName . substring ( 10 ) ) ; } else { lookupName = this . lookupName ; } final ContextNames . BindInfo bindInfo = ContextNames . bindInfoFor ( applicationName , moduleName , componentName , lookupName ) ; <START_BUG> bindInfo . setupLookupInjection ( serviceBuilder , injector ) ; <END_BUG> } public boolean equals ( Object configuration ) { } public int hashCode ( ) { } public String toString ( ) { } }

Fix:
bindInfo . setupLookupInjection ( serviceBuilder , injector , phaseContext . getDeploymentUnit ( ) ) ;
Buggy code:
public class NameServer { public static void main ( String [ ] args ) { RouterData [ ] entries = new RouterData [ 100 ] ; ServerSocket serverSocket = NetUtils . serverSocket ( ) ; try { System . out . println ( ( ( ( ( "Listening<seq2seq4repair_space>on<seq2seq4repair_space>port<seq2seq4repair_space>" + ( serverSocket . getLocalPort ( ) ) ) + "<seq2seq4repair_space>at<seq2seq4repair_space>IP<seq2seq4repair_space>Address<seq2seq4repair_space>" ) + ( IpChecker . getIp ( ) ) ) + "." ) ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } while ( true ) { System . out . println ( "Waiting<seq2seq4repair_space>to<seq2seq4repair_space>accept<seq2seq4repair_space>incoming<seq2seq4repair_space>client..." ) ; SocketBundle client = NetUtils . acceptClient ( serverSocket ) ; String ip = client . socket . getInetAddress ( ) . toString ( ) . substring ( 1 ) ; int connectionType = - 1 ; int routerId = - 1 ; try { connectionType = client . in . readInt ( ) ; routerId = client . in . readInt ( ) ; if ( connectionType == 0 ) { int port = client . in . readInt ( ) ; entries [ routerId ] = new RouterData ( routerId , ip , port ) ; } else if ( connectionType == 1 ) { client . out . writeInt ( entries [ routerId ] . toString ( ) . length ( ) ) ; client . out . writeChars ( entries [ routerId ] . toString ( ) ) ; } client . socket . close ( ) ; <START_BUG> } catch ( IOException e ) { <END_BUG> e . printStackTrace ( ) ; } } } No newline ; at end ; of file ; }

Fix:
} catch ( Exception e ) {
Buggy code:
public class BeanShellListener extends AbstractTestElement implements Serializable , UnsharedComponent , SampleListener , TestBean , TestListener , Visualizer { private static final Logger log = LoggingManager . getLoggerForClass ( ) ; private static final long serialVersionUID = 2 ; private transient BeanShellInterpreter bshInterpreter = null ; private static final String INIT_FILE = "beanshell.listener.init" ; private String script = "" ; public BeanShellListener ( ) { } private void init ( ) { try { bshInterpreter = new BeanShellInterpreter ( JMeterUtils . getProperty ( BeanShellListener . INIT_FILE ) , BeanShellListener . log ) ; } catch ( ClassNotFoundException e ) { <START_BUG> BeanShellListener . log . error ( e . getLocalizedMessage ( ) ) ; <END_BUG> } } private Object readResolve ( ) { } public String getScript ( ) { } public void setScript ( String script ) { } public void sampleOccurred ( SampleEvent se ) { } public void sampleStarted ( SampleEvent e ) { } public void sampleStopped ( SampleEvent e ) { } public void add ( SampleResult sample ) { } public boolean isStats ( ) { } public void testEnded ( ) { } public void testEnded ( String host ) { } public void testIterationStart ( LoopIterationEvent event ) { } public void testStarted ( ) { } public void testStarted ( String host ) { } }

Fix:
BeanShellListener . log . error ( ( "Cannot<seq2seq4repair_space>find<seq2seq4repair_space>BeanShell:<seq2seq4repair_space>" + ( e . toString ( ) ) ) ) ;
Buggy code:
public class ApplicationStringResourceLoaderTest extends StringResourceLoaderTestBase { public ApplicationStringResourceLoaderTest ( String message ) { } @ Override protected IStringResourceLoader createLoader ( ) { } @ Override public void testLoaderUnknownResources ( ) { WicketTester tester = new WicketTester ( ) ; WebApplication app = tester . getApplication ( ) ; IStringResourceLoader loader = new org . apache . wicket . resource . loader . ClassStringResourceLoader ( app . getClass ( ) ) ; <START_BUG> Assert . assertNull ( "Unknown<seq2seq4repair_space>resource<seq2seq4repair_space>should<seq2seq4repair_space>return<seq2seq4repair_space>null" , loader . loadStringResource ( component . getClass ( ) , "test.string" , Locale . getDefault ( ) , null ) ) ; <END_BUG> tester . destroy ( ) ; } }

Fix:
Assert . assertNull ( "Unknown<seq2seq4repair_space>resource<seq2seq4repair_space>should<seq2seq4repair_space>return<seq2seq4repair_space>null" , loader . loadStringResource ( component . getClass ( ) , "test.string" , Locale . getDefault ( ) , null , null ) ) ;
Buggy code:
public class DbWebServiceTask extends DbObject { public String getLinkForControlNode ( int controlNode_id ) { } public LinkedList < Integer > getAttributeIdsForControlNode ( int controlNode_id ) { } public LinkedList < String > getKeys ( int controlNode_id , int dataattribute_id ) { <START_BUG> String sql = "" ; <END_BUG> return this . executeStatementReturnsListString ( sql , "key" ) ; } }

Fix:
String sql = ( ( ( "SELECT<seq2seq4repair_space>`key`<seq2seq4repair_space>FROM<seq2seq4repair_space>`webservicetaskattribute`<seq2seq4repair_space>WHERE<seq2seq4repair_space>`controlnode_id`<seq2seq4repair_space>=<seq2seq4repair_space>" + controlNode_id ) + "<seq2seq4repair_space>AND<seq2seq4repair_space>`dataattribute_id`<seq2seq4repair_space>=<seq2seq4repair_space>" ) + dataattribute_id ) + "<seq2seq4repair_space>ORDER<seq2seq4repair_space>BY<seq2seq4repair_space>`order`<seq2seq4repair_space>ASC" ;
Buggy code:
final class OcrInitAsyncTask extends AsyncTask < String , String , Boolean > { private static final String TAG = OcrInitAsyncTask . class . getSimpleName ( ) ; public static final String LANGUAGE_CODE = "eng" ; private BaseActivity activity ; private Context context ; private TessBaseAPI baseApi ; private ProgressDialog dialog ; private ProgressDialog indeterminateDialog ; OcrInitAsyncTask ( BaseActivity activity ) { } @ Override protected void onPreExecute ( ) { } protected Boolean doInBackground ( String ... params ) { } private void deleteAllExceptTraineddata ( File tessdataDir ) { } private boolean downloadFile ( String sourceFilenameBase , File destinationFile ) throws IOException { } private boolean downloadGzippedFileHttp ( URL url , File destinationFile ) throws IOException { } private void gunzip ( File zippedFile , File outFilePath ) throws FileNotFoundException , IOException { } private int getGzipSizeUncompressed ( File zipFile ) throws IOException { } private void untar ( File tarFile , File destinationDir ) throws IOException { } private int getTarSizeUncompressed ( File tarFile ) throws IOException { } private boolean installFromAssets ( String sourceFilename , File modelRoot , File destinationFile ) throws IOException { } private boolean installZipFromAssets ( String sourceFilename , File destinationDir , File destinationFile ) throws IOException { } @ Override protected void onProgressUpdate ( String ... message ) { super . onProgressUpdate ( message ) ; int percentComplete = 0 ; percentComplete = Integer . parseInt ( message [ 1 ] ) ; dialog . setMessage ( message [ 0 ] ) ; dialog . setProgress ( percentComplete ) ; <START_BUG> activity . displayDialog ( dialog ) ; <END_BUG> } @ Override protected void onPostExecute ( Boolean result ) { } No newline ; at end ; of file ; }

Fix:
dialog . show ( ) ;
Buggy code:
public class BindingGroupAddHandler extends AbstractSocketBindingGroupAddHandler { public static ModelNode getOperation ( ModelNode address , ModelNode model ) { } public static final BindingGroupAddHandler INSTANCE = new BindingGroupAddHandler ( ) ; private BindingGroupAddHandler ( ) { } @ Override protected void populateModel ( final OperationContext context , final ModelNode operation , final Resource resource ) throws OperationFailedException { final Resource root = context . readResourceFromRoot ( EMPTY_ADDRESS ) ; ModelNode model = resource . getModel ( ) ; populateModel ( operation , model ) ; PORT_OFFSET . validateAndSet ( operation , model ) ; final PathAddress mine = PathAddress . pathAddress ( operation . require ( OP_ADDR ) ) ; context . addStep ( new OperationStepHandler ( ) { @ Override public void execute ( OperationContext context , ModelNode operation ) throws OperationFailedException { Set < ResourceEntry > children = root . getChildren ( SOCKET_BINDING_GROUP ) ; if ( ( children . size ( ) ) > 1 ) { for ( ResourceEntry entry : children ) { if ( ! ( entry . getName ( ) . equals ( mine . getLastElement ( ) . getValue ( ) ) ) ) { throw MESSAGES . cannotAddMoreThanOneSocketBindingGroupForServer ( mine , PathAddress . pathAddress ( PathElement . pathElement ( SOCKET_BINDING_GROUP , entry . getName ( ) ) ) ) ; } } } <START_BUG> context . completeStep ( NOOP_ROLLBACK_HANDLER ) ; <END_BUG> } } , MODEL ) ; SocketBindingGroupResourceDefinition . validateDefaultInterfaceReference ( context , model ) ; } @ Override protected boolean requiresRuntime ( OperationContext context ) { } @ Override protected void performRuntime ( OperationContext context , ModelNode operation , ModelNode model , ServiceVerificationHandler verificationHandler , List < ServiceController < ? > > newControllers ) throws OperationFailedException { } @ Override protected void rollbackRuntime ( OperationContext context , ModelNode operation , ModelNode model , List < ServiceController < ? > > controllers ) { } }

Fix:
context . stepCompleted ( ) ;
Buggy code:
@ DefaultStringValue ( "Select<seq2seq4repair_space>the<seq2seq4repair_space>Events<seq2seq4repair_space>for<seq2seq4repair_space>Notification:" ) String manageEventsPopupTitleLabel ( ) { } <START_BUG> @ DefaultStringValue ( "Note:<seq2seq4repair_space>To<seq2seq4repair_space>receive<seq2seq4repair_space>email<seq2seq4repair_space>notifications,<seq2seq4repair_space>ensure<seq2seq4repair_space>that<seq2seq4repair_space>the<seq2seq4repair_space>mail<seq2seq4repair_space>server<seq2seq4repair_space>is<seq2seq4repair_space>configured<seq2seq4repair_space>and<seq2seq4repair_space>the<seq2seq4repair_space>ovirt-event-notifier<seq2seq4repair_space>service<seq2seq4repair_space>is<seq2seq4repair_space>running." ) <END_BUG>

Fix:
@ DefaultStringValue ( "Note:<seq2seq4repair_space>To<seq2seq4repair_space>receive<seq2seq4repair_space>email<seq2seq4repair_space>notifications,<seq2seq4repair_space>ensure<seq2seq4repair_space>that<seq2seq4repair_space>the<seq2seq4repair_space>mail<seq2seq4repair_space>server<seq2seq4repair_space>is<seq2seq4repair_space>configured<seq2seq4repair_space>and<seq2seq4repair_space>the<seq2seq4repair_space>ovirt-engine-notifier<seq2seq4repair_space>service<seq2seq4repair_space>is<seq2seq4repair_space>running." )
Buggy code:
public class UrlCompressingWebCodingStrategy extends WebRequestCodingStrategy { protected CharSequence encode ( RequestCycle requestCycle , IListenerInterfaceRequestTarget requestTarget ) { final RequestListenerInterface rli = requestTarget . getRequestListenerInterface ( ) ; final AppendingStringBuffer url = new AppendingStringBuffer ( 64 ) ; url . append ( '?' ) ; url . append ( INTERFACE_PARAMETER_NAME ) ; url . append ( '=' ) ; final Component component = requestTarget . getTarget ( ) ; final Page page = component . getPage ( ) ; final IPageMap pageMap = page . getPageMap ( ) ; if ( ! ( pageMap . isDefault ( ) ) ) { url . append ( pageMap . getName ( ) ) ; } url . append ( PATH_SEPARATOR ) ; String listenerName = rli . getName ( ) ; if ( ( page instanceof WebPage ) && ( ! ( "IResourceListener" . equals ( listenerName ) ) ) ) { url . append ( page . getId ( ) ) ; url . append ( PATH_SEPARATOR ) ; url . append ( ( ( WebPage ) ( page ) ) . getUrlCompressor ( ) . getUIDForComponentAndInterface ( component , listenerName ) ) ; listenerName = null ; } else { url . append ( component . getPath ( ) ) ; } url . append ( PATH_SEPARATOR ) ; final int versionNumber = component . getPage ( ) . getCurrentVersionNumber ( ) ; if ( ! ( rli . getRecordsPageVersion ( ) ) ) { url . append ( LATEST_VERSION ) ; } else if ( versionNumber > 0 ) { url . append ( versionNumber ) ; } url . append ( PATH_SEPARATOR ) ; if ( ( listenerName != null ) && ( ! ( INTERFACE . getName ( ) . equals ( listenerName ) ) ) ) { url . append ( listenerName ) ; } url . append ( PATH_SEPARATOR ) ; RequestParameters params = requestTarget . getRequestParameters ( ) ; if ( ( params != null ) && ( ( params . getBehaviorId ( ) ) != null ) ) { url . append ( params . getBehaviorId ( ) ) ; } url . append ( PATH_SEPARATOR ) ; if ( ( params != null ) && ( ( params . getUrlDepth ( ) ) != 0 ) ) { url . append ( params . getUrlDepth ( ) ) ; } if ( IActivePageBehaviorListener . INTERFACE . getName ( ) . equals ( rli . getName ( ) ) ) { <START_BUG> url . append ( ( ( url . indexOf ( "?" ) ) > ( - 1 ) ? "&amp;" : "?" ) ) . append ( IGNORE_IF_NOT_ACTIVE_PARAMETER_NAME ) . append ( "=true" ) ; <END_BUG> } return requestCycle . getOriginalResponse ( ) . encodeURL ( url ) ; } }

Fix:
url . append ( ( ( url . indexOf ( "?" ) ) > ( - 1 ) ? "&" : "?" ) ) . append ( IGNORE_IF_NOT_ACTIVE_PARAMETER_NAME ) . append ( "=true" ) ;
Buggy code:
public class AttributeModifier extends AbstractBehavior implements Serializable { public static final String VALUELESS_ATTRIBUTE_ADD = "VA_ADD" ; public static final String VALUELESS_ATTRIBUTE_REMOVE = "VA_REMOVE" ; private static final long serialVersionUID = 1L ; private final boolean addAttributeIfNotPresent ; private final String attribute ; private boolean enabled ; private final String pattern ; private final IModel < ? extends CharSequence > replaceModel ; public AttributeModifier ( final String attribute , final boolean addAttributeIfNotPresent , final IModel < ? extends CharSequence > replaceModel ) { } public AttributeModifier ( final String attribute , final IModel < ? extends CharSequence > replaceModel ) { } public AttributeModifier ( final String attribute , final String pattern , final boolean addAttributeIfNotPresent , final IModel < ? extends CharSequence > replaceModel ) { } public AttributeModifier ( final String attribute , final String pattern , final IModel < ? extends CharSequence > replaceModel ) { } @ Override public final void detachModel ( Component component ) { } public boolean isEnabled ( ) { } @ Override public final void onComponentTag ( Component component , ComponentTag tag ) { <START_BUG> if ( ( tag . getType ( ) ) != ( XmlTag . CLOSE ) ) { <END_BUG> replaceAttibuteValue ( component , tag ) ; } } public final void replaceAttibuteValue ( final Component component , final ComponentTag tag ) { } public final void setEnabled ( final boolean enabled ) { } @ Override public String toString ( ) { } protected final IModel < ? extends CharSequence > getReplaceModel ( ) { } protected String newValue ( final String currentValue , final String replacementValue ) { } private CharSequence getReplacementOrNull ( final Component component ) { } private String toStringOrNull ( final Object replacementValue ) { } }

Fix:
if ( ( tag . getType ( ) ) != ( Type . CLOSE ) ) {