nus-yam/ex-repair huggingface dataset:
Buggy code:
public class HttpReplicatorTest extends ReplicatorTestCase { private File clientWorkDir ; private Replicator serverReplicator ; private IndexWriter writer ; private DirectoryReader reader ; private Server server ; private int port ; private Directory serverIndexDir ; private Directory handlerIndexDir ; private void startServer ( ) throws Exception { } @ Before @ Override public void setUp ( ) throws Exception { } @ Override public void tearDown ( ) throws Exception { } private void publishRevision ( int id ) throws IOException { } private void reopenReader ( ) throws IOException { } @ Test public void testBasic ( ) throws Exception { <START_BUG> Replicator replicator = new HttpReplicator ( "localhost" , port , ( ( ReplicationService . REPLICATION_CONTEXT ) + "//s1" ) , getClientConnectionManager ( ) ) ; <END_BUG> ReplicationClient client = new ReplicationClient ( replicator , new org . apache . lucene . replicator . IndexReplicationHandler ( handlerIndexDir , null ) , new PerSessionDirectoryFactory ( clientWorkDir ) ) ; publishRevision ( 1 ) ; client . updateNow ( ) ; reopenReader ( ) ; assertEquals ( 1 , Integer . parseInt ( reader . getIndexCommit ( ) . getUserData ( ) . get ( "ID" ) , 16 ) ) ; publishRevision ( 2 ) ; client . updateNow ( ) ; reopenReader ( ) ; assertEquals ( 2 , Integer . parseInt ( reader . getIndexCommit ( ) . getUserData ( ) . get ( "ID" ) , 16 ) ) ; } }

Fix:
Replicator replicator = new HttpReplicator ( "127.0.0.1" , port , ( ( ReplicationService . REPLICATION_CONTEXT ) + "//s1" ) , getClientConnectionManager ( ) ) ;
Buggy code:
public class Brewery extends AbstractFields implements Ownable { private Player owner ; private int price ; private boolean isMortgaged ; private String name ; public Brewery ( int id , Player owner , Texts text ) { } @ Override public void landOnField ( Player player , Texts text , GUI_Commands gui , GameBoard board ) { if ( ! ( isOwned ( ) ) ) { boolean buy = gui . getUserLeftButtonPressed ( text . getFormattedString ( "buy" , getName ( ) , getPrice ( ) ) , text . getString ( "Yes" ) , text . getString ( "No" ) ) ; if ( buy ) { buyProperty ( player , text , gui ) ; } } else if ( ( ( ! ( isMortgaged ) ) && ( ( owner ) != player ) ) && ( isOwned ( ) ) ) { <START_BUG> gui . showMessage ( text . getFormattedString ( "rent" , getRent ( board ) , owner ) ) ; <END_BUG> player . updateBalance ( ( - ( getRent ( board ) ) ) ) ; owner . updateBalance ( getRent ( board ) ) ; gui . setBalance ( player . getName ( ) , player . getBalance ( ) ) ; gui . setBalance ( owner . getName ( ) , owner . getBalance ( ) ) ; } } public void buyProperty ( Player player , Texts text , GUI_Commands gui ) { } public void sellProperty ( Player player ) { } public void mortgage ( Texts text , GUI_Commands gui ) { } public void unMortgage ( ) { } public boolean isMortgaged ( ) { } public boolean isOwned ( ) { } public void setOwner ( Player player , GUI_Commands gui ) { } public Player getOwner ( ) { } public int getRent ( GameBoard board ) { } @ Override public String getName ( ) { } @ Override public int getID ( ) { } public int getPrice ( ) { } public void setMortgage ( boolean x ) { } }

Fix:
gui . showMessage ( text . getFormattedString ( "rent" , getRent ( board ) , owner . getName ( ) ) ) ;
Buggy code:
public class Phone implements PhoneInterface { private static Context context ; private static Vibrator v ; private static Uri notification ; private static Ringtone r ; private static Phone ourInstance = new Phone ( ) ; public static PhoneInterface getInstance ( Context newContext ) { } private Phone ( ) { } @ Override public void vibratePhone ( long durationMilli ) { } @ Override public void playDefaultNotificationSound ( ) { } @ Override public void playDefaultRingtoneSound ( long durationMilli ) { } @ Override public void sendMessageToNotificationBar ( String title , String message , int requestID , String remKey ) { NotificationCompat . Builder mBuilder = new NotificationCompat . Builder ( Phone . context ) . setSmallIcon ( ic_action_notificationicon ) . setContentTitle ( title ) . setContentText ( message ) ; mBuilder . setAutoCancel ( true ) ; Bitmap icon = BitmapFactory . decodeResource ( Phone . context . getResources ( ) , app_logo ) ; mBuilder . setLargeIcon ( icon ) ; Reminder reminder = Storage . getInstance ( ) . getReminder ( remKey ) ; Intent resultIntent = new Intent ( Phone . context , MainActivity . class ) ; <START_BUG> resultIntent . addFlags ( FLAG_ACTIVITY_CLEAR_TOP ) ; <END_BUG> resultIntent . putExtra ( "Reminder" , reminder ) ; PendingIntent resultPendingIntent = PendingIntent . getActivity ( Phone . context , requestID , resultIntent , FLAG_UPDATE_CURRENT ) ; mBuilder . setContentIntent ( resultPendingIntent ) ; int mNotificationId = requestID ; NotificationManager mNotifyMgr = ( ( NotificationManager ) ( Phone . context . getSystemService ( Phone . context . NOTIFICATION_SERVICE ) ) ) ; mNotifyMgr . notify ( mNotificationId , mBuilder . build ( ) ) ; } @ Override public void flashCameraLight ( ) { } }

Fix:
resultIntent . setFlags ( ( ( Intent . FLAG_ACTIVITY_NEW_TASK ) | ( Intent . FLAG_ACTIVITY_CLEAR_TASK ) ) ) ;
Buggy code:
public class TrueLiteral extends MagicLiteral { static final char [ ] source = new char [ ] { 't' , 'r' , 'u' , 'e' } ; public TrueLiteral ( int s , int e ) { } public void computeConstant ( ) { } public void generateCode ( BlockScope currentScope , CodeStream codeStream , boolean valueRequired ) { int pc = codeStream . position ; if ( valueRequired ) { <START_BUG> codeStream . generateConstant ( constant , implicitConversion ) ; <END_BUG> } codeStream . recordPositionsFrom ( pc , this . sourceStart ) ; } public void generateOptimizedBoolean ( BlockScope currentScope , CodeStream codeStream , BranchLabel trueLabel , BranchLabel falseLabel , boolean valueRequired ) { } public TypeBinding literalType ( BlockScope scope ) { } public char [ ] source ( ) { } public void traverse ( ASTVisitor visitor , BlockScope scope ) { } }

Fix:
codeStream . generateConstant ( this . constant , this . implicitConversion ) ;
Buggy code:
public abstract class SpringWebApplication extends WebApplication implements ApplicationContextAware { private ApplicationContext applicationContext ; private static final ISpringContextLocator contextLocator = new ISpringContextLocator ( ) { public ApplicationContext getSpringContext ( ) { } } ; public SpringWebApplication ( ) { } @ Override protected void internalInit ( ) { super . internalInit ( ) ; if ( ( applicationContext ) == null ) { <START_BUG> ServletContext sc = getWicketServlet ( ) . getServletContext ( ) ; <END_BUG> applicationContext = WebApplicationContextUtils . getRequiredWebApplicationContext ( sc ) ; } } public final void setApplicationContext ( ApplicationContext applicationContext ) throws BeansException { } protected final ApplicationContext internalGetApplicationContext ( ) { } public ISpringContextLocator getSpringContextLocator ( ) { } protected Object createSpringBeanProxy ( Class clazz , String beanName ) { } protected Object createSpringBeanProxy ( Class clazz ) { } }

Fix:
ServletContext sc = getServletContext ( ) ;
Buggy code:
public class MySQL5MyISAMDialect extends MySQL5Dialect { @ Override public String getTableTypeString ( ) { <START_BUG> return "<seq2seq4repair_space>ENGINE=MyISAM" ; <END_BUG> } @ Override public boolean dropConstraints ( ) { } }

Fix:
return "<seq2seq4repair_space>ENGINE=MyISAM<seq2seq4repair_space>DEFAULT<seq2seq4repair_space>CHARSET=utf8" ;
Buggy code:
public interface MeasureAnswerAssessmentVariableResolver { AssessmentVariableDto resolveAssessmentVariable ( AssessmentVariable assessmentVariable , Integer veteranAssessmentId , Map < Integer , AssessmentVariable > measureAnswerHash ) { } <START_BUG> AssessmentVariableDto resolveAssessmentVariable ( AssessmentVariable parentAssessmentVariable , SurveyMeasureResponse response , Map < Integer , AssessmentVariable > measureAnswerHash ) ; <END_BUG> String resolveCalculationValue ( AssessmentVariable assessmentVariable , Integer veteranAssessmentId , SurveyMeasureResponse response ) { } String resolveCalculationValue ( AssessmentVariable assessmentVariable , Integer veteranAssessmentId ) { } String resolveCalculationValue ( AssessmentVariable answerVariable , Pair < Measure , gov . va . escreening . dto . ae . Measure > answer ) { } String resolveCalculationValue ( Measure left , Answer answerVal ) { } }

Fix:
AssessmentVariableDto resolveAssessmentVariable ( AssessmentVariable measureAnswerAssessmentVariable , SurveyMeasureResponse response , Map < Integer , AssessmentVariable > measureAnswerHash ) ;
Buggy code:
public abstract class AbstractRepeater extends WebMarkupContainer { private static final long serialVersionUID = 1L ; private static final Logger log = LoggerFactory . getLogger ( AbstractRepeater . class ) ; private static Pattern SAFE_CHILD_ID_PATTERN = Pattern . compile ( "^\\d+$" ) ; public AbstractRepeater ( String id ) { } public AbstractRepeater ( String id , IModel < ? > model ) { } protected abstract Iterator < ? extends Component > renderIterator ( ) { } @ Override protected final void onRender ( ) { } protected void renderChild ( final Component child ) { } @ Override protected void onBeforeRender ( ) { onPopulate ( ) ; <START_BUG> if ( Application . get ( ) . getConfigurationType ( ) . equals ( DEVELOPMENT ) ) { <END_BUG> Iterator < ? extends Component > i = iterator ( ) ; while ( i . hasNext ( ) ) { Component c = i . next ( ) ; Matcher matcher = AbstractRepeater . SAFE_CHILD_ID_PATTERN . matcher ( c . getId ( ) ) ; if ( ! ( matcher . matches ( ) ) ) { AbstractRepeater . log . warn ( ( ( ( ( ( ( "Child<seq2seq4repair_space>component<seq2seq4repair_space>of<seq2seq4repair_space>repeater<seq2seq4repair_space>" + ( getClass ( ) . getName ( ) ) ) + ":" ) + ( getId ( ) ) ) + "<seq2seq4repair_space>has<seq2seq4repair_space>a<seq2seq4repair_space>non-safe<seq2seq4repair_space>child<seq2seq4repair_space>id<seq2seq4repair_space>of<seq2seq4repair_space>" ) + ( c . getId ( ) ) ) + ".<seq2seq4repair_space>Safe<seq2seq4repair_space>child<seq2seq4repair_space>ids<seq2seq4repair_space>must<seq2seq4repair_space>be<seq2seq4repair_space>composed<seq2seq4repair_space>of<seq2seq4repair_space>digits<seq2seq4repair_space>only." ) ) ; break ; } } } super . onBeforeRender ( ) ; } @ Override public IMarkupFragment getMarkup ( final Component child ) { } protected abstract void onPopulate ( ) { } }

Fix:
if ( getApplication ( ) . usesDevelopmentConfig ( ) ) {
Buggy code:
public final class TimeFrame implements ITimeFrameSource { private static final long serialVersionUID = 1L ; private final Time end ; private final Time start ; public static ITimeFrameSource eachDay ( final TimeOfDay startTimeOfDay , final TimeOfDay endTimeOfDay ) { } public static TimeFrame valueOf ( final Time start , final Duration duration ) { } public static TimeFrame valueOf ( final Time start , final Time end ) { } private static void check ( final AbstractTimeValue start , final AbstractTimeValue end ) { } private TimeFrame ( final Time start , final Time end ) { } public boolean contains ( final Time time ) { } public Duration getDuration ( ) { } public Time getEnd ( ) { } public Time getStart ( ) { } public TimeFrame getTimeFrame ( ) { } public boolean overlaps ( final TimeFrame timeframe ) { } @ Override public int hashCode ( ) { } @ Override <START_BUG> public boolean equals ( Object obj ) { <END_BUG> if ( ( this ) == obj ) { return true ; } if ( obj == null ) { return false ; } if ( ( getClass ( ) ) != ( obj . getClass ( ) ) ) { return false ; } TimeFrame other = ( ( TimeFrame ) ( obj ) ) ; return ( Objects . equal ( start , other . start ) ) && ( Objects . equal ( end , other . end ) ) ; } @ Override public String toString ( ) { } }

Fix:
public boolean equals ( final Object obj ) {
Buggy code:
@ SuppressWarnings ( "serial" ) public class DistributedBrokerImpl extends FinalizingBrokerImpl { private transient String _rootSlice ; private transient DistributedConfiguration _conf ; private final ReentrantSliceLock _lock ; private static final Localizer _loc = Localizer . forPackage ( DistributedBrokerImpl . class ) ; public DistributedBrokerImpl ( ) { } public DistributedConfiguration getConfiguration ( ) { } @ Override public OpenJPAStateManager persist ( Object pc , Object id , boolean explicit , OpCallbacks call ) { OpenJPAStateManager sm = getStateManager ( pc ) ; SliceInfo info = null ; <START_BUG> boolean replicated = SliceImplHelper . isReplicated ( sm ) ; <END_BUG> if ( ( getOperatingSet ( ) . isEmpty ( ) ) && ( ! ( SliceImplHelper . isSliceAssigned ( sm ) ) ) ) { info = SliceImplHelper . getSlicesByPolicy ( pc , getConfiguration ( ) , this ) ; _rootSlice = info . getSlices ( ) [ 0 ] ; } sm = super . persist ( pc , id , explicit , call ) ; if ( ! ( SliceImplHelper . isSliceAssigned ( sm ) ) ) { if ( info == null ) { info = ( replicated ) ? SliceImplHelper . getSlicesByPolicy ( pc , getConfiguration ( ) , this ) : new SliceInfo ( _rootSlice ) ; } info . setInto ( sm ) ; } return sm ; } @ Override public boolean endOperation ( ) { } protected QueryImpl newQueryImpl ( String lang , StoreQuery sq ) { } @ Override public void lock ( ) { } @ Override public void unlock ( ) { } @ Override public void beginStore ( ) { } }

Fix:
boolean replicated = SliceImplHelper . isReplicated ( pc , getConfiguration ( ) ) ;
Buggy code:
public class IndexAllProject extends IndexRequest implements IResourceVisitor { IProject project ; IndexManager manager ; Hashtable indexedFileNames ; final String OK = "OK" ; final String DELETED = "DELETED" ; long indexLastModified ; public IndexAllProject ( IProject project , IndexManager manager ) { } public boolean belongsTo ( String jobFamily ) { } public boolean equals ( Object o ) { } public int hashCode ( ) { } public boolean execute ( IProgressMonitor progressMonitor ) { if ( ( progressMonitor != null ) && ( progressMonitor . isCanceled ( ) ) ) return IJob . COMPLETE ; if ( ! ( project . isOpen ( ) ) ) return IJob . COMPLETE ; IIndex index = manager . getIndex ( project . getFullPath ( ) ) ; if ( index == null ) return IJob . COMPLETE ; ReadWriteMonitor monitor = manager . getMonitorFor ( index ) ; if ( monitor == null ) return IJob . COMPLETE ; try { monitor . enterRead ( ) ; if ( index . hasChanged ( ) ) { try { monitor . exitRead ( ) ; monitor . enterWrite ( ) ; if ( IndexManager . VERBOSE ) System . out . println ( ( "-><seq2seq4repair_space>merging<seq2seq4repair_space>index<seq2seq4repair_space>:<seq2seq4repair_space>" + ( index . getIndexFile ( ) ) ) ) ; index . save ( ) ; } catch ( IOException e ) { return IJob . FAILED ; } finally { monitor . exitWrite ( ) ; monitor . enterRead ( ) ; } } this . indexLastModified = index . getIndexFile ( ) . lastModified ( ) ; this . indexedFileNames = new Hashtable ( 100 ) ; IQueryResult [ ] results = index . queryInDocumentNames ( "" ) ; for ( int i = 0 , max = ( results == null ) ? 0 : results . length ; i < max ; i ++ ) { String fileName = results [ i ] . getPath ( ) ; this . indexedFileNames . put ( fileName , DELETED ) ; } JavaCore javaCore = JavaCore . getJavaCore ( ) ; IJavaProject javaProject = javaCore . create ( this . project ) ; <START_BUG> IClasspathEntry [ ] entries = javaProject . getResolvedClasspath ( true ) ; <END_BUG> IWorkspaceRoot root = this . project . getWorkspace ( ) . getRoot ( ) ; for ( int i = 0 , length = entries . length ; i < length ; i ++ ) { if ( this . isCancelled ) return IJob . FAILED ; IClasspathEntry entry = entries [ i ] ; if ( ( entry . getEntryKind ( ) ) == ( IClasspathEntry . CPE_SOURCE ) ) { IPath entryPath = entry . getPath ( ) ; IResource sourceFolder = root . findMember ( entryPath ) ; if ( sourceFolder != null ) { sourceFolder . accept ( this ) ; } } } Enumeration names = indexedFileNames . keys ( ) ; while ( names . hasMoreElements ( ) ) { if ( this . isCancelled ) return IJob . FAILED ; String name = ( ( String ) ( names . nextElement ( ) ) ) ; Object value = indexedFileNames . get ( name ) ; if ( value instanceof IFile ) { manager . add ( ( ( IFile ) ( value ) ) , this . project . getFullPath ( ) ) ; } else if ( value == ( DELETED ) ) { manager . remove ( name , this . project . getFullPath ( ) ) ; } } } catch ( CoreException e ) { return IJob . FAILED ; } catch ( IOException e ) { return IJob . FAILED ; } finally { monitor . exitRead ( ) ; } return IJob . COMPLETE ; } public String toString ( ) { } public boolean visit ( IResource resource ) { } }

Fix:
IClasspathEntry [ ] entries = javaProject . getRawClasspath ( ) ;
Buggy code:
public class OnewayNoReturnValueRule extends AbstractAnnotationProcessor { public OnewayNoReturnValueRule ( ) { } @ Override public void process ( ) { Messager messager = environment . getMessager ( ) ; AnnotationTypeDeclaration annotationDeclaration = ( ( AnnotationTypeDeclaration ) ( environment . getTypeDeclaration ( "javax.jws.Oneway" ) ) ) ; Collection < Declaration > annotatedTypes = environment . getDeclarationsAnnotatedWith ( annotationDeclaration ) ; for ( Declaration declaration : annotatedTypes ) { if ( declaration instanceof MethodDeclaration ) { MethodDeclaration methodDeclaration = ( ( MethodDeclaration ) ( declaration ) ) ; if ( ! ( methodDeclaration . getReturnType ( ) . equals ( environment . getTypeUtils ( ) . getVoidType ( ) ) ) ) { Collection < AnnotationMirror > annotationMirrors = declaration . getAnnotationMirrors ( ) ; for ( AnnotationMirror mirror : annotationMirrors ) { if ( mirror . getAnnotationType ( ) . toString ( ) . equals ( annotationDeclaration . getQualifiedName ( ) ) ) { <START_BUG> messager . printError ( mirror . getPosition ( ) , ONEWAY_ANNOTATION_PROCESSOR_NO_RETURN_VALUE_ERROR_MESSAGE ) ; <END_BUG> } } } } } } }

Fix:
messager . printError ( mirror . getPosition ( ) , ONEWAY_NO_RETURN_VALUE_ERROR_MESSAGE ) ;
Buggy code:
public class DatePatternConverter extends PatternConverter { StringBuffer buf ; Logger logger = Logger . getLogger ( DatePatternConverter . class ) ; private DateFormat df ; private Date date ; protected FieldPosition pos = new FieldPosition ( 0 ) ; public DatePatternConverter ( FormattingInfo formattingInfo ) { } public void setOption ( String option ) { } public StringBuffer convert ( LoggingEvent event ) { buf . setLength ( 0 ) ; <START_BUG> date . setTime ( event . timeStamp ) ; <END_BUG> String converted = null ; try { df . format ( date , buf , pos ) ; } catch ( Exception ex ) { logger . error ( "Error<seq2seq4repair_space>occured<seq2seq4repair_space>while<seq2seq4repair_space>converting<seq2seq4repair_space>date." , ex ) ; } return buf ; } }

Fix:
date . setTime ( event . getTimeStamp ( ) ) ;
Buggy code:
public abstract class PerspectiveMenu extends ContributionItem { private static IPerspectiveRegistry reg ; private IWorkbenchWindow window ; private boolean showActive = false ; private boolean dirty = true ; private IMenuListener menuListener = new IMenuListener ( ) { public void menuAboutToShow ( IMenuManager manager ) { } } ; private Comparator comparator = new Comparator ( ) { private Collator collator = Collator . getInstance ( ) ; public int compare ( Object ob1 , Object ob2 ) { } } ; private static Hashtable imageCache = new Hashtable ( 11 ) ; public PerspectiveMenu ( IWorkbenchWindow window , String id ) { } void createMenuItem ( Menu menu , int index , final IPerspectiveDescriptor desc , boolean bCheck ) { } void createOtherItem ( Menu menu , int index ) { } public void fill ( Menu menu , int index ) { } private Image getImage ( IPerspectiveDescriptor perspDesc ) { ImageDescriptor imageDesc = perspDesc . getImageDescriptor ( ) ; if ( imageDesc == null ) { <START_BUG> imageDesc = WorkbenchImages . getImageDescriptor ( IMG_CTOOL_DEF_PERSPECTIVE_HOVER ) ; <END_BUG> } if ( imageDesc == null ) { return null ; } Image image = ( ( Image ) ( PerspectiveMenu . imageCache . get ( imageDesc ) ) ) ; if ( image == null ) { image = imageDesc . createImage ( ) ; PerspectiveMenu . imageCache . put ( imageDesc , image ) ; } return image ; } private ArrayList getPerspectiveShortcuts ( ) { } protected ArrayList getPerspectiveItems ( ) { } protected boolean getShowActive ( ) { } protected IWorkbenchWindow getWindow ( ) { } public boolean isDirty ( ) { } public boolean isDynamic ( ) { } protected abstract void run ( IPerspectiveDescriptor desc ) { } protected void run ( IPerspectiveDescriptor desc , SelectionEvent event ) { } void runOther ( SelectionEvent event ) { } protected void showActive ( boolean b ) { } }

Fix:
imageDesc = WorkbenchImages . getImageDescriptor ( IMG_ETOOL_DEF_PERSPECTIVE_HOVER ) ;
Buggy code:
public final class CompoundFileDirectory extends Directory { public static final class FileEntry { long offset ; long length ; } private final Directory directory ; private final String fileName ; protected final int readBufferSize ; private final Map < String , CompoundFileDirectory . FileEntry > entries ; private final boolean openForWrite ; private static final Map < String , CompoundFileDirectory . FileEntry > SENTINEL = Collections . emptyMap ( ) ; private final CompoundFileWriter writer ; private final IndexInputSlicer handle ; public CompoundFileDirectory ( Directory directory , String fileName , IOContext context , boolean openForWrite ) throws IOException { } private static final Map < String , CompoundFileDirectory . FileEntry > readEntries ( IndexInputSlicer handle , Directory dir , String name ) throws IOException { } public Directory getDirectory ( ) { } public String getName ( ) { } @ Override public synchronized void close ( ) throws IOException { } @ Override public synchronized IndexInput openInput ( String name , IOContext context ) throws IOException { } @ Override public String [ ] listAll ( ) { ensureOpen ( ) ; String [ ] res ; if ( ( writer ) != null ) { res = writer . listAll ( ) ; } else { res = entries . keySet ( ) . toArray ( new String [ entries . size ( ) ] ) ; <START_BUG> String seg = fileName . substring ( 0 , fileName . indexOf ( '.' ) ) ; <END_BUG> for ( int i = 0 ; i < ( res . length ) ; i ++ ) { res [ i ] = seg + ( res [ i ] ) ; } } return res ; } @ Override public boolean fileExists ( String name ) { } @ Override public void deleteFile ( String name ) { } public void renameFile ( String from , String to ) { } @ Override public long fileLength ( String name ) throws IOException { } @ Override public IndexOutput createOutput ( String name , IOContext context ) throws IOException { } @ Override public void sync ( Collection < String > names ) throws IOException { } @ Override public Lock makeLock ( String name ) { } @ Override public IndexInputSlicer createSlicer ( final String name , IOContext context ) throws IOException { } @ Override public String toString ( ) { } }

Fix:
String seg = IndexFileNames . parseSegmentName ( fileName ) ;
Buggy code:
public class AccountModel implements AccountModelContract { @ Override public void getAccounts ( AccountListListener accountListListener ) { ArrayList < Account > accounts = new ArrayList < > ( ) ; Cursor cursor = ExpenseTrackerApplication . getExpenseTrackerApplication ( ) . getContentResolver ( ) . query ( CONTENT_URI , null , null , null , null ) ; if ( ( cursor . getCount ( ) ) > 0 ) { while ( cursor . moveToNext ( ) ) { Account account = new Account ( ) ; account . accountId = cursor . getInt ( cursor . getColumnIndex ( _ID ) ) ; account . accountName = cursor . getString ( cursor . getColumnIndex ( COLUMNS_ACCOUNT_TITLE ) ) ; account . amount = cursor . getInt ( cursor . getColumnIndex ( COLUMNS_ACCOUNT_AMOUNT ) ) ; <START_BUG> account . date = cursor . getInt ( cursor . getColumnIndex ( COLUMNS_ACCOUNT_CREATED_DATE ) ) ; <END_BUG> account . accountType = cursor . getString ( cursor . getColumnIndex ( COLUMNS_ACCOUNT_TYPE ) ) ; accounts . add ( account ) ; } accountListListener . onAccountListSuccess ( accounts ) ; } else { accountListListener . onAccountListFailure ( "Failed<seq2seq4repair_space>to<seq2seq4repair_space>list<seq2seq4repair_space>data" ) ; } } }

Fix:
account . date = cursor . getLong ( cursor . getColumnIndex ( COLUMNS_ACCOUNT_CREATED_DATE ) ) ;
Buggy code:
public class ClobOutputStream extends OutputStream { private Clob clob_ ; private long offset_ ; public ClobOutputStream ( Clob clob , long offset ) throws SqlException { } public void write ( int b ) throws IOException { } public void write ( byte [ ] b , int off , int len ) throws IOException { } private void writeBytes ( byte [ ] b ) throws IOException { <START_BUG> String str = new String ( b , "US-ASCII" ) ; <END_BUG> clob_ . string_ = clob_ . string_ . substring ( 0 , ( ( ( int ) ( offset_ ) ) - 1 ) ) ; clob_ . string_ = clob_ . string_ . concat ( str ) ; clob_ . asciiStream_ = new StringBufferInputStream ( clob_ . string_ ) ; clob_ . unicodeStream_ = new StringBufferInputStream ( clob_ . string_ ) ; clob_ . characterStream_ = new StringReader ( clob_ . string_ ) ; clob_ . setSqlLength ( clob_ . string_ . length ( ) ) ; offset_ += b . length ; } }

Fix:
String str = new String ( b , "ISO-8859-1" ) ;
Buggy code:
public class DropKeyspace extends Migration { private String name ; protected DropKeyspace ( ) { } public DropKeyspace ( String name ) throws IOException , ConfigurationException { } public void applyModels ( ) throws IOException { <START_BUG> String snapshotName = Table . getTimestampedSnapshotName ( null ) ; <END_BUG> instance . getCompactionLock ( ) . lock ( ) ; try { KSMetaData ksm = schema . getTableDefinition ( name ) ; for ( CFMetaData cfm : ksm . cfMetaData ( ) . values ( ) ) { ColumnFamilyStore cfs = Table . open ( ksm . name , schema ) . getColumnFamilyStore ( cfm . cfName ) ; schema . purge ( cfm ) ; if ( ! ( StorageService . instance . isClientMode ( ) ) ) { cfs . snapshot ( snapshotName ) ; cfs . flushLock . lock ( ) ; try { Table . open ( ksm . name , schema ) . dropCf ( cfm . cfId ) ; } finally { cfs . flushLock . unlock ( ) ; } } } Table table = Table . clear ( ksm . name , schema ) ; assert table != null ; schema . clearTableDefinition ( ksm , newVersion ) ; } finally { instance . getCompactionLock ( ) . unlock ( ) ; } } public void subdeflate ( org . apache . cassandra . db . migration . avro . Migration mi ) { } public void subinflate ( org . apache . cassandra . db . migration . avro . Migration mi ) { } @ Override public String toString ( ) { } }

Fix:
String snapshotName = Table . getTimestampedSnapshotName ( name ) ;
Buggy code:
public abstract class MultiOperation extends JavaModelOperation { protected Map insertBeforeElements = new HashMap ( 1 ) ; protected Map newParents ; protected Map renamings ; protected String [ ] renamingsList = null ; protected MultiOperation ( IJavaElement [ ] elementsToProcess , boolean force ) { } protected MultiOperation ( IJavaElement [ ] elementsToProcess , IJavaElement [ ] parentElements , boolean force ) { } protected void error ( int code , IJavaElement element ) throws JavaModelException { } protected void executeOperation ( ) throws JavaModelException { } protected IJavaElement getDestinationParent ( IJavaElement child ) { } protected abstract String getMainTaskName ( ) { } protected String getNewNameFor ( IJavaElement element ) { } private void initializeRenamings ( ) { } protected boolean isMove ( ) { } protected boolean isRename ( ) { } protected abstract void processElement ( IJavaElement element ) throws JavaModelException { } protected void processElements ( ) throws JavaModelException { } public void setInsertBefore ( IJavaElement modifiedElement , IJavaElement newSibling ) { } public void setRenamings ( String [ ] renamingsList ) { } protected abstract void verify ( IJavaElement element ) throws JavaModelException { } protected void verifyDestination ( IJavaElement element , IJavaElement destination ) throws JavaModelException { } protected void verifyRenaming ( IJavaElement element ) throws JavaModelException { String newName = getNewNameFor ( element ) ; boolean isValid = true ; switch ( element . getElementType ( ) ) { case IJavaElement . PACKAGE_FRAGMENT : <START_BUG> if ( element . getElementName ( ) . equals ( IPackageFragment . DEFAULT_PACKAGE_NAME ) ) { <END_BUG> throw new JavaModelException ( new JavaModelStatus ( IJavaModelStatusConstants . NAME_COLLISION , element ) ) ; } isValid = ( JavaConventions . validatePackageName ( newName ) . getSeverity ( ) ) != ( IStatus . ERROR ) ; break ; case IJavaElement . COMPILATION_UNIT : isValid = ( JavaConventions . validateCompilationUnitName ( newName ) . getSeverity ( ) ) != ( IStatus . ERROR ) ; break ; case IJavaElement . INITIALIZER : isValid = false ; break ; default : isValid = ( JavaConventions . validateIdentifier ( newName ) . getSeverity ( ) ) != ( IStatus . ERROR ) ; break ; } if ( ! isValid ) { throw new JavaModelException ( new JavaModelStatus ( IJavaModelStatusConstants . INVALID_NAME , element , newName ) ) ; } } protected void verifySibling ( IJavaElement element , IJavaElement destination ) throws JavaModelException { } }

Fix:
if ( ( ( IPackageFragment ) ( element ) ) . isDefaultPackage ( ) ) {
Buggy code:
public class Battlepath { static Random g = new Random ( ) ; public static void main ( String [ ] args ) { <START_BUG> Field f = new Field ( 120 , 120 ) ; <END_BUG> Battlepath . randomCircles ( f , 40 , 0.15 ) ; Point2D start ; start = new Point2D . Double ( Battlepath . g . nextDouble ( ) , Battlepath . g . nextDouble ( ) ) ; while ( ( f . tileAt ( start ) ) == 1 ) start = new Point2D . Double ( Battlepath . g . nextDouble ( ) , Battlepath . g . nextDouble ( ) ) ; f . setTile ( start , 2 ) ; Game game = new Game ( f , start ) ; Input input = new Input ( game ) ; Renderer renderer = new Renderer ( game ) ; WindowUtilities . openInJFrame ( renderer , 600 , 600 , "Battlepath" , input ) ; renderer . start ( ) ; game . start ( ) ; } public static void randomCircles ( Field f , int n , double maxr ) { } }

Fix:
Field f = new Field ( 20 , 20 ) ;
Buggy code:
@ WebServlet ( "//user" ) public class UserServlet extends HttpServlet { @ EJB UserService userService ; @ Override protected void doPost ( HttpServletRequest req , HttpServletResponse resp ) throws IOException , ServletException { String action = req . getParameter ( "action" ) ; if ( action == null ) { return ; } try { JSONObject json = new JSONObject ( req . getReader ( ) . readLine ( ) ) ; String name = json . getString ( "name" ) ; String password = json . getString ( "password" ) ; if ( ( name == null ) || ( password == null ) ) { resp . setStatus ( 400 ) ; return ; } if ( action . equals ( "login" ) ) { req . login ( name , password ) ; req . getSession ( ) . setAttribute ( "name" , name ) ; resp . setStatus ( 200 ) ; } if ( action . equals ( "register" ) ) { if ( userService . regist ( name , password ) ) { <START_BUG> req . setAttribute ( "name" , name ) ; <END_BUG> resp . setStatus ( 201 ) ; } else { resp . setStatus ( 400 ) ; } } } catch ( Exception e ) { resp . setStatus ( 400 ) ; e . printStackTrace ( ) ; } } @ Override protected void doGet ( HttpServletRequest req , HttpServletResponse resp ) throws IOException , ServletException { } }

Fix:
req . getSession ( ) . setAttribute ( "name" , name ) ;
Buggy code:
public class ReferencesTest { private static final String UMLAUTE = "\"öÖü\";" ; private World world = new World ( ) ; @ Test public void jsNormal ( ) throws Exception { } @ Test public void jsBroken ( ) throws Exception { } @ Test public void umlaut ( ) throws Exception { } @ Test public void cssNormal ( ) throws Exception { } @ Test ( expected = IOException . class ) public void cssBroken ( ) throws Exception { } @ Test public void sass ( ) throws Exception { } private String js ( String ... sources ) throws IOException { } private String css ( String ... sources ) throws IOException { } private String minimize ( MimeType type , String ... sources ) throws IOException { Node dest ; References references ; dest = world . memoryNode ( ) ; try ( Writer writer = dest . createWriter ( ) ) { references = new References ( type , true ) ; for ( String source : sources ) { <START_BUG> references . add ( true , world . memoryNode ( source ) ) ; <END_BUG> } references . writeTo ( writer ) ; } return dest . readString ( ) ; } }

Fix:
references . add ( true , false , world . memoryNode ( source ) ) ;
Buggy code:
public class InstallThread extends Thread { public InstallThread ( Install installer , Progress progress , String installDir , OperatingSystem [ ] osTasks , int size , Vector components ) { } public void run ( ) { progress . setMaximum ( ( ( size ) * 1024 ) ) ; try { for ( int i = 0 ; i < ( components . size ( ) ) ; i ++ ) { String comp = ( ( String ) ( components . elementAt ( i ) ) ) ; System . err . println ( ( "Installing<seq2seq4repair_space>" + comp ) ) ; installComponent ( comp ) ; } for ( int i = 0 ; i < ( osTasks . length ) ; i ++ ) { System . err . println ( ( "Performing<seq2seq4repair_space>task<seq2seq4repair_space>" + ( osTasks [ i ] . getName ( ) ) ) ) ; <START_BUG> osTasks [ i ] . perform ( installDir ) ; <END_BUG> } } catch ( FileNotFoundException fnf ) { progress . error ( ( "The<seq2seq4repair_space>installer<seq2seq4repair_space>could<seq2seq4repair_space>not<seq2seq4repair_space>create<seq2seq4repair_space>the<seq2seq4repair_space>" + ( "destination<seq2seq4repair_space>directory.\n" + "Maybe<seq2seq4repair_space>you<seq2seq4repair_space>do<seq2seq4repair_space>not<seq2seq4repair_space>have<seq2seq4repair_space>write<seq2seq4repair_space>permission?" ) ) ) ; return ; } catch ( IOException io ) { progress . error ( io . toString ( ) ) ; return ; } progress . done ( ) ; } private Install installer ; private Progress progress ; private String installDir ; private OSTask [ ] osTasks ; private int size ; private Vector components ; private void installComponent ( String name ) throws IOException { } }

Fix:
osTasks [ i ] . perform ( installDir , components ) ;
Buggy code:
public class BAMIndexer { private final int numReferences ; private final BAMIndexWriter outputWriter ; private int currentReference = 0 ; private final BAMIndexer . BAMIndexBuilder indexBuilder ; public BAMIndexer ( final File output , final SAMFileHeader fileHeader ) { } public BAMIndexer ( final OutputStream output , final SAMFileHeader fileHeader ) { } public void processAlignment ( final SAMRecord rec ) { } public void finish ( ) { } private void advanceToReference ( final int nextReference ) { } public static void createAndWriteIndex ( final File input , final File output , final boolean textOutput ) { } private class BAMIndexBuilder { private final SAMSequenceDictionary sequenceDictionary ; private BinningIndexBuilder binningIndexBuilder ; private int currentReference = - 1 ; private final BAMIndexMetaData indexStats = new BAMIndexMetaData ( ) ; BAMIndexBuilder ( final SAMSequenceDictionary sequenceDictionary ) { } public void processAlignment ( final SAMRecord rec ) { } public BAMIndexContent processReference ( final int reference ) { } public long getNoCoordinateRecordCount ( ) { } void startNewReference ( ) { } } public static void createIndex ( SamReader reader , File output ) { } public static void createIndex ( SamReader reader , File output , Log log ) { BAMIndexer indexer = new BAMIndexer ( output , reader . getFileHeader ( ) ) ; <START_BUG> int totalRecords = 0 ; <END_BUG> for ( SAMRecord rec : reader ) { if ( ( ( ++ totalRecords ) % 1000000 ) == 0 ) { if ( null != log ) log . info ( ( totalRecords + "<seq2seq4repair_space>reads<seq2seq4repair_space>processed<seq2seq4repair_space>..." ) ) ; } indexer . processAlignment ( rec ) ; } indexer . finish ( ) ; } No newline ; at end ; of file ; }

Fix:
long totalRecords = 0 ;
Buggy code:
public class KitIntervalExecutor implements CommandExecutor { public CommandResult execute ( CommandSource src , CommandContext args ) throws CommandException { String kitName = args . < String > getOne ( "kit<seq2seq4repair_space>name" ) . get ( ) ; boolean oneTime = false ; int interval = 0 ; if ( args . < Integer > getOne ( "kit<seq2seq4repair_space>interval" ) . isPresent ( ) ) { interval = args . < Integer > getOne ( "kit<seq2seq4repair_space>interval" ) . get ( ) ; } else if ( args . < Boolean > getOne ( "one-time" ) . isPresent ( ) ) { oneTime = true ; } if ( ! oneTime ) { ConfigManager . setInterval ( interval , kitName ) ; } else if ( oneTime ) { <START_BUG> ConfigManager . setInterval ( kitName , oneTime ) ; <END_BUG> } src . sendMessage ( Texts . of ( GOLD , "Success!<seq2seq4repair_space>" , YELLOW , "The<seq2seq4repair_space>interval<seq2seq4repair_space>was<seq2seq4repair_space>changed!" ) ) ; return CommandResult . success ( ) ; } }

Fix:
ConfigManager . setInterval ( oneTime , kitName ) ;
Buggy code:
@ JatosGui @ Authenticated @ Singleton public class ComponentResults extends Controller { private static final String CLASS_NAME = ComponentResults . class . getSimpleName ( ) ; private final JatosGuiExceptionThrower jatosGuiExceptionThrower ; private final StudyService studyService ; private final ComponentService componentService ; private final UserService userService ; private final ResultService resultService ; private final JsonUtils jsonUtils ; private final StudyDao studyDao ; private final ComponentDao componentDao ; @ Inject ComponentResults ( JatosGuiExceptionThrower jatosGuiExceptionThrower , StudyService studyService , ComponentService componentService , UserService userService , ResultService resultService , StudyDao studyDao , ComponentDao componentDao , JsonUtils jsonUtils ) { } @ Transactional public Result index ( Long studyId , Long componentId , String errorMsg , int httpStatus ) throws JatosGuiException { } @ Transactional public Result index ( Long studyId , Long componentId , String errorMsg ) throws JatosGuiException { } @ Transactional public Result index ( Long studyId , Long componentId ) throws JatosGuiException { } @ Transactional public Result remove ( String componentResultIds ) throws JatosGuiException { } @ Transactional public Result tableDataByComponent ( Long studyId , Long componentId ) throws JatosGuiException { } @ Transactional public Result exportData ( String componentResultIds ) throws JatosGuiException { Logger . info ( ( ( ( ( ( ( ComponentResults . CLASS_NAME ) + ".exportData:<seq2seq4repair_space>componentResultIds<seq2seq4repair_space>" ) + componentResultIds ) + ",<seq2seq4repair_space>" ) + "logged-in<seq2seq4repair_space>user's<seq2seq4repair_space>email<seq2seq4repair_space>" ) + ( session ( SESSION_EMAIL ) ) ) ) ; response ( ) . discardCookie ( JQDOWNLOAD_COOKIE_NAME ) ; UserModel loggedInUser = userService . retrieveLoggedInUser ( ) ; List < ComponentResult > componentResultList = null ; try { List < Long > componentResultIdList = resultService . extractResultIds ( componentResultIds ) ; componentResultList = resultService . getAllComponentResults ( componentResultIdList ) ; <START_BUG> resultService . checkAllComponentResults ( componentResultList , loggedInUser , true ) ; <END_BUG> } catch ( ForbiddenException | BadRequestException | NotFoundException e ) { jatosGuiExceptionThrower . throwAjax ( e ) ; } String componentResultDataAsStr = resultService . getComponentResultData ( componentResultList ) ; response ( ) . setContentType ( "application//x-download" ) ; String filename = ( ( "results_" + ( DateUtils . getDateForFile ( new Date ( ) ) ) ) + "." ) + ( IOUtils . TXT_FILE_SUFFIX ) ; response ( ) . setHeader ( "Content-disposition" , ( "attachment;<seq2seq4repair_space>filename=" + filename ) ) ; response ( ) . setCookie ( JQDOWNLOAD_COOKIE_NAME , JQDOWNLOAD_COOKIE_CONTENT ) ; return ok ( componentResultDataAsStr ) ; } }

Fix:
resultService . checkAllComponentResults ( componentResultList , loggedInUser , false ) ;
Buggy code:
public class BookmarkablePageRequestTarget implements IBookmarkablePageRequestTarget { private Page page ; private final WeakReference < Class < ? extends Page > > pageClassRef ; private final String pageMapName ; private final PageParameters pageParameters ; public < C extends Page > BookmarkablePageRequestTarget ( Class < C > pageClass ) { } public < C extends Page > BookmarkablePageRequestTarget ( Class < C > pageClass , PageParameters pageParameters ) { } public < C extends Page > BookmarkablePageRequestTarget ( String pageMapName , Class < C > pageClass ) { } public < C extends Page > BookmarkablePageRequestTarget ( String pageMapName , Class < C > pageClass , PageParameters pageParameters ) { } public void detach ( RequestCycle requestCycle ) { } @ Override public boolean equals ( Object obj ) { } public final Page getPage ( ) { } protected final void setPage ( Page page ) { } public final Class < ? extends Page > getPageClass ( ) { } public final String getPageMapName ( ) { } public final PageParameters getPageParameters ( ) { } @ Override public int hashCode ( ) { } public void processEvents ( RequestCycle requestCycle ) { } public void respond ( RequestCycle requestCycle ) { if ( ( ( pageClassRef ) != null ) && ( ( pageClassRef . get ( ) ) != null ) ) { if ( requestCycle . isRedirect ( ) ) { IRequestCycleProcessor processor = requestCycle . getProcessor ( ) ; String redirectUrl = processor . getRequestCodingStrategy ( ) . encode ( requestCycle , this ) . toString ( ) ; if ( ( redirectUrl . startsWith ( ".//" ) ) && ( ( redirectUrl . length ( ) ) > 2 ) ) { redirectUrl = redirectUrl . substring ( 2 ) ; } requestCycle . getResponse ( ) . redirect ( redirectUrl ) ; } else { <START_BUG> getPage ( requestCycle ) . renderPage ( ) ; <END_BUG> } } } @ Override public String toString ( ) { } protected < C extends Page > Page newPage ( final Class < C > pageClass , final RequestCycle requestCycle ) { } protected final Page getPage ( RequestCycle requestCycle ) { } }

Fix:
getPage ( requestCycle ) . render ( ) ;
Buggy code:
@ FacesComponent ( Dygraph . COMPONENT_TYPE ) public class Dygraph extends UIOutput implements ClientBehaviorHolder { public static final String COMPONENT_TYPE = "org.dyfaces.component.graph" ; public static final String COMPONENT_FAMILY = "org.dyfaces.component" ; public static final String DEFAULT_EVENT = "graphClicked" ; public static final String EVENT_POINTCLICKED = "pointClicked" ; public static final String EVENT_ANNOCLICKED = "annotationClicked" ; public static final String EVENT_ANNODBLCLICKED = "annotationDblClicked" ; public static final String EVENT_GRAPHZOOMED = "graphZoomed" ; private static final Collection < String > EVENTS = Collections . unmodifiableCollection ( Arrays . asList ( Dygraph . DEFAULT_EVENT , Dygraph . EVENT_POINTCLICKED , Dygraph . EVENT_ANNOCLICKED , Dygraph . EVENT_ANNODBLCLICKED , Dygraph . EVENT_GRAPHZOOMED ) ) ; private static final Gson gson = new Gson ( ) ; @ Override public String getFamily ( ) { } @ Override public Collection < String > getEventNames ( ) { } @ Override public String getDefaultEventName ( ) { } public Object getDyDataModel ( ) { byte dataInputs = 0 ; Object dyDataModel = null ; Object value = getValue ( ) ; if ( value != null ) { dyDataModel = value ; dataInputs ++ ; } Object series = getValue ( "series" ) ; if ( series != null ) { dyDataModel = series ; dataInputs ++ ; } Object model = getValue ( "model" ) ; if ( model != null ) { dyDataModel = model ; dataInputs ++ ; } <START_BUG> if ( ( dataInputs <= 0 ) && ( dataInputs > 1 ) ) { <END_BUG> throw new InvalidDataInputException ( "no<seq2seq4repair_space>or<seq2seq4repair_space>more<seq2seq4repair_space>than<seq2seq4repair_space>one<seq2seq4repair_space>data<seq2seq4repair_space>inputs<seq2seq4repair_space>found<seq2seq4repair_space>for<seq2seq4repair_space>graph" ) ; } return dyDataModel ; } public List < AnnotationPoint > getAnnotations ( ) { } public void setAnnotations ( List < AnnotationPoint > value ) { } public List < HighlightRegion > getHghlightRegions ( ) { } public void setHighlightRegions ( List < HighlightRegion > value ) { } public String getSynchronize ( ) { } public void setSynchronize ( String value ) { } public Boolean isTooltip ( ) { } public void setTooltip ( Boolean value ) { } public String getVar ( ) { } public void setVar ( String value ) { } public Object getValue ( String param ) { } public void setValue ( String param , Object value ) { } @ Override public void encodeBegin ( FacesContext context ) throws IOException { } @ Override public void decode ( FacesContext context ) { } @ Override public void encodeChildren ( FacesContext context ) throws IOException { } @ Override public void queueEvent ( FacesEvent event ) { } }

Fix:
if ( ( dataInputs != 1 ) || ( dyDataModel == null ) ) {
Buggy code:
public class Task implements Cloneable { private int lineNumber ; private String text ; private String category ; private boolean isPriority ; private boolean isComplete ; public Task ( int lineNumber , String text , String category , boolean isPriority , boolean isComplete ) { } public int getLineNumber ( ) { } public String getText ( ) { } public String getCategory ( ) { } public boolean isPriority ( ) { } public boolean isComplete ( ) { } public void setLineNumber ( int lineNumber ) { } public void setText ( String text ) { } public void setCategory ( String category ) { if ( category == null ) { <START_BUG> text = "" ; <END_BUG> } this . category = category ; } public void setPriority ( boolean isPriority ) { } public void setComplete ( boolean isComplete ) { } public Task clone ( ) { } public boolean equals ( Task toCheck ) { } }

Fix:
category = "" ;
Buggy code:
public final class Program { String name ; String fullPath ; String identifier ; static final String PREFIX_HTTP = "http:////" ; static final String PREFIX_HTTPS = "https:////" ; Program ( ) { } public static Program findProgram ( String extension ) { } public static String [ ] getExtensions ( ) { } static Program getProgram ( NSBundle bundle ) { } public static Program [ ] getPrograms ( ) { } static NSURL getURL ( String fileName ) { } static boolean isExecutable ( String fileName ) { } public static boolean launch ( String fileName ) { } static boolean launch ( String fileName , String workingDir ) { if ( fileName == null ) SWT . error ( ERROR_NULL_ARGUMENT ) ; NSAutoreleasePool pool = ( ( NSAutoreleasePool ) ( new NSAutoreleasePool ( ) . alloc ( ) . init ( ) ) ) ; try { <START_BUG> if ( ( workingDir != null ) && ( Program . isExecutable ( fileName ) ) ) { <END_BUG> try { Compatibility . exec ( new String [ ] { fileName } , null , workingDir ) ; return true ; } catch ( IOException e ) { return false ; } } NSURL url = Program . getURL ( fileName ) ; NSWorkspace workspace = NSWorkspace . sharedWorkspace ( ) ; return workspace . openURL ( url ) ; } finally { pool . release ( ) ; } } public boolean execute ( String fileName ) { } public ImageData getImageData ( ) { } public String getName ( ) { } public boolean equals ( Object other ) { } public int hashCode ( ) { } public String toString ( ) { } }

Fix:
if ( Program . isExecutable ( fileName ) ) {
Buggy code:
public class CustomScopeConfigurerTests extends TestCase { private static final String FOO_SCOPE = "fooScope" ; public void testWithNoScopes ( ) throws Exception { } public void testSunnyDayWithBonaFideScopeInstance ( ) throws Exception { } public void testSunnyDayWithBonaFideScopeClass ( ) throws Exception { } public void testSunnyDayWithBonaFideScopeClassname ( ) throws Exception { } public void testWhereScopeMapHasNullScopeValueInEntrySet ( ) throws Exception { } public void testWhereScopeMapHasNonScopeInstanceInEntrySet ( ) throws Exception { } public void testWhereScopeMapHasNonStringTypedScopeNameInKeySet ( ) throws Exception { new CustomScopeConfigurerTests . ConfigurableListableBeanFactoryMockTemplate ( ) { protected void doTest ( final ConfigurableListableBeanFactory factory ) { <START_BUG> new org . springframework . test . AssertThrows ( IllegalArgumentException . class ) { <END_BUG> public void test ( ) throws Exception { java . util . Map scopes = new java . util . HashMap ( ) ; scopes . put ( this , new NoOpScope ( ) ) ; CustomScopeConfigurer figurer = new CustomScopeConfigurer ( ) ; figurer . setScopes ( scopes ) ; figurer . postProcessBeanFactory ( factory ) ; } } . runTest ( ) ; } } . test ( ) ; } private abstract class ConfigurableListableBeanFactoryMockTemplate extends AbstractScalarMockTemplate { public ConfigurableListableBeanFactoryMockTemplate ( ) { } public final void setupExpectations ( MockControl mockControl , Object mockObject ) throws Exception { } public final void doTest ( Object mockObject ) throws Exception { } public void setupExpectations ( MockControl mockControl , ConfigurableListableBeanFactory factory ) throws Exception { } protected abstract void doTest ( ConfigurableListableBeanFactory factory ) throws Exception { } } }

Fix:
new org . springframework . test . AssertThrows ( ClassCastException . class ) {