nus-yam/ex-repair huggingface dataset:
Buggy code:
public class CardsTouchProcessorSelectedState extends CardsTouchProcessorState { public static final float SELECTED_CARD_SIZE_SCALE = 1.1F ; public static final int RETURN_TO_DEFAULT_STATE_DELAY_SECONDS = 2 ; public static final float SELECTION_ANIMATION_DURATION = 0.1F ; private CardNode mSelectedCard ; private int originalSortingLayer ; private float mOriginalYPosition ; private float mInitialYOffset ; private YANDelayedTask mDelayedTask ; private long mLastTouchDownForTap ; public CardsTouchProcessorSelectedState ( CardsTouchProcessor cardsTouchProcessor ) { } @ Override public void applyState ( ) { } private void returnToDefaultState ( ) { } @ Override public boolean onTouchUp ( float normalizedX , float normalizedY ) { YANVector2 touchToWorldPoint = YANInputManager . touchToWorld ( normalizedX , normalizedY , EngineWrapper . getRenderer ( ) . getSurfaceSize ( ) . getX ( ) , EngineWrapper . getRenderer ( ) . getSurfaceSize ( ) . getY ( ) ) ; <START_BUG> YANTexturedNode touchedCard = mCardsTouchProcessor . findTouchedCard ( touchToWorldPoint ) ; <END_BUG> if ( touchedCard == ( mSelectedCard ) ) { if ( ( mCardsTouchProcessor . getCardsTouchProcessorListener ( ) ) != null ) { mDelayedTask . stop ( ) ; CardsTouchProcessorDefaultState defaultState = new CardsTouchProcessorDefaultState ( mCardsTouchProcessor ) ; mCardsTouchProcessor . setCardsTouchProcessorState ( defaultState ) ; mCardsTouchProcessor . getCardsTouchProcessorListener ( ) . onSelectedCardTap ( mSelectedCard ) ; } return true ; } return false ; } @ Override public boolean onTouchDrag ( float normalizedX , float normalizedY ) { } @ Override public boolean onTouchDown ( float normalizedX , float normalizedY ) { } public void setSelectedCard ( CardNode selectedCard ) { } public void setInitialYOffset ( float initialYOffset ) { } }

Fix:
CardNode touchedCard = mCardsTouchProcessor . findTouchedCard ( touchToWorldPoint ) ;
Buggy code:
public class VOMSErrorMessage { private final VOMSError error ; private String message ; private VOMSErrorMessage ( VOMSError e , String message ) { } private VOMSErrorMessage ( VOMSError e ) { } public String getMessage ( ) { } public void setMessage ( String message ) { } public VOMSError getError ( ) { } @ Override public String toString ( ) { } public static VOMSErrorMessage noSuchUser ( String userDN , String userCA ) { VOMSErrorMessage m = new VOMSErrorMessage ( VOMSError . NoSuchUser ) ; <START_BUG> m . setMessage ( String . format ( "No<seq2seq4repair_space>such<seq2seq4repair_space>user:<seq2seq4repair_space>subject='%s',<seq2seq4repair_space>issuer='%s'" , userDN , userCA ) ) ; <END_BUG> return m ; } public static VOMSErrorMessage noSuchAttribute ( String fqan ) { } public static VOMSErrorMessage suspendedUser ( String userDN , String userCA , String suspensionReason ) { } public static VOMSErrorMessage suspendedCertificate ( String certSubject , String certIssuer , String suspensionReason ) { } public static VOMSErrorMessage internalError ( String message ) { } public static VOMSErrorMessage endpointDisabled ( ) { } public static VOMSErrorMessage unauthenticatedClient ( ) { } }

Fix:
m . setMessage ( String . format ( "User<seq2seq4repair_space>unknown<seq2seq4repair_space>to<seq2seq4repair_space>this<seq2seq4repair_space>VO:<seq2seq4repair_space>'%s'<seq2seq4repair_space>(issued<seq2seq4repair_space>by<seq2seq4repair_space>'%s')" , userDN , userCA ) ) ;
Buggy code:
public class TarOutputStream extends FilterOutputStream { public static final int LONGFILE_ERROR = 0 ; public static final int LONGFILE_TRUNCATE = 1 ; public static final int LONGFILE_GNU = 2 ; protected boolean debug ; protected long currSize ; protected String currName ; protected long currBytes ; protected byte [ ] oneBuf ; protected byte [ ] recordBuf ; protected int assemLen ; protected byte [ ] assemBuf ; protected TarBuffer buffer ; protected int longFileMode = TarOutputStream . LONGFILE_ERROR ; private boolean closed = false ; public TarOutputStream ( OutputStream os ) { } public TarOutputStream ( OutputStream os , int blockSize ) { } public TarOutputStream ( OutputStream os , int blockSize , int recordSize ) { } public void setLongFileMode ( int longFileMode ) { } public void setDebug ( boolean debugF ) { } public void setBufferDebug ( boolean debug ) { } public void finish ( ) throws IOException { } public void close ( ) throws IOException { } public int getRecordSize ( ) { } public void putNextEntry ( TarArchiveEntry entry ) throws IOException { } public void closeEntry ( ) throws IOException { } public void write ( int b ) throws IOException { } public void write ( byte [ ] wBuf ) throws IOException { } public void write ( byte [ ] wBuf , int wOffset , int numToWrite ) throws IOException { if ( ( ( currBytes ) + numToWrite ) > ( currSize ) ) { throw new IOException ( ( ( ( ( ( ( "request<seq2seq4repair_space>to<seq2seq4repair_space>write<seq2seq4repair_space>'" + numToWrite ) + "'<seq2seq4repair_space>bytes<seq2seq4repair_space>exceeds<seq2seq4repair_space>size<seq2seq4repair_space>in<seq2seq4repair_space>header<seq2seq4repair_space>of<seq2seq4repair_space>'" ) + ( currSize ) ) + "'<seq2seq4repair_space>bytes<seq2seq4repair_space>for<seq2seq4repair_space>entry<seq2seq4repair_space>'" ) + ( currName ) ) + "'" ) ) ; } if ( ( assemLen ) > 0 ) { if ( ( ( assemLen ) + numToWrite ) >= ( recordBuf . length ) ) { int aLen = ( recordBuf . length ) - ( assemLen ) ; System . arraycopy ( assemBuf , 0 , recordBuf , 0 , assemLen ) ; System . arraycopy ( wBuf , wOffset , recordBuf , assemLen , aLen ) ; buffer . writeRecord ( recordBuf ) ; currBytes += recordBuf . length ; wOffset += aLen ; numToWrite -= aLen ; assemLen = 0 ; } else { System . arraycopy ( wBuf , wOffset , assemBuf , assemLen , numToWrite ) ; wOffset += numToWrite ; assemLen += numToWrite ; <START_BUG> numToWrite -= numToWrite ; <END_BUG> } } while ( numToWrite > 0 ) { if ( numToWrite < ( recordBuf . length ) ) { System . arraycopy ( wBuf , wOffset , assemBuf , assemLen , numToWrite ) ; assemLen += numToWrite ; break ; } buffer . writeRecord ( wBuf , wOffset ) ; int num = recordBuf . length ; currBytes += num ; numToWrite -= num ; wOffset += num ; } } private void writeEOFRecord ( ) throws IOException { } }

Fix:
numToWrite = 0 ;
Buggy code:
public class Version { private Version ( ) { } public static String id ( ) { <START_BUG> return "4.2" ; <END_BUG> } public static void main ( String [ ] args ) { } }

Fix:
return "4.3" ;
Buggy code:
class IndexOf extends Val { private final Val _val ; private final Val _args ; public IndexOf ( Val val , Val args ) { } public Class getType ( ) { } public void setImplicitType ( Class type ) { } protected Object eval ( Object candidate , Object orig , StoreContext ctx , Object [ ] params ) { Object str = _val . eval ( candidate , orig , ctx , params ) ; Object arg = _args . eval ( candidate , orig , ctx , params ) ; int idx ; if ( arg instanceof Object [ ] ) { Object [ ] args = ( ( Object [ ] ) ( arg ) ) ; idx = str . toString ( ) . indexOf ( args [ 0 ] . toString ( ) , ( ( Number ) ( args [ 1 ] ) ) . intValue ( ) ) ; } else idx = str . toString ( ) . indexOf ( arg . toString ( ) ) ; <START_BUG> return Numbers . valueOf ( idx ) ; <END_BUG> } public void acceptVisit ( ExpressionVisitor visitor ) { } }

Fix:
return idx ;
Buggy code:
@ RunWith ( Arquillian . class ) public class ExtensionsInEarDiscoveredTestCase { @ Deployment public static Archive < ? > deploy ( ) { } @ Test public void testExtensionIsLoaded ( ) throws NamingException { <START_BUG> SomeInterface bean = ( ( SomeInterface ) ( new InitialContext ( ) . lookup ( "java://global//testExtensions//testWar//WarSLSB" ) ) ) ; <END_BUG> bean . testInjectionWorked ( ) ; } }

Fix:
SomeInterface bean = ( ( SomeInterface ) ( new InitialContext ( ) . lookup ( "java:global//testExtensions//testWar//WarSLSB" ) ) ) ;
Buggy code:
class DeDupFilterSubCollector extends SubCollector { private final SubCollector delegate ; private ConcurrentHashMap < Long , AtomicReference < DeDupFilterSubCollector . Key > > keys ; private int currentDocBase ; private final String keyName ; private final String sortByFieldName ; private NumericDocValues sortByValues ; private NumericDocValues keyValues ; private int totalHits = 0 ; AtomicReaderContext context ; public DeDupFilterSubCollector ( String keyName , String sortByFieldName , SubCollector delegate , ConcurrentHashMap < Long , AtomicReference < DeDupFilterSubCollector . Key > > keys ) throws IOException { } @ Override public void setNextReader ( AtomicReaderContext context ) throws IOException { } @ Override public void collect ( int doc ) throws IOException { } @ Override public void setScorer ( Scorer scorer ) throws IOException { } @ Override public boolean acceptsDocsOutOfOrder ( ) { } @ Override public void complete ( ) throws IOException { } public int getTotalHits ( ) { } public class Key { private int docId ; private long sortByValue ; private ArrayList < Integer > duplicateDocIds = new ArrayList < Integer > ( ) ; private Key ( int docId , long sortByValue ) { } private Key ( DeDupFilterSubCollector . Key key , int docId , long sortByValue ) { } public ArrayList < Integer > getDuplicates ( ) { <START_BUG> return this . duplicateDocIds ; <END_BUG> } public int getDocId ( ) { } public long getSortByValue ( ) { } } }

Fix:
return ( ( ArrayList < Integer > ) ( this . duplicateDocIds . clone ( ) ) ) ;
Buggy code:
public abstract class UDFGSProperty extends UDFImpl { private static final Key MIN_LENGTH = KeyImpl . intern ( "minLength" ) ; private static final Key MAX_LENGTH = KeyImpl . intern ( "maxLength" ) ; private static final Key MIN = KeyImpl . intern ( "min" ) ; private static final Key MAX = KeyImpl . intern ( "max" ) ; private static final Key PATTERN = KeyImpl . intern ( "pattern" ) ; protected final FunctionArgument [ ] arguments ; protected final String name ; protected final ComponentImpl component ; public UDFGSProperty ( ComponentImpl component , String name , FunctionArgument [ ] arguments , short rtnType , String rtnFormat ) { } private static UDFPropertiesImpl UDFProperties ( PageSource pageSource , FunctionArgument [ ] arguments , int index , String functionName , short returnType , String strReturnFormat , boolean output , boolean async , String strAccess , String displayName , String description , String hint , Boolean secureJson , Boolean verifyClient , StructImpl meta ) { } public FunctionArgument [ ] getFunctionArguments ( ) { } public String getFunctionName ( ) { } public Component getOwnerComponent ( ) { } public Page getPage ( ) { } public boolean getOutput ( ) { } public int getAccess ( ) { } public String getDisplayName ( ) { } public String getDescription ( ) { } public String getHint ( ) { } public int getReturnFormat ( ) { } public int getReturnType ( ) { } public Object getValue ( ) { } public Boolean getSecureJson ( ) { } public Boolean getVerifyClient ( ) { } public DumpData toDumpData ( PageContext pageContext , int maxlevel , DumpProperties properties ) { <START_BUG> return UDFImpl . toDumpData ( pageContext , maxlevel , properties , this ) ; <END_BUG> } public Struct getMetaData ( PageContext pc ) throws PageException { } final Object cast ( FunctionArgument arg , Object value , int index ) throws PageException { } static final void validate ( String validate , Struct validateParams , Object obj ) throws PageException { } private static String createMessage ( String format , Object value ) { } }

Fix:
return UDFImpl . toDumpData ( pageContext , maxlevel , properties , this , false ) ;
Buggy code:
public class TTCCLayout extends DateLayout { private boolean threadPrinting = true ; private boolean categoryPrefixing = true ; private boolean contextPrinting = true ; protected final StringBuffer buf = new StringBuffer ( 256 ) ; public TTCCLayout ( ) { } public TTCCLayout ( String dateFormatType ) { } public void setThreadPrinting ( boolean threadPrinting ) { } public boolean getThreadPrinting ( ) { } public void setCategoryPrefixing ( boolean categoryPrefixing ) { } public boolean getCategoryPrefixing ( ) { } public void setContextPrinting ( boolean contextPrinting ) { } public boolean getContextPrinting ( ) { } public String format ( LoggingEvent event ) { buf . setLength ( 0 ) ; dateFormat ( buf , event ) ; if ( this . threadPrinting ) { buf . append ( '[' ) ; buf . append ( event . getThreadName ( ) ) ; buf . append ( "]<seq2seq4repair_space>" ) ; } buf . append ( event . level . toString ( ) ) ; buf . append ( '<seq2seq4repair_space>' ) ; if ( this . categoryPrefixing ) { <START_BUG> buf . append ( event . categoryName ) ; <END_BUG> buf . append ( '<seq2seq4repair_space>' ) ; } if ( this . contextPrinting ) { String ndc = event . getNDC ( ) ; if ( ndc != null ) { buf . append ( ndc ) ; buf . append ( '<seq2seq4repair_space>' ) ; } } buf . append ( "-<seq2seq4repair_space>" ) ; buf . append ( event . getRenderedMessage ( ) ) ; buf . append ( Layout . LINE_SEP ) ; return buf . toString ( ) ; } public boolean ignoresThrowable ( ) { } }

Fix:
buf . append ( event . loggerName ) ;
Buggy code:
class XMLFileHandler extends DefaultHandler { private static final Logger LOG = Logger . getLogger ( XMLFileHandler . class ) ; private static final String TAG_EVENT = "log4j:event" ; private static final String TAG_MESSAGE = "log4j:message" ; private static final String TAG_NDC = "log4j:NDC" ; private static final String TAG_THROWABLE = "log4j:throwable" ; private static final String TAG_LOCATION_INFO = "log4j:locationInfo" ; private final EventDetailSink mEventSink ; private int mNumEvents ; private long mTimeStamp ; private Priority mPriority ; private String mCategoryName ; private String mNDC ; private String mThreadName ; private String mMessage ; private String [ ] mThrowableStrRep ; private String mLocationDetails ; private final StringBuffer mBuf = new StringBuffer ( ) ; XMLFileHandler ( EventDetailSink aEventSink ) { } public void startDocument ( ) throws SAXException { } public void characters ( char [ ] aChars , int aStart , int aLength ) { } public void endElement ( String aNamespaceURI , String aLocalName , String aQName ) { } public void startElement ( String aNamespaceURI , String aLocalName , String aQName , Attributes aAtts ) { } int getNumEvents ( ) { } public int loadFile ( File file ) throws IOException , ParserConfigurationException , SAXException { } private void addEvent ( ) { <START_BUG> mEventSink . addEvent ( new EventDetails ( mTimeStamp , mPriority , mCategoryName , mNDC , mThreadName , mMessage , mThrowableStrRep , mLocationDetails ) ) ; <END_BUG> ( mNumEvents ) ++ ; } private void resetData ( ) { } private int loadFile ( String aFile ) throws IOException , ParserConfigurationException , SAXException { } }

Fix:
mEventSink . addEvent ( new EventDetails ( mTimeStamp , mPriority , mCategoryName , mNDC , null , mThreadName , mMessage , mThrowableStrRep , mLocationDetails ) ) ;
Buggy code:
public class JMXConnectorRemove extends AbstractSubsystemUpdate < JmxSubsystemElement , Void > { private static final long serialVersionUID = 5839017395274175195L ; protected JMXConnectorRemove ( ) { } protected void applyUpdate ( JmxSubsystemElement element ) throws UpdateFailedException { } protected < P > void applyUpdate ( UpdateContext context , UpdateResultHandler < ? super Void , P > resultHandler , P param ) { <START_BUG> final ServiceController < ? > service = context . getServiceContainer ( ) . getService ( SERVICE_NAME ) ; <END_BUG> if ( service == null ) { resultHandler . handleSuccess ( null , param ) ; } else { service . addListener ( new UpdateResultHandler . ServiceRemoveListener < P > ( resultHandler , param ) ) ; } } public AbstractSubsystemUpdate < JmxSubsystemElement , ? > getCompensatingUpdate ( JmxSubsystemElement original ) { } public Class < JmxSubsystemElement > getModelElementType ( ) { } }

Fix:
final ServiceController < ? > service = context . getServiceRegistry ( ) . getService ( SERVICE_NAME ) ;
Buggy code:
public class War extends Jar { private File deploymentDescriptor ; private boolean descriptorAdded ; public War ( ) { } public void setWarfile ( File warFile ) { log ( "DEPRECATED<seq2seq4repair_space>-<seq2seq4repair_space>The<seq2seq4repair_space>warfile<seq2seq4repair_space>attribute<seq2seq4repair_space>is<seq2seq4repair_space>deprecated.<seq2seq4repair_space>Use<seq2seq4repair_space>file<seq2seq4repair_space>attribute<seq2seq4repair_space>instead." ) ; <START_BUG> super . setFile ( warFile ) ; <END_BUG> } public void setWebxml ( File descr ) { } public void addLib ( ZipFileSet fs ) { } public void addClasses ( ZipFileSet fs ) { } public void addWebinf ( ZipFileSet fs ) { } protected void initZipOutputStream ( ZipOutputStream zOut ) throws IOException , BuildException { } protected void zipFile ( File file , ZipOutputStream zOut , String vPath ) throws IOException { } protected void cleanUp ( ) { } }

Fix:
setFile ( warFile ) ;
Buggy code:
public class LegacySSTableTest extends CleanupHelper { public static final String LEGACY_SSTABLE_PROP = "legacy-sstable-root" ; public static final String KSNAME = "Keyspace1" ; public static final String CFNAME = "Standard1" ; public static Map < byte [ ] , byte [ ] > TEST_DATA ; public static File LEGACY_SSTABLE_ROOT ; @ BeforeClass public static void beforeClass ( ) { } protected Descriptor getDescriptor ( String ver ) throws IOException { } @ Test public void testVerB ( ) throws IOException { SSTableReader reader = SSTableReader . open ( getDescriptor ( "b" ) ) ; List < byte [ ] > keys = new ArrayList < byte [ ] > ( LegacySSTableTest . TEST_DATA . keySet ( ) ) ; Collections . shuffle ( keys ) ; BufferedRandomAccessFile file = new BufferedRandomAccessFile ( reader . getFilename ( ) , "r" ) ; for ( byte [ ] key : keys ) { <START_BUG> file . seek ( reader . getPosition ( reader . partitioner . decorateKey ( key ) ) . position ) ; <END_BUG> assert Arrays . equals ( key , FBUtilities . readShortByteArray ( file ) ) ; } } }

Fix:
file . seek ( reader . getPosition ( reader . partitioner . decorateKey ( key ) ) ) ;
Buggy code:
public class DependencyManagerErrorTest extends TestCase { private SimpleRootModuleDefinition rootDefinition ; private DependencyManager manager ; @ Override protected void setUp ( ) throws Exception { } public void testOK ( ) throws Exception { } public void testModuleNotPresent ( ) throws Exception { } public void testSortHasInvalidModule ( ) throws Exception { } public void testAddModuleWithDuffDependency ( ) throws Exception { manager . addModule ( "root" , new SimpleModuleDefinition ( null , "newmodule1" , ModuleTypes . APPLICATION , null , new String [ ] { "e" } , null , null , null , null , true ) ) ; try { manager . addModule ( "root" , new SimpleModuleDefinition ( null , "newmodule2" , ModuleTypes . APPLICATION , null , new String [ ] { "duffModule" } , null , null , null , null , true ) ) ; } catch ( InvalidStateException e ) { <START_BUG> assertEquals ( "Unable<seq2seq4repair_space>to<seq2seq4repair_space>dependency<seq2seq4repair_space>named<seq2seq4repair_space>named<seq2seq4repair_space>'duffModule'<seq2seq4repair_space>for<seq2seq4repair_space>module<seq2seq4repair_space>definition<seq2seq4repair_space>'newmodule2'" , e . getMessage ( ) ) ; <END_BUG> } } private SimpleRootModuleDefinition definitionSet1 ( ) { } private void assertDuffModule ( InvalidStateException e ) { } }

Fix:
assertEquals ( "Unable<seq2seq4repair_space>to<seq2seq4repair_space>find<seq2seq4repair_space>entry<seq2seq4repair_space>for<seq2seq4repair_space>dependency<seq2seq4repair_space>named<seq2seq4repair_space>named<seq2seq4repair_space>'duffModule'<seq2seq4repair_space>for<seq2seq4repair_space>module<seq2seq4repair_space>definition<seq2seq4repair_space>'newmodule2'." , e . getMessage ( ) ) ;
Buggy code:
public class AllTests { public static Test suite ( ) { TestSuite suite = new TestSuite ( "Test<seq2seq4repair_space>for<seq2seq4repair_space>org.columba.modules.mail.parser" ) ; <START_BUG> suite . addTest ( new TestSuite ( Imap4ParserTest . class ) ) ; <END_BUG> return suite ; } }

Fix:
suite . addTest ( new TestSuite ( UIDParserTest . class ) ) ;
Buggy code:
public class Solution { public void sortColors ( int [ ] A ) { if ( null == A ) { return ; } int next = 0 ; int firstOne = - 1 ; int end = ( A . length ) - 1 ; while ( next <= end ) { if ( ( A [ next ] ) == 1 ) { if ( firstOne == ( - 1 ) ) { firstOne = next ; } next ++ ; } else if ( ( A [ next ] ) == 0 ) { if ( firstOne != ( - 1 ) ) { swap ( A , next , firstOne ) ; <START_BUG> firstOne = next ; <END_BUG> } next ++ ; } else { swap ( A , next , ( end -- ) ) ; } } } private void swap ( int [ ] A , int src , int dest ) { } No newline ; at end ; of file ; }

Fix:
firstOne += 1 ;
Buggy code:
public class KeyEvents { @ SubscribeEvent public void onKeyInput ( InputEvent . KeyInputEvent event ) { if ( debugKey . isPressed ( ) ) { <START_BUG> PerksAPI . setMovementPerk ( Minecraft . getMinecraft ( ) . thePlayer , 2.0F , 100 ) ; <END_BUG> } } No newline ; at end ; of file ; }

Fix:
movementPerks . setMovementPerk ( Minecraft . getMinecraft ( ) . thePlayer , 3.0F , 0.4F , 0.4F , 100 ) ;
Buggy code:
class CSVLexer { private static final int INITIAL_TOKEN_LENGTH = 50 ; private final CharBuffer wsBuf = new CharBuffer ( ) ; private final CSVFormat format ; private final ExtendedBufferedReader in ; static class Token { enum Type { INVALID , TOKEN , EOF , EORECORD ; } CSVLexer . Token . Type type = CSVLexer . Token . Type . INVALID ; CharBuffer content = new CharBuffer ( CSVLexer . INITIAL_TOKEN_LENGTH ) ; boolean isReady ; CSVLexer . Token reset ( ) { } } CSVLexer ( CSVFormat format , ExtendedBufferedReader in ) { } public int getLineNumber ( ) { } CSVLexer . Token nextToken ( CSVLexer . Token tkn ) throws IOException { } private CSVLexer . Token simpleTokenLexer ( CSVLexer . Token tkn , int c ) throws IOException { } private CSVLexer . Token encapsulatedTokenLexer ( CSVLexer . Token tkn , int c ) throws IOException { } private int readEscape ( int c ) throws IOException { } private boolean isWhitespace ( int c ) { <START_BUG> return ( Character . isWhitespace ( ( ( char ) ( c ) ) ) ) && ( c != ( format . getDelimiter ( ) ) ) ; <END_BUG> } private boolean isEndOfLine ( int c ) throws IOException { } private boolean isEndOfFile ( int c ) { } }

Fix:
return ( c != ( format . getDelimiter ( ) ) ) && ( Character . isWhitespace ( ( ( char ) ( c ) ) ) ) ;
Buggy code:
public class RepairManager { private static final Logger LOG = LoggerFactory . getLogger ( RepairManager . class ) ; private ScheduledExecutorService executor ; private long repairTimeoutMillis ; private long retryDelayMillis ; public long getRepairTimeoutMillis ( ) { } @ VisibleForTesting public Map < Long , RepairRunner > repairRunners = Maps . newConcurrentMap ( ) ; public void initializeThreadPool ( int threadAmount , long repairTimeout , TimeUnit repairTimeoutTimeUnit , long retryDelay , TimeUnit retryDelayTimeUnit ) { } public void resumeRunningRepairRuns ( AppContext context ) { Collection < RepairRun > running = context . storage . getRepairRunsWithState ( RUNNING ) ; for ( RepairRun repairRun : running ) { Collection < RepairSegment > runningSegments = context . storage . getSegmentsWithState ( repairRun . getId ( ) , RepairSegment . State . RUNNING ) ; for ( RepairSegment segment : runningSegments ) { try { SegmentRunner . abort ( context , segment , context . jmxConnectionFactory . connect ( segment . getCoordinatorHost ( ) ) ) ; } catch ( ReaperException e ) { RepairManager . LOG . debug ( ( "Tried<seq2seq4repair_space>to<seq2seq4repair_space>abort<seq2seq4repair_space>repair<seq2seq4repair_space>on<seq2seq4repair_space>segment<seq2seq4repair_space>{}<seq2seq4repair_space>marked<seq2seq4repair_space>as<seq2seq4repair_space>RUNNING,<seq2seq4repair_space>but<seq2seq4repair_space>the<seq2seq4repair_space>host<seq2seq4repair_space>was<seq2seq4repair_space>down" + "<seq2seq4repair_space>(so<seq2seq4repair_space>abortion<seq2seq4repair_space>won't<seq2seq4repair_space>be<seq2seq4repair_space>needed)" ) , segment . getId ( ) ) ; SegmentRunner . postpone ( context , segment ) ; } } startRepairRun ( context , repairRun ) ; } Collection < RepairRun > paused = context . storage . getRepairRunsWithState ( PAUSED ) ; for ( RepairRun pausedRepairRun : paused ) { <START_BUG> startRepairRun ( context , pausedRepairRun ) ; <END_BUG> } } public RepairRun startRepairRun ( AppContext context , RepairRun runToBeStarted ) { } private void startRunner ( AppContext context , long runId ) { } public RepairRun pauseRepairRun ( AppContext context , RepairRun runToBePaused ) { } public void scheduleRetry ( RepairRunner runner ) { } public void scheduleNextRun ( RepairRunner runner , long delay ) { } public void removeRunner ( RepairRunner runner ) { } }

Fix:
startRunner ( context , pausedRepairRun . getId ( ) ) ;
Buggy code:
public class RenderBee extends RenderLiving { private final ResourceLocation [ ] textures = new ResourceLocation [ 4 ] ; public RenderBee ( ) { } @ Override protected ResourceLocation getEntityTexture ( Entity entity ) { <START_BUG> return null ; <END_BUG> } }

Fix:
return textures [ 3 ] ;
Buggy code:
public class Master { private Name origin ; private BufferedReader br ; private File file ; private Record last = null ; private int defaultTTL = 3600 ; private Master included = null ; Master ( File file , Name defaultOrigin ) throws IOException { } public Master ( String filename , Name origin ) throws IOException { } public Master ( String filename ) throws IOException { } public Master ( BufferedReader in , Name defaultOrigin ) { } public Master ( BufferedReader in ) { } public Record nextRecord ( ) throws IOException { } private Name parseOrigin ( MyStringTokenizer st ) throws IOException { } private int parseTTL ( MyStringTokenizer st ) throws IOException { if ( ! ( st . hasMoreTokens ( ) ) ) throw new IOException ( "Missing<seq2seq4repair_space>TTL" ) ; <START_BUG> return Integer . parseInt ( st . nextToken ( ) ) ; <END_BUG> } private void parseInclude ( MyStringTokenizer st ) throws IOException { } private Record parseRR ( MyStringTokenizer st , boolean useLast , Record last , Name origin ) throws IOException { } private static String stripTrailing ( String s ) { } public static String readExtendedLine ( BufferedReader br ) throws IOException { } }

Fix:
return TTL . parseTTL ( st . nextToken ( ) ) ;
Buggy code:
public final class ObjectData implements Cloneable { private Object _oid ; private Object [ ] _data ; private Long _version ; private ClassMetaData _meta ; public ObjectData ( Object oid , ClassMetaData meta ) { } public Object getId ( ) { } public Object getField ( int num ) { } public void setField ( int num , Object val ) { } public void setVersion ( Long version ) { } public Long getVersion ( ) { } public ClassMetaData getMetaData ( ) { } public void load ( OpenJPAStateManager sm , FetchConfiguration fetch ) { } public void load ( OpenJPAStateManager sm , BitSet fields , FetchConfiguration fetch ) { } private static Object toLoadable ( OpenJPAStateManager sm , FieldMetaData fmd , Object val , FetchConfiguration fetch ) { } private static Object toNestedLoadable ( OpenJPAStateManager sm , ValueMetaData vmd , Object val , FetchConfiguration fetch ) { } public void store ( OpenJPAStateManager sm ) { _version = ( ( Long ) ( sm . getVersion ( ) ) ) ; if ( ( _version ) == null ) <START_BUG> _version = Numbers . valueOf ( 0L ) ; <END_BUG> FieldMetaData [ ] fmds = _meta . getFields ( ) ; for ( int i = 0 ; i < ( fmds . length ) ; i ++ ) { if ( ( sm . getDirty ( ) . get ( i ) ) && ( ( fmds [ i ] . getManagement ( ) ) == ( fmds [ i ] . MANAGE_PERSISTENT ) ) ) _data [ i ] = ObjectData . toStorable ( fmds [ i ] , sm . fetch ( i ) , sm . getContext ( ) ) ; } } private static Object toStorable ( FieldMetaData fmd , Object val , StoreContext ctx ) { } private static Object toNestedStorable ( ValueMetaData vmd , Object val , StoreContext ctx ) { } public Object clone ( ) { } public String toString ( ) { } }

Fix:
_version = 0L ;
Buggy code:
public class LongLiteral extends NumberLiteral { long value ; static final Constant FORMAT_ERROR = new DoubleConstant ( ( 1.0 // 0.0 ) ) ; public LongLiteral ( char [ ] token , int s , int e ) { } public LongLiteral ( char [ ] token , int s , int e , long value ) { } public void computeConstant ( ) { } public void generateCode ( BlockScope currentScope , CodeStream codeStream , boolean valueRequired ) { } public TypeBinding literalType ( BlockScope scope ) { } public final boolean mayRepresentMIN_VALUE ( ) { } public TypeBinding resolveType ( BlockScope scope ) { TypeBinding tb = super . resolveType ( scope ) ; if ( ( constant ) == ( LongLiteral . FORMAT_ERROR ) ) { constant = NotAConstant ; scope . problemReporter ( ) . constantOutOfFormat ( this ) ; <START_BUG> this . expressionType = null ; <END_BUG> return null ; } return tb ; } public void traverse ( IAbstractSyntaxTreeVisitor visitor , BlockScope scope ) { } }

Fix:
this . resolvedType = null ;
Buggy code:
public class RecoveredMethod extends RecoveredElement implements BaseTypes , CompilerModifiers , TerminalTokens { public AbstractMethodDeclaration methodDeclaration ; public RecoveredType [ ] localTypes ; public int localTypeCount ; public RecoveredBlock methodBody ; public boolean discardBody = true ; public RecoveredMethod ( AbstractMethodDeclaration methodDeclaration , RecoveredElement parent , int bracketBalance , Parser parser ) { } public RecoveredElement add ( Block nestedBlockDeclaration , int bracketBalanceValue ) { } public RecoveredElement add ( FieldDeclaration fieldDeclaration , int bracketBalanceValue ) { } public RecoveredElement add ( LocalDeclaration localDeclaration , int bracketBalanceValue ) { } public RecoveredElement add ( Statement statement , int bracketBalanceValue ) { } public RecoveredElement add ( TypeDeclaration typeDeclaration , int bracketBalanceValue ) { if ( ( ( methodDeclaration . declarationSourceEnd ) != 0 ) && ( ( typeDeclaration . declarationSourceStart ) > ( methodDeclaration . declarationSourceEnd ) ) ) { if ( ( this . parent ) == null ) { return this ; } return this . parent . add ( typeDeclaration , bracketBalanceValue ) ; } if ( ( ( typeDeclaration . bits ) & ( IsLocalTypeMASK ) ) != 0 ) { if ( ( methodBody ) == null ) { Block block = new Block ( 0 ) ; block . sourceStart = methodDeclaration . bodyStart ; this . add ( block , 1 ) ; } return methodBody . add ( typeDeclaration , bracketBalanceValue , true ) ; } <START_BUG> if ( ( typeDeclaration . kind ( ) ) == ( INTERFACE ) ) { <END_BUG> this . updateSourceEndIfNecessary ( this . previousAvailableLineEnd ( ( ( typeDeclaration . declarationSourceStart ) - 1 ) ) ) ; if ( ( this . parent ) == null ) { return this ; } return this . parent . add ( typeDeclaration , bracketBalanceValue ) ; } if ( ( localTypes ) == null ) { localTypes = new RecoveredType [ 5 ] ; localTypeCount = 0 ; } else { if ( ( localTypeCount ) == ( localTypes . length ) ) { System . arraycopy ( localTypes , 0 , ( localTypes = new RecoveredType [ 2 * ( localTypeCount ) ] ) , 0 , localTypeCount ) ; } } RecoveredType element = new RecoveredType ( typeDeclaration , this , bracketBalanceValue ) ; localTypes [ ( ( localTypeCount ) ++ ) ] = element ; if ( ! ( foundOpeningBrace ) ) { foundOpeningBrace = true ; ( this . bracketBalance ) ++ ; } return element ; } public boolean bodyStartsAtHeaderEnd ( ) { } public ASTNode parseTree ( ) { } public int sourceEnd ( ) { } public String toString ( int tab ) { } public void updateBodyStart ( int bodyStart ) { } public AbstractMethodDeclaration updatedMethodDeclaration ( ) { } public void updateFromParserState ( ) { } public RecoveredElement updateOnOpeningBrace ( int braceStart , int braceEnd ) { } public void updateParseTree ( ) { } public void updateSourceEndIfNecessary ( int braceStart , int braceEnd ) { } }

Fix:
if ( ( typeDeclaration . kind ( ) ) == ( INTERFACE_DECL ) ) {
Buggy code:
public class ExtensionResource implements Resource . ResourceEntry { private static final Set < String > CHILD_TYPES = Collections . unmodifiableSet ( new HashSet < String > ( Arrays . asList ( SUBSYSTEM ) ) ) ; private final String moduleName ; private final ExtensionRegistry extensionRegistry ; public ExtensionResource ( String moduleName , ExtensionRegistry extensionRegistry ) { } @ Override public String getName ( ) { } @ Override public PathElement getPathElement ( ) { } @ Override public ModelNode getModel ( ) { final ModelNode model = new ModelNode ( ) ; model . get ( MODULE . getName ( ) ) . set ( moduleName ) ; return model ; } @ Override public void writeModel ( ModelNode newModel ) { } @ Override public boolean isModelDefined ( ) { } @ Override public boolean hasChild ( PathElement element ) { } @ Override public Resource getChild ( PathElement element ) { } @ Override public Resource requireChild ( PathElement element ) { } @ Override public boolean hasChildren ( String childType ) { } @ Override public Resource navigate ( PathAddress address ) { } @ Override public Set < String > getChildTypes ( ) { } @ Override public Set < String > getChildrenNames ( String childType ) { } @ Override public Set < ResourceEntry > getChildren ( String childType ) { } @ Override public void registerChild ( PathElement address , Resource resource ) { } @ Override public Resource removeChild ( PathElement address ) { } @ Override public boolean isRuntime ( ) { } @ Override public boolean isProxy ( ) { } @ Override public ExtensionResource clone ( ) { } private static class SubsystemResource extends PlaceholderResource . PlaceholderResourceEntry { private final SubsystemInformation subsystemInformation ; public SubsystemResource ( final String name , ExtensionRegistry . SubsystemInformation subsystemInformation ) { } @ Override public ModelNode getModel ( ) { final ModelNode model = new ModelNode ( ) ; final ModelNode majorNode = model . get ( MAJOR_VERSION . getName ( ) ) ; Integer major = subsystemInformation . getManagementInterfaceMajorVersion ( ) ; if ( major != null ) { majorNode . set ( major . intValue ( ) ) ; } final ModelNode minorNode = model . get ( MINOR_VERSION . getName ( ) ) ; <START_BUG> Integer minor = subsystemInformation . getManagementInterfaceMajorVersion ( ) ; <END_BUG> if ( minor != null ) { minorNode . set ( minor . intValue ( ) ) ; } final ModelNode xmlNode = model . get ( XML_NAMESPACES . getName ( ) ) . setEmptyList ( ) ; List < String > namespaces = subsystemInformation . getXMLNamespaces ( ) ; if ( namespaces != null ) { for ( String namespace : namespaces ) { xmlNode . add ( namespace ) ; } } return model ; } @ Override public boolean isModelDefined ( ) { } @ Override public PlaceholderResourceEntry clone ( ) { } } }

Fix:
Integer minor = subsystemInformation . getManagementInterfaceMinorVersion ( ) ;
Buggy code:
public abstract class UMLComboBoxModel2 extends AbstractListModel implements ComboBoxModel , MElementListener { private static Category log = Category . getInstance ( "org.argouml.uml.ui.UMLComboBoxModel2" ) ; protected Object _target = null ; private List _objects = Collections . synchronizedList ( new ArrayList ( ) ) ; private Object _selectedObject = null ; private boolean _clearable = false ; protected String _propertySetName ; protected boolean _fireListEvents = true ; public UMLComboBoxModel2 ( String propertySetName , boolean clearable ) { } public void listRoleItemSet ( MElementEvent e ) { } public void propertySet ( MElementEvent e ) { } public void recovered ( MElementEvent e ) { } public void removed ( MElementEvent e ) { } public void roleAdded ( MElementEvent e ) { <START_BUG> if ( isValidEvent ( e ) ) { <END_BUG> Object o = getChangedElement ( e ) ; if ( o instanceof Collection ) { UMLComboBoxModel2 . log . warn ( ( "Collection<seq2seq4repair_space>added<seq2seq4repair_space>via<seq2seq4repair_space>roleAdded!<seq2seq4repair_space>The<seq2seq4repair_space>correct<seq2seq4repair_space>element" + "is<seq2seq4repair_space>probably<seq2seq4repair_space>not<seq2seq4repair_space>selected..." ) ) ; Iterator it = ( ( Collection ) ( o ) ) . iterator ( ) ; while ( it . hasNext ( ) ) { Object o2 = it . next ( ) ; addElement ( it . next ( ) ) ; } } else { addElement ( o ) ; } } } public void roleRemoved ( MElementEvent e ) { } public void targetChanged ( Object newTarget ) { } public void targetReasserted ( Object newTarget ) { } protected abstract boolean isValidElement ( Object element ) { } protected abstract void buildModelList ( ) { } protected void setElements ( Collection elements ) { } protected Object getTarget ( ) { } protected void removeAll ( Collection col ) { } protected void addAll ( Collection col ) { } protected Object getChangedElement ( MElementEvent e ) { } protected void setTarget ( Object target ) { } protected abstract Object getSelectedModelElement ( ) { } public Object getElementAt ( int index ) { } public int getSize ( ) { } public int getIndexOf ( Object o ) { } public void addElement ( Object o ) { } public void setSelectedItem ( Object o ) { } public void removeElement ( Object o ) { } public void removeAllElements ( ) { } public Object getSelectedItem ( ) { } public boolean contains ( Object elem ) { } protected boolean isValidEvent ( MElementEvent e ) { } protected void fireContentsChanged ( Object source , int index0 , int index1 ) { } protected void fireIntervalAdded ( Object source , int index0 , int index1 ) { } protected void fireIntervalRemoved ( Object source , int index0 , int index1 ) { } }

Fix:
if ( ( ( getTarget ( ) ) != null ) && ( isValidEvent ( e ) ) ) {
Buggy code:
class CLabelTab extends AlignableTab { CLabel label1 ; CLabel label2 ; CLabel label3 ; Group textLabelGroup ; Button shadowInButton ; Button shadowOutButton ; Button shadowNoneButton ; CLabelTab ( ControlExample instance ) { } void createExampleGroup ( ) { } void createExampleWidgets ( ) { int style = getDefaultStyle ( ) ; if ( shadowInButton . getSelection ( ) ) style |= SWT . SHADOW_IN ; if ( shadowNoneButton . getSelection ( ) ) style |= SWT . SHADOW_NONE ; if ( shadowOutButton . getSelection ( ) ) style |= SWT . SHADOW_OUT ; if ( leftButton . getSelection ( ) ) style |= SWT . LEFT ; if ( centerButton . getSelection ( ) ) style |= SWT . CENTER ; if ( rightButton . getSelection ( ) ) style |= SWT . RIGHT ; label1 = new CLabel ( textLabelGroup , style ) ; label1 . setText ( ControlExample . getResourceString ( "One" ) ) ; label1 . setImage ( instance . images [ ControlExample . ciClosedFolder ] ) ; label2 = new CLabel ( textLabelGroup , style ) ; label2 . setImage ( instance . images [ ControlExample . ciTarget ] ) ; label3 = new CLabel ( textLabelGroup , style ) ; <START_BUG> label3 . setText ( ControlExample . getResourceString ( "Example_string" ) ) ; <END_BUG> } void createStyleGroup ( ) { } Control [ ] getExampleWidgets ( ) { } String [ ] getMethodNames ( ) { } String getTabText ( ) { } void setExampleWidgetAlignment ( ) { } void setExampleWidgetState ( ) { } }

Fix:
label3 . setText ( ( ( ( ControlExample . getResourceString ( "Example_string" ) ) + "\n" ) + ( ControlExample . getResourceString ( "One_Two_Three" ) ) ) ) ;
Buggy code:
public class Initiator extends Thread { private Document fDocument ; private SimpleMessageQueue queue ; private SimpleMessageQueue receiverQueue ; private IModelSynchronizationStrategy initiator ; public Initiator ( IModelSynchronizationStrategy initiator , Document document ) { } public void run ( ) { for ( int i = 0 ; i < 10 ; i ++ ) { String text = fDocument . get ( ) ; String newText = ">" ; text = text . concat ( newText ) ; fDocument . set ( text ) ; <START_BUG> IModelChange change = new DocumentChangeMessage ( ( i + 150 ) , 1 , newText ) ; <END_BUG> IModelChangeMessage [ ] changes = initiator . registerLocalChange ( change ) ; getReceiverQueue ( ) . put ( changes ) ; } } protected void setInitiator ( IModelSynchronizationStrategy initiator ) { } public IModelSynchronizationStrategy getInitiator ( ) { } public void setDocument ( Document document ) { } public Document getDocument ( ) { } public SimpleMessageQueue getQueue ( ) { } public void setReceiverQueue ( SimpleMessageQueue receiverQueue ) { } public SimpleMessageQueue getReceiverQueue ( ) { } }

Fix:
IModelChange change = new DocumentChangeMessage ( ( i + 150 ) , newText . length ( ) , newText ) ;
Buggy code:
public class NTEventLogAppender extends AppenderSkeleton { private int _handle = 0 ; public static final String SOURCE_OPTION = "Source" ; private String source = null ; private String server = null ; private static final int FATAL = Priority . FATAL . toInt ( ) ; private static final int ERROR = Priority . ERROR . toInt ( ) ; private static final int WARN = Priority . WARN . toInt ( ) ; private static final int INFO = Priority . INFO . toInt ( ) ; private static final int DEBUG = Priority . DEBUG . toInt ( ) ; public NTEventLogAppender ( ) { } public NTEventLogAppender ( String source ) { } public NTEventLogAppender ( String server , String source ) { } public NTEventLogAppender ( Layout layout ) { } public NTEventLogAppender ( String source , Layout layout ) { } public NTEventLogAppender ( String server , String source , Layout layout ) { } public String [ ] getOptionStrings ( ) { } public void setOption ( String key , String value ) { } public void close ( ) { } public void activateOptions ( ) { } public void append ( LoggingEvent event ) { StringBuffer sbuf = new StringBuffer ( ) ; sbuf . append ( layout . format ( event ) ) ; if ( layout . ignoresThrowable ( ) ) { String [ ] s = event . getThrowableStrRep ( ) ; if ( s != null ) { int len = s . length ; for ( int i = 0 ; i < len ; i ++ ) { <START_BUG> sbuf . append ( s [ 0 ] ) ; <END_BUG> } } } int nt_category = event . priority . toInt ( ) ; reportEvent ( _handle , sbuf . toString ( ) , nt_category ) ; } public void finalize ( ) { } public void setSource ( String source ) { } public String getSource ( ) { } public boolean requiresLayout ( ) { } private native int registerEventSource ( String server , String source ) { } private native void reportEvent ( int handle , String message , int priority ) { } private native void deregisterEventSource ( int handle ) { } }

Fix:
sbuf . append ( s [ i ] ) ;
Buggy code:
class JarPackageFragment extends PackageFragment implements SuffixConstants { protected JarPackageFragment ( IPackageFragmentRoot root , String name ) { } protected boolean computeChildren ( OpenableElementInfo info ) { JarPackageFragmentInfo jInfo = ( ( JarPackageFragmentInfo ) ( info ) ) ; if ( ( jInfo . fEntryNames ) != null ) { ArrayList vChildren = new ArrayList ( ) ; for ( Iterator iter = jInfo . fEntryNames . iterator ( ) ; iter . hasNext ( ) ; ) { String child = ( ( String ) ( iter . next ( ) ) ) ; IClassFile classFile = getClassFile ( child ) ; vChildren . add ( classFile ) ; } IJavaElement [ ] children = new IJavaElement [ vChildren . size ( ) ] ; vChildren . toArray ( children ) ; info . setChildren ( children ) ; } else { <START_BUG> info . setChildren ( fgEmptyChildren ) ; <END_BUG> } return true ; } void computeNonJavaResources ( String [ ] resNames , JarPackageFragmentInfo info , String zipName ) { } public boolean containsJavaResources ( ) throws JavaModelException { } public ICompilationUnit createCompilationUnit ( String name , String contents , boolean force , IProgressMonitor monitor ) throws JavaModelException { } protected OpenableElementInfo createElementInfo ( ) { } public IClassFile [ ] getClassFiles ( ) throws JavaModelException { } public ICompilationUnit [ ] getCompilationUnits ( ) throws JavaModelException { } public IResource getCorrespondingResource ( ) throws JavaModelException { } public Object [ ] getNonJavaResources ( ) throws JavaModelException { } public boolean isReadOnly ( ) { } protected OpenableElementInfo openWhenClosed ( IProgressMonitor pm ) throws JavaModelException { } public void refreshChildren ( ) { } public IJavaElement rootedAt ( IJavaProject project ) { } protected Object [ ] storedNonJavaResources ( ) throws JavaModelException { } }

Fix:
info . setChildren ( NO_CHILDREN ) ;
Buggy code:
public class AcceptanceStory { private static final Money INITIAL_MONEY = new Money ( 50 ) ; public static final Money PRICE_1 = new Money ( 10 ) ; public static final Money PRICE_2 = new Money ( 20 ) ; public static final Money PRICE_3 = new Money ( 30 ) ; public static final Money TOTAL_COST = AcceptanceStory . PRICE_1 . add ( AcceptanceStory . PRICE_2 ) . add ( AcceptanceStory . PRICE_3 ) ; public static final Money CREDIT_LIMIT = AcceptanceStory . TOTAL_COST . substract ( AcceptanceStory . INITIAL_MONEY ) ; private ProductsCatalog productsCatalog = new ProductsCatalog ( ) ; private ClientManagement clientManagement = new ClientManagement ( ) ; private LightBoxManagement lightBoxManagement = new LightBoxManagement ( ) ; private PurchaseProcess purchaseProcess = new PurchaseProcess ( ) ; private AdminPanel adminPanel = new AdminPanel ( ) ; @ Test public void story ( ) { adminPanel . addPicture ( AcceptanceStory . PRICE_1 , new String [ ] { "ford" , "mustang" } ) ; adminPanel . addPicture ( AcceptanceStory . PRICE_2 , new String [ ] { "bmw" , "m6" } ) ; adminPanel . addPicture ( AcceptanceStory . PRICE_3 , new String [ ] { "fiat" , "multipla" } ) ; <START_BUG> adminPanel . addPicture ( AcceptanceStory . PRICE_3 , new String [ ] { "lamborgnini" , "huracan" } ) ; <END_BUG> String clientNr = clientManagement . register ( "nazwa<seq2seq4repair_space>1" , "login<seq2seq4repair_space>1" , "email@server.com" , "addresss" ) ; clientManagement . recharge ( clientNr , AcceptanceStory . INITIAL_MONEY ) ; adminPanel . promoteClient ( clientNr ) ; adminPanel . changeCreditLimit ( clientNr , AcceptanceStory . CREDIT_LIMIT ) ; List < Product > products = productsCatalog . find ( null , null , null , null ) ; String lightBoxNr = lightBoxManagement . createLightbox ( clientNr , "lightbox<seq2seq4repair_space>1" ) ; lightBoxManagement . add ( products . get ( 0 ) . getNumber ( ) , lightBoxNr ) ; purchaseProcess . add ( clientNr , products . get ( 1 ) . getNumber ( ) ) ; purchaseProcess . add ( clientNr , products . get ( 2 ) . getNumber ( ) ) ; purchaseProcess . add ( clientNr , products . get ( 3 ) . getNumber ( ) ) ; lightBoxManagement . addAllToReservation ( lightBoxNr ) ; adminPanel . changeAvability ( products . get ( 3 ) . getNumber ( ) , false ) ; Offer offer = purchaseProcess . calculateOffer ( clientNr ) ; Assert . assertEquals ( AcceptanceStory . TOTAL_COST , offer . getTotalCost ( ) ) ; purchaseProcess . confirm ( clientNr ) ; List < Purchase > purchases = clientManagement . findPurchases ( clientNr ) ; Assert . assertEquals ( 1 , purchases . size ( ) ) ; } }

Fix:
adminPanel . addPicture ( AcceptanceStory . PRICE_3 , new String [ ] { "lamborghini" , "huracan" } ) ;
Buggy code:
public class Board { private ArrayList < Mark > cells ; public Board ( ) { } public List < Mark > getCells ( ) { } public Mark getMarkAt ( int position ) { } public void mark ( int position , Mark mark ) { } public List < Integer > availableMoves ( ) { } public boolean isUnplayable ( ) { } public boolean hasWinner ( ) { } public Mark getWinningMark ( ) { } public boolean isDraw ( ) { } private boolean isEmptyCell ( int position ) { } public boolean isFull ( ) { <START_BUG> for ( int i = 1 ; i < ( cells . size ( ) ) ; i ++ ) { <END_BUG> if ( isEmptyCell ( i ) ) { return false ; } } return true ; } public boolean isEmpty ( ) { } }

Fix:
for ( int i = 0 ; i < ( cells . size ( ) ) ; i ++ ) {