nus-yam/ex-repair huggingface dataset:
Buggy code:
public class Ajc11CompilerAdapter extends DefaultCompilerAdapter { public static final String SKIP_ROOTS_NAME = "ajcAdapterSkipRoots" ; protected void addCurrentCompilerArgs ( Commandline cmd ) { } public boolean execute ( ) throws BuildException { Commandline cmd = setupModernJavacCommand ( ) ; try { String [ ] args = cmd . getArguments ( ) ; int result = runCompiler ( args ) ; return 0 == result ; } catch ( BuildException e ) { throw e ; } catch ( AbortException x ) { <START_BUG> if ( ABORT . equals ( x ) ) { <END_BUG> return false ; } else { Throwable t = x . getThrown ( ) ; if ( null == t ) { t = x ; } throw new BuildException ( "Thrown:<seq2seq4repair_space>" , t , location ) ; } } catch ( Throwable x ) { throw new BuildException ( "Thrown:<seq2seq4repair_space>" , x , location ) ; } } private int runCompiler ( String [ ] args ) { } private void throwBuildException ( String string , IMessageHolder sink ) { } protected String [ ] filterArgs ( String [ ] args ) { } }

Fix:
if ( x . isSilent ( ) ) {
Buggy code:
public class GitHub { final String login ; final String encodedAuthorization ; final String password ; final String apiToken ; private final Map < String , GHUser > users = new HashMap < String , GHUser > ( ) ; private final Map < String , GHOrganization > orgs = new HashMap < String , GHOrganization > ( ) ; private String oauthAccessToken ; private GitHub ( String login , String apiToken , String password ) { } private GitHub ( String oauthAccessToken ) throws IOException { } public static GitHub connect ( ) throws IOException { } public static GitHub connect ( String login , String apiToken ) throws IOException { } public static GitHub connect ( String login , String apiToken , String password ) throws IOException { } public static GitHub connectUsingOAuth ( String accessToken ) throws IOException { } public static GitHub connectAnonymously ( ) { } void requireCredential ( ) { } URL getApiURL ( ApiVersion . ApiVersion v , String tailApiUrl ) throws IOException { if ( ( oauthAccessToken ) != null ) { <START_BUG> tailApiUrl = ( tailApiUrl + "?access_token=" ) + ( oauthAccessToken ) ; <END_BUG> } return new URL ( ( ( v . url ) + tailApiUrl ) ) ; } < T > T retrieve ( String tailApiUrl , Class < T > type ) throws IOException { } < T > T retrieve3 ( String tailApiUrl , Class < T > type ) throws IOException { } < T > T retrieveWithAuth ( String tailApiUrl , Class < T > type ) throws IOException { } < T > T retrieveWithAuth3 ( String tailApiUrl , Class < T > type ) throws IOException { } < T > T retrieveWithAuth ( String tailApiUrl , Class < T > type , String method ) throws IOException { } < T > T retrieveWithAuth3 ( String tailApiUrl , Class < T > type , String method ) throws IOException { } private < T > T _retrieve ( String tailApiUrl , Class < T > type , String method , boolean withAuth , ApiVersion . ApiVersion v ) throws IOException { } void handleApiError ( IOException e , HttpURLConnection uc ) throws IOException { } public GHUser getMyself ( ) throws IOException { } public GHUser getUser ( String login ) throws IOException { } protected GHUser getUser ( GHUser orig ) throws IOException { } public GHOrganization getOrganization ( String name ) throws IOException { } public Map < String , GHOrganization > getMyOrganizations ( ) throws IOException { } public GHRepository createRepository ( String name , String description , String homepage , boolean isPublic ) throws IOException { } public boolean isCredentialValid ( ) throws IOException { } WebClient createWebClient ( ) throws IOException { } static URL parseURL ( String s ) { } static Date parseDate ( String timestamp ) { } static final ObjectMapper MAPPER = new ObjectMapper ( ) ; private static final String [ ] TIME_FORMATS = new String [ ] { "yyyy//MM//dd<seq2seq4repair_space>HH:mm:ss<seq2seq4repair_space>ZZZZ" , "yyyy-MM-dd'T'HH:mm:ss'Z'" } ; }

Fix:
tailApiUrl = ( ( tailApiUrl + ( ( tailApiUrl . indexOf ( '?' ) ) >= 0 ? '&' : '?' ) ) + "access_token=" ) + ( oauthAccessToken ) ;
Buggy code:
public class ParameterData extends ItemData { Method method ; int parameter ; public ParameterData ( Method method , int parameter , String str ) { } public static String [ ] getAllFlags ( ) { <START_BUG> return new String [ ] { "no_in" , "no_out" , "critical" , "init" , "struct" , "unicode" } ; <END_BUG> } public String getCast ( ) { } public Method getMethod ( ) { } public int getParameter ( ) { } public void setCast ( String str ) { } }

Fix:
return new String [ ] { FLAG_NO_IN , FLAG_NO_OUT , FLAG_CRITICAL , FLAG_INIT , FLAG_STRUCT , FLAG_UNICODE , FLAG_SENTINEL } ;
Buggy code:
public class Route { public Node routeStart ; public Node routeEnd ; public LinkedList < Node > routeList = new LinkedList < > ( ) ; public Route ( Collection < Node > theRoute ) { } public void overrideRoute ( Collection < Node > replacement ) { } public void overrideRoute ( int current , int next , int destination ) { routeList . clear ( ) ; <START_BUG> routeList . add ( nodelist . get ( current ) ) ; <END_BUG> Route r = RoutingManager . getRoute ( new BareRoute ( next , destination ) ) ; routeList . addAll ( r . routeList ) ; } }

Fix:
routeList . add ( Node . idGet ( current ) ) ;
Buggy code:
@ Test ( groups = "unit" , singleThreaded = true , testName = "NetworkClientExpectTest" ) public class NetworkClientExpectTest extends BaseVCloudDirectorRestClientExpectTest { @ Test public void testWhenResponseIs2xxLoginReturnsValidNetwork ( ) { } @ Test public void testWhenResponseIs400ForInvalidNetworkId ( ) { } @ Test public void testWhenResponseIs403ForCatalogIdUsedAsNetworkId ( ) { } @ Test public void testWhenResponseIs403ForFakeNetworkId ( ) { } @ Test public void testWhenResponseIs2xxLoginReturnsValidMetadataList ( ) { } @ Test ( enabled = false ) public void testWhenResponseIs2xxLoginReturnsValidMetadata ( ) { URI networkUri = URI . create ( "https:////vcloudbeta.bluelock.com//api//network//55a677cf-ab3f-48ae-b880-fab90421980c" ) ; VCloudDirectorClient client = requestsSendResponses ( loginRequest , sessionResponse , getStandardRequest ( "GET" , "//network//55a677cf-ab3f-48ae-b880-fab90421980c//metadata//KEY" ) , getStandardPayloadResponse ( "//network//metadataEntry.xml" , METADATA_ENTRY ) ) ; MetadataEntry expected = MetadataEntry . builder ( ) . entry ( "key" , "value" ) . build ( ) ; Reference networkRef = Reference . builder ( ) . href ( networkUri ) . build ( ) ; <START_BUG> assertEquals ( client . getOrgClient ( ) . getMetadataEntry ( networkRef , "KEY" ) , expected ) ; <END_BUG> } public static OrgNetwork orgNetwork ( ) { } }

Fix:
assertEquals ( client . getNetworkClient ( ) . getMetadataEntry ( networkRef , "KEY" ) , expected ) ;
Buggy code:
public class SubjectChoiceJTable extends JTable { private Timetable timetable ; private List < String > chosenSubjects = new ArrayList < String > ( ) ; public SubjectChoiceJTable ( ) { } public void loadSubjectNames ( Timetable timetable ) { } private void initTable ( ) { } public List < Block > getBlocks ( ) { } private TableModel generateSubjectChoiceTableModel ( ) { } public void clearSubjectChoices ( ) { for ( int block = 0 ; block < ( this . getColumnCount ( ) ) ; block ++ ) { for ( int row = 0 ; row < ( this . getRowCount ( ) ) ; row ++ ) { this . setValueAt ( false , row , block ) ; if ( ( getCellRenderer ( row , block ) . getClass ( ) ) == ( SubjectChoiceButton . class ) ) { SubjectChoiceButton subjectBtnRndr = ( ( SubjectChoiceButton ) ( getCellRenderer ( row , block ) ) ) ; <START_BUG> subjectBtnRndr . setSelected ( false ) ; <END_BUG> SubjectChoiceButton subjectBtnEdtr = ( ( SubjectChoiceButton ) ( getCellEditor ( row , block ) ) ) ; subjectBtnEdtr . setSelected ( false ) ; } } } } private Block blockA = new Block ( this , 0 ) ; private Block blockB = new Block ( this , 1 ) ; private Block blockC = new Block ( this , 2 ) ; private Block blockD = new Block ( this , 3 ) ; private Block blockE = new Block ( this , 4 ) ; }

Fix:
subjectBtnRndr . setSelected ( true ) ;
Buggy code:
public class CreateCompilationUnitOperation extends JavaModelOperation { protected String fName ; protected String fSource = null ; public CreateCompilationUnitOperation ( IPackageFragment parentElement , String name , String source , boolean force ) { } protected void executeOperation ( ) throws JavaModelException { try { beginTask ( Util . bind ( "operation.createUnitProgress" ) , 2 ) ; JavaElementDelta delta = newJavaElementDelta ( ) ; ICompilationUnit unit = getCompilationUnit ( ) ; IPackageFragment pkg = ( ( IPackageFragment ) ( getParentElement ( ) ) ) ; IContainer folder = ( ( IContainer ) ( pkg . getResource ( ) ) ) ; worked ( 1 ) ; IFile compilationUnitFile = folder . getFile ( new Path ( fName ) ) ; if ( compilationUnitFile . exists ( ) ) { if ( fForce ) { IBuffer buffer = unit . getBuffer ( ) ; if ( buffer == null ) return ; buffer . setContents ( fSource ) ; unit . save ( new NullProgressMonitor ( ) , false ) ; fResultElements = new IJavaElement [ ] { unit } ; if ( ( ! ( Util . isExcluded ( unit ) ) ) && ( unit . getParent ( ) . exists ( ) ) ) { for ( int i = 0 ; i < ( fResultElements . length ) ; i ++ ) { delta . changed ( fResultElements [ i ] , IJavaElementDelta . F_CONTENT ) ; } addDelta ( delta ) ; } } else { throw new JavaModelException ( new JavaModelStatus ( IJavaModelStatusConstants . NAME_COLLISION , Util . bind ( "status.nameCollision" , compilationUnitFile . getFullPath ( ) . toString ( ) ) ) ) ; } } else { try { String encoding = unit . getJavaProject ( ) . getOption ( JavaCore . CORE_ENCODING , true ) ; InputStream stream = new ByteArrayInputStream ( ( encoding == null ? fSource . getBytes ( ) : fSource . getBytes ( encoding ) ) ) ; <START_BUG> createFile ( folder , unit . getElementName ( ) , stream , false ) ; <END_BUG> fResultElements = new IJavaElement [ ] { unit } ; if ( ( ! ( Util . isExcluded ( unit ) ) ) && ( unit . getParent ( ) . exists ( ) ) ) { for ( int i = 0 ; i < ( fResultElements . length ) ; i ++ ) { delta . added ( fResultElements [ i ] ) ; } addDelta ( delta ) ; } } catch ( IOException e ) { throw new JavaModelException ( e , IJavaModelStatusConstants . IO_EXCEPTION ) ; } } worked ( 1 ) ; } finally { done ( ) ; } } protected ICompilationUnit getCompilationUnit ( ) { } public IJavaModelStatus verify ( ) { } }

Fix:
createFile ( folder , unit . getElementName ( ) , stream , fForce ) ;
Buggy code:
public class CrosscuttingMembersSet { private World world ; private Map members = new HashMap ( ) ; private List shadowMungers = null ; private List typeMungers = null ; private List lateTypeMungers = null ; private List declareSofts = null ; private List declareParents = null ; private List declareAnnotationOnTypes = null ; private List declareAnnotationOnFields = null ; private List declareAnnotationOnMethods = null ; private List declareDominates = null ; private boolean changedSinceLastReset = false ; private List verificationList = null ; public CrosscuttingMembersSet ( World world ) { } public boolean addOrReplaceAspect ( ResolvedType aspectType ) { } public boolean addOrReplaceAspect ( ResolvedType aspectType , boolean careAboutShadowMungers ) { boolean change = false ; CrosscuttingMembers xcut = ( ( CrosscuttingMembers ) ( members . get ( aspectType ) ) ) ; if ( xcut == null ) { members . put ( aspectType , aspectType . collectCrosscuttingMembers ( ) ) ; clearCaches ( ) ; CflowPointcut . clearCaches ( aspectType ) ; change = true ; } else { if ( xcut . replaceWith ( aspectType . collectCrosscuttingMembers ( ) , careAboutShadowMungers ) ) { clearCaches ( ) ; CflowPointcut . clearCaches ( aspectType ) ; change = true ; } else { <START_BUG> if ( careAboutShadowMungers ) { <END_BUG> shadowMungers = null ; } change = false ; } } if ( aspectType . isAbstract ( ) ) { boolean ancestorChange = addOrReplaceDescendantsOf ( aspectType , careAboutShadowMungers ) ; change = change || ancestorChange ; } changedSinceLastReset = ( changedSinceLastReset ) || change ; return change ; } private boolean addOrReplaceDescendantsOf ( ResolvedType aspectType , boolean careAboutShadowMungers ) { } public void addAdviceLikeDeclares ( ResolvedType aspectType ) { } public boolean deleteAspect ( UnresolvedType aspectType ) { } public boolean containsAspect ( UnresolvedType aspectType ) { } public void addFixedCrosscuttingMembers ( ResolvedType aspectType ) { } private void clearCaches ( ) { } public List getShadowMungers ( ) { } public List getTypeMungers ( ) { } public List getLateTypeMungers ( ) { } public List getDeclareSofts ( ) { } public List getDeclareParents ( ) { } public List getDeclareAnnotationOnTypes ( ) { } public List getDeclareAnnotationOnFields ( ) { } public List getDeclareAnnotationOnMethods ( ) { } public List getDeclareDominates ( ) { } public ResolvedType findAspectDeclaringParents ( DeclareParents p ) { } public void reset ( ) { } public boolean hasChangedSinceLastReset ( ) { } public void recordNecessaryCheck ( IVerificationRequired verification ) { } public void verify ( ) { } }

Fix:
if ( ( ! ( World . compareLocations ) ) && careAboutShadowMungers ) {
Buggy code:
public class RaActivate implements OperationStepHandler { static final RaActivate INSTANCE = new RaActivate ( ) ; public void execute ( OperationContext context , ModelNode operation ) throws OperationFailedException { final ModelNode model = context . readResourceForUpdate ( EMPTY_ADDRESS ) . getModel ( ) ; final ModelNode address = operation . require ( OP_ADDR ) ; final String raName = PathAddress . pathAddress ( address ) . getLastElement ( ) . getValue ( ) ; <START_BUG> if ( ( context . getType ( ) ) == ( Type . SERVER ) ) { <END_BUG> context . addStep ( new OperationStepHandler ( ) { public void execute ( final OperationContext context , ModelNode operation ) throws OperationFailedException { final String archiveName = model . get ( Constants . ARCHIVE . getName ( ) ) . asString ( ) ; RaOperationUtil . deactivateIfActive ( context , archiveName ) ; RaOperationUtil . activate ( context , raName , archiveName ) ; context . completeStep ( ) ; } } , RUNTIME ) ; } context . completeStep ( ) ; } }

Fix:
if ( context . isNormalServer ( ) ) {
Buggy code:
public class Util { public static int getWeekOfYear ( ) { } public static int getYear ( ) { } public static int getCacheKey ( ) { int weekOfYear = Util . getWeekOfYear ( ) ; int year = Util . getYear ( ) ; <START_BUG> int cacheKey = ( year + weekOfYear ) + weekOfYear ; <END_BUG> return cacheKey ; } }

Fix:
int cacheKey = ( ( year - 2000 ) * 52 ) + weekOfYear ;
Buggy code:
public class Base64BinaryDatatypeValidator extends AbstractStringValidator { public Base64BinaryDatatypeValidator ( ) throws InvalidDatatypeFacetException { } public Base64BinaryDatatypeValidator ( DatatypeValidator base , Hashtable facets , boolean derivedByList ) throws InvalidDatatypeFacetException { } protected void assignAdditionalFacets ( String key , Hashtable facets ) throws InvalidDatatypeFacetException { } protected void checkValueSpace ( String content ) throws InvalidDatatypeValueException { } protected int getLength ( String content ) { <START_BUG> return Base64 . getDataLength ( content . getBytes ( ) ) ; <END_BUG> } }

Fix:
return Base64 . getDecodedDataLength ( content . getBytes ( ) ) ;
Buggy code:
public class Checker extends ShadowMunger { private String msg ; private boolean isError ; public Checker ( DeclareErrorOrWarning deow ) { } public ShadowMunger concretize ( ResolvedType fromType , World world , PerClause clause ) { <START_BUG> pointcut = pointcut . concretize ( fromType , 0 , this ) ; <END_BUG> return this ; } public void specializeOn ( Shadow shadow ) { } public void implementOn ( Shadow shadow ) { } public boolean match ( Shadow shadow , World world ) { } public int compareTo ( Object other ) { } public Collection getThrownExceptions ( ) { } public boolean mustCheckExceptions ( ) { } public boolean isError ( ) { } }

Fix:
pointcut = pointcut . concretize ( fromType , getDeclaringType ( ) , 0 , this ) ;
Buggy code:
public class Search { public static List < Map . Entry < String , Double > > search ( String searchQuery , Index index ) { } private static JsonNode getIndexes ( ) throws IOException { } private static Set < String > getRelevantDocuments ( List < String > searchTokens , Index index ) { } private static Map < String , Double > computeQueryScore ( List < String > tokens , Index index ) { int numTokens = tokens . size ( ) ; Map < String , Integer > tokensFrequencies = new HashMap < String , Integer > ( ) ; for ( int i = 0 ; i < numTokens ; i ++ ) { if ( tokensFrequencies . containsKey ( tokens . get ( i ) ) ) { int currentFrequency = ( ( int ) ( tokensFrequencies . get ( tokens . get ( i ) ) ) ) ; currentFrequency ++ ; tokensFrequencies . put ( tokens . get ( i ) . toString ( ) , currentFrequency ) ; } else { tokensFrequencies . put ( tokens . get ( i ) . toString ( ) , 1 ) ; } } Map < String , Double > scoreQueries = new HashMap < String , Double > ( ) ; for ( Map . Entry < String , Integer > entry : tokensFrequencies . entrySet ( ) ) { <START_BUG> double tfValue = entry . getValue ( ) ; <END_BUG> double idfValue = index . getIdf ( entry . getKey ( ) ) ; double tfidfValue = tfValue * idfValue ; tfidfValue = ( Math . round ( ( tfidfValue * 10000.0 ) ) ) // 10000.0 ; if ( scoreQueries . containsKey ( entry . getKey ( ) ) ) { Double currentTfidfScore = ( ( Double ) ( scoreQueries . get ( entry . getValue ( ) ) ) ) ; currentTfidfScore = currentTfidfScore + tfidfValue ; scoreQueries . put ( entry . getKey ( ) . toString ( ) , currentTfidfScore ) ; } else { scoreQueries . put ( entry . getKey ( ) . toString ( ) , tfidfValue ) ; } } return scoreQueries ; } private static Double computeTotalQueryScore ( Map < String , Double > scoreQueries ) { } private static Map < String , Double > computeCosineScores ( Set < String > documents , List < String > tokens , Index index , Map < String , Double > scoreQueries ) { } private static List < Map . Entry < String , Double > > rankScore ( Map < String , Double > scoreMap ) { } }

Fix:
double tfValue = ( Math . log ( ( 1.0 + ( ( ( double ) ( entry . getValue ( ) ) ) // ( ( double ) ( numTokens ) ) ) ) ) ) // ( Math . log ( 2 ) ) ;
Buggy code:
@ Configuration @ ComponentScan ( basePackages = "MyPlanner" ) @ PropertySource ( "//WEB-INF//mp.properties" ) @ EnableWebMvc public class MvcConfiguration extends WebMvcConfigurerAdapter { @ Autowired Environment env ; @ Bean public static PropertySourcesPlaceholderConfigurer propertySourcesPlaceholderConfigurer ( ) { } @ Bean public InternalResourceViewResolver internalResourceViewResolver ( ) { } @ Override public void addResourceHandlers ( ResourceHandlerRegistry registry ) { } @ Bean ( name = "simpleMappingExceptionResolver" ) public SimpleMappingExceptionResolver createSimpleMappingExceptionResolver ( ) { SimpleMappingExceptionResolver r = new SimpleMappingExceptionResolver ( ) ; Properties mappings = new Properties ( ) ; mappings . setProperty ( "NotAuthorizedException" , "errors//not-authorized" ) ; r . setExceptionMappings ( mappings ) ; <START_BUG> r . setDefaultErrorView ( "error" ) ; <END_BUG> r . setExceptionAttribute ( "ex" ) ; return r ; } @ Bean ( name = "oAuth" ) public OAuth2 oAuth ( ) { } @ Bean public LoginInfoRepo loginInfoRepo ( ) { } @ Bean ( name = "props" ) public CanvasProperties props ( ) { } @ Bean public CanvasApi canvasApi ( ) { } @ Bean public UserDao userDao ( ) { } @ Bean public CourseDao courseDao ( ) { } @ Bean public ModuleDao moduleDao ( ) { } @ Bean public UserHasModuleDao userHasModuleDao ( ) { } }

Fix:
r . setDefaultErrorView ( "errors//error" ) ;
Buggy code:
public class UnknownFunction implements Function { private static final String KEY = "__unknownFunction" ; private Map varMap = new HashMap ( ) ; private String name ; public UnknownFunction ( String name ) { } public UnknownFunction ( ) { } public String execute ( SampleResult previousResult , Sampler currentSampler ) throws InvalidVariableException { String ret = getVariables ( ) . get ( name ) ; <START_BUG> if ( ret == null ) { <END_BUG> return ( "${" + ( name ) ) + "}" ; } return ret ; } private JMeterVariables getVariables ( ) { } public void setParameters ( String parameters ) throws InvalidVariableException { } public String getReferenceKey ( ) { } public List getArgumentDesc ( ) { } public void setJMeterVariables ( JMeterVariables jmv ) { } }

Fix:
if ( ( ret == null ) || ( ( ret . length ( ) ) == 0 ) ) {
Buggy code:
public class PingCommandImpl implements Command { public int getMinimalArgsCountNeeded ( ) { } public int getMaximalArgsCountNeeded ( ) { } @ Override public CmdType getType ( ) { } @ Override public boolean canExecute ( final SessionStageLevel usl ) { <START_BUG> return ( usl == ( SessionStageLevel . AUTHENTICATED ) ) || ( usl == ( SessionStageLevel . AUTHENTICATED_EXTERNAL ) ) ; <END_BUG> } @ Override public void execute ( final String [ ] payload , final Session usrSession , final Collection < Session > connectedSessions , final Map < String , List < Session > > globalFollowers ) throws ArrayIndexOutOfBoundsException { } }

Fix:
return true ;
Buggy code:
public class Tree { private List < Node > allNodes ; private Node startNode ; private double simplicityScore ; private final double widthFactor = 1 ; private final double depthFactor = 1 ; public Tree ( ) { } public List < Node > getAllNodes ( ) { } public void changeNode ( Node oldNode , Node newNode ) { } public void removeNode ( Node node ) { } public void changeProbability ( Node node , int probability ) { } private Node getParent ( Node node ) { } private void findAllNodes ( ) { } public double getSimplicityScore ( ) { } private void calculateSimplicity ( ) { <START_BUG> simplicityScore = ( ( ( widthFactor ) * ( getWidth ( ) ) ) + ( depthFactor ) ) - ( getDepth ( ) ) ; <END_BUG> } private double getDepth ( ) { } private double getWidth ( ) { } public Node getStartNode ( ) { } public void printTree ( ) { } }

Fix:
simplicityScore = ( ( widthFactor ) * ( getWidth ( ) ) ) + ( ( depthFactor ) * ( getDepth ( ) ) ) ;
Buggy code:
@ Entity @ Table ( name = "role" ) @ XmlRootElement @ NamedQueries ( { @ NamedQuery ( name = "Role.findAll" , query = "SELECT<seq2seq4repair_space>r<seq2seq4repair_space>FROM<seq2seq4repair_space>Role<seq2seq4repair_space>r" ) , @ NamedQuery ( name = "Role.findByRoleId" , query = "SELECT<seq2seq4repair_space>r<seq2seq4repair_space>FROM<seq2seq4repair_space>Role<seq2seq4repair_space>r<seq2seq4repair_space>WHERE<seq2seq4repair_space>r.roleId<seq2seq4repair_space>=<seq2seq4repair_space>:roleId" ) , @ NamedQuery ( name = "Role.findByName" , query = "SELECT<seq2seq4repair_space>r<seq2seq4repair_space>FROM<seq2seq4repair_space>Role<seq2seq4repair_space>r<seq2seq4repair_space>WHERE<seq2seq4repair_space>r.name<seq2seq4repair_space>=<seq2seq4repair_space>:name" ) } ) public class Role implements Serializable { private static final long serialVersionUID = 1L ; @ Id @ Basic ( optional = false ) @ NotNull @ Column ( name = "role_id" ) private Long roleId ; @ Size ( max = 255 ) @ Column ( name = "name" ) private String name ; @ OneToOne ( cascade = CascadeType . ALL , mappedBy = "role" ) private Person person ; @ OneToMany ( mappedBy = "roleId" ) private Collection < Person > personCollection ; public Role ( ) { } public Role ( Long roleId ) { } public Long getRoleId ( ) { } public void setRoleId ( Long roleId ) { } public String getName ( ) { } public void setName ( String name ) { } public Person getPerson ( ) { } public void setPerson ( Person person ) { } @ XmlTransient public Collection < Person > getPersonCollection ( ) { } public void setPersonCollection ( Collection < Person > personCollection ) { } @ Override public int hashCode ( ) { } @ Override public boolean equals ( Object object ) { } @ Override public String toString ( ) { <START_BUG> return ( "se.kth.Role[<seq2seq4repair_space>roleId=" + ( roleId ) ) + "<seq2seq4repair_space>]" ; <END_BUG> } }

Fix:
return ( "se.kth.model.Role[<seq2seq4repair_space>roleId=" + ( roleId ) ) + "<seq2seq4repair_space>]" ;
Buggy code:
public class Eydis { private TaskCollection _tasks ; private List < Task > searchResult = new ArrayList < Task > ( ) ; private static Eydis _eydis ; private static final Logger log = Logger . getLogger ( Eydis . class . getName ( ) ) ; private Eydis ( String filename ) { } public static Eydis getEydisInstance ( String filename ) { } public void executeCommand ( InputParser parser ) { } public List < Task > getSearchResults ( ) { } public List < Task > getAllTasks ( ) { } private void printTasks ( ) { } private void add ( InputParser parser ) { } private void remove ( InputParser parser ) { } private void clear ( ) { } private void update ( InputParser parser ) { } private void search ( InputParser parser ) { PowerSearch ps = new PowerSearch ( _tasks . getList ( ) ) ; String keyword = parser . getDescription ( ) ; DateTime startTime = parser . getStartTime ( ) ; DateTime endTime = parser . getEndTime ( ) ; if ( ! ( keyword . equals ( "" ) ) ) { <START_BUG> ps . checkStringOrRegex ( keyword ) ; <END_BUG> } if ( ( startTime != null ) || ( endTime != null ) ) { ps . filterStartEnd ( startTime , endTime ) ; } searchResult = ps . getResults ( ) ; } }

Fix:
ps . filter ( keyword ) ;
Buggy code:
public class CreatePackageFragmentOperation extends JavaModelOperation { protected String fName ; public CreatePackageFragmentOperation ( IPackageFragmentRoot parentElement , String packageName , boolean force ) { } protected void executeOperation ( ) throws JavaModelException { JavaElementDelta delta = null ; IPackageFragmentRoot root = ( ( IPackageFragmentRoot ) ( getParentElement ( ) ) ) ; String [ ] names = Util . getTrimmedSimpleNames ( fName ) ; beginTask ( Util . bind ( "operation.createPackageFragmentProgress" ) , names . length ) ; IContainer parentFolder = ( ( IContainer ) ( root . getResource ( ) ) ) ; String sideEffectPackageName = "" ; ArrayList resultElements = new ArrayList ( names . length ) ; <START_BUG> char [ ] [ ] exclusionPatterns = ( ( PackageFragmentRoot ) ( root ) ) . getExclusionPatterns ( ) ; <END_BUG> int i ; for ( i = 0 ; i < ( names . length ) ; i ++ ) { String subFolderName = names [ i ] ; sideEffectPackageName += subFolderName ; IResource subFolder = parentFolder . findMember ( subFolderName ) ; if ( subFolder == null ) { createFolder ( parentFolder , subFolderName , fForce ) ; parentFolder = parentFolder . getFolder ( new Path ( subFolderName ) ) ; IPackageFragment addedFrag = root . getPackageFragment ( sideEffectPackageName ) ; if ( ! ( Util . isExcluded ( parentFolder , exclusionPatterns ) ) ) { if ( delta == null ) { delta = newJavaElementDelta ( ) ; } delta . added ( addedFrag ) ; } resultElements . add ( addedFrag ) ; } else { parentFolder = ( ( IContainer ) ( subFolder ) ) ; } sideEffectPackageName += '.' ; worked ( 1 ) ; } if ( ( resultElements . size ( ) ) > 0 ) { fResultElements = new IJavaElement [ resultElements . size ( ) ] ; resultElements . toArray ( fResultElements ) ; if ( delta != null ) { addDelta ( delta ) ; } } done ( ) ; } public IJavaModelStatus verify ( ) { } }

Fix:
char [ ] [ ] exclusionPatterns = ( ( PackageFragmentRoot ) ( root ) ) . fullExclusionPatternChars ( ) ;
Buggy code:
public class dnsSIGRecord extends dnsRecord { short typeCovered ; byte alg ; byte labels ; int origTTL ; Date expire ; Date timeSigned ; short footprint ; dnsName signer ; byte [ ] signature ; public dnsSIGRecord ( dnsName rname , short rclass ) { } public dnsSIGRecord ( dnsName rname , short rclass , int rttl , short typeCovered , byte alg , byte labels , int origTTL , Date expire , Date timeSigned , short footprint , dnsName signer , byte [ ] signature ) { } void parse ( CountedDataInputStream in , dnsCompression c ) throws IOException { } void rrToBytes ( DataOutputStream out ) throws IOException { } void rrToCanonicalBytes ( DataOutputStream out ) throws IOException { } String rrToString ( ) { if ( ( rlength ) == 0 ) return null ; StringBuffer sb = new StringBuffer ( ) ; sb . append ( dns . typeString ( typeCovered ) ) ; sb . append ( "\t" ) ; sb . append ( alg ) ; sb . append ( "<seq2seq4repair_space>" ) ; sb . append ( origTTL ) ; sb . append ( "<seq2seq4repair_space>(\n\t" ) ; sb . append ( formatDate ( expire ) ) ; sb . append ( "<seq2seq4repair_space>" ) ; sb . append ( formatDate ( timeSigned ) ) ; sb . append ( "<seq2seq4repair_space>" ) ; <START_BUG> sb . append ( footprint ) ; <END_BUG> sb . append ( "<seq2seq4repair_space>" ) ; sb . append ( signer ) ; String s = base64 . toString ( signature ) ; for ( int i = 0 ; i < ( s . length ( ) ) ; i += 64 ) { sb . append ( "\n\t" ) ; if ( ( i + 64 ) >= ( s . length ( ) ) ) { sb . append ( s . substring ( i ) ) ; sb . append ( "<seq2seq4repair_space>)" ) ; } else { sb . append ( s . substring ( i , ( i + 64 ) ) ) ; } } return sb . toString ( ) ; } String formatDate ( Date d ) { } }

Fix:
sb . append ( ( ( ( int ) ( footprint ) ) & 65535 ) ) ;
Buggy code:
public class VerbUI extends Table { private static final float MARGIN = 1 ; private static final List < String > VERBS = Arrays . asList ( "give" , "pickup" , "use" , "open" , "talkto" , "push" , "close" , "lookat" , "pull" ) ; private static final List < String > VERBS_DESC = Arrays . asList ( "Give" , "Pick<seq2seq4repair_space>up" , "Use" , "Open" , "Talk<seq2seq4repair_space>to" , "Push" , "Close" , "Lookat" , "Pull" ) ; private static final int VERB_COLS = 3 ; private static final int INVENTORY_COLS = 3 ; private static final int INVENTORY_ROWS = 3 ; private final List < ImageButton > inventorySlots = new ArrayList < ImageButton > ( ) ; private final SceneScreen sceneScreen ; private final String DEFAULT_VERB = "lookat" ; private final Label infoLine ; private String currentVerb = DEFAULT_VERB ; private InteractiveActor target ; private VerbUI . VerbUIStyle style ; private int scroll = 0 ; private Table arrowPanel ; private Table invPanel ; public VerbUI ( SceneScreen scn ) { } private Table createArrowPanel ( ) { } private Table createVerbPanel ( ) { } @ Override public void sizeChanged ( ) { } @ Override public void act ( float delta ) { } private Table createInventoryPanel ( ) { } public String getCurrentVerb ( ) { } public String getTarget ( ) { } public void setCurrentActor ( InteractiveActor actor ) { } private String getTranslatedDesc ( InteractiveActor actor ) { String desc = null ; <START_BUG> if ( actor != null ) { <END_BUG> desc = actor . getDesc ( ) ; if ( ( desc . charAt ( 0 ) ) == '@' ) desc = I18N . getString ( desc . substring ( 1 ) ) ; } return desc ; } public void show ( ) { } public void hide ( ) { } public static class VerbUIStyle { public Drawable background ; public TextButtonStyle verbButtonStyle ; public ButtonStyle inventoryButtonStyle ; public LabelStyle infoLineLabelStyle ; public Drawable upArrow ; public Drawable downArrow ; public VerbUIStyle ( ) { } public VerbUIStyle ( VerbUI . VerbUIStyle style ) { } } }

Fix:
if ( ( actor != null ) && ( ( actor . getDesc ( ) ) != null ) ) {
Buggy code:
public class StandardStorageFormat implements StorageFormat { private FileFilter myFileFilter ; private String myFileExtension ; private String myFileDescription ; public StandardStorageFormat ( ) { } protected String createFileExtension ( ) { } public void setFileExtension ( String newFileExtension ) { } public String getFileExtension ( ) { } public String createFileDescription ( ) { } public void setFileDescription ( String newFileDescription ) { } public String getFileDescription ( ) { } protected FileFilter createFileFilter ( ) { return new FileFilter ( ) { public boolean accept ( File checkFile ) { if ( checkFile . isDirectory ( ) ) { return true ; } else { <START_BUG> return checkFile . getName ( ) . endsWith ( ( "." + ( getFileDescription ( ) ) ) ) ; <END_BUG> } } public String getDescription ( ) { return getFileDescription ( ) ; } } ; } public void setFileFilter ( FileFilter newFileFilter ) { } public FileFilter getFileFilter ( ) { } public boolean isRestoreFormat ( ) { } public boolean isStoreFormat ( ) { } public String store ( String fileName , Drawing saveDrawing ) throws IOException { } public Drawing restore ( String fileName ) throws IOException { } public boolean equals ( Object compareObject ) { } protected String adjustFileName ( String testFileName ) { } protected boolean hasCorrectFileExtension ( String testFileName ) { } }

Fix:
return checkFile . getName ( ) . endsWith ( ( "." + ( getFileExtension ( ) ) ) ) ;
Buggy code:
public enum JavaVersion { JAVA_0_9 ( 1.5F , "0.9" ) , JAVA_1_1 ( 1.1F , "1.1" ) , JAVA_1_2 ( 1.2F , "1.2" ) , JAVA_1_3 ( 1.3F , "1.3" ) , JAVA_1_4 ( 1.4F , "1.4" ) , JAVA_1_5 ( 1.5F , "1.5" ) , JAVA_1_6 ( 1.6F , "1.6" ) , JAVA_1_7 ( 1.7F , "1.7" ) , JAVA_1_8 ( 1.8F , "1.8" ) ; private float value ; private String name ; JavaVersion ( final float value , final String name ) { } <START_BUG> public boolean atLeast ( JavaVersion requiredVersion ) { <END_BUG> return ( this . value ) >= ( requiredVersion . value ) ; } static JavaVersion getJavaVersion ( final String nom ) { } static JavaVersion get ( final String nom ) { } @ Override public String toString ( ) { } }

Fix:
public boolean atLeast ( final JavaVersion requiredVersion ) {
Buggy code:
final class Locator { private List < String > tokens ; Locator ( List < String > tokens ) { } public static Locator of ( String expression ) { <START_BUG> return new Locator ( Arrays . asList ( expression . split ( "//" ) ) . stream ( ) . filter ( ( s ) -> ! ( s . isEmpty ( ) ) ) . collect ( Collectors . toList ( ) ) ) ; <END_BUG> } public String getRootPath ( ) { } public String getSubPath ( ) { } public List < String > getSubPathTokens ( ) { } public String getPath ( ) { } private boolean containsPlaceholder ( String token ) { } @ Override public String toString ( ) { } }

Fix:
return new Locator ( Arrays . asList ( expression . split ( "//" ) ) . stream ( ) . collect ( Collectors . toList ( ) ) ) ;
Buggy code:
public class PumpStreamHandler implements ExecuteStreamHandler { private Thread outputThread ; private Thread errorThread ; private StreamPumper inputPump ; private OutputStream out ; private OutputStream err ; private InputStream input ; public PumpStreamHandler ( OutputStream out , OutputStream err , InputStream input ) { } public PumpStreamHandler ( OutputStream out , OutputStream err ) { } public PumpStreamHandler ( OutputStream outAndErr ) { } public PumpStreamHandler ( ) { } public void setProcessOutputStream ( InputStream is ) { } public void setProcessErrorStream ( InputStream is ) { } public void setProcessInputStream ( OutputStream os ) { } public void start ( ) { } public void stop ( ) { } private static final long JOIN_TIMEOUT = 200 ; protected final void finish ( Thread t ) { } protected OutputStream getErr ( ) { } protected OutputStream getOut ( ) { } protected void createProcessOutputPump ( InputStream is , OutputStream os ) { } protected void createProcessErrorPump ( InputStream is , OutputStream os ) { } protected Thread createPump ( InputStream is , OutputStream os ) { } protected Thread createPump ( InputStream is , OutputStream os , boolean closeWhenExhausted ) { } StreamPumper createInputPump ( InputStream is , OutputStream os , boolean closeWhenExhausted ) { <START_BUG> StreamPumper pumper = new StreamPumper ( is , os , closeWhenExhausted , true ) ; <END_BUG> pumper . setAutoflush ( true ) ; return pumper ; } protected static class ThreadWithPumper extends Thread { private final StreamPumper pumper ; public ThreadWithPumper ( StreamPumper p ) { } protected StreamPumper getPumper ( ) { } } }

Fix:
StreamPumper pumper = new StreamPumper ( is , os , closeWhenExhausted , false ) ;
Buggy code:
public class Kjc extends DefaultCompilerAdapter { public boolean execute ( ) throws TaskException { } protected Commandline setupKjcCommand ( ) throws TaskException { Commandline cmd = new Commandline ( ) ; Path classpath = getCompileClasspath ( ) ; if ( ( m_deprecation ) == true ) { cmd . createArgument ( ) . setValue ( "-deprecation" ) ; } if ( ( m_destDir ) != null ) { cmd . createArgument ( ) . setValue ( "-d" ) ; cmd . createArgument ( ) . setFile ( m_destDir ) ; } cmd . createArgument ( ) . setValue ( "-classpath" ) ; <START_BUG> Path cp = new Path ( m_project ) ; <END_BUG> if ( ( m_bootclasspath ) != null ) { cp . append ( m_bootclasspath ) ; } if ( ( m_extdirs ) != null ) { cp . addExtdirs ( m_extdirs ) ; } cp . append ( classpath ) ; cp . append ( src ) ; cmd . createArgument ( ) . setPath ( cp ) ; if ( ( m_encoding ) != null ) { cmd . createArgument ( ) . setValue ( "-encoding" ) ; cmd . createArgument ( ) . setValue ( m_encoding ) ; } if ( m_debug ) { cmd . createArgument ( ) . setValue ( "-g" ) ; } if ( m_optimize ) { cmd . createArgument ( ) . setValue ( "-O2" ) ; } if ( m_verbose ) { cmd . createArgument ( ) . setValue ( "-verbose" ) ; } addCurrentCompilerArgs ( cmd ) ; logAndAddFilesToCompile ( cmd ) ; return cmd ; } }

Fix:
Path cp = new Path ( ) ;
Buggy code:
public class RuntimeStrategyInstaller extends StrategyInstaller { private static final Localizer _loc = Localizer . forPackage ( RuntimeStrategyInstaller . class ) ; public RuntimeStrategyInstaller ( MappingRepository repos ) { } public void installStrategy ( ClassMapping cls ) { } public void installStrategy ( FieldMapping field ) { FieldStrategy strategy = null ; ClassMapping owner = getOutermostDefiningMapping ( field ) ; <START_BUG> if ( ( owner != null ) && ( ! ( owner . isEmbeddable ( ) ) ) ) <END_BUG> strategy = repos . namedStrategy ( field , true ) ; if ( strategy == null ) { try { strategy = repos . defaultStrategy ( field , true , false ) ; } catch ( MetaDataException mde ) { Class cls = field . getDefiningMetaData ( ) . getDescribedType ( ) ; if ( ( ( ( ( ( ! ( Modifier . isAbstract ( cls . getModifiers ( ) ) ) ) || ( ( field . getMappedBy ( ) ) != null ) ) || ( field . getMappingInfo ( ) . hasSchemaComponents ( ) ) ) || ( field . getValueInfo ( ) . hasSchemaComponents ( ) ) ) || ( field . getElementMapping ( ) . getValueInfo ( ) . hasSchemaComponents ( ) ) ) || ( field . getKeyMapping ( ) . getValueInfo ( ) . hasSchemaComponents ( ) ) ) throw mde ; strategy = NoneFieldStrategy . getInstance ( ) ; } } field . setStrategy ( strategy , Boolean . FALSE ) ; } private ClassMapping getOutermostDefiningMapping ( ValueMetaData vm ) { } public void installStrategy ( Version version ) { } public void installStrategy ( Discriminator discrim ) { } }

Fix:
if ( ( ( owner != null ) && ( ! ( owner . isEmbeddable ( ) ) ) ) && ( ! ( owner . isAbstract ( ) ) ) )
Buggy code:
@ SuppressWarnings ( "serial" ) public class PratilipiSite extends HttpServlet { private static final Logger logger = Logger . getGlobal ( ) ; private static final Language defaulLang = Language . ENGLISH ; private static final String templateFilePrefix = "com//pratilipi//site//page//" ; private static final String dataFilePrefix = "page//data//" ; private static final String languageFilePrefix = "WEB-INF//classes//com//pratilipi//site//i18n//language." ; public void doGet ( HttpServletRequest request , HttpServletResponse response ) throws IOException { } public Map < String , Object > createDataModelForHomePage ( Language lang ) throws UnexpectedServerException { } public Map < String , Object > createDataModelForListPage ( PratilipiType type , Language lang ) throws UnexpectedServerException { SearchAccessor searchAccessor = DataAccessorFactory . getSearchAccessor ( ) ; DataAccessor dataAccessor = DataAccessorFactory . getDataAccessor ( ) ; Gson gson = new Gson ( ) ; PratilipiFilter pratilipiFilter = new PratilipiFilter ( ) ; pratilipiFilter . setType ( type ) ; <START_BUG> pratilipiFilter . setLanguageCode ( ( lang == null ? null : lang . getCode ( ) ) ) ; <END_BUG> DataListCursorTuple < Long > pratilipiIdListCursorTuple = searchAccessor . searchPratilipi ( pratilipiFilter , null , 20 ) ; List < Pratilipi > pratilipiList = dataAccessor . getPratilipiList ( pratilipiIdListCursorTuple . getDataList ( ) ) ; String cursor = pratilipiIdListCursorTuple . getCursor ( ) ; List < String > pratilipiJsonList = new java . util . ArrayList ( pratilipiList . size ( ) ) ; for ( Pratilipi pratilipi : pratilipiList ) { Author author = dataAccessor . getAuthor ( pratilipi . getAuthorId ( ) ) ; PratilipiData pratilipiData = PratilipiDataUtil . createData ( pratilipi , author ) ; pratilipiJsonList . add ( gson . toJson ( pratilipiData ) . toString ( ) ) ; } Map < String , Object > dataModel = new HashMap < String , Object > ( ) ; dataModel . put ( "pratilipiJsonList" , pratilipiJsonList ) ; dataModel . put ( "pratilipiFilter" , gson . toJson ( pratilipiFilter ) ) ; dataModel . put ( "pratilipiListCursor" , cursor ) ; return dataModel ; } public Map < String , Object > createDataModelForPratilipiPage ( Long pratilipiId ) { } public Map < String , Object > createDataModelForAuthorPage ( Long authorId ) { } public < T > T getData ( String fileName , Class < T > clazz ) throws UnexpectedServerException { } No newline ; at end ; of file ; }

Fix:
pratilipiFilter . setLanguage ( lang ) ;
Buggy code:
public class Name2Pinyin { public static void decare ( List < List < String > > nameArray , List < String > IpinyinList , List < String > firstWordsList , int depth , String sep ) { ArrayList < String > result = new ArrayList < String > ( ) ; result . add ( "" ) ; for ( List pinyinlist : nameArray ) { if ( ( pinyinlist . size ( ) ) >= depth ) { pinyinlist = pinyinlist . subList ( 0 , depth ) ; } ArrayList < String > tmpPinyinList = new ArrayList < > ( ) ; for ( String partialResult : result ) { for ( Object pinyin : pinyinlist ) { if ( partialResult . equals ( "" ) ) { tmpPinyinList . add ( ( ( ( String ) ( pinyin ) ) + "<seq2seq4repair_space>" ) ) ; } else { tmpPinyinList . add ( ( ( partialResult + ( ( String ) ( pinyin ) ) ) + "<seq2seq4repair_space>" ) ) ; } } } result = tmpPinyinList ; } for ( String pinyin : result ) { StringBuilder tmpFirstLetterStr = new StringBuilder ( ) ; String [ ] splitedPinyin = pinyin . split ( "<seq2seq4repair_space>" ) ; StringBuilder stringBuilder = new StringBuilder ( ) ; for ( String wordsPinyin : splitedPinyin ) { stringBuilder . append ( wordsPinyin ) ; <START_BUG> if ( ( pinyin . length ( ) ) > 0 ) { <END_BUG> tmpFirstLetterStr . append ( wordsPinyin . substring ( 0 , 1 ) ) ; } } IpinyinList . add ( stringBuilder . toString ( ) ) ; firstWordsList . add ( tmpFirstLetterStr . toString ( ) ) ; } } static HashMap totalWordsHashMap = new HashMap ( ) ; static HashMap familyNameHashMap = new HashMap ( ) ; public static void loadFamilyName ( ) { } public static void loadTatalWordsPinyin ( ) { } public static void getPinyin ( String Iname , ArrayList < String > IpinyinList , ArrayList < String > IfirstWordPinyin ) { } public static void getPinyin ( String Iname , ArrayList < String > pinyinList , ArrayList < String > firstWordPinyin , int width ) { } public static void getPinyin ( String Iname , ArrayList < String > pinyinList , ArrayList < String > firstWordPinyin , int width , int depth ) { } public static void getPinyin ( String Iname , ArrayList < String > pinyinList , ArrayList < String > firstWordPinyin , int width , int depth , String sep ) { } public static void main ( String [ ] args ) { } }

Fix:
if ( ( wordsPinyin . length ( ) ) > 0 ) {
Buggy code:
public class RegionBasedTypeHierarchy extends TypeHierarchy { protected IRegion fRegion ; protected IJavaProject fProject ; public RegionBasedTypeHierarchy ( IRegion region , IJavaProject project , IType type , boolean computeSubtypes ) throws JavaModelException { } protected void activate ( ) { } protected void compute ( ) throws CoreException , JavaModelException { } protected void destroy ( ) { } protected boolean isAffectedByOpenable ( IJavaElementDelta delta , IJavaElement element ) { if ( ( element instanceof CompilationUnit ) && ( ( ( CompilationUnit ) ( element ) ) . isWorkingCopy ( ) ) ) { return false ; } <START_BUG> if ( ( this . type ) == null ) { <END_BUG> return fRegion . contains ( element ) ; } else { return super . isAffectedByOpenable ( delta , element ) ; } } public IJavaProject javaProject ( ) { } public void pruneDeadBranches ( ) { } private void pruneDeadBranches ( IType [ ] types , boolean superInRegion ) { } protected void removeType ( IType type ) { } }

Fix:
if ( ( this . focusType ) == null ) {
Buggy code:
public class RosterFragment extends Fragment { private final String TAG = getClass ( ) . getSimpleName ( ) ; private static final boolean L = true ; public interface OnRosterChangeListener { public void onRosterChange ( int tID , Bundle dcdrState ) { } } private RosterFragment . OnRosterChangeListener rosterListener ; MainActivity mActivity ; private EditText mDcdrName1 ; private EditText mDcdrTyp1 ; private EditText mDcdrAddr1 ; private EditText mDcdrStep1 ; private int mDcdrFkey1 = 0 ; private ToggleButton mDcdrSelBtn1 ; private EditText mDcdrName2 ; private EditText mDcdrTyp2 ; private EditText mDcdrAddr2 ; private EditText mDcdrStep2 ; private int mDcdrFkey2 = 0 ; private ToggleButton mDcdrSelBtn2 ; private static Bundle rosterState = null ; private static boolean btn1State = false ; private static boolean btn2State = false ; private static final String NAME = "DCDR_NAME" ; private static final String ADDR = "DCDR_ADR" ; private static final String STATE = "DCDR_CNCT" ; private static final String TYPE = "ADR_TYP" ; private static final String STEPS = "SPD_STEPS" ; private static final String FKEYS = "KEY_STATES" ; public RosterFragment ( ) { } public static RosterFragment newInstance ( ) { } @ Override public void onAttach ( Activity activity ) { super . onAttach ( activity ) ; if ( RosterFragment . L ) Log . i ( TAG , ( "onAttach<seq2seq4repair_space>" + ( activity . getClass ( ) . getSimpleName ( ) ) ) ) ; try { rosterListener = ( ( RosterFragment . OnRosterChangeListener ) ( activity ) ) ; } catch ( ClassCastException e ) { throw new ClassCastException ( ( ( activity . toString ( ) ) + "<seq2seq4repair_space>must<seq2seq4repair_space>implement<seq2seq4repair_space>Server<seq2seq4repair_space>Change<seq2seq4repair_space>Listener" ) ) ; } this . mActivity = ( ( MainActivity ) ( activity ) ) ; <START_BUG> this . mActivity . onSectionAttached ( 1 ) ; <END_BUG> } @ Override public void onCreate ( Bundle saved ) { } @ Override public View onCreateView ( LayoutInflater inflater , ViewGroup container , Bundle savedInstanceState ) { } @ Override public void onActivityCreated ( Bundle saved ) { } @ Override public void onStart ( ) { } @ Override public void onResume ( ) { } @ Override public void onPause ( ) { } @ Override public void onStop ( ) { } @ Override public void onSaveInstanceState ( Bundle toSave ) { } private void onRestoreInstanceState ( Bundle fromSave ) { } No newline ; at end ; of file ; }

Fix:
this . mActivity . onSectionAttached ( 2 ) ;
Buggy code:
public class DefaultMarkupCacheKeyProvider implements IMarkupCacheKeyProvider { public DefaultMarkupCacheKeyProvider ( ) { } public String getCacheKey ( final MarkupContainer container , final Class < ? > clazz ) { final String classname = clazz . getName ( ) ; final Locale locale = container . getLocale ( ) ; <START_BUG> final String style = container . getStyle ( ) ; <END_BUG> final String markupType = container . getMarkupType ( ) ; final AppendingStringBuffer buffer = new AppendingStringBuffer ( ( ( classname . length ( ) ) + 64 ) ) ; buffer . append ( classname ) ; if ( locale != null ) { final boolean l = ( locale . getLanguage ( ) . length ( ) ) != 0 ; final boolean c = ( locale . getCountry ( ) . length ( ) ) != 0 ; final boolean v = ( locale . getVariant ( ) . length ( ) ) != 0 ; buffer . append ( locale . getLanguage ( ) ) ; if ( c || ( l && v ) ) { buffer . append ( '_' ) . append ( locale . getCountry ( ) ) ; } if ( v && ( l || c ) ) { buffer . append ( '_' ) . append ( locale . getVariant ( ) ) ; } } if ( style != null ) { buffer . append ( style ) ; } buffer . append ( markupType ) ; return buffer . toString ( ) ; } }

Fix:
final String style = ( ( container . getStyle ( ) ) + "_" ) + ( container . getVariation ( ) ) ;