nus-yam/ex-repair huggingface dataset:
Buggy code:
public class OWLAPIUtil { public static void writeTurtle ( OutputStream os , Set < RDFTriple > s ) throws IOException { } public static Set < RDFTriple > readTurtle ( InputStream is ) throws ParseException { Set < RDFTriple > s = new HashSet < RDFTriple > ( ) ; <START_BUG> TurtleParser tp = new TurtleParser ( is , new OWLAPIUtil . RDFConsAdapter ( s ) , IRI . create ( "" ) ) ; <END_BUG> tp . parseDocument ( ) ; return s ; } public static Set < RDFTriple > readRDFXML ( InputSource is ) throws IOException , SAXException { } private static class RDFConsAdapter implements RDFConsumer , TripleHandler { Set < RDFTriple > read ; RDFConsAdapter ( Set < RDFTriple > s ) { } @ Override public void addModelAttribte ( String key , String value ) throws SAXException { } @ Override public void endModel ( ) throws SAXException { } @ Override public void includeModel ( String logicalURI , String physicalURI ) throws SAXException { } @ Override public void logicalURI ( String logicalURI ) throws SAXException { } @ Override public void startModel ( String physicalURI ) throws SAXException { } @ Override public void statementWithLiteralValue ( String subject , String predicate , String object , String language , String datatype ) throws SAXException { } @ Override public void statementWithResourceValue ( String subject , String predicate , String object ) throws SAXException { } @ Override public void handleBaseDirective ( String base ) { } @ Override public void handleComment ( String comment ) { } @ Override public void handleEnd ( ) { } @ Override public void handlePrefixDirective ( String prefixName , String prefix ) { } @ Override public void handleTriple ( IRI subject , IRI predicate , IRI object ) { } @ Override public void handleTriple ( IRI subject , IRI predicate , String object ) { } @ Override public void handleTriple ( IRI subject , IRI predicate , String object , String lang ) { } @ Override public void handleTriple ( IRI subject , IRI predicate , String object , IRI datatype ) { } } }

Fix:
TurtleParser tp = new TurtleParser ( is , new OWLAPIUtil . RDFConsAdapter ( s ) , IRI . create ( "" ) . toString ( ) ) ;
Buggy code:
public class TermsQueryBuilder implements QueryBuilder { private final Analyzer analyzer ; public TermsQueryBuilder ( Analyzer analyzer ) { } public Query getQuery ( Element e ) throws ParserException { String fieldName = DOMUtils . getAttributeWithInheritanceOrFail ( e , "fieldName" ) ; String text = DOMUtils . getNonBlankTextOrFail ( e ) ; BooleanQuery bq = new BooleanQuery ( DOMUtils . getAttribute ( e , "disableCoord" , false ) ) ; bq . setMinimumNumberShouldMatch ( DOMUtils . getAttribute ( e , "minimumNumberShouldMatch" , 0 ) ) ; try { TokenStream ts = analyzer . tokenStream ( fieldName , new StringReader ( text ) ) ; TermToBytesRefAttribute termAtt = ts . addAttribute ( TermToBytesRefAttribute . class ) ; Term term = null ; BytesRef bytes = termAtt . getBytesRef ( ) ; ts . reset ( ) ; while ( ts . incrementToken ( ) ) { termAtt . fillBytesRef ( ) ; <START_BUG> term = new Term ( fieldName , new BytesRef ( bytes ) ) ; <END_BUG> bq . add ( new org . apache . lucene . search . BooleanClause ( new org . apache . lucene . search . TermQuery ( term ) , Occur . SHOULD ) ) ; } ts . end ( ) ; ts . close ( ) ; } catch ( IOException ioe ) { throw new RuntimeException ( ( "Error<seq2seq4repair_space>constructing<seq2seq4repair_space>terms<seq2seq4repair_space>from<seq2seq4repair_space>index:" + ioe ) ) ; } bq . setBoost ( DOMUtils . getAttribute ( e , "boost" , 1.0F ) ) ; return bq ; } }

Fix:
term = new Term ( fieldName , BytesRef . deepCopyOf ( bytes ) ) ;
Buggy code:
public class KieModuleDeploymentConfig { private String groupId = null ; private String artifactId = null ; private String version = null ; private ReleaseId releaseId = null ; private String kbaseName = null ; private String ksessionName = null ; List < String > resourceFilePaths = new ArrayList < String > ( ) ; List < Class < ? > > classes = new ArrayList < Class < ? > > ( ) ; List < String > dependencies = new ArrayList < String > ( ) ; private KieModuleModel kproj = null ; String pomText ; public KieModuleDeploymentConfig ( ) { } private final ThreadLocal < KieServices > kieServicesLocal = new ThreadLocal < KieServices > ( ) ; KieServices getKieServicesInstance ( ) { } void setGroupId ( String groupId ) { } void setArtifactId ( String artifactId ) { } void setVersion ( String version ) { } ReleaseId getReleaseId ( ) { } void setKbaseName ( String kbaseName ) { } String getKbaseName ( ) { } void setKsessionName ( String ksessionName ) { } String getKsessionName ( ) { } void checkComplete ( ) { if ( ( ( ( ( groupId ) != null ) && ( ( artifactId ) != null ) ) && ( ( version ) != null ) ) || ( ( releaseId ) != null ) ) { return ; } else if ( ( releaseId ) == null ) { if ( ( groupId ) == null ) { throw new IllegalStateException ( "No<seq2seq4repair_space>groupId<seq2seq4repair_space>has<seq2seq4repair_space>been<seq2seq4repair_space>set<seq2seq4repair_space>yet." ) ; } else if ( ( artifactId ) == null ) { throw new IllegalStateException ( "No<seq2seq4repair_space>artifactId<seq2seq4repair_space>has<seq2seq4repair_space>been<seq2seq4repair_space>set<seq2seq4repair_space>yet." ) ; } else if ( ( version ) == null ) { throw new IllegalStateException ( "No<seq2seq4repair_space>version<seq2seq4repair_space>has<seq2seq4repair_space>been<seq2seq4repair_space>set<seq2seq4repair_space>yet." ) ; } else <START_BUG> if ( ( ( ( groupId ) == ( artifactId ) ) && ( ( artifactId ) == ( version ) ) ) && ( ( version ) == null ) ) { <END_BUG> throw new IllegalStateException ( "None<seq2seq4repair_space>of<seq2seq4repair_space>groupId,<seq2seq4repair_space>artifactId,<seq2seq4repair_space>version<seq2seq4repair_space>or<seq2seq4repair_space>releaseId<seq2seq4repair_space>have<seq2seq4repair_space>been<seq2seq4repair_space>set." ) ; } } } KieModuleModel getKieProject ( ) { } }

Fix:
if ( ( ( groupId . equals ( artifactId ) ) && ( artifactId . equals ( version ) ) ) && ( ( version ) == null ) ) {
Buggy code:
@ Component public class DefaultScheduleConfigurationDAO implements ScheduleConfigurationDAO { @ Resource private ScheduleConfigurationRepository configRepository ; @ Override public List < ScheduleConfigurationModel > getAll ( ) { } @ Override public ScheduleConfigurationModel getConfig ( Long id ) { } @ Override public ScheduleConfigurationModel updateConfig ( ScheduleConfigurationModel model ) { } @ Override public void updateLastRun ( Long configId , DateTime lastRun ) { <START_BUG> ScheduleConfigurationModel model = configRepository . findOne ( configId ) ; <END_BUG> model . lastRun = lastRun . toDate ( ) ; configRepository . save ( model ) ; } }

Fix:
ScheduleConfigurationModel model = getConfig ( configId ) ;
Buggy code:
class OSGiSubsystemDescribeHandler extends GenericSubsystemDescribeHandler { static final OSGiSubsystemDescribeHandler INSTANCE = new OSGiSubsystemDescribeHandler ( ) ; public void execute ( OperationContext context , ModelNode operation ) throws OperationFailedException { super . execute ( context , operation ) ; <START_BUG> context . completeStep ( ) ; <END_BUG> } }

Fix:
context . completeStep ( NOOP_ROLLBACK_HANDLER ) ;
Buggy code:
public final class CheckBox extends FormComponent { private static final long serialVersionUID = 7559827519977114184L ; public CheckBox ( String name , IModel model ) { } public CheckBox ( String name , IModel model , String expression ) { } public CheckBox ( String name , Serializable object ) { } public CheckBox ( String name , Serializable object , String expression ) { } public boolean supportsPersistence ( ) { } public void setValue ( String value ) { } public void updateModel ( ) { } protected void handleComponentTag ( final ComponentTag tag ) { checkTag ( tag , "input" ) ; checkAttribute ( tag , "type" , "checkbox" ) ; super . handleComponentTag ( tag ) ; Object value = getModelObject ( ) ; if ( value != null ) { final boolean tagValue ; if ( value instanceof String ) { <START_BUG> tagValue = Boolean . parseBoolean ( ( ( String ) ( value ) ) ) ; <END_BUG> } else if ( value instanceof Boolean ) { tagValue = ( ( Boolean ) ( value ) ) . booleanValue ( ) ; } else { throw new WicketRuntimeException ( "Model<seq2seq4repair_space>objects<seq2seq4repair_space>for<seq2seq4repair_space>checkboxes<seq2seq4repair_space>have<seq2seq4repair_space>to<seq2seq4repair_space>be<seq2seq4repair_space>of<seq2seq4repair_space>type<seq2seq4repair_space>Boolean" ) ; } if ( tagValue ) tag . put ( "checked" , "checked" ) ; else tag . remove ( "checked" ) ; } } }

Fix:
tagValue = Boolean . valueOf ( ( ( String ) ( value ) ) ) . booleanValue ( ) ;
Buggy code:
public class TransactionSortingMapper extends Mapper < LongWritable , Text , LongWritable , TransactionTree > { private final OpenObjectIntHashMap < String > fMap = new OpenObjectIntHashMap < String > ( ) ; private Pattern splitter ; @ Override protected void map ( LongWritable offset , Text input , Context context ) throws IOException , InterruptedException { } @ Override protected void setup ( Context context ) throws IOException , InterruptedException { super . setup ( context ) ; <START_BUG> Parameters params = Parameters . fromString ( context . getConfiguration ( ) . get ( PFP_PARAMETERS , "" ) ) ; <END_BUG> int i = 0 ; for ( Pair < String , Long > e : PFPGrowth . deserializeList ( params , F_LIST , context . getConfiguration ( ) ) ) { fMap . put ( e . getFirst ( ) , ( i ++ ) ) ; } splitter = Pattern . compile ( params . get ( SPLIT_PATTERN , SPLITTER . toString ( ) ) ) ; } }

Fix:
Parameters params = new Parameters ( context . getConfiguration ( ) . get ( PFP_PARAMETERS , "" ) ) ;
Buggy code:
@ XmlAccessorType ( XmlAccessType . NONE ) public class DefaultBlock extends ValidatingConfig < StandaloneCatalog > implements Block { @ XmlAttribute ( required = false ) private BlockType type = BlockType . VANILLA ; @ XmlElement ( required = true ) @ XmlIDREF private DefaultUnit unit ; @ XmlElement ( required = true ) private Double size ; @ XmlElement ( required = true ) private DefaultInternationalPrice prices ; @ XmlElement ( required = false ) private Double minTopUpCredit ; private DefaultUsage usage ; @ Override public BlockType getType ( ) { } @ Override public Unit getUnit ( ) { } @ Override public Double getSize ( ) { } @ Override public InternationalPrice getPrice ( ) { } @ Override public Double getMinTopUpCredit ( ) throws CatalogApiException { <START_BUG> if ( ( type ) != ( BlockType . TOP_UP ) ) { <END_BUG> throw new CatalogApiException ( ErrorCode . CAT_NOT_TOP_UP_BLOCK , usage . getPhase ( ) . getName ( ) ) ; } return minTopUpCredit ; } @ Override public ValidationErrors validate ( final StandaloneCatalog catalog , final ValidationErrors errors ) { } public DefaultBlock setType ( final BlockType type ) { } public DefaultBlock setPrices ( final DefaultInternationalPrice prices ) { } public DefaultBlock setUnit ( final DefaultUnit unit ) { } public DefaultBlock setSize ( final Double size ) { } public DefaultBlock setPrice ( final DefaultInternationalPrice prices ) { } public DefaultBlock setUsage ( final DefaultUsage usage ) { } }

Fix:
if ( ( ( minTopUpCredit ) != null ) && ( ( type ) != ( BlockType . TOP_UP ) ) ) {
Buggy code:
@ RestController public class GreetingController { private static final String template = "Hello,<seq2seq4repair_space>%s!" ; private final AtomicLong counter = new AtomicLong ( ) ; private static Log logger = LogFactory . getLog ( GreetingController . class ) ; @ Autowired protected ServletContext servletContext ; @ RequestMapping ( "//greeting" ) @ ResponseBody public Greeting greeting ( @ RequestParam ( value = "name" , defaultValue = "World" ) String name ) { <START_BUG> GreetingController . logger . info ( ( "Server<seq2seq4repair_space>Info:<seq2seq4repair_space>" + ( servletContext . getServerInfo ( ) ) ) ) ; <END_BUG> return new Greeting ( counter . incrementAndGet ( ) , String . format ( GreetingController . template , name ) ) ; } }

Fix:
GreetingController . logger . info ( ( "Server<seq2seq4repair_space>Info<seq2seq4repair_space>001:<seq2seq4repair_space>" + ( servletContext . getServerInfo ( ) ) ) ) ;
Buggy code:
public class WebResponseExceptionsTest extends WicketTestCase { public void testBufferedExceptionErrorPage ( ) { } public void testExceptionErrorPage ( ) { } public void testExpirePage ( ) { tester . startPage ( TestExpirePage . class ) ; String document = tester . getServletResponse ( ) . getDocument ( ) ; assertTrue ( document . contains ( "Click<seq2seq4repair_space>me<seq2seq4repair_space>to<seq2seq4repair_space>get<seq2seq4repair_space>an<seq2seq4repair_space>error" ) ) ; AjaxLink link = ( ( AjaxLink ) ( tester . getComponentFromLastRenderedPage ( "link" ) ) ) ; WebRequestCycle cycle = tester . setupRequestAndResponse ( true ) ; tester . getWicketSession ( ) . invalidateNow ( ) ; tester . getWicketSession ( ) . invalidateNow ( ) ; <START_BUG> String callbackUrl = ( ( org . apache . wicket . ajax . AjaxEventBehavior ) ( link . getBehaviors ( ) . get ( 0 ) ) ) . getCallbackUrl ( true ) . toString ( ) ; <END_BUG> tester . getServletRequest ( ) . setURL ( callbackUrl ) ; cycle . request ( ) ; document = tester . getServletResponse ( ) . getDocument ( ) ; assertTrue ( document . equals ( "-" ) ) ; tester . assertAjaxLocation ( ) ; } public void testInternalErrorPage ( ) { } }

Fix:
String callbackUrl = ( ( org . apache . wicket . ajax . AjaxEventBehavior ) ( link . getBehaviors ( ) . get ( 0 ) ) ) . getCallbackUrl ( ) . toString ( ) ;
Buggy code:
public class URLShareRosterEntryContributionItem extends AbstractRosterEntryContributionItem { public URLShareRosterEntryContributionItem ( ) { } public URLShareRosterEntryContributionItem ( String id ) { } protected IAction [ ] makeActions ( ) { final IRosterEntry entry = getSelectedRosterEntry ( ) ; IContainer c = getContainerForRosterEntry ( entry ) ; if ( ( entry != null ) && ( c != null ) ) { final IChannelContainerAdapter channelAdapter = ( ( IChannelContainerAdapter ) ( c . getAdapter ( IChannelContainerAdapter . class ) ) ) ; if ( ( channelAdapter != null ) && ( isAvailable ( entry ) ) ) { URLShare tmp = URLShareRosterContributionItem . getURLShare ( c . getID ( ) ) ; if ( tmp != null ) { final URLShare urlshare = tmp ; IAction action = new Action ( ) { public void run ( ) { <START_BUG> urlshare . sendURL ( entry . getUser ( ) . getID ( ) ) ; <END_BUG> } } ; action . setText ( URLShareRosterEntryContributionItem_SEND_URL_MENU_TEXT ) ; action . setImageDescriptor ( Activator . imageDescriptorFromPlugin ( PLUGIN_ID , URLShareRosterContributionItem_BROWSER_ICON ) ) ; return new IAction [ ] { action } ; } } } return null ; } }

Fix:
urlshare . sendURL ( entry . getRoster ( ) . getUser ( ) . getName ( ) , entry . getUser ( ) . getID ( ) ) ;
Buggy code:
public class PagedTableTest extends TestCase { public PagedTableTest ( ) { } public PagedTableTest ( String name ) { } public void testPagedTable ( ) throws Exception { MockHttpApplication application = new MockHttpApplication ( null ) ; <START_BUG> application . getSettings ( ) . setHomePage ( PagedTablePage . class ) ; <END_BUG> application . setupRequestAndResponse ( ) ; application . processRequestCycle ( ) ; PagedTablePage page = ( ( PagedTablePage ) ( application . getLastRenderedPage ( ) ) ) ; String document = application . getServletResponse ( ) . getDocument ( ) ; assertTrue ( validatePage1 ( document ) ) ; Link link = ( ( Link ) ( page . get ( "navigation.1.pageLink" ) ) ) ; application . setupRequestAndResponse ( ) ; application . getServletRequest ( ) . setRequestToComponent ( link ) ; application . processRequestCycle ( ) ; document = application . getServletResponse ( ) . getDocument ( ) ; assertTrue ( validatePage2 ( document ) ) ; } private boolean validatePage1 ( String document ) { } private boolean validatePage2 ( String document ) { } }

Fix:
application . getPages ( ) . setHomePage ( PagedTablePage . class ) ;
Buggy code:
public class RequestHandlerStackTest extends BaseRequestHandlerStackTest { public RequestHandlerStackTest ( ) { } private boolean testFlag1 ; private boolean testFlag2 ; private boolean testFlag3 ; private boolean testFlag4 ; private boolean detachedFlag1 ; private boolean detachedFlag2 ; private boolean detachedFlag3 ; private boolean detachedFlag4 ; private void initFlags ( ) { } public void test1 ( ) { initFlags ( ) ; final Response originalResponse = newResponse ( ) ; final RequestHandlerStack stack = newStack ( originalResponse ) ; final IRequestHandler handler3 = new IRequestHandler ( ) { public void respond ( IRequestCycle requestCycle ) { testFlag3 = false ; } public void detach ( IRequestCycle requestCycle ) { detachedFlag3 = true ; } } ; final IRequestHandler handler2 = new IRequestHandler ( ) { public void respond ( IRequestCycle requestCycle ) { testFlag2 = false ; <START_BUG> stack . replaceCurrentRequestHandler ( handler3 ) ; <END_BUG> testFlag2 = true ; } public void detach ( IRequestCycle requestCycle ) { detachedFlag2 = true ; } } ; final IRequestHandler handler1 = new IRequestHandler ( ) { public void respond ( IRequestCycle requestCycle ) { testFlag1 = false ; Response resp = newResponse ( ) ; stack . setResponse ( resp ) ; stack . executeRequestHandler ( handler2 ) ; assertEquals ( stack . getResponse ( ) , resp ) ; testFlag1 = true ; } public void detach ( IRequestCycle requestCycle ) { detachedFlag1 = true ; } } ; stack . executeRequestHandler ( handler1 ) ; assertEquals ( stack . getResponse ( ) , originalResponse ) ; stack . detach ( ) ; assertTrue ( testFlag1 ) ; assertFalse ( testFlag2 ) ; assertFalse ( testFlag3 ) ; assertTrue ( detachedFlag1 ) ; assertTrue ( detachedFlag2 ) ; assertTrue ( detachedFlag3 ) ; } public void test2 ( ) { } public void test3 ( ) { } }

Fix:
stack . replaceAllRequestHandlers ( handler3 ) ;
Buggy code:
final class ThriftGenerator extends AnoaCodeGeneratorBase { final String thriftCommand ; ThriftGenerator ( CompilationUnit pg , Consumer < String > logger , String thriftCommand ) { } @ Override protected String schemaFileName ( String namespace ) { } @ Override public String generateSchema ( ) { } private String getSchema ( Schema type ) { StringBuilder sb = new StringBuilder ( ) ; sb . append ( comments ( type . getDoc ( ) , "" , "\n" ) ) ; int ordinal = 0 ; if ( ( type . getType ( ) ) == ( Type . ENUM ) ) { sb . append ( "enum<seq2seq4repair_space>" ) . append ( type . getName ( ) ) . append ( "<seq2seq4repair_space>{" ) ; for ( String symbol : type . getEnumSymbols ( ) ) { sb . append ( "\n<seq2seq4repair_space>" ) . append ( symbol ) . append ( "<seq2seq4repair_space>=<seq2seq4repair_space>" ) . append ( ( ordinal ++ ) ) . append ( ',' ) ; } } else { sb . append ( "struct<seq2seq4repair_space>" ) . append ( type . getName ( ) ) . append ( "<seq2seq4repair_space>{\n" ) ; for ( Schema . Field field : type . getFields ( ) ) { ++ ordinal ; if ( ! ( TRUE . equals ( field . getJsonProp ( "removed" ) ) ) ) { sb . append ( comments ( field . doc ( ) , "\n<seq2seq4repair_space>" , "" ) ) ; <START_BUG> sb . append ( "\n<seq2seq4repair_space>" ) . append ( ordinal ) . append ( ":<seq2seq4repair_space>optional<seq2seq4repair_space>" ) . append ( fieldType ( field . schema ( ) ) ) . append ( '<seq2seq4repair_space>' ) . append ( field . name ( ) ) ; <END_BUG> fieldDefault ( field . schema ( ) , field . defaultValue ( ) ) . ifPresent ( ( v ) -> sb . append ( "<seq2seq4repair_space>=<seq2seq4repair_space>" ) . append ( v ) ) ; sb . append ( ";\n" ) ; } } } return sb . append ( "}\n" ) . toString ( ) ; } private String fieldType ( Schema schema ) { } private String wrappedType ( Schema schema ) { } private Optional < String > fieldDefault ( Schema schema , JsonNode value ) { } @ Override public void generateJava ( File schemaRootDir , File javaRootDir ) throws JavaCodeGenerationException { } private void patchNamespace ( File javaSourceDir ) throws JavaCodeGenerationException { } private Map < Pattern , String > buildPatchMap ( File javaSource ) { } private void patchJavaSource ( File javaSource , Map < Pattern , String > map ) throws JavaCodeGenerationException { } }

Fix:
sb . append ( "\n<seq2seq4repair_space>" ) . append ( field . getJsonProp ( ORDINAL_PROP_KEY ) . asInt ( ) ) . append ( ":<seq2seq4repair_space>optional<seq2seq4repair_space>" ) . append ( fieldType ( field . schema ( ) ) ) . append ( '<seq2seq4repair_space>' ) . append ( field . name ( ) ) ;
Buggy code:
public class Intents { private Context context ; public Intents ( Context context ) { } public PendingIntent makePending ( Class < ? > clazz ) { } public PendingIntent makePending ( Intent intent ) { <START_BUG> return PendingIntent . getActivity ( context , 0 , intent , FLAG_UPDATE_CURRENT ) ; <END_BUG> } public Intent makeIntent ( Class < ? > clazz ) { } }

Fix:
return PendingIntent . getActivity ( context , 0 , intent , FLAG_CANCEL_CURRENT ) ;
Buggy code:
public class TestTermScorer extends LuceneTestCase { protected RAMDirectory directory ; private static final String FIELD = "field" ; protected String [ ] values = new String [ ] { "all" , "dogs<seq2seq4repair_space>dogs" , "like" , "playing" , "fetch" , "all" } ; protected IndexSearcher indexSearcher ; protected IndexReader indexReader ; public TestTermScorer ( String s ) { } protected void setUp ( ) throws Exception { super . setUp ( ) ; directory = new RAMDirectory ( ) ; IndexWriter writer = new IndexWriter ( directory , new WhitespaceAnalyzer ( ) , true , MaxFieldLength . LIMITED ) ; for ( int i = 0 ; i < ( values . length ) ; i ++ ) { Document doc = new Document ( ) ; doc . add ( new org . apache . lucene . document . Field ( TestTermScorer . FIELD , values [ i ] , Store . YES , Index . ANALYZED ) ) ; writer . addDocument ( doc ) ; } writer . close ( ) ; <START_BUG> indexSearcher = new IndexSearcher ( directory ) ; <END_BUG> indexReader = indexSearcher . getIndexReader ( ) ; } public void test ( ) throws IOException { } public void testNext ( ) throws Exception { } public void testSkipTo ( ) throws Exception { } public void testExplain ( ) throws Exception { } private class TestHit { public int doc ; public float score ; public TestHit ( int doc , float score ) { } public String toString ( ) { } } }

Fix:
indexSearcher = new IndexSearcher ( directory , false ) ;
Buggy code:
public class NoneMetaDataFactory implements MetaDataDefaults , MetaDataFactory { private static final NoneMetaDataFactory _instance = new NoneMetaDataFactory ( ) ; public static NoneMetaDataFactory getInstance ( ) { } public void setRepository ( MetaDataRepository repos ) { } public void setStoreDirectory ( File dir ) { } public void setStoreMode ( int store ) { } public void setStrict ( boolean strict ) { } public void load ( Class cls , int mode , ClassLoader envLoader ) { } public boolean store ( ClassMetaData [ ] metas , QueryMetaData [ ] queries , SequenceMetaData [ ] seqs , int mode , Map output ) { } public boolean drop ( Class [ ] cls , int mode , ClassLoader envLoader ) { } public MetaDataDefaults getDefaults ( ) { } public Set getPersistentTypeNames ( boolean classpath , ClassLoader envLoader ) { } public Class getQueryScope ( String queryName , ClassLoader loader ) { } public Class getResultSetMappingScope ( String resultSetMappingName , ClassLoader loader ) { } public ClassArgParser newClassArgParser ( ) { } public void clear ( ) { } public void addClassExtensionKeys ( Collection exts ) { } public void addFieldExtensionKeys ( Collection exts ) { } public int getDefaultAccessType ( ) { } public int getDefaultIdentityType ( ) { } public int getCallbackMode ( ) { } public boolean getCallbacksBeforeListeners ( int type ) { } public void setIgnoreNonPersistent ( boolean ignore ) { } public boolean isDeclaredInterfacePersistent ( ) { } public boolean isDataStoreObjectIdFieldUnwrapped ( ) { } public void populate ( ClassMetaData meta , int access ) { } public void populate ( ClassMetaData meta , int access , boolean ignoreTransient ) { } public Member getBackingMember ( FieldMetaData fmd ) { } public Member getMemberByProperty ( ClassMetaData meta , String property , int access , boolean scan ) { } public Class < ? extends Exception > getUnimplementedExceptionType ( ) { } <START_BUG> public void loadXMLMetaData ( FieldMetaData fmd ) { <END_BUG> } public String getMetaModelClassName ( String managedClassName ) { } public String getManagedClassName ( String metamodelClassName ) { } public boolean isMetaClass ( Class < ? > c ) { } public Class < ? > getManagedClass ( Class < ? > c ) { } public boolean isAbstractMappingUniDirectional ( OpenJPAConfiguration conf ) { } public boolean isNonDefaultMappingAllowed ( OpenJPAConfiguration conf ) { } }

Fix:
public void loadXMLMetaData ( Class < ? > cls ) {
Buggy code:
@ SuppressWarnings ( "unused" ) public class Account extends AEntity < Long > implements Comparable < Account > { @ Attribute ( name = "Name" , readable = true , writeable = true ) @ StringValidator ( allowNull = false , minLength = 1 , maxLength = 32 ) private String name ; @ Attribute ( name = "Remarks" , readable = true , writeable = true ) @ StringValidator ( allowNull = true , minLength = 0 , maxLength = 512 ) private String remarks ; @ Attribute ( name = "Currency" , readable = true , writeable = true ) @ ObjectValidator ( allowNull = false ) private Currency currency ; @ Override protected void update ( ) throws ProviderException { } @ Override protected void remove ( ) throws ReferenceException , ProviderException { } public Transaction createTransaction ( Category category , Date date , Double amount , String no , String remarks ) throws ProviderException { } public Transaction getTransaction ( long id ) throws ProviderException { } public List < Transaction > getTransactions ( Date begin , Date end ) throws ProviderException { } public List < Long > getTimestamps ( ) throws ProviderException { } public double getOpeningBalance ( int year , int month ) throws ProviderException { } public double getClosingBalance ( int year , int month ) throws ProviderException { Calendar calendar = Calendar . getInstance ( ) ; <START_BUG> calendar . set ( year , month , 1 , 0 , 0 , 0 ) ; <END_BUG> calendar . set ( Calendar . DATE , calendar . getActualMaximum ( Calendar . DATE ) ) ; return provider . getBalance ( getId ( ) , calendar . getTime ( ) ) ; } public String getName ( ) { } public void setName ( String name ) throws AttributeException { } public String getRemarks ( ) { } public void setRemarks ( String remarks ) throws AttributeException { } public Currency getCurrency ( ) { } public void setCurrency ( Currency currency ) throws AttributeException { } @ Override public String toString ( ) { } @ Override public boolean equals ( Object object ) { } @ Override public int compareTo ( Account account ) { } No newline ; at end ; of file ; }

Fix:
calendar . set ( year , month , 1 , 23 , 59 , 59 ) ;
Buggy code:
public class Solver { private class VisitedStates { boolean [ ] visitedStates ; public VisitedStates ( int vertexCount ) { } public boolean hasVisited ( boolean [ ] state ) { } } public static void main ( String [ ] args ) { } private LinkedList < LinkedList < int [ ] > > getSolution ( ) { } private LinkedList < int [ ] > solveComponent ( Graph component ) { } private LinkedList < int [ ] > getSolution ( Solver . VisitedStates visited , int staticPursuers , int dynPursuers , Graph g , boolean [ ] state , int [ ] freeEdges , int [ ] placements , int pos ) { if ( visited . hasVisited ( state ) ) { return null ; } int u = 0 ; for ( ; u < ( state . length ) ; u ++ ) { if ( ! ( state [ u ] ) ) { break ; } } if ( u == ( state . length ) ) { return new LinkedList < int [ ] > ( ) ; } for ( int i = 0 ; i < ( g . getVertexCount ( ) ) ; i ++ ) { if ( state [ i ] ) { continue ; } int c = 0 ; List < Integer > neighbours = g . getAdjacencyList ( ) . get ( i ) ; for ( int v : neighbours ) { if ( ( freeEdges [ v ] ) <= dynPursuers ) { c ++ ; } } if ( c > 0 ) { boolean [ ] newState ; int [ ] newFreeEdges = freeEdges . clone ( ) ; for ( int v : neighbours ) { ( newFreeEdges [ v ] ) -- ; } <START_BUG> placements [ pos ] = i ; <END_BUG> LinkedList < int [ ] > result ; if ( dynPursuers > 1 ) { newState = state . clone ( ) ; newState [ i ] = true ; result = getSolution ( visited , staticPursuers , ( dynPursuers - 1 ) , g , newState , newFreeEdges , placements , ( pos + 1 ) ) ; if ( result != null ) { return result ; } } else { newState = new boolean [ g . getVertexCount ( ) ] ; for ( int x = 0 ; x < ( g . getVertexCount ( ) ) ; x ++ ) { if ( ( newFreeEdges [ x ] ) == 0 ) { newState [ x ] = true ; } } newFreeEdges = new int [ g . getVertexCount ( ) ] ; for ( int x = 0 ; x < ( g . getVertexCount ( ) ) ; x ++ ) { if ( ! ( newState [ x ] ) ) { for ( int n : g . getAdjacencyList ( ) . get ( x ) ) { ( newFreeEdges [ n ] ) ++ ; } } } result = getSolution ( visited , staticPursuers , staticPursuers , g , newState , newFreeEdges , new int [ staticPursuers ] , 0 ) ; if ( result != null ) { result . addFirst ( placements ) ; return result ; } } } } return null ; } }

Fix:
placements [ pos ] = g . translate ( i ) ;
Buggy code:
public class CommonsExecIntegrationTest { private static final int SUCCESSFUL = 0 ; @ Rule public TemporaryFolder testDir = new TemporaryFolder ( ) ; private RunConfiguration createRunConfig ( ) { } @ Test public void shouldBeAbleToRunEmptyScript ( ) throws Exception { } @ Test public void shouldBeAbleToRunHelloWorldScript ( ) throws Exception { } @ Test public void shouldBeAbleToRunHelloErrorScript ( ) throws Exception { } @ Test public void shouldBeAbleToRunHelloNameScript ( ) throws Exception { } @ Test public void shouldBeAbleToDoDryRunOfModel ( ) throws Exception { } private static File findR ( ) { OSChecker osChecker = new OSCheckerImpl ( ) ; if ( osChecker . isWindows ( ) ) { <START_BUG> return new File ( "C:\\Program<seq2seq4repair_space>Files\\R\\R-3.0.2\\bin\\x64\\R.exe" ) ; <END_BUG> } else { return new File ( "//usr//bin//R" ) ; } } private static File createScript ( TemporaryFolder baseDir , String [ ] lines ) throws IOException { } }

Fix:
return new File ( ( ( System . getenv ( "R_HOME" ) ) + "\\bin\\x64\\R.exe" ) ) ;
Buggy code:
public class ProjectBinaryOutput extends BinaryOutput { private IProject project ; private IPath outputPath ; private JavaDevelopmentContextImpl dc ; public ProjectBinaryOutput ( IProject project , IPath outputPath , JavaDevelopmentContextImpl dc ) { } protected void basicPutBinary ( TypeStructureEntry tsEntry , byte [ ] binary , int crc ) { } private void deleteAllInContainer ( IContainer container ) { } public void deleteBinary ( IType type ) { } private void deleteClassesInContainer ( IContainer container ) { } public void garbageCollect ( IState [ ] statesInUse ) { } public byte [ ] getBinary ( TypeStructureEntry tsEntry , IType type ) { } private IContainer getContainer ( IPath path ) { } private IFile getFile ( IPath path ) { } IPath getOutputPath ( ) { } private IPath getPathForBinary ( IType type ) { } IContainer makeContainersIfNecessary ( IPath path ) { } public void scrubOutput ( ) { IJavaProject projectElement = JavaCore . create ( this . project ) ; IClasspathEntry [ ] entries ; try { <START_BUG> entries = projectElement . getResolvedClasspath ( true ) ; <END_BUG> } catch ( JavaModelException e ) { throw this . dc . internalException ( e ) ; } boolean flushAllOutput = true ; boolean hasSource = false ; for ( int i = 0 , length = entries . length ; i < length ; i ++ ) { IClasspathEntry entry = entries [ i ] ; if ( ( entry . getEntryKind ( ) ) == ( IClasspathEntry . CPE_SOURCE ) ) { hasSource = true ; if ( this . outputPath . equals ( entry . getPath ( ) ) ) { flushAllOutput = false ; break ; } } } if ( hasSource ) { if ( flushAllOutput ) { deleteAllInContainer ( getContainer ( this . outputPath ) ) ; } else { deleteClassesInContainer ( getContainer ( this . outputPath ) ) ; } } } }

Fix:
entries = projectElement . getExpandedClasspath ( true ) ;
Buggy code:
public class ColumnFamilyTest extends SchemaLoader { @ Test public void testSingleColumn ( ) throws IOException { } @ Test public void testManyColumns ( ) throws IOException { ColumnFamily cf ; TreeMap < String , String > map = new TreeMap < String , String > ( ) ; for ( int i = 100 ; i < 1000 ; ++ i ) { map . put ( Integer . toString ( i ) , ( "Avinash<seq2seq4repair_space>Lakshman<seq2seq4repair_space>is<seq2seq4repair_space>a<seq2seq4repair_space>good<seq2seq4repair_space>man:<seq2seq4repair_space>" + i ) ) ; } cf = ColumnFamily . create ( "Keyspace1" , "Standard1" ) ; DataOutputBuffer bufOut = new DataOutputBuffer ( ) ; for ( String cName : map . navigableKeySet ( ) ) { cf . addColumn ( Util . column ( cName , map . get ( cName ) , 314 ) ) ; } ColumnFamily . serializer ( ) . serialize ( cf , bufOut ) ; ByteArrayInputStream bufIn = new ByteArrayInputStream ( bufOut . getData ( ) , 0 , bufOut . getLength ( ) ) ; cf = ColumnFamily . serializer ( ) . deserialize ( new DataInputStream ( bufIn ) ) ; for ( String cName : map . navigableKeySet ( ) ) { <START_BUG> ByteBuffer val = cf . getColumn ( ByteBuffer . wrap ( cName . getBytes ( ) ) ) . value ( ) ; <END_BUG> assert new String ( val . array ( ) , val . position ( ) , val . remaining ( ) ) . equals ( map . get ( cName ) ) ; } assert ( cf . getColumnNames ( ) . size ( ) ) == ( map . size ( ) ) ; } @ Test public void testGetColumnCount ( ) { } @ Test public void testTimestamp ( ) { } @ Test public void testMergeAndAdd ( ) { } }

Fix:
ByteBuffer val = cf . getColumn ( ByteBufferUtil . bytes ( cName ) ) . value ( ) ;
Buggy code:
public final class FieldCacheRewriteMethod extends MultiTermQuery . RewriteMethod { @ Override public Query rewrite ( IndexReader reader , MultiTermQuery query ) { } static class MultiTermQueryFieldCacheWrapperFilter extends Filter { protected final MultiTermQuery query ; protected MultiTermQueryFieldCacheWrapperFilter ( MultiTermQuery query ) { } @ Override public String toString ( ) { } @ Override public final boolean equals ( final Object o ) { } @ Override public final int hashCode ( ) { } public final String getField ( ) { } @ Override public DocIdSet getDocIdSet ( AtomicReaderContext context , final Bits acceptDocs ) throws IOException { final FieldCache . DocTermsIndex fcsi = DEFAULT . getTermsIndex ( context . reader ( ) , query . field ) ; final OpenBitSet termSet = new OpenBitSet ( fcsi . numOrd ( ) ) ; TermsEnum termsEnum = query . getTermsEnum ( new Terms ( ) { @ Override public Comparator < BytesRef > getComparator ( ) throws IOException { return BytesRef . getUTF8SortedAsUnicodeComparator ( ) ; } @ Override public TermsEnum iterator ( TermsEnum reuse ) throws IOException { return fcsi . getTermsEnum ( ) ; } @ Override public long getSumTotalTermFreq ( ) { return - 1 ; } @ Override public long getSumDocFreq ( ) throws IOException { return - 1 ; } @ Override public int getDocCount ( ) throws IOException { return - 1 ; } @ Override <START_BUG> public long getUniqueTermCount ( ) throws IOException { <END_BUG> return - 1 ; } } ) ; assert termsEnum != null ; if ( ( termsEnum . next ( ) ) != null ) { do { long ord = termsEnum . ord ( ) ; if ( ord > 0 ) { termSet . set ( ord ) ; } } while ( ( termsEnum . next ( ) ) != null ) ; } else { return DocIdSet . EMPTY_DOCIDSET ; } return new FieldCacheDocIdSet ( context . reader ( ) . maxDoc ( ) , acceptDocs ) { @ Override protected final boolean matchDoc ( int doc ) throws ArrayIndexOutOfBoundsException { return termSet . get ( fcsi . getOrd ( doc ) ) ; } } ; } } }

Fix:
public long size ( ) throws IOException {
Buggy code:
public class HornetQXAResourceWrapper implements XAResource , SessionFailureListener { private static final Logger log = Logger . getLogger ( HornetQXAResourceWrapper . class ) ; private static final Object lock = new Object ( ) ; private ServerLocator serverLocator ; private ClientSessionFactory csf ; private ClientSession delegate ; private XARecoveryConfig [ ] xaRecoveryConfigs ; public HornetQXAResourceWrapper ( XARecoveryConfig ... xaRecoveryConfigs ) { } public Xid [ ] recover ( final int flag ) throws XAException { } public void commit ( final Xid xid , final boolean onePhase ) throws XAException { } public void rollback ( final Xid xid ) throws XAException { } public void forget ( final Xid xid ) throws XAException { } public boolean isSameRM ( XAResource xaRes ) throws XAException { } public int prepare ( final Xid xid ) throws XAException { } public void start ( final Xid xid , final int flags ) throws XAException { } public void end ( final Xid xid , final int flags ) throws XAException { } public int getTransactionTimeout ( ) throws XAException { } public boolean setTransactionTimeout ( final int seconds ) throws XAException { } public void connectionFailed ( final HornetQException me , boolean failedOver ) { } public void beforeReconnect ( final HornetQException me ) { } public XAResource getDelegate ( boolean retry ) throws XAException { XAResource result = null ; Exception error = null ; try { result = connect ( ) ; } catch ( Exception e ) { error = e ; } if ( result == null ) { if ( retry ) { XAException xae = new XAException ( "Connection<seq2seq4repair_space>unavailable<seq2seq4repair_space>for<seq2seq4repair_space>xa<seq2seq4repair_space>recovery" ) ; xae . errorCode = XAException . XA_RETRY ; if ( error != null ) { xae . initCause ( error ) ; } if ( HornetQXAResourceWrapper . log . isDebugEnabled ( ) ) { HornetQXAResourceWrapper . log . debug ( "Cannot<seq2seq4repair_space>get<seq2seq4repair_space>connectionFactory<seq2seq4repair_space>XAResource" , xae ) ; } throw xae ; } else { XAException xae = new XAException ( "Error<seq2seq4repair_space>trying<seq2seq4repair_space>to<seq2seq4repair_space>connect<seq2seq4repair_space>to<seq2seq4repair_space>any<seq2seq4repair_space>providers<seq2seq4repair_space>for<seq2seq4repair_space>xa<seq2seq4repair_space>recovery" ) ; <START_BUG> xae . errorCode = XAException . XAER_RMERR ; <END_BUG> if ( error != null ) { xae . initCause ( error ) ; } if ( HornetQXAResourceWrapper . log . isDebugEnabled ( ) ) { HornetQXAResourceWrapper . log . debug ( "Cannot<seq2seq4repair_space>get<seq2seq4repair_space>connectionFactory<seq2seq4repair_space>XAResource" , xae ) ; } throw xae ; } } return result ; } protected XAResource connect ( ) throws Exception { } @ Override public String toString ( ) { } public void close ( ) { } protected XAException check ( final XAException e ) throws XAException { } @ Override protected void finalize ( ) throws Throwable { } }

Fix:
xae . errorCode = XAException . XAER_RMFAIL ;
Buggy code:
public abstract class AbstractChart extends AbstractTestElement implements ReportChart { public static final String REPORT_CHART_X_AXIS = "ReportChart.chart.x.axis" ; public static final String REPORT_CHART_Y_AXIS = "ReportChart.chart.y.axis" ; public static final String REPORT_CHART_X_LABEL = "ReportChart.chart.x.label" ; public static final String REPORT_CHART_Y_LABEL = "ReportChart.chart.y.label" ; public static final String REPORT_CHART_TITLE = "ReportChart.chart.title" ; public static final String REPORT_CHART_CAPTION = "ReportChart.chart.caption" ; public static final String REPORT_CHART_WIDTH = "ReportChart.chart.width" ; public static final String REPORT_CHART_HEIGHT = "ReportChart.chart.height" ; public static final int DEFAULT_WIDTH = 350 ; public static final int DEFAULT_HEIGHT = 350 ; public static final String X_DATA_FILENAME_LABEL = "Filename" ; public static final String X_DATA_DATE_LABEL = "Date" ; public static final String [ ] X_LABELS = new String [ ] { AbstractChart . X_DATA_FILENAME_LABEL , AbstractChart . X_DATA_DATE_LABEL } ; protected BufferedImage image = null ; public AbstractChart ( ) { } public String getXAxis ( ) { } public String getFormattedXAxis ( ) { } public void setXAxis ( String field ) { } public String getYAxis ( ) { } public void setYAxis ( String scale ) { } public String getXLabel ( ) { } public void setXLabel ( String label ) { } public String getYLabel ( ) { } public void setYLabel ( String label ) { } public String getTitle ( ) { } public void setTitle ( String title ) { } public String getCaption ( ) { } public void setCaption ( String caption ) { } public int getWidth ( ) { } public void setWidth ( String width ) { } public int getHeight ( ) { } public void setHeight ( String height ) { } public abstract JComponent renderChart ( List data ) { } public BufferedImage getBufferedImage ( ) { } public void setBufferedImage ( BufferedImage img ) { } public double getValue ( SamplingStatCalculator stat ) { if ( this . getXAxis ( ) . equals ( REPORT_TABLE_50_PERCENT ) ) { return stat . getPercentPoint ( 0.5 ) . doubleValue ( ) ; } else if ( this . getXAxis ( ) . equals ( REPORT_TABLE_90_PERCENT ) ) { return stat . getPercentPoint ( 0.9 ) . doubleValue ( ) ; } else if ( this . getXAxis ( ) . equals ( REPORT_TABLE_ERROR_RATE ) ) { return stat . getErrorPercentage ( ) ; } else if ( this . getXAxis ( ) . equals ( REPORT_TABLE_MAX ) ) { return stat . getMax ( ) . doubleValue ( ) ; } else if ( this . getXAxis ( ) . equals ( REPORT_TABLE_MEAN ) ) { return stat . getMean ( ) ; } else if ( this . getXAxis ( ) . equals ( REPORT_TABLE_MEDIAN ) ) { return stat . getMedian ( ) . doubleValue ( ) ; } else if ( this . getXAxis ( ) . equals ( REPORT_TABLE_MIN ) ) { return stat . getMin ( ) . doubleValue ( ) ; } else if ( this . getXAxis ( ) . equals ( REPORT_TABLE_RESPONSE_RATE ) ) { return stat . getRate ( ) ; } else if ( this . getXAxis ( ) . equals ( REPORT_TABLE_TRANSFER_RATE ) ) { <START_BUG> return ( stat . getPageSize ( ) ) // 1024 ; <END_BUG> } else { return Double . NaN ; } } }

Fix:
return stat . getKBPerSecond ( ) ;
Buggy code:
public class JPADependencyProcessor implements DeploymentUnitProcessor { private static final ModuleIdentifier JAVAX_PERSISTENCE_API_ID = ModuleIdentifier . create ( "javax.persistence.api" ) ; private static final ModuleIdentifier JBOSS_AS_JPA_ID = ModuleIdentifier . create ( "org.jboss.as.jpa" ) ; private static final ModuleIdentifier JBOSS_AS_JPA_SPI_ID = ModuleIdentifier . create ( "org.jboss.as.jpa.spi" ) ; private static final ModuleIdentifier JAVASSIST_ID = ModuleIdentifier . create ( "org.javassist" ) ; private static final ModuleIdentifier HIBERNATE_3_PROVIDER = ModuleIdentifier . create ( "org.jboss.as.jpa.hibernate" , "3" ) ; private static final String HIBERNATE3_PROVIDER_ADAPTOR = "org.jboss.as.jpa.hibernate3.HibernatePersistenceProviderAdaptor" ; private static final ModuleIdentifier JBOSS_AS_NAMING_ID = ModuleIdentifier . create ( "org.jboss.as.naming" ) ; private static final ModuleIdentifier JBOSS_JANDEX_ID = ModuleIdentifier . create ( "org.jboss.jandex" ) ; public void deploy ( DeploymentPhaseContext phaseContext ) throws DeploymentUnitProcessingException { } private void addDependency ( ModuleSpecification moduleSpecification , ModuleLoader moduleLoader , DeploymentUnit deploymentUnit , ModuleIdentifier ... moduleIdentifiers ) { for ( ModuleIdentifier moduleIdentifier : moduleIdentifiers ) { <START_BUG> moduleSpecification . addSystemDependency ( new org . jboss . as . server . deployment . module . ModuleDependency ( moduleLoader , moduleIdentifier , false , false , true , false ) ) ; <END_BUG> ROOT_LOGGER . debugf ( "added<seq2seq4repair_space>%s<seq2seq4repair_space>dependency<seq2seq4repair_space>to<seq2seq4repair_space>%s" , moduleIdentifier , deploymentUnit . getName ( ) ) ; } } private void addOptionalDependency ( ModuleSpecification moduleSpecification , ModuleLoader moduleLoader , DeploymentUnit deploymentUnit , ModuleIdentifier ... moduleIdentifiers ) { } @ Override public void undeploy ( DeploymentUnit context ) { } private void addPersistenceProviderModuleDependencies ( DeploymentPhaseContext phaseContext , ModuleSpecification moduleSpecification , ModuleLoader moduleLoader ) throws DeploymentUnitProcessingException { } private static void addPUServiceDependencyToComponents ( final Collection < ComponentDescription > components , final PersistenceUnitMetadataHolder holder ) { } private int loadPersistenceUnits ( final ModuleSpecification moduleSpecification , final ModuleLoader moduleLoader , final DeploymentUnit deploymentUnit , final Set < String > moduleDependencies , final PersistenceUnitMetadataHolder holder ) throws DeploymentUnitProcessingException { } private void addHibernate3AdaptorToDeployment ( final ModuleLoader moduleLoader , final DeploymentUnit deploymentUnit ) { } }

Fix:
moduleSpecification . addSystemDependency ( new org . jboss . as . server . deployment . module . ModuleDependency ( moduleLoader , moduleIdentifier , false , false , false , false ) ) ;
Buggy code:
public class ByteQueue { public int getSize ( ) { } public void writeShort ( short s ) { } public void writeInt ( int i ) { } public void writeLong ( long l ) { ensureSpace ( 8 ) ; bytes [ write ] = ( ( byte ) ( l > > 56 ) ) ; write = ( ( write ) + 1 ) % ( bytes . length ) ; bytes [ write ] = ( ( byte ) ( l > > 48 ) ) ; write = ( ( write ) + 1 ) % ( bytes . length ) ; bytes [ write ] = ( ( byte ) ( l > > 40 ) ) ; write = ( ( write ) + 1 ) % ( bytes . length ) ; bytes [ write ] = ( ( byte ) ( l > > 32 ) ) ; write = ( ( write ) + 1 ) % ( bytes . length ) ; bytes [ write ] = ( ( byte ) ( l > > 24 ) ) ; write = ( ( write ) + 1 ) % ( bytes . length ) ; bytes [ write ] = ( ( byte ) ( l > > 16 ) ) ; write = ( ( write ) + 1 ) % ( bytes . length ) ; bytes [ write ] = ( ( byte ) ( l > > 8 ) ) ; write = ( ( write ) + 1 ) % ( bytes . length ) ; bytes [ write ] = ( ( byte ) ( l ) ) ; write = ( ( write ) + 1 ) % ( bytes . length ) ; <START_BUG> size += 4 ; <END_BUG> } public void writeFloat ( float f ) { } public void writeBytes ( byte [ ] bytes , int size ) { } public void readBytes ( byte [ ] result , int size ) { } private byte [ ] bytes ; private int read ; private int write ; private int size ; private final ByteBuffer tmp_bb = ByteBuffer . allocate ( 4 ) ; private void ensureSpace ( int needed_empty_space ) { } }

Fix:
size += 8 ;
Buggy code:
public class SkiTripsReport { SkiTripsReport ( int trips , double avgFlights , double avgTransfers , double avgAccom , double avgSkipass , double avgSkihire , double avgCost ) { } int trips ; double avgFlights ; double avgTransfers ; double avgAccom ; double avgSkipass ; double avgSkihire ; double avgCost ; public int getTrips ( ) { } public double getAvgFlights ( ) { } public double getAvgTransfers ( ) { } public double getAvgAccom ( ) { } public double getAvgSkipass ( ) { } public double getAvgSkihire ( ) { } public double getAvgCost ( ) { } public String toString ( ) { } public String floattoeuro ( double avgCost2 ) { <START_BUG> String str = String . format ( "Û%.02f" , avgCost2 ) ; <END_BUG> return str ; } }

Fix:
String str = String . format ( "%.02f<seq2seq4repair_space>euro" , avgCost2 ) ;
Buggy code:
public class SimpleInterceptor { private boolean postConstructInvoked ; @ PostConstruct private void onConstruct ( InvocationContext invocationContext ) { } @ AroundInvoke public Object onInvoke ( InvocationContext ctx ) throws Exception { <START_BUG> return ctx . proceed ( ) ; <END_BUG> } }

Fix:
return ( ( getClass ( ) . getName ( ) ) + "#" ) + ( ctx . proceed ( ) ) ;