nus-yam/ex-repair huggingface dataset:
Buggy code:
public class EmailHelper { private String TAG = "EMAIL_HELPER" ; private Context mContext ; public EmailHelper ( Context mContext ) { } public boolean sendEmail ( String Address , String filename ) { boolean info = false ; String [ ] TO = new String [ ] { Address } ; File outputDir = mContext . getFilesDir ( ) ; File fileLocation = new File ( outputDir , filename ) ; File exportedPath = new File ( mContext . getFilesDir ( ) , "exported" ) ; File newFile = new File ( exportedPath , filename ) ; <START_BUG> Uri path = FileProvider . getUriForFile ( mContext , "pub.haoran.jilizhang.fileprovider" , newFile ) ; <END_BUG> Log . d ( TAG , path . toString ( ) ) ; Intent emailIntent = new Intent ( Intent . ACTION_SEND ) ; if ( path != null ) { emailIntent . setFlags ( FLAG_GRANT_READ_URI_PERMISSION ) ; } emailIntent . setType ( "vnd.android.cursor.dir//email" ) ; emailIntent . putExtra ( EXTRA_EMAIL , TO ) ; emailIntent . putExtra ( EXTRA_STREAM , path ) ; emailIntent . putExtra ( EXTRA_SUBJECT , "Transaction<seq2seq4repair_space>records<seq2seq4repair_space>exported<seq2seq4repair_space>from<seq2seq4repair_space>Transaction<seq2seq4repair_space>Tracker." ) ; emailIntent . putExtra ( EXTRA_TEXT , ( "The<seq2seq4repair_space>attached<seq2seq4repair_space>is<seq2seq4repair_space>the<seq2seq4repair_space>excel<seq2seq4repair_space>file<seq2seq4repair_space>of<seq2seq4repair_space>all<seq2seq4repair_space>records.<seq2seq4repair_space>\n" + ( ( "P.S.<seq2seq4repair_space>For<seq2seq4repair_space>the<seq2seq4repair_space>iffromme<seq2seq4repair_space>colomn<seq2seq4repair_space>in<seq2seq4repair_space>the<seq2seq4repair_space>table,<seq2seq4repair_space>0<seq2seq4repair_space>means<seq2seq4repair_space>someone<seq2seq4repair_space>gives<seq2seq4repair_space>you,<seq2seq4repair_space>1<seq2seq4repair_space>means<seq2seq4repair_space>you<seq2seq4repair_space>give<seq2seq4repair_space>out<seq2seq4repair_space>to<seq2seq4repair_space>someone.\n\n" + "Thanks,\n" ) + "Transaction<seq2seq4repair_space>Tracker" ) ) ) ; try { mContext . startActivity ( Intent . createChooser ( emailIntent , "Send<seq2seq4repair_space>mail..." ) ) ; Log . i ( TAG , "Finished<seq2seq4repair_space>sending<seq2seq4repair_space>email..." ) ; info = true ; } catch ( android ex ) { info = false ; } return info ; } }

Fix:
Uri path = FileProvider . getUriForFile ( mContext , "net.haoranzhao.jilizhang.fileprovider" , newFile ) ;
Buggy code:
public class SimpleSecurityManager { private ThreadLocalStack < SecurityContext > contexts = new ThreadLocalStack < SecurityContext > ( ) ; private static PrivilegedAction < SecurityContext > securityContext ( ) { } public Principal getCallerPrincipal ( ) { } private Principal getPrincipal ( Subject subject ) { } public boolean isCallerInRole ( final String ... roleNames ) { } public void push ( final String securityDomain , final String runAs , final String runAsPrincipal ) { final SecurityContext previous = SecurityContextAssociation . getSecurityContext ( ) ; contexts . push ( previous ) ; SecurityContext current = SecurityFactory . establishSecurityContext ( securityDomain ) ; if ( previous != null ) { current . setSubjectInfo ( previous . getSubjectInfo ( ) ) ; current . setIncomingRunAs ( previous . getOutgoingRunAs ( ) ) ; } RunAs currentRunAs = current . getIncomingRunAs ( ) ; boolean trusted = ( currentRunAs != null ) && ( currentRunAs instanceof RunAsIdentity ) ; if ( trusted == false ) { boolean authenticated = authenticate ( current ) ; if ( authenticated == false ) { throw new SecurityException ( "Invalid<seq2seq4repair_space>User" ) ; } } if ( runAs != null ) { <START_BUG> RunAs runAsIdentity = new RunAsIdentity ( runAs , null ) ; <END_BUG> current . setOutgoingRunAs ( runAsIdentity ) ; } else if ( ( previous != null ) && ( ( previous . getOutgoingRunAs ( ) ) != null ) ) { current . setOutgoingRunAs ( previous . getOutgoingRunAs ( ) ) ; } } private boolean authenticate ( SecurityContext context ) { } private Identity getUnauthenticatedIdentity ( ) { } public void pop ( ) { } }

Fix:
RunAs runAsIdentity = new RunAsIdentity ( runAs , runAsPrincipal ) ;
Buggy code:
final class ObjectFactory { private static final String DEFAULT_PROPERTIES_FILENAME = "xerces.properties" ; private static final boolean DEBUG = ObjectFactory . isDebugEnabled ( ) ; private static final int DEFAULT_LINE_LENGTH = 80 ; private static Properties fXercesProperties = null ; private static long fLastModified = - 1 ; static Object createObject ( String factoryId , String fallbackClassName ) throws ObjectFactory . ConfigurationError { } static Object createObject ( String factoryId , String propertiesFilename , String fallbackClassName ) throws ObjectFactory . ConfigurationError { } private static boolean isDebugEnabled ( ) { } private static void debugPrintln ( String msg ) { } static ClassLoader findClassLoader ( ) throws ObjectFactory . ConfigurationError { } static Object newInstance ( String className , ClassLoader cl , boolean doFallback ) throws ObjectFactory . ConfigurationError { } static Class findProviderClass ( String className , ClassLoader cl , boolean doFallback ) throws ClassNotFoundException , ObjectFactory . ConfigurationError { SecurityManager security = System . getSecurityManager ( ) ; if ( security != null ) { <START_BUG> final int lastDot = className . lastIndexOf ( "." ) ; <END_BUG> String packageName = className ; if ( lastDot != ( - 1 ) ) packageName = className . substring ( 0 , lastDot ) ; security . checkPackageAccess ( packageName ) ; } Class providerClass ; if ( cl == null ) { providerClass = Class . forName ( className ) ; } else { try { providerClass = cl . loadClass ( className ) ; } catch ( ClassNotFoundException x ) { if ( doFallback ) { ClassLoader current = ObjectFactory . class . getClassLoader ( ) ; if ( current == null ) { providerClass = Class . forName ( className ) ; } else if ( cl != current ) { cl = current ; providerClass = cl . loadClass ( className ) ; } else { throw x ; } } else { throw x ; } } } return providerClass ; } private static Object findJarServiceProvider ( String factoryId ) throws ObjectFactory . ConfigurationError { } static final class ConfigurationError extends Error { static final long serialVersionUID = 937647395548533254L ; private Exception exception ; ConfigurationError ( String msg , Exception x ) { } Exception getException ( ) { } } }

Fix:
final int lastDot = className . lastIndexOf ( '.' ) ;
Buggy code:
public class DataSearchDB { public DataSearchDB ( ) { } public void run ( String dbType ) { try { System . out . println ( "Enter<seq2seq4repair_space>a<seq2seq4repair_space>data<seq2seq4repair_space>value<seq2seq4repair_space>to<seq2seq4repair_space>search:" ) ; Console co = System . console ( ) ; String search = co . readLine ( ) . toLowerCase ( ) ; List < KeyValue > records = new ArrayList < KeyValue > ( ) ; Database std_db = DbInstance . getInstance ( dbType ) ; Cursor std_cursor = std_db . openCursor ( null , null ) ; DatabaseEntry key = new DatabaseEntry ( ) ; DatabaseEntry data = new DatabaseEntry ( ) ; long start ; if ( dbType . equals ( "3" ) ) { DatabaseEntry pKey = new DatabaseEntry ( ) ; SecondaryDatabase indexDb = DbInstance . getIndexInstance ( std_db ) ; SecondaryCursor sec_cursor = indexDb . openSecondaryCursor ( null , null ) ; key . setData ( search . getBytes ( ) ) ; key . setSize ( search . length ( ) ) ; start = System . nanoTime ( ) ; OperationStatus oprStatus = sec_cursor . getSearchKey ( key , pKey , data , DEFAULT ) ; <START_BUG> records . add ( new KeyValue ( new String ( key . getData ( ) ) , new String ( data . getData ( ) ) ) ) ; <END_BUG> } else { start = System . nanoTime ( ) ; OperationStatus status = std_cursor . getFirst ( key , data , DEFAULT ) ; while ( status == ( OperationStatus . SUCCESS ) ) { String datastr = new String ( data . getData ( ) ) ; if ( datastr . equals ( search ) ) { String keystr = new String ( key . getData ( ) ) ; records . add ( new KeyValue ( keystr , datastr ) ) ; } status = std_cursor . getNext ( key , data , DEFAULT ) ; } } long end = System . nanoTime ( ) ; long micros = ( end - start ) // 1000 ; System . out . println ( String . format ( "%d<seq2seq4repair_space>records<seq2seq4repair_space>retrieved<seq2seq4repair_space>in<seq2seq4repair_space>%d<seq2seq4repair_space>micro-seconds" , records . size ( ) , micros ) ) ; Answers ans = new Answers ( "answers" ) ; ans . insertAnswers ( records ) ; } catch ( DatabaseException ex ) { System . out . println ( "Unable<seq2seq4repair_space>to<seq2seq4repair_space>search<seq2seq4repair_space>DB<seq2seq4repair_space>by<seq2seq4repair_space>data<seq2seq4repair_space>value" ) ; } } }

Fix:
records . add ( new KeyValue ( new String ( pKey . getData ( ) ) , new String ( data . getData ( ) ) ) ) ;
Buggy code:
public class StaticAppBuilder { public static boolean instrumentApps = true ; public static StaticApp buildOrReadStaticApp ( String apkPath , boolean forceBuild ) { } private static List < StaticClassBuilder > classBuilders = new ArrayList < StaticClassBuilder > ( ) ; private static void buildStaticApp ( StaticApp staticApp ) { String apkPath = staticApp . getApkPath ( ) ; String outDir = ( staticApp . getDataFolder ( ) ) + "//apktool//" ; Apktool . extractAPK ( apkPath , outDir ) ; File smaliFolder = new File ( ( ( staticApp . getDataFolder ( ) ) + "//apktool//smali" ) ) ; StaticAppBuilder . initClassBuilders ( staticApp , smaliFolder ) ; int threadCount = Runtime . getRuntime ( ) . availableProcessors ( ) ; <START_BUG> ExecutorService executor = Executors . newFixedThreadPool ( ( threadCount // 2 ) ) ; <END_BUG> System . out . println ( ( "class<seq2seq4repair_space>builders<seq2seq4repair_space>size<seq2seq4repair_space>" + ( StaticAppBuilder . classBuilders . size ( ) ) ) ) ; for ( StaticClassBuilder classBuilder : StaticAppBuilder . classBuilders ) { try { StaticClass c = executor . submit ( classBuilder ) . get ( ) ; staticApp . addClass ( c ) ; } catch ( Exception e ) { e . printStackTrace ( ) ; } } executor . shutdown ( ) ; for ( StaticClass c : staticApp . getClasses ( ) ) { if ( c . isInnerClass ( ) ) { StaticClass outerC = staticApp . findClassByJavaName ( c . getOuterClass ( ) ) ; outerC . addInnerClass ( c . getJavaName ( ) ) ; } } StaticAppBuilder . parseManifest ( staticApp ) ; } private static void initClassBuilders ( StaticApp staticApp , File smaliFile ) { } private static void parseManifest ( StaticApp staticApp ) { } }

Fix:
ExecutorService executor = Executors . newFixedThreadPool ( threadCount ) ;
Buggy code:
public class Ant { private Position p ; public int dir ; public Colour c ; public static int restCount ; public boolean dead ; public int s ; public boolean hasFood ; public Instruction instruction ; public Ant ( Position p , int dir , Colour c , int s ) { } public Ant ( Position p , int dir , Colour c , int restCount , boolean dead , int s ) { } public int turn ( LeftOrRight lr , int d ) { } public Colour otherColour ( Colour c ) { } public Position senseCell ( Position p , int d , SenseDirection sd ) { } public ArrayList senseCellList ( SenseDirection sd ) { } public int adjAnts ( Position p , Colour c ) { } public static boolean checkForSurroundedAnts ( Position p ) { } public Position adjacentCell ( Position p , int d ) { } public static int state ( Ant a ) { } public static Colour colour ( Ant a ) { } public static boolean resting ( Ant a ) { } public static int direction ( Ant a ) { } public static boolean hasFood ( Ant a ) { <START_BUG> return ( a . hasFood ) != 0 ; <END_BUG> } public static void setState ( Ant a , int s ) { } public static void setResting ( Ant a , int r ) { } public static void setDirection ( Ant a , int dir ) { } public static void setHasFood ( Ant a , boolean f ) { } }

Fix:
return ( a . Food ) != 0 ;
Buggy code:
final class ConfigurationClassMethod { private final MethodMetadata metadata ; private final ConfigurationClass declaringClass ; public ConfigurationClassMethod ( MethodMetadata metadata , ConfigurationClass declaringClass ) { } public MethodMetadata getMetadata ( ) { } public ConfigurationClass getDeclaringClass ( ) { } public Location getResourceLocation ( ) { <START_BUG> return new Location ( this . declaringClass . getResource ( ) , this . metadata . getMethodName ( ) ) ; <END_BUG> } public void validate ( ProblemReporter problemReporter ) { } private class NonOverridableMethodError extends Problem { public NonOverridableMethodError ( ) { } } }

Fix:
return new Location ( this . declaringClass . getResource ( ) , metadata ) ;
Buggy code:
public class Init { public static void init ( Locale locale ) { <START_BUG> ResourceBundle bundle = ResourceBundle . getBundle ( "org.argouml.uml.cognitive.UMLCognitiveResourceBundle" , locale ) ; <END_BUG> Init . addChecklist ( bundle , MClass . class , "ChClass" ) ; Init . addChecklist ( bundle , MInterface . class , "ChInterface" ) ; Init . addChecklist ( bundle , MAttribute . class , "ChAttribute" ) ; Init . addChecklist ( bundle , MOperation . class , "ChOperation" ) ; Init . addChecklist ( bundle , MAssociation . class , "ChAssociation" ) ; Init . addChecklist ( bundle , MAssociationClass . class , "ChAssociation" ) ; Init . addChecklist ( bundle , MState . class , "ChState" ) ; Init . addChecklist ( bundle , MTransition . class , "ChTransition" ) ; Init . addChecklist ( bundle , MUseCase . class , "ChUseCase" ) ; Init . addChecklist ( bundle , MActor . class , "ChActor" ) ; } private static void addChecklist ( ResourceBundle bundle , Class cls , String key ) { } }

Fix:
ResourceBundle bundle = ResourceBundle . getBundle ( "org.argouml.i18n.UMLCognitiveResourceBundle" , locale ) ;
Buggy code:
public class PackageTest extends TestCase { private static PropertyResourceBundle defaultPRB ; private PropertyResourceBundle getRAS ( String res ) throws Exception { } private static Object [ ] DUMMY_PARAMS = new Object [ ] { "1" , "2" , "3" , "4" , "5" , "6" , "7" , "8" , "9" } ; private int readRF ( String res , List l ) throws Exception { int fails = 0 ; InputStream ras = this . getClass ( ) . getResourceAsStream ( res ) ; BufferedReader fileReader = new BufferedReader ( new InputStreamReader ( ras ) ) ; String s ; while ( ( s = fileReader . readLine ( ) ) != null ) { if ( ( ( ( s . length ( ) ) > 0 ) && ( ! ( s . startsWith ( "#" ) ) ) ) && ( ! ( s . startsWith ( "!" ) ) ) ) { int equ = s . indexOf ( '=' ) ; String key = s . substring ( 0 , equ ) ; <START_BUG> if ( ( ( key . indexOf ( '<seq2seq4repair_space>' ) ) >= 0 ) || ( ! ( key . toLowerCase ( ) . equals ( key ) ) ) ) { <END_BUG> System . out . println ( ( "Invalid<seq2seq4repair_space>key<seq2seq4repair_space>for<seq2seq4repair_space>JMeterUtils<seq2seq4repair_space>" + key ) ) ; fails ++ ; } String val = s . substring ( ( equ + 1 ) ) ; l . add ( key ) ; if ( ( ( val . indexOf ( "{0}" ) ) > 0 ) && ( ( val . indexOf ( "'" ) ) > 0 ) ) { String m = MessageFormat . format ( val , PackageTest . DUMMY_PARAMS ) ; if ( ( m . indexOf ( "{" ) ) > 0 ) { fails ++ ; System . out . println ( "Incorrect<seq2seq4repair_space>message<seq2seq4repair_space>format<seq2seq4repair_space>?<seq2seq4repair_space>(input//output):<seq2seq4repair_space>" ) ; System . out . println ( val ) ; System . out . println ( m ) ; } } } } return fails ; } private static String getResName ( String lang ) { } private void check ( String resname ) throws Exception { } private void check ( String resname , boolean checkUnexpected ) throws Exception { } public static Test suite ( ) { } private int subTestFailures ; public PackageTest ( String string ) { } public void atestDE ( ) throws Exception { } public void atestJA ( ) throws Exception { } public void atestzh_CN ( ) throws Exception { } public void atestzh_TW ( ) throws Exception { } public void atestNO ( ) throws Exception { } public void atestFR ( ) throws Exception { } public void atestES ( ) throws Exception { } public void atestDefault ( ) throws Exception { } }

Fix:
if ( ( ( key . indexOf ( '<seq2seq4repair_space>' ) ) >= 0 ) || ( ! ( key . toLowerCase ( Locale . ENGLISH ) . equals ( key ) ) ) ) {
Buggy code:
public abstract class Statement extends ASTNode { public abstract FlowInfo analyseCode ( BlockScope currentScope , FlowContext flowContext , FlowInfo flowInfo ) { } public void branchChainTo ( Label label ) { } public boolean complainIfUnreachable ( FlowInfo flowInfo , BlockScope scope , boolean didAlreadyComplain ) { if ( ( ( flowInfo . reachMode ( ) ) & ( FlowInfo . UNREACHABLE ) ) != 0 ) { <START_BUG> this . bits &= ~ ( IsReachableMASK ) ; <END_BUG> boolean reported = flowInfo == ( FlowInfo . DEAD_END ) ; if ( ( ! didAlreadyComplain ) && reported ) { scope . problemReporter ( ) . unreachableCode ( this ) ; } return reported ; } return false ; } public void generateArguments ( MethodBinding binding , Expression [ ] arguments , BlockScope currentScope , CodeStream codeStream ) { } public abstract void generateCode ( BlockScope currentScope , CodeStream codeStream ) { } public boolean isEmptyBlock ( ) { } public boolean isValidJavaStatement ( ) { } public StringBuffer print ( int indent , StringBuffer output ) { } public abstract StringBuffer printStatement ( int indent , StringBuffer output ) { } public abstract void resolve ( BlockScope scope ) { } public Constant resolveCase ( BlockScope scope , TypeBinding testType , SwitchStatement switchStatement ) { } }

Fix:
this . bits &= ~ ( ASTNode . IsReachable ) ;
Buggy code:
public class JGroupsSubsystemRemoveHandler extends AbstractRemoveStepHandler { private final boolean allowRuntimeOnlyRegistration ; JGroupsSubsystemRemoveHandler ( boolean allowRuntimeOnlyRegistration ) { } @ Override protected void performRemove ( OperationContext context , ModelNode operation , ModelNode model ) throws OperationFailedException { } @ Override protected void performRuntime ( OperationContext context , ModelNode operation , ModelNode model ) throws OperationFailedException { context . removeService ( SERVICE_NAME ) ; String defaultStack = ModelNodes . asString ( DEFAULT_STACK . resolveModelAttribute ( context , model ) ) ; if ( ( defaultStack != null ) && ( ! ( defaultStack . equals ( DEFAULT ) ) ) ) { context . removeService ( ChannelFactoryService . getServiceName ( DEFAULT ) ) ; } String defaultChannel = ModelNodes . asString ( DEFAULT_CHANNEL . resolveModelAttribute ( context , model ) ) ; if ( ( defaultChannel != null ) && ( ! ( defaultChannel . equals ( ChannelService . DEFAULT ) ) ) ) { context . removeService ( ChannelService . getServiceName ( ChannelService . DEFAULT ) ) ; context . removeService ( ConnectedChannelService . getServiceName ( ChannelService . DEFAULT ) ) ; <START_BUG> context . removeService ( ChannelService . getStackServiceName ( ChannelService . DEFAULT ) ) ; <END_BUG> for ( GroupServiceInstaller installer : ServiceLoader . load ( ClusteredGroupServiceInstaller . class , ClusteredGroupServiceInstaller . class . getClassLoader ( ) ) ) { for ( ServiceName name : installer . getServiceNames ( ChannelService . DEFAULT ) ) { context . removeService ( name ) ; } } } } @ Override protected void recoverServices ( OperationContext context , ModelNode operation , ModelNode model ) throws OperationFailedException { } }

Fix:
context . removeService ( ChannelService . getFactoryServiceName ( ChannelService . DEFAULT ) ) ;
Buggy code:
public class LoadingTestCollector extends ClassPathTestCollector { TestCaseClassLoader fLoader ; public LoadingTestCollector ( ) { } protected boolean isTestClass ( String classFileName ) { } Class classFromFile ( String classFileName ) throws ClassNotFoundException { } boolean isTestClass ( Class testClass ) { } boolean hasSuiteMethod ( Class testClass ) { try { <START_BUG> Method suiteMethod = testClass . getMethod ( SUITE_METHODNAME , new Class [ 0 ] ) ; <END_BUG> } catch ( Exception e ) { return false ; } return true ; } boolean hasPublicConstructor ( Class testClass ) { } }

Fix:
testClass . getMethod ( SUITE_METHODNAME , new Class [ 0 ] ) ;
Buggy code:
public class SaslMechanismFinder { private static final Logger LOG = LoggerFactory . getLogger ( SaslMechanismFinder . class ) ; private static final FactoryFinder < MechanismFactory > MECHANISM_FACTORY_FINDER = new FactoryFinder < MechanismFactory > ( MechanismFactory . class , ( ( "META-INF//services//" + ( SaslMechanismFinder . class . getPackage ( ) . getName ( ) . replace ( "." , "//" ) ) ) + "//" ) ) ; public static Mechanism findMatchingMechanism ( String ... remoteMechanisms ) { } protected static MechanismFactory findMechanismFactory ( String name ) throws IOException { if ( ( name == null ) || ( name . isEmpty ( ) ) ) { <START_BUG> throw new IOException ( ( ( "No<seq2seq4repair_space>Mechanism<seq2seq4repair_space>name<seq2seq4repair_space>specified:<seq2seq4repair_space>[" + name ) + "]" ) ) ; <END_BUG> } MechanismFactory factory = null ; try { factory = SaslMechanismFinder . MECHANISM_FACTORY_FINDER . newInstance ( name ) ; } catch ( Throwable e ) { throw new IOException ( ( ( "Mechanism<seq2seq4repair_space>scheme<seq2seq4repair_space>NOT<seq2seq4repair_space>recognized:<seq2seq4repair_space>[" + name ) + "]" ) , e ) ; } return factory ; } }

Fix:
throw new IOException ( "No<seq2seq4repair_space>Mechanism<seq2seq4repair_space>name<seq2seq4repair_space>specified." ) ;
Buggy code:
public class StoreMetricsHandler extends AbstractRuntimeOnlyHandler { @ Override protected void executeRuntimeStep ( OperationContext context , ModelNode operation ) throws OperationFailedException { <START_BUG> PathAddress address = Operations . getPathAddress ( operation ) ; <END_BUG> String containerName = address . getElement ( ( ( address . size ( ) ) - 3 ) ) . getValue ( ) ; String cacheName = address . getElement ( ( ( address . size ( ) ) - 2 ) ) . getValue ( ) ; String name = Operations . getAttributeName ( operation ) ; StoreMetric metric = StoreMetric . forName ( name ) ; if ( metric == null ) { context . getFailureDescription ( ) . set ( ROOT_LOGGER . unknownMetric ( name ) ) ; } else { Cache < ? , ? > cache = ServiceContainerHelper . findValue ( context . getServiceRegistry ( false ) , CACHE . getServiceName ( containerName , cacheName ) ) ; if ( cache != null ) { ActivationInterceptor interceptor = CacheMetric . findInterceptor ( cache , ActivationInterceptor . class ) ; context . getResult ( ) . set ( ( interceptor != null ? metric . getValue ( interceptor ) : new ModelNode ( 0 ) ) ) ; } } context . completeStep ( NOOP_RESULT_HANDLER ) ; } }

Fix:
PathAddress address = context . getCurrentAddress ( ) ;
Buggy code:
public class MarkupCacheTest extends TestCase { private MarkupCache cache ; private MarkupCacheTest . MarkupCachingAssumingComponent component ; @ Override public void setUp ( ) { } public void testMarkupNotFoundInformationIsCachedInDeploymentMode ( ) { <START_BUG> Markup markup = cache . getMarkup ( component , null , false ) ; <END_BUG> assertEquals ( NO_MARKUP , markup ) ; markup = cache . getMarkup ( component , null , false ) ; assertEquals ( NO_MARKUP , markup ) ; } private class MarkupCachingAssumingComponent extends Panel implements IMarkupResourceStreamProvider { private static final long serialVersionUID = - 6743937191677599322L ; private boolean firstCall = true ; public MarkupCachingAssumingComponent ( final String id ) { } public IResourceStream getMarkupResourceStream ( MarkupContainer container , Class < ? > containerClass ) { } @ Override public String getMarkupType ( ) { } } }

Fix:
IMarkupFragment markup = cache . getMarkup ( component , null , false ) ;
Buggy code:
public class PhraseTable implements Grammar { private JoshuaConfiguration config ; private Grammar backend ; private int maxSourcePhraseLength ; public PhraseTable ( String grammarFile , String owner , JoshuaConfiguration config ) throws IOException { } public PhraseTable ( String owner , JoshuaConfiguration config ) { } public int getMaxSourcePhraseLength ( ) { } public RuleCollection getPhrases ( int [ ] sourceWords ) { } public void addRule ( Rule rule ) { } @ Override public void addOOVRules ( int sourceWord , List < FeatureFunction > featureFunctions ) { int targetWord = ( config . mark_oovs ) ? Vocabulary . id ( ( ( Vocabulary . word ( sourceWord ) ) + "_OOV" ) ) : sourceWord ; <START_BUG> int nt_i = Vocabulary . id ( this . config . default_non_terminal ) ; <END_BUG> Rule oovRule = new Rule ( nt_i , new int [ ] { nt_i , sourceWord } , new int [ ] { - 1 , targetWord } , "" , 1 , null ) ; addRule ( oovRule ) ; oovRule . estimateRuleCost ( featureFunctions ) ; } @ Override public Trie getTrieRoot ( ) { } @ Override public void sortGrammar ( List < FeatureFunction > models ) { } @ Override public boolean isSorted ( ) { } @ Override public boolean hasRuleForSpan ( int startIndex , int endIndex , int pathLength ) { } @ Override public int getNumRules ( ) { } @ Override public Rule constructManualRule ( int lhs , int [ ] sourceWords , int [ ] targetWords , float [ ] scores , int arity ) { } @ Override public void writeGrammarOnDisk ( String file ) { } @ Override public boolean isRegexpGrammar ( ) { } @ Override public int getOwner ( ) { } }

Fix:
int nt_i = Vocabulary . id ( "[X]" ) ;
Buggy code:
class SearchTest { public static void main ( String [ ] args ) { try { Directory directory = new RAMDirectory ( ) ; Analyzer analyzer = new SimpleAnalyzer ( ) ; IndexWriter writer = new IndexWriter ( directory , analyzer , true ) ; String [ ] docs = new String [ ] { "a<seq2seq4repair_space>b<seq2seq4repair_space>c<seq2seq4repair_space>d<seq2seq4repair_space>e" , "a<seq2seq4repair_space>b<seq2seq4repair_space>c<seq2seq4repair_space>d<seq2seq4repair_space>e<seq2seq4repair_space>a<seq2seq4repair_space>b<seq2seq4repair_space>c<seq2seq4repair_space>d<seq2seq4repair_space>e" , "a<seq2seq4repair_space>b<seq2seq4repair_space>c<seq2seq4repair_space>d<seq2seq4repair_space>e<seq2seq4repair_space>f<seq2seq4repair_space>g<seq2seq4repair_space>h<seq2seq4repair_space>i<seq2seq4repair_space>j" , "a<seq2seq4repair_space>c<seq2seq4repair_space>e" , "e<seq2seq4repair_space>c<seq2seq4repair_space>a" , "a<seq2seq4repair_space>c<seq2seq4repair_space>e<seq2seq4repair_space>a<seq2seq4repair_space>c<seq2seq4repair_space>e" , "a<seq2seq4repair_space>c<seq2seq4repair_space>e<seq2seq4repair_space>a<seq2seq4repair_space>b<seq2seq4repair_space>c" } ; for ( int j = 0 ; j < ( docs . length ) ; j ++ ) { Document d = new Document ( ) ; d . add ( Field . Text ( "contents" , docs [ j ] ) ) ; writer . addDocument ( d ) ; } writer . close ( ) ; Searcher searcher = new IndexSearcher ( directory ) ; String [ ] queries = new String [ ] { "\"a<seq2seq4repair_space>c<seq2seq4repair_space>e\"" } ; Hits hits = null ; QueryParser parser = new QueryParser ( "contents" , analyzer ) ; parser . setPhraseSlop ( 4 ) ; for ( int j = 0 ; j < ( queries . length ) ; j ++ ) { Query query = parser . parse ( queries [ j ] ) ; System . out . println ( ( "Query:<seq2seq4repair_space>" + ( query . toString ( "contents" ) ) ) ) ; <START_BUG> hits = searcher . search ( query , null ) ; <END_BUG> System . out . println ( ( ( hits . length ( ) ) + "<seq2seq4repair_space>total<seq2seq4repair_space>results" ) ) ; for ( int i = 0 ; ( i < ( hits . length ( ) ) ) && ( i < 10 ) ; i ++ ) { Document d = hits . doc ( i ) ; System . out . println ( ( ( ( ( i + "<seq2seq4repair_space>" ) + ( hits . score ( i ) ) ) + "<seq2seq4repair_space>" ) + ( d . get ( "contents" ) ) ) ) ; } } searcher . close ( ) ; } catch ( Exception e ) { System . out . println ( ( ( ( "<seq2seq4repair_space>caught<seq2seq4repair_space>a<seq2seq4repair_space>" + ( e . getClass ( ) ) ) + "\n<seq2seq4repair_space>with<seq2seq4repair_space>message:<seq2seq4repair_space>" ) + ( e . getMessage ( ) ) ) ) ; } } static long Time ( int year , int month , int day ) { } }

Fix:
hits = searcher . search ( query ) ;
Buggy code:
public class H2DatabaseResults implements DatabaseResults { private final ResultSet resultSet ; private final ResultSetMetaData metaData ; private final ObjectCache objectCache ; public H2DatabaseResults ( ResultSet resultSet , ObjectCache objectCache ) throws SQLException { } public int getColumnCount ( ) throws SQLException { } public String [ ] getColumnNames ( ) throws SQLException { int colN = getColumnCount ( ) ; String [ ] columnNames = new String [ colN ] ; for ( int colC = 0 ; colC < colN ; colC ++ ) { <START_BUG> columnNames [ colC ] = metaData . getColumnName ( ( colC + 1 ) ) ; <END_BUG> } return columnNames ; } public boolean first ( ) throws SQLException { } public boolean next ( ) throws SQLException { } public boolean last ( ) throws SQLException { } public boolean previous ( ) throws SQLException { } public boolean moveRelative ( int num ) throws SQLException { } public boolean moveAbsolute ( int position ) throws SQLException { } public int findColumn ( String columnName ) throws SQLException { } public String getString ( int columnIndex ) throws SQLException { } public boolean getBoolean ( int columnIndex ) throws SQLException { } public char getChar ( int columnIndex ) throws SQLException { } public byte getByte ( int columnIndex ) throws SQLException { } public byte [ ] getBytes ( int columnIndex ) throws SQLException { } public short getShort ( int columnIndex ) throws SQLException { } public int getInt ( int columnIndex ) throws SQLException { } public long getLong ( int columnIndex ) throws SQLException { } public float getFloat ( int columnIndex ) throws SQLException { } public double getDouble ( int columnIndex ) throws SQLException { } public BigDecimal getBigDecimal ( int columnIndex ) throws SQLException { } public Timestamp getTimestamp ( int columnIndex ) throws SQLException { } public InputStream getBlobStream ( int columnIndex ) throws SQLException { } public boolean wasNull ( int columnIndex ) throws SQLException { } public ObjectCache getObjectCache ( ) { } public void close ( ) throws IOException { } public void closeQuietly ( ) { } }

Fix:
columnNames [ colC ] = metaData . getColumnLabel ( ( colC + 1 ) ) ;
Buggy code:
public class ClasspathSourceDirectory extends ClasspathLocation { IContainer sourceFolder ; SimpleLookupTable directoryCache ; SimpleLookupTable missingPackageHolder = new SimpleLookupTable ( ) ; char [ ] [ ] fullExclusionPatternChars ; char [ ] [ ] fulInclusionPatternChars ; ClasspathSourceDirectory ( IContainer sourceFolder , char [ ] [ ] fullExclusionPatternChars , char [ ] [ ] fulInclusionPatternChars ) { } public void cleanup ( ) { } SimpleLookupTable directoryTable ( String qualifiedPackageName ) { } public boolean equals ( Object o ) { } public NameEnvironmentAnswer findClass ( String sourceFileWithoutExtension , String qualifiedPackageName , String qualifiedSourceFileWithoutExtension ) { SimpleLookupTable dirTable = directoryTable ( qualifiedPackageName ) ; if ( ( dirTable != null ) && ( ( dirTable . elementSize ) > 0 ) ) { IFile file = ( ( IFile ) ( dirTable . get ( sourceFileWithoutExtension ) ) ) ; if ( file != null ) { <START_BUG> return new NameEnvironmentAnswer ( new ResourceCompilationUnit ( file ) , null ) ; <END_BUG> } } return null ; } public IPath getProjectRelativePath ( ) { } public boolean isPackage ( String qualifiedPackageName ) { } public void reset ( ) { } public String toString ( ) { } public String debugPathString ( ) { } }

Fix:
return new NameEnvironmentAnswer ( new ResourceCompilationUnit ( file , file . getLocationURI ( ) ) , null ) ;
Buggy code:
public class NewReviewItemPropertyTester extends PropertyTester { public boolean test ( Object receiver , String property , Object [ ] args , Object expectedValue ) { final R4EUIReviewBasic activeReview = R4EUIModelController . getActiveReview ( ) ; if ( null == activeReview ) { return false ; } if ( activeReview . isReadOnly ( ) ) { return false ; } final R4EReviewPhase phase = ( ( org . eclipse . mylyn . reviews . r4e . core . model . R4EReviewState ) ( activeReview . getReview ( ) . getState ( ) ) ) . getState ( ) ; <START_BUG> if ( ( activeReview . isUserReviewed ( ) ) || ( phase . equals ( R4E_REVIEW_PHASE_COMPLETED ) ) ) { <END_BUG> return false ; } if ( receiver instanceof AbstractSet ) { final Iterator < ? > iterator = ( ( AbstractSet < ? > ) ( receiver ) ) . iterator ( ) ; if ( ( iterator . next ( ) ) instanceof TextSelection ) { if ( ! ( isR4EEditorInputAvailable ( ) ) ) { return false ; } } } if ( receiver instanceof AbstractList ) { final Iterator < ? > iterator = ( ( AbstractList < ? > ) ( receiver ) ) . iterator ( ) ; if ( ! ( iterator . hasNext ( ) ) ) { if ( ! ( isR4EEditorInputAvailable ( ) ) ) { return false ; } } else { final Object obj = iterator . next ( ) ; if ( ( ( R4EUIPlugin . isJDTAvailable ( ) ) && ( obj instanceof ISourceReference ) ) || ( ( R4EUIPlugin . isCDTAvailable ( ) ) && ( obj instanceof org . eclipse . cdt . core . model . ISourceReference ) ) ) { if ( ! ( isR4EEditorInputAvailable ( ) ) ) { return false ; } } } } return true ; } private boolean isR4EEditorInputAvailable ( ) { } No newline ; at end ; of file ; }

Fix:
if ( phase . equals ( R4E_REVIEW_PHASE_COMPLETED ) ) {
Buggy code:
public class TermFirstPassGroupingCollector extends AbstractFirstPassGroupingCollector < BytesRef > { private final BytesRef scratchBytesRef = new BytesRef ( ) ; private DocTermsIndex index ; private String groupField ; public TermFirstPassGroupingCollector ( String groupField , Sort groupSort , int topNGroups ) throws IOException { } @ Override protected BytesRef getDocGroupValue ( int doc ) { final int ord = index . getOrd ( doc ) ; <START_BUG> return ord == 0 ? null : index . lookup ( ord , scratchBytesRef ) ; <END_BUG> } @ Override protected BytesRef copyDocGroupValue ( BytesRef groupValue , BytesRef reuse ) { } @ Override public void setNextReader ( AtomicReaderContext readerContext ) throws IOException { } }

Fix:
return ord == ( - 1 ) ? null : index . lookup ( ord , scratchBytesRef ) ;
Buggy code:
class TabFolderTab extends Tab { TabFolder tabFolder1 ; Group tabFolderGroup ; Button topButton ; Button bottomButton ; static String [ ] TabItems1 = new String [ ] { ControlExample . getResourceString ( "TabItem1_0" ) , ControlExample . getResourceString ( "TabItem1_1" ) , ControlExample . getResourceString ( "TabItem1_2" ) } ; TabFolderTab ( ControlExample instance ) { } void createExampleGroup ( ) { } void createExampleWidgets ( ) { } void createStyleGroup ( ) { } Item [ ] getExampleWidgetItems ( ) { } Widget [ ] getExampleWidgets ( ) { } String [ ] getMethodNames ( ) { <START_BUG> return new String [ ] { "Selection" , "SelectionIndex" } ; <END_BUG> } String setMethodName ( String methodRoot ) { } Object [ ] parameterForType ( String typeName , String value , Widget widget ) { } TabItem findItem ( String value , TabItem [ ] items ) { } String getShortTabText ( ) { } String getTabText ( ) { } void setExampleWidgetState ( ) { } }

Fix:
return new String [ ] { "Selection" , "SelectionIndex" , "ToolTipText" } ;
Buggy code:
public abstract class ResourceReference implements Serializable { private static final long serialVersionUID = 1L ; private final String scope ; private final String name ; private final Locale locale ; private final String style ; private final String variation ; public ResourceReference ( Class < ? > scope , String name , Locale locale , String style , String variation ) { } public String getName ( ) { } public Class < ? > getScope ( ) { } public Locale getLocale ( ) { } public String getStyle ( ) { } public String getVariation ( ) { } @ Override public boolean equals ( Object obj ) { } @ Override public int hashCode ( ) { } <START_BUG> public abstract Resource getResource ( ) ; <END_BUG> }

Fix:
public abstract IResource getResource ( ) ;
Buggy code:
@ Controller public class EditorImageController { private static final Logger LOG = LoggerFactory . getLogger ( EditorImageController . class ) ; @ Autowired FileManager fileManager ; @ RequestMapping ( value = "//photoUpload" , method = RequestMethod . POST ) @ ResponseBody public UploadResult photoFileUploader ( @ RequestParam ( "file" ) MultipartFile file , @ RequestParam String alt ) { System . out . println ( ( "type<seq2seq4repair_space>:" + ( file . getContentType ( ) ) ) ) ; System . out . println ( ( "origin<seq2seq4repair_space>:" + ( file . getOriginalFilename ( ) ) ) ) ; PhotoInfo pi = fileManager . readTo ( file ) ; if ( pi == null ) { return new UploadResult ( true , "잘못된<seq2seq4repair_space>파일형식이나<seq2seq4repair_space>파일입니다." ) ; } if ( ! ( fileManager . save ( file , pi ) ) ) { return new UploadResult ( true , "파일을<seq2seq4repair_space>서버에<seq2seq4repair_space>저장할수<seq2seq4repair_space>없습니다." ) ; } <START_BUG> return new UploadResult ( false , ( ( ( pi . getRequestPath ( ) ) + ( pi . getUuFileName ( ) ) ) + ( pi . getFileExt ( ) ) ) ) ; <END_BUG> } }

Fix:
return new UploadResult ( false , ( ( ( ( ( pi . getRequestPath ( ) ) + "//" ) + ( pi . getUuFileName ( ) ) ) + "." ) + ( pi . getFileExt ( ) ) ) ) ;
Buggy code:
public final class AttachmentImageIconLoader { private static final Logger LOG = Logger . getLogger ( "org.columba.mail.gui.attachment.util" ) ; private AttachmentImageIconLoader ( ) { } public static ImageIcon getImageIcon ( String contentType , String contentSubtype ) { StringBuffer buf = new StringBuffer ( ) ; buf . append ( "mime//gnome-" ) ; buf . append ( contentType ) ; buf . append ( "-" ) ; buf . append ( contentSubtype ) ; buf . append ( ".png" ) ; if ( AttachmentImageIconLoader . LOG . isLoggable ( Level . FINE ) ) { AttachmentImageIconLoader . LOG . fine ( ( "Locating<seq2seq4repair_space>image<seq2seq4repair_space>icon<seq2seq4repair_space>" + ( buf . toString ( ) ) ) ) ; } ImageIcon icon = ImageLoader . getUnsafeImageIcon ( buf . toString ( ) ) ; if ( icon == null ) { icon = ImageLoader . getUnsafeImageIcon ( ( ( "mime//gnome-" + contentType ) + ".png" ) ) ; } if ( icon == null ) { <START_BUG> icon = ImageLoader . getImageIcon ( "text.png" ) ; <END_BUG> } return icon ; } }

Fix:
icon = ImageLoader . getUnsafeImageIcon ( "mime//gnome-text.png" ) ;
Buggy code:
public class XMPPClientSOContainer extends ClientSOContainer { public static final int DEFAULT_KEEPALIVE = 30000 ; public static final String XMPP_SHARED_OBJECT_ID = ( XMPPClientSOContainer . class . getName ( ) ) + ".xmpphandler" ; int keepAlive = 0 ; protected IIMMessageSender messageSender = null ; protected XMPPPresenceSharedObject sharedObject = null ; protected ID sharedObjectID = null ; public XMPPClientSOContainer ( ) throws Exception { } public XMPPClientSOContainer ( int ka ) throws Exception { } public XMPPClientSOContainer ( String userhost , int ka ) throws Exception { } protected ID handleConnectResponse ( ID originalTarget , Object serverData ) throws Exception { } protected void addSharedObjectToContainer ( ID remote ) throws SharedObjectAddException { <START_BUG> getSharedObjectManager ( ) . addSharedObject ( sharedObjectID , sharedObject , new HashMap ( ) , null ) ; <END_BUG> } protected void cleanUpConnectFail ( ) { } public void dispose ( long time ) { } protected ISynchAsynchConnection makeConnection ( ID remoteSpace , Object data ) throws ConnectionInstantiationException { } protected Object makeConnectData ( ID target , Callback [ ] cbs , Object data ) { } protected Callback [ ] makeAuthorizationCallbacks ( ) { } protected int getConnectTimeout ( ) { } public Roster getRoster ( ) throws IOException { } protected void handleChatMessage ( Message mess ) throws IOException { } protected void handleContainerMessage ( ContainerMessage mess ) throws IOException { } protected void handleIQMessage ( IQ mess ) throws IOException { } protected void handlePresenceMessage ( Presence mess ) throws IOException { } protected void handleXMPPMessage ( Packet aPacket ) throws IOException { } protected void initializeSharedObject ( ) throws Exception { } public void joinGroup ( ID remote , IJoinContext joinContext ) throws SharedObjectContainerJoinException { } public void leaveGroup ( ) { } protected SOContext makeSharedObjectContext ( SOConfig soconfig , IQueueEnqueue queue ) { } protected void processAsynch ( AsynchConnectionEvent e ) { } public void sendMessage ( ID target , String message ) throws IOException { } protected Presence makePresenceFromIPresence ( IPresence presence ) { } protected void sendPresenceUpdate ( ID target , Presence presence ) throws IOException { } protected void sendRosterAdd ( String user , String name , String [ ] groups ) throws IOException { } protected void sendRosterRemove ( String user ) throws IOException { } public Object getAdapter ( Class clazz ) { } }

Fix:
getSharedObjectManager ( ) . addSharedObject ( sharedObjectID , sharedObject , new HashMap ( ) ) ;
Buggy code:
public class Fragment extends WebMarkupContainer { private static final long serialVersionUID = 1L ; private String markupId ; private final MarkupContainer markupProvider ; public Fragment ( final String id , final String markupId , final MarkupContainer markupProvider ) { } public Fragment ( final String id , final String markupId , final MarkupContainer markupProvider , final IModel < ? > model ) { } public final void setMarkupTagReferenceId ( final String markupId ) { } @ Override protected void onComponentTag ( final ComponentTag tag ) { } @ Override protected void onComponentTagBody ( final MarkupStream markupStream , final ComponentTag openTag ) { <START_BUG> if ( ( ( ComponentTag ) ( markupStream . get ( ( ( markupStream . getCurrentIndex ( ) ) - 1 ) ) ) ) . isOpen ( ) ) { <END_BUG> markupStream . skipRawMarkup ( ) ; } renderFragment ( openTag ) ; } private void renderFragment ( final ComponentTag openTag ) { } protected final MarkupContainer getMarkupProvider ( ) { } protected IMarkupFragment chooseMarkup ( ) { } @ Override public IMarkupFragment getMarkup ( final Component child ) { } }

Fix:
if ( markupStream . getPreviousTag ( ) . isOpen ( ) ) {
Buggy code:
public class SSTableWriterTest extends CleanupHelper { @ Test public void testRecoverAndOpen ( ) throws IOException , InterruptedException , ExecutionException { RowMutation rm = new RowMutation ( "Keyspace1" , ByteBufferUtil . bytes ( "k1" ) ) ; rm . add ( new org . apache . cassandra . db . filter . QueryPath ( "Indexed1" , null , ByteBufferUtil . bytes ( "birthdate" ) ) , ByteBufferUtil . bytes ( 1L ) , 0 ) ; rm . apply ( ) ; Map < String , ColumnFamily > entries = new HashMap < String , ColumnFamily > ( ) ; ColumnFamily cf ; cf = ColumnFamily . create ( "Keyspace1" , "Indexed1" ) ; cf . addColumn ( new Column ( ByteBufferUtil . bytes ( "birthdate" ) , ByteBufferUtil . bytes ( 1L ) , 0 ) ) ; cf . addColumn ( new Column ( ByteBufferUtil . bytes ( "anydate" ) , ByteBufferUtil . bytes ( 1L ) , 0 ) ) ; entries . put ( "k2" , cf ) ; cf = ColumnFamily . create ( "Keyspace1" , "Indexed1" ) ; cf . addColumn ( new Column ( ByteBufferUtil . bytes ( "anydate" ) , ByteBufferUtil . bytes ( 1L ) , 0 ) ) ; entries . put ( "k3" , cf ) ; SSTableReader orig = SSTableUtils . prepare ( ) . cf ( "Indexed1" ) . write ( entries ) ; FileUtils . deleteWithConfirm ( orig . descriptor . filenameFor ( PRIMARY_INDEX ) ) ; FileUtils . deleteWithConfirm ( orig . descriptor . filenameFor ( FILTER ) ) ; SSTableReader sstr = instance . submitSSTableBuild ( orig . descriptor , AES ) . get ( ) ; assert sstr != null ; ColumnFamilyStore cfs = Table . open ( "Keyspace1" ) . getColumnFamilyStore ( "Indexed1" ) ; cfs . addSSTable ( sstr ) ; <START_BUG> cfs . buildSecondaryIndexes ( cfs . getSSTables ( ) , cfs . getIndexedColumns ( ) ) ; <END_BUG> IndexExpression expr = new IndexExpression ( ByteBufferUtil . bytes ( "birthdate" ) , IndexOperator . EQ , ByteBufferUtil . bytes ( 1L ) ) ; IndexClause clause = new IndexClause ( Arrays . asList ( expr ) , ByteBufferUtil . EMPTY_BYTE_BUFFER , 100 ) ; IFilter filter = new IdentityQueryFilter ( ) ; IPartitioner p = StorageService . getPartitioner ( ) ; Range range = new Range ( p . getMinimumToken ( ) , p . getMinimumToken ( ) ) ; List < Row > rows = cfs . scan ( clause , range , filter ) ; assertEquals ( "IndexExpression<seq2seq4repair_space>should<seq2seq4repair_space>return<seq2seq4repair_space>two<seq2seq4repair_space>rows<seq2seq4repair_space>on<seq2seq4repair_space>recoverAndOpen" , 2 , rows . size ( ) ) ; assertTrue ( "First<seq2seq4repair_space>result<seq2seq4repair_space>should<seq2seq4repair_space>be<seq2seq4repair_space>'k1'" , ByteBufferUtil . bytes ( "k1" ) . equals ( rows . get ( 0 ) . key . key ) ) ; } }

Fix:
cfs . maybeBuildSecondaryIndexes ( cfs . getSSTables ( ) , cfs . getIndexedColumns ( ) ) ;
Buggy code:
public class DribbleCommand implements ComplexCommand { Point2D ball ; Point2D alfie ; double facing ; public DribbleCommand ( Point2D ball , Point2D alfie , double facing ) { } public Point2D getBall ( ) { } public Point2D getAlfie ( ) { } public double getFacing ( ) { } @ Override public Type getType ( ) { <START_BUG> return null ; <END_BUG> } }

Fix:
return Type . DRIBBLE ;
Buggy code:
public class ConditionalFormatter { protected Spreadsheet spreadsheet ; protected Map < String , Set < Integer > > cellToIndex = new HashMap < String , Set < Integer > > ( ) ; protected FormulaEvaluator formulaEvaluator ; protected ColorConverter colorConverter ; public ConditionalFormatter ( Spreadsheet spreadsheet ) { } public Set < Integer > getCellFormattingIndex ( Cell cell ) { } public void createConditionalFormatterRules ( ) { } protected void runCellMatcher ( ConditionalFormatting cf , ConditionalFormattingRule rule , int classNameIndex ) { for ( CellRangeAddress cra : cf . getFormattingRanges ( ) ) { for ( int row = cra . getFirstRow ( ) ; row <= ( cra . getLastRow ( ) ) ; row ++ ) { for ( int col = cra . getFirstColumn ( ) ; col <= ( cra . getLastColumn ( ) ) ; col ++ ) { Cell cell = spreadsheet . getCell ( row , col ) ; <START_BUG> if ( matches ( cell , rule ) ) { <END_BUG> Set < Integer > list = cellToIndex . get ( SpreadsheetUtil . toKey ( cell ) ) ; if ( list == null ) { list = new HashSet < Integer > ( ) ; cellToIndex . put ( SpreadsheetUtil . toKey ( cell ) , list ) ; } list . add ( classNameIndex ) ; } } } } } protected boolean matches ( Cell cell , ConditionalFormattingRule rule ) { } protected boolean matchesFormula ( ConditionalFormattingRule rule ) { } protected boolean matchesValue ( Cell cell , ConditionalFormattingRule rule ) { } }

Fix:
if ( ( cell != null ) && ( matches ( cell , rule ) ) ) {
Buggy code:
public class MyWebSocketActor extends UntypedActor { public static ALogger log = Logger . of ( "myWebSocketActor" ) ; public static Props props ( ActorRef out ) { } private final ActorRef out ; private File file = new File ( "result//out.txt" ) ; public MyWebSocketActor ( ActorRef out ) { } @ Override public void preStart ( ) throws Exception { } public void onReceive ( Object message ) throws Exception { if ( message instanceof Log ) { Log msg = ( ( Log ) ( message ) ) ; if ( "email" . equals ( msg . getType ( ) ) ) { <START_BUG> FileUtils . write ( file , msg . getValue ( ) . toString ( ) , true ) ; <END_BUG> } MyWebSocketActor . log . debug ( ( "receive<seq2seq4repair_space>message:" + msg ) ) ; out . tell ( Json . toJson ( msg ) . toString ( ) , self ( ) ) ; } else if ( message instanceof String ) { MyWebSocketActor . log . debug ( ( "receive<seq2seq4repair_space>message:" + message ) ) ; out . tell ( Json . toJson ( new Log ( "log" , ( ( String ) ( message ) ) ) ) . toString ( ) , self ( ) ) ; } else { unhandled ( message ) ; } } No newline ; at end ; of file ; }

Fix:
FileUtils . write ( file , ( ( msg . getValue ( ) . toString ( ) ) + "\n" ) , true ) ;