nus-yam/ex-repair huggingface dataset:
Buggy code:
public class ThreadMXBeanThreadInfosHandler implements OperationStepHandler , DescriptionProvider { public static final ThreadMXBeanThreadInfosHandler INSTANCE = new ThreadMXBeanThreadInfosHandler ( ) ; private final ParametersValidator idsValidator = new ParametersValidator ( ) ; private final ParametersValidator depthValidator = new ParametersValidator ( ) ; private final ParametersValidator lockedValidator = new ParametersValidator ( ) ; private ThreadMXBeanThreadInfosHandler ( ) { } @ Override public void execute ( OperationContext context , ModelNode operation ) throws OperationFailedException { try { final long [ ] ids = getIds ( operation ) ; ThreadMXBean mbean = ManagementFactory . getThreadMXBean ( ) ; <START_BUG> ThreadInfo [ ] infos = null ; <END_BUG> if ( operation . hasDefined ( LOCKED_MONITORS ) ) { lockedValidator . validate ( operation ) ; infos = mbean . getThreadInfo ( ids , operation . require ( LOCKED_MONITORS ) . asBoolean ( ) , operation . require ( LOCKED_SYNCHRONIZERS ) . asBoolean ( ) ) ; } else if ( operation . hasDefined ( MAX_DEPTH ) ) { depthValidator . validate ( operation ) ; infos = mbean . getThreadInfo ( ids , operation . require ( MAX_DEPTH ) . asInt ( ) ) ; } else { infos = mbean . getThreadInfo ( ids ) ; } final ModelNode result = context . getResult ( ) ; if ( infos != null ) { result . setEmptyList ( ) ; for ( ThreadInfo info : infos ) { if ( info != null ) { result . add ( PlatformMBeanUtil . getDetypedThreadInfo ( info , mbean . isThreadCpuTimeSupported ( ) ) ) ; } else { result . add ( ) ; } } } } catch ( SecurityException e ) { throw new OperationFailedException ( new ModelNode ( ) . set ( e . toString ( ) ) ) ; } context . completeStep ( ) ; } @ Override public ModelNode getModelDescription ( Locale locale ) { } private long [ ] getIds ( final ModelNode operation ) throws OperationFailedException { } }

Fix:
ThreadInfo [ ] infos ;
Buggy code:
public class ValueTableJDBCSeq extends TableJDBCSeq { public static final String PK_VALUE = "PrimaryKeyValue" ; private static final Localizer _loc = Localizer . forPackage ( ValueTableJDBCSeq . class ) ; private String _value = "DEFAULT" ; public ValueTableJDBCSeq ( ) { } public String getPrimaryKeyValue ( ) { } public void setPrimaryKeyValue ( String value ) { } protected Column addPrimaryKeyColumn ( Table table ) { DBDictionary dict = getConfiguration ( ) . getDBDictionaryInstance ( ) ; <START_BUG> Column pkColumn = table . addColumn ( dict . getValidColumnName ( getPrimaryKeyColumn ( ) , table ) ) ; <END_BUG> pkColumn . setType ( dict . getPreferredType ( Types . VARCHAR ) ) ; pkColumn . setJavaType ( STRING ) ; pkColumn . setSize ( dict . characterColumnSize ) ; return pkColumn ; } protected Object getPrimaryKey ( ClassMapping mapping ) { } public static void main ( String [ ] args ) throws Exception { } public static boolean run ( JDBCConfiguration conf , String [ ] args , Options opts ) throws Exception { } public static boolean run ( JDBCConfiguration conf , String [ ] args , String action , MappingRepository repos , ClassLoader loader ) throws Exception { } }

Fix:
Column pkColumn = table . addColumn ( dict . getValidColumnName ( getPrimaryKeyColumnIdentifier ( ) , table ) ) ;
Buggy code:
public class PowerTableModel extends DefaultTableModel { private static Logger log = LoggingManager . getLoggerForClass ( ) ; Data model = new Data ( ) ; Class [ ] columnClasses ; public PowerTableModel ( String [ ] headers , Class [ ] cc ) { } public PowerTableModel ( ) { } public void setRowValues ( int row , Object [ ] values ) { } public Data getData ( ) { } public void addNewColumn ( String colName , Class colClass ) { } public void removeRow ( int row ) { } public void removeColumn ( int col ) { } public void setColumnData ( int col , List data ) { } public List getColumnData ( String colName ) { } public void clearData ( ) { } public void addRow ( Object [ ] data ) { } public void addNewRow ( ) { } private Object [ ] createDefaultRow ( ) { } public Object [ ] getRowData ( int row ) { } private Object createDefaultValue ( int i ) { Class colClass = getColumnClass ( i ) ; try { return colClass . newInstance ( ) ; } catch ( Exception e ) { try { Constructor constr = colClass . getConstructor ( new Class [ ] { String . class } ) ; return constr . newInstance ( new Object [ ] { "" } ) ; } catch ( Exception err ) { } try { Constructor constr = colClass . getConstructor ( new Class [ ] { Integer . TYPE } ) ; return constr . newInstance ( new Object [ ] { new Integer ( 0 ) } ) ; } catch ( Exception err ) { } try { Constructor constr = colClass . getConstructor ( new Class [ ] { Long . TYPE } ) ; return constr . newInstance ( new Object [ ] { new Long ( 0L ) } ) ; } catch ( Exception err ) { } try { Constructor constr = colClass . getConstructor ( new Class [ ] { Boolean . TYPE } ) ; <START_BUG> return constr . newInstance ( new Object [ ] { new Boolean ( false ) } ) ; <END_BUG> } catch ( Exception err ) { } try { Constructor constr = colClass . getConstructor ( new Class [ ] { Float . TYPE } ) ; return constr . newInstance ( new Object [ ] { new Float ( 0.0F ) } ) ; } catch ( Exception err ) { } try { Constructor constr = colClass . getConstructor ( new Class [ ] { Double . TYPE } ) ; return constr . newInstance ( new Object [ ] { new Double ( 0.0 ) } ) ; } catch ( Exception err ) { } try { Constructor constr = colClass . getConstructor ( new Class [ ] { Character . TYPE } ) ; return constr . newInstance ( new Object [ ] { new Character ( '<seq2seq4repair_space>' ) } ) ; } catch ( Exception err ) { } try { Constructor constr = colClass . getConstructor ( new Class [ ] { Byte . TYPE } ) ; return constr . newInstance ( new Object [ ] { new Byte ( Byte . MIN_VALUE ) } ) ; } catch ( Exception err ) { } try { Constructor constr = colClass . getConstructor ( new Class [ ] { Short . TYPE } ) ; return constr . newInstance ( new Object [ ] { new Short ( Short . MIN_VALUE ) } ) ; } catch ( Exception err ) { } } return "" ; } public int getRowCount ( ) { } public int getColumnCount ( ) { } public String getColumnName ( int column ) { } public boolean isCellEditable ( int row , int column ) { } public Class getColumnClass ( int column ) { } public Object getValueAt ( int row , int column ) { } public void setValueAt ( Object value , int row , int column ) { } }

Fix:
return constr . newInstance ( new Object [ ] { Boolean . FALSE } ) ;
Buggy code:
public class EditProfileActivity extends ActionBarActivity { public static final String PREFS_NAME = "com.example.cs480.lifesavings" ; private EditText userName ; private EditText userAge ; private RadioButton userMale ; private RadioButton userFemale ; private EditText userWeight ; private EditText userHeight ; private UserDataSource oldDB ; @ Override protected void onCreate ( Bundle savedInstanceState ) { } public void infoSave ( View view ) { User currentUser = new User ( ) ; Intent intent = new Intent ( this , HomeActivity . class ) ; if ( getIntent ( ) . hasExtra ( "USER" ) ) { currentUser = getUserFromInput ( User . fromArrayList ( getIntent ( ) . getStringArrayListExtra ( "USER" ) ) . getUserid ( ) ) ; oldDB . updateUser ( currentUser ) ; intent . putStringArrayListExtra ( "USER" , currentUser . toArrayList ( ) ) ; } else { currentUser = getUserFromInput ( ( - 1 ) ) ; <START_BUG> oldDB . createUser ( currentUser ) ; <END_BUG> intent . putStringArrayListExtra ( "USER" , currentUser . toArrayList ( ) ) ; } startActivity ( intent ) ; } public void infoCancel ( View view ) { } @ Override public boolean onCreateOptionsMenu ( Menu menu ) { } @ Override public boolean onOptionsItemSelected ( MenuItem item ) { } private User getUserFromInput ( int userId ) { } }

Fix:
currentUser = oldDB . createUser ( currentUser ) ;
Buggy code:
public class RunningModeReadHandler implements OperationStepHandler { private final RunningModeControl runningModeControl ; public RunningModeReadHandler ( RunningModeControl runningModeControl ) { } @ Override public void execute ( OperationContext context , ModelNode operation ) throws OperationFailedException { context . getResult ( ) . set ( runningModeControl . getRunningMode ( ) . name ( ) ) ; <START_BUG> context . completeStep ( NOOP_ROLLBACK_HANDLER ) ; <END_BUG> } }

Fix:
context . stepCompleted ( ) ;
Buggy code:
public class RecoveredInitializer extends RecoveredField implements BaseTypes , CompilerModifiers , TerminalTokens { public RecoveredType [ ] localTypes ; public int localTypeCount ; public RecoveredBlock initializerBody ; public RecoveredInitializer ( FieldDeclaration fieldDeclaration , RecoveredElement parent , int bracketBalance ) { } public RecoveredInitializer ( FieldDeclaration fieldDeclaration , RecoveredElement parent , int bracketBalance , Parser parser ) { } public RecoveredElement add ( Block nestedBlockDeclaration , int bracketBalanceValue ) { } public RecoveredElement add ( FieldDeclaration newFieldDeclaration , int bracketBalanceValue ) { } public RecoveredElement add ( LocalDeclaration localDeclaration , int bracketBalanceValue ) { } public RecoveredElement add ( Statement statement , int bracketBalanceValue ) { } public RecoveredElement add ( TypeDeclaration typeDeclaration , int bracketBalanceValue ) { } public String toString ( int tab ) { StringBuffer result = new StringBuffer ( tabString ( tab ) ) ; result . append ( "Recovered<seq2seq4repair_space>initializer:\n" ) ; <START_BUG> result . append ( this . fieldDeclaration . toString ( ( tab + 1 ) ) ) ; <END_BUG> if ( ( this . initializerBody ) != null ) { result . append ( "\n" ) ; result . append ( this . initializerBody . toString ( ( tab + 1 ) ) ) ; } return result . toString ( ) ; } public FieldDeclaration updatedFieldDeclaration ( ) { } public RecoveredElement updateOnClosingBrace ( int braceStart , int braceEnd ) { } public RecoveredElement updateOnOpeningBrace ( int currentPosition ) { } public void updateSourceEndIfNecessary ( int sourceEnd ) { } }

Fix:
result . append ( this . fieldDeclaration . print ( ( tab + 1 ) , result ) ) ;
Buggy code:
public class DurationAssertion extends AbstractTestElement implements Serializable , Assertion { public static final String DURATION_KEY = "DurationAssertion.duration" ; public AssertionResult getResult ( SampleResult response ) { <START_BUG> AssertionResult result = new AssertionResult ( ) ; <END_BUG> result . setFailure ( false ) ; long duration = getAllowedDuration ( ) ; if ( duration > 0 ) { long responseTime = response . getTime ( ) ; if ( responseTime > duration ) { result . setFailure ( true ) ; Object [ ] arguments = new Object [ ] { new Long ( responseTime ) , new Long ( duration ) } ; String message = MessageFormat . format ( JMeterUtils . getResString ( "duration_assertion_failure" ) , arguments ) ; result . setFailureMessage ( message ) ; } } return result ; } private long getAllowedDuration ( ) { } }

Fix:
AssertionResult result = new AssertionResult ( getName ( ) ) ;
Buggy code:
public class Maps { private int n ; public Maps ( ) { } public Ground next ( World world ) { <START_BUG> return new Ground ( world , ( ( 1 // 2 ) * ( Constants . VIEWPORT_WIDTH ) ) , ( ( Constants . VIEWPORT_HEIGHT ) * 0.15F ) , ( ( ( ( n ) ++ ) * 1.15F ) * ( Constants . VIEWPORT_WIDTH ) ) ) ; <END_BUG> } public Ground generateNext ( World world , Ground ground ) { } }

Fix:
return new Ground ( world , ( ( 1 // 2 ) * ( Constants . VIEWPORT_WIDTH ) ) , ( ( Constants . VIEWPORT_HEIGHT ) * 0.15F ) , ( ( ( ( ( n ) ++ ) * 1.15F ) - 0.3F ) * ( Constants . VIEWPORT_WIDTH ) ) ) ;
Buggy code:
public class ThreadMXBeanThreadInfosHandler implements OperationStepHandler , DescriptionProvider { public static final ThreadMXBeanThreadInfosHandler INSTANCE = new ThreadMXBeanThreadInfosHandler ( ) ; private final ParametersValidator idsValidator = new ParametersValidator ( ) ; private final ParametersValidator depthValidator = new ParametersValidator ( ) ; private final ParametersValidator lockedValidator = new ParametersValidator ( ) ; private ThreadMXBeanThreadInfosHandler ( ) { } @ Override public void execute ( OperationContext context , ModelNode operation ) throws OperationFailedException { try { final long [ ] ids = getIds ( operation ) ; ThreadMXBean mbean = ManagementFactory . getThreadMXBean ( ) ; ThreadInfo [ ] infos ; if ( operation . hasDefined ( LOCKED_MONITORS ) ) { lockedValidator . validate ( operation ) ; infos = mbean . getThreadInfo ( ids , operation . require ( LOCKED_MONITORS ) . asBoolean ( ) , operation . require ( LOCKED_SYNCHRONIZERS ) . asBoolean ( ) ) ; } else if ( operation . hasDefined ( MAX_DEPTH ) ) { depthValidator . validate ( operation ) ; infos = mbean . getThreadInfo ( ids , operation . require ( MAX_DEPTH ) . asInt ( ) ) ; } else { infos = mbean . getThreadInfo ( ids ) ; } final ModelNode result = context . getResult ( ) ; if ( infos != null ) { result . setEmptyList ( ) ; for ( ThreadInfo info : infos ) { if ( info != null ) { result . add ( PlatformMBeanUtil . getDetypedThreadInfo ( info , mbean . isThreadCpuTimeSupported ( ) ) ) ; } else { result . add ( ) ; } } } } catch ( SecurityException e ) { throw new OperationFailedException ( new ModelNode ( ) . set ( e . toString ( ) ) ) ; } <START_BUG> context . completeStep ( ) ; <END_BUG> } @ Override public ModelNode getModelDescription ( Locale locale ) { } private long [ ] getIds ( final ModelNode operation ) throws OperationFailedException { } }

Fix:
context . stepCompleted ( ) ;
Buggy code:
public class ExecProg extends GenericSharedObject { public static Trace myDebug = Trace . create ( "progsharedobject" ) ; public static final Boolean DEFAULT_INCLUDE_SERVER = Boolean . FALSE ; protected String [ ] cmds ; protected String [ ] env ; protected String [ ] replicaCmds ; protected String [ ] replicaEnv ; protected ID receiver ; protected Process proc = null ; public Boolean includeHost ; protected Boolean includeServer ; public ExecProg ( ) { } public ExecProg ( ID rcvr , String [ ] cmds , String [ ] env , Boolean includeHost , Boolean includeServer ) throws Exception { } protected void debug ( String msg ) { } protected void debug ( Throwable t , String msg ) { } public ExecProg ( ID rcvr , String [ ] hostCmds , String [ ] hostEnv , String [ ] replicaCmds , String [ ] replicaEnv , Boolean includeHost , Boolean includeServer ) throws Exception { } public ExecProg ( ID rcvr , String [ ] cmds , String [ ] env ) throws Exception { } protected void replicate ( ID remoteMember ) { } public void init ( ISharedObjectConfig config ) throws SharedObjectInitException { } protected SharedObjectDescription getReplicaDescription ( ID remoteMember ) { } public void activated ( ID [ ] others ) { debug ( "activated()" ) ; try { <START_BUG> if ( ( ! ( getContext ( ) . isGroupServer ( ) ) ) || ( includeServer . equals ( Boolean . TRUE ) ) ) { <END_BUG> startup ( ) ; } else { debug ( "Not<seq2seq4repair_space>executing<seq2seq4repair_space>commands<seq2seq4repair_space>because<seq2seq4repair_space>is<seq2seq4repair_space>server" ) ; } } catch ( Exception e ) { debug ( e , "Exception<seq2seq4repair_space>on<seq2seq4repair_space>startup()" ) ; } super . activated ( others ) ; postActivated ( ) ; } protected void postActivated ( ) { } protected void startup ( ) throws Exception { } }

Fix:
if ( ( ! ( getContext ( ) . isGroupManager ( ) ) ) || ( includeServer . equals ( Boolean . TRUE ) ) ) {
Buggy code:
public class MultiChoiceService { private MultiChoiceRepository repo ; @ Autowired public void setRepository ( MultiChoiceRepository repo ) { } public MultiChoice getMultiChoice ( MultiChoice game ) { <START_BUG> return repo . getMultiChoice ( ) ; <END_BUG> } }

Fix:
return repo . getMultiChoice ( game ) ;
Buggy code:
public class AsyncAppenderTestCase extends TestCase { static int DELAY = 10 ; Logger root = Logger . getRootLogger ( ) ; Layout layout = new SimpleLayout ( ) ; VectorAppender vectorAppender ; AsyncAppender asyncAppender = new AsyncAppender ( ) ; public AsyncAppenderTestCase ( String name ) { } public void setUp ( ) { vectorAppender = new VectorAppender ( ) ; vectorAppender . setDelay ( AsyncAppenderTestCase . DELAY ) ; asyncAppender . addAppender ( vectorAppender ) ; <START_BUG> asyncAppender . activate ( ) ; <END_BUG> root . addAppender ( asyncAppender ) ; } public void tearDown ( ) { } public void test1 ( ) throws Exception { } public void closeTest ( ) { } public void test2 ( ) { } public static Test XXsuite ( ) { } }

Fix:
asyncAppender . activateOptions ( ) ;
Buggy code:
public class WhenTakingLargeScreenshots { @ Rule public TemporaryFolder temporaryDirectory = new TemporaryFolder ( ) ; private File screenshotDirectory ; private WebDriver driver ; @ After public void closeBrowser ( ) { } @ Before public void createScreenshotDir ( ) { } private static File fileInClasspathCalled ( final String resourceName ) { } private static void openStaticTestSite ( WebDriver driver ) { } @ Test public void should_take_screenshot_with_specified_dimensions ( ) throws Exception { } @ Test public void should_take_screenshot_with_specified_larger_dimensions ( ) throws Exception { } @ Test public void should_take_screenshots_correctly ( ) throws IOException { } @ Test public void should_take_screenshots_correctly_in_chrome ( ) throws IOException { } @ Mock Logger logger ; @ Test public void should_not_explode_when_firefox_cannot_take_a_large_screenshot ( ) { } @ Test public void should_not_explode_when_chrome_cannot_take_a_large_screenshot ( ) throws IOException { driver = new WebDriverFactory ( ) . newInstanceOf ( CHROME ) ; openPage ( "big-page.html" , driver ) ; Photographer photographer = new Photographer ( driver , screenshotDirectory ) { @ Override protected Logger getLogger ( ) { return logger ; } } ; File screenshot = photographer . takeScreenshot ( "screenshot" ) ; if ( screenshot == null ) { <START_BUG> verify ( logger ) . error ( contains ( "Failed<seq2seq4repair_space>to<seq2seq4repair_space>write<seq2seq4repair_space>screenshot" ) ) ; <END_BUG> } else { File expectedScreenshot = WhenTakingLargeScreenshots . fileInClasspathCalled ( "screenshots//expected-big-screenshot.png" ) ; assertThat ( FileUtils . contentEquals ( screenshot , expectedScreenshot ) , is ( true ) ) ; } } private void openPage ( String pageName , WebDriver driver ) { } }

Fix:
verify ( logger ) . error ( contains ( "Failed<seq2seq4repair_space>to<seq2seq4repair_space>write<seq2seq4repair_space>screenshot" ) , any ( WebDriverException . class ) ) ;
Buggy code:
public interface ICommTrunk { public void sendResponse ( TrunkResponse response ) throws IOException { } <START_BUG> public void sendRequest ( TunkRequest request ) throws IOException ; <END_BUG> public void setCommTrunkRamp ( CommTrunkRamp ramp ) { } public CommTrunkRamp getCommTrunkRamp ( ) { } public boolean isConnected ( ) { } }

Fix:
public void sendRequest ( TrunkRequest request ) throws IOException ;
Buggy code:
public class StatefulSessionComponentInstance extends SessionBeanComponentInstance implements Cacheable < SessionID > { private static final long serialVersionUID = 3803978357389448971L ; private final SessionID id ; private final Interceptor afterBegin ; private final Interceptor afterCompletion ; private final Interceptor beforeCompletion ; private final Interceptor prePassivate ; private final Interceptor postActivate ; private final Interceptor ejb2XRemoveInterceptor ; private volatile Map < Object , Object > serializableInterceptors ; protected StatefulSessionComponentInstance ( final StatefulSessionComponent component , final AtomicReference < ManagedReference > instanceReference , final Interceptor preDestroyInterceptor , final Map < Method , Interceptor > methodInterceptors , final InterceptorFactoryContext factoryContext ) { } protected void afterBegin ( ) { } protected void afterCompletion ( boolean committed ) { } protected void beforeCompletion ( ) { } protected void prePassivate ( ) { } protected void postActivate ( ) { } public void discard ( ) { } private Object execute ( final Interceptor interceptor , final Method method , final Object ... parameters ) { } public Map < Object , Object > getSerializableInterceptors ( ) { } public void setSerializableInterceptors ( final Map < Object , Object > serializableInterceptors ) { } @ Override public StatefulSessionComponent getComponent ( ) { } @ Override public boolean isModified ( ) { } @ Override public SessionID getId ( ) { } public Interceptor getEjb2XRemoveInterceptor ( ) { } @ Override public String toString ( ) { } public Object writeReplace ( ) throws ObjectStreamException { <START_BUG> return new SerializedStatefulSessionComponent ( getInstance ( ) , id , getComponent ( ) . getCreateServiceName ( ) . getCanonicalName ( ) , serializableInterceptors ) ; <END_BUG> } }

Fix:
return new SerializedStatefulSessionComponent ( getInstanceReference ( ) . get ( ) , id , getComponent ( ) . getCreateServiceName ( ) . getCanonicalName ( ) , serializableInterceptors ) ;
Buggy code:
public class FragmentResolver implements IComponentResolver { private static final long serialVersionUID = 1L ; public boolean resolve ( final MarkupContainer container , final MarkupStream markupStream , final ComponentTag tag ) { if ( tag instanceof WicketTag ) { final WicketTag wTag = ( ( WicketTag ) ( tag ) ) ; <START_BUG> if ( wTag . isFragementTag ( markupStream . getWicketNamespace ( ) ) ) { <END_BUG> markupStream . skipComponent ( ) ; return true ; } } return false ; } }

Fix:
if ( wTag . isFragementTag ( ) ) {
Buggy code:
public abstract class AbstractAddStepHandler implements OperationStepHandler { public void execute ( final OperationContext context , final ModelNode operation ) throws OperationFailedException { } protected void populateModel ( final OperationContext context , final ModelNode operation , final Resource resource ) throws OperationFailedException { } protected void populateModel ( final ModelNode operation , final Resource resource ) throws OperationFailedException { } protected abstract void populateModel ( final ModelNode operation , final ModelNode model ) throws OperationFailedException { } protected boolean requiresRuntime ( OperationContext context ) { <START_BUG> return ( context . getType ( ) ) == ( Type . SERVER ) ; <END_BUG> } protected boolean requiresRuntimeVerification ( ) { } protected void performRuntime ( final OperationContext context , final ModelNode operation , final ModelNode model , final ServiceVerificationHandler verificationHandler , final List < ServiceController < ? > > newControllers ) throws OperationFailedException { } protected void rollbackRuntime ( OperationContext context , final ModelNode operation , final ModelNode model , List < ServiceController < ? > > controllers ) { } }

Fix:
return context . isNormalServer ( ) ;
Buggy code:
public class MachineName extends AbstractFunction implements Serializable { private static final List desc = new LinkedList ( ) ; private static final String KEY = "__machineName" ; private Object [ ] values ; public MachineName ( ) { } public Object clone ( ) throws CloneNotSupportedException { } public synchronized String execute ( SampleResult previousResult , Sampler currentSampler ) throws InvalidVariableException { String machineName = JMeterUtils . getLocalHostName ( ) ; if ( ( values . length ) >= 1 ) { JMeterVariables vars = getVariables ( ) ; if ( vars != null ) { <START_BUG> String varName = ( ( org . apache . jmeter . engine . util . CompoundVariable ) ( values [ 0 ] ) ) . execute ( ) ; <END_BUG> if ( ( varName . length ( ) ) > 0 ) { vars . put ( varName , machineName ) ; } } } return machineName ; } public synchronized void setParameters ( Collection parameters ) throws InvalidVariableException { } public String getReferenceKey ( ) { } public List getArgumentDesc ( ) { } }

Fix:
String varName = ( ( org . apache . jmeter . engine . util . CompoundVariable ) ( values [ 0 ] ) ) . execute ( ) . trim ( ) ;
Buggy code:
public class QueueManagementBeans { public static QueueManagementBeans self ; public static final String DIRECT_EXCHANGE = "amq.direct" ; public static final String DEFAULT_EXCHANGE = "<<default>>" ; public static QueueManagementBeans getInstance ( ) { } public void createQueue ( String queueName , String userName ) throws QueueManagerException { } public List < Queue > getAllQueueCounts ( ) throws QueueManagerException { } public long getMessageCount ( String queueName , String msgPattern ) throws QueueManagerException { long messageCount = 0 ; MBeanServer mBeanServer = ManagementFactory . getPlatformMBeanServer ( ) ; try { ObjectName objectName = new ObjectName ( "org.wso2.andes:type=QueueManagementInformation,name=QueueManagementInformation" ) ; String operationName = "getMessageCount" ; Object [ ] parameters = new Object [ ] { queueName , msgPattern } ; String [ ] signature = new String [ ] { String . class . getName ( ) , String . class . getName ( ) } ; Object result = mBeanServer . invoke ( objectName , operationName , parameters , signature ) ; if ( result != null ) { messageCount = ( ( Long ) ( result ) ) ; } return messageCount ; } catch ( MalformedObjectNameException | ReflectionException | MBeanException | InstanceNotFoundException e ) { <START_BUG> throw new QueueManagerException ( ( "Cannot<seq2seq4repair_space>access<seq2seq4repair_space>mBean<seq2seq4repair_space>operations<seq2seq4repair_space>for<seq2seq4repair_space>message<seq2seq4repair_space>count:" + queueName ) , e ) ; <END_BUG> } } public void deleteQueue ( String queueName ) throws QueueManagerException { } public void deleteMessagesFromDeadLetterQueue ( long [ ] messageIDs , String destinationQueueName ) throws QueueManagerException { } public void restoreMessagesFromDeadLetterQueue ( long [ ] messageIDs , String destinationQueueName ) throws QueueManagerException { } public void restoreMessagesFromDeadLetterQueueWithDifferentDestination ( long [ ] messageIDs , String newDestinationQueueName , String destinationQueueName ) throws QueueManagerException { } public void purgeMessagesFromQueue ( String queueName , String userName ) throws QueueManagerException { } public static boolean queueExists ( String queueName ) throws QueueManagerException { } public List < Message > browseQueue ( String queueName , long nextMessageIdToRead , int maxMessageCount ) throws QueueManagerException { } }

Fix:
throw new QueueManagerException ( ( "Error<seq2seq4repair_space>while<seq2seq4repair_space>invoking<seq2seq4repair_space>mBean<seq2seq4repair_space>operations<seq2seq4repair_space>for<seq2seq4repair_space>message<seq2seq4repair_space>count:" + queueName ) , e ) ;
Buggy code:
public class AccessAuthorizationUseRealmRolesWriteAttributeHandler extends AbstractWriteAttributeHandler < Void > { private final WritableAuthorizerConfiguration authorizerConfiguration ; AccessAuthorizationUseRealmRolesWriteAttributeHandler ( WritableAuthorizerConfiguration authorizerConfiguration ) { } @ Override protected void finishModelStage ( OperationContext context , ModelNode operation , String attributeName , ModelNode newValue , ModelNode oldValue , Resource model ) throws OperationFailedException { if ( ( ( newValue . getType ( ) ) == ( ModelType . EXPRESSION ) ) || ( ( newValue . asBoolean ( false ) ) == false ) ) { <START_BUG> RbacSanityCheckOperation . registerOperation ( context ) ; <END_BUG> } } @ Override protected boolean applyUpdateToRuntime ( OperationContext context , ModelNode operation , String attributeName , ModelNode resolvedValue , ModelNode currentValue , AbstractWriteAttributeHandler . HandbackHolder < Void > handbackHolder ) throws OperationFailedException { } @ Override protected void revertUpdateToRuntime ( OperationContext context , ModelNode operation , String attributeName , ModelNode valueToRestore , ModelNode valueToRevert , Void handback ) throws OperationFailedException { } private void setUseRealmRoles ( final ModelNode value ) { } @ Override protected boolean requiresRuntime ( OperationContext context ) { } }

Fix:
RbacSanityCheckOperation . addOperation ( context ) ;
Buggy code:
public interface DistributableSessionIdentifierCodecBuilder { <START_BUG> ServiceBuilder < SessionIdentifierCodec > build ( ServiceTarget target , ServiceName name , ServiceName deploymentServiceName ) ; <END_BUG> ServiceBuilder < ? > buildServerDependency ( ServiceTarget target ) { } }

Fix:
ServiceBuilder < SessionIdentifierCodec > build ( ServiceTarget target , ServiceName name , String deploymentName ) ;
Buggy code:
public class DbSetup { public static boolean doIt ( Connection conn ) throws Throwable { } public static synchronized void printException ( String where , Exception e ) { if ( e instanceof SQLException ) { SQLException se = ( ( SQLException ) ( e ) ) ; if ( se . getSQLState ( ) . equals ( "40001" ) ) System . out . println ( "deadlocked<seq2seq4repair_space>detected" ) ; if ( se . getSQLState ( ) . equals ( "40XL1" ) ) System . out . println ( "<seq2seq4repair_space>lock<seq2seq4repair_space>timeout<seq2seq4repair_space>exception" ) ; if ( se . getSQLState ( ) . equals ( "23500" ) ) System . out . println ( "<seq2seq4repair_space>duplicate<seq2seq4repair_space>key<seq2seq4repair_space>violation" ) ; if ( ( se . getNextException ( ) ) != null ) { String m = se . getNextException ( ) . getSQLState ( ) ; System . out . println ( ( ( ( se . getNextException ( ) . getMessage ( ) ) + "<seq2seq4repair_space>SQLSTATE:<seq2seq4repair_space>" ) + m ) ) ; } } <START_BUG> if ( e . getMessage ( ) . equals ( null ) ) { <END_BUG> System . out . println ( "NULL<seq2seq4repair_space>error<seq2seq4repair_space>message<seq2seq4repair_space>detected" ) ; System . out . println ( ( "Here<seq2seq4repair_space>is<seq2seq4repair_space>the<seq2seq4repair_space>NULL<seq2seq4repair_space>exection<seq2seq4repair_space>-<seq2seq4repair_space>" + ( e . toString ( ) ) ) ) ; System . out . println ( "Stack<seq2seq4repair_space>trace<seq2seq4repair_space>of<seq2seq4repair_space>the<seq2seq4repair_space>NULL<seq2seq4repair_space>exception<seq2seq4repair_space>-<seq2seq4repair_space>" ) ; e . printStackTrace ( System . out ) ; } System . out . println ( ( ( ( "During<seq2seq4repair_space>" + where ) + ",<seq2seq4repair_space>exception<seq2seq4repair_space>thrown<seq2seq4repair_space>was<seq2seq4repair_space>:<seq2seq4repair_space>" ) + ( e . getMessage ( ) ) ) ) ; } }

Fix:
if ( ( e . getMessage ( ) ) == null ) {
Buggy code:
@ Ignore public class TestPageRender extends TestCase { public static class Page1 extends Page { private static final long serialVersionUID = 1L ; public Page1 ( ) { } } public void testRender1 ( ) { <START_BUG> ThreadContext context = ThreadContext . getAndClean ( ) ; <END_BUG> MockApplication app = new MockApplication ( ) ; app . setName ( "TestApplication1" ) ; app . set ( ) ; app . initApplication ( ) ; app . getRequestCycleSettings ( ) . setRenderStrategy ( ONE_PASS_RENDER ) ; app . registerEncoder ( new MountedMapper ( "first-test-page" , TestPageRender . Page1 . class ) ) ; Request request = new org . apache . wicket . ng . mock . MockWebRequest ( Url . parse ( "first-test-page" ) ) ; MockWebResponse response = new MockWebResponse ( ) ; MockRequestCycle cycle = ( ( MockRequestCycle ) ( app . createRequestCycle ( request , response ) ) ) ; cycle . processRequestAndDetach ( ) ; System . out . println ( "Rendered:" ) ; System . out . println ( response . getTextResponse ( ) ) ; request = new org . apache . wicket . ng . mock . MockWebRequest ( Url . parse ( "wicket//page?0-1.ILinkListener-link" ) ) ; response = new MockWebResponse ( ) ; cycle = ( ( MockRequestCycle ) ( app . createRequestCycle ( request , response ) ) ) ; cycle . processRequestAndDetach ( ) ; cycle = ( ( MockRequestCycle ) ( app . createRequestCycle ( request , response ) ) ) ; cycle . forceRequestHandler ( new org . apache . wicket . ng . request . handler . impl . ListenerInterfaceRequestHandler ( new PageAndComponentProvider ( 0 , null , "link" ) , ILinkListener . INTERFACE ) ) ; cycle . processRequestAndDetach ( ) ; app . destroy ( ) ; ThreadContext . restore ( context ) ; } }

Fix:
ThreadContext context = ThreadContext . detach ( ) ;
Buggy code:
public class FilterPreferencesAction extends AbstractColumbaAction implements SelectionListener { public FilterPreferencesAction ( FrameMediator frameMediator ) { } public void actionPerformed ( ActionEvent evt ) { FolderCommandReference [ ] r = ( ( FolderCommandReference [ ] ) ( frameMediator . getSelectionManager ( ) . getSelection ( "mail.tree" ) ) ) ; MessageFolder folder = ( ( MessageFolder ) ( r [ 0 ] . getFolder ( ) ) ) ; if ( folder == null ) { return ; } FolderItem item = folder . getConfiguration ( ) ; if ( item == null ) { return ; } if ( folder instanceof VirtualFolder ) { new SearchFrame ( ( ( AbstractMailFrameController ) ( frameMediator ) ) , ( ( VirtualFolder ) ( folder ) ) ) ; } else { <START_BUG> new org . columba . mail . gui . config . filter . ConfigFrame ( frameMediator . getView ( ) . getFrame ( ) , folder ) ; <END_BUG> } } public void selectionChanged ( SelectionChangedEvent e ) { } }

Fix:
new org . columba . mail . gui . config . filter . ConfigFrame ( frameMediator , folder ) ;
Buggy code:
public class UpstreamsConf { public static String generate ( Slb slb , VirtualServer vs , List < App > apps ) { } public static String buildUpstreamName ( Slb slb , VirtualServer vs , App app ) { } public static String buildUpstreamConf ( Slb slb , VirtualServer vs , App app , String upstreamName ) { StringBuilder b = new StringBuilder ( 1024 ) ; b . append ( "upstream<seq2seq4repair_space>" ) . append ( upstreamName ) . append ( "<seq2seq4repair_space>{" ) . append ( "\n" ) ; b . append ( "<seq2seq4repair_space>" ) . append ( LBConf . generate ( slb , vs , app ) ) ; for ( AppServer as : app . getAppServers ( ) ) { Server s = as . getServer ( ) ; <START_BUG> b . append ( "<seq2seq4repair_space>server<seq2seq4repair_space>" ) . append ( ( ( ( s . getIp ( ) ) + ":" ) + ( vs . getPort ( ) ) ) ) . append ( "<seq2seq4repair_space>weight=" ) . append ( as . getWeight ( ) ) . append ( "<seq2seq4repair_space>max_fails=" ) . append ( as . getMaxFails ( ) ) . append ( "<seq2seq4repair_space>fail_timeout=" ) . append ( as . getFailTimeout ( ) ) . append ( ";\n" ) ; <END_BUG> } b . append ( "}" ) . append ( "\n" ) ; return b . toString ( ) ; } }

Fix:
b . append ( "<seq2seq4repair_space>server<seq2seq4repair_space>" ) . append ( ( ( ( s . getIp ( ) ) + ":" ) + ( as . getPort ( ) ) ) ) . append ( "<seq2seq4repair_space>weight=" ) . append ( as . getWeight ( ) ) . append ( "<seq2seq4repair_space>max_fails=" ) . append ( as . getMaxFails ( ) ) . append ( "<seq2seq4repair_space>fail_timeout=" ) . append ( as . getFailTimeout ( ) ) . append ( ";\n" ) ;
Buggy code:
public class ResourceLink extends Link implements IResourceListener { private static final long serialVersionUID = 1L ; private final ResourceReference resourceReference ; private final Resource resource ; public ResourceLink ( final String id , final ResourceReference resourceReference ) { } public ResourceLink ( final String id , final Resource resource ) { } public void onClick ( ) { } protected final String getURL ( ) { if ( ( resourceReference ) != null ) { resourceReference . setLocale ( getLocale ( ) ) ; resourceReference . setStyle ( getStyle ( ) ) ; resourceReference . bind ( getApplication ( ) ) ; <START_BUG> return getPage ( ) . urlFor ( resourceReference . getPath ( ) ) ; <END_BUG> } return urlFor ( IResourceListener . class ) ; } public final void onResourceRequested ( ) { } }

Fix:
return getRequestCycle ( ) . urlFor ( resourceReference ) ;
Buggy code:
@ Controller @ RequestMapping ( "//activity//administrator" ) public class ActivityAdministratorController extends AbstractController { @ Autowired private ActivityService activityService ; @ Autowired private ServiceService serviceService ; public ActivityAdministratorController ( ) { } @ RequestMapping ( value = "//list" , method = RequestMethod . GET ) public ModelAndView list ( @ RequestParam ( required = false ) Integer gymId ) { } @ RequestMapping ( value = "//create" , method = RequestMethod . GET ) public ModelAndView create ( @ RequestParam ( required = false ) Integer activityId , @ RequestParam ( required = false ) Integer serviceId ) { } @ RequestMapping ( value = "//create" , method = RequestMethod . POST , params = "save" ) public ModelAndView saveOfCreate ( Activity activity , BindingResult binding ) { ModelAndView result ; if ( binding . hasErrors ( ) ) { result = createEditModelAndView ( activity ) ; } else { try { activity . setTitle ( activity . getService ( ) . getName ( ) ) ; activity . setPictures ( activity . getService ( ) . getPictures ( ) ) ; result = createEditModelAndView ( activity ) ; } catch ( Throwable oops ) { <START_BUG> result = createEditModelAndView ( activity , "activity.commit.error" ) ; <END_BUG> } } return result ; } @ RequestMapping ( value = "//edit" , method = RequestMethod . GET ) public ModelAndView edit ( @ RequestParam int activityId ) { } @ RequestMapping ( value = "//edit" , method = RequestMethod . POST , params = "save" ) public ModelAndView save ( @ Valid Activity activity , BindingResult binding ) { } @ RequestMapping ( value = "//delete" , method = RequestMethod . GET ) public ModelAndView cancel ( @ RequestParam int activityId ) { } protected ModelAndView createEditModelAndView ( Activity activity ) { } protected ModelAndView createEditModelAndView ( Activity activity , String message ) { } protected ModelAndView createEditModelAndViewCreate ( Activity activity ) { } protected ModelAndView createEditModelAndViewCreate ( Activity activity , String message ) { } No newline ; at end ; of file ; }

Fix:
result = createEditModelAndViewCreate ( activity , "activity.commit.error" ) ;
Buggy code:
public final class WicketParamTagHandler extends AbstractMarkupFilter { private static final Log log = LogFactory . getLog ( WicketParamTagHandler . class ) ; private ComponentTag lastTag ; private IXmlPullParser xmlParser ; private boolean stripWicketTag = true ; private IMarkupSettings settings ; public WicketParamTagHandler ( final IMarkupFilter parent , final IMarkupSettings settings ) { } public void setStripWicketTag ( final boolean strip ) { } public final MarkupElement nextTag ( ) throws ParseException { } private ComponentTag handleNext ( ComponentTag tag ) throws ParseException { if ( tag . isClose ( ) ) { return tag ; } if ( ( tag . getId ( ) ) == null ) { return tag ; } if ( ( ! ( tag instanceof WicketTag ) ) || ( ! ( ( ( WicketTag ) ( tag ) ) . isParamTag ( ) ) ) ) { return tag ; } <START_BUG> final CharSequence rawMarkup = xmlParser . getInputSubsequence ( ( ( lastTag . getPos ( ) ) + ( lastTag . getLength ( ) ) ) , tag . getPos ( ) ) ; <END_BUG> if ( ( rawMarkup . length ( ) ) > 0 ) { String text = rawMarkup . toString ( ) ; text = text . replaceAll ( "[\\r\\n]+" , "" ) . trim ( ) ; if ( ( text . length ( ) ) > 0 ) { throw new ParseException ( ( "There<seq2seq4repair_space>must<seq2seq4repair_space>not<seq2seq4repair_space>be<seq2seq4repair_space>any<seq2seq4repair_space>text<seq2seq4repair_space>between<seq2seq4repair_space>a<seq2seq4repair_space>component<seq2seq4repair_space>tag<seq2seq4repair_space>and<seq2seq4repair_space>" + "it's<seq2seq4repair_space>related<seq2seq4repair_space>param<seq2seq4repair_space>tag.<seq2seq4repair_space>Only<seq2seq4repair_space>spaces<seq2seq4repair_space>and<seq2seq4repair_space>line<seq2seq4repair_space>breaks<seq2seq4repair_space>are<seq2seq4repair_space>allowed." ) , tag . getPos ( ) ) ; } } lastTag . getAdditionalAttributes ( ) . putAll ( tag . getAttributes ( ) ) ; if ( ( stripWicketTag ) == true ) { tag = ( ( ComponentTag ) ( getParent ( ) . nextTag ( ) ) ) ; } else { WicketParamTagHandler . log . warn ( "Be<seq2seq4repair_space>careful.<seq2seq4repair_space>Not<seq2seq4repair_space>stripping<seq2seq4repair_space><wicket:param><seq2seq4repair_space>from<seq2seq4repair_space>output<seq2seq4repair_space>may<seq2seq4repair_space>cause<seq2seq4repair_space>subtle<seq2seq4repair_space>errors." ) ; } return tag ; } }

Fix:
final CharSequence rawMarkup = xmlParser . getInput ( ( ( lastTag . getPos ( ) ) + ( lastTag . getLength ( ) ) ) , tag . getPos ( ) ) ;
Buggy code:
public class SpansQueryConfigHandler extends QueryConfigHandler { public SpansQueryConfigHandler ( ) { } @ Override <START_BUG> public FieldConfig getFieldConfig ( CharSequence fieldName ) { <END_BUG> return null ; } }

Fix:
public FieldConfig getFieldConfig ( String fieldName ) {
Buggy code:
public class TypeChecker { private ReferenceMap referenceMap = new ReferenceMap ( ) ; private Questionnaire ast ; public TypeChecker ( Questionnaire ast ) { } public boolean runChecks ( ) { } private void typeCheck ( Node n ) { try { n . typeCheck ( ) ; } catch ( TypeCheckingException e ) { e . printStackTrace ( ) ; } if ( n . hasChildren ( ) ) { for ( Node child : n . getChildren ( ) ) { <START_BUG> buildReferenceMap ( child ) ; <END_BUG> } } } private void buildReferenceMap ( Node n ) { } }

Fix:
typeCheck ( child ) ;
Buggy code:
public class RemoveAnnotationFromMethodParameterTest extends AbstractAnnotationTest { @ Override public String getPackageName ( ) { } @ Override public String getClassName ( ) { } @ Override public String getClassContents ( ) { } @ Override public Annotation getAnnotation ( ) { } public void testRemoveAnnotationFromMethodParameter ( ) { try { assertNotNull ( annotation ) ; assertEquals ( WebParam . class . getSimpleName ( ) , AnnotationUtils . getAnnotationName ( annotation ) ) ; IMethod method = source . findPrimaryType ( ) . getMethod ( "add" , new String [ ] { "I" , "I" } ) ; assertNotNull ( method ) ; SingleVariableDeclaration parameter = AnnotationUtils . getMethodParameter ( compilationUnit , method , 93 ) ; assertTrue ( AnnotationUtils . isAnnotationPresent ( parameter , annotation ) ) ; AnnotationUtils . removeAnnotationFromMethodParameter ( source , rewriter , parameter , annotation , textFileChange ) ; assertTrue ( executeChange ( new NullProgressMonitor ( ) , textFileChange ) ) ; <START_BUG> parameter = AnnotationUtils . getMethodParameter ( AnnotationUtils . getASTParser ( method . getCompilationUnit ( ) ) , method , 93 ) ; <END_BUG> assertFalse ( AnnotationUtils . isAnnotationPresent ( parameter , annotation ) ) ; } catch ( CoreException ce ) { fail ( ce . getLocalizedMessage ( ) ) ; } } }

Fix:
parameter = AnnotationUtils . getMethodParameter ( AnnotationUtils . getASTParser ( method . getCompilationUnit ( ) , false ) , method , 93 ) ;
Buggy code:
@ RunWith ( Arquillian . class ) @ RunAsClient public class SimpleWebTestCase { private static final Logger log = Logger . getLogger ( SimpleWebTestCase . class ) ; @ Deployment ( name = "deployment-single" ) public static Archive < ? > deployment ( ) { } @ Test @ OperateOnDeployment ( "deployment-single" ) public void test ( @ ArquillianResource ( SimpleServlet . class ) URL baseURL ) throws IOException , ClientProtocolException { DefaultHttpClient client = new DefaultHttpClient ( ) ; String url = ( baseURL . toString ( ) ) + "simple" ; try { HttpResponse response = client . execute ( new HttpGet ( url ) ) ; Assert . assertEquals ( SC_OK , response . getStatusLine ( ) . getStatusCode ( ) ) ; Assert . assertEquals ( 1 , Integer . parseInt ( response . getFirstHeader ( "value" ) . getValue ( ) ) ) ; Assert . assertFalse ( Boolean . valueOf ( response . getFirstHeader ( "serialized" ) . getValue ( ) ) ) ; response . getEntity ( ) . getContent ( ) . close ( ) ; response = client . execute ( new HttpGet ( url ) ) ; Assert . assertEquals ( SC_OK , response . getStatusLine ( ) . getStatusCode ( ) ) ; Assert . assertEquals ( 2 , Integer . parseInt ( response . getFirstHeader ( "value" ) . getValue ( ) ) ) ; <START_BUG> Assert . assertTrue ( Boolean . valueOf ( response . getFirstHeader ( "serialized" ) . getValue ( ) ) ) ; <END_BUG> response . getEntity ( ) . getContent ( ) . close ( ) ; } finally { client . getConnectionManager ( ) . shutdown ( ) ; } } }

Fix:
Assert . assertFalse ( Boolean . valueOf ( response . getFirstHeader ( "serialized" ) . getValue ( ) ) ) ;
Buggy code:
public abstract class CompletionRequestor { private int ignoreSet = 0 ; public CompletionRequestor ( ) { } public final boolean isIgnored ( int completionProposalKind ) { } public final void setIgnored ( int completionProposalKind , boolean ignore ) { <START_BUG> if ( ( completionProposalKind < ( CompletionProposal . ANONYMOUS_CLASS_DECLARATION ) ) || ( completionProposalKind > ( CompletionProposal . VARIABLE_DECLARATION ) ) ) { <END_BUG> throw new IllegalArgumentException ( ) ; } if ( ignore ) { this . ignoreSet |= 1 << completionProposalKind ; } else { this . ignoreSet &= ~ ( 1 << completionProposalKind ) ; } } public void beginReporting ( ) { } public void endReporting ( ) { } public void completionFailure ( IProblem problem ) { } public abstract void accept ( CompletionProposal proposal ) { } }

Fix:
if ( ( completionProposalKind < ( CompletionProposal . ANONYMOUS_CLASS_DECLARATION ) ) || ( completionProposalKind > ( CompletionProposal . METHOD_NAME_REFERENCE ) ) ) {
Buggy code:
public class HexBinaryDV extends TypeValidator { public short getAllowedFacets ( ) { } public Object getActualValue ( String content , ValidationContext context ) throws InvalidDatatypeValueException { String decoded = HexBin . decode ( content ) ; if ( decoded == null ) <START_BUG> throw new InvalidDatatypeValueException ( ( ( "Value<seq2seq4repair_space>'" + content ) + "'<seq2seq4repair_space>is<seq2seq4repair_space>not<seq2seq4repair_space>encoded<seq2seq4repair_space>in<seq2seq4repair_space>Hex" ) ) ; <END_BUG> return decoded ; } }

Fix:
throw new InvalidDatatypeValueException ( "cvc-datatype-valid.1.2.1" , new Object [ ] { content , "hexBinary" } ) ;
Buggy code:
public class SplashScreen extends Canvas { public SplashScreen ( ) { } public void dispose ( ) { } public synchronized void advance ( ) { } public void update ( Graphics g ) { } public synchronized void paint ( Graphics g ) { Dimension size = getSize ( ) ; if ( ( offscreenImg ) == null ) { offscreenImg = createImage ( size . width , size . height ) ; offscreenGfx = offscreenImg . getGraphics ( ) ; } offscreenGfx . setColor ( Color . gray ) ; offscreenGfx . drawRect ( 0 , 0 , ( ( size . width ) - 1 ) , ( ( size . height ) - 1 ) ) ; offscreenGfx . drawImage ( image , 1 , 1 , this ) ; offscreenGfx . setColor ( new Color ( 206 , 206 , 229 ) ) ; offscreenGfx . fillRect ( 1 , ( ( image . getHeight ( this ) ) + 1 ) , ( ( ( ( win . getWidth ( ) ) - 2 ) * ( progress ) ) // 7 ) , fm . getHeight ( ) ) ; offscreenGfx . setColor ( Color . black ) ; String str = "Version<seq2seq4repair_space>" + ( jEdit . getVersion ( ) ) ; <START_BUG> offscreenGfx . drawString ( str , ( ( ( win . getWidth ( ) ) - ( fm . stringWidth ( str ) ) ) // 2 ) , ( ( ( win . getHeight ( ) ) - ( fm . getDescent ( ) ) ) - ( fm . getLeading ( ) ) ) ) ; <END_BUG> g . drawImage ( offscreenImg , 0 , 0 , this ) ; notify ( ) ; } private FontMetrics fm ; private Window win ; private Image image ; private Image offscreenImg ; private Graphics offscreenGfx ; private int progress ; }

Fix:
offscreenGfx . drawString ( str , ( ( ( getWidth ( ) ) - ( fm . stringWidth ( str ) ) ) // 2 ) , ( ( ( win . getHeight ( ) ) - ( fm . getDescent ( ) ) ) - ( fm . getLeading ( ) ) ) ) ;