nus-yam/ex-repair huggingface dataset:
Buggy code:
public class TimeFunction extends AbstractFunction implements Serializable { private static final long serialVersionUID = 1L ; private static final String KEY = "__time" ; private static final List desc = new LinkedList ( ) ; private static final Map aliases = new HashMap ( ) ; private transient String format = "" ; private transient String variable = "" ; private Object readResolve ( ) { } public TimeFunction ( ) { } public Object clone ( ) throws CloneNotSupportedException { } public synchronized String execute ( SampleResult previousResult , Sampler currentSampler ) throws InvalidVariableException { } public synchronized void setParameters ( Collection parameters ) throws InvalidVariableException { checkParameterCount ( parameters , 0 , 2 ) ; Object [ ] values = parameters . toArray ( ) ; int count = values . length ; if ( count > 0 ) { format = ( ( org . apache . jmeter . engine . util . CompoundVariable ) ( values [ 0 ] ) ) . execute ( ) ; } if ( count > 1 ) { <START_BUG> variable = ( ( org . apache . jmeter . engine . util . CompoundVariable ) ( values [ 1 ] ) ) . execute ( ) ; <END_BUG> } } public String getReferenceKey ( ) { } public List getArgumentDesc ( ) { } }

Fix:
variable = ( ( org . apache . jmeter . engine . util . CompoundVariable ) ( values [ 1 ] ) ) . execute ( ) . trim ( ) ;
Buggy code:
public class FastSineTransformer implements RealTransformer { public FastSineTransformer ( ) { } public double [ ] transform ( double [ ] f ) throws IllegalArgumentException { } public double [ ] transform ( UnivariateFunction f , double min , double max , int n ) throws IllegalArgumentException { } public double [ ] transform2 ( double [ ] f ) throws IllegalArgumentException { } public double [ ] transform2 ( UnivariateFunction f , double min , double max , int n ) throws IllegalArgumentException { } public double [ ] inverseTransform ( double [ ] f ) throws IllegalArgumentException { } public double [ ] inverseTransform ( UnivariateFunction f , double min , double max , int n ) throws IllegalArgumentException { } public double [ ] inverseTransform2 ( double [ ] f ) throws IllegalArgumentException { } public double [ ] inverseTransform2 ( UnivariateFunction f , double min , double max , int n ) throws IllegalArgumentException { } protected double [ ] fst ( double [ ] f ) throws IllegalArgumentException { final double [ ] transformed = new double [ f . length ] ; FastFourierTransformer . verifyDataSet ( f ) ; if ( ( f [ 0 ] ) != 0.0 ) { throw MathRuntimeException . createIllegalArgumentException ( FIRST_ELEMENT_NOT_ZERO , f [ 0 ] ) ; } final int n = f . length ; if ( n == 1 ) { transformed [ 0 ] = 0.0 ; return transformed ; } final double [ ] x = new double [ n ] ; x [ 0 ] = 0.0 ; x [ ( n > > 1 ) ] = 2.0 * ( f [ ( n > > 1 ) ] ) ; for ( int i = 1 ; i < ( n > > 1 ) ; i ++ ) { final double a = ( FastMath . sin ( ( ( i * ( FastMath . PI ) ) // n ) ) ) * ( ( f [ i ] ) + ( f [ ( n - i ) ] ) ) ; final double b = 0.5 * ( ( f [ i ] ) - ( f [ ( n - i ) ] ) ) ; x [ i ] = a + b ; x [ ( n - i ) ] = a - b ; } <START_BUG> FastFourierTransformer transformer = new FastFourierTransformer ( ) ; <END_BUG> Complex [ ] y = transformer . transform ( x ) ; transformed [ 0 ] = 0.0 ; transformed [ 1 ] = 0.5 * ( y [ 0 ] . getReal ( ) ) ; for ( int i = 1 ; i < ( n > > 1 ) ; i ++ ) { transformed [ ( 2 * i ) ] = - ( y [ i ] . getImaginary ( ) ) ; transformed [ ( ( 2 * i ) + 1 ) ] = ( y [ i ] . getReal ( ) ) + ( transformed [ ( ( 2 * i ) - 1 ) ] ) ; } return transformed ; } }

Fix:
FastFourierTransformer transformer = FastFourierTransformer . create ( ) ;
Buggy code:
public class CoolBar extends Composite { CoolItem [ ] [ ] items = new CoolItem [ 0 ] [ 0 ] ; CoolItem [ ] originalItems = new CoolItem [ 0 ] ; Cursor hoverCursor ; Cursor dragCursor ; Cursor cursor ; CoolItem dragging = null ; int mouseXOffset ; int itemXOffset ; boolean isLocked = false ; boolean inDispose = false ; static final int ROW_SPACING = 2 ; static final int CLICK_DISTANCE = 3 ; public CoolBar ( Composite parent , int style ) { } private static int checkStyle ( int style ) { } void _setCursor ( Cursor cursor ) { } protected void checkSubclass ( ) { } public Point computeSize ( int wHint , int hHint , boolean changed ) { } CoolItem getGrabbedItem ( int x , int y ) { } public CoolItem getItem ( int index ) { } public int getItemCount ( ) { } public CoolItem [ ] getItems ( ) { } Point findItem ( CoolItem item ) { } void fixEvent ( Event event ) { } Rectangle fixRectangle ( int x , int y , int width , int height ) { } Point fixPoint ( int x , int y ) { } public int indexOf ( CoolItem item ) { } void insertItemIntoRow ( CoolItem item , int rowIndex , int x_root ) { } void internalRedraw ( int x , int y , int width , int height ) { } void createItem ( CoolItem item , int index ) { } void destroyItem ( CoolItem item ) { } void moveDown ( CoolItem item , int x_root ) { } void moveLeft ( CoolItem item , int pixels ) { } void moveRight ( CoolItem item , int pixels ) { } void moveUp ( CoolItem item , int x_root ) { } void onDispose ( Event event ) { } void onMouseDown ( Event event ) { if ( ( isLocked ) || ( ( event . button ) != 1 ) ) return ; fixEvent ( event ) ; dragging = getGrabbedItem ( event . x , event . y ) ; if ( ( dragging ) != null ) { mouseXOffset = event . x ; itemXOffset = ( mouseXOffset ) - ( dragging . internalGetBounds ( ) . x ) ; <START_BUG> setCursor ( dragCursor ) ; <END_BUG> } fixEvent ( event ) ; } void onMouseExit ( ) { } void onMouseMove ( Event event ) { } void onMouseUp ( Event event ) { } void onMouseDoubleClick ( Event event ) { } void onPaint ( Event event ) { } void onResize ( ) { } void removeControl ( Control control ) { } void removeItemFromRow ( CoolItem item , int rowIndex , boolean disposed ) { } int layoutItems ( ) { } void relayout ( ) { } public int [ ] getItemOrder ( ) { } void setItemOrder ( int [ ] itemOrder ) { } public Point [ ] getItemSizes ( ) { } void setItemSizes ( Point [ ] sizes ) { } public boolean getLocked ( ) { } int getWidth ( ) { } public int [ ] getWrapIndices ( ) { } public void setLocked ( boolean locked ) { } public void setWrapIndices ( int [ ] indices ) { } public void setCursor ( Cursor cursor ) { } public void setItemLayout ( int [ ] itemOrder , int [ ] wrapIndices , Point [ ] sizes ) { } void wrapItems ( int maxWidth ) { } }

Fix:
_setCursor ( dragCursor ) ;
Buggy code:
public class ReceiptCapturer implements Runnable { private int error_count = 0 ; private static volatile boolean shouldRun = true ; private ServerSocket server = null ; private Socket client = null ; private boolean popupCalled = false ; private final byte RECEIPT_INDICATOR = 7 ; private MPAIntentService service ; public ReceiptCapturer ( MPAIntentService service ) { } public void terminate ( ) { } public void restart ( ) { if ( ( error_count ) >= 5 ) { <START_BUG> VirtualPrinter . restartService ( ) ; <END_BUG> return ; } ( error_count ) ++ ; terminate ( ) ; run ( ) ; } public static Boolean isRunning ( ) { } @ Override public void run ( ) { } public void processInput ( Socket client ) { } public void callServer ( ) { } }

Fix:
service . restartService ( ) ;
Buggy code:
public class PerObject extends PerClause { private boolean isThis ; private Pointcut entry ; private static final Set thisKindSet = new HashSet ( Shadow . ALL_SHADOW_KINDS ) ; private static final Set targetKindSet = new HashSet ( Shadow . ALL_SHADOW_KINDS ) ; public PerObject ( Pointcut entry , boolean isThis ) { } public Object accept ( PatternNodeVisitor visitor , Object data ) { } public Set couldMatchKinds ( ) { } public FuzzyBoolean fastMatch ( FastMatchInfo type ) { } public FuzzyBoolean fastMatch ( Class targetType ) { } protected FuzzyBoolean matchInternal ( Shadow shadow ) { } public void resolveBindings ( IScope scope , Bindings bindings ) { } private Var getVar ( Shadow shadow ) { } protected Test findResidueInternal ( Shadow shadow , ExposedState state ) { } public PerClause concretize ( ResolvedType inAspect ) { PerObject ret = new PerObject ( entry , isThis ) ; ret . inAspect = inAspect ; if ( inAspect . isAbstract ( ) ) return ret ; World world = inAspect . getWorld ( ) ; <START_BUG> Pointcut concreteEntry = entry . concretize ( inAspect , 0 , null ) ; <END_BUG> inAspect . crosscuttingMembers . addConcreteShadowMunger ( Advice . makePerObjectEntry ( world , concreteEntry , isThis , inAspect ) ) ; ResolvedTypeMunger munger = new org . aspectj . weaver . PerObjectInterfaceTypeMunger ( inAspect , concreteEntry ) ; inAspect . crosscuttingMembers . addLateTypeMunger ( world . concreteTypeMunger ( munger , inAspect ) ) ; if ( ( inAspect . isAnnotationStyleAspect ( ) ) && ( ! ( inAspect . isAbstract ( ) ) ) ) { inAspect . crosscuttingMembers . addLateTypeMunger ( inAspect . getWorld ( ) . makePerClauseAspect ( inAspect , getKind ( ) ) ) ; } if ( ( inAspect . isAnnotationStyleAspect ( ) ) && ( ! ( inAspect . getWorld ( ) . isXnoInline ( ) ) ) ) { inAspect . crosscuttingMembers . addTypeMunger ( new org . aspectj . weaver . bcel . BcelAccessForInlineMunger ( inAspect ) ) ; } return ret ; } public void write ( DataOutputStream s ) throws IOException { } public static PerClause readPerClause ( VersionedDataInputStream s , ISourceContext context ) throws IOException { } public Kind getKind ( ) { } public boolean isThis ( ) { } public String toString ( ) { } public String toDeclarationString ( ) { } }

Fix:
Pointcut concreteEntry = entry . concretize ( inAspect , inAspect , 0 , null ) ;
Buggy code:
public class XMLLayout extends Layout { public static final String LOCATION_INFO_OPTION = "LocationInfo" ; private final int DEFAULT_SIZE = 256 ; private final int UPPER_LIMIT = 2048 ; private StringBuffer buf = new StringBuffer ( DEFAULT_SIZE ) ; private boolean locationInfo = false ; public String [ ] getOptionStrings ( ) { } public void setOption ( String key , String value ) { } public void setLocationInfo ( boolean flag ) { } public boolean getLocationInfo ( ) { } public void activateOptions ( ) { } public String format ( LoggingEvent event ) { if ( ( buf . capacity ( ) ) > ( UPPER_LIMIT ) ) { buf = new StringBuffer ( DEFAULT_SIZE ) ; } else { buf . setLength ( 0 ) ; } buf . append ( "<log4j:event<seq2seq4repair_space>category=\"" ) ; <START_BUG> buf . append ( event . loggerName ) ; <END_BUG> buf . append ( "\"<seq2seq4repair_space>timestamp=\"" ) ; buf . append ( event . timeStamp ) ; buf . append ( "\"<seq2seq4repair_space>level=\"" ) ; buf . append ( event . level ) ; buf . append ( "\"<seq2seq4repair_space>thread=\"" ) ; buf . append ( event . getThreadName ( ) ) ; buf . append ( "\">\r\n" ) ; buf . append ( "<log4j:message><![CDATA[" ) ; buf . append ( event . getRenderedMessage ( ) ) ; buf . append ( "]]><//log4j:message>\r\n" ) ; String ndc = event . getNDC ( ) ; if ( ndc != null ) { buf . append ( "<log4j:NDC><![CDATA[" ) ; buf . append ( ndc ) ; buf . append ( "]]><//log4j:NDC>\r\n" ) ; } String [ ] s = event . getThrowableStrRep ( ) ; if ( s != null ) { buf . append ( "<log4j:throwable><![CDATA[" ) ; for ( int i = 0 ; i < ( s . length ) ; i ++ ) { buf . append ( s [ i ] ) ; } buf . append ( "]]><//log4j:throwable>\r\n" ) ; } if ( locationInfo ) { LocationInfo locationInfo = event . getLocationInformation ( ) ; buf . append ( "<log4j:locationInfo<seq2seq4repair_space>class=\"" ) ; buf . append ( locationInfo . getClassName ( ) ) ; buf . append ( "\"<seq2seq4repair_space>method=\"" ) ; buf . append ( locationInfo . getMethodName ( ) ) ; buf . append ( "\"<seq2seq4repair_space>file=\"" ) ; buf . append ( locationInfo . getFileName ( ) ) ; buf . append ( "\"<seq2seq4repair_space>line=\"" ) ; buf . append ( locationInfo . getLineNumber ( ) ) ; buf . append ( "\"//>\r\n" ) ; } buf . append ( "<//log4j:event>\r\n\r\n" ) ; return buf . toString ( ) ; } public boolean ignoresThrowable ( ) { } }

Fix:
buf . append ( event . categoryName ) ;
Buggy code:
public class ThreadGroupGui extends AbstractJMeterGuiComponent { LoopControlPanel loopPanel ; private static final String THREAD_NAME = "Thread<seq2seq4repair_space>Field" ; private static final String RAMP_NAME = "Ramp<seq2seq4repair_space>Up<seq2seq4repair_space>Field" ; private JTextField threadInput ; private JTextField rampInput ; public ThreadGroupGui ( ) { } public Collection getMenuCategories ( ) { } public TestElement createTestElement ( ) { } public void modifyTestElement ( TestElement tg ) { } public void configure ( TestElement tg ) { } public JPopupMenu createPopupMenu ( ) { } public JPanel createControllerPanel ( ) { } public String getStaticLabel ( ) { } private void init ( ) { } public void setNode ( JMeterTreeNode node ) { <START_BUG> namePanel . setNode ( node ) ; <END_BUG> } public Dimension getPreferredSize ( ) { } }

Fix:
getNamePanel ( ) . setNode ( node ) ;
Buggy code:
public class SpringBeanLocator implements IProxyTargetLocator { private static final long serialVersionUID = 1L ; private transient WeakReference < Class < ? > > beanTypeCache ; private final String beanTypeName ; private String beanName ; private ISpringContextLocator springContextLocator ; private Boolean singletonCache = null ; public SpringBeanLocator ( final Class < ? > beanType , final ISpringContextLocator locator ) { } public SpringBeanLocator ( final String beanName , final Class < ? > beanType , final ISpringContextLocator locator ) { } private final String getBeanNameOfClass ( final ApplicationContext ctx , final Class < ? > clazz ) { } private BeanDefinition getBeanDefinition ( ConfigurableListableBeanFactory beanFactory , String name ) { if ( beanFactory . containsBeanDefinition ( name ) ) { return beanFactory . getBeanDefinition ( name ) ; } else { BeanFactory parent = beanFactory . getParentBeanFactory ( ) ; if ( ( parent != null ) && ( parent instanceof ConfigurableListableBeanFactory ) ) { <START_BUG> return getBeanDefinition ( beanFactory , name ) ; <END_BUG> } else { return null ; } } } public boolean isSingletonBean ( ) { } public Class < ? > getBeanType ( ) { } public Object locateProxyTarget ( ) { } private ApplicationContext getSpringContext ( ) { } public final String getBeanName ( ) { } public final ISpringContextLocator getSpringContextLocator ( ) { } private final Object lookupSpringBean ( ApplicationContext ctx , Class < ? > clazz ) { } private static Object lookupSpringBean ( ApplicationContext ctx , String name , Class < ? > clazz ) { } @ Override public boolean equals ( final Object obj ) { } @ Override public int hashCode ( ) { } }

Fix:
return getBeanDefinition ( ( ( ConfigurableListableBeanFactory ) ( parent ) ) , name ) ;
Buggy code:
@ XmlRootElement public class CurveDTO { private String name ; private int color ; private CurveType type ; private List < PointDTO > points = new ArrayList < > ( ) ; public static CurveDTO toDTO ( ICurve c ) { CurveDTO dto = new CurveDTO ( ) ; dto . setName ( c . getName ( ) ) ; dto . setColor ( c . getColor ( ) . getRGB ( ) ) ; <START_BUG> dto . getPoints ( ) . addAll ( c . getPoints ( ) . stream ( ) . map ( PointDTO :: toDTO ) . collect ( Collectors . toList ( ) ) ) ; <END_BUG> dto . setType ( c . getType ( ) ) ; return dto ; } public static ICurve fromDTO ( CurveDTO dto ) { } public String getName ( ) { } @ XmlElement public void setName ( String name ) { } public int getColor ( ) { } @ XmlElement public void setColor ( int color ) { } public CurveType getType ( ) { } @ XmlElement public void setType ( ICurve . CurveType type ) { } public List < PointDTO > getPoints ( ) { } @ XmlElement public void setPoints ( List < PointDTO > points ) { } }

Fix:
dto . setPoints ( c . getPoints ( ) . stream ( ) . map ( PointDTO :: toDTO ) . collect ( Collectors . toList ( ) ) ) ;
Buggy code:
@ SuppressWarnings ( "serial" ) public class AsyncAnnotationAdvisor extends AbstractPointcutAdvisor implements BeanFactoryAware { private AsyncUncaughtExceptionHandler exceptionHandler ; private Advice advice ; private Pointcut pointcut ; public AsyncAnnotationAdvisor ( ) { } @ SuppressWarnings ( "unchecked" ) public AsyncAnnotationAdvisor ( Executor executor , AsyncUncaughtExceptionHandler exceptionHandler ) { } public void setTaskExecutor ( Executor executor ) { <START_BUG> this . advice = buildAdvice ( executor , exceptionHandler ) ; <END_BUG> } public void setAsyncAnnotationType ( Class < ? extends Annotation > asyncAnnotationType ) { } @ Override public void setBeanFactory ( BeanFactory beanFactory ) { } @ Override public Advice getAdvice ( ) { } @ Override public Pointcut getPointcut ( ) { } protected Advice buildAdvice ( Executor executor , AsyncUncaughtExceptionHandler exceptionHandler ) { } protected Pointcut buildPointcut ( Set < Class < ? extends Annotation > > asyncAnnotationTypes ) { } }

Fix:
this . advice = buildAdvice ( executor , this . exceptionHandler ) ;
Buggy code:
public class MedicalRecord { private List < Diagnosis > diagnosisList ; public MedicalRecord ( ) { } public MedicalRecord ( List < Diagnosis > dlist ) { } public boolean AddDiagnosis ( String diagnosis ) { boolean addDiagnosis = true ; Diagnosis newDiagnosis = new Diagnosis ( diagnosis ) ; for ( Diagnosis temp : diagnosisList ) { <START_BUG> if ( temp . equals ( newDiagnosis ) ) { <END_BUG> addDiagnosis = false ; break ; } } if ( addDiagnosis ) { diagnosisList . add ( newDiagnosis ) ; } return addDiagnosis ; } public List < Diagnosis > getListOfDiagnosis ( ) { } }

Fix:
if ( temp . getDiagnosis ( ) . equals ( newDiagnosis . getDiagnosis ( ) ) ) {
Buggy code:
public class TimeDV extends AbstractDateTimeDV { public Object getActualValue ( String content , ValidationContext context ) throws InvalidDatatypeValueException { } protected DateTimeData parse ( String str ) throws SchemaDateTimeException { } protected String dateToString ( DateTimeData date ) { } protected XMLGregorianCalendar getXMLGregorianCalendar ( DateTimeData date ) { <START_BUG> return factory . newXMLGregorianCalendar ( null , DatatypeConstants . FIELD_UNDEFINED , DatatypeConstants . FIELD_UNDEFINED , date . unNormHour , date . unNormMinute , ( ( int ) ( date . unNormSecond ) ) , ( ( date . unNormSecond ) != 0 ? getFractionalSecondsAsBigDecimal ( date ) : null ) , ( date . hasTimeZone ( ) ? ( ( date . timezoneHr ) * 60 ) + ( date . timezoneMin ) : DatatypeConstants . FIELD_UNDEFINED ) ) ; <END_BUG> } }

Fix:
return datatypeFactory . newXMLGregorianCalendar ( null , DatatypeConstants . FIELD_UNDEFINED , DatatypeConstants . FIELD_UNDEFINED , date . unNormHour , date . unNormMinute , ( ( int ) ( date . unNormSecond ) ) , ( ( date . unNormSecond ) != 0 ? getFractionalSecondsAsBigDecimal ( date ) : null ) , ( date . hasTimeZone ( ) ? ( ( date . timezoneHr ) * 60 ) + ( date . timezoneMin ) : DatatypeConstants . FIELD_UNDEFINED ) ) ;
Buggy code:
public class JavaSearchPattern extends SearchPattern { boolean isCaseSensitive ; boolean isCamelCase ; int matchMode ; int matchCompatibility ; public static final int MATCH_MODE_MASK = ( ( ( SearchPattern . R_EXACT_MATCH ) | ( SearchPattern . R_PREFIX_MATCH ) ) | ( SearchPattern . R_PATTERN_MATCH ) ) | ( SearchPattern . R_REGEXP_MATCH ) ; public static final int MATCH_COMPATIBILITY_MASK = ( ( SearchPattern . R_ERASURE_MATCH ) | ( SearchPattern . R_EQUIVALENT_MATCH ) ) | ( SearchPattern . R_FULL_MATCH ) ; char [ ] [ ] typeSignatures ; private char [ ] [ ] [ ] typeArguments ; private int flags = 0 ; static final int HAS_TYPE_ARGUMENTS = 1 ; protected JavaSearchPattern ( int patternKind , int matchRule ) { } public SearchPattern getBlankPattern ( ) { } int getMatchMode ( ) { } boolean isCamelCase ( ) { } boolean isCaseSensitive ( ) { } boolean isErasureMatch ( ) { } boolean isEquivalentMatch ( ) { } char [ ] [ ] extractMethodArguments ( IMethod method ) { } final char [ ] [ ] [ ] getTypeArguments ( ) { } public final boolean hasSignatures ( ) { } public final boolean hasTypeArguments ( ) { } public final boolean hasTypeParameters ( ) { } protected StringBuffer print ( StringBuffer output ) { } final void setTypeArguments ( char [ ] [ ] [ ] typeArguments ) { } void storeTypeSignaturesAndArguments ( IType type ) { BindingKey key ; if ( ( type . isResolved ( ) ) && ( ( key = new BindingKey ( type . getKey ( ) ) ) . isParameterizedType ( ) ) ) { <START_BUG> String signature = key . internalToSignature ( ) ; <END_BUG> this . typeSignatures = Util . splitTypeLevelsSignature ( signature ) ; setTypeArguments ( Util . getAllTypeArguments ( this . typeSignatures ) ) ; } else { char [ ] [ ] [ ] typeParameters = new char [ 10 ] [ ] [ ] ; int ptr = - 1 ; boolean hasParameters = false ; try { IJavaElement parent = type ; ITypeParameter [ ] parameters = null ; while ( ( parent != null ) && ( ( parent . getElementType ( ) ) == ( IJavaElement . TYPE ) ) ) { if ( ( ++ ptr ) > ( typeParameters . length ) ) { System . arraycopy ( typeParameters , 0 , ( typeParameters = new char [ ( typeParameters . length ) + 10 ] [ ] [ ] ) , 0 , ptr ) ; } IType parentType = ( ( IType ) ( parent ) ) ; parameters = parentType . getTypeParameters ( ) ; int length = ( parameters == null ) ? 0 : parameters . length ; if ( length > 0 ) { hasParameters = true ; typeParameters [ ptr ] = new char [ length ] [ ] ; for ( int i = 0 ; i < length ; i ++ ) typeParameters [ ptr ] [ i ] = Signature . createTypeSignature ( parameters [ i ] . getElementName ( ) , false ) . toCharArray ( ) ; } parent = parent . getParent ( ) ; } } catch ( JavaModelException jme ) { return ; } if ( hasParameters ) { if ( ( ++ ptr ) < ( typeParameters . length ) ) System . arraycopy ( typeParameters , 0 , ( typeParameters = new char [ ptr ] [ ] [ ] ) , 0 , ptr ) ; setTypeArguments ( typeParameters ) ; } } } public final String toString ( ) { } }

Fix:
String signature = key . toSignature ( ) ;
Buggy code:
public class NSHTTPCookie extends NSObject { public NSHTTPCookie ( ) { } public NSHTTPCookie ( int id ) { } public NSHTTPCookie ( id id ) { } public boolean isSessionOnly ( ) { <START_BUG> return ( OS . objc_msgSend ( this . id , sel_isSessionOnly ) ) != 0 ; <END_BUG> } }

Fix:
return OS . objc_msgSend_bool ( this . id , sel_isSessionOnly ) ;
Buggy code:
public class MethodData extends ItemData { Method method ; public MethodData ( Method method , String str ) { } public static String [ ] getAllFlags ( ) { <START_BUG> return new String [ ] { FLAG_NO_GEN , FLAG_ADDRESS , FLAG_CONST , FLAG_DYNAMIC , FLAG_JNI , FLAG_CPP , FLAG_NEW , FLAG_DELETE , FLAG_GCNEW , FLAG_GCOBJECT , FLAG_SETTER , FLAG_GETTER , FLAG_ADDER } ; <END_BUG> } public Method getMethod ( ) { } public String getAccessor ( ) { } public String getExclude ( ) { } public void setAccessor ( String str ) { } public void setExclude ( String str ) { } }

Fix:
return new String [ ] { FLAG_NO_GEN , FLAG_ADDRESS , FLAG_CONST , FLAG_DYNAMIC , FLAG_JNI , FLAG_CAST , FLAG_CPP , FLAG_NEW , FLAG_DELETE , FLAG_GCNEW , FLAG_GCOBJECT , FLAG_SETTER , FLAG_GETTER , FLAG_ADDER } ;
Buggy code:
public class ViewHeaderListCommand extends SelectiveGuiUpdateCommand { private HeaderList headerList ; private Folder folder ; public ViewHeaderListCommand ( AbstractFrameController frame , DefaultCommandReference [ ] references ) { } public void updateGUI ( ) throws Exception { ( ( TableSelectionHandler ) ( frameController . getSelectionManager ( ) . getHandler ( "mail.table" ) ) ) . setFolder ( folder ) ; <START_BUG> ( ( TableOwnerInterface ) ( frameController ) ) . showHeaderList ( folder , headerList ) ; <END_BUG> treeModel . nodeChanged ( folder ) ; } public void execute ( Worker worker ) throws Exception { } }

Fix:
( ( org . columba . mail . gui . frame . TableOwnerInterface ) ( frameController ) ) . getTableController ( ) . showHeaderList ( folder , headerList ) ;
Buggy code:
public class NetworkConnectionManager { public static void setMobileDataEnabled ( Context context , boolean enabled ) throws ClassNotFoundException , IllegalAccessException , NoSuchFieldException , NoSuchMethodException , InvocationTargetException { } public static boolean isDataEnabled ( Context context ) { boolean dataEnabled = false ; NetworkInfo activeNetworkInfo = NetworkConnectionManager . getNetworkInfo ( context ) ; <START_BUG> if ( ( activeNetworkInfo != null ) && ( ( activeNetworkInfo . getType ( ) ) == ( ConnectivityManager . TYPE_WIFI ) ) ) { <END_BUG> dataEnabled = ( activeNetworkInfo . getType ( ) ) == ( ConnectivityManager . TYPE_MOBILE ) ; } return dataEnabled ; } public static boolean isWifiEnabled ( Context context ) { } private static NetworkInfo getNetworkInfo ( Context context ) { } }

Fix:
if ( ( activeNetworkInfo != null ) && ( ( activeNetworkInfo . getType ( ) ) == ( ConnectivityManager . TYPE_MOBILE ) ) ) {
Buggy code:
public class MongoDBNativeQuery { private final DBCollection dbCollection ; MongoDBNativeQuery ( DBCollection dbCollection ) { } public long count ( ) { } public long count ( DBObject query ) { } public List distinct ( String key ) { } public List distinct ( String key , DBObject query ) { } public DBCursor find ( DBObject query , QueryOptions options ) { } public DBCursor find ( DBObject query , DBObject projection , QueryOptions options ) { } public AggregationOutput aggregate ( List < DBObject > operations , QueryOptions options ) { } public WriteResult insert ( DBObject objects , QueryOptions options ) { } public WriteResult insert ( List < DBObject > dbObjects , QueryOptions options ) { } public WriteResult update ( DBObject object , DBObject updates , boolean upsert , boolean multi ) { } public WriteResult update ( List < DBObject > dbObjects , List < DBObject > updates , boolean upsert , boolean multi ) { } public WriteResult remove ( DBObject query ) { } public DBObject findAndModify ( DBObject query , DBObject projection , DBObject sort , DBObject update , QueryOptions options ) { } public void createIndex ( DBObject keys , DBObject options ) { } public List < DBObject > getIndex ( ) { } public void dropIndex ( DBObject keys ) { } private DBObject getProjection ( DBObject projection , QueryOptions options ) { if ( projection == null ) { projection = new BasicDBObject ( ) ; } projection . put ( "_id" , 0 ) ; if ( options != null ) { List < String > includeStringList = options . getAsStringList ( "include" , "," ) ; if ( ( includeStringList != null ) && ( ( includeStringList . size ( ) ) > 0 ) ) { for ( Object field : includeStringList ) { projection . put ( field . toString ( ) , 1 ) ; } } else { <START_BUG> List < String > excludeStringList = options . getAsStringList ( "include" , "," ) ; <END_BUG> if ( ( excludeStringList != null ) && ( ( excludeStringList . size ( ) ) > 0 ) ) { for ( Object field : excludeStringList ) { projection . put ( field . toString ( ) , 0 ) ; } } } } return projection ; } }

Fix:
List < String > excludeStringList = options . getAsStringList ( "exclude" , "," ) ;
Buggy code:
public class FrameworkBootstrapService implements Service < Void > { static final ServiceName SERVICE_NAME = OSGiConstants . SERVICE_BASE_NAME . append ( "framework" , "bootstrap" ) ; static final String MAPPED_OSGI_SOCKET_BINDINGS = "org.jboss.as.osgi.socket.bindings" ; private final InjectedValue < ServerEnvironment > injectedServerEnvironment = new InjectedValue < ServerEnvironment > ( ) ; private final InjectedValue < SubsystemState > injectedSubsystemState = new InjectedValue < SubsystemState > ( ) ; private final InitialDeploymentTracker deploymentTracker ; private final ServiceVerificationHandler verificationHandler ; private final List < SubsystemExtension > extensions ; private final OSGiRuntimeResource resource ; public static ServiceController < Void > addService ( ServiceTarget target , OSGiRuntimeResource resource , InitialDeploymentTracker deploymentTracker , List < SubsystemExtension > extensions , ServiceVerificationHandler verificationHandler ) { FrameworkBootstrapService service = new FrameworkBootstrapService ( resource , deploymentTracker , extensions , verificationHandler ) ; ServiceBuilder < Void > builder = target . addService ( FrameworkBootstrapService . SERVICE_NAME , service ) ; builder . addDependency ( ServerEnvironmentService . SERVICE_NAME , ServerEnvironment . class , service . injectedServerEnvironment ) ; builder . addDependency ( SUBSYSTEM_STATE_SERVICE_NAME , SubsystemState . class , service . injectedSubsystemState ) ; <START_BUG> builder . addListener ( ONCE , verificationHandler ) ; <END_BUG> return builder . install ( ) ; } private FrameworkBootstrapService ( OSGiRuntimeResource resource , InitialDeploymentTracker deploymentTracker , List < SubsystemExtension > extensions , ServiceVerificationHandler verificationHandler ) { } @ Override public synchronized void start ( StartContext context ) throws StartException { } @ Override public synchronized void stop ( StopContext context ) { } @ Override public Void getValue ( ) throws IllegalStateException { } private void setupIntegrationProperties ( StartContext context , Map < String , Object > props ) { } Object getPropertyWithSystemFallback ( Map < String , Object > props , String key ) { } }

Fix:
builder . addListener ( verificationHandler ) ;
Buggy code:
public class DynmapPlotMe extends JavaPlugin { private static final String DEF_INFOWINDOW = "<div<seq2seq4repair_space>class=\"infowindow\"><span<seq2seq4repair_space>style=\"font-size:120%;\">ID<seq2seq4repair_space>:<seq2seq4repair_space>%plotid%<//span><br<seq2seq4repair_space>//>" + "<seq2seq4repair_space>Owner<seq2seq4repair_space><span<seq2seq4repair_space>style=\"font-weight:bold;\">%plotowners%<//span>%plothelpers%" ; private static MarkerSet set ; private PlotMe_CorePlugin plotme ; private Plugin dynmap ; private DynmapAPI api ; private long updperiod ; private String infowindow ; private DynmapPlotMe . AreaStyle defstyle ; private Map < String , DynmapPlotMe . AreaStyle > cusstyle ; private Map < String , DynmapPlotMe . AreaStyle > cuswildstyle ; private Map < String , DynmapPlotMe . AreaStyle > ownerstyle ; private Set < String > visible ; private Set < String > hidden ; private boolean stop ; private Map < String , AreaMarker > resareas = new HashMap < > ( ) ; private PlotMeCoreManager manager ; private String formatInfoWindow ( Plot plot ) { String v = ( "<div<seq2seq4repair_space>class=\"plotinfo\">" + ( infowindow ) ) + "<//div>" ; v = v . replace ( "%plotid%" , plot . getId ( ) . toString ( ) ) ; v = v . replace ( "%plotowners%" , plot . getOwner ( ) ) ; <START_BUG> if ( plot . getAllowed ( ) . equalsIgnoreCase ( "" ) ) { <END_BUG> v = v . replace ( "%plothelpers%" , "" ) ; } else { v = v . replace ( "%plothelpers%" , ( ( "<br<seq2seq4repair_space>//>Helpers<seq2seq4repair_space><span<seq2seq4repair_space>style=\"font-weight:bold;\">" + ( plot . getAllowed ( ) ) ) + "<//span><//div>" ) ) ; } return v ; } private boolean isVisible ( String id , String worldname ) { } private void addStyle ( String plotid , String worldid , AreaMarker marker , Plot plot ) { } private void handlePlot ( World world , Plot plot , Map < String , AreaMarker > newmap ) { } private void updatePlots ( ) { } @ Override public void onEnable ( ) { } private void activate ( ) { } private static class AreaStyle { final String strokecolor ; final double strokeopacity ; final int strokeweight ; final String fillcolor ; final double fillopacity ; String label ; AreaStyle ( FileConfiguration cfg , String path , DynmapPlotMe . AreaStyle def ) { } AreaStyle ( FileConfiguration cfg , String path ) { } } private class PlotMeUpdate implements Runnable { @ Override public void run ( ) { } } private class OurServerListener implements Listener { @ EventHandler ( priority = EventPriority . MONITOR , ignoreCancelled = true ) public void onPluginEnable ( PluginEnableEvent event ) { } @ EventHandler ( priority = EventPriority . MONITOR , ignoreCancelled = true ) public void onPlotEvent ( PlotEvent event ) { } } No newline ; at end ; of file ; }

Fix:
if ( plot . getAllowed ( ) . isEmpty ( ) ) {
Buggy code:
@ RunWith ( Arquillian . class ) @ RunAsClient public class CustomHandlerOperationsTestCase extends AbstractLoggingOperationsTestCase { private static final String FILE_NAME = "custom-handler-file.log" ; private static final String CUSTOM_HANDLER_NAME = "customFileHandler" ; private static final PathAddress CUSTOM_HANDLER_ADDRESS = createCustomHandlerAddress ( CustomHandlerOperationsTestCase . CUSTOM_HANDLER_NAME ) ; @ ContainerResource private ManagementClient managementClient ; @ ArquillianResource ( DefaultLoggingServlet . class ) private URL url ; private File logFile = null ; @ Deployment public static WebArchive createDeployment ( ) { } @ Before public void setLogFile ( ) throws Exception { } @ Override protected ManagementClient getManagementClient ( ) { } @ Test public void testCustomHandler ( ) throws Exception { } private void testCustomHandler ( final String profileName ) throws Exception { <START_BUG> final ModelNode address = createCustomHandlerAddress ( profileName , "CONSOLE" ) . toModelNode ( ) ; <END_BUG> final ModelNode addOp = Operations . createAddOperation ( address ) ; addOp . get ( "module" ) . set ( "org.jboss.logmanager" ) ; addOp . get ( "class" ) . set ( ConsoleHandler . class . getName ( ) ) ; executeOperation ( addOp ) ; testWrite ( address , "level" , "INFO" ) ; testWrite ( address , "enabled" , true ) ; testWrite ( address , "encoding" , "utf-8" ) ; testWrite ( address , "formatter" , "[test]<seq2seq4repair_space>%d{HH:mm:ss,SSS}<seq2seq4repair_space>%-5p<seq2seq4repair_space>[%c]<seq2seq4repair_space>%s%E%n" ) ; testWrite ( address , "filter-spec" , "deny" ) ; testWrite ( address , "class" , QueueHandler . class . getName ( ) ) ; testWrite ( address , "module" , "org.jboss.logmanager" ) ; final ModelNode properties = new ModelNode ( ) . setEmptyObject ( ) ; properties . get ( "autoFlush" ) . set ( true ) ; properties . get ( "target" ) . set ( "SYSTEM_OUT" ) ; testWrite ( address , "properties" , properties ) ; testUndefine ( address , "level" ) ; testUndefine ( address , "enabled" ) ; testUndefine ( address , "encoding" ) ; testUndefine ( address , "formatter" ) ; testUndefine ( address , "filter-spec" ) ; testUndefine ( address , "properties" ) ; executeOperation ( Operations . createRemoveOperation ( address ) ) ; verifyRemoved ( address ) ; } }

Fix:
final ModelNode address = createCustomHandlerAddress ( profileName , "CONSOLE2" ) . toModelNode ( ) ;
Buggy code:
@ Component public class TaskDaoImpl extends AbstractDao implements TaskDao { @ Override @ Transactional public void updateTask ( Task task ) { } @ Override @ Transactional public Long saveTask ( Task task ) { } @ Override @ Transactional public void deleteTasksByIds ( List < Long > tasksIds ) { } @ Override public Task findTaskById ( Long taskId ) { } @ Override public Set < Task > getTasksByProjectId ( Long projectId ) { } @ Override public Set < Task > getTasksByTaskIdWithDepends ( Long taskId ) { } @ Override public Set < Task > getTasksByUserAndFetchUsers ( Long userId ) { } @ Override public List < User > getUsersByTaskId ( Long taskId ) { } @ Override public Set < Task > getYesterdayTasksByUser ( Long userId ) { } @ Override public Set < Task > getTodayTasksByUser ( Long userId ) { } @ Override public Set < Task > getTomorrowTasksByUser ( Long userId ) { } public Set < Task > getTasksByProjectIdWithDepends ( Long projectId ) { } public Set < Task > getTasksByProjectIdAndUserIdWithDepends ( Long projectId , Long userId ) { } @ Override public Set < Task > getTasksByUser ( Long userId ) { } @ Override public Long findMaxTaskRowByProjectId ( Long projectId ) { <START_BUG> Long maxRow = Utilities . getSingleResultOrNull ( em . createQuery ( "SELECT<seq2seq4repair_space>MAX(t.row)<seq2seq4repair_space>FROM<seq2seq4repair_space>Task<seq2seq4repair_space>t<seq2seq4repair_space>WHERE<seq2seq4repair_space>t.project<seq2seq4repair_space>=<seq2seq4repair_space>:projectId<seq2seq4repair_space>" ) . setParameter ( "projectId" , projectId ) ) ; <END_BUG> if ( maxRow == null ) return new Long ( 0 ) ; else return maxRow ; } }

Fix:
Long maxRow = Utilities . getSingleResultOrNull ( em . createQuery ( "SELECT<seq2seq4repair_space>MAX(t.row)<seq2seq4repair_space>FROM<seq2seq4repair_space>Task<seq2seq4repair_space>t<seq2seq4repair_space>WHERE<seq2seq4repair_space>t.project.id<seq2seq4repair_space>=<seq2seq4repair_space>:projectId<seq2seq4repair_space>" ) . setParameter ( "projectId" , projectId ) ) ;
Buggy code:
public class SSLIdentityService implements Service < SSLIdentityService > { public static final String SERVICE_SUFFIX = "ssl" ; private final ModelNode ssl ; private final char [ ] password ; private final InjectedValue < KeyStore > keystore = new InjectedValue < KeyStore > ( ) ; private final InjectedValue < KeyStore > truststore = new InjectedValue < KeyStore > ( ) ; private volatile SSLContext sslContext ; public SSLIdentityService ( ModelNode ssl , char [ ] password ) { } public void start ( StartContext context ) throws StartException { try { String protocol = "TLS" ; <START_BUG> if ( ssl . has ( PROTOCOL ) ) { <END_BUG> protocol = ssl . get ( PROTOCOL ) . asString ( ) ; } KeyManager [ ] keyManagers = null ; KeyStore theKeyStore = keystore . getOptionalValue ( ) ; if ( theKeyStore != null ) { KeyManagerFactory keyManagerFactory = KeyManagerFactory . getInstance ( "SunX509" ) ; keyManagerFactory . init ( theKeyStore , password ) ; keyManagers = keyManagerFactory . getKeyManagers ( ) ; } TrustManager [ ] trustManagers = null ; KeyStore theTrustStore = truststore . getOptionalValue ( ) ; if ( theTrustStore != null ) { TrustManagerFactory trustManagerFactory = TrustManagerFactory . getInstance ( "SunX509" ) ; trustManagerFactory . init ( theTrustStore ) ; trustManagers = trustManagerFactory . getTrustManagers ( ) ; } SSLContext sslContext = SSLContext . getInstance ( protocol ) ; sslContext . init ( keyManagers , trustManagers , null ) ; this . sslContext = sslContext ; } catch ( NoSuchAlgorithmException nsae ) { throw DomainManagementMessages . MESSAGES . unableToStart ( nsae ) ; } catch ( KeyManagementException kme ) { throw DomainManagementMessages . MESSAGES . unableToStart ( kme ) ; } catch ( KeyStoreException kse ) { throw DomainManagementMessages . MESSAGES . unableToStart ( kse ) ; } catch ( UnrecoverableKeyException e ) { throw DomainManagementMessages . MESSAGES . unableToStart ( e ) ; } } public void stop ( StopContext context ) { } public SSLIdentityService getValue ( ) throws IllegalArgumentException , IllegalStateException { } public InjectedValue < KeyStore > getKeyStoreInjector ( ) { } public InjectedValue < KeyStore > getTrustStoreInjector ( ) { } SSLContext getSSLContext ( ) { } boolean hasTrustStore ( ) { } }

Fix:
if ( ssl . hasDefined ( PROTOCOL ) ) {
Buggy code:
public class BatchEditLineHandler extends CommandHandlerWithHelp { public BatchEditLineHandler ( ) { } @ Override public boolean isAvailable ( CommandContext ctx ) { } @ Override protected void doHandle ( CommandContext ctx ) { BatchManager batchManager = ctx . getBatchManager ( ) ; if ( ! ( batchManager . isBatchActive ( ) ) ) { ctx . printLine ( "No<seq2seq4repair_space>active<seq2seq4repair_space>batch." ) ; return ; } Batch batch = batchManager . getActiveBatch ( ) ; final int batchSize = batch . size ( ) ; if ( batchSize == 0 ) { ctx . printLine ( "The<seq2seq4repair_space>batch<seq2seq4repair_space>is<seq2seq4repair_space>empty." ) ; return ; } <START_BUG> String argsStr = ctx . getCommandArguments ( ) ; <END_BUG> if ( argsStr == null ) { ctx . printLine ( "Missing<seq2seq4repair_space>line<seq2seq4repair_space>number." ) ; return ; } int i = 0 ; while ( i < ( argsStr . length ( ) ) ) { if ( Character . isWhitespace ( argsStr . charAt ( i ) ) ) { break ; } ++ i ; } if ( i == ( argsStr . length ( ) ) ) { ctx . printLine ( "Missing<seq2seq4repair_space>the<seq2seq4repair_space>new<seq2seq4repair_space>command<seq2seq4repair_space>line<seq2seq4repair_space>after<seq2seq4repair_space>the<seq2seq4repair_space>index." ) ; return ; } String intStr = argsStr . substring ( 0 , i ) ; int lineNumber ; try { lineNumber = Integer . parseInt ( intStr ) ; } catch ( NumberFormatException e ) { ctx . printLine ( ( ( ( "Failed<seq2seq4repair_space>to<seq2seq4repair_space>parse<seq2seq4repair_space>line<seq2seq4repair_space>number<seq2seq4repair_space>'" + intStr ) + "':<seq2seq4repair_space>" ) + ( e . getLocalizedMessage ( ) ) ) ) ; return ; } if ( ( lineNumber < 1 ) || ( lineNumber > batchSize ) ) { ctx . printLine ( ( ( ( lineNumber + "<seq2seq4repair_space>isn't<seq2seq4repair_space>in<seq2seq4repair_space>range<seq2seq4repair_space>[1.." ) + batchSize ) + "]." ) ) ; return ; } String editedLine = argsStr . substring ( i ) . trim ( ) ; if ( ( editedLine . length ( ) ) == 0 ) { ctx . printLine ( "Missing<seq2seq4repair_space>the<seq2seq4repair_space>new<seq2seq4repair_space>command<seq2seq4repair_space>line<seq2seq4repair_space>after<seq2seq4repair_space>the<seq2seq4repair_space>index." ) ; return ; } try { BatchedCommand newCmd = ctx . toBatchedCommand ( editedLine ) ; batch . set ( ( lineNumber - 1 ) , newCmd ) ; } catch ( OperationFormatException e ) { ctx . printLine ( ( ( ( "Failed<seq2seq4repair_space>to<seq2seq4repair_space>process<seq2seq4repair_space>command<seq2seq4repair_space>line<seq2seq4repair_space>'" + editedLine ) + "':<seq2seq4repair_space>" ) + ( e . getLocalizedMessage ( ) ) ) ) ; } } }

Fix:
String argsStr = ctx . getArgumentsString ( ) ;
Buggy code:
@ RunWith ( Arquillian . class ) @ Run ( RunModeType . AS_CLIENT ) public class SarTestCase { @ Deployment public static JavaArchive createDeployment ( ) throws Exception { } @ Test public void testMBean ( ) throws Exception { MBeanServer mbeanServer = ManagementFactory . getPlatformMBeanServer ( ) ; ObjectName objectName = new ObjectName ( "jboss:name=test,type=config" ) ; <START_BUG> PollingUtils . retryWithTimeout ( 2000 , new PollingUtils . WaitForMBeanTask ( mbeanServer , objectName ) ) ; <END_BUG> Object o = mbeanServer . getAttribute ( objectName , "IntervalSeconds" ) ; mbeanServer . setAttribute ( objectName , new Attribute ( "IntervalSeconds" , 2 ) ) ; } }

Fix:
PollingUtils . retryWithTimeout ( 10000 , new PollingUtils . WaitForMBeanTask ( mbeanServer , objectName ) ) ;
Buggy code:
public class TileEntityLogisticsManager extends BaseTileEntity { private static List < TileEntityLogisticsManager > activeManagers ; public static List < TileEntityLogisticsManager > getActiveManagers ( ) { } private LogisticsManager manager ; public LogisticsManager getManager ( ) { if ( worldObj . isRemote ) { return null ; } if ( ( manager ) == null ) { <START_BUG> manager = new LogisticsManager ( ) ; <END_BUG> } return manager ; } public TileEntityLogisticsManager ( ) { } @ Override public void onChunkUnload ( ) { } @ Override public void updateContainingBlockInfo ( ) { } @ Override public void updateEntity ( ) { } @ Override protected void writePropertiesToNBT ( NBTTagCompound tag ) { } @ Override protected void readPropertiesFromNBT ( NBTTagCompound tag ) { } public int stationRegister ( IStation station ) { } public void stationUnregister ( IStation station ) { } public int vehicleRegister ( IVehicle vehicle ) { } public void vehicleUnregister ( IVehicle vehicle ) { } }

Fix:
manager = new LogisticsManager ( worldObj ) ;
Buggy code:
public class ChessGame { Player white_player ; Player black_player ; boolean isWhite = true ; public ChessGame ( ) { } public void readFile ( String fileName ) throws IOException { } public void applyMove ( String move ) { } public void displayChessBoard ( ) { ChessGame . BoardSquare [ ] [ ] board = new ChessGame . BoardSquare [ 8 ] [ 8 ] ; for ( int i = 0 ; i < 8 ; i ++ ) { for ( int j = 0 ; j < 8 ; j ++ ) { board [ i ] [ j ] = new ChessGame . BoardSquare ( ) ; } } for ( Piece piece : white_player . pieces ) { if ( ! ( piece . isCaptured ( ) ) ) { board [ ( 8 - ( piece . getY ( ) ) ) ] [ ( ( piece . getX ( ) ) - 'a' ) ] . pieceName = "W_" + ( piece . getName ( ) ) ; } } for ( Piece piece : black_player . pieces ) { if ( ! ( piece . isCaptured ( ) ) ) { board [ ( 8 - ( piece . getY ( ) ) ) ] [ ( ( piece . getX ( ) ) - 'a' ) ] . pieceName = "B_" + ( piece . getName ( ) ) ; } } for ( int i = 0 ; i < 8 ; i ++ ) { if ( i == 0 ) { System . out . println ( "<seq2seq4repair_space>A<seq2seq4repair_space>B<seq2seq4repair_space>C<seq2seq4repair_space>D<seq2seq4repair_space>E<seq2seq4repair_space>F<seq2seq4repair_space>G<seq2seq4repair_space>H<seq2seq4repair_space>" ) ; } for ( int j = 0 ; j < 8 ; j ++ ) { if ( j == 0 ) { <START_BUG> System . out . print ( ( ( i + 1 ) + "<seq2seq4repair_space>" ) ) ; <END_BUG> } if ( ( board [ i ] [ j ] . pieceName ) != null ) { System . out . print ( ( ( board [ i ] [ j ] . pieceName ) + "<seq2seq4repair_space>" ) ) ; } else { System . out . print ( "<seq2seq4repair_space>" ) ; } } System . out . println ( ) ; } } private class BoardSquare { String pieceName ; } }

Fix:
System . out . print ( ( ( 8 - i ) + "<seq2seq4repair_space>" ) ) ;
Buggy code:
public class TestMethodRunner extends BeforeAndAfterRunner { private final Object fTest ; private final Method fMethod ; private final RunNotifier fNotifier ; private final TestIntrospector fTestIntrospector ; private final Description fDescription ; public TestMethodRunner ( Object test , Method method , RunNotifier notifier , Description description ) { } public void run ( ) { } private void runWithTimeout ( long timeout ) { ExecutorService service = Executors . newSingleThreadExecutor ( ) ; Callable < Object > callable = new Callable < Object > ( ) { public Object call ( ) throws Exception { runMethod ( ) ; return null ; } } ; Future < Object > result = service . submit ( callable ) ; service . shutdown ( ) ; try { boolean terminated = service . awaitTermination ( timeout , TimeUnit . MILLISECONDS ) ; if ( ! terminated ) service . shutdownNow ( ) ; <START_BUG> result . get ( timeout , TimeUnit . MILLISECONDS ) ; <END_BUG> } catch ( TimeoutException e ) { addFailure ( new Exception ( String . format ( "test<seq2seq4repair_space>timed<seq2seq4repair_space>out<seq2seq4repair_space>after<seq2seq4repair_space>%d<seq2seq4repair_space>milliseconds" , timeout ) ) ) ; } catch ( Exception e ) { addFailure ( e ) ; } } private void runMethod ( ) { } @ Override protected void runUnprotected ( ) { } protected void executeMethodBody ( ) throws IllegalAccessException , InvocationTargetException { } @ Override protected void addFailure ( Throwable e ) { } private boolean expectsException ( ) { } private Class < ? extends Throwable > expectedException ( ) { } private boolean isUnexpected ( Throwable exception ) { } }

Fix:
result . get ( 0 , TimeUnit . MILLISECONDS ) ;