nus-yam/ex-repair huggingface dataset:
Buggy code:
public abstract class WebResponse extends Response { public static final Duration MAX_CACHE_DURATION = Duration . days ( 365 ) ; public abstract void addCookie ( final Cookie cookie ) { } public abstract void clearCookie ( final Cookie cookie ) { } public abstract void setHeader ( String name , String value ) { } public abstract void addHeader ( String name , String value ) { } public abstract void setDateHeader ( String name , Time date ) { } public abstract void setContentLength ( final long length ) { } public abstract void setContentType ( final String mimeType ) { } public void setLastModifiedTime ( final Time time ) { } public void setAttachmentHeader ( final String filename ) { } public void setInlineHeader ( final String filename ) { } public abstract void setStatus ( int sc ) { } public abstract void sendError ( int sc , String msg ) { } public abstract String encodeRedirectURL ( CharSequence url ) { } public abstract void sendRedirect ( String url ) { } public abstract boolean isRedirect ( ) { } public abstract void flush ( ) { } public void disableCaching ( ) { } public void enableCaching ( Duration duration , final WebResponse . CacheScope scope ) { Args . notNull ( duration , "duration" ) ; Args . notNull ( scope , "scope" ) ; if ( ( duration . compareTo ( WebResponse . MAX_CACHE_DURATION ) ) > 0 ) { duration = WebResponse . MAX_CACHE_DURATION ; } Time now = Time . now ( ) ; setDateHeader ( "Date" , now ) ; setDateHeader ( "Expires" , now . add ( duration ) ) ; setHeader ( "Cache-Control" , scope . cacheControl ) ; <START_BUG> addHeader ( "Cache-Control" , ( "max-age=" + ( duration . getMilliseconds ( ) ) ) ) ; <END_BUG> } public static enum CacheScope { PUBLIC ( "public" ) , PRIVATE ( "private" ) ; private final String cacheControl ; CacheScope ( final String cacheControl ) { } } }

Fix:
addHeader ( "Cache-Control" , ( "max-age=" + ( duration . seconds ( ) ) ) ) ;
Buggy code:
public class DomainDeploymentUtils implements Closeable { private final List < DomainDeploymentUtils . Deployment > deployments = new ArrayList < DomainDeploymentUtils . Deployment > ( ) ; private final ModelControllerClient client ; private boolean injectedClient = true ; public DomainDeploymentUtils ( ) throws UnknownHostException { } public DomainDeploymentUtils ( ModelControllerClient client ) throws UnknownHostException { } public DomainDeploymentUtils ( String archiveName , Package pkg ) throws UnknownHostException { } public DomainDeploymentUtils ( String archiveName , Package pkg , boolean show ) throws UnknownHostException { } public synchronized void addDeployment ( String archiveName , Package pkg ) { } public synchronized void addDeployment ( String archiveName , Package pkg , boolean show ) { } public synchronized void deploy ( ) throws IOException , InterruptedException , ExecutionException , DuplicateDeploymentNameException { ModelNode op = new ModelNode ( ) ; <START_BUG> OperationBuilder builder = new OperationBuilder ( op ) ; <END_BUG> op . get ( OP ) . set ( "composite" ) ; op . get ( OP_ADDR ) . setEmptyList ( ) ; ModelNode steps = op . get ( "steps" ) ; for ( DomainDeploymentUtils . Deployment deployment : deployments ) { steps . add ( deployment . addDeployment ( builder ) ) ; } op . get ( OPERATION_HEADERS , ROLLBACK_ON_RUNTIME_FAILURE ) . set ( DomainDeploymentUtils . getRolloutPlan ( ) ) ; execute ( builder . build ( ) ) ; } public synchronized void undeploy ( ) throws IOException { } public MBeanServerConnection getServerOneConnection ( ) throws Exception { } public String showServerOneJndi ( ) throws Exception { } public MBeanServerConnection getServerTwoConnection ( ) throws Exception { } public String showServerTwoJndi ( ) throws Exception { } @ Override public void close ( ) throws IOException { } private Set < String > getDeploymentNames ( ) throws IOException { } private ModelNode execute ( ModelNode op ) throws IOException { } private ModelNode execute ( Operation op ) throws IOException { } private static ModelNode getRolloutPlan ( ) { } private class Deployment { final String archiveName ; final JavaArchive archive ; final File realArchive ; public Deployment ( String archiveName , Package pkg , boolean show ) { } private void addFiles ( JavaArchive archive , File dir , ArchivePath dest ) { } public synchronized ModelNode addDeployment ( OperationBuilder context ) throws IOException { } public synchronized ModelNode removeDeployment ( ) { } private File getSourceMetaInfDir ( ) { } private File getOutputDir ( ) { } } }

Fix:
OperationBuilder builder = new OperationBuilder ( op , true ) ;
Buggy code:
public class MultiSearcher extends Searcher { private static class CachedDfSource extends Searcher { private Map dfMap ; private int maxDoc ; public CachedDfSource ( Map dfMap , int maxDoc , Similarity similarity ) { } public int docFreq ( Term term ) { } public int [ ] docFreqs ( Term [ ] terms ) { } public int maxDoc ( ) { } public Query rewrite ( Query query ) { } public void close ( ) { } public Document doc ( int i ) { } public Document doc ( int i , FieldSelector fieldSelector ) { } public Explanation explain ( Weight weight , int doc ) { } public void search ( Weight weight , Filter filter , HitCollector results ) { } public TopDocs search ( Weight weight , Filter filter , int n ) { } public TopFieldDocs search ( Weight weight , Filter filter , int n , Sort sort ) { } } private Searchable [ ] searchables ; private int [ ] starts ; private int maxDoc = 0 ; public MultiSearcher ( Searchable [ ] searchables ) throws IOException { } public Searchable [ ] getSearchables ( ) { } protected int [ ] getStarts ( ) { } public void close ( ) throws IOException { } public int docFreq ( Term term ) throws IOException { } public Document doc ( int n ) throws IOException , CorruptIndexException { } public Document doc ( int n , FieldSelector fieldSelector ) throws IOException , CorruptIndexException { } public int subSearcher ( int n ) { int lo = 0 ; int hi = ( searchables . length ) - 1 ; while ( hi >= lo ) { <START_BUG> int mid = ( lo + hi ) > > 1 ; <END_BUG> int midValue = starts [ mid ] ; if ( n < midValue ) hi = mid - 1 ; else if ( n > midValue ) lo = mid + 1 ; else { while ( ( ( mid + 1 ) < ( searchables . length ) ) && ( ( starts [ ( mid + 1 ) ] ) == midValue ) ) { mid ++ ; } return mid ; } } return hi ; } public int subDoc ( int n ) { } public int maxDoc ( ) throws IOException { } public TopDocs search ( Weight weight , Filter filter , int nDocs ) throws IOException { } public TopFieldDocs search ( Weight weight , Filter filter , int n , Sort sort ) throws IOException { } public void search ( Weight weight , Filter filter , final HitCollector results ) throws IOException { } public Query rewrite ( Query original ) throws IOException { } public Explanation explain ( Weight weight , int doc ) throws IOException { } protected Weight createWeight ( Query original ) throws IOException { } }

Fix:
int mid = ( lo + hi ) > > > 1 ;
Buggy code:
public class CodeSnippetEvaluator extends Evaluator implements EvaluationConstants { static final boolean DEVELOPMENT_MODE = false ; char [ ] codeSnippet ; CodeSnippetToCuMapper mapper ; CodeSnippetEvaluator ( char [ ] codeSnippet , EvaluationContext context , INameEnvironment environment , Map options , IRequestor requestor , IProblemFactory problemFactory ) { } protected void addEvaluationResultForCompilationProblem ( Map resultsByIDs , IProblem problem , char [ ] cuSource ) { } protected char [ ] getClassName ( ) { } Compiler getCompiler ( ICompilerRequestor requestor ) { Compiler compiler = null ; if ( ! ( CodeSnippetEvaluator . DEVELOPMENT_MODE ) ) { <START_BUG> compiler = new CodeSnippetCompiler ( this . environment , DefaultErrorHandlingPolicies . exitAfterAllProblems ( ) , this . options , requestor , this . problemFactory , this . context , getMapper ( ) . startPosOffset , ( ( ( ( getMapper ( ) . startPosOffset ) + ( codeSnippet . length ) ) - 1 ) + ( LINE_SEPARATOR_CHARS ) ) ) ; <END_BUG> IBinaryType binary = this . context . getRootCodeSnippetBinary ( ) ; if ( binary != null ) { compiler . lookupEnvironment . cacheBinaryType ( binary ) ; } VariablesInfo installedVars = this . context . installedVars ; if ( installedVars != null ) { ClassFile [ ] globalClassFiles = installedVars . classFiles ; for ( int i = 0 ; i < ( globalClassFiles . length ) ; i ++ ) { ClassFileReader binaryType = null ; try { binaryType = new ClassFileReader ( globalClassFiles [ i ] . getBytes ( ) , null ) ; } catch ( ClassFormatException e ) { e . printStackTrace ( ) ; } compiler . lookupEnvironment . cacheBinaryType ( binaryType ) ; } } } else { compiler = new Compiler ( getWrapperEnvironment ( ) , DefaultErrorHandlingPolicies . exitAfterAllProblems ( ) , this . options , requestor , this . problemFactory ) ; } return compiler ; } private CodeSnippetToCuMapper getMapper ( ) { } protected char [ ] getSource ( ) { } private INameEnvironment getWrapperEnvironment ( ) { } }

Fix:
compiler = new CodeSnippetCompiler ( this . environment , DefaultErrorHandlingPolicies . exitAfterAllProblems ( ) , this . options , requestor , this . problemFactory , this . context , getMapper ( ) . startPosOffset , ( ( ( getMapper ( ) . startPosOffset ) + ( codeSnippet . length ) ) - 1 ) ) ;
Buggy code:
public class Transaction extends BaseTransaction implements Persistent { private Attachment aAttachment = null ; public void create ( NumberKey typeId , ScarabUser user , Attachment attachment ) throws Exception { } public Attachment getAttachment ( ) throws Exception { } public void setAttachment ( Attachment v ) throws Exception { } public List getActivityList ( ) throws Exception { } public void sendEmail ( TemplateContext context , Issue issue , String subject , String template ) throws Exception { TemplateEmail te = new TemplateEmail ( ) ; if ( context == null ) { context = new DefaultTemplateContext ( ) ; } context . put ( "issue" , issue ) ; context . put ( "attachment" , aAttachment ) ; context . put ( "activityList" , getActivityList ( ) ) ; te . setContext ( context ) ; te . setFrom ( Turbine . getConfiguration ( ) . getString ( "scarab.email.modifyissue.fromName" , "Scarab<seq2seq4repair_space>System" ) , Turbine . getConfiguration ( ) . getString ( "scarab.email.modifyissue.fromAddress" , "help@scarab.tigris.org" ) ) ; if ( subject == null ) { <START_BUG> te . setSubject ( ( ( ( ( "[" + ( issue . getScarabModule ( ) . getRealName ( ) . toUpperCase ( ) ) ) + "]<seq2seq4repair_space>Issue<seq2seq4repair_space>#" ) + ( issue . getUniqueId ( ) ) ) + "<seq2seq4repair_space>modified" ) ) ; <END_BUG> } else { te . setSubject ( subject ) ; } if ( template == null ) { te . setTemplate ( Turbine . getConfiguration ( ) . getString ( "scarab.email.modifyissue.template" , "email//ModifyIssue.vm" ) ) ; } else { te . setTemplate ( template ) ; } List associatedUsers = issue . getAssociatedUsers ( ) ; Iterator iter = associatedUsers . iterator ( ) ; while ( iter . hasNext ( ) ) { ScarabUser toUser = ( ( ScarabUser ) ( iter . next ( ) ) ) ; te . setTo ( ( ( ( toUser . getFirstName ( ) ) + "<seq2seq4repair_space>" ) + ( toUser . getLastName ( ) ) ) , toUser . getUserName ( ) ) ; te . send ( ) ; } } public void sendEmail ( TemplateContext context , Issue issue ) throws Exception { } public void sendEmail ( Issue issue ) throws Exception { } public void sendEmail ( Issue issue , String subject , String template ) throws Exception { } }

Fix:
te . setSubject ( ( ( ( ( "[" + ( issue . getModule ( ) . getRealName ( ) . toUpperCase ( ) ) ) + "]<seq2seq4repair_space>Issue<seq2seq4repair_space>#" ) + ( issue . getUniqueId ( ) ) ) + "<seq2seq4repair_space>modified" ) ) ;
Buggy code:
public final class InteractiveInventorySlot extends AbstractDraggable implements DropTarget , UseTarget { private static final byte REFERENCE_ID = 3 ; private final InventorySlot parentItem ; public InteractiveInventorySlot ( final InventorySlot item ) { } @ Override public void dragTo ( final InteractiveChar targetChar ) { } @ Override public void dragTo ( final InteractiveInventorySlot targetSlot ) { <START_BUG> if ( ( ! ( isValidItem ( ) ) ) || ( targetSlot . isValidItem ( ) ) ) { <END_BUG> return ; } final DragInvInvCmd cmd = CommandFactory . getInstance ( ) . getCommand ( CMD_DRAG_INV_INV , DragInvInvCmd . class ) ; cmd . setDrag ( getSlotId ( ) , targetSlot . getSlotId ( ) ) ; cmd . send ( ) ; } @ Override public void dragTo ( final InteractiveMapTile targetTile ) { } @ Override public void encodeUse ( final NetCommWriter writer ) { } public int getSlotId ( ) { } public boolean isValidItem ( ) { } }

Fix:
if ( ! ( isValidItem ( ) ) ) {
Buggy code:
public final class BoundedQueueThreadPoolExecutorElement extends AbstractExecutorElement < BoundedQueueThreadPoolExecutorElement > { private static final long serialVersionUID = - 6314205265652284301L ; private String handoffExecutor ; private boolean blocking ; private boolean allowCoreTimeout ; private ScaledCount queueLength ; private ScaledCount coreThreads ; public BoundedQueueThreadPoolExecutorElement ( final Location location , final String name ) { } public BoundedQueueThreadPoolExecutorElement ( final XMLExtendedStreamReader reader ) throws XMLStreamException { } public void activate ( final ServiceActivatorContext context ) { final BatchBuilder batchBuilder = context . getBatchBuilder ( ) ; final ScaledCount coreThreads = this . coreThreads ; int coreThreadsValue = ( coreThreads != null ) ? coreThreads . getScaledCount ( ) : 0 ; final ScaledCount maxThreads = getMaxThreads ( ) ; int maxThreadsValue = ( maxThreads != null ) ? maxThreads . getScaledCount ( ) : Integer . MAX_VALUE ; final ScaledCount queueLength = this . queueLength ; int queueLengthValue = ( queueLength != null ) ? queueLength . getScaledCount ( ) : Integer . MAX_VALUE ; TimeSpec keepAlive = getKeepaliveTime ( ) ; if ( keepAlive == null ) keepAlive = TimeSpec . DEFAULT_KEEPALIVE ; final BoundedQueueThreadPoolService service = new BoundedQueueThreadPoolService ( coreThreadsValue , maxThreadsValue , queueLengthValue , blocking , keepAlive , allowCoreTimeout ) ; final ServiceName serviceName = JBOSS_THREAD_EXECUTOR . append ( getName ( ) ) ; final BatchServiceBuilder < ExecutorService > serviceBuilder = batchBuilder . addService ( serviceName , service ) ; final String threadFactory = getThreadFactory ( ) ; final ServiceName threadFactoryName ; if ( threadFactory == null ) { threadFactoryName = serviceName . append ( "thread-factory" ) ; batchBuilder . addService ( threadFactoryName , new ThreadFactoryService ( ) ) ; } else { threadFactoryName = JBOSS_THREAD_FACTORY . append ( threadFactory ) ; } serviceBuilder . addDependency ( threadFactoryName , ThreadFactory . class , service . getThreadFactoryInjector ( ) ) ; final String handoffExecutor = this . handoffExecutor ; <START_BUG> if ( handoffExecutor == null ) { <END_BUG> final ServiceName handoffExecutorName = JBOSS_THREAD_EXECUTOR . append ( handoffExecutor ) ; serviceBuilder . addDependency ( handoffExecutorName , Executor . class , service . getHandoffExecutorInjector ( ) ) ; } } public long elementHash ( ) { } protected void appendDifference ( final Collection < AbstractModelUpdate < BoundedQueueThreadPoolExecutorElement > > target , final BoundedQueueThreadPoolExecutorElement other ) { } protected Class < BoundedQueueThreadPoolExecutorElement > getElementClass ( ) { } public void writeContent ( final XMLExtendedStreamWriter streamWriter ) throws XMLStreamException { } }

Fix:
if ( handoffExecutor != null ) {
Buggy code:
public class Memory { public static void main ( String [ ] args ) { } public HashMap < String , Long > tentativeClock = new HashMap < String , Long > ( ) ; public HashMap < String , Long > committedClock = new HashMap < String , Long > ( ) ; public List < Command > committedWriteLog = new ArrayList < Command > ( ) ; public List < Command > deliveredWriteLog = new LinkedList < Command > ( ) ; public List < Command > undeliveredWriteLog = new LinkedList < Command > ( ) ; public PrintLog pLog = new PrintLog ( ) ; public int csn = 0 ; public Replica replica ; final CommandComparator comparator = new CommandComparator ( ) ; public Memory ( Replica replica ) { } public boolean acceptCommand ( Command command ) { if ( ( command . CSN ) == ( csn ) ) { replica . performCommittedOperation ( command . operation ) ; replica . logger . info ( ( "Committing:<seq2seq4repair_space>" + ( command . toString ( ) ) ) ) ; committedClock . put ( command . serverId , command . acceptStamp ) ; committedWriteLog . add ( csn , command ) ; pLog . add ( command ) ; ( csn ) ++ ; return true ; } else if ( ( command . CSN ) > ( csn ) ) { replica . logger . info ( ( "Can't<seq2seq4repair_space>commit<seq2seq4repair_space>yet:<seq2seq4repair_space>" + ( command . toString ( ) ) ) ) ; undeliveredWriteLog . add ( command ) ; return false ; } else if ( ( command . CSN ) >= 0 ) { replica . logger . info ( ( "Already<seq2seq4repair_space>committed<seq2seq4repair_space>this,<seq2seq4repair_space>deleting:<seq2seq4repair_space>" + ( command . toString ( ) ) ) ) ; return false ; } if ( ( Memory . completeV ( tentativeClock , command . serverId ) ) == ( ( command . acceptStamp ) - 1 ) ) { replica . logger . info ( ( "Performing:<seq2seq4repair_space>" + ( command . toString ( ) ) ) ) ; deliveredWriteLog . add ( command ) ; tentativeClock . put ( command . serverId , command . acceptStamp ) ; replica . performOperation ( command . operation ) ; pLog . add ( command ) ; <START_BUG> if ( Replica . isPrimary ) { <END_BUG> commit ( command ) ; } return true ; } else if ( ( Memory . completeV ( tentativeClock , command . serverId ) ) < ( ( command . acceptStamp ) - 1 ) ) { replica . logger . info ( ( "Can't<seq2seq4repair_space>perform<seq2seq4repair_space>yet:<seq2seq4repair_space>" + ( command . toString ( ) ) ) ) ; undeliveredWriteLog . add ( command ) ; return false ; } replica . logger . info ( ( "Already<seq2seq4repair_space>performed<seq2seq4repair_space>this,<seq2seq4repair_space>deleting:<seq2seq4repair_space>" + ( command . toString ( ) ) ) ) ; return false ; } public void checkUndeliveredMessages ( ) { } public void commitDeliveredMessages ( ) { } public void garbageCollect ( ) { } private void commit ( Command c ) { } static long completeV ( HashMap < String , Long > clock , String serverId ) { } long myNextCommand ( ) { } HashSet < Command > unseenCommands ( VectorClock other , int otherCSN ) { } boolean clientDependencyCheck ( MessageWithClock message ) { } void buildPlaylist ( ) { } public void printLogs ( ) { } public void printClocks ( ) { } }

Fix:
if ( replica . isPrimary ) {
Buggy code:
public final class FlashMap extends HashMap < String , Object > implements Comparable < FlashMap > { private static final long serialVersionUID = 1L ; private String targetRequestPath ; private final MultiValueMap < String , String > targetRequestParams = new org . springframework . util . LinkedMultiValueMap < String , String > ( ) ; private long expirationStartTime ; private int timeToLive ; public void setTargetRequestPath ( String path ) { } public String getTargetRequestPath ( ) { } public FlashMap addTargetRequestParams ( MultiValueMap < String , String > params ) { } public FlashMap addTargetRequestParam ( String name , String value ) { } public MultiValueMap < String , String > getTargetRequestParams ( ) { <START_BUG> return targetRequestParams ; <END_BUG> } public void startExpirationPeriod ( int timeToLive ) { } public boolean isExpired ( ) { } public int compareTo ( FlashMap other ) { } @ Override public String toString ( ) { } }

Fix:
return this . targetRequestParams ;
Buggy code:
public class GroupsController implements Initializable { @ FXML private TitledPane manageGroups ; @ FXML private ListView groups ; @ FXML private ListView members ; @ FXML private TextField groupSelected ; @ FXML private TextField newGroupName ; @ FXML private Button addGroupBtn ; @ FXML private TextField addUserName ; @ FXML private Button addUserBtn ; @ FXML private Button deleteGroupBtn ; @ FXML private Button deleteMemberBtn ; @ FXML private Button finishBtn ; private MainController application ; private final ObservableList obsGroupsList = FXCollections . observableArrayList ( ) ; private final ObservableList obsMembersList = FXCollections . observableArrayList ( ) ; List < Group > listGroups = null ; public void setApp ( MainController application ) { } @ FXML public void initialize ( URL location , ResourceBundle resources ) { } public void loadGroups ( ) { } @ FXML public void changeGroupName ( ActionEvent event ) { } @ FXML public void deleteGroup ( ActionEvent event ) { } @ FXML public void deleteMemberFromGroup ( ActionEvent event ) { } @ FXML public void addNewGroup ( ActionEvent event ) { } @ FXML public void addMemberInGroup ( ActionEvent event ) { if ( Strings . isNullOrEmpty ( addUserName . getText ( ) ) ) { showWarningDialog ( "Veuillez<seq2seq4repair_space>entrer<seq2seq4repair_space>le<seq2seq4repair_space>login<seq2seq4repair_space>de<seq2seq4repair_space>l'utilisateur." ) ; } else { String selectedGrp = groups . getSelectionModel ( ) . getSelectedItem ( ) . toString ( ) ; for ( Group g : listGroups ) { if ( g . getNom ( ) . equals ( selectedGrp ) ) { Boolean inGroup = false ; for ( User u : g . getUsers ( ) ) { if ( addUserName . getText ( ) . equalsIgnoreCase ( u . getLogin ( ) ) ) { showWarningDialog ( "Ajout<seq2seq4repair_space>impossible:<seq2seq4repair_space>L'utilisateur<seq2seq4repair_space>existe<seq2seq4repair_space>déjà<seq2seq4repair_space>dans<seq2seq4repair_space>le<seq2seq4repair_space>groupe<seq2seq4repair_space>!" ) ; inGroup = true ; return ; } } if ( ! inGroup ) { User user = checkIfFriend ( addUserName . getText ( ) ) ; if ( user != null ) { <START_BUG> application . getIHMtoDATA ( ) . addUserInGroup ( user , g ) ; <END_BUG> obsMembersList . add ( user . getLogin ( ) ) ; showInformationDialog ( ( ( user . getLogin ( ) ) + "<seq2seq4repair_space>a<seq2seq4repair_space>été<seq2seq4repair_space>ajouté<seq2seq4repair_space>dans<seq2seq4repair_space>le<seq2seq4repair_space>groupe<seq2seq4repair_space>avec<seq2seq4repair_space>succès." ) ) ; addUserName . clear ( ) ; return ; } else { showWarningDialog ( "Ajout<seq2seq4repair_space>impossible:<seq2seq4repair_space>L'utilisateur<seq2seq4repair_space>n'est<seq2seq4repair_space>pas<seq2seq4repair_space>votre<seq2seq4repair_space>ami<seq2seq4repair_space>ou<seq2seq4repair_space>n'existe<seq2seq4repair_space>pas." ) ; return ; } } } } } } private void displayUsers ( String groupName ) { } private void disableFields ( Boolean b ) { } @ FXML private void finish ( ) { } private User checkIfFriend ( String login ) { } }

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

Fix:
if ( ! ( Util . isExcluded ( parentFolder , exclusionPatterns ) ) ) {
Buggy code:
public class ToggleMarkCommand extends FolderCommand { protected FolderCommandAdapter adapter ; private WorkerStatusController worker ; private List commandList ; public ToggleMarkCommand ( DefaultCommandReference [ ] references ) { } public void updateGUI ( ) throws Exception { } public void execute ( WorkerStatusController worker ) throws Exception { this . worker = worker ; adapter = new FolderCommandAdapter ( ( ( FolderCommandReference [ ] ) ( getReferences ( ) ) ) ) ; FolderCommandReference [ ] r = adapter . getSourceFolderReferences ( ) ; for ( int i = 0 ; i < ( r . length ) ; i ++ ) { Object [ ] uids = r [ i ] . getUids ( ) ; MessageFolder srcFolder = ( ( MessageFolder ) ( r [ i ] . getFolder ( ) ) ) ; ( ( StatusObservableImpl ) ( srcFolder . getObservable ( ) ) ) . setWorker ( worker ) ; int markVariant = r [ i ] . getMarkVariant ( ) ; List list1 = new ArrayList ( ) ; List list2 = new ArrayList ( ) ; for ( int j = 0 ; j < ( uids . length ) ; j ++ ) { Flags flags = srcFolder . getFlags ( uids [ j ] ) ; boolean result = false ; if ( markVariant == ( MarkMessageCommand . MARK_AS_READ ) ) { if ( flags . getSeen ( ) ) result = true ; } else if ( markVariant == ( MarkMessageCommand . MARK_AS_FLAGGED ) ) { if ( flags . getFlagged ( ) ) result = true ; } else if ( markVariant == ( MarkMessageCommand . MARK_AS_EXPUNGED ) ) { if ( flags . getExpunged ( ) ) result = true ; } else if ( markVariant == ( MarkMessageCommand . MARK_AS_ANSWERED ) ) { if ( flags . getAnswered ( ) ) result = true ; } else if ( markVariant == ( MarkMessageCommand . MARK_AS_DRAFT ) ) { if ( flags . getDraft ( ) ) result = true ; } else if ( markVariant == ( MarkMessageCommand . MARK_AS_SPAM ) ) { boolean spam = ( ( Boolean ) ( srcFolder . getAttribute ( uids [ j ] , "columba.spam" ) ) ) . booleanValue ( ) ; if ( spam ) result = true ; } if ( result ) list1 . add ( uids [ j ] ) ; else list2 . add ( uids [ j ] ) ; } FolderCommandReference [ ] ref = new FolderCommandReference [ 1 ] ; if ( ( list1 . size ( ) ) > 0 ) { ref [ 0 ] = new FolderCommandReference ( srcFolder , list1 . toArray ( ) ) ; ref [ 0 ] . setMarkVariant ( ( - markVariant ) ) ; MarkMessageCommand c = new MarkMessageCommand ( ref ) ; commandList . add ( c ) ; c . execute ( worker ) ; if ( ( markVariant == ( MarkMessageCommand . MARK_AS_SPAM ) ) || ( markVariant == ( MarkMessageCommand . MARK_AS_NOTSPAM ) ) ) { <START_BUG> processSpamFilter ( uids , srcFolder , markVariant ) ; <END_BUG> } } if ( ( list2 . size ( ) ) > 0 ) { ref [ 0 ] = new FolderCommandReference ( srcFolder , list2 . toArray ( ) ) ; ref [ 0 ] . setMarkVariant ( markVariant ) ; MarkMessageCommand c = new MarkMessageCommand ( ref ) ; commandList . add ( c ) ; c . execute ( worker ) ; if ( ( markVariant == ( MarkMessageCommand . MARK_AS_SPAM ) ) || ( markVariant == ( MarkMessageCommand . MARK_AS_NOTSPAM ) ) ) { processSpamFilter ( uids , srcFolder , markVariant ) ; } } } } private void processSpamFilter ( Object [ ] uids , MessageFolder srcFolder , int markVariant ) throws Exception { } }

Fix:
processSpamFilter ( uids , srcFolder , ( - markVariant ) ) ;
Buggy code:
public class Log4jLogAdapter implements LogAdapter , Plugin { public boolean canWork ( ) { try { <START_BUG> Class . forName ( "org.apache.log4j.Logger" , false , Thread . currentThread ( ) . getContextClassLoader ( ) ) ; <END_BUG> return true ; } catch ( Throwable e ) { } return false ; } public Log getLogger ( String className ) { } static class Log4JLogger extends AbstractLog { public static final String SUPER_FQCN = AbstractLog . class . getName ( ) ; public static final String SELF_FQCN = Log4jLogAdapter . Log4JLogger . class . getName ( ) ; private Logger logger ; private static boolean hasTrace ; Log4JLogger ( String className ) { } public void debug ( Object message , Throwable t ) { } public void error ( Object message , Throwable t ) { } public void fatal ( Object message , Throwable t ) { } public void info ( Object message , Throwable t ) { } public void trace ( Object message , Throwable t ) { } public void warn ( Object message , Throwable t ) { } @ Override protected void log ( int level , Object message , Throwable tx ) { } } }

Fix:
Class . forName ( "org.apache.log4j.Logger" , false , Log4jLogAdapter . class . getClassLoader ( ) ) ;
Buggy code:
@ RunWith ( Arquillian . class ) @ RunAsClient public class CliArgumentsTestCase extends CliScriptTestBase { private static final String tempDir = System . getProperty ( "java.io.tmpdir" ) ; @ Test public void testVersionArgument ( ) throws Exception { } @ Test public void testVersionAsCommandArgument ( ) throws Exception { } @ Test public void testFileArgument ( ) throws Exception { } @ Test public void testConnectArgument ( ) throws Exception { } @ Test public void testWrongControler ( ) throws Exception { <START_BUG> int exitCode = execute ( TestSuiteEnvironment . getServerAddress ( ) , ( ( TestSuiteEnvironment . getServerPort ( ) ) - 1 ) , true , "quit" , false ) ; <END_BUG> assertTrue ( ( exitCode != 0 ) ) ; } }

Fix:
int exitCode = execute ( TestSuiteEnvironment . getServerAddress ( ) , ( ( TestSuiteEnvironment . getServerPort ( ) ) - 1 ) , true , "quit" , true ) ;
Buggy code:
@ SuppressWarnings ( "unchecked" ) public class GenericHibernateDao < T > implements GenericDao < T > { @ Autowired private SessionFactory sessionFactory ; private Class < T > persistentClass ; public GenericHibernateDao ( ) { } public T getById ( Long id ) { <START_BUG> return ( ( T ) ( getSession ( ) . load ( getPersistentClass ( ) , id ) ) ) ; <END_BUG> } protected Session getSession ( ) { } private SessionFactory getSessionFactory ( ) { } public Class < T > getPersistentClass ( ) { } @ Override public List < T > listAll ( ) { } @ Override public T save ( T entity ) { } @ Override public void delete ( T entity ) { } @ Override public void deleteById ( Long id ) { } }

Fix:
return ( ( T ) ( getSession ( ) . get ( getPersistentClass ( ) , id ) ) ) ;
Buggy code:
public class FastaParser { private final File file ; public FastaParser ( String filePathName ) { } public List < String > parseFastaFile ( ) throws FileNotFoundException { ArrayList < String > resultList = new ArrayList < > ( ) ; boolean first = true ; String accLine = "" ; try ( Scanner sc = new Scanner ( file ) ) { while ( sc . hasNextLine ( ) ) { String line = sc . nextLine ( ) . trim ( ) ; <START_BUG> if ( ( line . charAt ( 0 ) ) == '>' ) { <END_BUG> if ( first ) first = false ; else { resultList . add ( accLine ) ; accLine = "" ; } } else { accLine += line ; } } } resultList . add ( accLine ) ; return resultList ; } public static void main ( String [ ] args ) throws FileNotFoundException { } No newline ; at end ; of file ; }

Fix:
if ( ( ! ( ( line . length ( ) ) == 0 ) ) && ( ( line . charAt ( 0 ) ) == '>' ) ) {
Buggy code:
public class FloatLiteral extends NumberLiteral { float value ; static final float Float_MIN_VALUE = Float . intBitsToFloat ( 1 ) ; public FloatLiteral ( char [ ] token , int s , int e ) { } public void computeConstant ( ) { } public void generateCode ( BlockScope currentScope , CodeStream codeStream , boolean valueRequired ) { int pc = codeStream . position ; if ( valueRequired ) if ( ( ( implicitConversion ) > > 4 ) == ( TypeIds . T_float ) ) codeStream . generateInlinedValue ( value ) ; else codeStream . generateConstant ( constant , implicitConversion ) ; <START_BUG> codeStream . recordPositionsFrom ( pc , this ) ; <END_BUG> } public TypeBinding literalType ( BlockScope scope ) { } public void traverse ( IAbstractSyntaxTreeVisitor visitor , BlockScope blockScope ) { } }

Fix:
codeStream . recordPositionsFrom ( pc , this . sourceStart ) ;
Buggy code:
public class CreateFilterOnFromAction extends AbstractColumbaAction implements SelectionListener { public CreateFilterOnFromAction ( FrameMediator frameMediator ) { } public void actionPerformed ( ActionEvent evt ) { FolderCommandReference [ ] r = ( ( org . columba . mail . gui . frame . MailFrameMediator ) ( getFrameMediator ( ) ) ) . getTableSelection ( ) ; <START_BUG> CreateFilterOnMessageCommand c = new CreateFilterOnMessageCommand ( r , CreateFilterOnMessageCommand . FILTER_ON_FROM ) ; <END_BUG> processor . addOp ( c ) ; } public void selectionChanged ( SelectionChangedEvent e ) { } }

Fix:
CreateFilterOnMessageCommand c = new CreateFilterOnMessageCommand ( getFrameMediator ( ) , r , CreateFilterOnMessageCommand . FILTER_ON_FROM ) ;
Buggy code:
public class Snippet239 { public static void main ( String [ ] args ) { final Display display = new Display ( ) ; Shell shell = new Shell ( display ) ; shell . setText ( "Text<seq2seq4repair_space>spans<seq2seq4repair_space>two<seq2seq4repair_space>columns<seq2seq4repair_space>in<seq2seq4repair_space>a<seq2seq4repair_space>TableItem" ) ; shell . setLayout ( new FillLayout ( ) ) ; final Table table = new Table ( shell , ( ( SWT . MULTI ) | ( SWT . FULL_SELECTION ) ) ) ; table . setHeaderVisible ( true ) ; int columnCount = 4 ; for ( int i = 0 ; i < columnCount ; i ++ ) { TableColumn column = new TableColumn ( table , SWT . NONE ) ; column . setText ( ( "Column<seq2seq4repair_space>" + i ) ) ; } int itemCount = 8 ; for ( int i = 0 ; i < itemCount ; i ++ ) { TableItem item = new TableItem ( table , SWT . NONE ) ; item . setText ( 0 , ( ( "item<seq2seq4repair_space>" + i ) + "<seq2seq4repair_space>a" ) ) ; item . setText ( 3 , ( ( "item<seq2seq4repair_space>" + i ) + "<seq2seq4repair_space>d" ) ) ; } final String string = "text<seq2seq4repair_space>that<seq2seq4repair_space>spans<seq2seq4repair_space>two<seq2seq4repair_space>columns" ; GC gc = new GC ( table ) ; final Point extent = gc . stringExtent ( string ) ; gc . dispose ( ) ; final TableColumn column1 = table . getColumn ( 1 ) ; final Color red = display . getSystemColor ( COLOR_RED ) ; Listener paintListener = new Listener ( ) { public void handleEvent ( Event event ) { switch ( event . type ) { case SWT . MeasureItem : { if ( ( ( event . index ) == 1 ) || ( ( event . index ) == 2 ) ) { event . width = ( extent . x ) // 2 ; <START_BUG> event . height = extent . y ; <END_BUG> } break ; } case SWT . PaintItem : { if ( ( ( event . index ) == 1 ) || ( ( event . index ) == 2 ) ) { int offset = 0 ; if ( ( event . index ) == 2 ) offset = column1 . getWidth ( ) ; event . gc . setForeground ( red ) ; int y = ( event . y ) + ( ( ( event . height ) - ( extent . y ) ) // 2 ) ; event . gc . drawString ( string , ( ( event . x ) - offset ) , y ) ; } break ; } } } } ; table . addListener ( MeasureItem , paintListener ) ; table . addListener ( PaintItem , paintListener ) ; for ( int i = 0 ; i < columnCount ; i ++ ) { table . getColumn ( i ) . pack ( ) ; } shell . pack ( ) ; shell . open ( ) ; while ( ! ( shell . isDisposed ( ) ) ) { if ( ! ( display . readAndDispatch ( ) ) ) display . sleep ( ) ; } display . dispose ( ) ; } }

Fix:
event . height = Math . max ( event . height , ( ( extent . y ) + 2 ) ) ;
Buggy code:
public class NonPassivatingBackingCacheImpl < K extends Serializable , V extends Cacheable < K > > extends AbstractBackingCache < K , V , NonPassivatingBackingCacheEntry < K , V > > implements BackingCacheEntryFactory < K , V , NonPassivatingBackingCacheEntry < K , V > > { private final StatefulObjectFactory < V > factory ; private final Map < K , NonPassivatingBackingCacheEntry < K , V > > cache = new ConcurrentHashMap < K , NonPassivatingBackingCacheEntry < K , V > > ( ) ; private final StatefulTimeoutInfo timeout ; private volatile ScheduledExecutorService executor ; private final ThreadFactory threadFactory ; private final Map < K , Future < ? > > expirationFutures = new ConcurrentHashMap < K , Future < ? > > ( ) ; public NonPassivatingBackingCacheImpl ( StatefulObjectFactory < V > factory , ThreadFactory threadFactory , StatefulTimeoutInfo timeout ) { } public NonPassivatingBackingCacheImpl ( StatefulObjectFactory < V > factory , ScheduledExecutorService executor , StatefulTimeoutInfo timeout ) { } @ Override public NonPassivatingBackingCacheEntry < K , V > create ( ) { } @ Override public NonPassivatingBackingCacheEntry < K , V > createEntry ( V item ) { } @ Override public void destroyEntry ( NonPassivatingBackingCacheEntry < K , V > entry ) { } @ Override public NonPassivatingBackingCacheEntry < K , V > get ( K key ) throws NoSuchEJBException { } @ Override public NonPassivatingBackingCacheEntry < K , V > peek ( K key ) throws NoSuchEJBException { } @ Override public NonPassivatingBackingCacheEntry < K , V > release ( K key ) { } @ Override public void discard ( K key ) { } @ Override public void remove ( K key ) { } @ Override public boolean isClustered ( ) { } @ Override public void start ( ) { } @ Override public void stop ( ) { } private void scheduleExpiration ( K id , boolean cancel ) { <START_BUG> if ( ( this . timeout ) != null ) { <END_BUG> Future < ? > future = ( cancel ) ? this . expirationFutures . remove ( id ) : this . expirationFutures . put ( id , this . executor . schedule ( new org . jboss . as . ejb3 . cache . spi . impl . RemoveTask < K > ( this , id ) , this . timeout . getValue ( ) , this . timeout . getTimeUnit ( ) ) ) ; if ( future != null ) { future . cancel ( false ) ; } } } }

Fix:
if ( ( ( this . timeout ) != null ) && ( ( timeout . getValue ( ) ) != ( - 1 ) ) ) {
Buggy code:
public class FloatConverter extends AbstractDecimalConverter < Float > { private static final long serialVersionUID = 1L ; public static final IConverter < Float > INSTANCE = new FloatConverter ( ) ; public Float convertToObject ( final String value , Locale locale ) { final Number number = parse ( value , ( - ( Float . MAX_VALUE ) ) , Float . MAX_VALUE , locale ) ; if ( number == null ) { return null ; } <START_BUG> return new Float ( number . floatValue ( ) ) ; <END_BUG> } @ Override protected Class < Float > getTargetType ( ) { } }

Fix:
return number . floatValue ( ) ;
Buggy code:
public final class ReflectionUtils { public static < T > T newInstance ( Class < T > clazz ) { } public static < T > T newInstance ( Class < T > clazz , Class [ ] types , Object [ ] args ) { } @ SuppressWarnings ( "unchecked" ) public static < T > T newInstance ( String className , Class [ ] types , Object [ ] args ) { } public static Object invokeInstanceMethod ( Object target , String methodName ) { } public static Object invokeInstanceMethod ( Object target , String methodName , Class < ? > type , Object arg ) { } public static Object invokeInstanceMethod ( Object target , String methodName , Class [ ] types , Object [ ] args ) { } public static Object invokeStaticMethod ( Class < ? > clazz , String methodName , Class < ? > type , Object arg ) { } @ SuppressWarnings ( { "NullableProblems" } ) public static Object invokeStaticMethod ( Class < ? > clazz , String methodName , Class [ ] types , Object [ ] args ) { } public static TargetInvocation cacheInvocation ( Class < ? > clazz , String methodName , Class [ ] types , Object [ ] args ) { } private static Object invokeMethod ( Object target , Class < ? > clazz , String methodName , Class [ ] types , Object [ ] args ) { } private static Method findMethod ( Class < ? > clazz , String methodName , Class [ ] types ) { if ( clazz == null ) throw new IllegalArgumentException ( "Null<seq2seq4repair_space>class" ) ; if ( methodName == null ) throw new IllegalArgumentException ( "Null<seq2seq4repair_space>method<seq2seq4repair_space>name" ) ; try { Class < ? > current = clazz ; while ( current != null ) { try { <START_BUG> final Method m = clazz . getDeclaredMethod ( methodName , types ) ; <END_BUG> m . setAccessible ( true ) ; return m ; } catch ( NoSuchMethodException ignored ) { } current = current . getSuperclass ( ) ; } } catch ( Throwable t ) { throw new RuntimeException ( t ) ; } throw new IllegalStateException ( ( ( ( "Couldn't<seq2seq4repair_space>invoke<seq2seq4repair_space>method:<seq2seq4repair_space>" + ( clazz . getName ( ) ) ) + "<seq2seq4repair_space>//<seq2seq4repair_space>" ) + methodName ) ) ; } }

Fix:
final Method m = current . getDeclaredMethod ( methodName , types ) ;
Buggy code:
public class FloorIsLavaReward implements IChanceCubeReward { @ Override public void trigger ( World world , int x , int y , int z , EntityPlayer player ) { player . addChatMessage ( new ChatComponentText ( "Quick!<seq2seq4repair_space>The<seq2seq4repair_space>Floor<seq2seq4repair_space>is<seq2seq4repair_space>lava!" ) ) ; List < OffsetBlock > blocks = new ArrayList < OffsetBlock > ( ) ; int delay = 0 ; for ( int yy = y + 5 ; yy > ( y - 5 ) ; yy -- ) { int xx = 0 ; int zz = 0 ; int dx = 0 ; int dy = - 1 ; int t = 32 ; int maxI = t * t ; for ( int i = 0 ; i < maxI ; i ++ ) { if ( ( ( ( ( ( - 16 ) // 2 ) <= xx ) && ( xx <= ( 16 // 2 ) ) ) && ( ( ( - 16 ) // 2 ) <= zz ) ) && ( zz <= ( 16 // 2 ) ) ) { Block blockAt = world . getBlock ( ( x + xx ) , yy , ( z + zz ) ) ; <START_BUG> if ( blockAt . equals ( grass ) ) { <END_BUG> blocks . add ( new OffsetBlock ( xx , ( yy - y ) , zz , Blocks . lava , false , delay ) ) ; delay ++ ; } } if ( ( ( xx == zz ) || ( ( xx < 0 ) && ( xx == ( - zz ) ) ) ) || ( ( xx > 0 ) && ( xx == ( 1 - zz ) ) ) ) { t = dx ; dx = - dy ; dy = t ; } xx += dx ; zz += dy ; } } for ( OffsetBlock b : blocks ) b . spawnInWorld ( world , x , y , z ) ; } @ Override public int getChanceValue ( ) { } @ Override public String getName ( ) { } }

Fix:
if ( ! ( blockAt . equals ( air ) ) ) {
Buggy code:
public class InstallerJDialogUncaughtExceptionHandler implements Thread . UncaughtExceptionHandler { private final InstallerJDialog parent ; private final String connectionErrorMessage ; public InstallerJDialogUncaughtExceptionHandler ( InstallerJDialog parent , String connectionErrorMessage ) { } @ Override public void uncaughtException ( Thread t , final Throwable e ) { <START_BUG> String errorMessage = I18n . _ ( e . getMessage ( ) . substring ( ( ( e . getMessage ( ) . indexOf ( ":" ) ) + 2 ) ) ) ; <END_BUG> if ( errorMessage . startsWith ( "Error<seq2seq4repair_space>downloading" ) ) { errorMessage = connectionErrorMessage ; } final String finalErrorMessage = errorMessage ; SwingUtilities . invokeLater ( new Runnable ( ) { @ Override public void run ( ) { System . err . println ( finalErrorMessage ) ; e . printStackTrace ( ) ; } } ) ; parent . setErrorMessage ( finalErrorMessage ) ; } }

Fix:
String errorMessage = I18n . _ ( e . getMessage ( ) . substring ( ( ( e . getMessage ( ) . indexOf ( ":" ) ) + 1 ) ) ) ;
Buggy code:
public class FileNameEnvironment extends FileSystem { public FileNameEnvironment ( String [ ] classpathNames , String encoding ) { } public ClasspathJar getClasspathJar ( File file ) throws IOException { try { ZipFile zipFile = JavaModelManager . getJavaModelManager ( ) . getZipFile ( new Path ( file . getPath ( ) ) ) ; return new ClasspathJar ( zipFile , false ) ; } catch ( CoreException e ) { <START_BUG> return super . getClasspathJar ( file , true ) ; <END_BUG> } } }

Fix:
return super . getClasspathJar ( file ) ;
Buggy code:
public class DiskFileItem implements FileItem , FileItemHeadersSupport { private static final Logger log = LoggerFactory . getLogger ( DiskFileItem . class ) ; private static final long serialVersionUID = 2237570099615271025L ; public static final String DEFAULT_CHARSET = "ISO-8859-1" ; private static final String UID = UUID . randomUUID ( ) . toString ( ) . replace ( ':' , '_' ) . replace ( '-' , '_' ) ; private static final Random counter = new Random ( ) ; private String fieldName ; private final String contentType ; private boolean isFormField ; private final String fileName ; private long size = - 1 ; private final int sizeThreshold ; private final File repository ; private byte [ ] cachedContent ; private transient DeferredFileOutputStream dfos ; private transient File tempFile ; private File dfosFile ; private FileItemHeaders headers ; private final IFileUploadCleaner fileUploadCleaner ; public DiskFileItem ( final String fieldName , final String contentType , final boolean isFormField , final String fileName , final int sizeThreshold , final File repository , final IFileUploadCleaner fileUploadCleaner ) { } public InputStream getInputStream ( ) throws IOException { } public String getContentType ( ) { } public String getCharSet ( ) { } public String getName ( ) { } public boolean isInMemory ( ) { } public long getSize ( ) { } public byte [ ] get ( ) { } public String getString ( final String charset ) throws UnsupportedEncodingException { } public String getString ( ) { } public void write ( final File file ) throws IOException { } public void delete ( ) { } public String getFieldName ( ) { } public void setFieldName ( final String fieldName ) { } public boolean isFormField ( ) { } public void setFormField ( final boolean state ) { } public OutputStream getOutputStream ( ) throws IOException { } public File getStoreLocation ( ) { } @ Override protected void finalize ( ) throws Throwable { } protected File getTempFile ( ) { } private static String getUniqueId ( ) { } @ Override public String toString ( ) { } private void writeObject ( ObjectOutputStream out ) throws IOException { } private void readObject ( ObjectInputStream in ) throws IOException , ClassNotFoundException { in . defaultReadObject ( ) ; OutputStream output = getOutputStream ( ) ; if ( ( cachedContent ) != null ) { output . write ( cachedContent ) ; } else { FileInputStream input = new FileInputStream ( dfosFile ) ; Streams . copy ( input , output ) ; <START_BUG> dfosFile . delete ( ) ; <END_BUG> dfosFile = null ; } output . close ( ) ; cachedContent = null ; } public FileItemHeaders getHeaders ( ) { } public void setHeaders ( FileItemHeaders pHeaders ) { } }

Fix:
Files . remove ( dfosFile ) ;
Buggy code:
public class Utilities { public static final String STRING_ENCODING = "UTF-8" ; private static final char [ ] s_hexArray = "0123456789ABCDEF" . toCharArray ( ) ; public static String getString ( ByteBuffer buffer ) { } public static int getBufferLengthForString ( String string ) { } public static void putString ( ByteBuffer buffer , String string ) { } public static int getUnsignedShort ( ByteBuffer buffer ) { } public static void putUnsignedShort ( ByteBuffer buffer , int value ) { } public static byte [ ] getBytes ( ByteBuffer buffer ) { } public static void delayInMilliseconds ( long milliseconds ) { } public static void delayInMicroseconds ( long microseconds ) { } public static String toHexString ( byte aByte ) { } public static String toHexString ( ByteBuffer bytes ) { final int offset = bytes . position ( ) ; final int size = bytes . remaining ( ) ; final char [ ] hexChars = new char [ size * 2 ] ; for ( int i = 0 ; i < size ; i ++ ) { final int aByte = bytes . get ( ( i + offset ) ) ; <START_BUG> hexChars [ ( i * 2 ) ] = Utilities . s_hexArray [ ( aByte > > > 4 ) ] ; <END_BUG> hexChars [ ( ( i * 2 ) + 1 ) ] = Utilities . s_hexArray [ ( aByte & 15 ) ] ; } return new String ( hexChars ) ; } public static boolean toBoolean ( byte value ) { } public static boolean toBoolean ( int value ) { } public static byte toByte ( boolean value ) { } }

Fix:
hexChars [ ( i * 2 ) ] = Utilities . s_hexArray [ ( ( aByte & 240 ) > > > 4 ) ] ;