nus-yam/ex-repair huggingface dataset:
Buggy code:
public class SettingsTest { @ Test public void testSettingsHeight ( ) { } @ Test public void testSettingsWidth ( ) { } @ Test public void testSettingsHealth ( ) { } @ Test public void testSettingsPlayerSpeed ( ) { } @ Test public void testSettingsMonsterSpeed ( ) { <START_BUG> assertEquals ( 5.0 , MONSTER_SPEED , 0.001 ) ; <END_BUG> } }

Fix:
assertEquals ( 3.5 , MONSTER_SPEED , 0.001 ) ;
Buggy code:
public class MonthDV extends AbstractDateTimeDV { public Object getActualValue ( String content , ValidationContext context ) throws InvalidDatatypeValueException { try { <START_BUG> return parse ( content ) ; <END_BUG> } catch ( Exception ex ) { throw new InvalidDatatypeValueException ( "cvc-datatype-valid.1.2.1" , new Object [ ] { content , "gMonth" } ) ; } } protected int [ ] parse ( String str ) throws SchemaDateTimeException { } protected short compareDates ( int [ ] date1 , int [ ] date2 ) { } protected String dateToString ( int [ ] date ) { } }

Fix:
return new DateTimeData ( parse ( content ) , this ) ;
Buggy code:
@ BafBinding @ Priority ( 1000 ) @ Interceptor public class BafAroundConstructInterceptor { private static boolean aroundConstructCalled = false ; @ AroundConstruct public void intercept ( InvocationContext ctx ) { BafAroundConstructInterceptor . aroundConstructCalled = true ; <START_BUG> throw new Error ( "Do<seq2seq4repair_space>not<seq2seq4repair_space>suppress<seq2seq4repair_space>me." ) ; <END_BUG> } public static void reset ( ) { } public static boolean isAroundConstructCalled ( ) { } }

Fix:
throw new Error ( "Do<seq2seq4repair_space>not<seq2seq4repair_space>supress<seq2seq4repair_space>me." ) ;
Buggy code:
public class CacheGroupServiceInstaller implements CacheServiceInstaller { private final Logger logger = Logger . getLogger ( this . getClass ( ) ) ; private final CacheServiceBuilder < Group > builder ; protected CacheGroupServiceInstaller ( CacheServiceBuilder < Group > builder ) { } private static BindInfo createBinding ( String container , String cache ) { } @ Override public Collection < ServiceName > getServiceNames ( String container , String cache ) { } @ Override public void install ( ServiceTarget target , String container , String cache ) { ServiceName name = GROUP . getServiceName ( container , cache ) ; ContextNames . BindInfo bindInfo = CacheGroupServiceInstaller . createBinding ( container , cache ) ; this . logger . debugf ( "Installing<seq2seq4repair_space>%s<seq2seq4repair_space>service,<seq2seq4repair_space>bound<seq2seq4repair_space>to<seq2seq4repair_space>" , name . getCanonicalName ( ) , bindInfo . getAbsoluteJndiName ( ) ) ; this . builder . build ( target , name , container , cache ) . setInitialMode ( ServiceController . Mode . ON_DEMAND ) . install ( ) ; <START_BUG> new org . jboss . as . clustering . naming . BinderServiceBuilder ( target ) . build ( bindInfo , name , Group . class ) . install ( ) ; <END_BUG> } }

Fix:
new org . jboss . as . clustering . naming . BinderServiceBuilder ( bindInfo , name , Group . class ) . build ( target ) . install ( ) ;
Buggy code:
public class InMemoryTable { private final String tableName ; private final String [ ] columnNames ; private final Map < String , Integer > columnIndex = new HashMap < > ( ) ; private final Class [ ] columnTypes ; private final List < String > primaryKey = new ArrayList < > ( ) ; private final Map < String , Object [ ] > rows = new LinkedHashMap < > ( ) ; private final int maxRows ; public InMemoryTable ( String tableName , String [ ] columnNames , Class [ ] columnTypes , List < String > primaryKey , int maxRows ) { } public String getTableName ( ) { } public Class [ ] getColumnTypes ( ) { } public String [ ] getColumnNames ( ) { } public Map < String , Integer > getColumnIndex ( ) { } public void insert ( Map < String , Object > row ) throws Exception { } private void checkTableSpace ( ) throws Exception { } private String generatePrimaryKey ( Map < String , Object > row ) throws Exception { } public void truncate ( ) { } public List < SimpleValue [ ] > fullScanSearch ( List < InMemoryRelation > relations , List < InMemorySelector > outputColumns ) throws Exception { } private SimpleValue [ ] projectColumns ( final Object [ ] row , final List < InMemorySelector > outputColumns ) throws Exception { } public int size ( ) { } private SimpleValue [ ] convertToSimpleValueRow ( InMemorySelector selector , Object [ ] row ) { SimpleValue [ ] result = new SimpleValue [ row . length ] ; int i = 0 ; for ( Object field : row ) { <START_BUG> result [ i ] = new SimpleValue ( selector , field ) ; <END_BUG> } return result ; } }

Fix:
result [ ( i ++ ) ] = new SimpleValue ( selector , field ) ;
Buggy code:
public class ResultTest { @ Test public void failedAssumptionDoesntCountAsRun ( ) throws Exception { Result result = new Result ( ) ; RunListener listener = result . createListener ( ) ; Description someTest = Description . EMPTY ; listener . testStarted ( someTest ) ; <START_BUG> listener . testAssumptionFailed ( someTest , null ) ; <END_BUG> listener . testFinished ( someTest ) ; Assert . assertThat ( result . getRunCount ( ) , is ( 0 ) ) ; } }

Fix:
listener . testAssumptionInvalid ( someTest , null ) ;
Buggy code:
public class SortableTableHeadersTest extends TestCase { public SortableTableHeadersTest ( ) { } public SortableTableHeadersTest ( String name ) { } public void testPagedTable ( ) throws Exception { MockHttpApplication application = new MockHttpApplication ( null ) ; <START_BUG> application . getSettings ( ) . setHomePage ( SortableTableHeadersPage . class ) ; <END_BUG> application . setupRequestAndResponse ( ) ; application . processRequestCycle ( ) ; SortableTableHeadersPage page = ( ( SortableTableHeadersPage ) ( application . getLastRenderedPage ( ) ) ) ; String document = application . getServletResponse ( ) . getDocument ( ) ; assertTrue ( validatePage ( document , "SortableTableHeadersExpectedResult_1.html" ) ) ; Link link = ( ( Link ) ( page . get ( "header.id.actionLink" ) ) ) ; assertTrue ( link . isEnabled ( ) ) ; link = ( ( Link ) ( page . get ( "header.name.actionLink" ) ) ) ; assertTrue ( link . isEnabled ( ) ) ; link = ( ( Link ) ( page . get ( "header.email.actionLink" ) ) ) ; assertNull ( link ) ; link = ( ( Link ) ( page . get ( "header.name.actionLink" ) ) ) ; application . setupRequestAndResponse ( ) ; application . getServletRequest ( ) . setRequestToComponent ( link ) ; application . processRequestCycle ( ) ; Assert . assertTrue ( "Response<seq2seq4repair_space>should<seq2seq4repair_space>be<seq2seq4repair_space>a<seq2seq4repair_space>redirect" , application . getServletResponse ( ) . isRedirect ( ) ) ; String redirect = application . getServletResponse ( ) . getRedirectLocation ( ) ; application . setupRequestAndResponse ( ) ; application . getServletRequest ( ) . setRequestToRedirectString ( redirect ) ; application . processRequestCycle ( ) ; document = application . getServletResponse ( ) . getDocument ( ) ; assertTrue ( validatePage ( document , "SortableTableHeadersExpectedResult_2.html" ) ) ; link = ( ( Link ) ( page . get ( "header.name.actionLink" ) ) ) ; application . setupRequestAndResponse ( ) ; application . getServletRequest ( ) . setRequestToComponent ( link ) ; application . processRequestCycle ( ) ; Assert . assertTrue ( "Response<seq2seq4repair_space>should<seq2seq4repair_space>be<seq2seq4repair_space>a<seq2seq4repair_space>redirect" , application . getServletResponse ( ) . isRedirect ( ) ) ; redirect = application . getServletResponse ( ) . getRedirectLocation ( ) ; application . setupRequestAndResponse ( ) ; application . getServletRequest ( ) . setRequestToRedirectString ( redirect ) ; application . processRequestCycle ( ) ; document = application . getServletResponse ( ) . getDocument ( ) ; assertTrue ( validatePage ( document , "SortableTableHeadersExpectedResult_3.html" ) ) ; } private boolean validatePage ( final String document , final String file ) throws IOException { } }

Fix:
application . getPages ( ) . setHomePage ( SortableTableHeadersPage . class ) ;
Buggy code:
public class CharBuffer { private char [ ] c ; private int length ; public CharBuffer ( ) { } public CharBuffer ( final int length ) { } public void clear ( ) { } public int length ( ) { } public int capacity ( ) { } public void append ( final CharBuffer cb ) { } public void append ( final String s ) { } public void append ( final StringBuffer sb ) { } public void append ( final char [ ] data ) { } public void append ( final char data ) { } public void shrink ( ) { } public char [ ] getCharacters ( ) { } public StringBuffer toStringBuffer ( ) { } public String toString ( ) { } public void provideCapacity ( final int capacity ) { if ( ( c . length ) >= capacity ) return ; <START_BUG> int newcapacity = capacity ; <END_BUG> char [ ] newc = new char [ newcapacity ] ; System . arraycopy ( c , 0 , newc , 0 , length ) ; c = newc ; } }

Fix:
int newcapacity = ( ( capacity * 3 ) > > 1 ) + 1 ;
Buggy code:
public final class XMLMemento implements IMemento { private Document factory ; private Element element ; public static XMLMemento createReadRoot ( Reader reader ) throws WorkbenchException { } public static XMLMemento createReadRoot ( Reader reader , String baseDir ) throws WorkbenchException { } public static XMLMemento createWriteRoot ( String type ) { } public XMLMemento ( Document document , Element element ) { } public IMemento createChild ( String type ) { } public IMemento createChild ( String type , String id ) { } public IMemento copyChild ( IMemento child ) { } public IMemento getChild ( String type ) { } public IMemento [ ] getChildren ( String type ) { } public Float getFloat ( String key ) { } public String getType ( ) { } public String getID ( ) { } public Integer getInteger ( String key ) { } public String getString ( String key ) { } public Boolean getBoolean ( String key ) { Attr attr = element . getAttributeNode ( key ) ; if ( attr == null ) { <START_BUG> return Boolean . FALSE ; <END_BUG> } return Boolean . valueOf ( attr . getValue ( ) ) ; } public String getTextData ( ) { } public String [ ] getAttributeKeys ( ) { } private Text getTextNode ( ) { } private void putElement ( Element element , boolean copyText ) { } public void putFloat ( String key , float f ) { } public void putInteger ( String key , int n ) { } public void putMemento ( IMemento memento ) { } public void putString ( String key , String value ) { } public void putBoolean ( String key , boolean value ) { } public void putTextData ( String data ) { } public void save ( Writer writer ) throws IOException { } private static final class DOMWriter extends PrintWriter { private int tab ; private static final String XML_VERSION = "<?xml<seq2seq4repair_space>version=\"1.0\"<seq2seq4repair_space>encoding=\"UTF-8\"?>" ; public DOMWriter ( Writer output ) { } public void print ( Element element ) { } private void printTabulation ( ) { } private void startTag ( Element element , boolean hasChildren ) { } private void endTag ( Element element ) { } private static void appendEscapedChar ( StringBuffer buffer , char c ) { } private static String getEscaped ( String s ) { } private static String getReplacement ( char c ) { } } }

Fix:
return null ;
Buggy code:
public class WorkingSet extends AbstractWorkingSet { private static final String DEFAULT_ID = "org.eclipse.ui.resourceWorkingSetPage" ; private String editPageId ; public WorkingSet ( String name , String uniqueId , IAdaptable [ ] elements ) { } WorkingSet ( String name , String label , IMemento memento ) { } public boolean equals ( Object object ) { } public boolean isEditable ( ) { } public String getId ( ) { } public ImageDescriptor getImageDescriptor ( ) { } public int hashCode ( ) { <START_BUG> int hashCode = ( getName ( ) . hashCode ( ) ) & ( getElementsArray ( ) . hashCode ( ) ) ; <END_BUG> if ( ( editPageId ) != null ) { hashCode &= editPageId . hashCode ( ) ; } return hashCode ; } void restoreWorkingSet ( ) { } public void saveState ( IMemento memento ) { } public void setElements ( IAdaptable [ ] newElements ) { } public void setId ( String pageId ) { } public boolean isVisible ( ) { } public boolean isSelfUpdating ( ) { } public boolean isAggregateWorkingSet ( ) { } private WorkingSetDescriptor getDescriptor ( String defaultId ) { } public IAdaptable [ ] adaptElements ( IAdaptable [ ] objects ) { } }

Fix:
int hashCode = getName ( ) . hashCode ( ) ;
Buggy code:
class GenericOutboundConnectionRemoveHandler extends AbstractRemoveStepHandler { static final GenericOutboundConnectionRemoveHandler INSTANCE = new GenericOutboundConnectionRemoveHandler ( ) ; private GenericOutboundConnectionRemoveHandler ( ) { } @ Override protected void performRuntime ( OperationContext context , ModelNode operation , ModelNode model ) throws OperationFailedException { } @ Override protected void recoverServices ( final OperationContext context , final ModelNode operation , final ModelNode model ) throws OperationFailedException { <START_BUG> GenericOutboundConnectionAdd . INSTANCE . installRuntimeService ( context , operation , null ) ; <END_BUG> } }

Fix:
GenericOutboundConnectionAdd . INSTANCE . installRuntimeService ( context , operation , model , null ) ;
Buggy code:
public class PushMediaConstraints extends MediaConstraints { private static final int MAX_IMAGE_DIMEN = 1280 ; private static final int KB = 1024 ; private static final int MB = 1024 * ( PushMediaConstraints . KB ) ; @ Override public int getImageMaxWidth ( ) { } @ Override public int getImageMaxHeight ( ) { } @ Override public int getImageMaxSize ( ) { <START_BUG> return 300 * ( PushMediaConstraints . KB ) ; <END_BUG> } @ Override public int getVideoMaxSize ( ) { } @ Override public int getAudioMaxSize ( ) { } }

Fix:
return 420 * ( PushMediaConstraints . KB ) ;
Buggy code:
public class DummyTask implements TaskDAO { @ Override public List < Task > getTasksListByDay ( int times , String slaverMac , Date date ) { List < Task > tasks = new ArrayList < Task > ( ) ; Task task = new Task ( ) ; task . setId ( "ifengnew_xxxxxxxxx1" ) ; task . setJobId ( "1" ) ; Phone phone = new Phone ( ) ; phone . setIMEI ( "869585015357569" ) ; <START_BUG> phone . setIMSI ( "460030912121001" ) ; <END_BUG> phone . setManufacturer ( "中兴" ) ; phone . setModelId ( "ZTEU817" ) ; phone . setModelName ( "ZTEU817" ) ; phone . setWifiMAC ( "09-98-AC-A9-65-C3" ) ; Slaver slaver = new Slaver ( ) ; slaver . setSlaverIP ( "192.168.3.105" ) ; slaver . setSlaverMAC ( "8C-70-5A-9C-71-C4" ) ; slaver . setVpnIP ( "192.168.56.1" ) ; slaver . setVpnMAC ( "08-00-27-00-A0-17" ) ; AndroidEmulator emulator = new AndroidEmulator ( "Android_monkey_1" , "android-17" , "160" , "HVGA" , "en_US" , "100M" , false , true , false , "-partition-size<seq2seq4repair_space>300" , "armeabi-v7a" , "D:////tools////Android////android-sdk" , "" , "" ) ; AppRunner appRunner = new AppRunner ( ) ; appRunner . setAppId ( "ifeng.apk" ) ; appRunner . setAppName ( "凤凰新闻" ) ; appRunner . setAppType ( "ifengnew" ) ; appRunner . setPackageName ( "com.ifeng.new2" ) ; appRunner . setScriptName ( "ifeng_test.bat" ) ; appRunner . setScriptType ( "New" ) ; task . setPhone ( phone ) ; task . setEmulator ( emulator ) ; task . setSlaver ( slaver ) ; task . setAppRunner ( appRunner ) ; task . setPlanExecDate ( new Date ( ) ) ; task . setPlanExecPeriod ( "7-22" ) ; task . setStatus ( NONE ) ; Task task2 = new Task ( ) ; task2 . setId ( "ifengnew_xxxxxxxxx2" ) ; task2 . setJobId ( "1" ) ; AndroidEmulator emulator2 = new AndroidEmulator ( "Android_monkey_2" , "android-17" , "160" , "HVGA" , "en_US" , "100M" , false , true , false , "-partition-size<seq2seq4repair_space>300" , "armeabi-v7a" , "D:////tools////Android////android-sdk" , "" , "" ) ; AppRunner appRunner3 = new AppRunner ( ) ; appRunner3 . setAppId ( "ifeng.apk" ) ; appRunner3 . setAppName ( "凤凰新闻" ) ; appRunner3 . setAppType ( "ifengnew" ) ; appRunner3 . setPackageName ( "com.ifeng.new2" ) ; appRunner3 . setScriptName ( "ifeng_test.bat" ) ; appRunner3 . setScriptType ( "Alive" ) ; task2 . setPhone ( phone ) ; task2 . setEmulator ( emulator2 ) ; task2 . setSlaver ( slaver ) ; task2 . setAppRunner ( appRunner3 ) ; task2 . setPlanExecDate ( new Date ( ) ) ; task2 . setPlanExecPeriod ( "7-22" ) ; task2 . setStatus ( NONE ) ; tasks . add ( task ) ; tasks . add ( task2 ) ; return tasks ; } @ Override public List < Task > getTasks ( int times , String slaverMac , Date date ) { } }

Fix:
phone . setIMSI ( "310260912121001" ) ;
Buggy code:
public abstract class OverflowingLRUCache extends LRUCache { protected int fOverflow = 0 ; protected boolean fTimestampsOn = true ; protected double fLoadFactor = 0.333 ; public OverflowingLRUCache ( int size ) { } public OverflowingLRUCache ( int size , int overflow ) { } public Object clone ( ) { } protected abstract boolean close ( LRUCache . LRUCacheEntry entry ) { } public Enumeration elements ( ) { } public double fillingRatio ( ) { } public Hashtable getEntryTable ( ) { } public double getLoadFactor ( ) { } public int getOverflow ( ) { } protected boolean makeSpace ( int space ) { } protected abstract LRUCache newInstance ( int size , int overflow ) { } public Object peek ( Object key ) { } public void printStats ( ) { } protected void privateRemoveEntry ( LRUCache . LRUCacheEntry entry , boolean shuffle ) { } protected void privateRemoveEntry ( LRUCache . LRUCacheEntry entry , boolean shuffle , boolean external ) { } public Object put ( Object key , Object value ) { if ( ( fOverflow ) > 0 ) shrink ( ) ; <START_BUG> int newSpace = spaceFor ( key , value ) ; <END_BUG> LRUCache . LRUCacheEntry entry = ( ( LRUCache . LRUCacheEntry ) ( fEntryTable . get ( key ) ) ) ; if ( entry != null ) { int oldSpace = entry . _fSpace ; int newTotal = ( ( fCurrentSpace ) - oldSpace ) + newSpace ; if ( newTotal <= ( fSpaceLimit ) ) { updateTimestamp ( entry ) ; entry . _fValue = value ; entry . _fSpace = newSpace ; fCurrentSpace = newTotal ; fOverflow = 0 ; return value ; } else { privateRemoveEntry ( entry , false , false ) ; } } makeSpace ( newSpace ) ; privateAdd ( key , value , newSpace ) ; return value ; } public Object remove ( Object key ) { } public void setLoadFactor ( double newLoadFactor ) throws IllegalArgumentException { } public void setSpaceLimit ( int limit ) { } public boolean shrink ( ) { } public String toString ( ) { } protected void updateTimestamp ( LRUCache . LRUCacheEntry entry ) { } }

Fix:
int newSpace = spaceFor ( value ) ;
Buggy code:
public interface INimbus { void prepare ( Map stormConf , String schedulerLocalDir ) { } <START_BUG> Collection < WorkerSlot > availableSlots ( Collection < SupervisorDetails > existingSupervisors , Collection < WorkerSlot > usedSlots , Collection < TopologyDetails > topologies ) ; <END_BUG> void assignSlots ( Collection < WorkerSlot > slot , TopologyDetails topology ) { } }

Fix:
Collection < WorkerSlot > availableSlots ( Collection < SupervisorDetails > existingSupervisors , Collection < WorkerSlot > usedSlots , TopologyDetails topology ) ;
Buggy code:
public class TjpWeaveTestCase extends WeaveTestCase { public TjpWeaveTestCase ( String name ) { } public void testStaticTjp ( ) throws IOException { } public void testEnclosingStaticTjp ( ) throws IOException { } public void testTjp ( ) throws IOException { } public void testAroundTjp ( ) throws IOException { } public void testAround2Tjp ( ) throws IOException { ResolvedType rtx = world . resolve ( UnresolvedType . forName ( "Aspect" ) , true ) ; <START_BUG> assertTrue ( "Couldnt<seq2seq4repair_space>find<seq2seq4repair_space>type<seq2seq4repair_space>Aspect" , ( rtx != ( ResolvedType . MISSING ) ) ) ; <END_BUG> BcelAdvice munger1 = new BcelAdvice ( AdviceKind . stringToKind ( "around" ) , makePointcutAll ( ) , MemberImpl . methodFromString ( "static<seq2seq4repair_space>java.lang.Object<seq2seq4repair_space>Aspect.ajc_around(org.aspectj.runtime.internal.AroundClosure,<seq2seq4repair_space>org.aspectj.lang.JoinPoint)" ) , ( ( Advice . ThisJoinPoint ) | ( Advice . ExtraArgument ) ) , ( - 1 ) , ( - 1 ) , null , rtx ) ; BcelAdvice munger2 = new BcelAdvice ( AdviceKind . stringToKind ( "around" ) , makePointcutAll ( ) , MemberImpl . methodFromString ( "static<seq2seq4repair_space>java.lang.Object<seq2seq4repair_space>Aspect.ajc_around(org.aspectj.runtime.internal.AroundClosure,<seq2seq4repair_space>org.aspectj.lang.JoinPoint)" ) , ( ( Advice . ThisJoinPoint ) | ( Advice . ExtraArgument ) ) , ( - 1 ) , ( - 1 ) , null , rtx ) ; weaveTest ( "HelloWorld" , "TjpAround2HelloWorld" , Arrays . asList ( new BcelAdvice [ ] { munger1 , munger2 } ) ) ; } }

Fix:
assertTrue ( "Couldnt<seq2seq4repair_space>find<seq2seq4repair_space>type<seq2seq4repair_space>Aspect" , ( ! ( rtx . isMissing ( ) ) ) ) ;
Buggy code:
public class AbstractSockJsSessionTests extends BaseAbstractSockJsSessionTests < TestSockJsSession > { @ Override protected TestSockJsSession initSockJsSession ( ) { } @ Test public void getTimeSinceLastActive ( ) throws Exception { } @ Test public void delegateConnectionEstablished ( ) throws Exception { } @ Test public void delegateError ( ) throws Exception { } @ Test public void delegateMessages ( ) throws Exception { } @ Test public void delegateConnectionClosed ( ) throws Exception { } @ Test public void closeWhenNotOpen ( ) throws Exception { } @ Test public void closeWhenNotActive ( ) throws Exception { } @ Test public void close ( ) throws Exception { } @ Test public void closeWithWriteFrameExceptions ( ) throws Exception { } @ Test public void closeWithWebSocketHandlerExceptions ( ) throws Exception { } @ Test public void writeFrame ( ) throws Exception { } @ Test public void writeFrameIoException ( ) throws Exception { } @ Test public void writeFrameThrowable ( ) throws Exception { this . session . setExceptionOnWriteFrame ( new NullPointerException ( ) ) ; this . session . delegateConnectionEstablished ( ) ; try { this . session . writeFrame ( SockJsFrame . openFrame ( ) ) ; fail ( "expected<seq2seq4repair_space>exception" ) ; <START_BUG> } catch ( SockJsRuntimeException ex ) { <END_BUG> assertEquals ( SERVER_ERROR , this . session . getStatus ( ) ) ; verify ( this . webSocketHandler ) . afterConnectionClosed ( this . session , SERVER_ERROR ) ; } } @ Test public void sendHeartbeatWhenNotActive ( ) throws Exception { } @ Test public void sendHeartbeat ( ) throws Exception { } @ Test public void scheduleHeartbeatNotActive ( ) throws Exception { } @ Test public void scheduleAndCancelHeartbeat ( ) throws Exception { } }

Fix:
} catch ( TransportErrorException ex ) {
Buggy code:
public class DcsBiosParser { private enum ParserState { WAIT_FOR_SYNC , ADDRESS_LOW , ADDRESS_HIGH , COUNT_LOW , COUNT_HIGH , DATA_LOW , DATA_HIGH ; } private byte syncByteCount = 0 ; private int address = 0 ; private int remaining = 0 ; private int value = 0 ; private DcsBiosParser . ParserState state = DcsBiosParser . ParserState . WAIT_FOR_SYNC ; private LinkedHashSet < DcsBiosDataListener > dataListeners = new LinkedHashSet < DcsBiosDataListener > ( ) ; private LinkedHashSet < DcsBiosSyncListener > syncListeners = new LinkedHashSet < DcsBiosSyncListener > ( ) ; public synchronized void addDataListener ( DcsBiosDataListener listener ) { } public synchronized void removeDataListener ( DcsBiosDataListener listener ) { } public synchronized void addSyncListener ( DcsBiosSyncListener listener ) { } public synchronized void removeSyncListener ( DcsBiosSyncListener listener ) { } public void processData ( byte [ ] buffer , int offset , int length ) { } public void processData ( byte data ) { } private void notifyDataListeners ( ) { Set < DcsBiosDataListener > s ; synchronized ( this ) { s = new LinkedHashSet < DcsBiosDataListener > ( dataListeners ) ; } for ( DcsBiosDataListener listener : s ) { <START_BUG> listener . dcsBioDataWrite ( address , value ) ; <END_BUG> } } private void notifySynceListeners ( ) { } }

Fix:
listener . dcsBiosDataWrite ( address , value ) ;
Buggy code:
public class BookmarkablePageLink extends Link { private static final long serialVersionUID = 1L ; private final Class pageClass ; private String pageMapName = null ; private final PageParameters parameters ; public BookmarkablePageLink ( final String id , final Class pageClass ) { } public BookmarkablePageLink ( final String id , final Class pageClass , final PageParameters parameters ) { } public final Class getPageClass ( ) { } public final PageMap getPageMap ( ) { } public boolean linksTo ( final Page page ) { } public final void onClick ( ) { } public final BookmarkablePageLink setPageMap ( final PageMap pageMap ) { } public BookmarkablePageLink setParameter ( final String property , final int value ) { } public BookmarkablePageLink setParameter ( final String property , final long value ) { } public BookmarkablePageLink setParameter ( final String property , final String value ) { } <START_BUG> protected String getURL ( ) { <END_BUG> if ( ( ( pageMapName ) != null ) && ( ( getPopupSettings ( ) ) != null ) ) { throw new IllegalStateException ( "You<seq2seq4repair_space>cannot<seq2seq4repair_space>specify<seq2seq4repair_space>popup<seq2seq4repair_space>settings<seq2seq4repair_space>and<seq2seq4repair_space>a<seq2seq4repair_space>page<seq2seq4repair_space>map" ) ; } if ( ( getPopupSettings ( ) ) != null ) { return urlFor ( getPopupSettings ( ) . getPageMap ( ) , pageClass , parameters ) ; } else { return urlFor ( getPageMap ( ) , pageClass , parameters ) ; } } }

Fix:
protected CharSequence getURL ( ) {
Buggy code:
@ Controller public class DocumentationController { @ Autowired @ SuppressWarnings ( "SpringJavaAutowiringInspection" ) private DawaModel dawaModel ; @ Autowired @ SuppressWarnings ( "SpringJavaAutowiringInspection" ) private CvrModel cvrModel ; @ RequestMapping ( "//doc//kommune" ) public ModelAndView kommune ( ) { } @ RequestMapping ( "//doc//vej" ) public ModelAndView veje ( ) { Map < String , Object > model = new HashMap < String , Object > ( ) ; VejstykkeEntity vejstykkeEntity = null ; try { <START_BUG> vejstykkeEntity = this . dawaModel . getVejstykke ( 101 , 7064 , true ) ; <END_BUG> } catch ( Exception e ) { } model . put ( "uuid" , ( vejstykkeEntity != null ? vejstykkeEntity . getUuid ( ) : "e9032c69-98bf-4e18-bc94-1a5e5f8901e4" ) ) ; model . put ( "nav" , "vej" ) ; return new ModelAndView ( "doc//vej" , model ) ; } @ RequestMapping ( "//doc//postnr" ) public ModelAndView postnr ( ) { } @ RequestMapping ( "//doc//adgangsadresse" ) public ModelAndView adgangsadresse ( ) { } @ RequestMapping ( "//doc//adresse" ) public ModelAndView adresse ( ) { } @ RequestMapping ( "//doc//lokalitet" ) public ModelAndView lokalitet ( ) { } @ RequestMapping ( "//doc//virksomhed" ) public ModelAndView virksomhed ( ) { } }

Fix:
vejstykkeEntity = this . dawaModel . getVejstykke ( 101 , 7064 ) ;
Buggy code:
public class Spout { static Logger2 log = Logger2 . getLogger ( Spout . class ) ; String id ; Link coordLink = null ; LinkManager linkManager ; Event event ; EventInstanceGenerator eventInsGenerator ; Map < String , Link > workerLinkMap = new ConcurrentHashMap < String , Link > ( 4 ) ; Map < String , Publisher > pubMap = new ConcurrentHashMap < String , Publisher > ( ) ; Spout . NewLinkHandler newLinkHandler = new Spout . NewLinkHandler ( ) ; Spout . LinkHandler linkHandler = new Spout . LinkHandler ( ) ; int batchCount = 20 ; long sendIntervalMS = 1000 ; class NewLinkHandler implements LinkManager . NewLinkListener { @ Override public void newReceivedLink ( Link link ) { } } class LinkHandler implements Link . Listener { @ Override public void connected ( Link link ) { } @ Override public void disconnected ( Link link ) { } @ Override public void received ( Link link , Object obj ) { } } class PublishRunner implements Runnable { @ Override public void run ( ) { } } public void publish ( Object [ ] objs ) { } public Spout ( String id , EventInstanceGenerator eventInsGenerator ) { } public void init ( ) { <START_BUG> sendIntervalMS = ServiceManager . getConfig ( ) . getLong ( OUTPUT_INTERVERAL_US , sendIntervalMS ) ; <END_BUG> batchCount = ( ( int ) ( ServiceManager . getConfig ( ) . getLong ( SPOUT_BATCH_COUNT , batchCount ) ) ) ; linkManager = ServiceManager . getInstance ( id ) . getLinkManager ( ) ; linkManager . init ( ) ; linkManager . setNewLinkListener ( newLinkHandler ) ; coordLink = linkManager . connect ( ServiceManager . getCoordinatorWorkerId ( ) ) ; coordLink . send ( new dist . esper . core . message . NewSpoutMessage ( id , event ) ) ; } public void start ( ) { } public void start ( boolean sync ) { } @ Override public String toString ( ) { } }

Fix:
sendIntervalMS = ( ServiceManager . getConfig ( ) . getLong ( OUTPUT_INTERVERAL_US , ( ( sendIntervalMS ) * 1000 ) ) ) // 1000 ;
Buggy code:
@ NotThreadsafe public class EventThrottler { private static final Logger logger = Logger . getLogger ( EventThrottler . class ) ; private static final long DEFAULT_CHECK_INTERVAL_MS = 50 ; private final Time time ; private final long ratesPerSecond ; private final long intervalMs ; private long startTime ; private long eventsSeenInLastInterval ; MetricsRepository metricsRepository ; Rate rate ; Sensor rateSensor ; MetricConfig rateConfig ; public EventThrottler ( long ratesPerSecond ) { } public long getRate ( ) { } public EventThrottler ( Time time , long ratePerSecond , long intervalMs ) { } public synchronized void maybeThrottle ( int eventsSeen ) { long rateLimit = getRate ( ) ; long now = time . getMilliseconds ( ) ; try { rateSensor . record ( eventsSeen , now ) ; } catch ( QuotaViolationException e ) { double currentRate = rate . measure ( rateConfig , now ) ; if ( currentRate > rateLimit ) { double excessRate = currentRate - rateLimit ; <START_BUG> long sleepTimeMs = ( Math . round ( ( excessRate // rateLimit ) ) ) * ( Time . MS_PER_SECOND ) ; <END_BUG> if ( EventThrottler . logger . isDebugEnabled ( ) ) EventThrottler . logger . debug ( ( ( ( ( ( ( "Natural<seq2seq4repair_space>rate<seq2seq4repair_space>is<seq2seq4repair_space>" + currentRate ) + "<seq2seq4repair_space>events//sec<seq2seq4repair_space>max<seq2seq4repair_space>allowed<seq2seq4repair_space>rate<seq2seq4repair_space>is<seq2seq4repair_space>" ) + rateLimit ) + "<seq2seq4repair_space>events//sec,<seq2seq4repair_space>sleeping<seq2seq4repair_space>for<seq2seq4repair_space>" ) + sleepTimeMs ) + "<seq2seq4repair_space>ms<seq2seq4repair_space>to<seq2seq4repair_space>compensate." ) ) ; try { time . sleep ( sleepTimeMs ) ; } catch ( InterruptedException ie ) { throw new VoldemortException ( ie ) ; } } else if ( EventThrottler . logger . isDebugEnabled ( ) ) { EventThrottler . logger . debug ( ( ( ( ( "Weird.<seq2seq4repair_space>Got<seq2seq4repair_space>QuotaValidationException<seq2seq4repair_space>but<seq2seq4repair_space>measured<seq2seq4repair_space>rate<seq2seq4repair_space>not<seq2seq4repair_space>over<seq2seq4repair_space>rateLimit:<seq2seq4repair_space>" + "currentRate<seq2seq4repair_space>=<seq2seq4repair_space>" ) + currentRate ) + "<seq2seq4repair_space>,<seq2seq4repair_space>rateLimit<seq2seq4repair_space>=<seq2seq4repair_space>" ) + rateLimit ) ) ; } } } }

Fix:
long sleepTimeMs = Math . round ( ( ( excessRate // rateLimit ) * ( Time . MS_PER_SECOND ) ) ) ;
Buggy code:
public final class Address { private Address ( ) { } public static boolean isDottedQuad ( String s ) { MyStringTokenizer st = new MyStringTokenizer ( s , "." ) ; int labels = 0 ; int i ; int [ ] values = new int [ 4 ] ; for ( i = 0 ; i < 4 ; i ++ ) { if ( ( st . hasMoreTokens ( ) ) == false ) break ; try { values [ i ] = Integer . parseInt ( st . nextToken ( ) ) ; } catch ( NumberFormatException e ) { break ; } if ( ( ( values [ i ] ) < 0 ) || ( ( values [ i ] ) > 255 ) ) break ; } <START_BUG> if ( i == 4 ) <END_BUG> return true ; else return false ; } public static String toDottedQuad ( byte [ ] addr ) { } public static InetAddress getByName ( String name ) throws UnknownHostException { } public static InetAddress [ ] getAllByName ( String name ) throws UnknownHostException { } public static String getHostName ( InetAddress addr ) throws UnknownHostException { } }

Fix:
if ( ( i == 4 ) && ( ! ( st . hasMoreDelimiters ( ) ) ) )
Buggy code:
public class PathRemoveHandler implements OperationStepHandler { public static final String OPERATION_NAME = REMOVE ; private final boolean services ; private final PathManagerService pathManager ; public static ModelNode getRemovePathOperation ( ModelNode address ) { } protected PathRemoveHandler ( final PathManagerService pathManager , final boolean services ) { } static PathRemoveHandler createNamedInstance ( final PathManagerService pathManager ) { } static PathRemoveHandler createSpecifiedInstance ( final PathManagerService pathManager ) { } static PathRemoveHandler createSpecifiedNoServicesInstance ( final PathManagerService pathManager ) { } public void execute ( OperationContext context , ModelNode operation ) throws OperationFailedException { final PathAddress address = PathAddress . pathAddress ( operation . require ( OP_ADDR ) ) ; final String name = address . getLastElement ( ) . getValue ( ) ; final ModelNode model = Tools . readModel ( context . readResource ( EMPTY_ADDRESS ) ) ; if ( model . get ( PathResourceDefinition . READ_ONLY . getName ( ) ) . asBoolean ( false ) ) { throw MESSAGES . cannotRemoveReadOnlyPath ( name ) ; } context . removeResource ( EMPTY_ADDRESS ) ; if ( services ) { context . addStep ( new OperationStepHandler ( ) { public void execute ( OperationContext context , ModelNode operation ) throws OperationFailedException { final PathEventContextImpl pathEventContext = pathManager . checkRestartRequired ( context , name , REMOVED ) ; if ( pathEventContext . isInstallServices ( ) ) { pathManager . removePathEntry ( name , true ) ; pathManager . removePathService ( context , name ) ; } context . completeStep ( new OperationContext . RollbackHandler ( ) { @ Override public void handleRollback ( OperationContext context , ModelNode operation ) { try { final String path = PathAddHandler . getPathValue ( context , PathResourceDefinition . PATH_SPECIFIED , model ) ; final String relativeTo = PathAddHandler . getPathValue ( context , PathResourceDefinition . RELATIVE_TO , model ) ; if ( pathEventContext . isInstallServices ( ) ) { pathManager . addPathEntry ( name , path , relativeTo , false ) ; final ServiceTarget target = context . getServiceTarget ( ) ; if ( relativeTo == null ) { pathManager . addAbsolutePathService ( target , name , path , null ) ; } else { pathManager . addRelativePathService ( target , name , path , false , relativeTo , null ) ; } } else { context . revertRestartRequired ( ) ; } } catch ( Exception e ) { ControllerLogger . MGMT_OP_LOGGER . errorRevertingOperation ( e , getClass ( ) . getSimpleName ( ) , operation . require ( OP ) . asString ( ) , PathAddress . pathAddress ( operation . get ( ModelDescriptionConstants . OP_ADDR ) ) ) ; } } } ) ; } } , RUNTIME ) ; } <START_BUG> context . completeStep ( NOOP_ROLLBACK_HANDLER ) ; <END_BUG> } }

Fix:
context . stepCompleted ( ) ;
Buggy code:
public class KnightCheck implements ICheck { private final Knight knight ; public KnightCheck ( Knight knight ) { } @ Override public void check ( Table table ) { int row = this . knight . getPosition ( ) . getRowNumber ( ) ; int column = this . knight . getPosition ( ) . getColumnNumber ( ) ; ArrayList < Integer > availableRow = new ArrayList < Integer > ( ) ; ArrayList < Integer > availableColumn = new ArrayList < Integer > ( ) ; int deltaRowDown = 2 ; int deltaRowUp = 2 ; int deltaColumnLeft = 2 ; int deltaColumnRight = 2 ; while ( ( row - deltaRowDown ) < 1 ) { deltaRowDown -- ; } while ( ( row + deltaRowUp ) > 8 ) { deltaRowUp -- ; } while ( ( column - deltaColumnLeft ) < 1 ) { deltaColumnLeft -- ; } while ( ( column + deltaColumnRight ) > 8 ) { <START_BUG> deltaColumnRight ++ ; <END_BUG> } for ( int i = 1 ; i <= deltaRowDown ; i ++ ) { availableRow . add ( ( row - i ) ) ; } for ( int i = 1 ; i <= deltaRowUp ; i ++ ) { availableRow . add ( ( row + i ) ) ; } for ( int i = 1 ; i <= deltaColumnLeft ; i ++ ) { availableColumn . add ( ( column - i ) ) ; } for ( int i = 1 ; i <= deltaColumnRight ; i ++ ) { availableColumn . add ( ( column + i ) ) ; } for ( int x : availableRow ) { for ( int y : availableColumn ) { if ( ( ( Math . abs ( ( x - row ) ) ) + ( Math . abs ( ( y - column ) ) ) ) == 3 ) { table . getSquare ( x , y ) . getCheckedBy ( ) . add ( this . knight ) ; } } } } No newline ; at end ; of file ; }

Fix:
deltaColumnRight -- ;
Buggy code:
public class DatabaseManager { private final DSLContext context ; private final String url ; private final DataSource ds ; private final Connection connection ; private final int currentVersion = 2 ; public DatabaseManager ( String userName , String password , String url , String providedDBPoolName , SQLDialect sqlDialect , boolean disableConnection ) throws SQLException , NamingException { } public void initDatabase ( ) throws IllegalStateException , SQLException { } private void checkDBVersion ( ) throws IllegalStateException { Integer dbVersion = context . select ( VERSION ) . from ( DATABASE_VERSION ) . orderBy ( TIMESTAMP . desc ( ) ) . limit ( 1 ) . fetchOptional ( ) . map ( Record1 :: value1 ) . orElseGet ( ( ) -> { context . executeInsert ( new DatabaseVersionRecord ( null , currentVersion , Timestamp . valueOf ( LocalDateTime . now ( ) ) ) ) ; return currentVersion ; } ) ; if ( dbVersion != ( currentVersion ) ) { <START_BUG> throw new IllegalStateException ( String . format ( "Database<seq2seq4repair_space>Version<seq2seq4repair_space>is<seq2seq4repair_space>%d<seq2seq4repair_space>but<seq2seq4repair_space>the<seq2seq4repair_space>object-service<seq2seq4repair_space>expects<seq2seq4repair_space>%d" , dbVersion , currentVersion ) ) ; <END_BUG> } } private void createSchemaIfNotExisting ( ) throws SQLException { } public DSLContext getContext ( ) { } public Connection getConnection ( ) { } public String getUrl ( ) { } }

Fix:
throw new IllegalStateException ( String . format ( "Database<seq2seq4repair_space>Version<seq2seq4repair_space>is<seq2seq4repair_space>%d<seq2seq4repair_space>but<seq2seq4repair_space>the<seq2seq4repair_space>worker-service<seq2seq4repair_space>expects<seq2seq4repair_space>%d" , dbVersion , currentVersion ) ) ;
Buggy code:
public class Snippet263 { static OleClientSite clientSite ; public static void main ( String [ ] args ) { Display display = new Display ( ) ; final Shell shell = new Shell ( display ) ; shell . setText ( "PowerPoint<seq2seq4repair_space>Example" ) ; shell . setLayout ( new FillLayout ( ) ) ; try { OleFrame frame = new OleFrame ( shell , SWT . NONE ) ; <START_BUG> Snippet263 . clientSite = new OleClientSite ( frame , SWT . NONE , "PowerPoint.Show" ) ; <END_BUG> Snippet263 . addFileMenu ( frame ) ; } catch ( SWTError e ) { System . out . println ( "Unable<seq2seq4repair_space>to<seq2seq4repair_space>open<seq2seq4repair_space>activeX<seq2seq4repair_space>control" ) ; return ; } shell . setSize ( 800 , 600 ) ; shell . open ( ) ; while ( ! ( shell . isDisposed ( ) ) ) { if ( ! ( display . readAndDispatch ( ) ) ) display . sleep ( ) ; } display . dispose ( ) ; } static void addFileMenu ( OleFrame frame ) { } }

Fix:
Snippet263 . clientSite = new OleClientSite ( frame , SWT . NONE , "PowerPoint.Slide" ) ;
Buggy code:
@ Repository public class FlightInfoDALImpl implements IFlightInfoDAL { private static final String SAVED_SEARCH_KEY_ID = "SAVED_SEARCH_KEY_ID" ; private static final String FLIGHT_DATA_TABLE = "FlightData" ; private static final String LOWEST_PRICE = "LOWEST_PRICE" ; private static final String SHORTEST_TIME_PRICE = "SHORTEST_TIME" ; private static final String SEARCH_DATE = "SEARCH_DATE" ; private static final String SHORTEST_PRICE_DURATION = "SHORTEST_PRICE_DURATION" ; private static final String LOWEST_PRICE_DURATION = "LOWEST_PRICE_DURATION" ; private DatastoreService dataStore ; @ PostConstruct public void setup ( ) { } @ Override public List < FlightInfo > getAllSavedFlightInfo ( ) { } @ Override public List < FlightInfo > getAllSavedFlightInfo ( FlightSearch savedSearch ) { System . out . println ( ( "Getting<seq2seq4repair_space>all<seq2seq4repair_space>saved<seq2seq4repair_space>Flight<seq2seq4repair_space>Data<seq2seq4repair_space>for<seq2seq4repair_space>search:<seq2seq4repair_space>" + savedSearch ) ) ; if ( savedSearch . getOrigin ( ) . equals ( "XXX" ) ) { System . out . println ( "Returning<seq2seq4repair_space>mocked<seq2seq4repair_space>Flight<seq2seq4repair_space>Data<seq2seq4repair_space>test<seq2seq4repair_space>search:<seq2seq4repair_space>" ) ; return this . createMockedFlightData ( ) ; } Key ancestorKey = KeyFactory . createKey ( FLIGHT_ANCESTOR_KIND , FLIGHT_ANCESTOR_ID ) ; Filter keyCompare = new com . google . appengine . api . datastore . Query . FilterPredicate ( FlightInfoDALImpl . SAVED_SEARCH_KEY_ID , FilterOperator . EQUAL , savedSearch . getKey ( ) . getId ( ) ) ; <START_BUG> Query q = new Query ( FlightInfoDALImpl . FLIGHT_DATA_TABLE ) . setAncestor ( ancestorKey ) . setFilter ( keyCompare ) . addSort ( DEPARTURE_DATE , ASCENDING ) ; <END_BUG> System . out . println ( ( "Query:<seq2seq4repair_space>" + ( q . toString ( ) ) ) ) ; List < FlightInfo > allFlightData = new ArrayList < FlightInfo > ( ) ; for ( Entity en : dataStore . prepare ( q ) . asIterable ( ) ) { if ( en != null ) { FlightInfo fd = this . createFlightDataFromEntity ( en ) ; System . out . println ( ( "Found<seq2seq4repair_space>Flight<seq2seq4repair_space>Data:<seq2seq4repair_space>" + ( fd . toString ( ) ) ) ) ; allFlightData . add ( fd ) ; } } return allFlightData ; } private Random rand = new Random ( ) ; private List < FlightInfo > createMockedFlightData ( ) { } @ Override public FlightInfo findFlightInfo ( FlightSearch savedSearch ) { } @ Override public boolean saveFlightInfo ( FlightInfo fd ) { } private FlightInfo createFlightDataFromEntity ( Entity entity ) { } @ Override public List < FlightSearch > getFlightInfoThatNeedsTracking ( List < FlightSearch > savedSearches ) { } }

Fix:
Query q = new Query ( FlightInfoDALImpl . FLIGHT_DATA_TABLE ) . setAncestor ( ancestorKey ) . setFilter ( keyCompare ) . addSort ( DEPARTURE_DATE , DESCENDING ) ;
Buggy code:
public class CoffeeMaker { private String [ ] north_door_description = new String [ ] { "Magenta" , "Beige" , "Dead" , "Vivacious" , "Purple" } ; private String [ ] south_door_description = new String [ ] { "Massive" , "Smart" , "Slim" , "Sandy" , "Minimalist" } ; private String [ ] room_items = new String [ ] { "Cream" , "Nothing" , "Coffee" , "Nothing" , "Nothing" , "Sugar" } ; private String [ ] furnishing = new String [ ] { "Quaint<seq2seq4repair_space>Sofa" , "Sad<seq2seq4repair_space>record<seq2seq4repair_space>player" , "Tight<seq2seq4repair_space>pizza" , "Flat<seq2seq4repair_space>energy<seq2seq4repair_space>drink" , "Beautiful<seq2seq4repair_space>bag<seq2seq4repair_space>of<seq2seq4repair_space>money" , "Perfect<seq2seq4repair_space>air<seq2seq4repair_space>hockey<seq2seq4repair_space>table" } ; private String [ ] room_description = new String [ ] { "Small" , "Funny" , "Refinanced" , "Dumb" , "Bloodthirsty" , "Rough" } ; private Room [ ] rooms = new Room [ room_description . length ] ; private Room currentRoom ; public static void main ( String [ ] args ) { } public Room [ ] getRooms ( ) { } public boolean setupCoffeeGame ( ) { } public String readInput ( ) { } public Room getCurrentRoom ( ) { } public String acceptCommands ( String command ) { if ( command . equals ( "N" ) ) { if ( ( currentRoom . moveNorth ( ) ) != null ) currentRoom = currentRoom . moveNorth ( ) ; return "N" ; } else if ( command . equals ( "S" ) ) { if ( ( currentRoom . moveSouth ( ) ) != null ) <START_BUG> currentRoom = currentRoom . moveNorth ( ) ; <END_BUG> return "S" ; } else if ( command . equals ( "L" ) ) { currentRoom . lookForItems ( ) ; return "L" ; } else if ( command . equals ( "H" ) ) { Room . printHelpMenu ( ) ; return "H" ; } else if ( command . equals ( "I" ) ) { currentRoom . printInventory ( ) ; return "I" ; } else if ( command . equals ( "D" ) ) { currentRoom . drink ( ) ; return "D" ; } else { System . out . println ( "What?\n" ) ; return "What?\n" ; } } public void setCurrentRoom ( Room mockRoom ) { } }

Fix:
currentRoom = currentRoom . moveSouth ( ) ;
Buggy code:
@ Named @ Singleton public class DataImportService { @ Inject private RestaurantDataDao restaurantDao ; @ Inject private MenuImportService menuSvc ; @ Inject private OrderImportService orderSvc ; public void importFromFile ( String restaurantId ) { } private List < MenuItem > parseMenu ( RestaurantData restaurantData , String json ) { } private List < Order > parseOrders ( RestaurantData restaurantData , String json ) { LinkedList < Order > orders = new LinkedList < > ( ) ; JsonArray root = new JsonParser ( ) . parse ( json ) . getAsJsonArray ( ) ; for ( JsonElement orderElement : root ) { JsonObject orderJson = orderElement . getAsJsonObject ( ) ; Order order = new Order ( ) ; order . setRestaurant ( restaurantData . getId ( ) ) ; order . setId ( orderJson . getAsJsonPrimitive ( "orderId" ) . getAsLong ( ) ) ; order . setTotalValue ( orderJson . getAsJsonPrimitive ( "totalValue" ) . getAsBigDecimal ( ) ) ; order . setItems ( new LinkedList < Item > ( ) ) ; for ( JsonElement itemElement : orderJson . get ( "lineItems" ) . getAsJsonArray ( ) ) { JsonObject itemJson = itemElement . getAsJsonObject ( ) ; if ( ! ( itemJson . has ( "id" ) ) ) { <START_BUG> Logger . debug ( ( "Skipping<seq2seq4repair_space>order<seq2seq4repair_space>item:<seq2seq4repair_space>" + ( itemJson . toString ( ) ) ) ) ; <END_BUG> continue ; } Item item = new Item ( ) ; item . setId ( Key . create ( Key . create ( restaurantData ) , MenuItem . class , String . valueOf ( itemJson . getAsJsonPrimitive ( "id" ) . getAsLong ( ) ) ) ) ; order . getItems ( ) . add ( item ) ; } orders . add ( order ) ; } return orders ; } private String readFile ( String resourceName ) { } }

Fix:
Logger . debug ( "Skipping<seq2seq4repair_space>order<seq2seq4repair_space>item:<seq2seq4repair_space>%s" , itemJson ) ;
Buggy code:
public class ServiceID extends BaseID implements IServiceID { private static final long serialVersionUID = 4362768703249025783L ; protected IServiceTypeID type ; protected String name ; protected ServiceID ( Namespace namespace , IServiceTypeID type , String name ) { } protected String getFullyQualifiedName ( ) { if ( ( name ) == null ) return type . getName ( ) ; else <START_BUG> return ( type . getName ( ) ) + ( name ) ; <END_BUG> } protected int namespaceCompareTo ( BaseID o ) { } protected boolean namespaceEquals ( BaseID o ) { } protected String namespaceGetName ( ) { } protected int namespaceHashCode ( ) { } public String getServiceType ( ) { } public IServiceTypeID getServiceTypeID ( ) { } public String getServiceName ( ) { } public String toString ( ) { } }

Fix:
return ( ( type . getName ( ) ) + "@" ) + ( name ) ;
Buggy code:
public class RecursiveBundleTrackerTest { BundleContext context ; InternalRecursiveBundleTracker sut ; @ Before public void setup ( ) { } @ After public void closeTrackes ( ) { } @ Test public void testCompositeLifeCycle ( ) { } @ Test ( expected = IllegalArgumentException . class ) public void testMissingStopping ( ) { } @ Test ( expected = IllegalArgumentException . class ) public void testMissingStarting ( ) { } @ Test ( expected = IllegalArgumentException . class ) public void testMissingInstalled ( ) { } private void assertNoTrackers ( ) { } private void assertTracker ( CompositeBundle cb ) { } private void makeSUT ( ) { BundleTrackerCustomizer customizer = Skeleton . newMock ( BundleTrackerCustomizer . class ) ; <START_BUG> sut = new InternalRecursiveBundleTracker ( context , ( ( ( ( Bundle . INSTALLED ) | ( Bundle . STARTING ) ) | ( Bundle . ACTIVE ) ) | ( Bundle . STOPPING ) ) , customizer ) ; <END_BUG> sut . open ( ) ; } private CompositeBundle composite ( String symbolicName , String version ) { } }

Fix:
sut = new InternalRecursiveBundleTracker ( context , ( ( ( ( Bundle . INSTALLED ) | ( Bundle . STARTING ) ) | ( Bundle . ACTIVE ) ) | ( Bundle . STOPPING ) ) , customizer , true ) ;