nus-yam/ex-repair huggingface dataset:
Buggy code:
public class JasperReportsUtilsTests extends TestCase { public void testRenderAsCsvWithDataSource ( ) throws Exception { } public void testRenderAsCsvWithCollection ( ) throws Exception { } public void testRenderAsCsvWithExporterParameters ( ) throws Exception { } public void testRenderAsHtmlWithDataSource ( ) throws Exception { } public void testRenderAsHtmlWithCollection ( ) throws Exception { } public void testRenderAsHtmlWithExporterParameters ( ) throws Exception { } public void testRenderAsPdfWithDataSource ( ) throws Exception { } public void testRenderAsPdfWithCollection ( ) throws Exception { } public void testRenderAsPdfWithExporterParameters ( ) throws Exception { } public void testRenderAsXlsWithDataSource ( ) throws Exception { } public void testRenderAsXlsWithCollection ( ) throws Exception { } public void testRenderAsXlsWithExporterParameters ( ) throws Exception { } public void testRenderWithWriter ( ) throws Exception { } public void testRenderWithOutputStream ( ) throws Exception { } private void assertCsvOutputCorrect ( String output ) { } private void assertHtmlOutputCorrect ( String output ) { } private void assertPdfOutputCorrect ( byte [ ] output ) throws Exception { } private void assertXlsOutputCorrect ( byte [ ] output ) throws Exception { HSSFWorkbook workbook = new HSSFWorkbook ( new ByteArrayInputStream ( output ) ) ; HSSFSheet sheet = workbook . getSheetAt ( 0 ) ; assertNotNull ( "Sheet<seq2seq4repair_space>should<seq2seq4repair_space>not<seq2seq4repair_space>be<seq2seq4repair_space>null" , sheet ) ; HSSFRow row = sheet . getRow ( 3 ) ; HSSFCell cell = row . getCell ( ( ( short ) ( 1 ) ) ) ; assertNotNull ( "Cell<seq2seq4repair_space>should<seq2seq4repair_space>not<seq2seq4repair_space>be<seq2seq4repair_space>null" , cell ) ; <START_BUG> assertEquals ( "Cell<seq2seq4repair_space>content<seq2seq4repair_space>should<seq2seq4repair_space>be<seq2seq4repair_space>Dear<seq2seq4repair_space>Lord!" , "Dear<seq2seq4repair_space>Lord!" , cell . getStringCellValue ( ) ) ; <END_BUG> } private JasperReport getReport ( ) throws Exception { } private Map < String , Object > getParameters ( ) { } private JRDataSource getDataSource ( ) { } private List < PersonBean > getData ( ) { } private static class SimpleProgressMonitor implements JRExportProgressMonitor { private boolean invoked = false ; @ Override public void afterPageExport ( ) { } public boolean isInvoked ( ) { } } }

Fix:
assertEquals ( "Cell<seq2seq4repair_space>content<seq2seq4repair_space>should<seq2seq4repair_space>be<seq2seq4repair_space>Dear<seq2seq4repair_space>Lord!" , "Dear<seq2seq4repair_space>Lord!" , cell . getRichStringCellValue ( ) . getString ( ) ) ;
Buggy code:
public class TestHelper { static boolean headless ; static Random rand ; static final int RANDOMTESTCOUNT ; public static void progress ( int calls , int methods ) { } public static boolean notHeadless ( ) { } public static Object [ ] [ ] createRandomValues ( int n , Object [ ] [ ] values , String [ ] [ ] types ) { assert n > 0 ; int l = values . length ; Object [ ] [ ] result = new Object [ l + n ] [ types . length ] ; for ( int i = 0 ; i < l ; i ++ ) { result [ i ] = values [ i ] ; } for ( int i = l ; i < ( l + n ) ; i ++ ) { for ( int j = 0 ; j < ( types . length ) ; j ++ ) { boolean error = true ; if ( ( types [ j ] [ 0 ] ) == "Integer" ) { int min = 0 ; int max = Integer . MAX_VALUE ; if ( ( types [ j ] [ 1 ] ) != "" ) { min = new Integer ( types [ j ] [ 1 ] ) ; } if ( ( types [ j ] [ 2 ] ) != "" ) { max = new Integer ( types [ j ] [ 2 ] ) ; } <START_BUG> result [ i ] [ j ] = ( TestHelper . rand . nextInt ( max ) ) - min ; <END_BUG> error = false ; } if ( ( types [ j ] [ 0 ] ) == "Boolean" ) { if ( ( ( types [ j ] . length ) > 1 ) && ( ( types [ j ] [ 1 ] ) != "" ) ) result [ i ] [ j ] = new Boolean ( types [ j ] [ 1 ] ) ; else result [ i ] [ j ] = TestHelper . rand . nextBoolean ( ) ; error = false ; } if ( error ) assert false ; } } return result ; } public static Object [ ] [ ] createRandomValues ( Object [ ] [ ] values , String [ ] [ ] types ) { } }

Fix:
result [ i ] [ j ] = ( TestHelper . rand . nextInt ( ( max - min ) ) ) + min ;
Buggy code:
public abstract class MultipartServletWebRequest extends ServletWebRequest implements IMultipartWebRequest { public MultipartServletWebRequest ( HttpServletRequest httpServletRequest , String filterPrefix ) { } public MultipartServletWebRequest ( HttpServletRequest httpServletRequest , String filterPrefix , Url url ) { } @ Override public ServletWebRequest cloneWithUrl ( Url url ) { <START_BUG> return new MultipartServletWebRequest ( getHttpServletRequest ( ) , getFilterPrefix ( ) , url ) { <END_BUG> public FileItem getFile ( String fieldName ) { return MultipartServletWebRequest . this . getFile ( fieldName ) ; } public Map < String , FileItem > getFiles ( ) { return MultipartServletWebRequest . this . getFiles ( ) ; } @ Override public IRequestParameters getPostParameters ( ) { return MultipartServletWebRequest . this . getPostParameters ( ) ; } } ; } }

Fix:
return new MultipartServletWebRequest ( getContainerRequest ( ) , getFilterPrefix ( ) , url ) {
Buggy code:
public class MapAccessor implements PropertyAccessor { public boolean canRead ( EvaluationContext context , Object target , String name ) throws AccessException { } public TypedValue read ( EvaluationContext context , Object target , String name ) throws AccessException { <START_BUG> return new TypedValue ( ( ( Map ) ( target ) ) . get ( name ) , TypeDescriptor . valueOf ( Object . class ) ) ; <END_BUG> } public boolean canWrite ( EvaluationContext context , Object target , String name ) throws AccessException { } @ SuppressWarnings ( "unchecked" ) public void write ( EvaluationContext context , Object target , String name , Object newValue ) throws AccessException { } public Class [ ] getSpecificTargetClasses ( ) { } }

Fix:
return new TypedValue ( ( ( Map ) ( target ) ) . get ( name ) , TypeDescriptor . OBJECT ) ;
Buggy code:
class MethodBinding implements IMethodBinding { private static final int VALID_MODIFIERS = ( ( ( ( ( ( ( ( Modifier . PUBLIC ) | ( Modifier . PROTECTED ) ) | ( Modifier . PRIVATE ) ) | ( Modifier . ABSTRACT ) ) | ( Modifier . STATIC ) ) | ( Modifier . FINAL ) ) | ( Modifier . SYNCHRONIZED ) ) | ( Modifier . NATIVE ) ) | ( Modifier . STRICTFP ) ; private static final ITypeBinding [ ] NO_TYPE_BINDINGS = new ITypeBinding [ 0 ] ; private org . eclipse . jdt . internal . compiler . lookup . MethodBinding binding ; private BindingResolver resolver ; private ITypeBinding [ ] parameterTypes ; private ITypeBinding [ ] exceptionTypes ; private String name ; private ITypeBinding declaringClass ; private ITypeBinding returnType ; private String key ; private ITypeBinding [ ] typeParameters ; private ITypeBinding [ ] typeArguments ; private IAnnotationBinding [ ] annotations ; private IAnnotationBinding [ ] parameterAnnotations ; MethodBinding ( BindingResolver resolver , org . eclipse . jdt . internal . compiler . lookup . MethodBinding binding ) { } public boolean isAnnotationMember ( ) { } public boolean isConstructor ( ) { } public boolean isDefaultConstructor ( ) { final ReferenceBinding declaringClassBinding = this . binding . declaringClass ; if ( declaringClassBinding . isRawType ( ) ) { RawTypeBinding rawTypeBinding = ( ( RawTypeBinding ) ( declaringClassBinding ) ) ; <START_BUG> if ( rawTypeBinding . type . isBinaryBinding ( ) ) { <END_BUG> return false ; } return ( ( this . binding . modifiers ) & ( ExtraCompilerModifiers . AccIsDefaultConstructor ) ) != 0 ; } if ( declaringClassBinding . isBinaryBinding ( ) ) { return false ; } return ( ( this . binding . modifiers ) & ( ExtraCompilerModifiers . AccIsDefaultConstructor ) ) != 0 ; } public String getName ( ) { } public IAnnotationBinding [ ] getAnnotations ( ) { } public ITypeBinding getDeclaringClass ( ) { } public IAnnotationBinding [ ] getParameterAnnotations ( int index ) { } public ITypeBinding [ ] getParameterTypes ( ) { } public ITypeBinding getReturnType ( ) { } public Object getDefaultValue ( ) { } public ITypeBinding [ ] getExceptionTypes ( ) { } public IJavaElement getJavaElement ( ) { } private JavaElement getUnresolvedJavaElement ( ) { } public int getKind ( ) { } public int getModifiers ( ) { } public boolean isDeprecated ( ) { } public boolean isRecovered ( ) { } public boolean isSynthetic ( ) { } public boolean isVarargs ( ) { } public String getKey ( ) { } public boolean isEqualTo ( IBinding other ) { } public ITypeBinding [ ] getTypeParameters ( ) { } public boolean isGenericMethod ( ) { } public ITypeBinding [ ] getTypeArguments ( ) { } public boolean isParameterizedMethod ( ) { } public boolean isRawMethod ( ) { } public boolean isSubsignature ( IMethodBinding otherMethod ) { } public IMethodBinding getMethodDeclaration ( ) { } public boolean overrides ( IMethodBinding overridenMethod ) { } public String toString ( ) { } }

Fix:
if ( rawTypeBinding . genericType ( ) . isBinaryBinding ( ) ) {
Buggy code:
public class ModuleControllerGui extends AbstractControllerGui { private JMeterTreeNode selected = null ; private JComboBox nodes ; private DefaultComboBoxModel nodesModel ; private JLabel warningLabel ; public ModuleControllerGui ( ) { } public String getLabelResource ( ) { } public void configure ( TestElement el ) { } private String renderPath ( Collection path ) { } public TestElement createTestElement ( ) { } public void modifyTestElement ( TestElement element ) { } public void clear ( ) { } public JPopupMenu createPopupMenu ( ) { } private void init ( ) { <START_BUG> setLayout ( new VerticalLayout ( 5 , VerticalLayout . LEFT , VerticalLayout . TOP ) ) ; <END_BUG> setBorder ( makeBorder ( ) ) ; add ( makeTitlePanel ( ) ) ; JPanel modulesPanel = new JPanel ( new FlowLayout ( FlowLayout . LEFT , 20 , 5 ) ) ; JLabel nodesLabel = new JLabel ( JMeterUtils . getResString ( "module_controller_module_to_run" ) ) ; modulesPanel . add ( nodesLabel ) ; nodesModel = new DefaultComboBoxModel ( ) ; nodes = new JComboBox ( nodesModel ) ; nodesLabel . setLabelFor ( nodes ) ; reinitialize ( ) ; modulesPanel . add ( nodes ) ; warningLabel = new JLabel ( "" ) ; modulesPanel . add ( warningLabel ) ; add ( modulesPanel ) ; } private void reinitialize ( ) { } private void buildNodesModel ( JMeterTreeNode node , String parent_name , int level ) { } private String spaces ( int level ) { } }

Fix:
setLayout ( new VerticalLayout ( 5 , VerticalLayout . BOTH , VerticalLayout . TOP ) ) ;
Buggy code:
public class MimePartParser { public static String parse ( IMAPResponse [ ] responses ) { String source = responses [ 0 ] . getSource ( ) ; int newLine = source . indexOf ( "\n" ) ; if ( newLine == ( - 1 ) ) { int leftIndex = source . indexOf ( "\"" ) ; int rightIndex = source . lastIndexOf ( "\"" ) ; return source . substring ( ( leftIndex + 1 ) , rightIndex ) ; } boolean uidAtBeginning = false ; int uidIndex = source . indexOf ( "(UID" ) ; if ( uidIndex != ( - 1 ) ) uidAtBeginning = true ; int leftIndex = source . indexOf ( '}' ) ; int rightIndex = - 1 ; if ( uidAtBeginning ) { <START_BUG> rightIndex = ( source . length ( ) ) - 2 ; <END_BUG> } else { rightIndex = ( source . lastIndexOf ( "UID" ) ) - 1 ; } return source . substring ( ( leftIndex + 3 ) , rightIndex ) ; } }

Fix:
rightIndex = source . lastIndexOf ( ")" ) ;
Buggy code:
public class NamingExtension implements Extension { public static final String SUBSYSTEM_NAME = "naming" ; public static final String NAMESPACE_1_0 = "urn:jboss:domain:naming:1.0" ; public static final String NAMESPACE_1_1 = "urn:jboss:domain:naming:1.1" ; public static final String NAMESPACE_1_2 = "urn:jboss:domain:naming:1.2" ; public static final String NAMESPACE_1_3 = "urn:jboss:domain:naming:1.3" ; private static final int MANAGEMENT_API_MAJOR_VERSION = 1 ; private static final int MANAGEMENT_API_MINOR_VERSION = 1 ; private static final int MANAGEMENT_API_MICRO_VERSION = 0 ; public static final String RESOURCE_NAME = ( NamingExtension . class . getPackage ( ) . getName ( ) ) + ".LocalDescriptions" ; public static ResourceDescriptionResolver getResourceDescriptionResolver ( final String keyPrefix ) { } @ Override public void initialize ( ExtensionContext context ) { final SubsystemRegistration subsystem = context . registerSubsystem ( NamingExtension . SUBSYSTEM_NAME , NamingExtension . MANAGEMENT_API_MAJOR_VERSION , NamingExtension . MANAGEMENT_API_MINOR_VERSION , NamingExtension . MANAGEMENT_API_MICRO_VERSION ) ; final ManagementResourceRegistration registration = subsystem . registerSubsystemModel ( INSTANCE ) ; registration . registerOperationHandler ( DESCRIBE , GenericSubsystemDescribeHandler . INSTANCE , GenericSubsystemDescribeHandler . INSTANCE , false , PRIVATE ) ; registration . registerSubModel ( NamingBindingResourceDefinition . INSTANCE ) ; registration . registerSubModel ( RemoteNamingResourceDefinition . INSTANCE ) ; if ( context . isRuntimeOnlyRegistrationValid ( ) ) { registration . registerOperationHandler ( OPERATION_NAME , JndiViewOperation . INSTANCE , JNDI_VIEW , false , EnumSet . of ( RUNTIME_ONLY ) ) ; } <START_BUG> subsystem . registerXMLElementWriter ( NamingSubsystem12Parser . INSTANCE ) ; <END_BUG> } @ Override public void initializeParsers ( ExtensionParsingContext context ) { } static ModelNode createAddOperation ( ) { } }

Fix:
subsystem . registerXMLElementWriter ( NamingSubsystem13Parser . INSTANCE ) ;
Buggy code:
public class FixCRLF extends MatchingTask { private int addcr ; private int addtab ; private int ctrlz ; private int tablength = 8 ; private File srcDir ; private File destDir = null ; public FixCRLF ( ) { } public void setSrcdir ( File srcDir ) { } public void setDestdir ( File destDir ) { } public void setCr ( String option ) { } public void setTab ( String option ) { } public void setTablength ( int tlength ) throws BuildException { <START_BUG> if ( ( tlength < 2 ) || ( ( tlength & ( tlength - 1 ) ) == 0 ) ) { <END_BUG> throw new BuildException ( "tablength<seq2seq4repair_space>must<seq2seq4repair_space>be<seq2seq4repair_space>a<seq2seq4repair_space>positive<seq2seq4repair_space>power<seq2seq4repair_space>of<seq2seq4repair_space>2" , location ) ; } tablength = tlength ; } public void setEof ( String option ) { } public void execute ( ) throws BuildException { } }

Fix:
if ( ( tlength < 2 ) || ( ( tlength & ( tlength - 1 ) ) != 0 ) ) {
Buggy code:
public class DateUtils { public static String convertCurrentPriceStringForWidget ( final BitcoinPriceDTO bitcoinPriceDTO ) throws Exception { final DateFormat inputFormat = new SimpleDateFormat ( "MMM<seq2seq4repair_space>dd,<seq2seq4repair_space>yyyy<seq2seq4repair_space>HH:mm:ss<seq2seq4repair_space>zz" , Locale . ENGLISH ) ; inputFormat . setTimeZone ( TimeZone . getTimeZone ( "Etc//UTC" ) ) ; final Date date = inputFormat . parse ( bitcoinPriceDTO . getTime ( ) . getUpdated ( ) ) ; <START_BUG> final DateFormat outputFormat = new SimpleDateFormat ( "HH:mm<seq2seq4repair_space>//<seq2seq4repair_space>dd.MM<seq2seq4repair_space>yyy" ) ; <END_BUG> outputFormat . setTimeZone ( Calendar . getInstance ( ) . getTimeZone ( ) ) ; return outputFormat . format ( date ) ; } }

Fix:
final DateFormat outputFormat = new SimpleDateFormat ( "HH:mm<seq2seq4repair_space>//<seq2seq4repair_space>dd.MM.yyy" ) ;
Buggy code:
public class AttributeModifierComponentTest extends TestCase { private MockHttpApplication application ; public AttributeModifierComponentTest ( final String name ) { } protected void setUp ( ) throws Exception { super . setUp ( ) ; application = new MockHttpApplication ( null ) ; <START_BUG> application . getSettings ( ) . setHomePage ( AttributeModifierComponentPage . class ) ; <END_BUG> } public void testComponentTagAttributeModification ( ) throws Exception { } private boolean validateDocument ( String document ) { } }

Fix:
application . getPages ( ) . setHomePage ( AttributeModifierComponentPage . class ) ;
Buggy code:
public abstract class AbstractLink extends WebMarkupContainer { private static final long serialVersionUID = 1L ; public AbstractLink ( String id , IModel < ? > model ) { } public AbstractLink ( String id ) { } private String beforeDisabledLink ; private String afterDisabledLink ; public AbstractLink setAfterDisabledLink ( final String afterDisabledLink ) { } public String getAfterDisabledLink ( ) { } public AbstractLink setBeforeDisabledLink ( final String beforeDisabledLink ) { } @ Override protected void onBeforeRender ( ) { } public String getBeforeDisabledLink ( ) { } protected final boolean isLinkEnabled ( ) { } @ Override protected void onComponentTagBody ( final MarkupStream markupStream , final ComponentTag openTag ) { if ( ( ! ( isLinkEnabled ( ) ) ) && ( ( getBeforeDisabledLink ( ) ) != null ) ) { getResponse ( ) . write ( getBeforeDisabledLink ( ) ) ; } <START_BUG> renderComponentTagBody ( markupStream , openTag ) ; <END_BUG> if ( ( ! ( isLinkEnabled ( ) ) ) && ( ( getAfterDisabledLink ( ) ) != null ) ) { getResponse ( ) . write ( getAfterDisabledLink ( ) ) ; } } protected void disableLink ( final ComponentTag tag ) { } }

Fix:
super . onComponentTagBody ( markupStream , openTag ) ;
Buggy code:
public class WrappedOutputStream extends FilterOutputStream { public static final int DEFAULT_BUFFER_SIZE = 1024 ; protected byte [ ] fBuffer ; protected int fPosition ; protected DataOutputStream fDataOutputStream ; public WrappedOutputStream ( OutputStream stream ) { } public WrappedOutputStream ( OutputStream stream , int bufferSize ) { } public void write ( int b ) throws IOException { fBuffer [ ( ( fPosition ) ++ ) ] = ( ( byte ) ( b ) ) ; if ( ( fPosition ) == ( fBuffer . length ) ) { fPosition = 0 ; fDataOutputStream . writeInt ( fBuffer . length ) ; <START_BUG> write ( fBuffer , 0 , fBuffer . length ) ; <END_BUG> } } public void write ( byte [ ] b , int offset , int length ) throws IOException { } public void flush ( ) throws IOException { } public void close ( ) throws IOException { } public void flush0 ( ) throws IOException { } }

Fix:
super . out . write ( fBuffer , 0 , fBuffer . length ) ;
Buggy code:
public class TSIG { public static final String HMAC = "HMAC-MD5.SIG-ALG.REG.INT" ; private Name name ; private byte [ ] key ; private hmacSigner axfrSigner = null ; public TSIG ( String name , byte [ ] key ) { } public void apply ( Message m , TSIGRecord old ) throws IOException { Date timeSigned = new Date ( ) ; short fudge = 300 ; hmacSigner h = new hmacSigner ( key ) ; Name alg = new Name ( TSIG . HMAC ) ; try { if ( old != null ) { DataByteOutputStream dbs = new DataByteOutputStream ( ) ; dbs . writeShort ( ( ( short ) ( old . getSignature ( ) . length ) ) ) ; h . addData ( dbs . toByteArray ( ) ) ; h . addData ( old . getSignature ( ) ) ; } h . addData ( m . toWire ( ) ) ; DataByteOutputStream out = new DataByteOutputStream ( ) ; name . toWireCanonical ( out ) ; out . writeShort ( ANY ) ; out . writeInt ( 0 ) ; alg . toWireCanonical ( out ) ; long time = ( timeSigned . getTime ( ) ) // 1000 ; short timeHigh = ( ( short ) ( time > > 32 ) ) ; int timeLow = ( ( int ) ( time ) ) ; out . writeShort ( timeHigh ) ; out . writeInt ( timeLow ) ; out . writeShort ( fudge ) ; out . writeShort ( 0 ) ; out . writeShort ( 0 ) ; h . addData ( out . toByteArray ( ) ) ; } catch ( IOException e ) { return ; } Record r = new TSIGRecord ( name , DClass . ANY , 0 , alg , timeSigned , fudge , h . sign ( ) , m . getHeader ( ) . getID ( ) , Rcode . NOERROR , null ) ; <START_BUG> m . addRecord ( ADDITIONAL , r ) ; <END_BUG> } public boolean verify ( Message m , byte [ ] b , TSIGRecord old ) { } public void verifyAXFRStart ( ) { } public boolean verifyAXFR ( Message m , byte [ ] b , TSIGRecord old , boolean required , boolean first ) { } }

Fix:
m . addRecord ( r , ADDITIONAL ) ;
Buggy code:
public final class AdaptiveLogisticRegressionTest extends MahoutTestCase { @ Test public void testTrain ( ) { } private static TrainingExample getExample ( int i , Random gen , Vector beta ) { Vector data = new DenseVector ( 200 ) ; for ( Vector . Element element : data ) { element . set ( ( ( gen . nextDouble ( ) ) < 0.3 ? 1 : 0 ) ) ; } double p = 1 // ( 1 + ( Math . exp ( ( 1.5 - ( data . dot ( beta ) ) ) ) ) ) ; int target = 0 ; if ( ( gen . nextDouble ( ) ) < p ) { target = 1 ; } <START_BUG> return new AdaptiveLogisticRegression . TrainingExample ( i , target , data ) ; <END_BUG> } @ Test public void copyLearnsAsExpected ( ) { } }

Fix:
return new AdaptiveLogisticRegression . TrainingExample ( i , null , target , data ) ;
Buggy code:
public class GameScreen implements Screen { public static CoreGame game ; private static Stage stage ; private static Stage mapStage ; public static SpriteBatch sb ; public static Game_Map_Manager mapManager ; private static ShapeRenderer shapeRend = new ShapeRenderer ( ) ; public static MapInputProcessor mapInput ; public static void create ( ) { } public static JSONObject getJSONData ( ) { } public static void createCoreGame ( Station p1Station , Station p2Station ) { if ( LocomotionCommotion . isReplay ) { <START_BUG> JSONObject gameData = GameScreen . getJSONData ( ) ; <END_BUG> GameScreen . game = new com . TeamJKG . LocomotionCommotion . Replay . ReplayGame ( LocomotionCommotion . player1name , LocomotionCommotion . player2name , gameData ) ; } else { GameScreen . game = new com . TeamJKG . LocomotionCommotion . Game . NewGame ( LocomotionCommotion . player1name , LocomotionCommotion . player2name , p1Station , p2Station , LocomotionCommotion . turnChoice ) ; } GameScreenUI . refreshResources ( ) ; } @ Override public void render ( float delta ) { } @ Override public void resize ( int width , int height ) { } @ Override public void show ( ) { } @ Override public void hide ( ) { } @ Override public void pause ( ) { } @ Override public void resume ( ) { } public static void resetStage ( ) { } @ Override public void dispose ( ) { } public static Stage getStage ( ) { } public static Stage getMapStage ( ) { } public static ShapeRenderer getRend ( ) { } public static void setStage ( Stage stage ) { } public void resetScreen ( ) { } }

Fix:
JSONObject gameData = ( ( JSONObject ) ( GameScreen . getJSONData ( ) . get ( "turns" ) ) ) ;
Buggy code:
public class PointcutResidueTestCase extends WeaveTestCase { public PointcutResidueTestCase ( String name ) { } String [ ] none = new String [ 0 ] ; public void testArgResidue1 ( ) throws IOException { } public void testArgResidue2 ( ) throws IOException { } public void testArgResidue3 ( ) throws IOException { } public void testMultiArgState ( ) throws IOException { } public void testAdd ( ) throws IOException { } public void testNot ( ) throws IOException { } public void testState ( ) throws IOException { } public void testNoResidueArgs ( ) throws IOException { } public void testCflowState ( ) throws IOException { } private void checkDynamicWeave ( String label , String pointcutSource ) throws IOException { } private void checkMultiArgWeave ( String label , String pointcutSource ) throws IOException { } private void checkWeave ( String label , String filename , String pointcutSource , String [ ] formalTypes , String [ ] formalNames ) throws IOException { final Pointcut sp = Pointcut . fromString ( pointcutSource ) ; final Pointcut rp = sp . resolve ( new SimpleScope ( world , SimpleScope . makeFormalBindings ( UnresolvedType . forNames ( formalTypes ) , formalNames ) ) ) ; ShadowMunger pp = new BcelAdvice ( AdviceKind . Before , rp , MemberImpl . method ( UnresolvedType . forName ( "Aspect" ) , Modifier . STATIC , "ajc_before_0" , MemberImpl . typesToSignature ( VOID , UnresolvedType . forNames ( formalTypes ) , false ) ) , 0 , ( - 1 ) , ( - 1 ) , null , null ) ; ResolvedType inAspect = world . resolve ( "Aspect" ) ; <START_BUG> CrosscuttingMembers xcut = new CrosscuttingMembers ( inAspect ) ; <END_BUG> inAspect . crosscuttingMembers = xcut ; ShadowMunger cp = pp . concretize ( inAspect , world , null ) ; xcut . addConcreteShadowMunger ( cp ) ; weaveTest ( new String [ ] { filename } , label , xcut . getShadowMungers ( ) ) ; checkSerialize ( rp ) ; } public void weaveTest ( String name , String outName , ShadowMunger planner ) throws IOException { } public void checkSerialize ( Pointcut p ) throws IOException { } }

Fix:
CrosscuttingMembers xcut = new CrosscuttingMembers ( inAspect , true ) ;
Buggy code:
public class MultivariateSummaryStatisticsTest extends TestCase { public MultivariateSummaryStatisticsTest ( String name ) { } public static Test suite ( ) { } public void testSetterInjection ( ) throws Exception { } public void testSetterIllegalState ( ) throws Exception { } static class sumMean implements StorelessUnivariateStatistic { private static final long serialVersionUID = 6492471391340853423L ; private double sum = 0 ; private long n = 0 ; public double evaluate ( double [ ] values , int begin , int length ) { } public double evaluate ( double [ ] values ) { } public void clear ( ) { } public long getN ( ) { } public double getResult ( ) { } public void increment ( double d ) { } public void incrementAll ( double [ ] values , int start , int length ) { } public void incrementAll ( double [ ] values ) { } } public void testDimension ( ) { } public void testStats ( ) throws DimensionMismatchException { } public void testN0andN1Conditions ( ) throws Exception { } public void testNaNContracts ( ) throws DimensionMismatchException { } public void testSerialization ( ) throws DimensionMismatchException { } public void testEqualsAndHashCode ( ) throws DimensionMismatchException { MultivariateSummaryStatistics u = new MultivariateSummaryStatistics ( 2 , true ) ; MultivariateSummaryStatistics t = null ; int emptyHash = u . hashCode ( ) ; assertTrue ( u . equals ( u ) ) ; assertFalse ( u . equals ( t ) ) ; <START_BUG> assertFalse ( u . equals ( new Double ( 0 ) ) ) ; <END_BUG> t = new MultivariateSummaryStatistics ( 2 , true ) ; assertTrue ( t . equals ( u ) ) ; assertTrue ( u . equals ( t ) ) ; assertEquals ( emptyHash , t . hashCode ( ) ) ; u . addValue ( new double [ ] { 2.0 , 1.0 } ) ; u . addValue ( new double [ ] { 1.0 , 1.0 } ) ; u . addValue ( new double [ ] { 3.0 , 1.0 } ) ; u . addValue ( new double [ ] { 4.0 , 1.0 } ) ; u . addValue ( new double [ ] { 5.0 , 1.0 } ) ; assertFalse ( t . equals ( u ) ) ; assertFalse ( u . equals ( t ) ) ; assertTrue ( ( ( u . hashCode ( ) ) != ( t . hashCode ( ) ) ) ) ; t . addValue ( new double [ ] { 2.0 , 1.0 } ) ; t . addValue ( new double [ ] { 1.0 , 1.0 } ) ; t . addValue ( new double [ ] { 3.0 , 1.0 } ) ; t . addValue ( new double [ ] { 4.0 , 1.0 } ) ; t . addValue ( new double [ ] { 5.0 , 1.0 } ) ; assertTrue ( t . equals ( u ) ) ; assertTrue ( u . equals ( t ) ) ; assertEquals ( u . hashCode ( ) , t . hashCode ( ) ) ; u . clear ( ) ; t . clear ( ) ; assertTrue ( t . equals ( u ) ) ; assertTrue ( u . equals ( t ) ) ; assertEquals ( emptyHash , t . hashCode ( ) ) ; assertEquals ( emptyHash , u . hashCode ( ) ) ; } }

Fix:
assertFalse ( u . equals ( Double . valueOf ( 0 ) ) ) ;
Buggy code:
public class WeldEjbInjectionServices implements EjbInjectionServices { private final ServiceRegistry serviceRegistry ; private final EEModuleDescription moduleDescription ; public WeldEjbInjectionServices ( ServiceRegistry serviceRegistry , EEModuleDescription moduleDescription ) { } @ Override public Object resolveEjb ( InjectionPoint injectionPoint ) { EJB ejb = injectionPoint . getAnnotated ( ) . getAnnotation ( EJB . class ) ; if ( ejb == null ) { throw new RuntimeException ( ( "@Ejb<seq2seq4repair_space>annotation<seq2seq4repair_space>not<seq2seq4repair_space>found<seq2seq4repair_space>on<seq2seq4repair_space>" + ( injectionPoint . getMember ( ) ) ) ) ; } if ( ( ( injectionPoint . getMember ( ) ) instanceof Method ) && ( ( ( ( Method ) ( injectionPoint . getMember ( ) ) ) . getParameterTypes ( ) . length ) != 1 ) ) { throw new IllegalArgumentException ( ( "Injection<seq2seq4repair_space>point<seq2seq4repair_space>represents<seq2seq4repair_space>a<seq2seq4repair_space>method<seq2seq4repair_space>which<seq2seq4repair_space>doesn't<seq2seq4repair_space>follow<seq2seq4repair_space>JavaBean<seq2seq4repair_space>conventions<seq2seq4repair_space>(must<seq2seq4repair_space>have<seq2seq4repair_space>exactly<seq2seq4repair_space>one<seq2seq4repair_space>parameter)<seq2seq4repair_space>" + injectionPoint ) ) ; } if ( ! ( ejb . lookup ( ) . equals ( "" ) ) ) { <START_BUG> final ServiceName ejbServiceName = ContextNames . serviceNameOfContext ( moduleDescription . getAppName ( ) , moduleDescription . getModuleName ( ) , moduleDescription . getModuleName ( ) , ejb . lookup ( ) ) ; <END_BUG> ServiceController < ? > controller = serviceRegistry . getRequiredService ( ejbServiceName ) ; ManagedReferenceFactory factory = ( ( ManagedReferenceFactory ) ( controller . getValue ( ) ) ) ; return factory . getReference ( ) . getInstance ( ) ; } else { throw new RuntimeException ( ( "Currently<seq2seq4repair_space>only<seq2seq4repair_space>the<seq2seq4repair_space>lookup<seq2seq4repair_space>attribute<seq2seq4repair_space>is<seq2seq4repair_space>supported<seq2seq4repair_space>on<seq2seq4repair_space>CDI<seq2seq4repair_space>@EJB<seq2seq4repair_space>injection<seq2seq4repair_space>" + injectionPoint ) ) ; } } @ Override public void cleanup ( ) { } }

Fix:
final ServiceName ejbServiceName = ContextNames . serviceNameOfContext ( moduleDescription . getApplicationName ( ) , moduleDescription . getModuleName ( ) , moduleDescription . getModuleName ( ) , ejb . lookup ( ) ) ;
Buggy code:
public class Projection extends SpelNodeImpl { public Projection ( Token payload ) { } @ Override public TypedValue getValueInternal ( ExpressionState state ) throws EvaluationException { } @ Override public String toStringAST ( ) { StringBuilder sb = new StringBuilder ( ) ; <START_BUG> return sb . append ( "!{" ) . append ( getChild ( 0 ) . toStringAST ( ) ) . append ( "}" ) . toString ( ) ; <END_BUG> } }

Fix:
return sb . append ( "![" ) . append ( getChild ( 0 ) . toStringAST ( ) ) . append ( "]" ) . toString ( ) ;
Buggy code:
public class QueryMaterial extends PageParentClass { public QueryMaterial ( ) { } public List < List < String > > GetManufactureStorageRecord ( ) { } private List < List < String > > GetAllRecordWithoutEnsure ( IStorageTableInterface hTableHandle ) { List < List < String > > rtnRst = new ArrayList < List < String > > ( ) ; <START_BUG> String [ ] sqlKeyList = new String [ ] { "Bar_Code" , "Batch_Lot" , "IN_QTY" , "OUT_QTY" , "Price_Per_Unit" , "Total_Price" , "vendor_name" , "id" , "isEnsure" } ; <END_BUG> hTableHandle . QueryRecordByFilterKeyList ( Arrays . asList ( "isEnsure" ) , Arrays . asList ( "0" ) ) ; for ( int keywordIdx = 0 ; keywordIdx < ( sqlKeyList . length ) ; keywordIdx ++ ) { rtnRst . add ( hTableHandle . getDBRecordList ( sqlKeyList [ keywordIdx ] ) ) ; } return rtnRst ; } }

Fix:
String [ ] sqlKeyList = new String [ ] { "Bar_Code" , "Batch_Lot" , "po_name" , "IN_QTY" , "Price_Per_Unit" , "Total_Price" , "vendor_name" , "id" , "isEnsure" } ;
Buggy code:
public abstract class Definer extends Task { private String name ; private String value ; private File file ; private String resource ; private Delegate cpDelegate ; public void setReverseLoader ( boolean reverseLoader ) { } public String getName ( ) { } public Path getClasspath ( ) { } public File getFile ( ) { } public String getResource ( ) { } public boolean isReverseLoader ( ) { } public String getLoaderId ( ) { } public String getClasspathId ( ) { } public void setClasspath ( Path classpath ) { } public Path createClasspath ( ) { } public void setClasspathRef ( Reference r ) { } public void setLoaderRef ( Reference r ) { } public void execute ( ) throws BuildException { } private void addDefinition ( ClassLoader al , String name , String value ) throws BuildException { try { Class c = al . loadClass ( value ) ; AntClassLoader . initializeClass ( c ) ; addDefinition ( name , c ) ; } catch ( ClassNotFoundException cnfe ) { String msg = ( ( ( getTaskName ( ) ) + "<seq2seq4repair_space>class<seq2seq4repair_space>" ) + value ) + "<seq2seq4repair_space>cannot<seq2seq4repair_space>be<seq2seq4repair_space>found" ; throw new BuildException ( msg , cnfe , getLocation ( ) ) ; } catch ( NoClassDefFoundError ncdfe ) { <START_BUG> String msg = ( ( ( ( getTaskName ( ) ) + "A<seq2seq4repair_space>class<seq2seq4repair_space>needed<seq2seq4repair_space>on<seq2seq4repair_space>loading<seq2seq4repair_space>by<seq2seq4repair_space>class<seq2seq4repair_space>" ) + value ) + "<seq2seq4repair_space>cannot<seq2seq4repair_space>be<seq2seq4repair_space>found:<seq2seq4repair_space>" ) + ( ncdfe . getMessage ( ) ) ; <END_BUG> throw new BuildException ( msg , ncdfe , location ) ; } } private ClassLoader createLoader ( ) { } public void setFile ( File file ) { } public void setResource ( String res ) { } public void setName ( String name ) { } public String getClassname ( ) { } public void setClassname ( String v ) { } protected abstract void addDefinition ( String name , Class c ) { } public void init ( ) throws BuildException { } }

Fix:
String msg = ( ( ( ( getTaskName ( ) ) + ":<seq2seq4repair_space>A<seq2seq4repair_space>class<seq2seq4repair_space>needed<seq2seq4repair_space>by<seq2seq4repair_space>class<seq2seq4repair_space>" ) + value ) + "<seq2seq4repair_space>cannot<seq2seq4repair_space>be<seq2seq4repair_space>found:<seq2seq4repair_space>" ) + ( ncdfe . getMessage ( ) ) ;
Buggy code:
public class ScrollBar extends Widget { Scrollable parent ; int increment ; int pageIncrement ; ScrollBar ( Scrollable parent , int style ) { } public void addSelectionListener ( SelectionListener listener ) { } static int checkStyle ( int style ) { } void createWidget ( ) { } void destroyWidget ( ) { } Rectangle getBounds ( ) { } public boolean getEnabled ( ) { } public int getIncrement ( ) { } public int getMaximum ( ) { } public int getMinimum ( ) { } public int getPageIncrement ( ) { } public Scrollable getParent ( ) { } public int getSelection ( ) { } public Point getSize ( ) { } public int getThumb ( ) { } public Rectangle getThumbBounds ( ) { } public Rectangle getThumbTrackBounds ( ) { } public boolean getVisible ( ) { } int hwndScrollBar ( ) { } public boolean isEnabled ( ) { } public boolean isVisible ( ) { } void releaseHandle ( ) { } void releaseParent ( ) { } public void removeSelectionListener ( SelectionListener listener ) { } int scrollBarType ( ) { } public void setEnabled ( boolean enabled ) { } public void setIncrement ( int value ) { } public void setMaximum ( int value ) { } public void setMinimum ( int value ) { } public void setPageIncrement ( int value ) { } boolean SetScrollInfo ( int hwnd , int flags , SCROLLINFO info , boolean fRedraw ) { } public void setSelection ( int selection ) { } public void setThumb ( int value ) { } public void setValues ( int selection , int minimum , int maximum , int thumb , int increment , int pageIncrement ) { } public void setVisible ( boolean visible ) { } LRESULT wmScrollChild ( int wParam , int lParam ) { int code = OS . LOWORD ( wParam ) ; if ( code == ( OS . SB_ENDSCROLL ) ) return null ; Event event = new Event ( ) ; switch ( code ) { case OS . SB_THUMBPOSITION : event . detail = SWT . NONE ; break ; case OS . SB_THUMBTRACK : event . detail = SWT . DRAG ; break ; case OS . SB_TOP : event . detail = SWT . HOME ; break ; case OS . SB_BOTTOM : event . detail = SWT . END ; break ; case OS . SB_LINEDOWN : event . detail = SWT . ARROW_DOWN ; break ; case OS . SB_LINEUP : event . detail = SWT . ARROW_UP ; break ; case OS . SB_PAGEDOWN : event . detail = SWT . PAGE_DOWN ; break ; case OS . SB_PAGEUP : event . detail = SWT . PAGE_UP ; break ; } <START_BUG> sendEvent ( Selection , event ) ; <END_BUG> return null ; } }

Fix:
sendSelectionEvent ( Selection , event , true ) ;
Buggy code:
public class Test { static final Function slidesFuncA = ( double x ) -> x * ( Math . pow ( Math . E , ( 2 * x ) ) ) ; static final FancyFunc slidesRunge = ( double x , double y ) -> ( Math . sin ( x ) ) - y ; public static void main ( String [ ] args ) { <START_BUG> Main . partB ( funcB , 0 , Math . PI , ( 0.05 * ( Math . PI ) ) , 1 ) ; <END_BUG> } public static void testGraphs ( ) { } }

Fix:
Main . partB ( Test . slidesRunge , 0 , Math . PI , ( 0.05 * ( Math . PI ) ) , 1 ) ;
Buggy code:
public class TestFrenchAnalyzer extends BaseTokenStreamTestCase { public void testAnalyzer ( ) throws Exception { } @ Deprecated public void testAnalyzer30 ( ) throws Exception { } public void testReusableTokenStream ( ) throws Exception { } public void testExclusionTableViaCtor ( ) throws Exception { } public void testElision ( ) throws Exception { } @ Deprecated public void testBuggyStopwordsCasing ( ) throws IOException { } public void testStopwordsCasing ( ) throws IOException { } public void testRandomStrings ( ) throws Exception { <START_BUG> checkRandomData ( random ( ) , new FrenchAnalyzer ( TEST_VERSION_CURRENT ) , ( 10000 * ( RANDOM_MULTIPLIER ) ) ) ; <END_BUG> } public void testAccentInsensitive ( ) throws Exception { } }

Fix:
checkRandomData ( random ( ) , new FrenchAnalyzer ( TEST_VERSION_CURRENT ) , ( 1000 * ( RANDOM_MULTIPLIER ) ) ) ;
Buggy code:
public class WSDeploymentAspectParserTestCase extends TestCase { @ Test public void test ( ) throws Exception { InputStream is = getXmlUrl ( "jbossws-deployment-aspects-example.xml" ) . openStream ( ) ; try { <START_BUG> List < DeploymentAspect > das = WSDeploymentAspectParser . parse ( is ) ; <END_BUG> assertEquals ( 4 , das . size ( ) ) ; boolean da1Found = false ; boolean da2Found = false ; boolean da3Found = false ; boolean da4Found = false ; for ( DeploymentAspect da : das ) { if ( da instanceof TestDA2 ) { da2Found = true ; TestDA2 da2 = ( ( TestDA2 ) ( da ) ) ; assertEquals ( "myString" , da2 . getTwo ( ) ) ; } else if ( da instanceof TestDA3 ) { da3Found = true ; TestDA3 da3 = ( ( TestDA3 ) ( da ) ) ; assertNotNull ( da3 . getList ( ) ) ; assertTrue ( da3 . getList ( ) . contains ( "One" ) ) ; assertTrue ( da3 . getList ( ) . contains ( "Two" ) ) ; } else if ( da instanceof TestDA4 ) { da4Found = true ; TestDA4 da4 = ( ( TestDA4 ) ( da ) ) ; assertEquals ( true , da4 . isBool ( ) ) ; assertNotNull ( da4 . getMap ( ) ) ; assertEquals ( 1 , ( ( int ) ( da4 . getMap ( ) . get ( "One" ) ) ) ) ; assertEquals ( 3 , ( ( int ) ( da4 . getMap ( ) . get ( "Three" ) ) ) ) ; } else if ( da instanceof TestDA1 ) { da1Found = true ; } } assertTrue ( da1Found ) ; assertTrue ( da2Found ) ; assertTrue ( da3Found ) ; assertTrue ( da4Found ) ; } finally { if ( is != null ) { is . close ( ) ; } } } URL getXmlUrl ( String xmlName ) { } URL getResourceUrl ( String resourceName ) { } }

Fix:
List < DeploymentAspect > das = WSDeploymentAspectParser . parse ( is , this . getClass ( ) . getClassLoader ( ) ) ;
Buggy code:
public class CovReport extends Task { private File home = null ; private String format = null ; private File tofile = null ; private String type = null ; private Integer percent = null ; private String filters = null ; private File snapshot = null ; private Path sourcePath = null ; private boolean includeSource = true ; private Path coveragePath = null ; private CovReport . Reference reference = null ; public void setHome ( File value ) { } public static class ReportFormat extends EnumeratedAttribute { public String [ ] getValues ( ) { } } public void setFormat ( CovReport . ReportFormat value ) { } public static class ReportType extends EnumeratedAttribute { public String [ ] getValues ( ) { } } public void setType ( CovReport . ReportType value ) { } public void setIncludesource ( boolean value ) { } public void setPercent ( Integer value ) { } public void setFilters ( String values ) { } public Path createSourcepath ( ) { } public void setSnapshot ( File value ) { } public void setTofile ( File value ) { } public Path createCoveragepath ( ) { } public CovReport . Reference createReference ( ) { } public CovReport ( ) { } protected void checkOptions ( ) throws BuildException { } public void execute ( ) throws BuildException { checkOptions ( ) ; try { Commandline cmdl = new Commandline ( ) ; cmdl . setExecutable ( new File ( home , "jpcovreport" ) . getAbsolutePath ( ) ) ; String [ ] params = getParameters ( ) ; for ( int i = 0 ; i < ( params . length ) ; i ++ ) { cmdl . createArgument ( ) . setValue ( params [ i ] ) ; } LogStreamHandler handler = new LogStreamHandler ( this , Project . MSG_INFO , Project . MSG_WARN ) ; Execute exec = new Execute ( handler ) ; <START_BUG> log ( cmdl . toString ( ) , MSG_VERBOSE ) ; <END_BUG> exec . setCommandline ( cmdl . getCommandline ( ) ) ; int exitValue = exec . execute ( ) ; if ( exitValue != 0 ) { throw new BuildException ( ( ( "JProbe<seq2seq4repair_space>Coverage<seq2seq4repair_space>Report<seq2seq4repair_space>failed<seq2seq4repair_space>(" + exitValue ) + ")" ) ) ; } log ( ( "coveragePath:<seq2seq4repair_space>" + ( coveragePath ) ) , MSG_VERBOSE ) ; log ( ( "format:<seq2seq4repair_space>" + ( format ) ) , MSG_VERBOSE ) ; if ( ( ( reference ) != null ) && ( "xml" . equals ( format ) ) ) { reference . createEnhancedXMLReport ( ) ; } } catch ( IOException e ) { throw new BuildException ( "Failed<seq2seq4repair_space>to<seq2seq4repair_space>execute<seq2seq4repair_space>JProbe<seq2seq4repair_space>Coverage<seq2seq4repair_space>Report." , e ) ; } } protected String [ ] getParameters ( ) { } public class Reference { protected Path classPath ; protected ReportFilters filters ; public Path createClasspath ( ) { } public ReportFilters createFilters ( ) { } protected void createEnhancedXMLReport ( ) throws BuildException { } } }

Fix:
log ( cmdl . describeCommand ( ) , MSG_VERBOSE ) ;
Buggy code:
class PatchXml_1_0 extends PatchXmlUtils implements XMLStreamConstants , XMLElementReader < PatchXml . Result < PatchMetadataResolver > > , XMLElementWriter < Patch > { @ Override public void writeContent ( final XMLExtendedStreamWriter writer , final Patch patch ) throws XMLStreamException { } @ Override public void readElement ( XMLExtendedStreamReader reader , PatchXml . Result < PatchMetadataResolver > factory ) throws XMLStreamException { final PatchBuilder builder = new PatchBuilder ( ) ; <START_BUG> doReadElement ( reader , builder , factory . getOriginalIdentity ( ) ) ; <END_BUG> factory . setResult ( builder ) ; } }

Fix:
doReadElement ( reader , builder ) ;
Buggy code:
public abstract class Widget extends SWTObject { private Widget parent = null ; private int style = 0 ; private Object data = null ; private boolean disposed = false ; private Properties dataProperties = null ; private ListenerTable listenerTable = new ListenerTable ( this ) ; public Widget ( Widget parent , int style ) throws SWTException { } public void addListener ( int eventType , Listener listener ) throws SWTException { } public void addDisposeListener ( DisposeListener listener ) throws SWTException { } protected void addTypedListener ( TypedListener listener , int ... eventTypes ) throws SWTException { } private void checkThread ( ) throws SWTException { } private void checkDisposed ( ) throws SWTException { } protected void checkSubclass ( ) throws SWTException { } protected void checkWidget ( ) throws SWTException { } public void dispose ( ) throws SWTException { } public Object getData ( ) throws SWTException { } public Object getData ( String key ) throws SWTException { } public Display getDisplay ( ) throws SWTException { if ( isDisposed ( ) ) { <START_BUG> throw new SWTException ( SWT . ERROR_DEVICE_DISPOSED ) ; <END_BUG> } return this . parent . getDisplay ( ) ; } public Listener [ ] getListeners ( int eventType ) throws SWTException { } public int getStyle ( ) throws SWTException { } public boolean isDisposed ( ) { } public boolean isListening ( int eventType ) throws SWTException { } public void notifyListeners ( int eventType , Event event ) throws SWTException { } public void removeListener ( int eventType , Listener listener ) throws SWTException { } public void removeDisposeListener ( DisposeListener listener ) throws SWTException { } protected void removeTypedListener ( TypedListener listener , int ... eventTypes ) throws SWTException { } public void reskin ( int flags ) throws SWTException { } public void setData ( Object data ) throws SWTException { } public void setData ( String key , Object value ) throws SWTException { } @ Override public String toString ( ) { } }

Fix:
throw new SWTException ( SWT . ERROR_WIDGET_DISPOSED ) ;
Buggy code:
public class MaxStarterTest { private MaxCore fMax ; @ Before public void createMax ( ) { } @ After public void forgetMax ( ) { } public static class TwoTests { @ Test public void succeed ( ) { } @ Test public void dontSucceed ( ) { } } @ Test public void twoTestsNotRunComeBackInRandomOrder ( ) { } @ Test public void preferNewTests ( ) { } @ Test public void preferNewTestsOverTestsThatFailed ( ) { } @ Test public void preferRecentlyFailed ( ) { } @ Test public void sortTestsInMultipleClasses ( ) { } public static class TwoUnEqualTests { @ Test public void slow ( ) throws InterruptedException { } @ Test public void fast ( ) throws InterruptedException { } } @ Test public void preferFast ( ) { } @ Test public void remember ( ) throws CouldNotReadCoreException { } @ Test public void listenersAreCalledCorrectlyInTheFaceOfFailures ( ) throws Exception { } @ Test public void testsAreOnlyIncludedOnceWhenExpandingForSorting ( ) throws Exception { } public static class TwoOldTests extends TestCase { public void testOne ( ) { } public void testTwo ( ) { } } @ Test public void junit3TestsAreRunOnce ( ) throws Exception { } @ Test public void saffSqueezeExample ( ) throws Exception { } @ Test public void testCountsMatchUp ( ) { } @ Test public void testCountsStandUpToFiltration ( ) { } private void assertFilterLeavesTestUnscathed ( Class < ? > testClass ) { } @ Test public void parseClass_whenCantParse ( ) { } @ Test public void parseMethod_whenCantParse ( ) { <START_BUG> Assert . assertNull ( TEST_MECHANISM . parseMethod ( ) ) ; <END_BUG> } @ Test public void buildRunner_whenCantParse ( ) { } @ Test ( expected = IllegalArgumentException . class ) public void createSuiteDescription_whenZeroLength ( ) { } }

Fix:
Assert . assertNull ( TEST_MECHANISM . getMethodName ( ) ) ;
Buggy code:
public class FileSystemMonitorTestCase extends AbstractMonitorTestCase { public FileSystemMonitorTestCase ( String name ) { } @ Override protected void tearDown ( ) throws Exception { } public void testMonitor ( ) { } private void checkFile ( String label , File file , Collection < File > files ) { <START_BUG> for ( int i = 0 ; i < 5 ; i ++ ) { <END_BUG> if ( files . contains ( file ) ) { return ; } sleepHandleInterruped ( pauseTime ) ; } fail ( ( ( ( label + "<seq2seq4repair_space>" ) + file ) + "<seq2seq4repair_space>not<seq2seq4repair_space>found" ) ) ; } }

Fix:
for ( int i = 0 ; i < 20 ; i ++ ) {
Buggy code:
public class XMLParser extends RubyBasic { private static final RhoLogger LOG = ( RhoLogger . RHO_STRIP_LOG ) ? new RhoEmptyLogger ( ) : new RhoLogger ( "XMLParser" ) ; RubyArray m_arEvents = new RubyArray ( ) ; int m_nCurPos = 0 ; XMLParser ( RubyClass c ) { } private static RubyValue alloc ( RubyValue receiver ) { } RubyValue createEndDocumentEvent ( ) { } void addEvent ( RubyValue valEvent ) { } void addEvent ( String strName ) { } void addEvent ( String strName , RubyValue arg1 ) { } void addEvent ( String strName , RubyValue arg1 , RubyValue arg2 ) { } static class XmlSAXHandler extends DefaultHandler { XMLParser m_parser ; XmlSAXHandler ( XMLParser parser ) { } public void startDocument ( ) { } public void endDocument ( ) { } public void startElement ( String uri , String localName , String qname , Attributes attr ) { } public void endElement ( String uri , String localName , String qname ) { } public void characters ( char [ ] ch , int start , int length ) { } public void ignorableWhitespace ( char [ ] ch , int start , int length ) { } public void startPrefixMapping ( String prefix , String uri ) { } public void endPrefixMapping ( String prefix ) { } public void warning ( SAXParseException spe ) { } public void fatalError ( SAXParseException spe ) throws SAXException { } } private void parse ( String strXML ) throws Exception { <START_BUG> InputStream in = new ByteArrayInputStream ( strXML . getBytes ( ) ) ; <END_BUG> parse ( in ) ; } private void parse ( InputStream in ) throws Exception { } private RubyValue pull ( ) { } public static void initMethods ( RubyClass klass ) { } }

Fix:
InputStream in = new ByteArrayInputStream ( strXML . getBytes ( "UTF-8" ) ) ;