nus-yam/ex-repair huggingface dataset:
Buggy code:
public class BuildScriptErrorIntegrationTest extends AbstractIntegrationTest { @ Test public void reportsProjectEvaluationFailsWithGroovyException ( ) { } @ Test public void reportsScriptCompilationException ( ) { } @ Test public void reportsNestedProjectEvaluationFailsWithRuntimeException ( ) { testFile ( "settings.gradle" ) . write ( "include<seq2seq4repair_space>'child'" ) ; TestFile buildFile = testFile ( "build.gradle" ) ; <START_BUG> buildFile . writelns ( "dependsOn<seq2seq4repair_space>'child'" , "task<seq2seq4repair_space>t" ) ; <END_BUG> TestFile childBuildFile = testFile ( "child//build.gradle" ) ; childBuildFile . writelns ( "def<seq2seq4repair_space>broken<seq2seq4repair_space>=<seq2seq4repair_space>{<seq2seq4repair_space>->" , "<seq2seq4repair_space>throw<seq2seq4repair_space>new<seq2seq4repair_space>RuntimeException('failure')<seq2seq4repair_space>}" , "broken()" ) ; ExecutionFailure failure = inTestDirectory ( ) . withTasks ( "t" ) . runWithFailure ( ) ; failure . assertHasFileName ( String . format ( "Build<seq2seq4repair_space>file<seq2seq4repair_space>'%s'" , childBuildFile ) ) ; failure . assertHasLineNumber ( 2 ) ; failure . assertHasDescription ( "A<seq2seq4repair_space>problem<seq2seq4repair_space>occurred<seq2seq4repair_space>evaluating<seq2seq4repair_space>project<seq2seq4repair_space>':child'" ) ; failure . assertHasCause ( "failure" ) ; } @ Test public void reportsTaskGraphReadyEventFailsWithRuntimeException ( ) { } @ Test @ Ignore public void reportsTaskDependencyClosureFailsWithRuntimeException ( ) { } }

Fix:
buildFile . writelns ( "evaluationDependsOn<seq2seq4repair_space>'child'" , "task<seq2seq4repair_space>t" ) ;
Buggy code:
public class DOM3 implements DOMErrorHandler , DOMParserFilter { protected static final boolean DEFAULT_NAMESPACES = true ; protected static final boolean DEFAULT_VALIDATION = false ; protected static final boolean DEFAULT_SCHEMA_VALIDATION = false ; static DOMParser builder ; public static void main ( String [ ] argv ) { if ( ( argv . length ) == 0 ) { DOM3 . printUsage ( ) ; System . exit ( 1 ) ; } try { System . setProperty ( DOMImplementationRegistry . PROPERTY , "org.apache.xerces.dom.DOMImplementationSourceImpl" ) ; DOMImplementationRegistry registry = DOMImplementationRegistry . newInstance ( ) ; DOMImplementationLS impl = ( ( DOMImplementationLS ) ( registry . getDOMImplementation ( "LS" ) ) ) ; DOM3 . builder = impl . createDOMParser ( DOMImplementationLS . MODE_SYNCHRONOUS , null ) ; DOMConfiguration config = DOM3 . builder . getConfig ( ) ; DOMErrorHandler errorHandler = new DOM3 ( ) ; DOMParserFilter filter = new DOM3 ( ) ; DOM3 . builder . setFilter ( filter ) ; config . setParameter ( "error-handler" , errorHandler ) ; config . setParameter ( "validate" , Boolean . TRUE ) ; config . setParameter ( "schema-type" , "http:////www.w3.org//2001//XMLSchema" ) ; config . setParameter ( "schema-location" , "personal.xsd" ) ; System . out . println ( ( ( "Parsing<seq2seq4repair_space>" + ( argv [ 0 ] ) ) + "..." ) ) ; Document doc = DOM3 . builder . parseURI ( argv [ 0 ] ) ; <START_BUG> config = doc . getConfig ( ) ; <END_BUG> config . setParameter ( "error-handler" , errorHandler ) ; config . setParameter ( "validate" , Boolean . TRUE ) ; config . setParameter ( "schema-type" , "http:////www.w3.org//2001//XMLSchema" ) ; config . setParameter ( "schema-location" , "data//personal.xsd" ) ; config . setParameter ( "comments" , Boolean . FALSE ) ; System . out . println ( "Normalizing<seq2seq4repair_space>document...<seq2seq4repair_space>" ) ; doc . normalizeDocument ( ) ; DOMSerializer domWriter = impl . createDOMSerializer ( ) ; System . out . println ( "Serializing<seq2seq4repair_space>document...<seq2seq4repair_space>" ) ; config = domWriter . getConfig ( ) ; config . setParameter ( "xml-declaration" , Boolean . FALSE ) ; DOMOutput dOut = new DOMOutputImpl ( ) ; dOut . setByteStream ( System . out ) ; domWriter . write ( doc , dOut ) ; } catch ( Exception ex ) { ex . printStackTrace ( ) ; } } private static void printUsage ( ) { } public boolean handleError ( DOMError error ) { } public short acceptNode ( Node enode ) { } public int getWhatToShow ( ) { } public short startElement ( Element elt ) { } }

Fix:
config = doc . getDomConfig ( ) ;
Buggy code:
public class JdtOawClassicTypeStrategy implements JdtTypeStrategy { public JdtOawClassicTypeStrategy ( ) { } public IType [ ] getSuperTypes ( final IType type ) throws JavaModelException { } private final Cache < IType , ITypeHierarchy > cache = new Cache < IType , ITypeHierarchy > ( ) { @ Override protected ITypeHierarchy createNew ( IType type ) { } } ; public boolean isAssignable ( final IType toAssigTo , final IType assignable ) { <START_BUG> return ( ( ITypeHierarchy ) ( cache . get ( assignable ) ) ) . contains ( toAssigTo ) ; <END_BUG> } public boolean isGetter ( final IMethod method ) { } public String getterToProperty ( final String elementName ) { } public boolean isOperation ( final IMethod method ) { } public String propertyName ( final IMethod method ) { } public String getPropertiesInnerType ( final IMethod method ) { } public boolean isConstant ( IField field ) { } public String propertyName ( IField field ) { } }

Fix:
return cache . get ( assignable ) . contains ( toAssigTo ) ;
Buggy code:
public class LDAPArguments extends ConfigTestElement implements Serializable { public static final String ARGUMENTS = "Arguments.arguments" ; public LDAPArguments ( ) { } public CollectionProperty getArguments ( ) { } @ Override public void clear ( ) { } public void setArguments ( List < Object > arguments ) { } public Map < String , String > getArgumentsAsMap ( ) { } public void addArgument ( String name , String value , String opcode ) { } public void addArgument ( LDAPArgument arg ) { } public void addArgument ( String name , String value , String opcode , String metadata ) { } public PropertyIterator iterator ( ) { } @ Override public String toString ( ) { <START_BUG> StringBuffer str = new StringBuffer ( ) ; <END_BUG> PropertyIterator iter = getArguments ( ) . iterator ( ) ; while ( iter . hasNext ( ) ) { LDAPArgument arg = ( ( LDAPArgument ) ( iter . next ( ) . getObjectValue ( ) ) ) ; final String metaData = arg . getMetaData ( ) ; str . append ( arg . getName ( ) ) ; if ( metaData == null ) { str . append ( "=" ) ; } else { str . append ( metaData ) ; } str . append ( arg . getValue ( ) ) ; if ( iter . hasNext ( ) ) { str . append ( "&" ) ; } } return str . toString ( ) ; } public void removeArgument ( int row ) { } public void removeArgument ( LDAPArgument arg ) { } public void removeArgument ( String argName ) { } public void removeAllArguments ( ) { } public void addEmptyArgument ( ) { } public int getArgumentCount ( ) { } public LDAPArgument getArgument ( int row ) { } }

Fix:
StringBuilder str = new StringBuilder ( ) ;
Buggy code:
public class SystemBolt implements IBolt { private static Logger LOG = LoggerFactory . getLogger ( SystemBolt . class ) ; private static boolean _prepareWasCalled = false ; private static class MemoryUsageMetric implements IMetric { IFn _getUsage ; public MemoryUsageMetric ( IFn getUsage ) { } @ Override public Object getValueAndReset ( ) { } } private static class GarbageCollectorMetric implements IMetric { GarbageCollectorMXBean _gcBean ; Long _collectionCount ; Long _collectionTime ; public GarbageCollectorMetric ( GarbageCollectorMXBean gcBean ) { } @ Override public Object getValueAndReset ( ) { } } @ Override public void prepare ( final Map stormConf , TopologyContext context , OutputCollector collector ) { <START_BUG> if ( ( SystemBolt . _prepareWasCalled ) && ( ( stormConf . get ( STORM_CLUSTER_MODE ) ) != "local" ) ) { <END_BUG> throw new RuntimeException ( "A<seq2seq4repair_space>single<seq2seq4repair_space>worker<seq2seq4repair_space>should<seq2seq4repair_space>have<seq2seq4repair_space>1<seq2seq4repair_space>SystemBolt<seq2seq4repair_space>instance." ) ; } SystemBolt . _prepareWasCalled = true ; int bucketSize = RT . intCast ( stormConf . get ( TOPOLOGY_BUILTIN_METRICS_BUCKET_SIZE_SECS ) ) ; final RuntimeMXBean jvmRT = ManagementFactory . getRuntimeMXBean ( ) ; context . registerMetric ( "uptimeSecs" , new IMetric ( ) { @ Override public Object getValueAndReset ( ) { return ( jvmRT . getUptime ( ) ) // 1000.0 ; } } , bucketSize ) ; context . registerMetric ( "startTimeSecs" , new IMetric ( ) { @ Override public Object getValueAndReset ( ) { return ( jvmRT . getStartTime ( ) ) // 1000.0 ; } } , bucketSize ) ; context . registerMetric ( "newWorkerEvent" , new IMetric ( ) { boolean doEvent = true ; @ Override public Object getValueAndReset ( ) { if ( doEvent ) { doEvent = false ; return 1 ; } else return 0 ; } } , bucketSize ) ; final MemoryMXBean jvmMemRT = ManagementFactory . getMemoryMXBean ( ) ; context . registerMetric ( "memory//heap" , new SystemBolt . MemoryUsageMetric ( new AFn ( ) { public Object invoke ( ) { return jvmMemRT . getHeapMemoryUsage ( ) ; } } ) , bucketSize ) ; context . registerMetric ( "memory//nonHeap" , new SystemBolt . MemoryUsageMetric ( new AFn ( ) { public Object invoke ( ) { return jvmMemRT . getNonHeapMemoryUsage ( ) ; } } ) , bucketSize ) ; for ( GarbageCollectorMXBean b : ManagementFactory . getGarbageCollectorMXBeans ( ) ) { context . registerMetric ( ( "GC//" + ( b . getName ( ) . replaceAll ( "\\W" , "" ) ) ) , new SystemBolt . GarbageCollectorMetric ( b ) , bucketSize ) ; } } @ Override public void execute ( Tuple input ) { } @ Override public void cleanup ( ) { } }

Fix:
if ( ( SystemBolt . _prepareWasCalled ) && ( ! ( "local" . equals ( stormConf . get ( STORM_CLUSTER_MODE ) ) ) ) ) {
Buggy code:
public class TestGalicianMinimalStemFilter extends BaseTokenStreamTestCase { Analyzer a = new Analyzer ( ) { @ Override protected TokenStreamComponents createComponents ( String fieldName , Reader reader ) { } } ; public void testPlural ( ) throws Exception { } public void testExceptions ( ) throws Exception { } public void testRandomStrings ( ) throws Exception { <START_BUG> checkRandomData ( random ( ) , a , ( 10000 * ( RANDOM_MULTIPLIER ) ) ) ; <END_BUG> } public void testEmptyTerm ( ) throws IOException { } }

Fix:
checkRandomData ( random ( ) , a , ( 1000 * ( RANDOM_MULTIPLIER ) ) ) ;
Buggy code:
public class DeploymentAddHandler implements OperationStepHandler { public static final String OPERATION_NAME = ADD ; protected final ContentRepository contentRepository ; private final AbstractVaultReader vaultReader ; protected DeploymentAddHandler ( final ContentRepository contentRepository , final AbstractVaultReader vaultReader ) { } public static DeploymentAddHandler create ( final ContentRepository contentRepository , final AbstractVaultReader vaultReader ) { } public void execute ( OperationContext context , ModelNode operation ) throws OperationFailedException { final Resource resource = context . createResource ( EMPTY_ADDRESS ) ; ModelNode newModel = resource . getModel ( ) ; if ( ! ( operation . hasDefined ( PERSISTENT . getName ( ) ) ) ) { operation . get ( PERSISTENT . getName ( ) ) . set ( true ) ; } PERSISTENT . validateAndSet ( operation , newModel ) ; for ( AttributeDefinition def : SERVER_ADD_ATTRIBUTES ) { if ( ! ( def . getName ( ) . equals ( CONTENT_ALL . getName ( ) ) ) ) { def . validateAndSet ( operation , newModel ) ; } else { def . validateOperation ( operation ) ; } } ModelNode content = operation . require ( CONTENT_ALL . getName ( ) ) ; ModelNode contentItemNode = content . require ( 0 ) ; final ModelNode opAddr = operation . get ( OP_ADDR ) ; PathAddress address = PathAddress . pathAddress ( opAddr ) ; final String name = address . getLastElement ( ) . getValue ( ) ; final String runtimeName = ( operation . hasDefined ( RUNTIME_NAME . getName ( ) ) ) ? operation . get ( RUNTIME_NAME . getName ( ) ) . asString ( ) : name ; newModel . get ( RUNTIME_NAME . getName ( ) ) . set ( runtimeName ) ; final DeploymentHandlerUtil . ContentItem contentItem ; if ( contentItemNode . hasDefined ( CONTENT_HASH . getName ( ) ) ) { byte [ ] hash = contentItemNode . require ( CONTENT_HASH . getName ( ) ) . asBytes ( ) ; contentItem = addFromHash ( hash , name , context ) ; } else if ( DeploymentHandlerUtils . hasValidContentAdditionParameterDefined ( contentItemNode ) ) { contentItem = addFromContentAdditionParameter ( context , contentItemNode ) ; contentItemNode = new ModelNode ( ) ; contentItemNode . get ( CONTENT_HASH . getName ( ) ) . set ( contentItem . getHash ( ) ) ; content = new ModelNode ( ) ; content . add ( contentItemNode ) ; } else { contentItem = addUnmanaged ( contentItemNode ) ; } newModel . get ( CONTENT_ALL . getName ( ) ) . set ( content ) ; if ( ( ENABLED . resolveModelAttribute ( context , newModel ) . asBoolean ( ) ) && ( context . isNormalServer ( ) ) ) { DeploymentHandlerUtil . deploy ( context , runtimeName , name , vaultReader , contentItem ) ; } <START_BUG> context . completeStep ( ) ; <END_BUG> } ContentItem addFromHash ( byte [ ] hash , String deploymentName , OperationContext context ) throws OperationFailedException { } ContentItem addFromContentAdditionParameter ( OperationContext context , ModelNode contentItemNode ) throws OperationFailedException { } ContentItem addUnmanaged ( ModelNode contentItemNode ) throws OperationFailedException { } }

Fix:
context . stepCompleted ( ) ;
Buggy code:
public class WorkbenchPreferenceDialog extends PreferenceDialog { private static final int LOAD_ID = ( IDialogConstants . CLIENT_ID ) + 1 ; private static final String LOAD_SETTING = "WorkbenchPreferenceDialog.load" ; private static final int SAVE_ID = ( IDialogConstants . CLIENT_ID ) + 2 ; private static final String SAVE_SETTING = "WorkbenchPreferenceDialog.save" ; private static final String PREFERENCE_EXT = "epf" ; private static final String [ ] DIALOG_PREFERENCE_EXTENSIONS = new String [ ] { "*." + ( WorkbenchPreferenceDialog . PREFERENCE_EXT ) , "*.*" } ; public WorkbenchPreferenceDialog ( Shell parentShell , PreferenceManager manager ) { } protected void buttonPressed ( int buttonId ) { } protected void createButtonsForButtonBar ( Composite parent ) { } protected void loadPressed ( ) { } protected void savePressed ( ) { } protected void createTreeItemFor ( Widget parent , IPreferenceNode node ) { <START_BUG> IObjectActivityManager prefManager = WorkbenchPlugin . getDefault ( ) . getWorkbench ( ) . getActivityManager ( PL_PREFERENCES , false ) ; <END_BUG> if ( prefManager != null ) { Collection activePages = prefManager . getActiveObjects ( ) ; if ( ( node instanceof WorkbenchPreferenceNode ) && ( ! ( activePages . contains ( node ) ) ) ) { return ; } } super . createTreeItemFor ( parent , node ) ; } }

Fix:
IObjectActivityManager prefManager = WorkbenchPlugin . getDefault ( ) . getWorkbench ( ) . getObjectActivityManager ( PL_PREFERENCES , false ) ;
Buggy code:
final class OS2BMPFileFormat extends FileFormat { static final int BMPFileHeaderSize = 14 ; static final int BMPHeaderFixedSize = 12 ; int width ; int height ; int bitCount ; boolean isFileFormat ( LEDataInputStream stream ) { } byte [ ] loadData ( byte [ ] infoHeader ) { } byte [ ] loadData ( byte [ ] infoHeader , int stride ) { } int [ ] loadFileHeader ( ) { } ImageData [ ] loadFromByteStream ( ) { int [ ] fileHeader = loadFileHeader ( ) ; byte [ ] infoHeader = new byte [ OS2BMPFileFormat . BMPHeaderFixedSize ] ; try { inputStream . read ( infoHeader ) ; } catch ( Exception e ) { SWT . error ( ERROR_IO , e ) ; } width = ( ( infoHeader [ 4 ] ) & 255 ) | ( ( ( infoHeader [ 5 ] ) & 255 ) << 8 ) ; height = ( ( infoHeader [ 6 ] ) & 255 ) | ( ( ( infoHeader [ 7 ] ) & 255 ) << 8 ) ; bitCount = ( ( infoHeader [ 10 ] ) & 255 ) | ( ( ( infoHeader [ 11 ] ) & 255 ) << 8 ) ; PaletteData palette = loadPalette ( infoHeader ) ; if ( ( inputStream . getPosition ( ) ) < ( fileHeader [ 4 ] ) ) { try { inputStream . skip ( ( ( fileHeader [ 4 ] ) - ( inputStream . getPosition ( ) ) ) ) ; } catch ( IOException e ) { SWT . error ( ERROR_IO , e ) ; } } byte [ ] data = loadData ( infoHeader ) ; <START_BUG> int type = SWT . IMAGE_BMP_OS2 ; <END_BUG> return new ImageData [ ] { ImageData . internal_new ( width , height , bitCount , palette , 4 , data , 0 , null , null , ( - 1 ) , ( - 1 ) , type , 0 , 0 , 0 , 0 ) } ; } PaletteData loadPalette ( byte [ ] infoHeader ) { } PaletteData paletteFromBytes ( byte [ ] bytes , int numColors ) { } static byte [ ] paletteToBytes ( PaletteData pal ) { } int unloadData ( ImageData image , OutputStream out ) { } void unloadIntoByteStream ( ImageData image ) { } void flipScanLines ( byte [ ] data , int stride , int height ) { } }

Fix:
int type = SWT . IMAGE_OS2_BMP ;
Buggy code:
public class StreamReplyVerbHandler implements IVerbHandler { private static Logger logger = LoggerFactory . getLogger ( StreamReplyVerbHandler . class ) ; public void doVerb ( Message message ) { byte [ ] body = message . getMessageBody ( ) ; ByteArrayInputStream bufIn = new ByteArrayInputStream ( body ) ; try { <START_BUG> StreamReply reply = serializer . deserialize ( new DataInputStream ( bufIn ) ) ; <END_BUG> StreamReplyVerbHandler . logger . debug ( "Received<seq2seq4repair_space>StreamReply<seq2seq4repair_space>{}" , reply ) ; StreamOutSession session = StreamOutSession . get ( message . getFrom ( ) , reply . sessionId ) ; switch ( reply . action ) { case FILE_FINISHED : session . validateCurrentFile ( reply . file ) ; session . startNext ( ) ; break ; case FILE_RETRY : session . validateCurrentFile ( reply . file ) ; StreamReplyVerbHandler . logger . info ( "Need<seq2seq4repair_space>to<seq2seq4repair_space>re-stream<seq2seq4repair_space>file<seq2seq4repair_space>{}<seq2seq4repair_space>to<seq2seq4repair_space>{}" , reply . file , message . getFrom ( ) ) ; session . retry ( ) ; break ; case SESSION_FINISHED : session . close ( ) ; break ; default : throw new RuntimeException ( ( "Cannot<seq2seq4repair_space>handle<seq2seq4repair_space>FileStatus.Action:<seq2seq4repair_space>" + ( reply . action ) ) ) ; } } catch ( IOException ex ) { throw new IOError ( ex ) ; } } }

Fix:
StreamReply reply = serializer . deserialize ( new DataInputStream ( bufIn ) , message . getVersion ( ) ) ;
Buggy code:
public class StaleAsyncRequestCheckingCallable extends AbstractDelegatingCallable { private final AsyncWebRequest asyncWebRequest ; public StaleAsyncRequestCheckingCallable ( AsyncWebRequest asyncWebRequest ) { } public Object call ( ) throws Exception { Object result = getNextCallable ( ) . call ( ) ; if ( this . asyncWebRequest . isAsyncCompleted ( ) ) { <START_BUG> throw new StaleAsyncWebRequestException ( "Async<seq2seq4repair_space>request<seq2seq4repair_space>no<seq2seq4repair_space>longer<seq2seq4repair_space>available<seq2seq4repair_space>due<seq2seq4repair_space>to<seq2seq4repair_space>a<seq2seq4repair_space>timed<seq2seq4repair_space>out<seq2seq4repair_space>or<seq2seq4repair_space>a<seq2seq4repair_space>(client)<seq2seq4repair_space>error" ) ; <END_BUG> } return result ; } }

Fix:
throw new StaleAsyncWebRequestException ( "Async<seq2seq4repair_space>request<seq2seq4repair_space>no<seq2seq4repair_space>longer<seq2seq4repair_space>available<seq2seq4repair_space>due<seq2seq4repair_space>to<seq2seq4repair_space>a<seq2seq4repair_space>timeout<seq2seq4repair_space>or<seq2seq4repair_space>a<seq2seq4repair_space>(client)<seq2seq4repair_space>error" ) ;
Buggy code:
public class Java extends Task { private CommandlineJava cmdl = new CommandlineJava ( ) ; private boolean fork = false ; private File dir = null ; private PrintStream outStream = null ; private boolean failOnError = false ; private File out ; public void setClassname ( String s ) throws TaskException { } public void setClasspath ( Path s ) throws TaskException { } public void setClasspathRef ( Reference r ) throws TaskException { } public void setDir ( File d ) { } public void setFailonerror ( boolean fail ) { } public void setFork ( boolean s ) { } public void setJVMVersion ( String value ) { } public void setJar ( File jarfile ) throws TaskException { } public void setJvm ( String s ) { } public void setMaxmemory ( String max ) { } public void setOutput ( File out ) { } public void addSysproperty ( Environment . Variable sysp ) { } public void clearArgs ( ) { } public Argument createArg ( ) { } public Path createClasspath ( ) throws TaskException { } public Argument createJvmarg ( ) { } public void execute ( ) throws TaskException { } public int executeJava ( ) throws TaskException { } protected void handleErrorOutput ( String line ) { } protected void handleOutput ( String line ) { } protected void run ( String classname , Vector args ) throws TaskException { } private void run ( CommandlineJava command ) throws TaskException { } private int run ( String [ ] command ) throws TaskException { FileOutputStream fos = null ; try { Execute exe = null ; if ( ( out ) == null ) { exe = new Execute ( new LogStreamHandler ( this , Project . MSG_INFO , Project . MSG_WARN ) , null ) ; } else { fos = new FileOutputStream ( out ) ; exe = new Execute ( new PumpStreamHandler ( fos ) , null ) ; } exe . setAntRun ( project ) ; if ( ( dir ) == null ) { <START_BUG> dir = project . getBaseDir ( ) ; <END_BUG> } else if ( ( ! ( dir . exists ( ) ) ) || ( ! ( dir . isDirectory ( ) ) ) ) { throw new TaskException ( ( ( dir . getAbsolutePath ( ) ) + "<seq2seq4repair_space>is<seq2seq4repair_space>not<seq2seq4repair_space>a<seq2seq4repair_space>valid<seq2seq4repair_space>directory" ) ) ; } exe . setWorkingDirectory ( dir ) ; exe . setCommandline ( command ) ; try { return exe . execute ( ) ; } catch ( IOException e ) { throw new TaskException ( "Error" , e ) ; } } catch ( IOException io ) { throw new TaskException ( "Error" , io ) ; } finally { if ( fos != null ) { try { fos . close ( ) ; } catch ( IOException io ) { } } } } }

Fix:
dir = getBaseDirectory ( ) ;
Buggy code:
public class AccountManager { SharedPreferences sharedPreferences ; public AccountManager ( SharedPreferences sharedPreferences ) { } public String getAuthToken ( ) { <START_BUG> return "9b8a0a84943c098e82737227e9f1f1960a406f6f" ; <END_BUG> } public boolean isLoggedIn ( ) { } public void clearLogin ( ) { } public boolean isCheckedIn ( ) { } public void setCheckedIn ( int pk ) { } public int getCheckedInEventId ( ) { } public void clearCheckin ( ) { } public RequestInterceptor getAuthTokenInterceptor ( ) { } }

Fix:
return sharedPreferences . getString ( TOKEN , "" ) ;
Buggy code:
public class ShipTest { @ Test public void testFire ( ) throws Exception { ShipType shipType1 = new ShipType ( "meet" , 1 , 1 , 1 ) ; ShipType shipType2 = new ShipType ( "shield4" , 1 , 1 , 4 ) ; Race race1 = new Race ( 1 , "Race1" ) ; Race race2 = new Race ( 2 , "Race2" ) ; Ship ship = new Ship ( race1 , shipType1 ) ; Ship shipEnemy = new Ship ( race2 , shipType2 ) ; <START_BUG> Shot shot = ship . fire ( shipEnemy , 1 ) ; <END_BUG> System . out . println ( shot . toString ( ) ) ; } No newline ; at end ; of file ; }

Fix:
Shot shot = ship . fire ( shipEnemy ) ;
Buggy code:
public class PropertiesViewW extends PropertiesView implements RequiresResize , SetLabels { private FlowPanel wrappedPanel ; private OptionsDefaultsW defaultsPanel ; private OptionsEuclidianW euclidianPanel ; private OptionsEuclidianW euclidianPanel2 ; private OptionsEuclidianW euclidianPanel3D ; private OptionsSpreadsheetW spreadsheetPanel ; private OptionsCASW casPanel ; private OptionsAdvancedW advancedPanel ; private OptionsLayoutW layoutPanel ; private OptionPanelW optionPanel ; private PropertiesStyleBarW styleBar ; private FlowPanel mainPanel ; private Label notImplemented ; private FlowPanel contentsPanel ; private OptionType optionType ; public PropertiesViewW ( AppW app ) { } public void initGUI ( ) { } public PropertiesStyleBarW getStyleBar ( ) { } protected PropertiesStyleBarW newPropertiesStyleBar ( ) { <START_BUG> return new PropertiesStyleBarW ( this , ( ( AppW ) ( app ) ) ) ; <END_BUG> } public OptionPanelW getOptionPanel ( OptionType type , int subType ) { } private OptionsObjectW getObjectPanel ( ) { } public void add ( GeoElement geo ) { } public void remove ( GeoElement geo ) { } public void rename ( GeoElement geo ) { } public void update ( GeoElement geo ) { } public void updateVisualStyle ( GeoElement geo ) { } public void updateAuxiliaryObject ( GeoElement geo ) { } public void repaintView ( ) { } public void reset ( ) { } public void clearView ( ) { } public void setMode ( int mode , ModeSetter m ) { } public int getViewID ( ) { } public boolean hasFocus ( ) { } @ Override public void updateSelection ( ) { } @ Override public void setOptionPanel ( OptionType type ) { } @ Override public void setOptionPanel ( OptionType type , int subType ) { } @ Override public void mousePressedForPropertiesView ( ) { } @ Override public void updateSelection ( ArrayList < GeoElement > geos ) { } private void updatePropertiesGUI ( ) { } @ Override protected void updateTitleBar ( ) { } @ Override public void attachView ( ) { } @ Override public void detachView ( ) { } @ Override public void updatePropertiesView ( ) { } public void repaint ( ) { } public boolean isShowing ( ) { } public Widget getWrappedPanel ( ) { } public void updateFonts ( ) { } public void onResize ( ) { } public boolean suggestRepaint ( ) { } @ Override public void setLabels ( ) { } }

Fix:
return new PropertiesStyleBarW ( this , app ) ;
Buggy code:
class UserTransactionRollbackTask extends UserTransactionManagementTask { UserTransactionRollbackTask ( final TransactionRequestHandler transactionRequestHandler , final EJBRemoteTransactionsRepository transactionsRepository , final MarshallerFactory marshallerFactory , final UserTransactionID userTransactionID , final ChannelAssociation channelAssociation , final short invocationId ) { } @ Override protected void manageTransaction ( ) throws Throwable { <START_BUG> final Transaction transaction = this . transactionsRepository . removeTransaction ( this . userTransactionID ) ; <END_BUG> if ( transaction != null ) { this . resumeTransaction ( transaction ) ; this . transactionsRepository . getTransactionManager ( ) . rollback ( ) ; } else if ( EJB3_INVOCATION_LOGGER . isDebugEnabled ( ) ) { EJB3_INVOCATION_LOGGER . debug ( ( ( "Not<seq2seq4repair_space>rolling<seq2seq4repair_space>back<seq2seq4repair_space>transaction<seq2seq4repair_space>" + ( this . userTransactionID ) ) + "<seq2seq4repair_space>as<seq2seq4repair_space>is<seq2seq4repair_space>was<seq2seq4repair_space>not<seq2seq4repair_space>found<seq2seq4repair_space>on<seq2seq4repair_space>the<seq2seq4repair_space>server" ) ) ; } } }

Fix:
final Transaction transaction = this . transactionsRepository . removeUserTransaction ( this . userTransactionID ) ;
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 = 2646822752226280048L ; private Exception exception ; ConfigurationError ( String msg , Exception x ) { } Exception getException ( ) { } } }

Fix:
final int lastDot = className . lastIndexOf ( '.' ) ;
Buggy code:
public class SyncResponse { protected HttpResponse response ; public SyncResponse ( ) { } public SyncResponse ( HttpResponse res ) { } public HttpResponse httpResponse ( ) { } public int getStatusCode ( ) { } public boolean wasSuccessful ( ) { } public String body ( ) throws IOException , IllegalStateException { } public Object jsonBody ( ) throws IOException , IllegalStateException , ParseException { } public ExtendedJSONObject jsonObjectBody ( ) throws IOException , IllegalStateException , ParseException , NonObjectJSONException { } private boolean hasHeader ( String h ) { } private int getIntegerHeader ( String h ) { if ( this . hasHeader ( h ) ) { <START_BUG> Header header = this . response . getFirstHeader ( "retry-after" ) ; <END_BUG> return Integer . parseInt ( header . getValue ( ) , 10 ) ; } return - 1 ; } public int retryAfter ( ) throws NumberFormatException { } public int weaveBackoff ( ) throws NumberFormatException { } public int weaveTimestamp ( ) throws NumberFormatException { } public int weaveRecords ( ) throws NumberFormatException { } public int weaveQuotaRemaining ( ) throws NumberFormatException { } public String weaveAlert ( ) { } No newline ; at end ; of file ; }

Fix:
Header header = this . response . getFirstHeader ( h ) ;
Buggy code:
public interface TransferExecutor { <START_BUG> void execute ( Transfer transfer ) ; <END_BUG> }

Fix:
Void execute ( Transfer transfer ) ;
Buggy code:
public class Button extends Control { String text = "" ; String message = "" ; Image image ; Image image2 ; Image disabledImage ; ImageList imageList ; boolean ignoreMouse ; static final int MARGIN = 4 ; static final int CHECK_WIDTH ; static final int CHECK_HEIGHT ; static final int ICON_WIDTH = 128 ; static final int ICON_HEIGHT = 128 ; static final boolean COMMAND_LINK = false ; static final int ButtonProc ; static final TCHAR ButtonClass = new TCHAR ( 0 , "BUTTON" , true ) ; public Button ( Composite parent , int style ) { } void _setImage ( Image image ) { } void _setText ( String text ) { } public void addSelectionListener ( SelectionListener listener ) { } int callWindowProc ( int hwnd , int msg , int wParam , int lParam ) { } static int checkStyle ( int style ) { } void click ( ) { } int computeLeftMargin ( ) { } public Point computeSize ( int wHint , int hHint , boolean changed ) { } void createHandle ( ) { } int defaultBackground ( ) { } int defaultForeground ( ) { } void enableWidget ( boolean enabled ) { } public int getAlignment ( ) { } boolean getDefault ( ) { } public Image getImage ( ) { } String getMessage ( ) { } String getNameText ( ) { } public boolean getSelection ( ) { } public String getText ( ) { } boolean isTabItem ( ) { } boolean mnemonicHit ( char ch ) { } boolean mnemonicMatch ( char key ) { } void releaseWidget ( ) { } public void removeSelectionListener ( SelectionListener listener ) { } void selectRadio ( ) { } public void setAlignment ( int alignment ) { } void setDefault ( boolean value ) { } boolean setFixedFocus ( ) { } public void setImage ( Image image ) { } void setMessage ( String message ) { } boolean setRadioFocus ( ) { } boolean setRadioSelection ( boolean value ) { } boolean setSavedFocus ( ) { } public void setSelection ( boolean selected ) { } public void setText ( String string ) { } int widgetStyle ( ) { } TCHAR windowClass ( ) { } int windowProc ( ) { } LRESULT WM_ERASEBKGND ( int wParam , int lParam ) { } LRESULT WM_GETDLGCODE ( int wParam , int lParam ) { } LRESULT WM_KILLFOCUS ( int wParam , int lParam ) { } LRESULT WM_LBUTTONDOWN ( int wParam , int lParam ) { } LRESULT WM_LBUTTONUP ( int wParam , int lParam ) { } LRESULT WM_SETFOCUS ( int wParam , int lParam ) { } LRESULT WM_SIZE ( int wParam , int lParam ) { } LRESULT WM_SYSCOLORCHANGE ( int wParam , int lParam ) { } LRESULT WM_UPDATEUISTATE ( int wParam , int lParam ) { } LRESULT wmCommandChild ( int wParam , int lParam ) { <START_BUG> int code = wParam > > 16 ; <END_BUG> switch ( code ) { case OS . BN_CLICKED : case OS . BN_DOUBLECLICKED : if ( ( ( style ) & ( ( SWT . CHECK ) | ( SWT . TOGGLE ) ) ) != 0 ) { setSelection ( ( ! ( getSelection ( ) ) ) ) ; } else { if ( ( ( style ) & ( SWT . RADIO ) ) != 0 ) { if ( ( ( parent . getStyle ( ) ) & ( SWT . NO_RADIO_GROUP ) ) != 0 ) { setSelection ( ( ! ( getSelection ( ) ) ) ) ; } else { selectRadio ( ) ; } } } postEvent ( Selection ) ; } return super . wmCommandChild ( wParam , lParam ) ; } LRESULT wmColorChild ( int wParam , int lParam ) { } LRESULT wmDrawChild ( int wParam , int lParam ) { } }

Fix:
int code = OS . HIWORD ( wParam ) ;
Buggy code:
public class SelectionOnMessageSend extends MessageSend { private MethodBinding findNonDefaultAbstractMethod ( MethodBinding methodBinding ) { ReferenceBinding [ ] itsInterfaces = methodBinding . declaringClass . superInterfaces ( ) ; if ( itsInterfaces != ( Binding . NO_SUPERINTERFACES ) ) { ReferenceBinding [ ] [ ] interfacesToVisit = new ReferenceBinding [ 5 ] [ ] ; int lastPosition = 0 ; interfacesToVisit [ lastPosition ] = itsInterfaces ; <START_BUG> org . eclipse . jdt . internal . core . util . SimpleSet interfacesSeen = new org . eclipse . jdt . internal . core . util . SimpleSet ( ( ( itsInterfaces . length ) * 2 ) ) ; <END_BUG> for ( int i = 0 ; i <= lastPosition ; i ++ ) { ReferenceBinding [ ] interfaces = interfacesToVisit [ i ] ; for ( int j = 0 , length = interfaces . length ; j < length ; j ++ ) { ReferenceBinding currentType = interfaces [ j ] ; if ( ! ( interfacesSeen . includes ( currentType ) ) ) { interfacesSeen . add ( currentType ) ; MethodBinding [ ] methods = currentType . getMethods ( methodBinding . selector ) ; if ( methods != null ) { for ( int k = 0 ; k < ( methods . length ) ; k ++ ) { if ( methodBinding . areParametersEqual ( methods [ k ] ) ) { return methods [ k ] ; } } } itsInterfaces = currentType . superInterfaces ( ) ; if ( itsInterfaces != ( Binding . NO_SUPERINTERFACES ) ) { if ( ( ++ lastPosition ) == ( interfacesToVisit . length ) ) System . arraycopy ( interfacesToVisit , 0 , ( interfacesToVisit = new ReferenceBinding [ lastPosition * 2 ] [ ] ) , 0 , lastPosition ) ; interfacesToVisit [ lastPosition ] = itsInterfaces ; } } } } } return methodBinding ; } public StringBuffer printExpression ( int indent , StringBuffer output ) { } public TypeBinding resolveType ( BlockScope scope ) { } }

Fix:
SimpleSet interfacesSeen = new SimpleSet ( ( ( itsInterfaces . length ) * 2 ) ) ;
Buggy code:
public class ExecutorUtil { public static Logger log = LoggerFactory . getLogger ( ExecutorUtil . class ) ; public static void shutdownNowAndAwaitTermination ( ExecutorService pool ) { } public static void shutdownAndAwaitTermination ( ExecutorService pool ) { pool . shutdown ( ) ; boolean shutdown = false ; while ( ! shutdown ) { try { <START_BUG> shutdown = pool . awaitTermination ( 30 , TimeUnit . SECONDS ) ; <END_BUG> } catch ( InterruptedException ie ) { Thread . currentThread ( ) . interrupt ( ) ; } if ( ! shutdown ) { pool . shutdownNow ( ) ; } } } }

Fix:
shutdown = pool . awaitTermination ( 60 , TimeUnit . SECONDS ) ;
Buggy code:
public class UserTest extends TokenTest { public UserApi userApi ; public MediaApi mediaApi ; @ Before public void init ( ) { } @ Test public void create ( ) throws WeixinException { } @ Test public void batchUpload ( ) throws WeixinException { } @ Test public void update ( ) throws WeixinException { } @ Test public void get ( ) throws WeixinException { <START_BUG> User user = userApi . getUser ( "u001" ) ; <END_BUG> Assert . assertTrue ( ( user != null ) ) ; System . out . println ( user ) ; } @ Test public void list ( ) throws WeixinException { } @ Test public void delete ( ) throws WeixinException { } @ Test public void invite ( ) throws WeixinException { } @ Test public void convert ( ) throws WeixinException { } }

Fix:
User user = userApi . getUser ( "jinyu" ) ;
Buggy code:
public class StandardServletAsyncWebRequestTests { private StandardServletAsyncWebRequest asyncRequest ; private MockHttpServletRequest request ; private MockHttpServletResponse response ; @ Before public void setup ( ) { } @ Test public void isAsyncStarted ( ) throws Exception { } @ Test public void startAsync ( ) throws Exception { } @ Test public void startAsyncMultipleTimes ( ) throws Exception { } @ Test public void startAsyncNotSupported ( ) throws Exception { } @ Test public void startAsyncAfterCompleted ( ) throws Exception { } @ Test public void onTimeoutDefaultBehavior ( ) throws Exception { } @ Test public void onTimeoutTimeoutHandler ( ) throws Exception { Runnable timeoutHandler = EasyMock . createMock ( Runnable . class ) ; timeoutHandler . run ( ) ; replay ( timeoutHandler ) ; <START_BUG> this . asyncRequest . setTimeoutHandler ( timeoutHandler ) ; <END_BUG> this . asyncRequest . onTimeout ( new AsyncEvent ( null ) ) ; verify ( timeoutHandler ) ; } @ Test ( expected = IllegalStateException . class ) public void setTimeoutDuringConcurrentHandling ( ) { } }

Fix:
this . asyncRequest . addTimeoutHandler ( timeoutHandler ) ;
Buggy code:
public class CoreferenceTest { @ Test public void demo ( ) throws Exception { TSVReader reader = new TSVReader ( 0 , 1 , 2 , 3 , 4 , 5 , 6 , 7 ) ; reader . open ( new FileInputStream ( "src//test//resources//arith-qs.ak.cnlp" ) ) ; List < DEPTree > trees = new ArrayList < > ( ) ; DEPTree tree ; while ( ( tree = reader . next ( ) ) != null ) trees . add ( tree ) ; AbstractCoreferenceResolution coref = new EnglishCoreferenceResolution ( ) ; Pair < List < Mention > , DisjointSet > entities = coref . getEntities ( trees ) ; List < Mention > mentions = entities . o1 ; DisjointSet set = entities . o2 ; for ( int i = 0 ; i < ( mentions . size ( ) ) ; i ++ ) <START_BUG> System . out . println ( ( ( i + ":<seq2seq4repair_space>" ) + ( mentions . get ( i ) . getNode ( ) . getWordForm ( ) ) ) ) ; <END_BUG> for ( int i = 0 ; i < ( ( mentions . size ( ) ) - 1 ) ; i ++ ) for ( int j = i + 1 ; j < ( mentions . size ( ) ) ; j ++ ) System . out . println ( ( ( ( ( ( "(" + i ) + "," ) + j ) + ")<seq2seq4repair_space>" ) + ( set . inSameSet ( i , j ) ) ) ) ; } }

Fix:
System . out . println ( ( ( ( ( ( ( i + ":<seq2seq4repair_space>" ) + ( mentions . get ( i ) . getNode ( ) . getWordForm ( ) ) ) + "<seq2seq4repair_space>" ) + ( mentions . get ( i ) . getEntityType ( ) ) ) + "<seq2seq4repair_space>" ) + ( mentions . get ( i ) . getNumberType ( ) ) ) ) ;
Buggy code:
public class TextImpl extends CharacterDataImpl implements CharacterData , Text { static final long serialVersionUID = - 5294980852957403469L ; public TextImpl ( DocumentImpl ownerDoc , String data ) { } public short getNodeType ( ) { } public String getNodeName ( ) { } public void setIgnorableWhitespace ( boolean ignore ) { } public boolean isIgnorableWhitespace ( ) { } public Text splitText ( int offset ) throws DOMException { if ( isReadOnly ( ) ) { throw new DOMException ( DOMException . NO_MODIFICATION_ALLOWED_ERR , "DOM001<seq2seq4repair_space>Modification<seq2seq4repair_space>not<seq2seq4repair_space>allowed" ) ; } if ( needsSyncData ( ) ) { synchronizeData ( ) ; } <START_BUG> if ( ( offset < 0 ) || ( offset > ( ( data . length ( ) ) - 1 ) ) ) { <END_BUG> throw new DOMException ( DOMException . INDEX_SIZE_ERR , "DOM004<seq2seq4repair_space>Index<seq2seq4repair_space>out<seq2seq4repair_space>of<seq2seq4repair_space>bounds" ) ; } Text newText = getOwnerDocument ( ) . createTextNode ( data . substring ( offset ) ) ; setNodeValue ( data . substring ( 0 , offset ) ) ; Node parentNode = getParentNode ( ) ; if ( parentNode != null ) { parentNode . insertBefore ( newText , nextSibling ) ; } return newText ; } }

Fix:
if ( ( offset < 0 ) || ( offset > ( data . length ( ) ) ) ) {
Buggy code:
public abstract class AbstractKeyAnalyzer < K > implements KeyAnalyzer < K > { private static final long serialVersionUID = - 20497563720380683L ; @ SuppressWarnings ( "unchecked" ) public int compare ( final K o1 , final K o2 ) { if ( o1 == null ) { return o2 == null ? 0 : - 1 ; } else if ( o2 == null ) { <START_BUG> return o1 == null ? 0 : 1 ; <END_BUG> } return ( ( Comparable < K > ) ( o1 ) ) . compareTo ( o2 ) ; } static boolean isOutOfBoundsIndex ( final int bitIndex ) { } static boolean isEqualBitKey ( final int bitIndex ) { } static boolean isNullBitKey ( final int bitIndex ) { } static boolean isValidBitIndex ( final int bitIndex ) { } }

Fix:
return 1 ;
Buggy code:
public class Device { String color ; String id ; String name ; Integer state ; Date lastUpdate ; public Device ( String id ) { } public Device ( String id , String name ) { } public void setState ( Integer state ) { this . state = state ; this . color = "black" ; if ( this . state . equals ( 1 ) ) this . color = "green" ; <START_BUG> if ( this . state . equals ( 2 ) ) <END_BUG> this . color = "red" ; } public String getColor ( ) { } public String getId ( ) { } public String getName ( ) { } public Integer getState ( ) { } public Date getLastUpdate ( ) { } @ Override public boolean equals ( Object o ) { } @ Override public int hashCode ( ) { } No newline ; at end ; of file ; }

Fix:
if ( this . state . equals ( 0 ) )
Buggy code:
public class PrefixFileFilter extends AbstractFileFilter implements Serializable { private final String [ ] prefixes ; private final IOCase caseSensitivity ; public PrefixFileFilter ( String prefix ) { } public PrefixFileFilter ( String prefix , IOCase caseSensitivity ) { } public PrefixFileFilter ( String [ ] prefixes ) { } public PrefixFileFilter ( String [ ] prefixes , IOCase caseSensitivity ) { } public PrefixFileFilter ( List < String > prefixes ) { } public PrefixFileFilter ( List < String > prefixes , IOCase caseSensitivity ) { } public boolean accept ( File file ) { } public boolean accept ( File file , String name ) { } public String toString ( ) { <START_BUG> StringBuffer buffer = new StringBuffer ( ) ; <END_BUG> buffer . append ( super . toString ( ) ) ; buffer . append ( "(" ) ; if ( ( prefixes ) != null ) { for ( int i = 0 ; i < ( prefixes . length ) ; i ++ ) { if ( i > 0 ) { buffer . append ( "," ) ; } buffer . append ( prefixes [ i ] ) ; } } buffer . append ( ")" ) ; return buffer . toString ( ) ; } }

Fix:
StringBuilder buffer = new StringBuilder ( ) ;
Buggy code:
public class TabTwoFragment extends Fragment { Context mContext ; Resources mResources ; DBUtils mDBUtils ; String mTwitterDataString ; ListView mTwitterListView ; TwitterArrayAdapter mTwitterArrayAdapter ; boolean mUpdate = false ; ArrayList < TwitterStatus > mTwitterStatus = new ArrayList < TwitterStatus > ( ) ; SharedPreferences mSharedPreferences ; ActionBar mActionBar ; @ Override public View onCreateView ( LayoutInflater inflater , ViewGroup container , Bundle savedInstanceState ) { } @ Override public void onCreateOptionsMenu ( Menu menu , MenuInflater inflater ) { } @ Override public boolean onOptionsItemSelected ( MenuItem item ) { } @ Override public void onCreate ( Bundle savedInstanceState ) { } public void setupList ( ) { } public void initiateRefresh ( boolean manualRefresh ) { try { if ( ! ( mDBUtils . getData ( TWITTER_TYPE ) . isEmpty ( ) ) ) { if ( manualRefresh ) { Log . i ( "MANUAL<seq2seq4repair_space>REFRESH" , ( "" + manualRefresh ) ) ; checkNetworkTwitter ( ) ; <START_BUG> } <END_BUG> if ( ! ( GeoUtils . compareTime ( Long . parseLong ( mSharedPreferences . getString ( CACHE_TIME , null ) ) , Long . parseLong ( mDBUtils . getDateColumn ( TWITTER_TYPE ) ) ) ) ) { mUpdate = false ; Log . i ( "posts<seq2seq4repair_space>found" , "using<seq2seq4repair_space>db<seq2seq4repair_space>version" ) ; mTwitterDataString = mDBUtils . getData ( TWITTER_TYPE ) ; setupList ( ) ; } else { mUpdate = true ; Log . i ( "refreshing<seq2seq4repair_space>db" , "db<seq2seq4repair_space>refresh" ) ; checkNetworkTwitter ( ) ; } } else { checkNetworkTwitter ( ) ; } } catch ( SQLiteException ex ) { checkNetworkTwitter ( ) ; } } public void checkNetworkTwitter ( ) { } public void getTwitterActivities ( ) { } private class GetTwitterTask extends AsyncTask < Context , String , List < Status > > { @ Override protected List < Status > doInBackground ( Context ... context ) { } public List < Status > getTwitterPosts ( ) { } protected void onPostExecute ( List < Status > statuses ) { } } }

Fix:
} else
Buggy code:
public class CanopyDriver { private CanopyDriver ( ) { } public static void main ( String [ ] args ) throws IOException { } public static void runJob ( String input , String output , String measureClassName , double t1 , double t2 ) throws IOException { JobClient client = new JobClient ( ) ; JobConf conf = new JobConf ( CanopyDriver . class ) ; conf . set ( DISTANCE_MEASURE_KEY , measureClassName ) ; conf . set ( T1_KEY , String . valueOf ( t1 ) ) ; conf . set ( T2_KEY , String . valueOf ( t2 ) ) ; conf . setOutputKeyClass ( Text . class ) ; conf . setOutputValueClass ( Text . class ) ; FileInputFormat . setInputPaths ( conf , new Path ( input ) ) ; Path outPath = new Path ( output ) ; FileOutputFormat . setOutputPath ( conf , outPath ) ; conf . setMapperClass ( CanopyMapper . class ) ; conf . setCombinerClass ( CanopyCombiner . class ) ; conf . setReducerClass ( CanopyReducer . class ) ; conf . setNumReduceTasks ( 1 ) ; conf . setOutputFormat ( SequenceFileOutputFormat . class ) ; client . setConf ( conf ) ; <START_BUG> FileSystem dfs = FileSystem . get ( conf ) ; <END_BUG> if ( dfs . exists ( outPath ) ) dfs . delete ( outPath , true ) ; JobClient . runJob ( conf ) ; } }

Fix:
FileSystem dfs = FileSystem . get ( outPath . toUri ( ) , conf ) ;