nus-yam/ex-repair huggingface dataset:
Buggy code:
public class WebPage extends Page implements IHeaderRenderer { private String bodyOnLoad ; protected WebPage ( ) { } protected WebPage ( final IModel model ) { } public String urlFor ( final String pageMapName , final Class pageClass , final PageParameters parameters ) { if ( pageClass == null ) { throw new NullPointerException ( "argument<seq2seq4repair_space>pageClass<seq2seq4repair_space>may<seq2seq4repair_space>not<seq2seq4repair_space>be<seq2seq4repair_space>null" ) ; } final WebRequestCycle cycle = getWebRequestCycle ( ) ; final StringBuffer buffer = urlPrefix ( cycle ) ; if ( pageMapName == null ) { appendPageMapName ( buffer ) ; } else { buffer . append ( "?pagemap=" ) ; buffer . append ( pageMapName ) ; buffer . append ( '&' ) ; } buffer . append ( "bookmarkablePage=" ) ; <START_BUG> String pageReference = cycle . getApplication ( ) . getPages ( ) . aliasForPageClass ( pageClass ) ; <END_BUG> if ( pageReference == null ) pageReference = pageClass . getName ( ) ; buffer . append ( pageReference ) ; if ( parameters != null ) { for ( final Iterator iterator = parameters . keySet ( ) . iterator ( ) ; iterator . hasNext ( ) ; ) { final String key = ( ( String ) ( iterator . next ( ) ) ) ; buffer . append ( '&' ) ; buffer . append ( key ) ; buffer . append ( '=' ) ; buffer . append ( parameters . getString ( key ) ) ; } } return cycle . getResponse ( ) . encodeURL ( buffer . toString ( ) ) ; } public String urlFor ( final Component component , final Class listenerInterface ) { } public String urlFor ( final String path ) { } public String getMarkupType ( ) { } protected final WebRequestCycle getWebRequestCycle ( ) { } protected final BookmarkablePageLink homePageLink ( final String id ) { } private void appendPageMapName ( final StringBuffer buffer ) { } private StringBuffer urlPrefix ( final WebRequestCycle cycle ) { } public final void renderHeadSections ( final HtmlHeaderContainer container ) { } public String getBodyOnLoad ( ) { } public final void appendToBodyOnLoad ( final String onLoad ) { } protected void onEndRequest ( ) { } }

Fix:
String pageReference = cycle . getApplication ( ) . getPages ( ) . aliasForClass ( pageClass ) ;
Buggy code:
public class CodeSnippetFieldReference extends FieldReference implements ProblemReasons , EvaluationConstants { EvaluationContext evaluationContext ; FieldBinding delegateThis ; public CodeSnippetFieldReference ( char [ ] source , long pos , EvaluationContext evaluationContext ) { } public void generateAssignment ( BlockScope currentScope , CodeStream codeStream , Assignment assignment , boolean valueRequired ) { } public void generateCode ( BlockScope currentScope , CodeStream codeStream , boolean valueRequired ) { } public void generateCompoundAssignment ( BlockScope currentScope , CodeStream codeStream , Expression expression , int operator , int assignmentImplicitConversion , boolean valueRequired ) { } public void generatePostIncrement ( BlockScope currentScope , CodeStream codeStream , CompoundAssignment postIncrement , boolean valueRequired ) { } public void manageSyntheticAccessIfNecessary ( BlockScope currentScope , FlowInfo flowInfo , boolean isReadAccess ) { if ( ( ( flowInfo . tagBits ) & ( FlowInfo . UNREACHABLE ) ) != 0 ) return ; if ( ( this . binding ) instanceof ParameterizedFieldBinding ) { ParameterizedFieldBinding parameterizedField = ( ( ParameterizedFieldBinding ) ( this . binding ) ) ; this . codegenBinding = parameterizedField . originalField ; if ( this . codegenBinding . type . isTypeVariable ( ) ) { TypeVariableBinding variableReturnType = ( ( TypeVariableBinding ) ( this . codegenBinding . type ) ) ; if ( ( variableReturnType . firstBound ) != ( parameterizedField . type ) ) { this . genericCast = parameterizedField . type . erasure ( ) ; } } } else { this . codegenBinding = this . binding ; } TypeBinding someReceiverType = ( ( this . delegateThis ) != null ) ? this . delegateThis . type : this . receiverType ; if ( ( ( ( ( this . binding . declaringClass ) != someReceiverType ) && ( ! ( someReceiverType . isArrayType ( ) ) ) ) && ( ( this . binding . declaringClass ) != null ) ) && ( ( this . binding . constant ( ) ) == ( Constant . NotAConstant ) ) ) { CompilerOptions options = currentScope . compilerOptions ( ) ; <START_BUG> if ( ( ( ( ( options . targetJDK ) >= ( ClassFileConstants . JDK1_2 ) ) && ( ( ( ( options . complianceLevel ) >= ( ClassFileConstants . JDK1_4 ) ) || ( ! ( receiver . isImplicitThis ( ) ) ) ) || ( ! ( this . codegenBinding . isStatic ( ) ) ) ) ) && ( ( this . binding . declaringClass . id ) != ( TypeIds . T_JavaLangObject ) ) ) || ( ! ( this . binding . declaringClass . canBeSeenBy ( currentScope ) ) ) ) { <END_BUG> this . codegenBinding = currentScope . enclosingSourceType ( ) . getUpdatedFieldBinding ( this . codegenBinding , ( ( ReferenceBinding ) ( someReceiverType . erasure ( ) ) ) ) ; } } } public TypeBinding resolveType ( BlockScope scope ) { } }

Fix:
if ( ( ( ( ( options . targetJDK ) >= ( ClassFileConstants . JDK1_2 ) ) && ( ( ( ( options . complianceLevel ) >= ( ClassFileConstants . JDK1_4 ) ) || ( ! ( this . receiver . isImplicitThis ( ) ) ) ) || ( ! ( this . codegenBinding . isStatic ( ) ) ) ) ) && ( ( this . binding . declaringClass . id ) != ( TypeIds . T_JavaLangObject ) ) ) || ( ! ( this . binding . declaringClass . canBeSeenBy ( currentScope ) ) ) ) {
Buggy code:
public class AccessRuleSet { private AccessRule [ ] accessRules ; public String [ ] messageTemplates ; public static final int MESSAGE_TEMPLATES_LENGTH = 4 ; public AccessRuleSet ( AccessRule [ ] accessRules ) { } public AccessRuleSet ( AccessRule [ ] accessRules , String [ ] messageTemplates ) { } public boolean equals ( Object object ) { } public AccessRule [ ] getAccessRules ( ) { } public AccessRestriction getViolatedRestriction ( char [ ] targetTypeFilePath ) { for ( int i = 0 , length = this . accessRules . length ; i < length ; i ++ ) { AccessRule accessRule = this . accessRules [ i ] ; if ( CharOperation . pathMatch ( accessRule . pattern , targetTypeFilePath , true , '//' ) ) { <START_BUG> switch ( accessRule . problemId ) { <END_BUG> case IProblem . ForbiddenReference : case IProblem . DiscouragedReference : return new AccessRestriction ( accessRule , this . messageTemplates ) ; default : return null ; } } } return null ; } public String toString ( ) { } public String toString ( boolean wrap ) { } }

Fix:
switch ( accessRule . getProblemId ( ) ) {
Buggy code:
public class WWinKeyBindingService { private HashMap globalActionDefIdToAction = new HashMap ( ) ; private HashMap actionSetDefIdToAction = new HashMap ( ) ; private IPropertyChangeListener propertyListener ; private KeyBindingService activeService ; private WorkbenchWindow window ; private AcceleratorMenu accMenu ; private final WWinKeyBindingService . KeyModeContributionItem statusItem = new WWinKeyBindingService . KeyModeContributionItem ( "KeyModeContribution" ) ; private VerifyListener verifyListener = new VerifyListener ( ) { public void verifyText ( VerifyEvent event ) { } } ; private void setStatusLineMessage ( KeySequence keySequence ) { } public void clear ( ) { } public void pressed ( KeyStroke keyStroke , Event event ) { } public void invoke ( String action , Event event ) { } public WWinKeyBindingService ( WorkbenchWindow workbenchWindow ) { } public void dispose ( ) { } public void registerGlobalAction ( IAction action ) { } public void registerActionSets ( IActionSet [ ] sets ) { } public HashMap getMapping ( ) { } public IWorkbenchWindow getWindow ( ) { } public void update ( IWorkbenchPart part , boolean force ) { } public String getDefinitionId ( int accelerator ) { } public void updateAccelerators ( ) { } private static class KeyModeContributionItem extends ContributionItem { private int fixedWidth = - 1 ; private String text ; private CLabel label ; public KeyModeContributionItem ( String id ) { } public void setText ( String msg ) { } public void fill ( Composite parent ) { label = new CLabel ( parent , SWT . SHADOW_IN ) ; StatusLineLayoutData data = new StatusLineLayoutData ( ) ; if ( ( fixedWidth ) < 0 ) { GC gc = new GC ( parent ) ; gc . setFont ( parent . getFont ( ) ) ; <START_BUG> fixedWidth = ( gc . getFontMetrics ( ) . getAverageCharWidth ( ) ) * 22 ; <END_BUG> gc . dispose ( ) ; } data . widthHint = fixedWidth ; label . setLayoutData ( data ) ; if ( ( text ) != null ) label . setText ( text ) ; } } }

Fix:
fixedWidth = ( gc . getFontMetrics ( ) . getAverageCharWidth ( ) ) * 40 ;
Buggy code:
public class ServicePublicationHandler implements ServiceTrackerCustomizer { private IDiscoveryService discovery ; private final String serviceNamePrefix ; private Map serviceInfos = Collections . synchronizedMap ( new HashMap ( ) ) ; private final IServiceListener serviceListener = new IServiceListener ( ) { public void serviceDiscovered ( IServiceEvent anEvent ) { } public void serviceUndiscovered ( IServiceEvent anEvent ) { } } ; void handleServiceDiscovered ( ID localContainerID , IServiceInfo serviceInfo ) { } private DiscoveredServiceNotification createDiscoveredServiceNotification ( IServiceInfo serviceInfo ) { } private DiscoveredServiceTracker [ ] findMatchingDiscoveredServiceTrackers ( IServiceInfo serviceInfo ) { } private boolean matchWithDiscoveredServiceInfo ( ServiceReference serviceReference , IServiceInfo serviceInfo ) { } private boolean matchServiceID ( IServiceID serviceId ) { } void handleServiceUndiscovered ( ID localContainerID , IServiceInfo serviceInfo ) { } public ServicePublicationHandler ( IDiscoveryService discovery , String serviceNamePrefix ) { } public ServiceReference [ ] getPublishedServices ( ) { } IServiceInfo addServiceInfo ( ServiceReference sr , IServiceInfo si ) { } IServiceInfo removeServiceInfo ( ServiceReference sr ) { } IServiceInfo getServiceInfo ( ServiceReference sr ) { } public Object addingService ( ServiceReference reference ) { } private void addServicePublication ( ServiceReference reference , ServicePublication servicePublication ) { } private ServiceInfo createServiceInfo ( ServiceReference serviceReference , Collection svcInterfaces , Collection interfaceVersions , Collection endpointInterfaces , Map svcProperties , URL location , String id ) { } private IServiceProperties createServiceProperties ( Collection svcInterfaces , Collection interfaceVersions , Collection endpointInterfaces , Map svcProperties , URL location , String id ) { } private URI createURI ( URL location ) { String locationStr = null ; try { locationStr = ( location == null ) ? "" : URLEncoder . encode ( location . toExternalForm ( ) , "UTF-8" ) ; } catch ( UnsupportedEncodingException e ) { } <START_BUG> return URI . create ( ( ( ( ServiceConstants . PROTOCOL ) + ( ServiceConstants . PROTOCOL_SEPARATOR ) ) + locationStr ) ) ; <END_BUG> } private void traceException ( String string , Throwable e ) { } private IServiceID createServiceID ( ServiceReference serviceReference ) { } private IServiceTypeID getDiscoveryType ( ) { } private void publishService ( ServiceReference reference , IServiceInfo svcInfo ) { } public void modifiedService ( ServiceReference reference , Object service ) { } public void removedService ( ServiceReference reference , Object service ) { } private void unpublishService ( ServiceReference reference ) { } protected void trace ( String methodName , String message ) { } public void dispose ( ) { } }

Fix:
return URI . create ( ( ( ( ServiceConstants . PROTOCOL ) + ( ServicePropertyUtils . PROTOCOL_SEPARATOR ) ) + locationStr ) ) ;
Buggy code:
public abstract class Continuus extends Task { private static final String CCM_EXE = "ccm" ; public static final String COMMAND_CREATE_TASK = "create_task" ; public static final String COMMAND_CHECKOUT = "co" ; public static final String COMMAND_CHECKIN = "ci" ; public static final String COMMAND_RECONFIGURE = "reconfigure" ; public static final String COMMAND_DEFAULT_TASK = "default_task" ; private String _ccmDir = "" ; private String _ccmAction = "" ; public final void setCcmDir ( String dir ) { } public void setCcmAction ( String v ) { } public String getCcmAction ( ) { } protected final String getCcmCommand ( ) { } protected int run ( Commandline cmd , ExecuteStreamHandler handler ) { try { Execute exe = new Execute ( handler ) ; exe . setAntRun ( getProject ( ) ) ; exe . setWorkingDirectory ( getProject ( ) . getBaseDir ( ) ) ; exe . setCommandline ( cmd . getCommandline ( ) ) ; return exe . execute ( ) ; } catch ( IOException e ) { <START_BUG> throw new BuildException ( e ) ; <END_BUG> } } protected int run ( Commandline cmd ) { } }

Fix:
throw new BuildException ( "Error" , e ) ;
Buggy code:
public class TypeDeclarationStatement extends Statement { private TypeDeclaration typeDecl = null ; TypeDeclarationStatement ( AST ast ) { } public int getNodeType ( ) { } ASTNode clone ( AST target ) { TypeDeclarationStatement result = new TypeDeclarationStatement ( target ) ; result . setSourceRange ( this . getStartPosition ( ) , this . getLength ( ) ) ; <START_BUG> result . setLeadingComment ( getLeadingComment ( ) ) ; <END_BUG> result . setTypeDeclaration ( ( ( TypeDeclaration ) ( getTypeDeclaration ( ) . clone ( target ) ) ) ) ; return result ; } public boolean subtreeMatch ( ASTMatcher matcher , Object other ) { } void accept0 ( ASTVisitor visitor ) { } public TypeDeclaration getTypeDeclaration ( ) { } public void setTypeDeclaration ( TypeDeclaration decl ) { } public ITypeBinding resolveBinding ( ) { } int memSize ( ) { } int treeSize ( ) { } }

Fix:
result . copyLeadingComment ( this ) ;
Buggy code:
public class Routes { private static SignInResponse respond ( SignInRequest r ) { } private static CentralBoardResponse respond ( CentralBoardRequest r ) { } private static SignUpResponse respond ( SignUpRequest r ) { <START_BUG> return new SignUpResponse ( ) ; <END_BUG> } private static PostResponse respond ( PostRequest r ) { } public static Response processRequest ( Request r ) { } }

Fix:
return new SignUpResponse ( null , null ) ;
Buggy code:
public class TextureUnpacker { private static final String DEFAULT_OUTPUT_PATH = "output" ; private static final int NINEPATCH_PADDING = 1 ; private static final String OUTPUT_TYPE = "png" ; private static final String HELP = "Usage:<seq2seq4repair_space>atlasFile<seq2seq4repair_space>[imageDir]<seq2seq4repair_space>[outputDir]" ; private static final String ATLAS_FILE_EXTENSION = ".atlas" ; private int parseArguments ( String [ ] args ) { } private boolean checkDirectoryValidity ( String directory ) { } public void splitAtlas ( TextureAtlasData atlas , String outputDir ) { } private BufferedImage extractImage ( BufferedImage page , Region region , File outputDirFile , int padding ) { BufferedImage splitImage = null ; if ( region . rotate ) { BufferedImage srcImage = page . getSubimage ( region . left , region . top , region . height , region . width ) ; <START_BUG> splitImage = new BufferedImage ( region . height , region . width , page . getType ( ) ) ; <END_BUG> AffineTransform transform = new AffineTransform ( ) ; transform . rotate ( Math . toRadians ( 90.0 ) ) ; transform . translate ( 0 , ( - ( region . width ) ) ) ; AffineTransformOp op = new AffineTransformOp ( transform , AffineTransformOp . TYPE_BILINEAR ) ; op . filter ( srcImage , splitImage ) ; } else { splitImage = page . getSubimage ( region . left , region . top , region . width , region . height ) ; } if ( padding > 0 ) { BufferedImage paddedImage = new BufferedImage ( ( ( splitImage . getWidth ( ) ) + ( padding * 2 ) ) , ( ( splitImage . getHeight ( ) ) + ( padding * 2 ) ) , page . getType ( ) ) ; Graphics2D g2 = paddedImage . createGraphics ( ) ; g2 . drawImage ( splitImage , padding , padding , null ) ; g2 . dispose ( ) ; return paddedImage ; } else { return splitImage ; } } private BufferedImage extractNinePatch ( BufferedImage page , Region region , File outputDirFile ) { } private void printExceptionAndExit ( Exception e ) { } public static void main ( String [ ] args ) { } }

Fix:
splitImage = new BufferedImage ( region . width , region . height , page . getType ( ) ) ;
Buggy code:
public class SharedMemoryMatchingManagerFactory implements MatchingManagerFactory { private static final int MATCHING_MANAGER_INSTANCE_KEY = 1 ; private static Cache < Integer , SharedMemoryMatchingManager > getInMemoryMatchingCache ( ) { } public MatchingManager getMatchingManager ( OMElement config ) throws EventBrokerConfigurationException { SharedMemoryMatchingManager inMemoryMatchingManager = null ; if ( ( SharedMemoryMatchingManagerFactory . getInMemoryMatchingCache ( ) . get ( SharedMemoryMatchingManagerFactory . MATCHING_MANAGER_INSTANCE_KEY ) ) == null ) { inMemoryMatchingManager = new SharedMemoryMatchingManager ( ) ; SharedMemoryMatchingManagerFactory . getInMemoryMatchingCache ( ) . put ( SharedMemoryMatchingManagerFactory . MATCHING_MANAGER_INSTANCE_KEY , inMemoryMatchingManager ) ; } try { inMemoryMatchingManager . initializeTenant ( ) ; } catch ( EventBrokerException e ) { <START_BUG> throw new EventBrokerConfigurationException ( "Can<seq2seq4repair_space>not<seq2seq4repair_space>initialize<seq2seq4repair_space>the<seq2seq4repair_space>in<seq2seq4repair_space>memory<seq2seq4repair_space>mathing<seq2seq4repair_space>manager" , e ) ; <END_BUG> } return inMemoryMatchingManager ; } }

Fix:
throw new EventBrokerConfigurationException ( "Can<seq2seq4repair_space>not<seq2seq4repair_space>initialize<seq2seq4repair_space>the<seq2seq4repair_space>in<seq2seq4repair_space>memory<seq2seq4repair_space>matching<seq2seq4repair_space>manager" , e ) ;
Buggy code:
public class StatisticalSearchCodeHandler extends HoldingsHandler { private final String TYPE = "Statistical<seq2seq4repair_space>Code" ; @ Override public Boolean isInterested ( String operation ) { } @ Override public void process ( JSONObject requestJsonObject , Exchange exchange ) { } @ Override public void processDataMappings ( JSONObject requestJsonObject , Exchange exchange ) { JSONArray jsonArrayeFromJsonObject = getJSONArrayeFromJsonObject ( requestJsonObject , TYPE ) ; List < String > listFromJSONArray = getListFromJSONArray ( jsonArrayeFromJsonObject . toString ( ) ) ; if ( CollectionUtils . isNotEmpty ( listFromJSONArray ) ) { HoldingsRecord holdingsRecord = ( ( HoldingsRecord ) ( exchange . get ( HOLDINGS_RECORD ) ) ) ; List < HoldingsStatisticalSearchRecord > holdingsStatisticalSearchRecords = holdingsRecord . getHoldingsStatisticalSearchRecords ( ) ; if ( CollectionUtils . isNotEmpty ( holdingsStatisticalSearchRecords ) ) { for ( Iterator < String > iterator = listFromJSONArray . iterator ( ) ; iterator . hasNext ( ) ; ) { String statisticalSearchCode = iterator . next ( ) ; StatisticalSearchRecord statisticalSearchRecord = new StatisticalSearchCodeUtil ( ) . fetchStatisticalSearchRecordByCode ( statisticalSearchCode ) ; for ( Iterator < HoldingsStatisticalSearchRecord > holdingsStatisticalSearchRecordIterator = holdingsStatisticalSearchRecords . iterator ( ) ; holdingsStatisticalSearchRecordIterator . hasNext ( ) ; ) { HoldingsStatisticalSearchRecord holdingsStatisticalSearchRecord = holdingsStatisticalSearchRecordIterator . next ( ) ; holdingsStatisticalSearchRecord . setStatisticalSearchRecord ( statisticalSearchRecord ) ; } } } else { holdingsStatisticalSearchRecords = new ArrayList < HoldingsStatisticalSearchRecord > ( ) ; for ( Iterator < String > iterator = listFromJSONArray . iterator ( ) ; iterator . hasNext ( ) ; ) { String statisticalSearchCode = iterator . next ( ) ; StatisticalSearchRecord statisticalSearchRecord = new StatisticalSearchCodeUtil ( ) . fetchStatisticalSearchRecordByCode ( statisticalSearchCode ) ; <START_BUG> if ( null != statisticalSearchCode ) { <END_BUG> HoldingsStatisticalSearchRecord holdingsStatisticalSearchRecord = new HoldingsStatisticalSearchRecord ( ) ; holdingsStatisticalSearchRecord . setStatisticalSearchId ( statisticalSearchRecord . getStatisticalSearchId ( ) ) ; holdingsStatisticalSearchRecord . setStatisticalSearchRecord ( statisticalSearchRecord ) ; holdingsStatisticalSearchRecord . setHoldingsId ( holdingsRecord . getHoldingsId ( ) ) ; holdingsStatisticalSearchRecord . setHoldingsRecord ( holdingsRecord ) ; holdingsStatisticalSearchRecords . add ( holdingsStatisticalSearchRecord ) ; } } holdingsRecord . setHoldingsStatisticalSearchRecords ( holdingsStatisticalSearchRecords ) ; } exchange . add ( HOLDINGS_RECORD , holdingsRecord ) ; } } }

Fix:
if ( null != statisticalSearchRecord ) {
Buggy code:
public class StaticPartitionConnections { Map < Integer , SimpleConsumer > _kafka = new HashMap < Integer , SimpleConsumer > ( ) ; KafkaConfig _config ; StaticHosts hosts ; public StaticPartitionConnections ( KafkaConfig conf ) { } public SimpleConsumer getConsumer ( int partition ) { int hostIndex = partition // ( hosts . partitionsPerHost ) ; if ( ! ( _kafka . containsKey ( hostIndex ) ) ) { HostPort hp = hosts . hosts . get ( hostIndex ) ; <START_BUG> _kafka . put ( hostIndex , new SimpleConsumer ( hp . host , hp . port , _config . socketTimeoutMs , _config . bufferSizeBytes ) ) ; <END_BUG> } return _kafka . get ( hostIndex ) ; } public int getHostPartition ( int globalPartition ) { } public int getNumberOfHosts ( ) { } public void close ( ) { } }

Fix:
_kafka . put ( hostIndex , new SimpleConsumer ( hp . host , hp . port , _config . socketTimeoutMs , _config . bufferSizeBytes , OffsetRequest . DefaultClientId ( ) ) ) ;
Buggy code:
public class TestSuite implements Serializable { private static final long serialVersionUID = 1 ; public final String id = new SimpleDateFormat ( "yyyy-MM-dd__HH_mm_ss" ) . format ( new Date ( ) ) ; public final List < TestCase > testCaseList = new LinkedList < TestCase > ( ) ; public Set < Failure . Type > tolerableFailures = Collections . emptySet ( ) ; public int duration ; public boolean failFast ; public TestCase getTestCase ( String testCaseId ) { } public void addTest ( TestCase testCase ) { } public int size ( ) { } @ Override public String toString ( ) { } public static TestSuite loadTestSuite ( File testPropertiesFile , String propertiesOverrideString ) { } private static Properties loadProperties ( File file ) { } private static Map < String , TestCase > createTestCases ( Properties properties ) { Map < String , TestCase > testCases = new HashMap < String , TestCase > ( ) ; for ( String property : properties . stringPropertyNames ( ) ) { String value = ( ( String ) ( properties . get ( property ) ) ) ; <START_BUG> int indexOfAt = property . indexOf ( "@" ) ; <END_BUG> String testCaseId = "" ; String field = property ; if ( indexOfAt > ( - 1 ) ) { testCaseId = property . substring ( 0 , indexOfAt ) ; field = property . substring ( ( indexOfAt + 1 ) ) ; } TestCase testCase = TestSuite . getOrCreateTestCase ( testCases , testCaseId ) ; testCase . setProperty ( field , value ) ; } return testCases ; } private static TestCase getOrCreateTestCase ( Map < String , TestCase > testCases , String testCaseId ) { } private static TestSuite createTestSuite ( File file , Map < String , TestCase > testCases , String propertiesOverrideString ) { } private static Map < String , String > parseProperties ( String overrideProperties ) { } private static List < String > getTestCaseIds ( Map < String , TestCase > testCases ) { } }

Fix:
int indexOfAt = property . indexOf ( '@' ) ;
Buggy code:
class FirstLine extends Anchor { int skew ; FirstLine ( DisplayManager displayManager , JEditTextArea textArea ) { } public void changed ( ) { } public void reset ( ) { if ( Debug . SCROLL_DEBUG ) Log . log ( DEBUG , this , "reset()" ) ; int oldPhysicalLine = physicalLine ; physicalLine = 0 ; scrollLine = 0 ; int i = displayManager . getFirstVisibleLine ( ) ; for ( ; ; ) { if ( i >= oldPhysicalLine ) break ; int before = scrollLine ; displayManager . updateScreenLineCount ( i ) ; if ( before != ( scrollLine ) ) throw new RuntimeException ( ( ( this ) + "<seq2seq4repair_space>nudged" ) ) ; scrollLine += displayManager . getScreenLineCount ( i ) ; int nextLine = displayManager . getNextVisibleLine ( i ) ; if ( nextLine == ( - 1 ) ) break ; else i = nextLine ; } physicalLine = i ; displayManager . updateScreenLineCount ( i ) ; int screenLines = displayManager . getScreenLineCount ( physicalLine ) ; if ( ( skew ) >= screenLines ) skew = screenLines - 1 ; <START_BUG> textArea . updateScrollBars ( ) ; <END_BUG> } void physDown ( int amount , int screenAmount ) { } void physUp ( int amount , int screenAmount ) { } void scrollDown ( int amount ) { } void scrollUp ( int amount ) { } void ensurePhysicalLineIsVisible ( ) { } }

Fix:
textArea . updateScrollBar ( ) ;
Buggy code:
class WebDeploymentService implements Service < Context > { private static final Logger log = Logger . getLogger ( "org.jboss.web.deployment" ) ; private final StandardContext context ; public WebDeploymentService ( final StandardContext context ) { } public synchronized void start ( StartContext startContext ) throws StartException { final long time = System . currentTimeMillis ( ) ; try { context . create ( ) ; } catch ( Exception e ) { throw new StartException ( "failed<seq2seq4repair_space>to<seq2seq4repair_space>create<seq2seq4repair_space>context" , e ) ; } try { context . start ( ) ; } catch ( LifecycleException e ) { throw new StartException ( "failed<seq2seq4repair_space>to<seq2seq4repair_space>start<seq2seq4repair_space>context" , e ) ; } <START_BUG> Logger . getLogger ( "org.jboss.web" ) . info ( ( "starting<seq2seq4repair_space>context<seq2seq4repair_space>" + ( ( System . currentTimeMillis ( ) ) - time ) ) ) ; <END_BUG> } public synchronized void stop ( StopContext stopContext ) { } public synchronized Context getValue ( ) throws IllegalStateException { } }

Fix:
Logger . getLogger ( "org.jboss.web" ) . info ( ( ( ( "starting<seq2seq4repair_space>context<seq2seq4repair_space>" + ( context . getName ( ) ) ) + ":<seq2seq4repair_space>" ) + ( ( System . currentTimeMillis ( ) ) - time ) ) ) ;
Buggy code:
public abstract class Expression extends ASTNode { Expression ( AST ast ) { } public ITypeBinding resolveTypeBinding ( ) { <START_BUG> return getAST ( ) . getBindingResolver ( ) . resolveExpressionType ( this ) ; <END_BUG> } }

Fix:
return this . ast . getBindingResolver ( ) . resolveExpressionType ( this ) ;
Buggy code:
@ RunWith ( Arquillian . class ) public class SFSBMandatoryTransactionTestCase { @ Inject private UserTransaction userTransaction ; @ Inject private MandatorySFSB sfsb ; @ Deployment public static Archive < ? > deploy ( ) { } @ Test public void testSFSBNotDestroyed ( ) throws NotSupportedException , SystemException { try { sfsb . doStuff ( ) ; <START_BUG> throw new RuntimeException ( "Expected<seq2seq4repair_space>a<seq2seq4repair_space>EJBTransactionRequiredException" ) ; <END_BUG> } catch ( EJBTransactionRequiredException e ) { } userTransaction . begin ( ) ; sfsb . doStuff ( ) ; userTransaction . rollback ( ) ; } }

Fix:
throw new RuntimeException ( "Expected<seq2seq4repair_space>an<seq2seq4repair_space>EJBTransactionRequiredException" ) ;
Buggy code:
public class JSFDependencyProcessor implements DeploymentUnitProcessor { private static final ModuleIdentifier JSF_SUBSYSTEM = ModuleIdentifier . create ( "org.jboss.as.jsf" ) ; private static final ModuleIdentifier BEAN_VALIDATION = ModuleIdentifier . create ( "org.hibernate.validator" ) ; private static final ModuleIdentifier JSTL = ModuleIdentifier . create ( "javax.servlet.jstl.api" ) ; private JSFModuleIdFactory moduleIdFactory = JSFModuleIdFactory . getInstance ( ) ; @ Override public void deploy ( DeploymentPhaseContext phaseContext ) throws DeploymentUnitProcessingException { final DeploymentUnit deploymentUnit = phaseContext . getDeploymentUnit ( ) ; if ( ! ( DeploymentTypeMarker . isType ( WAR , deploymentUnit ) ) ) { return ; } if ( JsfVersionMarker . getVersion ( deploymentUnit ) . equals ( WAR_BUNDLES_JSF_IMPL ) ) { return ; } final DeploymentUnit topLevelDeployment = ( ( deploymentUnit . getParent ( ) ) == null ) ? deploymentUnit : deploymentUnit . getParent ( ) ; final ModuleSpecification moduleSpecification = deploymentUnit . getAttachment ( MODULE_SPECIFICATION ) ; final ModuleLoader moduleLoader = Module . getBootModuleLoader ( ) ; String jsfVersion = JsfVersionMarker . getVersion ( topLevelDeployment ) ; if ( ! ( moduleIdFactory . isValidJSFSlot ( jsfVersion ) ) ) { ROOT_LOGGER . unknownJSFVersion ( jsfVersion ) ; <START_BUG> jsfVersion = JSFModuleIdFactory . DEFAULT_SLOT ; <END_BUG> } addJSFAPI ( jsfVersion , moduleSpecification , moduleLoader ) ; addJSFImpl ( jsfVersion , moduleSpecification , moduleLoader ) ; moduleSpecification . addSystemDependency ( new org . jboss . as . server . deployment . module . ModuleDependency ( moduleLoader , JSFDependencyProcessor . JSTL , false , false , false , false ) ) ; moduleSpecification . addSystemDependency ( new org . jboss . as . server . deployment . module . ModuleDependency ( moduleLoader , JSFDependencyProcessor . BEAN_VALIDATION , false , false , true , false ) ) ; moduleSpecification . addSystemDependency ( new org . jboss . as . server . deployment . module . ModuleDependency ( moduleLoader , JSFDependencyProcessor . JSF_SUBSYSTEM , false , false , true , false ) ) ; addJSFInjection ( jsfVersion , moduleSpecification , moduleLoader ) ; } @ Override public void undeploy ( DeploymentUnit context ) { } private void addJSFAPI ( String jsfVersion , ModuleSpecification moduleSpecification , ModuleLoader moduleLoader ) { } private void addJSFImpl ( String jsfVersion , ModuleSpecification moduleSpecification , ModuleLoader moduleLoader ) { } private void addJSFInjection ( String jsfVersion , ModuleSpecification moduleSpecification , ModuleLoader moduleLoader ) { } }

Fix:
jsfVersion = JSFModuleIdFactory . getInstance ( ) . getDefaultSlot ( ) ;
Buggy code:
public class JSON { public Hashtable < String , String > songinfo = new Hashtable < String , String > ( ) ; private String URL ; private String HOSTNAME ; private Context f_context ; DefaultHttpClient httpClient ; CookieStore cookieStore ; HttpContext httpContext ; private String ret ; HttpResponse response = null ; HttpPost httpPost = null ; HttpGet httpGet = null ; public JSON ( Context context ) { } public boolean setNotification ( String tickerString , String notificationTitle , String noticicationText , Context context ) { } public void clearNotifications ( Context context ) { } public String getArtest ( ) { } public String getAlbum ( ) { } public String getSongName ( ) { } public String getTimeElapised ( ) { } public String getSongLength ( ) { } public int getIsPlaying ( ) { } public Boolean UpdateSongInfo ( ) { } public String getHostNames ( ) { } public String getRootPath ( ) { } public JSONArray getCommands ( String host ) throws JSONException { } public void authenticate ( ) { } public void deauthenticate ( ) { <START_BUG> String return_value = JSONSendCmd ( "deauthenticate" , null ) ; <END_BUG> Log . d ( LOG_TAG , ( "Deauthenticate<seq2seq4repair_space>Return<seq2seq4repair_space>Value<seq2seq4repair_space>" + return_value ) ) ; } public String JSONSendCmd ( String methodName , Map < String , String > params ) { } public String JSONSendCmd ( String methodName ) { } private void process_cookies ( ) { } protected void updateSettings ( ) { } private Boolean getSongInfo ( ) { } }

Fix:
String return_value = JSONSendCmd ( "deauthenticate" ) ;
Buggy code:
public class ManagedContainerConfiguration extends CommonContainerConfiguration { private String jbossHome = System . getenv ( "JBOSS_HOME" ) ; private String javaHome = System . getenv ( "JAVA_HOME" ) ; private String javaVmArguments = "-Xmx512m<seq2seq4repair_space>-XX:MaxPermSize=128m" ; private int startupTimeoutInSeconds = 30 ; private boolean outputToConsole = true ; @ Override public void validate ( ) throws ConfigurationException { super . validate ( ) ; <START_BUG> Validate . configurationDirectoryExists ( jbossHome , "jbossHome<seq2seq4repair_space>must<seq2seq4repair_space>exist" ) ; <END_BUG> if ( ( javaHome ) != null ) { Validate . configurationDirectoryExists ( javaHome , "javaHome<seq2seq4repair_space>must<seq2seq4repair_space>exist" ) ; } } public String getJbossHome ( ) { } public void setJbossHome ( String jbossHome ) { } public String getJavaHome ( ) { } public void setJavaHome ( String javaHome ) { } public String getJavaVmArguments ( ) { } public void setJavaVmArguments ( String javaVmArguments ) { } public void setStartupTimeoutInSeconds ( int startupTimeoutInSeconds ) { } public int getStartupTimeoutInSeconds ( ) { } public void setOutputToConsole ( boolean outputToConsole ) { } public boolean isOutputToConsole ( ) { } }

Fix:
Validate . configurationDirectoryExists ( jbossHome , ( ( "jbossHome<seq2seq4repair_space>'" + ( jbossHome ) ) + "'<seq2seq4repair_space>must<seq2seq4repair_space>exist" ) ) ;
Buggy code:
public class SaveMessageCommand extends FolderCommand { private MessageFolder folder ; public SaveMessageCommand ( DefaultCommandReference [ ] references ) { } public void updateGUI ( ) throws Exception { } public void execute ( WorkerStatusController worker ) throws Exception { ComposerCommandReference [ ] r = ( ( ComposerCommandReference [ ] ) ( getReferences ( ) ) ) ; ComposerController composerController = r [ 0 ] . getComposerController ( ) ; AccountItem item = ( ( ComposerModel ) ( composerController . getModel ( ) ) ) . getAccountItem ( ) ; SendableMessage message = ( ( SendableMessage ) ( r [ 0 ] . getMessage ( ) ) ) ; if ( message == null ) { message = new MessageComposer ( ( ( ComposerModel ) ( composerController . getModel ( ) ) ) ) . compose ( worker ) ; } folder = ( ( MessageFolder ) ( r [ 0 ] . getFolder ( ) ) ) ; InputStream sourceStream = message . getSourceStream ( ) ; <START_BUG> folder . addMessage ( sourceStream , message . getHeader ( ) . getAttributes ( ) ) ; <END_BUG> sourceStream . close ( ) ; } }

Fix:
folder . addMessage ( sourceStream , message . getHeader ( ) . getAttributes ( ) , message . getFlags ( ) ) ;
Buggy code:
public class ReportTreeListener implements KeyListener , MouseListener , MouseMotionListener , TreeSelectionListener { private static final Logger log = LoggingManager . getLoggerForClass ( ) ; private TreePath currentPath ; private ActionListener actionHandler ; private ReportTreeModel model ; private JTree tree ; private boolean dragging = false ; private ReportTreeNode [ ] draggedNodes ; private JLabel dragIcon = new JLabel ( JMeterUtils . getImage ( "leafnode.gif" ) ) ; public ReportTreeListener ( ReportTreeModel model ) { } public ReportTreeListener ( ) { } public void setModel ( ReportTreeModel m ) { } public void setActionHandler ( ActionListener ah ) { } public void setJTree ( JTree tree ) { } public void setEndWindow ( Container window ) { } public JTree getJTree ( ) { } public ReportTreeNode getCurrentNode ( ) { } public ReportTreeNode [ ] getSelectedNodes ( ) { } public TreePath removedSelectedNode ( ) { } public void valueChanged ( TreeSelectionEvent e ) { } public void mouseClicked ( MouseEvent ev ) { } public void mouseReleased ( MouseEvent e ) { } public ReportTreeNode [ ] getDraggedNodes ( ) { } private boolean isValidDragAction ( ReportTreeNode [ ] source , ReportTreeNode dest ) { } public void mouseEntered ( MouseEvent e ) { } private void changeSelectionIfDragging ( MouseEvent e ) { } private boolean contains ( Object [ ] container , Object item ) { } public void mousePressed ( MouseEvent e ) { } public void mouseDragged ( MouseEvent e ) { } public void mouseMoved ( MouseEvent e ) { } public void mouseExited ( MouseEvent ev ) { } public void keyPressed ( KeyEvent e ) { } public void keyReleased ( KeyEvent e ) { } public void keyTyped ( KeyEvent e ) { } private boolean isRightClick ( MouseEvent e ) { <START_BUG> return ( ( ( MouseEvent . BUTTON2_MASK ) & ( e . getModifiers ( ) ) ) > 0 ) || ( ( MouseEvent . BUTTON3_MASK ) == ( e . getModifiers ( ) ) ) ; <END_BUG> } private void displayPopUp ( MouseEvent e ) { } private void displayPopUp ( MouseEvent e , JPopupMenu popup ) { } }

Fix:
return ( ( e . isPopupTrigger ( ) ) || ( ( ( MouseEvent . BUTTON2_MASK ) & ( e . getModifiers ( ) ) ) > 0 ) ) || ( ( MouseEvent . BUTTON3_MASK ) == ( e . getModifiers ( ) ) ) ;
Buggy code:
public class Test_org_eclipse_swt_widgets_MessageBox extends Test_org_eclipse_swt_widgets_Dialog { public Test_org_eclipse_swt_widgets_MessageBox ( String name ) { } public static void main ( String [ ] args ) { } protected void setUp ( ) { } protected void tearDown ( ) { } public void test_ConstructorLorg_eclipse_swt_widgets_Shell ( ) { <START_BUG> MessageBox mb = new MessageBox ( shell ) ; <END_BUG> try { new MessageBox ( null ) ; fail ( "No<seq2seq4repair_space>exception<seq2seq4repair_space>thrown<seq2seq4repair_space>for<seq2seq4repair_space>parent<seq2seq4repair_space>==<seq2seq4repair_space>null" ) ; } catch ( IllegalArgumentException e ) { } } public void test_ConstructorLorg_eclipse_swt_widgets_ShellI ( ) { } public void test_getMessage ( ) { } public void test_open ( ) { } public void test_setMessageLjava_lang_String ( ) { } public static Test suite ( ) { } public static Vector methodNames ( ) { } protected void runTest ( ) throws Throwable { } MessageBox messageBox ; }

Fix:
new MessageBox ( shell ) ;
Buggy code:
public class PublishingContext implements Cloneable { protected User publisher = null ; protected Date startDate = null ; protected Date endDate = null ; public PublishingContext ( ) { } public PublishingContext ( User publisher ) { } public PublishingContext ( User publisher , Date startDate , Date endDate ) { } private Date cutOffMillis ( Date date ) { } public void setPublished ( User publisher , Date startDate , Date endDate ) throws IllegalStateException { } public void setPublisher ( User user ) { } public User getPublisher ( ) { } public void setPublishFrom ( Date startDate ) { } public Date getPublishFrom ( ) { } public void setPublishTo ( Date endDate ) { } public Date getPublishTo ( ) { } public boolean isPublished ( ) { } public boolean isPublished ( Date date ) { } public Object clone ( ) throws CloneNotSupportedException { } public static PublishingContext fromXml ( Node context ) throws IllegalStateException { } public static PublishingContext fromXml ( Node context , XPath xpathProcessor ) throws IllegalStateException { } public String toXml ( ) { <START_BUG> if ( ( ( publisher ) == null ) || ( ( startDate ) == null ) ) <END_BUG> return "" ; StringBuffer b = new StringBuffer ( ) ; b . append ( "<published>" ) ; if ( ( publisher ) != null ) { b . append ( "<user" ) ; b . append ( "<seq2seq4repair_space>id=\"" ) ; b . append ( publisher . getLogin ( ) ) ; b . append ( "\"" ) ; if ( ( publisher . getRealm ( ) ) != null ) { b . append ( "<seq2seq4repair_space>realm=\"" ) ; b . append ( publisher . getRealm ( ) ) ; b . append ( "\"" ) ; } b . append ( ">" ) ; if ( ( publisher . getName ( ) ) != null ) { b . append ( "<![CDATA[" ) . append ( publisher . getName ( ) ) . append ( "]]>" ) ; } b . append ( "<//user>" ) ; } if ( ( startDate ) != null ) { b . append ( "<from>" ) ; b . append ( WebloungeDateFormat . formatStatic ( startDate ) ) ; b . append ( "<//from>" ) ; } if ( ( endDate ) != null ) { b . append ( "<to>" ) ; b . append ( WebloungeDateFormat . formatStatic ( endDate ) ) ; b . append ( "<//to>" ) ; } b . append ( "<//published>" ) ; return b . toString ( ) ; } No newline ; at end ; of file ; }

Fix:
if ( ( startDate ) == null )
Buggy code:
public class DictionaryController extends Controller { public void create ( ) { } public void modify ( ) { } @ Before ( DictionaryKindFormValidator . class ) public void save ( ) { } public void view ( ) { } @ Before ( Tx . class ) public void delete ( ) { } public void list ( ) { } public void add ( ) { } @ Before ( DictionaryFormValidator . class ) public void saveDict ( ) { } public void remove ( ) { } public void all ( ) { int kindId = getParaToInt ( 0 ) ; <START_BUG> int pageNumber = getParaToInt ( 1 , 1 ) ; <END_BUG> int pageSize = getParaToInt ( "pagesize" , 10 ) ; setAttr ( "kindid" , kindId ) ; setAttr ( "page" , dao . paginate ( pageNumber , pageSize , "select<seq2seq4repair_space>*" , "<seq2seq4repair_space>from<seq2seq4repair_space>dictionary<seq2seq4repair_space>where<seq2seq4repair_space>kind=?" , DictionaryKind . dao . findById ( kindId ) . get ( "kind" ) ) ) ; render ( "all.html" ) ; } }

Fix:
int pageNumber = getParaToInt ( "page" , 1 ) ;
Buggy code:
public class CallOfBeerActivity extends FragmentActivity implements AuthenticationFragment . OnAuthenticationFragmentInteractionListener { public static FragmentManager fragmentManager ; private SlidingUpPanelLayout mSlidingLayout ; private CobFloatingMenu menu ; @ Override protected void onCreate ( Bundle savedInstanceState ) { } private class SlidingUpPanelView implements SlidingUpPanelLayout . PanelSlideListener { @ Override public void onPanelSlide ( View view , float v ) { } @ Override public void onPanelCollapsed ( View view ) { } @ Override public void onPanelExpanded ( View view ) { } @ Override public void onPanelAnchored ( View view ) { } @ Override public void onPanelHidden ( View view ) { } } public void forcedSlidingUp ( ) { } @ Override public void onNewIntent ( Intent intent ) { Uri uri = intent . getData ( ) ; <START_BUG> if ( ( uri . getEncodedSchemeSpecificPart ( ) . equals ( "////auth" ) ) && ( ( getFragmentManager ( ) . findFragmentById ( main_container ) ) instanceof AuthenticationFragment ) ) { <END_BUG> ( ( AuthenticationFragment ) ( getFragmentManager ( ) . findFragmentById ( main_container ) ) ) . newCobIntent ( intent ) ; } super . onNewIntent ( intent ) ; } @ Override public void onUserLogged ( ) { } @ Override public void onUserLoggingFailed ( ) { } public Authentication getUserAuth ( ) { } }

Fix:
if ( ( ( uri != null ) && ( uri . getEncodedSchemeSpecificPart ( ) . equals ( "////auth" ) ) ) && ( ( getFragmentManager ( ) . findFragmentById ( main_container ) ) instanceof AuthenticationFragment ) ) {
Buggy code:
public class PlayerTarget extends PerPlayer { private static final float CROSS_RADIUS = 0.1F ; @ Override public void draw ( final GL2 gl , final RobotState player , final Camera camera ) { final SPLStandardMessage msg = player . getLastMessage ( ) ; <START_BUG> if ( ( msg != null ) && ( ( player . getPenalty ( ) ) == ( PlayerInfo . PENALTY_NONE ) ) ) { <END_BUG> final float poseX = ( msg . pose [ 0 ] ) // 1000.0F ; final float poseY = ( msg . pose [ 1 ] ) // 1000.0F ; final float walkingToX = ( msg . walkingTo [ 0 ] ) // 1000.0F ; final float walkingToY = ( msg . walkingTo [ 1 ] ) // 1000.0F ; gl . glColor3f ( 0 , 0 , 0 ) ; gl . glNormal3f ( 0 , 0 , 1 ) ; gl . glBegin ( GL_LINES ) ; gl . glVertex3f ( poseX , poseY , 0 ) ; gl . glVertex3f ( walkingToX , walkingToY , 0 ) ; gl . glEnd ( ) ; gl . glTranslatef ( walkingToX , walkingToY , 0 ) ; gl . glBegin ( GL_LINES ) ; gl . glVertex3f ( ( - ( PlayerTarget . CROSS_RADIUS ) ) , ( - ( PlayerTarget . CROSS_RADIUS ) ) , 0 ) ; gl . glVertex3f ( PlayerTarget . CROSS_RADIUS , PlayerTarget . CROSS_RADIUS , 0 ) ; gl . glEnd ( ) ; gl . glBegin ( GL_LINES ) ; gl . glVertex3f ( ( - ( PlayerTarget . CROSS_RADIUS ) ) , PlayerTarget . CROSS_RADIUS , 0 ) ; gl . glVertex3f ( PlayerTarget . CROSS_RADIUS , ( - ( PlayerTarget . CROSS_RADIUS ) ) , 0 ) ; gl . glEnd ( ) ; gl . glTranslatef ( ( - walkingToX ) , ( - walkingToY ) , 0 ) ; } } @ Override public boolean hasAlpha ( ) { } @ Override public int getPriority ( ) { } }

Fix:
if ( ( ( ( msg != null ) && ( msg . poseValid ) ) && ( msg . walkingToValid ) ) && ( ( player . getPenalty ( ) ) == ( PlayerInfo . PENALTY_NONE ) ) ) {
Buggy code:
public class LocalizedFormatsTest { @ Test public void testMessageNumber ( ) { <START_BUG> Assert . assertEquals ( 318 , LocalizedFormats . values ( ) . length ) ; <END_BUG> } @ Test public void testAllKeysPresentInPropertiesFiles ( ) { } @ Test public void testAllPropertiesCorrespondToKeys ( ) { } @ Test public void testNoMissingFrenchTranslation ( ) { } @ Test public void testNoOpEnglishTranslation ( ) { } @ Test public void testVariablePartsConsistency ( ) { } }

Fix:
Assert . assertEquals ( 319 , LocalizedFormats . values ( ) . length ) ;
Buggy code:
public class MutableInt extends Number implements Comparable < MutableInt > , Mutable < Number > { private static final long serialVersionUID = 512176391864L ; private int value ; public MutableInt ( ) { } public MutableInt ( final int value ) { } public MutableInt ( final Number value ) { } public MutableInt ( final String value ) throws NumberFormatException { } @ Override public Integer getValue ( ) { } public void setValue ( final int value ) { } @ Override public void setValue ( final Number value ) { } public void increment ( ) { } public void decrement ( ) { } public void add ( final int operand ) { } public void add ( final Number operand ) { } public void subtract ( final int operand ) { } public void subtract ( final Number operand ) { } @ Override public int intValue ( ) { } @ Override public long longValue ( ) { } @ Override public float floatValue ( ) { } @ Override public double doubleValue ( ) { } public Integer toInteger ( ) { } @ Override public boolean equals ( final Object obj ) { } @ Override public int hashCode ( ) { } @ Override public int compareTo ( final MutableInt other ) { <START_BUG> int anotherVal = other . value ; <END_BUG> return ( value ) < anotherVal ? - 1 : ( value ) == anotherVal ? 0 : 1 ; } @ Override public String toString ( ) { } }

Fix:
final int anotherVal = other . value ;
Buggy code:
public class Server extends Communicator { private boolean isRunning = true ; private ArrayList < Socket > connections = new ArrayList < Socket > ( ) ; private Socket connectedPlayer ; private InetSocketAddress testAddress ; GamePanel gPanel ; public Server ( GamePanel gPanel ) { } @ Override public void sendMessage ( String message ) { } @ Override public void run ( ) { ServerSocket welcomeSocket = null ; try { welcomeSocket = new ServerSocket ( 9001 ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; isRunning = false ; } while ( isRunning ) { try { Socket connectionSocket = null ; connectionSocket = welcomeSocket . accept ( ) ; connections . add ( connectionSocket ) ; <START_BUG> ClientHandler clientHandler = new ClientHandler ( this , connectionSocket ) ; <END_BUG> Thread clientThread = new Thread ( clientHandler ) ; clientThread . start ( ) ; } catch ( Exception e ) { e . printStackTrace ( ) ; } } } private Socket getSocket ( ) throws Exception { } public void loadCharacter ( String charName , int x , int y ) { } public void moveCharacter ( String charName , int x , int y ) { } }

Fix:
ClientHandler clientHandler = new ClientHandler ( this , gPanel , connectionSocket ) ;
Buggy code:
public class Fruit { public String name ; public Color color ; public String colorName ; public int stringscount = - 1 ; public Fruit ( String name , Color color , String colorName ) { } public Color getColor ( ) { } public Fruit ( String ... strings ) { } public Fruit ( int i , String ... strings ) { } public int stringscount ( ) { } public String toString ( ) { <START_BUG> return ( ( ( "A" + ( colorName . startsWith ( "o" ) ? "n<seq2seq4repair_space>" : "<seq2seq4repair_space>" ) ) + ( colorName ) ) + "<seq2seq4repair_space>" ) + ( name ) ; <END_BUG> } }

Fix:
return ( ( ( "A" + ( ( ( colorName ) != null ) && ( colorName . startsWith ( "o" ) ) ? "n<seq2seq4repair_space>" : "<seq2seq4repair_space>" ) ) + ( colorName ) ) + "<seq2seq4repair_space>" ) + ( name ) ;