nus-yam/ex-repair huggingface dataset:
Buggy code:
public class BeanToJsonConverter { private static final int MAX_DEPTH = 5 ; public String convert ( Object object ) { if ( object == null ) { return null ; } try { JsonElement json = convertObject ( object ) ; <START_BUG> return new GsonBuilder ( ) . serializeNulls ( ) . create ( ) . toJson ( json ) ; <END_BUG> } catch ( Exception e ) { throw new WebDriverException ( ( "Unable<seq2seq4repair_space>to<seq2seq4repair_space>convert:<seq2seq4repair_space>" + object ) , e ) ; } } public JsonElement convertObject ( Object object ) { } @ SuppressWarnings ( "unchecked" ) private JsonElement convertObject ( Object toConvert , int maxDepth ) throws Exception { } private Method getMethod ( Object toConvert , String methodName ) { } private JsonElement mapObject ( Object toConvert , int maxDepth , boolean skipNulls ) throws Exception { } }

Fix:
return new GsonBuilder ( ) . disableHtmlEscaping ( ) . serializeNulls ( ) . create ( ) . toJson ( json ) ;
Buggy code:
public class State < T extends Payload < T > > implements Comparable < State < T > > { static volatile int objectCount = 0 ; int id = ( State . objectCount ) ++ ; private Random gen = new Random ( ) ; private double [ ] params ; private Mapping [ ] maps ; private double omni ; private double [ ] step ; private double value ; private T payload ; private State ( ) { } public State ( double [ ] x0 , double omni ) { } public State < T > copy ( ) { } public State < T > mutate ( ) { double sum = 0 ; for ( double v : step ) { sum += v * v ; } sum = Math . sqrt ( sum ) ; double lambda = 1 + ( gen . nextGaussian ( ) ) ; State < T > r = this . copy ( ) ; double magnitude = ( 0.9 * ( omni ) ) + ( sum // 10 ) ; r . omni = magnitude * ( - ( Math . log ( ( 1 - ( gen . nextDouble ( ) ) ) ) ) ) ; for ( int i = 0 ; i < ( step . length ) ; i ++ ) { r . step [ i ] = ( lambda * ( step [ i ] ) ) + ( ( r . omni ) * ( gen . nextGaussian ( ) ) ) ; r . params [ i ] += r . step [ i ] ; } <START_BUG> if ( ( r . payload ) != null ) { <END_BUG> r . payload . update ( r . getMappedParams ( ) ) ; } return r ; } public void setMap ( int i , Mapping m ) { } public double get ( int i ) { } public double [ ] getMappedParams ( ) { } public double getOmni ( ) { } public double [ ] getStep ( ) { } public T getPayload ( ) { } public double getValue ( ) { } public void setRand ( Random rand ) { } public void setOmni ( double omni ) { } public void setValue ( double v ) { } public void setPayload ( T payload ) { } @ Override public int compareTo ( State other ) { } public String toString ( ) { } }

Fix:
if ( ( this . payload ) != null ) {
Buggy code:
public class RestaurantController extends Controller { static Form < Meal > inputForm = new Form < Meal > ( Meal . class ) ; public static Result createMeal ( ) { User u = Session . getCurrentUser ( ctx ( ) ) ; if ( ! ( u . role . equalsIgnoreCase ( "RESTAURANT" ) ) ) { return ok ( wrong . render ( "Cannot<seq2seq4repair_space>create<seq2seq4repair_space>meal<seq2seq4repair_space>if<seq2seq4repair_space>you're<seq2seq4repair_space>not<seq2seq4repair_space>reastaurant!<seq2seq4repair_space>" ) ) ; } String mealName = RestaurantController . inputForm . bindFromRequest ( ) . field ( "name" ) . value ( ) ; String mealPrice = RestaurantController . inputForm . bindFromRequest ( ) . field ( "price" ) . value ( ) ; mealPrice = mealPrice . replace ( ',' , '.' ) ; Double price = Double . parseDouble ( mealPrice ) ; if ( ( Meal . create ( mealName , price ) ) == true ) { <START_BUG> return ok ( user . render ( Session . getCurrentUser ( ctx ( ) ) . email ) ) ; <END_BUG> } return TODO ; } public static Result deleteMeal ( ) { } public static Result list ( ) { } public static Result details ( int id ) { } No newline ; at end ; of file ; }

Fix:
return ok ( restaurant . render ( Session . getCurrentUser ( ctx ( ) ) . email ) ) ;
Buggy code:
public class RemoveTrailingUnderscoreProcessorFactory extends UpdateRequestProcessorFactory { private String [ ] fields ; @ Override public void init ( @ SuppressWarnings ( "rawtypes" ) final NamedList args ) { final SolrParams parameters = SolrParams . toSolrParams ( args ) ; <START_BUG> fields = parameters . getParams ( "fields" ) ; <END_BUG> } @ Override public UpdateRequestProcessor getInstance ( final SolrQueryRequest request , final SolrQueryResponse response , final UpdateRequestProcessor next ) { } }

Fix:
fields = parameters . get ( "fields" , "" ) . split ( "," ) ;
Buggy code:
final class HandlerAdd extends AbstractAddStepHandler { static final HandlerAdd INSTANCE = new HandlerAdd ( ) ; private HandlerAdd ( ) { } @ Override protected void performRuntime ( final OperationContext context , final ModelNode operation , final ModelNode model , final ServiceVerificationHandler verificationHandler , final List < ServiceController < ? > > newControllers ) throws OperationFailedException { final ServerConfig config = PackageUtils . getServerConfig ( context ) ; if ( config != null ) { final PathAddress address = PathAddress . pathAddress ( operation . require ( OP_ADDR ) ) ; final PathElement confElem = address . getElement ( ( ( address . size ( ) ) - 3 ) ) ; final String configType = confElem . getKey ( ) ; final String configName = confElem . getValue ( ) ; final String handlerChainType = address . getElement ( ( ( address . size ( ) ) - 2 ) ) . getKey ( ) ; final String handlerChainId = address . getElement ( ( ( address . size ( ) ) - 2 ) ) . getValue ( ) ; final String handlerName = address . getElement ( ( ( address . size ( ) ) - 1 ) ) . getValue ( ) ; final String handlerClass = operation . require ( Constants . CLASS ) . asString ( ) ; for ( final CommonConfig commonConfig : PackageUtils . getConfigs ( config , configType ) ) { if ( configName . equals ( commonConfig . getConfigName ( ) ) ) { final List < UnifiedHandlerChainMetaData > handlerChains ; if ( Constants . PRE_HANDLER_CHAIN . equals ( handlerChainType ) ) { handlerChains = commonConfig . getPreHandlerChains ( ) ; } else if ( Constants . POST_HANDLER_CHAIN . equals ( handlerChainType ) ) { handlerChains = commonConfig . getPostHandlerChains ( ) ; } else { throw WSMessages . MESSAGES . wrongHandlerChainType ( handlerChainType , Constants . PRE_HANDLER_CHAIN , Constants . POST_HANDLER_CHAIN ) ; } final UnifiedHandlerChainMetaData handlerChain = HandlerAdd . getChain ( handlerChains , handlerChainId ) ; if ( handlerChain == null ) { throw WSMessages . MESSAGES . multipleHandlerChainsWithSameId ( handlerChainType , handlerChainId , configName ) ; } final UnifiedHandlerMetaData handler = new UnifiedHandlerMetaData ( ) ; handler . setHandlerName ( handlerName ) ; handler . setHandlerClass ( handlerClass ) ; handlerChain . addHandler ( handler ) ; if ( ! ( context . isBooting ( ) ) ) { <START_BUG> context . restartRequired ( ) ; <END_BUG> } return ; } } throw WSMessages . MESSAGES . missingConfig ( configName ) ; } } private static UnifiedHandlerChainMetaData getChain ( final List < UnifiedHandlerChainMetaData > handlerChains , final String handlerChainId ) { } @ Override protected void populateModel ( final ModelNode operation , final ModelNode model ) throws OperationFailedException { } }

Fix:
context . reloadRequired ( ) ;
Buggy code:
public class Genotype { private String reference ; private String alternate ; private int [ ] allelesIdx ; private boolean phased ; private AllelesCode code ; private int count ; Genotype ( ) { } public Genotype ( String genotype ) { } public Genotype ( String genotype , String ref , String alt ) { } private void parseGenotype ( String genotype ) { String [ ] alleles = genotype . split ( "//|\\|" , ( - 1 ) ) ; this . code = ( ( alleles . length ) > 1 ) ? AllelesCode . ALLELES_OK : AllelesCode . HAPLOID ; this . allelesIdx = new int [ alleles . length ] ; for ( int i = 0 ; i < ( alleles . length ) ; i ++ ) { String allele = alleles [ i ] ; <START_BUG> if ( allele . equals ( "." ) ) { <END_BUG> this . code = AllelesCode . ALLELES_MISSING ; this . allelesIdx [ i ] = - 1 ; } else { if ( StringUtils . isNumeric ( allele ) ) { this . allelesIdx [ i ] = Integer . parseInt ( allele ) ; } else { if ( allele . equalsIgnoreCase ( reference ) ) { this . allelesIdx [ i ] = 0 ; } else if ( allele . equalsIgnoreCase ( alternate ) ) { this . allelesIdx [ i ] = 1 ; } else { if ( allele . isEmpty ( ) ) { System . out . println ( ( ( ( "Empty<seq2seq4repair_space>allele:<seq2seq4repair_space>REF=" + ( reference ) ) + ",ALT=" ) + ( alternate ) ) ) ; } this . allelesIdx [ i ] = 2 ; } } if ( ( allelesIdx [ i ] ) > 1 ) { this . code = AllelesCode . MULTIPLE_ALTERNATES ; } } } } public String getReference ( ) { } void setReference ( String reference ) { } public String getAlternate ( ) { } void setAlternate ( String alternate ) { } public int getAllele ( int i ) { } public int [ ] getAllelesIdx ( ) { } public int [ ] getNormalizedAllelesIdx ( ) { } void setAllelesIdx ( int [ ] allelesIdx ) { } public boolean isAlleleRef ( int i ) { } public boolean isPhased ( ) { } void setPhased ( boolean phased ) { } public AllelesCode getCode ( ) { } void setCode ( AllelesCode code ) { } public Integer getCount ( ) { } public void setCount ( int count ) { } public void incrementCount ( int count ) { } public String getGenotypeInfo ( ) { } public int encode ( ) { } public static Genotype decode ( int encoding ) { } @ Override public String toString ( ) { } @ Override public int hashCode ( ) { } @ Override public boolean equals ( Object obj ) { } }

Fix:
if ( ( allele . equals ( "." ) ) || ( allele . equals ( "-1" ) ) ) {
Buggy code:
public class LineIterator implements Iterator < String > { private final BufferedReader bufferedReader ; private String cachedLine ; private boolean finished = false ; public LineIterator ( final Reader reader ) throws IllegalArgumentException { } public boolean hasNext ( ) { if ( ( cachedLine ) != null ) { return true ; } else if ( finished ) { return false ; } else { try { while ( true ) { String line = bufferedReader . readLine ( ) ; if ( line == null ) { finished = true ; return false ; } else if ( isValidLine ( line ) ) { cachedLine = line ; return true ; } } } catch ( IOException ioe ) { close ( ) ; <START_BUG> throw new IllegalStateException ( ioe . toString ( ) ) ; <END_BUG> } } } protected boolean isValidLine ( String line ) { } public String next ( ) { } public String nextLine ( ) { } public void close ( ) { } public void remove ( ) { } public static void closeQuietly ( LineIterator iterator ) { } }

Fix:
throw new IllegalStateException ( ioe ) ;
Buggy code:
public class STRING extends Instruction implements Evaluable { public static final STRING _ = new STRING ( ) ; private STRING ( ) { } @ Override public OnQuestion onCalcQuestion ( ) { } class Calc extends OnQuestion { @ Override public void act ( final PFlow pf ) { } } public static StringBuilder eval ( PFlow pf , Node node ) { StringBuilder sb = new StringBuilder ( ) ; <START_BUG> IndexHits < Relationship > hits = Order . context ( node ) ; <END_BUG> try { for ( Relationship r : hits ) { try { sb . append ( CachedSerializer . STRING . serialize ( pf . getVector ( ) . question2 ( r ) ) ) ; } catch ( IOException e ) { pf . sendException ( e ) ; return null ; } } } finally { hits . close ( ) ; } return sb ; } No newline ; at end ; of file ; }

Fix:
IndexHits < Relationship > hits = Order . queryDown ( node ) ;
Buggy code:
public class LaplaceDistribution extends AbstractRealDistribution { private static final long serialVersionUID = 20141003 ; private final double mu ; private final double beta ; public LaplaceDistribution ( double mu , double beta ) { } public LaplaceDistribution ( RandomGenerator rng , double mu , double beta ) { } public double getLocation ( ) { } public double getScale ( ) { } public double density ( double x ) { } public double cumulativeProbability ( double x ) { } @ Override public double inverseCumulativeProbability ( double p ) throws OutOfRangeException { if ( ( p < 0.0 ) || ( p > 1.0 ) ) { throw new OutOfRangeException ( p , 0.0 , 1.0 ) ; } else if ( p == 0 ) { <START_BUG> return 0.0 ; <END_BUG> } else if ( p == 1 ) { return Double . POSITIVE_INFINITY ; } double x = ( p > 0.5 ) ? - ( Math . log ( ( 2.0 - ( 2.0 * p ) ) ) ) : Math . log ( ( 2.0 * p ) ) ; return ( mu ) + ( ( beta ) * x ) ; } public double getNumericalMean ( ) { } public double getNumericalVariance ( ) { } public double getSupportLowerBound ( ) { } public double getSupportUpperBound ( ) { } public boolean isSupportLowerBoundInclusive ( ) { } public boolean isSupportUpperBoundInclusive ( ) { } public boolean isSupportConnected ( ) { } }

Fix:
return Double . NEGATIVE_INFINITY ;
Buggy code:
public class JBossContextConfig extends ContextConfig { private static Logger log = Logger . getLogger ( JBossContextConfig . class ) ; private DeploymentUnit deploymentUnitContext = null ; private Set < String > overlays = new HashSet < String > ( ) ; public JBossContextConfig ( DeploymentUnit deploymentUnitContext ) { } @ Override public void lifecycleEvent ( LifecycleEvent event ) { } @ Override protected void applicationWebConfig ( ) { } @ Override protected void defaultWebConfig ( ) { } protected void processJBossWebMetaData ( JBossWebMetaData metaData ) { } protected Object getInstance ( String moduleName , String className , List < ParamValueMetaData > params ) { } protected void processWebMetaData ( JBossWebMetaData metaData ) { } @ Override protected void init ( ) { } @ Override protected void destroy ( ) { } @ Override protected void applicationTldConfig ( ) { final TldsMetaData tldsMetaData = deploymentUnitContext . getAttachment ( ATTACHMENT_KEY ) ; if ( tldsMetaData == null ) { return ; } Map < String , TldMetaData > localTlds = tldsMetaData . getTlds ( ) ; <START_BUG> List < TldMetaData > sharedTlds = tldsMetaData . getSharedTlds ( ) ; <END_BUG> ArrayList < TagLibraryInfo > tagLibraries = new ArrayList < TagLibraryInfo > ( ) ; for ( String location : localTlds . keySet ( ) ) { processTld ( tagLibraries , location , localTlds . get ( location ) ) ; } for ( TldMetaData sharedTld : sharedTlds ) { processTld ( tagLibraries , null , sharedTld ) ; } String [ ] taglibs = context . findTaglibs ( ) ; for ( int i = 0 ; i < ( taglibs . length ) ; i ++ ) { String uri = taglibs [ i ] ; String path = context . findTaglib ( taglibs [ i ] ) ; String location = "" ; if ( ( ( path . indexOf ( ':' ) ) == ( - 1 ) ) && ( ! ( path . startsWith ( "//" ) ) ) ) { path = "//WEB-INF//" + path ; } if ( path . endsWith ( ".jar" ) ) { location = path ; path = "META-INF//taglib.tld" ; } for ( int j = 0 ; j < ( tagLibraries . size ( ) ) ; j ++ ) { TagLibraryInfo tagLibraryInfo = tagLibraries . get ( j ) ; if ( ( tagLibraryInfo . getLocation ( ) . equals ( location ) ) && ( tagLibraryInfo . getPath ( ) . equals ( path ) ) ) { context . addJspTagLibrary ( uri , tagLibraryInfo ) ; } } } } protected void processTld ( ArrayList < TagLibraryInfo > tagLibraries , String location , TldMetaData tldMetaData ) { } @ Override public void applicationServletContainerInitializerConfig ( ) { } @ Override protected void createFragmentsOrder ( ) { } @ Override protected void applicationExtraDescriptorsConfig ( ) { } protected void resolveAnnotations ( JBossAnnotationsMetaData annotations ) { } @ Override protected void completeConfig ( ) { } }

Fix:
List < TldMetaData > sharedTlds = tldsMetaData . getSharedTlds ( deploymentUnitContext ) ;
Buggy code:
public class SuperTypeNamesCollector { SearchPattern pattern ; char [ ] typeSimpleName ; char [ ] typeQualification ; MatchLocator locator ; IType type ; IProgressMonitor progressMonitor ; char [ ] [ ] [ ] result ; int resultIndex ; public class TypeDeclarationVisitor extends ASTVisitor { public boolean visit ( TypeDeclaration typeDeclaration , BlockScope scope ) { } public boolean visit ( TypeDeclaration typeDeclaration , CompilationUnitScope scope ) { } public boolean visit ( TypeDeclaration memberTypeDeclaration , ClassScope scope ) { } public boolean visit ( FieldDeclaration fieldDeclaration , MethodScope scope ) { } public boolean visit ( Initializer initializer , MethodScope scope ) { } public boolean visit ( ConstructorDeclaration constructorDeclaration , ClassScope scope ) { } public boolean visit ( MethodDeclaration methodDeclaration , ClassScope scope ) { } } public SuperTypeNamesCollector ( SearchPattern pattern , char [ ] typeSimpleName , char [ ] typeQualification , MatchLocator locator , IType type , IProgressMonitor progressMonitor ) { } protected void addToResult ( char [ ] [ ] compoundName ) { } protected CompilationUnitDeclaration buildBindings ( ICompilationUnit compilationUnit ) throws JavaModelException { } public char [ ] [ ] [ ] collect ( ) throws JavaModelException { } protected void collectSuperTypeNames ( ReferenceBinding binding ) { } protected String [ ] getPathsOfDeclaringType ( ) { if ( ( ( this . typeQualification ) == null ) && ( ( this . typeSimpleName ) == null ) ) return null ; final PathCollector pathCollector = new PathCollector ( ) ; IJavaSearchScope scope = SearchEngine . createWorkspaceScope ( ) ; IndexManager indexManager = JavaModelManager . getJavaModelManager ( ) . getIndexManager ( ) ; <START_BUG> SearchPattern searchPattern = new TypeDeclarationPattern ( ( ( this . typeSimpleName ) != null ? null : this . typeQualification ) , null , this . typeSimpleName , IIndexConstants . TYPE_SUFFIX , this . pattern . matchRule ) ; <END_BUG> IndexQueryRequestor searchRequestor = new IndexQueryRequestor ( ) { public boolean acceptIndexMatch ( String documentPath , SearchPattern indexRecord , SearchParticipant participant ) { TypeDeclarationPattern record = ( ( TypeDeclarationPattern ) ( indexRecord ) ) ; if ( ( record . enclosingTypeNames ) != ( IIndexConstants . ONE_ZERO_CHAR ) ) { pathCollector . acceptIndexMatch ( documentPath , indexRecord , participant ) ; } return true ; } } ; indexManager . performConcurrentJob ( new PatternSearchJob ( searchPattern , new JavaSearchParticipant ( this . locator . workingCopies ) , scope , searchRequestor ) , IJavaSearchConstants . WAIT_UNTIL_READY_TO_SEARCH , ( ( progressMonitor ) == null ? null : new SubProgressMonitor ( progressMonitor , 100 ) ) ) ; return pathCollector . getPaths ( ) ; } protected boolean matches ( char [ ] [ ] compoundName ) { } protected boolean matches ( ReferenceBinding binding ) { } }

Fix:
SearchPattern searchPattern = new TypeDeclarationPattern ( ( ( this . typeSimpleName ) != null ? null : this . typeQualification ) , null , this . typeSimpleName , IIndexConstants . TYPE_SUFFIX , this . pattern . getMatchRule ( ) ) ;
Buggy code:
public final class SessionIdGenerator extends BaseInterceptor { String randomClassName = null ; Random randomSource = null ; DataInputStream randomIS = null ; String devRandomSource = "//dev//urandom" ; static Jdk11Compat jdk11Compat = Jdk11Compat . getJdkCompat ( ) ; public SessionIdGenerator ( ) { } public final void setRandomClass ( String randomClass ) { } public void setRandomFile ( String s ) { } public int sessionState ( Request req , ServerSession sess , int state ) { } public void engineInit ( ContextManager cm ) throws TomcatException { } String createNewId ( String jsIdent ) { String newId ; if ( ( System . getSecurityManager ( ) ) == null ) { newId = getIdentifier ( jsIdent ) ; return newId ; } SessionIdGenerator . PriviledgedIdGenerator di = new SessionIdGenerator . PriviledgedIdGenerator ( this , jsIdent ) ; try { <START_BUG> newId = ( ( String ) ( SessionIdGenerator . jdk11Compat . doPrivileged ( di ) ) ) ; <END_BUG> } catch ( Exception ex ) { newId = null ; } return newId ; } static class PriviledgedIdGenerator extends Action { SessionIdGenerator sg ; String jsIdent ; public PriviledgedIdGenerator ( SessionIdGenerator sg , String jsIdent ) { } public Object run ( ) { } } private void createRandomClass ( ) { } private static int session_count = 0 ; private static long lastTimeVal = 0 ; public static final long maxRandomLen = 2176782336L ; public static final long maxSessionLifespanTics = 46656 ; public static final long ticDifference = 2000 ; public synchronized String getIdentifier ( String jsIdent ) { } }

Fix:
newId = ( ( String ) ( SessionIdGenerator . jdk11Compat . doPrivileged ( di , SessionIdGenerator . jdk11Compat . getAccessControlContext ( ) ) ) ) ;
Buggy code:
public class ParallelTaxonomyArrays { private final int [ ] parents ; private volatile boolean initializedChildren = false ; private int [ ] children ; private int [ ] siblings ; private ParallelTaxonomyArrays ( int [ ] parents ) { } public ParallelTaxonomyArrays ( IndexReader reader ) throws IOException { } public ParallelTaxonomyArrays ( IndexReader reader , ParallelTaxonomyArrays copyFrom ) throws IOException { } private final synchronized void initChildrenSiblings ( ParallelTaxonomyArrays copyFrom ) { } private void computeChildrenSiblings ( int [ ] parents , int first ) { } private void initParents ( IndexReader reader , int first ) throws IOException { } ParallelTaxonomyArrays add ( int ordinal , int parentOrdinal ) { if ( ordinal >= ( parents . length ) ) { <START_BUG> int [ ] newarray = ArrayUtil . grow ( parents ) ; <END_BUG> newarray [ ordinal ] = parentOrdinal ; return new ParallelTaxonomyArrays ( newarray ) ; } parents [ ordinal ] = parentOrdinal ; return this ; } public int [ ] parents ( ) { } public int [ ] children ( ) { } public int [ ] siblings ( ) { } }

Fix:
int [ ] newarray = ArrayUtil . grow ( parents , ( ordinal + 1 ) ) ;
Buggy code:
public class UserSearchLabelProvider extends LabelProvider { public Image getImage ( Object element ) { } public String getText ( Object element ) { if ( element instanceof IResult ) { return ( ( IResult ) ( element ) ) . getUser ( ) . getName ( ) ; } else if ( element instanceof IResultList ) { <START_BUG> return ( ( ( IResultList ) ( element ) ) . geResults ( ) . size ( ) ) + ( Messages . UserSearchLabelProvider_ContactsFound ) ; <END_BUG> } return element . toString ( ) ; } }

Fix:
return ( ( ( IResultList ) ( element ) ) . getResults ( ) . size ( ) ) + ( Messages . UserSearchLabelProvider_ContactsFound ) ;
Buggy code:
public class RecursivePrefixTreeFilter extends Filter { private final String fieldName ; private final SpatialPrefixTree grid ; private final Shape queryShape ; private final int prefixGridScanLevel ; private final int detailLevel ; public RecursivePrefixTreeFilter ( String fieldName , SpatialPrefixTree grid , Shape queryShape , int prefixGridScanLevel , int detailLevel ) { } @ Override public DocIdSet getDocIdSet ( AtomicReaderContext ctx , Bits acceptDocs ) throws IOException { AtomicReader reader = ctx . reader ( ) ; OpenBitSet bits = new OpenBitSet ( reader . maxDoc ( ) ) ; Terms terms = reader . terms ( fieldName ) ; if ( terms == null ) return null ; TermsEnum termsEnum = terms . iterator ( null ) ; DocsEnum docsEnum = null ; Node scanCell = null ; LinkedList < Node > cells = new LinkedList < Node > ( grid . getWorldNode ( ) . getSubCells ( queryShape ) ) ; while ( ! ( cells . isEmpty ( ) ) ) { final Node cell = cells . removeFirst ( ) ; final BytesRef cellTerm = new BytesRef ( cell . getTokenBytes ( ) ) ; TermsEnum . SeekStatus seekStat = termsEnum . seekCeil ( cellTerm ) ; if ( seekStat == ( SeekStatus . END ) ) break ; if ( seekStat == ( SeekStatus . NOT_FOUND ) ) continue ; if ( ( ( cell . getLevel ( ) ) == ( detailLevel ) ) || ( cell . isLeaf ( ) ) ) { docsEnum = termsEnum . docs ( acceptDocs , docsEnum , 0 ) ; addDocs ( docsEnum , bits ) ; } else { BytesRef nextCellTerm = termsEnum . next ( ) ; assert StringHelper . startsWith ( nextCellTerm , cellTerm ) ; scanCell = grid . getNode ( nextCellTerm . bytes , nextCellTerm . offset , nextCellTerm . length , scanCell ) ; if ( scanCell . isLeaf ( ) ) { docsEnum = termsEnum . docs ( acceptDocs , docsEnum , 0 ) ; addDocs ( docsEnum , bits ) ; termsEnum . next ( ) ; } boolean scan = ( cell . getLevel ( ) ) >= ( prefixGridScanLevel ) ; if ( ! scan ) { cells . addAll ( 0 , cell . getSubCells ( queryShape ) ) ; } else { for ( BytesRef term = termsEnum . term ( ) ; ( term != null ) && ( StringHelper . startsWith ( term , cellTerm ) ) ; term = termsEnum . next ( ) ) { scanCell = grid . getNode ( term . bytes , term . offset , term . length , scanCell ) ; int termLevel = scanCell . getLevel ( ) ; if ( termLevel > ( detailLevel ) ) continue ; if ( ( termLevel == ( detailLevel ) ) || ( scanCell . isLeaf ( ) ) ) { Shape cShape = ( termLevel == ( grid . getMaxLevels ( ) ) ) ? scanCell . getCenter ( ) : scanCell . getShape ( ) ; <START_BUG> if ( ( queryShape . relate ( cShape , grid . getSpatialContext ( ) ) ) == ( SpatialRelation . DISJOINT ) ) <END_BUG> continue ; docsEnum = termsEnum . docs ( acceptDocs , docsEnum , 0 ) ; addDocs ( docsEnum , bits ) ; } } } } } return bits ; } private void addDocs ( DocsEnum docsEnum , OpenBitSet bits ) throws IOException { } @ Override public String toString ( ) { } @ Override public boolean equals ( Object o ) { } @ Override public int hashCode ( ) { } }

Fix:
if ( ( queryShape . relate ( cShape ) ) == ( SpatialRelation . DISJOINT ) )
Buggy code:
public class Langcpp extends Activity { int start = 1 ; final Context context = this ; @ Override public void onCreate ( Bundle savedInstanceState ) { } public void buttonClick ( String category ) { <START_BUG> Intent i = new Intent ( getApplicationContext ( ) , TestPagec . class ) ; <END_BUG> i . putExtra ( "cat" , category ) ; startActivity ( i ) ; } }

Fix:
Intent i = new Intent ( getApplicationContext ( ) , TestPagecpp . class ) ;
Buggy code:
public class MouseCommand extends Command { public MouseCommand ( String evtnm , int flags ) { } protected void process ( AuRequest request ) { final Component comp = request . getComponent ( ) ; if ( comp == null ) throw new org . zkoss . zk . ui . UiException ( MZk . ILLEGAL_REQUEST_COMPONENT_REQUIRED , this ) ; final String [ ] data = request . getData ( ) ; if ( ( ( ( data != null ) && ( ( data . length ) != 1 ) ) && ( ( data . length ) != 2 ) ) && ( ( data . length ) != 3 ) ) throw new org . zkoss . zk . ui . UiException ( MZk . ILLEGAL_REQUEST_WRONG_DATA , new Object [ ] { Objects . toString ( data ) , this } ) ; <START_BUG> if ( ( data . length ) > 1 ) { <END_BUG> int x = data [ 0 ] . indexOf ( '.' ) ; if ( x >= 0 ) data [ 0 ] = data [ 0 ] . substring ( 0 , x ) ; x = data [ 1 ] . indexOf ( '.' ) ; if ( x >= 0 ) data [ 1 ] = data [ 1 ] . substring ( 0 , x ) ; } final MouseEvent event = ( ( data == null ) || ( ( data . length ) == 0 ) ) ? new MouseEvent ( getId ( ) , comp ) : ( data . length ) == 1 ? new MouseEvent ( getId ( ) , comp , data [ 0 ] ) : new MouseEvent ( getId ( ) , comp , Integer . parseInt ( data [ 0 ] ) , Integer . parseInt ( data [ 1 ] ) , ( ( data . length ) == 2 ? 0 : Commands . parseKeys ( data [ 2 ] ) ) ) ; Events . postEvent ( event ) ; } }

Fix:
if ( ( data != null ) && ( ( data . length ) > 1 ) ) {
Buggy code:
public abstract class P4Base extends org . apache . tools . ant . Task implements ExecOutputHandler { protected Perl5Util util ; protected String m_p4Port = "" ; protected String m_p4Client = "" ; protected String m_p4User = "" ; protected String m_p4View = "" ; protected String P4Opts = "" ; protected String m_p4CmdOpts = "" ; protected String shell ; private TaskException m_error ; public void setClient ( String P4Client ) { } public void setCmdopts ( String P4CmdOpts ) { } public void setPort ( String P4Port ) { } public void setUser ( String P4User ) { } public void setView ( String P4View ) { } private void prepare ( ) { } public void execute ( ) throws TaskException { } protected void execP4Command ( final String command , ExecOutputHandler handler ) throws TaskException { try { final Commandline cmd = new Commandline ( ) ; cmd . setExecutable ( "p4" ) ; if ( ( ( m_p4Port ) != null ) && ( ( m_p4Port . length ( ) ) != 0 ) ) { cmd . addArgument ( m_p4Port ) ; } if ( ( ( m_p4User ) != null ) && ( ( m_p4User . length ( ) ) != 0 ) ) { cmd . addArgument ( m_p4User ) ; } if ( ( ( m_p4Client ) != null ) && ( ( m_p4Client . length ( ) ) != 0 ) ) { cmd . addArgument ( m_p4Client ) ; } <START_BUG> cmd . createArgument ( ) . setLine ( command ) ; <END_BUG> String [ ] cmdline = cmd . getCommandline ( ) ; String cmdl = "" ; for ( int i = 0 ; i < ( cmdline . length ) ; i ++ ) { cmdl += ( cmdline [ i ] ) + "<seq2seq4repair_space>" ; } getLogger ( ) . debug ( ( "Execing<seq2seq4repair_space>" + cmdl ) ) ; if ( handler == null ) { handler = this ; } final Execute2 exe = new Execute2 ( ) ; exe . setExecOutputHandler ( handler ) ; exe . setCommandline ( cmd . getCommandline ( ) ) ; try { exe . execute ( ) ; } catch ( IOException e ) { throw new TaskException ( "Error" , e ) ; } if ( null != ( m_error ) ) { throw m_error ; } } catch ( TaskException te ) { throw te ; } catch ( Exception e ) { throw new TaskException ( ( "Problem<seq2seq4repair_space>exec'ing<seq2seq4repair_space>P4<seq2seq4repair_space>command:<seq2seq4repair_space>" + ( e . getMessage ( ) ) ) ) ; } } protected final void registerError ( final TaskException error ) { } public void stdout ( final String line ) { } public void stderr ( final String line ) { } }

Fix:
cmd . addLine ( command ) ;
Buggy code:
public class LoadingScreen extends Screen { public LoadingScreen ( Game game ) { } public void update ( float deltaTime ) { Graphics g = game . getGraphics ( ) ; Assets . background = g . newPixmap ( "background.png" , RGB565 ) ; Assets . gamebg = g . newPixmap ( "gamebg.png" , ARGB4444 ) ; Assets . logo = g . newPixmap ( "logo.png" , ARGB4444 ) ; Assets . mainMenu = g . newPixmap ( "mainmenu.png" , ARGB4444 ) ; Assets . buttons = g . newPixmap ( "buttons.png" , ARGB4444 ) ; Assets . help1 = g . newPixmap ( "help1.png" , ARGB4444 ) ; Assets . help2 = g . newPixmap ( "help2.png" , ARGB4444 ) ; Assets . help3 = g . newPixmap ( "help3.png" , ARGB4444 ) ; Assets . numbers = g . newPixmap ( "numbers.png" , ARGB4444 ) ; Assets . ready = g . newPixmap ( "ready.png" , ARGB4444 ) ; Assets . pause = g . newPixmap ( "pause.png" , ARGB4444 ) ; Assets . gameOver = g . newPixmap ( "gameover.png" , ARGB4444 ) ; Assets . playersumo = g . newPixmap ( "playersumo.png" , ARGB4444 ) ; Assets . playersumo1 = g . newPixmap ( "playersumo1.png" , ARGB4444 ) ; Assets . playersumo2 = g . newPixmap ( "playersumo2.png" , ARGB4444 ) ; Assets . playersumo3 = g . newPixmap ( "playersumo3.png" , ARGB4444 ) ; Assets . cpusumo = g . newPixmap ( "cpusumo.png" , ARGB4444 ) ; Assets . cpusumo1 = g . newPixmap ( "cpusumo1.png" , ARGB4444 ) ; Assets . cpusumo2 = g . newPixmap ( "cpusumo2.png" , ARGB4444 ) ; Assets . cpusumo3 = g . newPixmap ( "cpusumo3.png" , ARGB4444 ) ; Assets . judge = g . newPixmap ( "judge.png" , ARGB4444 ) ; <START_BUG> Assets . arena = g . newPixmap ( "arena.png" , ARGB4444 ) ; <END_BUG> Assets . click = game . getAudio ( ) . newSound ( "click.ogg" ) ; Assets . slap = game . getAudio ( ) . newSound ( "slap.ogg" ) ; Assets . cheer = game . getAudio ( ) . newSound ( "cheer.ogg" ) ; Assets . Win = game . getAudio ( ) . newSound ( "win.ogg" ) ; Assets . Lose = game . getAudio ( ) . newSound ( "lose.ogg" ) ; Assets . grunt = game . getAudio ( ) . newSound ( "grunt.ogg" ) ; Settings . load ( game . getFileIO ( ) ) ; game . setScreen ( new MainMenuScreen ( game ) ) ; } public void present ( float deltaTime ) { } public void pause ( ) { } public void resume ( ) { } public void dispose ( ) { } }

Fix:
Assets . arena = g . newPixmap ( "gamebg.png" , ARGB4444 ) ;
Buggy code:
@ Security . Authenticated ( LoggedStoremanOrAdmin . class ) public class Events extends Controller { public static Result add ( ) throws IOException { } public static Result addAndEdit ( ) throws IOException { } public static Result edit ( String eventType , String id ) { } public static Result editInstl ( String id ) { } public static Result update ( String sEventType , String id ) throws Exception { } public static Result updateStrmn ( String sEventType , String id ) throws Exception { } public static Result updateInstl ( String id ) { } public static Result delete ( String sEventType , String id ) throws IOException { } public static Result deleteInstl ( String id ) throws IOException { } public static Result drag ( String eventType , String id ) throws IOException { EventTO eventTO = Form . form ( EventTO . class ) . bindFromRequest ( ) . get ( ) ; <START_BUG> GoogleAPI . updateEvent ( eventTO . toGoogleEvent ( id , null ) , eventTO . eventType ) ; <END_BUG> return ok ( ) ; } public static Result changeCal ( String sEventType , String id ) { } public static Result editStrmn ( String eventType , String id ) { } public static Result upcomingActions ( ) throws IOException { } public static Result getEntries ( String eventType , String id ) { } }

Fix:
GoogleAPI . updateEvent ( eventTO . toGoogleEvent ( id , null , true ) , eventTO . eventType ) ;
Buggy code:
public class LongType extends AbstractType { public static final LongType instance = new LongType ( ) ; LongType ( ) { } public int compare ( ByteBuffer o1 , ByteBuffer o2 ) { } public String getString ( ByteBuffer bytes ) { if ( ( bytes . remaining ( ) ) == 0 ) { return "" ; } if ( ( bytes . remaining ( ) ) != 8 ) { throw new MarshalException ( ( "A<seq2seq4repair_space>long<seq2seq4repair_space>is<seq2seq4repair_space>exactly<seq2seq4repair_space>8<seq2seq4repair_space>bytes:<seq2seq4repair_space>" + ( bytes . remaining ( ) ) ) ) ; } <START_BUG> return String . valueOf ( bytes . getLong ( ( ( bytes . position ( ) ) + ( bytes . arrayOffset ( ) ) ) ) ) ; <END_BUG> } public ByteBuffer fromString ( String source ) { } public void validate ( ByteBuffer bytes ) throws MarshalException { } }

Fix:
return String . valueOf ( bytes . getLong ( bytes . position ( ) ) ) ;
Buggy code:
@ RuntimePermissions public class SignInActivity extends AppCompatActivity implements GoogleApiClient . ConnectionCallbacks , GoogleApiClient . OnConnectionFailedListener { private static final int REQUEST_CODE_RESOLVE_ERR = 42 ; private static final int REQUEST_CODE_REQUEST_PERMISSION = 43 ; public static final String PREF_SIGNED_IN_BEFORE = "signedIn" ; private static final String SCOPE_PROFILE = "https:////www.googleapis.com//auth//userinfo.profile" ; private static final String SCOPE_EMAIL = "https:////www.googleapis.com//auth//userinfo.email" ; private GoogleApiClient mApiClient ; private ProgressDialog mProgressDialog ; @ Inject SharedPreferences mPreferences ; @ Inject GeoRentingService mGeoRentingService ; @ Override protected void onCreate ( Bundle savedInstanceState ) { } public void onClickSignIn ( View v ) { } @ Override @ DebugLog public void onConnected ( Bundle bundle ) { } <START_BUG> @ NeedsPermission ( permission . GET_ACCOUNTS ) <END_BUG> @ DebugLog void handleSignIn ( ) { Async . start ( this :: getGoogleAuthToken , Schedulers . newThread ( ) ) . subscribeOn ( Schedulers . newThread ( ) ) . observeOn ( Schedulers . newThread ( ) ) . flatMap ( ( user ) -> mGeoRentingService . auth ( ( ( User ) ( user ) ) ) ) . subscribe ( ( sessionToken ) -> { Timber . d ( ( "Test:<seq2seq4repair_space>" + sessionToken ) ) ; mProgressDialog . dismiss ( ) ; mPreferences . edit ( ) . putBoolean ( PREF_SIGNED_IN_BEFORE , true ) . apply ( ) ; ( ( GeoRentingApplication ) ( getApplication ( ) ) ) . setSessionToken ( sessionToken ) ; startService ( new Intent ( this , . class ) ) ; proceed ( ) ; } ) ; } @ DebugLog private User getGoogleAuthToken ( ) { } @ Override public void onConnectionSuspended ( int i ) { } @ Override @ DebugLog public void onConnectionFailed ( ConnectionResult connectionResult ) { } private void proceed ( ) { } @ Override protected void onActivityResult ( int requestCode , int resultCode , Intent data ) { } }

Fix:
@ NeedsPermission ( { permission . GET_ACCOUNTS , permission . ACCESS_FINE_LOCATION } )
Buggy code:
public class JavaConfigGui extends AbstractConfigGui implements ActionListener { private static final Logger log = LoggingManager . getLoggerForClass ( ) ; private static final String CLASSNAMECOMBO = "classnamecombo" ; private JComboBox classnameCombo ; private boolean displayName = true ; private ArgumentsPanel argsPanel ; public JavaConfigGui ( ) { } public JavaConfigGui ( boolean displayNameField ) { } public String getLabelResource ( ) { } protected void init ( ) { } private JPanel createClassnamePanel ( ) { } public void actionPerformed ( ActionEvent evt ) { } private JPanel createParameterPanel ( ) { } public void configure ( TestElement config ) { } public TestElement createTestElement ( ) { } public void modifyTestElement ( TestElement config ) { configureTestElement ( config ) ; ( ( org . apache . jmeter . protocol . java . config . JavaConfig ) ( config ) ) . setArguments ( ( ( Arguments ) ( argsPanel . createTestElement ( ) ) ) ) ; <START_BUG> ( ( org . apache . jmeter . protocol . java . config . JavaConfig ) ( config ) ) . setClassname ( classnameCombo . getSelectedItem ( ) . toString ( ) ) ; <END_BUG> } }

Fix:
( ( org . apache . jmeter . protocol . java . config . JavaConfig ) ( config ) ) . setClassname ( String . valueOf ( classnameCombo . getSelectedItem ( ) ) ) ;
Buggy code:
public class FSTCompletionBuilder { public static final int DEFAULT_BUCKETS = 10 ; private final int buckets ; FST < Object > automaton ; private final BytesRefSorter sorter ; private final BytesRef scratch = new BytesRef ( ) ; private final int shareMaxTailLength ; public FSTCompletionBuilder ( ) { } public FSTCompletionBuilder ( int buckets , BytesRefSorter sorter , int shareMaxTailLength ) { } public void add ( BytesRef utf8 , int bucket ) throws IOException { } public FSTCompletion build ( ) throws IOException { } private FST < Object > buildAutomaton ( BytesRefSorter sorter ) throws IOException { final Outputs < Object > outputs = NoOutputs . getSingleton ( ) ; final Object empty = outputs . getNoOutput ( ) ; <START_BUG> final Builder < Object > builder = new Builder < Object > ( INPUT_TYPE . BYTE1 , 0 , 0 , true , true , shareMaxTailLength , outputs , null , false ) ; <END_BUG> BytesRef scratch = new BytesRef ( ) ; BytesRef entry ; final IntsRef scratchIntsRef = new IntsRef ( ) ; int count = 0 ; BytesRefIterator iter = sorter . iterator ( ) ; while ( ( entry = iter . next ( ) ) != null ) { count ++ ; if ( ( scratch . compareTo ( entry ) ) != 0 ) { builder . add ( Util . toIntsRef ( entry , scratchIntsRef ) , empty ) ; scratch . copyBytes ( entry ) ; } } return count == 0 ? null : builder . finish ( ) ; } }

Fix:
final Builder < Object > builder = new Builder < Object > ( INPUT_TYPE . BYTE1 , 0 , 0 , true , true , shareMaxTailLength , outputs , null , false , true ) ;
Buggy code:
public class XPathExtractorGui extends AbstractPostProcessorGui { private static final long serialVersionUID = 240L ; private final JLabeledTextField defaultField = new JLabeledTextField ( JMeterUtils . getResString ( "default_value_field" ) ) ; private final JLabeledTextField xpathQueryField = new JLabeledTextField ( JMeterUtils . getResString ( "xpath_extractor_query" ) ) ; private final JLabeledTextField refNameField = new JLabeledTextField ( JMeterUtils . getResString ( "ref_name_field" ) ) ; private final JCheckBox getFragment = new JCheckBox ( JMeterUtils . getResString ( "xpath_extractor_fragment" ) ) ; private final XMLConfPanel xml = new XMLConfPanel ( ) ; @ Override public String getLabelResource ( ) { } public XPathExtractorGui ( ) { } @ Override public void configure ( TestElement el ) { } @ Override public TestElement createTestElement ( ) { } @ Override public void modifyTestElement ( TestElement extractor ) { } @ Override public void clearGui ( ) { } private void init ( ) { setLayout ( new BorderLayout ( ) ) ; setBorder ( makeBorder ( ) ) ; Box box = Box . createVerticalBox ( ) ; box . add ( makeTitlePanel ( ) ) ; <START_BUG> box . add ( createScopePanel ( true , false , false ) ) ; <END_BUG> xml . setBorder ( BorderFactory . createTitledBorder ( BorderFactory . createEtchedBorder ( ) , JMeterUtils . getResString ( "xpath_assertion_option" ) ) ) ; box . add ( xml ) ; box . add ( getFragment ) ; box . add ( makeParameterPanel ( ) ) ; add ( box , BorderLayout . NORTH ) ; } private JPanel makeParameterPanel ( ) { } private void addField ( JPanel panel , JLabeledTextField field , GridBagConstraints gbc ) { } private void resetContraints ( GridBagConstraints gbc ) { } private void initConstraints ( GridBagConstraints gbc ) { } }

Fix:
box . add ( createScopePanel ( true , true , true ) ) ;
Buggy code:
@ RestController @ RequestMapping ( "//products" ) public class ProductApiGatewayRestController { @ Autowired @ LoadBalanced private RestTemplate restTemplate ; @ Output ( Source . OUTPUT ) @ Autowired private MessageChannel messageChannel ; @ Autowired private PriceRepository priceRepository ; @ RequestMapping ( method = RequestMethod . POST ) public void write ( @ RequestBody SimpleProduct r ) { } <START_BUG> public Collection < String > getProductNamesFallback ( Long productId ) { <END_BUG> return Collections . emptyList ( ) ; } public List < SimplePrice > getPriceByProductIdFallback ( Long productId ) { } @ HystrixCommand ( fallbackMethod = "getProductNamesFallback" ) @ RequestMapping ( "//names" ) public Collection < String > getProductNames ( ) { } @ HystrixCommand ( fallbackMethod = "getPriceByProductIdFallback" ) @ RequestMapping ( "//find_price_by_product_id" ) List < SimplePrice > findPriceByProductId ( Long productId ) { } }

Fix:
public Collection < String > getProductNamesFallback ( ) {
Buggy code:
public final class PageMap implements Serializable { public static final String DEFAULT_NAME = null ; private static final Log log = LogFactory . getLog ( PageMap . class ) ; private static final long serialVersionUID = 1L ; private final ArrayListStack accessStack = new ArrayListStack ( 8 ) ; private String interceptContinuationURL ; private final String name ; private int pageId = 0 ; private transient Session session ; public static class Access implements Serializable { private static final long serialVersionUID = 1L ; int id ; int version ; public boolean equals ( Object obj ) { } public final int getId ( ) { } public final int getVersion ( ) { } public int hashCode ( ) { } public String toString ( ) { } } static interface IVisitor { public void entry ( final IPageMapEntry entry ) { } } public static PageMap forName ( final String pageMapName ) { } PageMap ( final String name , final Session session ) { } public final void clear ( ) { } public final ArrayListStack getAccessStack ( ) { } public final IPageMapEntry getEntry ( final int id ) { } public final String getName ( ) { } public final Session getSession ( ) { } public final long getSizeInBytes ( ) { } public final int getVersions ( ) { } public final boolean isDefault ( ) { } public final IPageMapEntry lastAccessedEntry ( ) { } public final void remove ( ) { } public final void remove ( final Page page ) { } public final void removeEntry ( final IPageMapEntry entry ) { } public String toString ( ) { } final String attributeForId ( final int id ) { } final String attributePrefix ( ) { } final boolean continueToOriginalDestination ( ) { } final Page get ( final int id , int versionNumber ) { } final int nextId ( ) { } final void put ( final Page page ) { <START_BUG> if ( ( ! ( page . isStateless ( ) ) ) && ( ! ( page . isErrorPage ( ) ) ) ) { <END_BUG> final IPageMapEntry entry = page . getPageMapEntry ( ) ; pushAccess ( entry ) ; final String attribute = attributeForId ( entry . getNumericId ( ) ) ; session . setAttribute ( attribute , entry ) ; session . getApplication ( ) . getSessionSettings ( ) . getPageMapEvictionStrategy ( ) . evict ( this ) ; } } final void redirectToInterceptPage ( final Page page ) { } final void setSession ( final Session session ) { } final void visitEntries ( final PageMap . IVisitor visitor ) { } private final void access ( final IPageMapEntry entry , final int version ) { } private final List getEntries ( ) { } private final PageMap . Access peekAccess ( ) { } private final PageMap . Access popAccess ( ) { } private final void pushAccess ( IPageMapEntry entry ) { } private final int versionOf ( final IPageMapEntry entry ) { } }

Fix:
if ( ! ( page . isStateless ( ) ) ) {
Buggy code:
public class ShowFileRequestHandler extends RequestHandlerBase { public static final String HIDDEN = "hidden" ; public static final String USE_CONTENT_TYPE = "contentType" ; protected Set < String > hiddenFiles ; private static ShowFileRequestHandler instance ; public ShowFileRequestHandler ( ) { } @ Override public void init ( NamedList args ) { } public Set < String > getHiddenFiles ( ) { } @ Override public void handleRequestBody ( SolrQueryRequest req , SolrQueryResponse rsp ) throws IOException { } @ Deprecated public static String getFileContents ( String path ) { if ( ( ( ShowFileRequestHandler . instance ) != null ) && ( ( ShowFileRequestHandler . instance . hiddenFiles ) != null ) ) { if ( ShowFileRequestHandler . instance . hiddenFiles . contains ( path ) ) { return "" ; } } try { SolrCore core = SolrCore . getSolrCore ( ) ; InputStream input = core . getResourceLoader ( ) . openResource ( path ) ; <START_BUG> return IOUtils . toString ( input ) ; <END_BUG> } catch ( Exception ex ) { } return "" ; } @ Override public String getDescription ( ) { } @ Override public String getVersion ( ) { } @ Override public String getSourceId ( ) { } @ Override public String getSource ( ) { } }

Fix:
return IOUtils . toString ( input , "UTF-8" ) ;
Buggy code:
public class Advice extends AbstractDefinition implements XpandAdvice { public static final String DEF_VAR_NAME = "targetDef" ; public Advice ( final Identifier pointCut , final Identifier type , final DeclaredParameter [ ] params , final boolean wildParams , final Statement [ ] body ) { } public Identifier getPointCut ( ) { } @ Override public void analyze ( XpandExecutionContext ctx , final Set < AnalysationIssue > issues ) { } private Pattern p = null ; public boolean isWildcardParams ( ) { } public boolean matches ( final XpandDefinition def , XpandExecutionContext ctx ) { } @ Override public String getNameString ( ExecutionContext context ) { } @ Override public String toString ( ) { if ( ( _stringRepresentation ) == null ) { <START_BUG> _stringRepresentation = ( ( ( ( ( getOwner ( ) . getFullyQualifiedName ( ) ) + ":<seq2seq4repair_space>" ) + ( getName ( ) ) ) + ( getParamString ( false ) ) ) + "<seq2seq4repair_space>:<seq2seq4repair_space>" ) + ( getType ( ) . getValue ( ) ) ; <END_BUG> } return _stringRepresentation ; } }

Fix:
_stringRepresentation = ( ( ( getName ( ) ) + ( getParamString ( false ) ) ) + "<seq2seq4repair_space>:<seq2seq4repair_space>" ) + ( getType ( ) . getValue ( ) ) ;
Buggy code:
public class AlertPlayer { static AlertPlayer singletone ; private static final String TAG = AlertPlayer . class . getSimpleName ( ) ; private MediaPlayer mediaPlayer ; int volumeBeforeAlert ; Context context ; public static AlertPlayer getPlayer ( ) { if ( ( AlertPlayer . singletone ) == null ) { Log . e ( AlertPlayer . TAG , "getPlayer:<seq2seq4repair_space>Creating<seq2seq4repair_space>a<seq2seq4repair_space>new<seq2seq4repair_space>AlertPlayer" ) ; AlertPlayer . singletone = new AlertPlayer ( ) ; } else { <START_BUG> Log . e ( "tag" , "getPlayer:<seq2seq4repair_space>Using<seq2seq4repair_space>existing<seq2seq4repair_space>AlertPlayer" ) ; <END_BUG> } return AlertPlayer . singletone ; } public synchronized void startAlert ( Context ctx , AlertType newAlert ) { } public synchronized void stopAlert ( boolean ClearData , boolean clearIfSnoozeFinished ) { } public synchronized void Snooze ( Context ctx , int repeatTime ) { } public void ClockTick ( Context ctx ) { } private void PlayFile ( Context ctx , String FileName ) { } }

Fix:
Log . i ( AlertPlayer . TAG , "getPlayer:<seq2seq4repair_space>Using<seq2seq4repair_space>existing<seq2seq4repair_space>AlertPlayer" ) ;