nus-yam/ex-repair huggingface dataset:
Buggy code:
public class PPSemanticHighlightingCalculator implements ISemanticHighlightingCalculator { private static class ZeroLengthFilteredAcceptorWrapper implements IHighlightedPositionAcceptor { private IHighlightedPositionAcceptor wrapped ; public ZeroLengthFilteredAcceptorWrapper ( IHighlightedPositionAcceptor wrapped ) { } public void addPosition ( int offset , int length , String ... id ) { } } @ Inject private PPDocumentationParser docParser ; private PPGrammarAccess grammarAccess ; private AbstractRule ruleVariable ; private AbstractRule ruleSqText ; private AbstractRule ruleDQ_STRING ; private AbstractRule ruleExpression ; private AbstractRule ruleUNION_VARIABLE_OR_NAME ; private AbstractRule ruleUnionNameOrReference ; private final PolymorphicDispatcher < Void > highlightDispatcher = new PolymorphicDispatcher < Void > ( "highlight" , 2 , 2 , Collections . singletonList ( this ) , new PolymorphicDispatcher . ErrorHandler < Void > ( ) { public Void handle ( Object [ ] params , Throwable e ) { } } ) ; @ Inject public PPSemanticHighlightingCalculator ( IGrammarAccess grammarAccess ) { } public void doHighlight ( Object o , IHighlightedPositionAcceptor acceptor ) { } protected void handleError ( Object [ ] params , Throwable e ) { } public void highlight ( Definition semantic , IHighlightedPositionAcceptor acceptor ) { } public void highlight ( EObject o , IHighlightedPositionAcceptor acceptor ) { } public void highlight ( HostClassDefinition semantic , IHighlightedPositionAcceptor acceptor ) { } public void highlight ( INode o , IHighlightedPositionAcceptor acceptor ) { } public void highlight ( NodeDefinition semantic , IHighlightedPositionAcceptor acceptor ) { } public void highlight ( PuppetManifest model , IHighlightedPositionAcceptor acceptor ) { } public void highlight ( ResourceExpression expr , IHighlightedPositionAcceptor acceptor ) { } private String highlightIDForDocStyle ( int docStyle ) { } private void highlightObject ( EObject semantic , String highlightID , IHighlightedPositionAcceptor acceptor ) { } public boolean isSpecialSpace ( char c ) { } public void provideHighlightingFor ( XtextResource resource , IHighlightedPositionAcceptor acceptor ) { } protected void provideNodeBasedHighlighting ( XtextResource resource , IHighlightedPositionAcceptor acceptor ) { } protected void provideResourceLevelHighlighting ( XtextResource resource , IHighlightedPositionAcceptor acceptor ) { } private void provideSemanticHighlighting ( XtextResource resource , IHighlightedPositionAcceptor acceptor ) { } public void provideTextualHighlighting ( XtextResource resource , IHighlightedPositionAcceptor acceptor ) { ICompositeNode root = resource . getParseResult ( ) . getRootNode ( ) ; String text = root . getText ( ) ; int limit = text . length ( ) ; for ( int i = 0 ; i < limit ; i ++ ) if ( isSpecialSpace ( text . charAt ( i ) ) ) <START_BUG> acceptor . addPosition ( ( ( root . getOffset ( ) ) + i ) , 1 , SPECIAL_SPACE_ID ) ; <END_BUG> } private void setupRules ( ) { } }

Fix:
acceptor . addPosition ( i , 1 , SPECIAL_SPACE_ID ) ;
Buggy code:
public class UtilityTestCase extends TestCase { public UtilityTestCase ( String name ) { } public void disassembleTest ( String name ) throws IOException { <START_BUG> BcelWorld world = new BcelWorld ( "..//bcweaver//bin" ) ; <END_BUG> LazyClassGen clazz = new LazyClassGen ( ( ( BcelObjectType ) ( world . resolve ( name ) ) ) ) ; clazz . print ( ) ; System . out . println ( ) ; } public void testHelloWorld ( ) throws IOException { } public void testFancyHelloWorld ( ) throws IOException { } public static void main ( String [ ] args ) throws IOException { } }

Fix:
BcelWorld world = new BcelWorld ( "..//weaver//bin" ) ;
Buggy code:
public class DeleteDraftPatchSetIT extends AbstractDaemonTest { @ Test public void deletePatchSet ( ) throws Exception { String changeId = createChange ( ) . getChangeId ( ) ; PatchSet ps = getCurrentPatchSet ( changeId ) ; String triplet = "p~master~" + changeId ; ChangeInfo c = get ( triplet ) ; assertThat ( c . id ) . isEqualTo ( triplet ) ; assertThat ( c . status ) . isEqualTo ( NEW ) ; RestResponse r = DeleteDraftPatchSetIT . deletePatchSet ( changeId , ps , adminSession ) ; <START_BUG> assertThat ( r . getEntityContent ( ) ) . isEqualTo ( "Patch<seq2seq4repair_space>set<seq2seq4repair_space>is<seq2seq4repair_space>not<seq2seq4repair_space>a<seq2seq4repair_space>draft." ) ; <END_BUG> assertThat ( r . getStatusCode ( ) ) . isEqualTo ( SC_CONFLICT ) ; } @ Test public void deleteDraftPatchSetNoACL ( ) throws Exception { } @ Test public void deleteDraftPatchSetAndChange ( ) throws Exception { } private String createDraftChangeWith2PS ( ) throws IOException , GitAPIException { } private PatchSet getCurrentPatchSet ( String changeId ) throws OrmException { } private static RestResponse deletePatchSet ( String changeId , PatchSet ps , RestSession s ) throws IOException { } }

Fix:
assertThat ( r . getEntityContent ( ) ) . isEqualTo ( "Patch<seq2seq4repair_space>set<seq2seq4repair_space>is<seq2seq4repair_space>not<seq2seq4repair_space>a<seq2seq4repair_space>draft" ) ;
Buggy code:
public class Jvc extends DefaultCompilerAdapter { public boolean execute ( ) throws TaskException { getLogger ( ) . debug ( "Using<seq2seq4repair_space>jvc<seq2seq4repair_space>compiler" ) ; <START_BUG> Path classpath = new Path ( m_project ) ; <END_BUG> if ( ( m_bootclasspath ) != null ) { classpath . append ( m_bootclasspath ) ; } classpath . addExtdirs ( m_extdirs ) ; if ( ( ( m_bootclasspath ) == null ) || ( ( m_bootclasspath . size ( ) ) == 0 ) ) { m_includeJavaRuntime = true ; } else { } classpath . append ( getCompileClasspath ( ) ) ; classpath . append ( src ) ; Commandline cmd = new Commandline ( ) ; cmd . setExecutable ( "jvc" ) ; if ( ( m_destDir ) != null ) { cmd . createArgument ( ) . setValue ( "//d" ) ; cmd . createArgument ( ) . setFile ( m_destDir ) ; } cmd . createArgument ( ) . setValue ( "//cp:p" ) ; cmd . createArgument ( ) . setPath ( classpath ) ; cmd . createArgument ( ) . setValue ( "//x-" ) ; cmd . createArgument ( ) . setValue ( "//nomessage" ) ; cmd . createArgument ( ) . setValue ( "//nologo" ) ; if ( m_debug ) { cmd . createArgument ( ) . setValue ( "//g" ) ; } if ( m_optimize ) { cmd . createArgument ( ) . setValue ( "//O" ) ; } if ( m_verbose ) { cmd . createArgument ( ) . setValue ( "//verbose" ) ; } addCurrentCompilerArgs ( cmd ) ; int firstFileName = cmd . size ( ) ; logAndAddFilesToCompile ( cmd ) ; return ( executeExternalCompile ( cmd . getCommandline ( ) , firstFileName ) ) == 0 ; } }

Fix:
Path classpath = new Path ( ) ;
Buggy code:
public class ConsumesRequestConditionTests { @ Test public void consumesMatch ( ) { } @ Test public void negatedConsumesMatch ( ) { } @ Test public void consumesWildcardMatch ( ) { } @ Test public void consumesMultipleMatch ( ) { } @ Test public void consumesSingleNoMatch ( ) { } @ Test public void compareToSingle ( ) { } @ Test public void compareToMultiple ( ) { } @ Test public void combine ( ) { } @ Test public void combineWithDefault ( ) { ConsumesRequestCondition condition1 = new ConsumesRequestCondition ( "text//plain" ) ; <START_BUG> ConsumesRequestCondition condition2 = new ConsumesRequestCondition ( "*//*" ) ; <END_BUG> ConsumesRequestCondition result = condition1 . combine ( condition2 ) ; assertEquals ( condition1 , result ) ; } @ Test public void parseConsumesAndHeaders ( ) { } @ Test public void parseConsumesDefault ( ) { } @ Test public void parseConsumesDefaultAndHeaders ( ) { } @ Test public void getMatchingCondition ( ) { } private void assertConditions ( ConsumesRequestCondition condition , String ... expected ) { } }

Fix:
ConsumesRequestCondition condition2 = new ConsumesRequestCondition ( ) ;
Buggy code:
public class GUIController { LogicFacade logicComponent ; private final int NUM_TASKS = 1 ; private final int NUM_EVENTS = 2 ; private final int NUM_OVERDUE = 3 ; private final int NUM_FLOAT = 4 ; private final int NUM_TODAY_TASKS = 5 ; private final int NUM_TODAY_EVENTS = 6 ; private final int NUM_SEARCH = 7 ; private ArrayList < Task > getTasks ; private ArrayList < Task > getEvents ; private ArrayList < Task > getOverdue ; private ArrayList < Task > getFloat ; private ArrayList < String > getCate ; private ArrayList < Task > getTodayTasks ; private ArrayList < Task > getTodayEvents ; private ArrayList < Task > getFocusList ; private ArrayList < Task > getCompletedTasks ; private ArrayList < Task > getCompletedEvents ; private ArrayList < Task > getCompletedFloat ; private ArrayList < Task > getSearch ; public GUIController ( ) { } void retrieveAllData ( ) { } void retrieveSearch ( ) { <START_BUG> getSearch = logicComponent . retrieveTaskData ( "upcomingToDo" ) ; <END_BUG> } void retrieveCompletes ( ) { } void retrieveTodays ( ) { } ArrayList < Task > retrieveTask ( ) { } ArrayList < Task > getCompletedTasks ( ) { } ArrayList < Task > getCompletedEvents ( ) { } ArrayList < Task > getCompletedFloat ( ) { } void determineList ( int currentList ) { } String executeCommand ( String userInput ) { } ArrayList < Task > getTasksList ( ) { } ArrayList < Task > getEventsList ( ) { } ArrayList < Task > getOverdueList ( ) { } ArrayList < Task > getFloatList ( ) { } ArrayList < String > getCateList ( ) { } ArrayList < Task > getFocusList ( ) { } ArrayList < Task > getTodayT ( ) { } ArrayList < Task > getTodayE ( ) { } ArrayList < Task > getSearchList ( ) { } }

Fix:
getSearch = logicComponent . retrieveSearchData ( ) ;
Buggy code:
public class TransformUtils { private TransformUtils ( ) { } static List < String > checkLegacyModel ( final ModelNode model , final boolean failOnErrors ) throws OperationFailedException { } static ModelNode transformModel ( final ModelNode legacyModel ) { final ModelNode model = new ModelNode ( ) ; for ( Property property : legacyModel . asPropertyList ( ) ) { String name = property . getName ( ) ; final ModelNode legacyValue = property . getValue ( ) ; if ( legacyModel . isDefined ( ) ) { final ModelNode value ; switch ( name ) { case JacORBSubsystemConstants . ORB_GIOP_MINOR_VERSION : name = Constants . ORB_GIOP_VERSION ; value = new ModelNode ( new StringBuilder ( ) . append ( "1." ) . append ( legacyValue ) . toString ( ) ) ; break ; case JacORBSubsystemConstants . ORB_INIT_TRANSACTIONS : if ( legacyValue . asString ( ) . equals ( ON ) ) { value = new ModelNode ( Constants . FULL ) ; } else if ( legacyValue . asString ( ) . equals ( OFF ) ) { value = new ModelNode ( Constants . NONE ) ; } else { value = legacyValue ; } break ; case JacORBSubsystemConstants . ORB_INIT_SECURITY : if ( legacyValue . asString ( ) . equals ( OFF ) ) { value = new ModelNode ( Constants . NONE ) ; } else { value = legacyValue ; } break ; case JacORBSubsystemConstants . SECURITY_SUPPORT_SSL : case JacORBSubsystemConstants . SECURITY_ADD_COMP_VIA_INTERCEPTOR : case JacORBSubsystemConstants . NAMING_EXPORT_CORBALOC : if ( legacyValue . asString ( ) . equals ( ON ) ) { value = new ModelNode ( true ) ; } else { value = new ModelNode ( false ) ; } break ; default : value = legacyValue ; } <START_BUG> if ( ! ( value . equals ( "off" ) ) ) { <END_BUG> model . get ( name ) . set ( value ) ; } } } return model ; } }

Fix:
if ( ! ( value . asString ( ) . equals ( OFF ) ) ) {
Buggy code:
public class PageRequestTarget implements IPageRequestTarget { private final Page page ; public PageRequestTarget ( Page page ) { } public void respond ( RequestCycle requestCycle ) { } public final Page getPage ( ) { } public void detach ( RequestCycle requestCycle ) { <START_BUG> page . internalDetach ( ) ; <END_BUG> } public Object getLock ( RequestCycle requestCycle ) { } @ Override public boolean equals ( Object obj ) { } @ Override public int hashCode ( ) { } @ Override public String toString ( ) { } }

Fix:
page . detach ( ) ;
Buggy code:
public class WeaveOrderTestCase extends WeaveTestCase { public WeaveOrderTestCase ( String name ) { } public void testLexicalOrder ( ) { } public void testLexicalOrderWithAfter ( ) { } public void testSubtypes ( ) { } public void testDominates ( ) { } public void testDominatesHarder ( ) { } private Advice makeConcreteAdvice ( AdviceKind kind , UnresolvedType declaringAspect , UnresolvedType concreteAspect , int lexicalPosition ) { <START_BUG> Advice a1 = new BcelAdvice ( kind , makeResolvedPointcut ( "this(*)" ) , Member . method ( declaringAspect , 0 , "foo" , "()V" ) , 0 , lexicalPosition , lexicalPosition , null , null ) ; <END_BUG> a1 = ( ( Advice ) ( a1 . concretize ( concreteAspect . resolve ( world ) , world , null ) ) ) ; return a1 ; } }

Fix:
Advice a1 = new BcelAdvice ( kind , makeResolvedPointcut ( "this(*)" ) , MemberImpl . method ( declaringAspect , 0 , "foo" , "()V" ) , 0 , lexicalPosition , lexicalPosition , null , null ) ;
Buggy code:
@ RunWith ( Arquillian . class ) public class JaxrsAtomProviderTestCase { @ Deployment public static Archive < ? > deploy ( ) { WebArchive war = ShrinkWrap . create ( WebArchive . class , "jaxrsnoap.war" ) ; war . addPackage ( HttpRequest . class . getPackage ( ) ) ; war . addPackage ( JaxrsAtomProviderTestCase . class . getPackage ( ) ) ; <START_BUG> war . addAsWebResource ( WebXml . get ( ( "<servlet-mapping>\n" + ( ( ( "<seq2seq4repair_space><servlet-name>javax.ws.rs.core.Application<//servlet-name>\n" + "<seq2seq4repair_space><url-pattern>//myjaxrs//*<//url-pattern>\n" ) + "<seq2seq4repair_space><//servlet-mapping>\n" ) + "\n" ) ) ) , "web.xml" ) ; <END_BUG> return war ; } private static String performCall ( String urlPattern ) throws Exception { } @ Test public void testJaxRsWithNoApplication ( ) throws Exception { } }

Fix:
war . addAsWebInfResource ( WebXml . get ( ( "<servlet-mapping>\n" + ( ( ( "<seq2seq4repair_space><servlet-name>javax.ws.rs.core.Application<//servlet-name>\n" + "<seq2seq4repair_space><url-pattern>//myjaxrs//*<//url-pattern>\n" ) + "<seq2seq4repair_space><//servlet-mapping>\n" ) + "\n" ) ) ) , "web.xml" ) ;
Buggy code:
class VariableBinding implements IVariableBinding { private org . eclipse . jdt . internal . compiler . lookup . VariableBinding binding ; private BindingResolver resolver ; private String name ; private ITypeBinding declaringClass ; private ITypeBinding type ; private String key ; VariableBinding ( BindingResolver resolver , org . eclipse . jdt . internal . compiler . lookup . VariableBinding binding ) { } public boolean isField ( ) { } public String getName ( ) { } public ITypeBinding getDeclaringClass ( ) { } public ITypeBinding getType ( ) { } public int getKind ( ) { } public int getModifiers ( ) { } public boolean isDeprecated ( ) { } public boolean isSynthetic ( ) { } public String getKey ( ) { } private void getKey ( BlockScope scope , StringBuffer buffer ) { } public int getVariableId ( ) { } public Object getConstantValue ( ) { <START_BUG> if ( ! ( this . binding . isConstantValue ( ) ) ) { <END_BUG> return null ; } Constant c = this . binding . constant ; switch ( c . typeID ( ) ) { case TypeIds . T_boolean : return Boolean . valueOf ( c . booleanValue ( ) ) ; case TypeIds . T_byte : return new Byte ( c . byteValue ( ) ) ; case TypeIds . T_char : return new Character ( c . charValue ( ) ) ; case TypeIds . T_double : return new Double ( c . doubleValue ( ) ) ; case TypeIds . T_float : return new Float ( c . floatValue ( ) ) ; case TypeIds . T_int : return new Integer ( c . intValue ( ) ) ; case TypeIds . T_long : return new Long ( c . longValue ( ) ) ; case TypeIds . T_short : return new Short ( c . shortValue ( ) ) ; case T_String : return c . stringValue ( ) ; } return null ; } public String toString ( ) { } }

Fix:
if ( ( ! ( this . binding . isConstantValue ( ) ) ) || ( ( this . binding . constant ) == null ) ) {
Buggy code:
public class SYSVIEWSRowFactory extends CatalogRowFactory { private static final String TABLENAME_STRING = "SYSVIEWS" ; protected static final int SYSVIEWS_COLUMN_COUNT = 4 ; protected static final int SYSVIEWS_TABLEID = 1 ; protected static final int SYSVIEWS_VIEWDEFINITION = 2 ; protected static final int SYSVIEWS_CHECKOPTION = 3 ; protected static final int SYSVIEWS_COMPILATION_SCHEMAID = 4 ; protected static final int SYSVIEWS_TABLEID_WIDTH = 36 ; protected static final int SYSVIEWS_INDEX1_ID = 0 ; private static final int [ ] [ ] indexColumnPositions = new int [ ] [ ] { new int [ ] { SYSVIEWSRowFactory . SYSVIEWS_TABLEID } } ; private static final boolean [ ] uniqueness = null ; private static final String [ ] uuids = new String [ ] { "8000004d-00d0-fd77-3ed8-000a0a0b1900" , "80000050-00d0-fd77-3ed8-000a0a0b1900" , "8000004f-00d0-fd77-3ed8-000a0a0b1900" } ; public SYSVIEWSRowFactory ( UUIDFactory uuidf , ExecutionFactory ef , DataValueFactory dvf , boolean convertIdToLower ) { } public ExecRow makeRow ( TupleDescriptor td , TupleDescriptor parent ) throws StandardException { } public TupleDescriptor buildDescriptor ( ExecRow row , TupleDescriptor parentTupleDescriptor , DataDictionary dd ) throws StandardException { } public SystemColumn [ ] buildColumnList ( ) { SystemColumn [ ] columnList = new SystemColumn [ SYSVIEWSRowFactory . SYSVIEWS_COLUMN_COUNT ] ; columnList [ 0 ] = new SystemColumnImpl ( convertIdCase ( "TABLEID" ) , SYSVIEWSRowFactory . SYSVIEWS_TABLEID , 0 , 0 , false , "CHAR" , true , 36 ) ; columnList [ 1 ] = new SystemColumnImpl ( convertIdCase ( "VIEWDEFINITION" ) , SYSVIEWSRowFactory . SYSVIEWS_VIEWDEFINITION , 0 , 0 , false , "LONG<seq2seq4repair_space>VARCHAR" , true , TypeId . LONGVARCHAR_MAXWIDTH ) ; columnList [ 2 ] = new SystemColumnImpl ( convertIdCase ( "CHECKOPTION" ) , SYSVIEWSRowFactory . SYSVIEWS_CHECKOPTION , 0 , 0 , false , "CHAR" , true , 1 ) ; <START_BUG> columnList [ 3 ] = new SystemColumnImpl ( convertIdCase ( "COMPILATIONSCHEMAID" ) , SYSVIEWSRowFactory . SYSVIEWS_COMPILATION_SCHEMAID , 0 , 0 , false , "CHAR" , true , 36 ) ; <END_BUG> return columnList ; } }

Fix:
columnList [ 3 ] = new SystemColumnImpl ( convertIdCase ( "COMPILATIONSCHEMAID" ) , SYSVIEWSRowFactory . SYSVIEWS_COMPILATION_SCHEMAID , 0 , 0 , true , "CHAR" , true , 36 ) ;
Buggy code:
public class SimpleQQParser implements QualityQueryParser { private String qqName ; private String indexField ; ThreadLocal < QueryParser > queryParser = new ThreadLocal < QueryParser > ( ) ; public SimpleQQParser ( String qqName , String indexField ) { } public Query parse ( QualityQuery qq ) throws ParseException { QueryParser qp = queryParser . get ( ) ; if ( qp == null ) { <START_BUG> qp = new QueryParser ( indexField , new org . apache . lucene . analysis . standard . StandardAnalyzer ( Version . LUCENE_CURRENT ) ) ; <END_BUG> queryParser . set ( qp ) ; } return qp . parse ( qq . getValue ( qqName ) ) ; } }

Fix:
qp = new QueryParser ( Version . LUCENE_CURRENT , indexField , new org . apache . lucene . analysis . standard . StandardAnalyzer ( Version . LUCENE_CURRENT ) ) ;
Buggy code:
public class I18nExtractorTest { static final String BASE = ".." ; static final String MODULE = "axelor-core" ; @ Test public void test ( ) { I18nExtractor tools = new I18nExtractor ( ) ; <START_BUG> tools . extract ( Paths . get ( I18nExtractorTest . BASE , I18nExtractorTest . MODULE ) ) ; <END_BUG> } }

Fix:
tools . extract ( Paths . get ( I18nExtractorTest . BASE , I18nExtractorTest . MODULE ) , true ) ;
Buggy code:
public class BlockMetaBaseTest { private class BlockMetaBaseForTest extends BlockMetaBase { public BlockMetaBaseForTest ( long blockId , StorageDir dir ) { } @ Override public long getBlockSize ( ) { } @ Override public String getPath ( ) { } } private static final long TEST_BLOCK_ID = 9 ; private static final String TEST_DIR_PATH = "//mnt//ramdisk//0//" ; private StorageTier mTier ; private StorageDir mDir ; private BlockMetaBaseTest . BlockMetaBaseForTest mBlockMeta ; @ Before public void before ( ) throws IOException { } @ Test public void getBlockIdTest ( ) { } @ Test public void getBlockLocationTest ( ) { <START_BUG> BlockStoreLocation expectedLocation = new BlockStoreLocation ( mTier . getTierAlias ( ) , mDir . getDirIndex ( ) ) ; <END_BUG> Assert . assertEquals ( expectedLocation , mBlockMeta . getBlockLocation ( ) ) ; } @ Test public void getParentDirTest ( ) { } }

Fix:
BlockStoreLocation expectedLocation = new BlockStoreLocation ( mTier . getTierAlias ( ) , mTier . getTierLevel ( ) , mDir . getDirIndex ( ) ) ;
Buggy code:
public class WelcomeScreen extends AppCompatActivity { @ Override protected void onCreate ( Bundle savedInstanceState ) { super . onCreate ( savedInstanceState ) ; setContentView ( activity_welcome_screen ) ; final Context context = getApplicationContext ( ) ; Button btn_Skills = ( ( Button ) ( findViewById ( btn_skills ) ) ) ; btn_Skills . setOnClickListener ( new Button . OnClickListener ( ) { @ Override public void onClick ( View v ) { <START_BUG> Intent intent = new Intent ( context , SkillActivty . class ) ; <END_BUG> startActivityForResult ( intent , SKILL_ACTIVITY ) ; } } ) ; Button btn_Strain = ( ( Button ) ( findViewById ( btn_strains ) ) ) ; btn_Strain . setOnClickListener ( new Button . OnClickListener ( ) { @ Override public void onClick ( View v ) { Intent intent = new Intent ( context , StrainActivity . class ) ; startActivityForResult ( intent , STRAIN_ACTIVITY ) ; } } ) ; Button btn_Profession = ( ( Button ) ( findViewById ( btn_professions ) ) ) ; btn_Profession . setOnClickListener ( new Button . OnClickListener ( ) { @ Override public void onClick ( View v ) { Intent intent = new Intent ( context , ProfessionActivity . class ) ; startActivityForResult ( intent , PROFESSION_ACTIVITY ) ; } } ) ; Button btn_Character = ( ( Button ) ( findViewById ( btn_character ) ) ) ; btn_Character . setOnClickListener ( new View . OnClickListener ( ) { @ Override public void onClick ( View v ) { Intent intent = new Intent ( context , CharacterActivity . class ) ; startActivityForResult ( intent , CHARACTER_ACTIVITY ) ; } } ) ; } @ Override public boolean onCreateOptionsMenu ( Menu menu ) { } @ Override public boolean onOptionsItemSelected ( MenuItem item ) { } }

Fix:
Intent intent = new Intent ( context , SkillActivity . class ) ;
Buggy code:
public class ListMultipleChoice extends AbstractChoice { private static final long serialVersionUID = 1L ; private static int defaultMaxRows = 8 ; private int maxRows ; protected static int getDefaultMaxRows ( ) { } protected static void setDefaultMaxRows ( final int defaultMaxRows ) { } public ListMultipleChoice ( final String id ) { } public ListMultipleChoice ( final String id , final List choices ) { } public ListMultipleChoice ( final String id , final List choices , final int maxRows ) { } public ListMultipleChoice ( final String id , final List choices , final IChoiceRenderer renderer ) { } public ListMultipleChoice ( final String id , IModel object , final List choices ) { } public ListMultipleChoice ( final String id , IModel object , final List choices , final IChoiceRenderer renderer ) { } public ListMultipleChoice ( String id , IModel choices ) { } public ListMultipleChoice ( String id , IModel model , IModel choices ) { } public ListMultipleChoice ( String id , IModel choices , IChoiceRenderer renderer ) { } public ListMultipleChoice ( String id , IModel model , IModel choices , IChoiceRenderer renderer ) { } public final ListMultipleChoice setMaxRows ( final int maxRows ) { } public final String getModelValue ( ) { } public final void setModelValue ( final String value ) { } protected final boolean isSelected ( Object choice , int index , String selected ) { } protected final void onComponentTag ( final ComponentTag tag ) { super . onComponentTag ( tag ) ; <START_BUG> tag . put ( "multiple" , true ) ; <END_BUG> tag . put ( "size" , Math . min ( maxRows , getChoices ( ) . size ( ) ) ) ; } public final void updateModel ( ) { } }

Fix:
tag . put ( "multiple" , "multiple" ) ;
Buggy code:
@ RunWith ( Parameterized . class ) public class MainLibraryTest { private String name = "" ; private String id = "" ; private String dirName ; private String rating ; @ Parameterized . Parameters public static Collection < Object [ ] > data ( ) { } public MainLibraryTest ( String id , String name , String dirName , String rating ) { } @ Test public void testReserveBook ( ) throws Exception { } @ Test public void testReserveMovie ( ) throws Exception { } @ Test public void testMovieGetterWithUniqueReturn ( ) { ProductIntf movie = new Movies ( id , name , dirName , rating ) ; <START_BUG> assertEquals ( movie . getName ( ) , ( ( ( ( ( name ) + "<seq2seq4repair_space>" ) + ( dirName ) ) + "<seq2seq4repair_space>" ) + ( rating ) ) ) ; <END_BUG> } }

Fix:
assertEquals ( movie . getName ( ) , ( ( ( ( ( name ) + "<seq2seq4repair_space>By:<seq2seq4repair_space>" ) + ( dirName ) ) + "<seq2seq4repair_space>Rating[0-10]:<seq2seq4repair_space>" ) + ( rating ) ) ) ;
Buggy code:
public class PathConvert extends AbstractTask { private Path m_path ; private String m_targetOS ; private boolean m_targetWindows ; private boolean m_onWindows ; private String m_property ; private ArrayList m_prefixMap = new ArrayList ( ) ; private String m_pathSep ; private String m_dirSep ; public void setDirSep ( final String dirSep ) { } public void setPathSep ( final String pathSep ) { } public void setProperty ( final String property ) { } public void setTargetos ( String targetOS ) throws TaskException { } public void addMap ( final PathConvert . MapEntry entry ) { } public void addPath ( Path path ) throws TaskException { if ( ( m_path ) == null ) { m_path = path ; } else { <START_BUG> m_path . addPath ( path ) ; <END_BUG> } } public void execute ( ) throws TaskException { } private String mapElement ( String elem ) throws TaskException { } private void validate ( ) throws TaskException { } public class MapEntry { private String m_from ; private String m_to ; public void setFrom ( final String from ) { } public void setTo ( final String to ) { } public String apply ( String elem ) throws TaskException { } } }

Fix:
m_path . add ( path ) ;
Buggy code:
public class ObjectFormat { private static final int FILE_VERSION = 1 ; public static void write ( File file , IDyvilHeader header ) { <START_BUG> if ( ! ( FileUtils . createFile ( file ) ) ) { <END_BUG> DyvilCompiler . error ( ( ( "Error<seq2seq4repair_space>during<seq2seq4repair_space>compilation<seq2seq4repair_space>of<seq2seq4repair_space>'" + file ) + "':<seq2seq4repair_space>could<seq2seq4repair_space>not<seq2seq4repair_space>create<seq2seq4repair_space>file" ) ) ; return ; } try ( ObjectWriter writer = new ObjectWriter ( ) ; OutputStream fo = new BufferedOutputStream ( new FileOutputStream ( file ) ) ) { writer . writeShort ( ObjectFormat . FILE_VERSION ) ; header . write ( writer ) ; writer . writeTo ( fo ) ; } catch ( Throwable ex ) { DyvilCompiler . warn ( ( ( ( "Error<seq2seq4repair_space>during<seq2seq4repair_space>compilation<seq2seq4repair_space>of<seq2seq4repair_space>'" + file ) + "':<seq2seq4repair_space>" ) + ( ex . getLocalizedMessage ( ) ) ) ) ; DyvilCompiler . error ( "ClassWriter" , "compile" , ex ) ; return ; } } public static DyvilHeader read ( InputStream is , DyvilHeader header ) { } }

Fix:
if ( ! ( FileUtils . create ( file ) ) ) {
Buggy code:
public class CompletionOnJavadocParamNameReference extends JavadocSingleNameReference implements CompletionOnJavadoc { public int completionFlags = CompletionOnJavadoc . JAVADOC ; public char [ ] [ ] missingParams ; public char [ ] [ ] missingTypeParams ; public CompletionOnJavadocParamNameReference ( char [ ] name , long pos , int start , int end ) { } public CompletionOnJavadocParamNameReference ( JavadocSingleNameReference nameRef ) { } public void addCompletionFlags ( int flags ) { } public int getCompletionFlags ( ) { } public StringBuffer printExpression ( int indent , StringBuffer output ) { <START_BUG> output . append ( "<CompleteOnJavadocSingleNameReference:" ) ; <END_BUG> if ( ( this . token ) != null ) super . printExpression ( indent , output ) ; return output . append ( '>' ) ; } public TypeBinding reportError ( BlockScope scope ) { } }

Fix:
output . append ( "<CompletionOnJavadocParamNameReference:" ) ;
Buggy code:
public class CurrentDirectoryMenu extends EnhancedMenu { public CurrentDirectoryMenu ( ) { } public void setPopupMenuVisible ( boolean b ) { if ( b ) { <START_BUG> final View view = EditAction . getView ( this ) ; <END_BUG> if ( ( getMenuComponentCount ( ) ) != 0 ) removeAll ( ) ; File file = view . getBuffer ( ) . getFile ( ) ; if ( file == null ) { JMenuItem mi = new JMenuItem ( jEdit . getProperty ( "current-directory.not-local" ) ) ; mi . setEnabled ( false ) ; add ( mi ) ; super . setPopupMenuVisible ( b ) ; return ; } File dir = new File ( file . getParent ( ) ) ; JMenuItem mi = new JMenuItem ( dir . getPath ( ) ) ; mi . setEnabled ( false ) ; add ( mi ) ; addSeparator ( ) ; JMenu current = this ; ActionListener listener = new ActionListener ( ) { public void actionPerformed ( ActionEvent evt ) { jEdit . openFile ( view , evt . getActionCommand ( ) ) ; } } ; String backupPrefix = jEdit . getProperty ( "backup.prefix" ) ; String backupSuffix = jEdit . getProperty ( "backup.suffix" ) ; String [ ] list = dir . list ( ) ; if ( ( list == null ) || ( ( list . length ) == 0 ) ) { mi = new JMenuItem ( jEdit . getProperty ( "current-directory.no-files" ) ) ; mi . setEnabled ( false ) ; add ( mi ) ; } else { MiscUtilities . quicksort ( list , new MiscUtilities . StringICaseCompare ( ) ) ; for ( int i = 0 ; i < ( list . length ) ; i ++ ) { String name = list [ i ] ; if ( name . endsWith ( ".marks" ) ) continue ; if ( ( name . startsWith ( "#" ) ) && ( name . endsWith ( "#" ) ) ) continue ; if ( ( ( ( backupPrefix . length ( ) ) != 0 ) && ( name . startsWith ( backupPrefix ) ) ) || ( ( ( backupSuffix . length ( ) ) != 0 ) && ( name . endsWith ( backupSuffix ) ) ) ) continue ; file = new File ( dir , name ) ; if ( file . isDirectory ( ) ) continue ; mi = new JMenuItem ( name ) ; mi . setActionCommand ( file . getPath ( ) ) ; mi . addActionListener ( listener ) ; mi . setIcon ( fileIcon ) ; if ( ( current . getItemCount ( ) ) >= 20 ) { JMenu newCurrent = new JMenu ( jEdit . getProperty ( "common.more" ) ) ; current . add ( newCurrent ) ; current = newCurrent ; } current . add ( mi ) ; } } } super . setPopupMenuVisible ( b ) ; } }

Fix:
final View view = GUIUtilities . getView ( this ) ;
Buggy code:
public class StartEventHandler extends AbstractNodeHandler { protected Node createNode ( Attributes attrs ) { } @ SuppressWarnings ( "unchecked" ) public Class generateNodeFor ( ) { } @ SuppressWarnings ( "unchecked" ) protected void handleNode ( final Node node , final Element element , final String uri , final String localName , final ExtensibleXmlParser parser ) throws SAXException { } protected void readDataOutputAssociation ( org . w3c . dom . Node xmlNode , StartNode startNode ) { String language = "XPath" ; if ( ( ( ( ( Element ) ( xmlNode ) ) . getAttribute ( "language" ) ) != null ) && ( ! ( "" . equals ( ( ( Element ) ( xmlNode ) ) . getAttribute ( "language" ) ) ) ) ) { language = ( ( Element ) ( xmlNode ) ) . getAttribute ( "language" ) ; } org . w3c . dom . Node subNode = xmlNode . getFirstChild ( ) ; if ( "sourceRef" . equals ( subNode . getNodeName ( ) ) ) { subNode = subNode . getNextSibling ( ) ; } String target = subNode . getTextContent ( ) ; startNode . setMetaData ( "TriggerMapping" , target ) ; subNode = subNode . getNextSibling ( ) ; List < AssignmentAction > assignmentActions = ( ( ArrayList < AssignmentAction > ) ( startNode . getMetaData ( ASSIGNMENT_ACTION ) ) ) ; if ( null == assignmentActions ) { assignmentActions = new ArrayList < AssignmentAction > ( ) ; startNode . setMetaData ( ASSIGNMENT_ACTION , assignmentActions ) ; } ProcessDialect dialectBuilder = ProcessDialectRegistry . getDialect ( language ) ; while ( subNode != null ) { org . w3c . dom . Node ssubNode = subNode . getFirstChild ( ) ; String from = ssubNode . getTextContent ( ) ; String to = ssubNode . getNextSibling ( ) . getTextContent ( ) ; Assignment assignment = new Assignment ( null , from , to ) ; dialectBuilder . getAssignmentBuilder ( ) . build ( null , assignment , "message" , target , null , false ) ; <START_BUG> AssignmentAction assignmentAction = ( ( AssignmentAction ) ( assignment . getMetaData ( ACTION ) ) ) ; <END_BUG> assignmentActions . add ( assignmentAction ) ; subNode = subNode . getNextSibling ( ) ; } } public void writeNode ( Node node , StringBuilder xmlDump , int metaDataType ) { } }

Fix:
AssignmentAction assignmentAction = ( ( AssignmentAction ) ( assignment . getMetaData ( "Action" ) ) ) ;
Buggy code:
public class MapMain_Relation { private Map current_map_reference_ ; public void createNewMap ( int x , int y ) { } public MapMain_Relation ( ) { } public Map getMyMap ( ) { } public int addAvatar ( Avatar a , int x , int y ) { } public int addEntity ( Entity e , int x , int y ) { } public int removeAvatar ( Avatar a ) { } public int removeEntity ( Entity e ) { } public int addItem ( Item i , int x , int y ) { } public Item removeTopItem ( Item i , int x , int y ) { i . getMapRelation ( ) . associateWithMap ( null ) ; <START_BUG> return current_map_reference_ . removeTopItem ( i , x , y ) ; <END_BUG> } public MapTile getTile ( int x , int y ) { } public void addViewToMap ( MapView view ) { } public int initializeTerrain ( Terrain t , int x , int y ) { } }

Fix:
return current_map_reference_ . removeTopItem ( x , y ) ;
Buggy code:
class Nodo { int info ; Nodo pai ; Nodo esq ; Nodo dir ; boolean cor ; public Nodo ( int k ) { } public Nodo ( int k , Nodo p ) { } public Nodo busca ( int k ) { } public void print ( ) { <START_BUG> System . out . println ( ( ( ( ( ( ( ( ( ( ( ( this ) + ":<seq2seq4repair_space>" ) + ( this . esq ) ) + "<seq2seq4repair_space><-<seq2seq4repair_space>(" ) + ( this . info ) ) + "<seq2seq4repair_space>+<seq2seq4repair_space>" ) + ( this . cor ) ) + ")<seq2seq4repair_space>-><seq2seq4repair_space>" ) + ( this . dir ) ) + "<seq2seq4repair_space>~~~<seq2seq4repair_space>Cor:<seq2seq4repair_space>" ) + ( this . cor ) ) ) ; <END_BUG> if ( ( this . esq ) != null ) this . esq . print ( ) ; if ( ( this . dir ) != null ) this . dir . print ( ) ; } public Nodo minimo ( ) { } }

Fix:
System . out . println ( ( ( ( ( ( ( ( ( ( this ) + ":<seq2seq4repair_space>" ) + ( this . esq ) ) + "<seq2seq4repair_space><-<seq2seq4repair_space>(" ) + ( this . info ) ) + "<seq2seq4repair_space>+<seq2seq4repair_space>" ) + ( this . cor ? "V" : "P" ) ) + ")<seq2seq4repair_space>-><seq2seq4repair_space>" ) + ( this . dir ) ) ) ;
Buggy code:
@ Entity public class Score extends BaseModel < Score > implements Comparable < Score > { public static Finder < Long , Score > finder = new Model . Finder ( Long . class , Score . class ) ; @ ManyToOne public Game game ; @ ManyToOne public Player player ; @ ManyToOne public Stage stage ; @ ManyToOne public Mode mode ; @ ManyToOne public Difficulty difficulty ; @ ManyToOne public Ship ship ; @ ManyToOne public Platform platform ; @ Lob public String comment ; public String photo ; public String replay ; public BigDecimal value ; public boolean onecc ; @ Transient public String playerName ; @ Transient public Long gapWithPreviousScore ; private Integer rank ; public Score ( Game game , Player player , Stage stage , Ship ship , Mode mode , Difficulty difficulty , String comment , Platform platform , BigDecimal value , String photo , String replay ) { } public Score ( Long id , Game game , Player player , Stage stage , Ship ship , Mode mode , Difficulty difficulty , String comment , Platform platform , BigDecimal value , String photo , String replay , Integer rank ) { } public Score ( Game game , Player player , Stage stage , Ship ship , Mode mode , Difficulty difficulty , String comment , Platform platform , BigDecimal value ) { } public static Score getBestScoreFor ( Game game , Mode mode , Difficulty difficulty ) { } public String formattedDate ( ) { } public String formattedDateInFrench ( ) { <START_BUG> return getUpdatedSinceInFrench ( ) ; <END_BUG> } public String formattedValue ( ) { } public String formattedRank ( ) { } public Integer rank ( ) { } @ Override public String toString ( ) { } @ Override public int compareTo ( Score score ) { } @ Override public boolean equals ( Object o ) { } public boolean isWorstThanOlders ( ) { } boolean isWorstThan ( Score score ) { } private boolean isComparableWith ( Score score ) { } private boolean hasDifficulty ( Difficulty difficulty ) { } private boolean hasGame ( Game game ) { } private boolean hasMode ( Mode mode ) { } public boolean isPlayedBy ( Player player ) { } public String getGameTitle ( ) { } public Double getGapWithTop ( ) { } public void updateRank ( Integer rank ) { } public boolean hasRank ( ) { } public String tweet ( ) { } private String twitterAccount ( ) { } public String difficultyName ( ) { } public String modeName ( ) { } public String shipName ( ) { } public void setRank ( int rank ) { } public boolean isVip ( ) { } public boolean is1CC ( ) { } public ScoreDecorator decorator ( ) { } }

Fix:
return getCreatedSinceInFrench ( ) ;
Buggy code:
public class MapContainer { private int tilesHorizontally ; private int tilesVertically ; private Tile [ ] [ ] mapContainer ; private static char SIGN_COMMENT = '#' ; private Hero hero ; private ObstacleContainer obstacleContainer ; public MapContainer ( int tilesHorizontally , int tilesVertically ) { } private void initMapContainer ( int tilesHorizontally , int tilesVertically ) { } public void loadFromFile ( String path ) throws IOException { List < String > mapLines = loadMapLines ( path ) ; <START_BUG> obstacleContainer . loadObstacles ( mapLines ) ; <END_BUG> loadMapItems ( mapLines ) ; } private List < String > loadMapLines ( String path ) throws IOException { } private void loadMapItems ( List < String > mapLines ) throws IOException { } private void loadLineIntoArray ( String line , int verticallyIndex ) { } private void loadHero ( int horizontallyIndex , int verticallyIndex ) { } public Tile [ ] [ ] getMap ( ) { } private boolean lineContainsMapData ( String line ) { } private boolean isComment ( String line ) { } public Hero getHero ( ) { } public ObstacleContainer getObstacleContainer ( ) { } }

Fix:
obstacleContainer . loadObstacles ( mapLines , this ) ;
Buggy code:
class StringMockSolrResourceLoader implements ResourceLoader { String text ; StringMockSolrResourceLoader ( String text ) { } <START_BUG> public < T > T newInstance ( String cname , Class < T > expectedType , String ... subpackages ) { <END_BUG> return null ; } public InputStream openResource ( String resource ) throws IOException { } }

Fix:
public < T > T newInstance ( String cname , Class < T > expectedType ) {
Buggy code:
public class Snippet133 { Display display ; Shell shell ; Text text ; Font font ; Color foregroundColor ; Color backgroundColor ; Printer printer ; GC gc ; Font printerFont ; Color printerForegroundColor ; Color printerBackgroundColor ; int lineHeight = 0 ; int tabWidth = 0 ; int leftMargin ; int rightMargin ; int topMargin ; int bottomMargin ; int x ; int y ; int index ; int end ; String textToPrint ; String tabs ; StringBuffer wordBuffer ; public static void main ( String [ ] args ) { } void open ( ) { } void menuOpen ( ) { } void menuFont ( ) { } void menuForegroundColor ( ) { } void menuBackgroundColor ( ) { } void menuPrint ( ) { <START_BUG> PrintDialog dialog = new PrintDialog ( shell , SWT . NULL ) ; <END_BUG> PrinterData data = dialog . open ( ) ; if ( data == null ) return ; if ( data . printToFile ) { data . fileName = "print.out" ; } textToPrint = text . getText ( ) ; printer = new Printer ( data ) ; Thread printingThread = new Thread ( "Printing" ) { public void run ( ) { print ( printer ) ; printer . dispose ( ) ; } } ; printingThread . start ( ) ; } void print ( Printer printer ) { } void printText ( ) { } void printWordBuffer ( ) { } void newline ( ) { } }

Fix:
PrintDialog dialog = new PrintDialog ( shell , SWT . NONE ) ;
Buggy code:
public class KakuOfPiece extends Piece { @ Override public String getName ( ) { } @ Override public Set < Point > getRuleOfPiece ( ) { Set < Point > set = new HashSet < Point > ( ) ; <START_BUG> for ( int i = - 9 ; i < 10 ; i ++ ) { <END_BUG> if ( i == 0 ) continue ; set . add ( new Point ( i , i ) ) ; set . add ( new Point ( ( - i ) , i ) ) ; } return set ; } @ Override public Set < Point > getCapableMovePiece ( GameBoard board , Point point ) { } private Set < Point > getSetToNeedToRemove ( GameBoard board , boolean axis , int direction , Point mine ) { } @ Override public Integer getTypeOfPiece ( ) { } }

Fix:
for ( int i = - 8 ; i < 9 ; i ++ ) {
Buggy code:
public class RuntimeExpressionResolver extends ExpressionResolverImpl { private final VaultReader vaultReader ; public RuntimeExpressionResolver ( VaultReader vaultReader ) { } @ Override protected void resolvePluggableExpression ( ModelNode node ) { String expression = node . asString ( ) ; if ( ( expression . length ( ) ) > 3 ) { expression = expression . substring ( 2 , ( ( expression . length ( ) ) - 2 ) ) ; <START_BUG> if ( vaultReader . isVaultFormat ( expression ) ) { <END_BUG> node . set ( vaultReader . retrieveFromVault ( expression ) ) ; } } } }

Fix:
if ( ( ( vaultReader ) != null ) && ( vaultReader . isVaultFormat ( expression ) ) ) {
Buggy code:
public class SortedFeedItemContainer implements Serializable , Comparable < SortedFeedItemContainer > { private FeedItem feeditem ; private long score = - 1 ; private TrainingCase trainingCase ; public SortedFeedItemContainer ( FeedItem feeditem ) { } public FeedItem getFeeditem ( ) { } public boolean hasScore ( ) { <START_BUG> return ( score ) != ( - 1 ) ; <END_BUG> } public long getScore ( ) { } public void feedback ( Context context , Feedback feedback ) { } public void setScore ( long score ) { } @ Override public int compareTo ( SortedFeedItemContainer another ) { } }

Fix:
return ( score ) != 0 ;
Buggy code:
public class ApplicationStringResourceLoaderTest extends StringResourceLoaderTestBase { public ApplicationStringResourceLoaderTest ( String message ) { } @ Override protected IStringResourceLoader createLoader ( ) { <START_BUG> return new wicket . resource . loader . ClassStringResourceLoader ( application , application . getClass ( ) ) ; <END_BUG> } @ Override public void testLoaderUnknownResources ( ) { } }

Fix:
return new wicket . resource . loader . ClassStringResourceLoader ( application . getClass ( ) ) ;
Buggy code:
public class ColourUnifier implements Mutator { @ Override public boolean mutate ( Chromosome chromosome ) { } private boolean contains ( int [ ] colours , int colour ) { } @ Override public void mutateFunction ( Chromosome chromosome , Graph < Object , Object > graph , Object [ ] vertex , Collection < Object > edges ) { int [ ] translator = new int [ chromosome . getColors ( ) ] ; for ( int i = 0 ; i < ( translator . length ) ; i ++ ) translator [ i ] = - 1 ; int [ ] colours = chromosome . getColoringTab ( ) ; int index = 0 ; for ( int i = 0 ; i < ( colours . length ) ; i ++ ) { if ( ! ( contains ( translator , colours [ i ] ) ) ) { translator [ index ] = colours [ i ] ; index ++ ; if ( index >= ( translator . length ) ) break ; } } Arrays . sort ( translator ) ; boolean [ ] hasBeenChanged = new boolean [ colours . length ] ; for ( int i = 0 ; i < ( colours . length ) ; i ++ ) hasBeenChanged [ i ] = false ; for ( int i = 0 ; i < ( translator . length ) ; i ++ ) { <START_BUG> for ( int j = 0 ; i < ( hasBeenChanged . length ) ; j ++ ) { <END_BUG> if ( ( ( translator [ i ] ) == ( chromosome . getColoringTab ( ) [ j ] ) ) && ( ! ( hasBeenChanged [ j ] ) ) ) { chromosome . getColoringTab ( ) [ j ] = i ; hasBeenChanged [ j ] = true ; } } } return ; } }

Fix:
for ( int j = 0 ; j < ( hasBeenChanged . length ) ; j ++ ) {
Buggy code:
public final class CommandValidator { private static List < String > viewCommandFloatingAliases = Arrays . asList ( "floating" , "ft" ) ; private static List < String > viewCommandDeadlineAliases = Arrays . asList ( "deadline" , "dl" ) ; private static List < String > viewCommandOverduedAliases = Arrays . asList ( "overdued" , "od" ) ; private CommandValidator ( ) { } public static boolean isDeadlineTask ( String command ) { <START_BUG> String pattern = "((?i)(due|by)\\s+)[0-9//:<seq2seq4repair_space>]+" ; <END_BUG> return command . matches ( pattern ) ; } public static boolean isEmptyString ( String command ) { } public static boolean isFloatingTask ( String command ) { } public static boolean isHashTags ( String command ) { } public static boolean isNormalTask ( String command ) { } public static boolean isRecurringTask ( String command ) { } public static boolean checkRecurringType ( String type ) { } public static boolean isPositiveNonZeroInteger ( String s ) { } public static boolean isTaskDescriptionWithinQuotes ( String command ) { } public static boolean isViewAll ( String command ) { } public static boolean isViewFloating ( String command ) { } public static boolean isViewDeadline ( String command ) { } public static boolean isViewOverdued ( String command ) { } }

Fix:
String pattern = "((?i)(due|by)\\s+)[a-zA-Z0-9//:<seq2seq4repair_space>]+" ;
Buggy code:
class TypeAnalyzer { private static final String [ ] NAMES_TO_IGNORE = new String [ ] { "getClass" } ; private static final JsonString EMPTY_JSON_STRING = new JsonString ( ) { private static final String TYPE = "string" ; @ Override public ValueType getValueType ( ) { } @ Override public String getString ( ) { } @ Override public CharSequence getChars ( ) { } } ; private final Lock lock = new ReentrantLock ( ) ; private String type ; private boolean collection ; TypeRepresentation analyze ( final String type ) { } private boolean isRelevant ( ) { } private static JsonValue analyzeInternal ( final String type ) { } private static JsonValue analyzeClass ( final CtClass ctClass ) throws ClassNotFoundException { } private static boolean isRelevant ( final CtField field , final XmlAccessType accessType ) { } private static boolean isRelevant ( final CtMethod method , final XmlAccessType accessType ) { } private static boolean isGetter ( final CtMethod method ) { } private static Pair < String , String > mapField ( final CtField field ) { try { final String sig = ( ( field . getGenericSignature ( ) ) != null ) ? field . getGenericSignature ( ) : field . getSignature ( ) ; <START_BUG> final String fieldType = JavaUtils . getType ( SignatureAttribute . toFieldSignature ( sig ) ) ; <END_BUG> return Pair . of ( field . getName ( ) , fieldType ) ; } catch ( BadBytecode e ) { LogProvider . getLogger ( ) . accept ( ( "Could<seq2seq4repair_space>not<seq2seq4repair_space>analyze<seq2seq4repair_space>field:<seq2seq4repair_space>" + field ) ) ; return null ; } } private static Pair < String , String > mapGetter ( final CtMethod method ) { } private static String normalizeGetter ( final String name ) { } private static void addToObject ( final JsonObjectBuilder builder , final String key , final String type ) { } private static void addToArray ( final JsonArrayBuilder builder , final String type ) { } }

Fix:
final String fieldType = JavaUtils . getType ( SignatureAttribute . toTypeSignature ( sig ) ) ;
Buggy code:
public class KMeansModel extends Model < KMeansModel , KMeansModel . KMeansParameters , KMeansModel . KMeansOutput > { public static class KMeansParameters extends Model . Parameters { public int _k = 1 ; public int _max_iterations = 1000 ; public boolean _standardize = true ; public long _seed = System . nanoTime ( ) ; public Initialization _init = Initialization . Furthest ; Key < Frame > _user_points ; } public static class KMeansOutput extends Model . Output { public int _categorical_column_count ; public int _iterations ; public TwoDimTable _centers ; public double [ ] [ ] _centers_raw ; public long [ ] _size ; public double [ ] _within_mse ; public double _avg_within_ss ; public double _avg_ss ; public double _avg_between_ss ; public KMeansOutput ( KMeans b ) { } @ Override public ModelCategory getModelCategory ( ) { } } public KMeansModel ( Key selfKey , KMeansModel . KMeansParameters parms , KMeansModel . KMeansOutput output ) { } @ Override public MetricBuilder makeMetricBuilder ( String [ ] domain ) { assert domain == null ; <START_BUG> return new ModelMetricsKMeans . MetricBuilderKMeans ( _output . nfeatures ( ) ) ; <END_BUG> } @ Override public ModelSchema schema ( ) { } @ Override protected float [ ] score0 ( double [ ] data , float [ ] preds ) { } }

Fix:
return new ModelMetricsKMeans . MetricBuilderKMeans ( _output . nfeatures ( ) , _parms . _k ) ;