nus-yam/ex-repair huggingface dataset:
Buggy code:
public class MessageBuilder { public static final int REPLY = 0 ; public static final int REPLY_ALL = 1 ; public static final int REPLY_MAILINGLIST = 2 ; public static final int REPLY_AS_ATTACHMENT = 3 ; public static final int FORWARD = 4 ; public static final int FORWARD_INLINE = 5 ; public static final int OPEN = 6 ; private static MessageBuilder instance ; public MessageBuilder ( ) { } public static MessageBuilder getInstance ( ) { } public static boolean isAlreadyReply ( String subject , String pattern ) { } private static String createReplySubject ( ColumbaHeader header ) { } private static String createForwardSubject ( ColumbaHeader header ) { } private static String createTo ( ColumbaHeader header ) { } private static String createToAll ( ColumbaHeader header ) { } private static String createToMailinglist ( ColumbaHeader header ) { } private static void createMailingListHeaderItems ( ColumbaHeader header , ComposerModel model ) { } private static AccountItem getAccountItem ( ColumbaHeader header ) { } private static String createBodyText ( Message message ) { } private static String createQuotedBodyText ( Message message ) { } public void createMessage ( Message message , ComposerModel model , int operation ) { } public static void openMessage ( Message message , ComposerModel model ) { } public static void bounceMessage ( Message message , ComposerModel model ) { } public void addSenderToAddressbook ( String sender ) { if ( sender != null ) { if ( ( sender . length ( ) ) > 0 ) { <START_BUG> Folder selectedFolder = tree . getFolder ( 102 ) ; <END_BUG> String address = AddressParser . getAddress ( sender ) ; System . out . println ( ( "address:" + address ) ) ; if ( ! ( selectedFolder . exists ( address ) ) ) { ContactCard card = new ContactCard ( ) ; String fn = AddressParser . getDisplayname ( sender ) ; System . out . println ( ( "fn=" + fn ) ) ; card . set ( "fn" , fn ) ; card . set ( "displayname" , fn ) ; card . set ( "email" , "internet" , address ) ; selectedFolder . add ( card ) ; } } } } }

Fix:
Folder selectedFolder = ( ( Folder ) ( treeModel . getFolder ( 102 ) ) ) ;
Buggy code:
public class Rect implements Serializable { static final long serialVersionUID = 4624999276134559686L ; public static Rect fromBounds ( int minX , int minY , int spanX , int spanY ) { } public static Rect fromEdges ( int minX , int minY , int maxX , int maxY ) { } public static Rect fromCenter ( int centerX , int centerY , int spanX , int spanY ) { } public int x0 ; public int y0 ; public int x1 ; public int y1 ; public Rect ( ) { } public Rect ( int minX , int minY , int maxX , int maxY ) { } public Rect ( Rect copy ) { } public int x ( ) { } public int y ( ) { } public int maxX ( ) { } public int maxY ( ) { } public int centerX ( ) { } public int centerY ( ) { } public void set ( Rect copy ) { } public void position ( int x , int y ) { } public void center ( int x , int y ) { } public int width ( ) { } public int height ( ) { } public int area ( ) { } public Rect size ( int width , int height ) { } public void clamp ( Rect rect ) { } public void fit ( Rect rect ) { } public void inflate ( double scaleX , double scaleY ) { } public void inflate ( int scaleX , int scaleY ) { } public boolean intersect ( Rect rect ) { } public void union ( Rect rect ) { } public void scale ( int multX , int multY ) { } public void translate ( int dx , int dy ) { } public boolean intersects ( int x , int y ) { } public boolean intersects ( Rect rect ) { } public boolean equals ( Object obj ) { } @ Override public int hashCode ( ) { } public String toString ( ) { <START_BUG> return ( ( ( ( ( ( ( "Rect<seq2seq4repair_space>[" + ( x0 ) ) + ",<seq2seq4repair_space>" ) + ( y0 ) ) + "][<seq2seq4repair_space>w:" ) + ( ( x0 ) + ( x1 ) ) ) + ",<seq2seq4repair_space>h:" ) + ( ( y0 ) + ( y1 ) ) ) + "]" ; <END_BUG> } }

Fix:
return ( ( ( ( ( ( ( "Rect<seq2seq4repair_space>[" + ( x0 ) ) + ",<seq2seq4repair_space>" ) + ( y0 ) ) + "][<seq2seq4repair_space>w:" ) + ( ( x1 ) - ( x0 ) ) ) + ",<seq2seq4repair_space>h:" ) + ( ( y1 ) - ( y0 ) ) ) + "]" ;
Buggy code:
class BSHLiteral extends SimpleNode { public Object value ; BSHLiteral ( int id ) { } public Object eval ( CallStack callstack , Interpreter interpreter ) throws EvalError { } private char getEscapeChar ( char ch ) { } public void charSetup ( String str ) { char ch = str . charAt ( 0 ) ; if ( ch == '\\' ) { ch = str . charAt ( 1 ) ; if ( Character . isDigit ( ch ) ) ch = ( ( char ) ( Integer . parseInt ( str . substring ( 1 ) , 8 ) ) ) ; else ch = getEscapeChar ( ch ) ; } <START_BUG> value = new Primitive ( new Character ( ch ) ) ; <END_BUG> } void stringSetup ( String str ) { } }

Fix:
value = new Primitive ( new Character ( ch ) . charValue ( ) ) ;
Buggy code:
public class SoftmaxCost extends MemoizedDifferentiableFunction { DoubleMatrix Features ; DoubleMatrix Labels ; DifferentiableMatrixFunction Activation ; ClassifierTheta Gradient ; double Lambda ; int CatSize ; int FeatureLength ; int [ ] requiredEntries ; public SoftmaxCost ( DoubleMatrix Features , int [ ] Labels , int CatSize , double Lambda ) { } public SoftmaxCost ( DoubleMatrix Features , DoubleMatrix Labels , double Lambda ) { } public SoftmaxCost ( int CatSize , int FeatureLength , double Lambda ) { } @ Override public int dimension ( ) { } @ Override public double valueAt ( double [ ] x ) { } public DoubleMatrix getPredictions ( ClassifierTheta Theta , DoubleMatrix Features ) { } public DoubleMatrix getLogLoss ( ClassifierTheta classifierParams , DoubleMatrix Features , int [ ] Labels ) { } public double [ ] derivativeFor ( ClassifierTheta Theta , DoubleMatrix dataItem , int [ ] Label ) { if ( ( ( dataItem . columns ) > 1 ) || ( ( Label . length ) > 1 ) ) System . err . println ( "Data<seq2seq4repair_space>item<seq2seq4repair_space>is<seq2seq4repair_space>malformed.<seq2seq4repair_space>Please<seq2seq4repair_space>pass<seq2seq4repair_space>a<seq2seq4repair_space>column<seq2seq4repair_space>vector" ) ; DoubleMatrix Labels = getLabelsRepresentation ( Label , 1 ) ; DoubleMatrix Input = Theta . getW ( ) . transpose ( ) . mmul ( dataItem ) . addColumnVector ( Theta . b ) ; Input = DoubleMatrix . concatVertically ( Input , DoubleMatrix . zeros ( 1 , 1 ) ) ; DoubleMatrix Prediction = Activation . valueAt ( Input ) ; DoubleMatrix Diff = Prediction . sub ( Labels ) ; <START_BUG> DoubleMatrix Delta = Features . mmul ( Diff . transpose ( ) ) ; <END_BUG> DoubleMatrix gradW = Delta . getColumns ( requiredEntries ) ; DoubleMatrix gradb = Diff . rowSums ( ) . getRows ( requiredEntries ) ; gradW = gradW . addi ( Theta . getW ( ) . mul ( Lambda ) ) ; return new ClassifierTheta ( gradW , gradb ) . Theta ; } private DoubleMatrix getLogLoss ( DoubleMatrix Prediction , DoubleMatrix Labels ) { } private DoubleMatrix getLabelsRepresentation ( int [ ] Labels , int numDataItems ) { } No newline ; at end ; of file ; }

Fix:
DoubleMatrix Delta = dataItem . mmul ( Diff . transpose ( ) ) ;
Buggy code:
public class AnonymousLocalTypeDeclaration extends LocalTypeDeclaration { public static final char [ ] ANONYMOUS_EMPTY_NAME = new char [ ] { } ; public QualifiedAllocationExpression allocation ; public AnonymousLocalTypeDeclaration ( CompilationResult compilationResult ) { } public MethodBinding createsInternalConstructorWithBinding ( MethodBinding inheritedConstructorBinding ) { String baseName = "$anonymous" ; TypeBinding [ ] argumentTypes = inheritedConstructorBinding . parameters ; int argumentsLength = argumentTypes . length ; ConstructorDeclaration cd = new ConstructorDeclaration ( this . compilationResult ) ; cd . selector = new char [ ] { 'x' } ; cd . sourceStart = sourceStart ; cd . sourceEnd = sourceEnd ; cd . modifiers = ( modifiers ) & ( AccVisibilityMASK ) ; cd . isDefaultConstructor = true ; if ( argumentsLength > 0 ) { Argument [ ] arguments = cd . arguments = new Argument [ argumentsLength ] ; for ( int i = argumentsLength ; ( -- i ) >= 0 ; ) { arguments [ i ] = new Argument ( ( baseName + i ) . toCharArray ( ) , 0L , null , AccDefault ) ; } } cd . constructorCall = new ExplicitConstructorCall ( ExplicitConstructorCall . ImplicitSuper ) ; cd . constructorCall . sourceStart = sourceStart ; cd . constructorCall . sourceEnd = sourceEnd ; if ( argumentsLength > 0 ) { Expression [ ] args ; args = cd . constructorCall . arguments = new Expression [ argumentsLength ] ; for ( int i = argumentsLength ; ( -- i ) >= 0 ; ) { args [ i ] = new SingleNameReference ( ( baseName + i ) . toCharArray ( ) , 0L ) ; } } if ( ( methods ) == null ) { methods = new AbstractMethodDeclaration [ ] { cd } ; } else { AbstractMethodDeclaration [ ] newMethods ; System . arraycopy ( methods , 0 , ( newMethods = new AbstractMethodDeclaration [ ( methods . length ) + 1 ] ) , 1 , length ) ; newMethods [ 0 ] = cd ; methods = newMethods ; } cd . binding = new MethodBinding ( cd . modifiers , ( argumentsLength == 0 ? NoParameters : argumentTypes ) , inheritedConstructorBinding . thrownExceptions , binding ) ; <START_BUG> cd . scope = new MethodScope ( scope , this , true ) ; <END_BUG> cd . bindArguments ( ) ; cd . constructorCall . resolve ( cd . scope ) ; if ( ( binding . methods ) == null ) { binding . methods = new MethodBinding [ ] { cd . binding } ; } else { MethodBinding [ ] newMethods ; System . arraycopy ( binding . methods , 0 , ( newMethods = new MethodBinding [ ( binding . methods . length ) + 1 ] ) , 1 , binding . methods . length ) ; newMethods [ 0 ] = cd . binding ; binding . methods = newMethods ; } return cd . binding ; } public void resolve ( BlockScope scope ) { } public String toString ( int tab ) { } public void traverse ( IAbstractSyntaxTreeVisitor visitor , BlockScope blockScope ) { } }

Fix:
cd . scope = new MethodScope ( scope , cd , true ) ;
Buggy code:
@ SuppressWarnings ( "serial" ) public class MessageHandlerServlet extends HttpServlet { private void sendUpdates ( Msg msg ) { } public void doPost ( HttpServletRequest req , HttpServletResponse resp ) throws IOException { UserService userService = UserServiceFactory . getUserService ( ) ; String userId = userService . getCurrentUser ( ) . getUserId ( ) ; String msg_type = req . getParameter ( "msg" ) . trim ( ) ; Msg msg = new Msg ( msg_type , req . getParameter ( "action" ) . trim ( ) , req . getParameter ( "price" ) . trim ( ) , req . getParameter ( "qty" ) . trim ( ) , req . getParameter ( "key" ) . trim ( ) , "" ) ; System . out . println ( "msg<seq2seq4repair_space>recv:<seq2seq4repair_space>" ) ; msg . printString ( ) ; GenericToolkit gt = GenericToolkit . getInstance ( ) ; String arrayIndex = String . format ( "%02d" , Integer . parseInt ( msg . key . substring ( 16 , msg . key . length ( ) ) ) ) ; switch ( msg . msg_type ) { case UPDATE : switch ( msg . msg_action ) { case SELL : msg = gt . createBidOffer ( msg . key . substring ( 0 , 16 ) , Double . parseDouble ( msg . price ) , userId , arrayIndex ) ; break ; case BUY : msg = gt . createBidOffer ( msg . key . substring ( 0 , 16 ) , Double . parseDouble ( msg . price ) , userId , arrayIndex ) ; break ; case CANCEL : <START_BUG> msg = gt . cancelBidOffer ( req . getParameter ( "eKey" ) . trim ( ) ) ; <END_BUG> break ; default : break ; } break ; case REFRESH : break ; case LAUNCH : break ; case CONFIRM : switch ( msg . msg_action ) { case BUY : msg = gt . createTransaction ( msg . key . substring ( 0 , 16 ) , arrayIndex , userId , "ami" , "SG" , "KP" ) ; break ; case SELL : msg = gt . createTransaction ( msg . key . substring ( 0 , 16 ) , arrayIndex , userId , "ami" , "SG" , "KP" ) ; break ; default : break ; } break ; default : break ; } if ( msg != null ) { sendUpdates ( msg ) ; } else { } } }

Fix:
msg = gt . cancelBidOffer ( req . getParameter ( "eKey" ) . trim ( ) , userId ) ;
Buggy code:
public class MultiTermQueryWrapperFilter < Q extends MultiTermQuery > extends Filter { protected final Q query ; protected MultiTermQueryWrapperFilter ( Q query ) { } @ Override public String toString ( ) { } @ Override @ SuppressWarnings ( { "unchecked" , "rawtypes" } ) public final boolean equals ( final Object o ) { } @ Override public final int hashCode ( ) { } public final String getField ( ) { } @ Override public DocIdSet getDocIdSet ( AtomicReaderContext context , Bits acceptDocs ) throws IOException { final AtomicReader reader = context . reader ( ) ; final Fields fields = reader . fields ( ) ; if ( fields == null ) { return DocIdSet . EMPTY_DOCIDSET ; } final Terms terms = fields . terms ( query . field ) ; if ( terms == null ) { return DocIdSet . EMPTY_DOCIDSET ; } final TermsEnum termsEnum = query . getTermsEnum ( terms ) ; assert termsEnum != null ; if ( ( termsEnum . next ( ) ) != null ) { final FixedBitSet bitSet = new FixedBitSet ( context . reader ( ) . maxDoc ( ) ) ; DocsEnum docsEnum = null ; do { <START_BUG> docsEnum = termsEnum . docs ( acceptDocs , docsEnum , 0 ) ; <END_BUG> int docid ; while ( ( docid = docsEnum . nextDoc ( ) ) != ( DocIdSetIterator . NO_MORE_DOCS ) ) { bitSet . set ( docid ) ; } } while ( ( termsEnum . next ( ) ) != null ) ; return bitSet ; } else { return DocIdSet . EMPTY_DOCIDSET ; } } }

Fix:
docsEnum = termsEnum . docs ( acceptDocs , docsEnum , false ) ;
Buggy code:
public class CommunityDaoImpl implements CommunityDao { DatabaseServiceImpl dbService = new DatabaseServiceImpl ( ) ; @ Override public int getCommunityCount ( ) { } @ Override @ SuppressWarnings ( "unchecked" ) public Collection < Community > getAllCommunities ( ) { } @ Override @ SuppressWarnings ( "unchecked" ) public Collection < Community > getUserCommunities ( int userId ) { EntityTransaction etx = null ; try { etx = dbService . getEntitymanager ( ) . getTransaction ( ) ; etx . begin ( ) ; <START_BUG> List < Community > clist = dbService . getEntitymanager ( ) . createQuery ( ( "SELECT<seq2seq4repair_space>c<seq2seq4repair_space>FROM<seq2seq4repair_space>Community<seq2seq4repair_space>c<seq2seq4repair_space>where<seq2seq4repair_space>c.user.userId=" + userId ) ) . getResultList ( ) ; <END_BUG> etx . commit ( ) ; return clist ; } catch ( Exception e ) { e . printStackTrace ( ) ; if ( etx != null ) etx . rollback ( ) ; return null ; } } @ Override public Community getCommunityById ( int id ) { } @ Override public Community saveCommunity ( Community c ) { } @ Override public Community updateCommunity ( Community c ) { } @ Override public void deleteCommunity ( Community c ) { } @ Override public Community addCommunityMember ( Community c , Communitymember cm ) { } @ Override public void removeCommunityMember ( Community c , Communitymember cm ) { } @ SuppressWarnings ( "unchecked" ) @ Override public Collection < Community > searchCommunity ( String key ) { } }

Fix:
List < Community > clist = dbService . getEntitymanager ( ) . createQuery ( ( ( "SELECT<seq2seq4repair_space>c<seq2seq4repair_space>FROM<seq2seq4repair_space>Community<seq2seq4repair_space>c<seq2seq4repair_space>where<seq2seq4repair_space>c.communityId<seq2seq4repair_space>in<seq2seq4repair_space>(select<seq2seq4repair_space>cm.CommunityId<seq2seq4repair_space>from<seq2seq4repair_space>Communitymember<seq2seq4repair_space>cm<seq2seq4repair_space>where<seq2seq4repair_space>cm.user.userId=" + userId ) + ")" ) ) . getResultList ( ) ;
Buggy code:
public class MeGridViewAdapter extends BaseAdapter { public static final String TAG = MeGridViewAdapter . class . getSimpleName ( ) ; private List < File > mImageList ; private Context mContext ; public MeGridViewAdapter ( Context context ) { } public int getCount ( ) { } public Object getItem ( int position ) { } public long getItemId ( int position ) { } public View getView ( int position , View convertView , ViewGroup parent ) { ImageView imageView = ( ( ImageView ) ( convertView ) ) ; if ( convertView == null ) { imageView = new ImageView ( mContext ) ; GridView . LayoutParams imageParams = new GridView . LayoutParams ( LayoutParams . MATCH_PARENT , 300 ) ; imageView . setLayoutParams ( imageParams ) ; imageView . setScaleType ( FIT_XY ) ; <START_BUG> int padding = 10 ; <END_BUG> imageView . setPadding ( padding , padding , padding , padding ) ; } Uri imageUri = Uri . fromFile ( mImageList . get ( position ) ) ; imageView . setImageURI ( imageUri ) ; return imageView ; } public void update ( ) { } public void deleteAllImages ( ) { } public void copyImage ( ) { } No newline ; at end ; of file ; }

Fix:
int padding = 5 ;
Buggy code:
public class SteeringEntity extends Entity { private static final Integer SIZE = 50 ; private SteeringBehavour behavour ; public SteeringEntity ( SteeringBehavour behavour ) { } @ Override <START_BUG> public void update ( TreeNode behaviourRoot ) { <END_BUG> Vector2D targetForce = behavour . process ( ) ; x += targetForce . getX ( ) ; y += targetForce . getY ( ) ; } @ Override public void draw ( Graphics2D graphics ) { } }

Fix:
public void update ( ) {
Buggy code:
public class NullLiteral extends MagicLiteral { static final char [ ] source = new char [ ] { 'n' , 'u' , 'l' , 'l' } ; public NullLiteral ( int s , int e ) { } public void computeConstant ( ) { } public void generateCode ( BlockScope currentScope , CodeStream codeStream , boolean valueRequired ) { int pc = codeStream . position ; if ( valueRequired ) codeStream . aconst_null ( ) ; <START_BUG> codeStream . recordPositionsFrom ( pc , this ) ; <END_BUG> } public TypeBinding literalType ( BlockScope scope ) { } public char [ ] source ( ) { } public void traverse ( IAbstractSyntaxTreeVisitor visitor , BlockScope scope ) { } }

Fix:
codeStream . recordPositionsFrom ( pc , this . sourceStart ) ;
Buggy code:
public class Connection implements Runnable { private static Logger logger = Logger . getLogger ( Server . class ) ; private Socket socket ; private State state ; private BufferedOutputStream out ; private BufferedInputStream in ; private ServerMailManager manager ; public Connection ( Socket socket ) { } @ Override public void run ( ) { } public void processing ( ) { } public void updateState ( ) { } public void sendMessage ( ) { try { Connection . logger . info ( ( "Server<seq2seq4repair_space>:<seq2seq4repair_space>" + ( state . getMsgToSend ( ) ) ) ) ; <START_BUG> out . write ( state . getMsgToSend ( ) . getBytes ( ) ) ; <END_BUG> out . flush ( ) ; } catch ( IOException e ) { Connection . logger . error ( ( "Error<seq2seq4repair_space>during<seq2seq4repair_space>writing<seq2seq4repair_space>through<seq2seq4repair_space>server<seq2seq4repair_space>output\n" + ( e . getMessage ( ) ) ) ) ; } } }

Fix:
out . write ( state . getMsgToSend ( ) . getBytes ( "UTF-8" ) ) ;
Buggy code:
class GrabUtility { public static List < String > filesToGrab = new ArrayList < String > ( ) ; public static List < String > framesToGrab = new ArrayList < String > ( ) ; public static String title ; public static String searchForNewFilesToGrab ( String htmlToParse , String baseUrl ) { Document parsedHtml = null ; URL fromHTMLPageUrl ; System . out . println ( baseUrl ) ; boolean noBaseUrl = false ; try { fromHTMLPageUrl = new URL ( baseUrl ) ; noBaseUrl = false ; } catch ( MalformedURLException e ) { fromHTMLPageUrl = null ; noBaseUrl = true ; } String urlToGrab = null ; if ( ! ( htmlToParse . trim ( ) . equals ( "" ) ) ) { if ( noBaseUrl ) { parsedHtml = Jsoup . parse ( htmlToParse ) ; } else { parsedHtml = Jsoup . parse ( htmlToParse , baseUrl ) ; } if ( ( parsedHtml . title ( ) ) != "" ) { GrabUtility . title = parsedHtml . title ( ) ; } Elements links = parsedHtml . select ( "frame[src]" ) ; for ( Element link : links ) { urlToGrab = link . attr ( "abs:src" ) ; synchronized ( GrabUtility . framesToGrab ) { if ( ! ( GrabUtility . framesToGrab . contains ( urlToGrab ) ) ) { GrabUtility . framesToGrab . add ( urlToGrab ) ; } } String replacedURL = urlToGrab . substring ( ( ( urlToGrab . lastIndexOf ( "//" ) ) + 1 ) ) ; link . attr ( "src" , replacedURL ) ; } links = parsedHtml . select ( "iframe[src]" ) ; for ( Element link : links ) { urlToGrab = link . attr ( "abs:src" ) ; synchronized ( GrabUtility . framesToGrab ) { if ( ! ( GrabUtility . framesToGrab . contains ( urlToGrab ) ) ) { GrabUtility . framesToGrab . add ( urlToGrab ) ; } } String replacedURL = urlToGrab . substring ( ( ( urlToGrab . lastIndexOf ( "//" ) ) + 1 ) ) ; link . attr ( "src" , replacedURL ) ; } links = parsedHtml . select ( "link[href]" ) ; for ( Element link : links ) { urlToGrab = link . attr ( "abs:href" ) ; GrabUtility . addLinkToList ( urlToGrab , fromHTMLPageUrl ) ; String replacedURL = urlToGrab . substring ( ( ( urlToGrab . lastIndexOf ( "//" ) ) + 1 ) ) ; link . attr ( "href" , replacedURL ) ; } links = parsedHtml . select ( "script[src]" ) ; for ( Element link : links ) { urlToGrab = link . attr ( "abs:src" ) ; GrabUtility . addLinkToList ( urlToGrab , fromHTMLPageUrl ) ; String replacedURL = urlToGrab . substring ( ( ( urlToGrab . lastIndexOf ( "//" ) ) + 1 ) ) ; link . attr ( "src" , replacedURL ) ; } links = parsedHtml . select ( "img[src]" ) ; for ( Element link : links ) { urlToGrab = link . attr ( "abs:src" ) ; GrabUtility . addLinkToList ( urlToGrab , fromHTMLPageUrl ) ; String replacedURL = urlToGrab . substring ( ( ( urlToGrab . lastIndexOf ( "//" ) ) + 1 ) ) ; link . attr ( "src" , replacedURL ) ; } } <START_BUG> return parsedHtml . toString ( ) ; <END_BUG> } public static void addLinkToList ( String link , URL fromHTMLPageUrl ) { } }

Fix:
return parsedHtml . outerHtml ( ) ;
Buggy code:
public abstract class WizardExportResourcesPage extends WizardDataTransferPage { private IStructuredSelection initialResourceSelection ; private List selectedTypes = new ArrayList ( ) ; private ResourceTreeAndListGroup resourceGroup ; private Button typesToExportEditButton ; private static final String STORE_SELECTED_TYPES_ID = "WizardFileSystemExportPage1.STORE_SELECTED_TYPES_ID." ; private static final String SELECT_TYPES_TITLE = WorkbenchMessages . getString ( "WizardTransferPage.selectTypes" ) ; private static final String SELECT_ALL_TITLE = WorkbenchMessages . getString ( "WizardTransferPage.selectAll" ) ; private static final String DESELECT_ALL_TITLE = WorkbenchMessages . getString ( "WizardTransferPage.deselectAll" ) ; protected WizardExportResourcesPage ( String pageName , IStructuredSelection selection ) { } protected boolean allowNewContainerName ( ) { } protected Button createButton ( Composite parent , int id , String label , boolean defaultButton ) { } protected final void createButtonsGroup ( Composite parent ) { } public void createControl ( Composite parent ) { } protected abstract void createDestinationGroup ( Composite parent ) { } protected final void createResourcesGroup ( Composite parent ) { List input = new ArrayList ( ) ; IProject [ ] projects = ResourcesPlugin . getWorkspace ( ) . getRoot ( ) . getProjects ( ) ; for ( int i = 0 ; i < ( projects . length ) ; i ++ ) { if ( projects [ i ] . isOpen ( ) ) input . add ( projects [ i ] ) ; } <START_BUG> int availableRows = availableRows ( parent ) ; <END_BUG> this . resourceGroup = new ResourceTreeAndListGroup ( parent , input , getResourceProvider ( ( ( IResource . FOLDER ) | ( IResource . PROJECT ) ) ) , new WorkbenchLabelProvider ( ) , getResourceProvider ( IResource . FILE ) , new WorkbenchLabelProvider ( ) , SWT . NONE , ( availableRows > 50 ) ) ; } protected String getErrorDialogTitle ( ) { } protected boolean ensureResourcesLocal ( List resources ) { } protected List extractNonLocalResources ( List originalList ) { } private ITreeContentProvider getResourceProvider ( final int resourceType ) { } protected List getSelectedResources ( ) { } protected Iterator getSelectedResourcesIterator ( ) { } protected List getTypesToExport ( ) { } protected List getWhiteCheckedResources ( ) { } protected void handleTypesEditButtonPressed ( ) { } protected boolean hasExportableExtension ( String resourceName ) { } protected void internalSaveWidgetValues ( ) { } protected Object [ ] queryResourceTypesToExport ( ) { } protected void restoreResourceSpecificationWidgetValues ( ) { } protected void saveWidgetValues ( ) { } protected void setupBasedOnInitialSelections ( ) { } private void setupSelectionsBasedOnSelectedTypes ( ) { } private void setupSelectionsBasedOnSelectedTypes ( Map selectionMap , IContainer parent ) { } protected boolean saveDirtyEditors ( ) { } }

Fix:
int availableRows = Dialog . availableRows ( parent ) ;
Buggy code:
public abstract class CollationTestBase extends LuceneTestCase { protected String firstRangeBeginningOriginal = "د" ; protected String firstRangeEndOriginal = "ژ" ; protected String secondRangeBeginningOriginal = "س" ; protected String secondRangeEndOriginal = "ظ" ; @ Deprecated protected String encodeCollationKey ( byte [ ] keyBits ) { } public void testFarsiRangeFilterCollating ( Analyzer analyzer , BytesRef firstBeg , BytesRef firstEnd , BytesRef secondBeg , BytesRef secondEnd ) throws Exception { } public void testFarsiRangeQueryCollating ( Analyzer analyzer , BytesRef firstBeg , BytesRef firstEnd , BytesRef secondBeg , BytesRef secondEnd ) throws Exception { } public void testFarsiTermRangeQuery ( Analyzer analyzer , BytesRef firstBeg , BytesRef firstEnd , BytesRef secondBeg , BytesRef secondEnd ) throws Exception { } public void testCollationKeySort ( Analyzer usAnalyzer , Analyzer franceAnalyzer , Analyzer swedenAnalyzer , Analyzer denmarkAnalyzer , String usResult , String frResult , String svResult , String dkResult ) throws Exception { } private void assertMatches ( IndexSearcher searcher , Query query , Sort sort , String expectedResult ) throws IOException { } public void assertThreadSafe ( final Analyzer analyzer ) throws Exception { int numTestPoints = 100 ; int numThreads = _TestUtil . nextInt ( random , 3 , 5 ) ; final HashMap < String , BytesRef > map = new HashMap < String , BytesRef > ( ) ; for ( int i = 0 ; i < numTestPoints ; i ++ ) { String term = _TestUtil . randomSimpleString ( random ) ; TokenStream ts = analyzer . tokenStream ( "fake" , new StringReader ( term ) ) ; TermToBytesRefAttribute termAtt = ts . addAttribute ( TermToBytesRefAttribute . class ) ; BytesRef bytes = termAtt . getBytesRef ( ) ; ts . reset ( ) ; assertTrue ( ts . incrementToken ( ) ) ; termAtt . fillBytesRef ( ) ; <START_BUG> map . put ( term , new BytesRef ( bytes ) ) ; <END_BUG> } Thread [ ] threads = new Thread [ numThreads ] ; for ( int i = 0 ; i < numThreads ; i ++ ) { threads [ i ] = new Thread ( ) { @ Override public void run ( ) { try { for ( Map . Entry < String , BytesRef > mapping : map . entrySet ( ) ) { String term = mapping . getKey ( ) ; BytesRef expected = mapping . getValue ( ) ; TokenStream ts = analyzer . tokenStream ( "fake" , new StringReader ( term ) ) ; TermToBytesRefAttribute termAtt = ts . addAttribute ( TermToBytesRefAttribute . class ) ; BytesRef bytes = termAtt . getBytesRef ( ) ; ts . reset ( ) ; assertTrue ( ts . incrementToken ( ) ) ; termAtt . fillBytesRef ( ) ; assertEquals ( expected , bytes ) ; } } catch ( IOException e ) { throw new RuntimeException ( e ) ; } } } ; } for ( int i = 0 ; i < numThreads ; i ++ ) { threads [ i ] . start ( ) ; } for ( int i = 0 ; i < numThreads ; i ++ ) { threads [ i ] . join ( ) ; } } }

Fix:
map . put ( term , BytesRef . deepCopyOf ( bytes ) ) ;
Buggy code:
public class JmsMessageProducerTest extends JmsConnectionTestSupport { private JmsSession session ; private final JmsTopic topic = new JmsTopic ( "topic" ) ; private final JmsQueue queue = new JmsQueue ( "topic" ) ; @ Override @ Before public void setUp ( ) throws Exception { } @ Test ( timeout = 10000 ) public void testMultipleCloseCallsNoErrors ( ) throws Exception { } @ Test ( timeout = 10000 , expected = InvalidDestinationException . class ) public void testSetDestinationToNull ( ) throws Exception { } @ Test ( timeout = 10000 ) public void testSetDestinationToCurrentValue ( ) throws Exception { } @ Test ( timeout = 10000 , expected = UnsupportedOperationException . class ) public void testSetDesinationOnNonAnonymousProducer ( ) throws Exception { } <START_BUG> @ Test ( timeout = 10000 , expected = UnsupportedOperationException . class ) <END_BUG> public void testSetDesinationOnAnonymousProducer ( ) throws Exception { JmsMessageProducer producer = ( ( JmsMessageProducer ) ( session . createProducer ( null ) ) ) ; producer . setDestination ( topic ) ; } @ Test ( timeout = 10000 ) public void testCreateProducerWithNullDestination ( ) throws Exception { } @ Test ( timeout = 10000 ) public void testGetDisableMessageID ( ) throws Exception { } @ Test ( timeout = 10000 ) public void testGetDisableTimeStamp ( ) throws Exception { } @ Test ( timeout = 10000 ) public void testPriorityConfiguration ( ) throws Exception { } @ Test ( timeout = 10000 ) public void testTimeToLiveConfiguration ( ) throws Exception { } @ Test ( timeout = 10000 ) public void testDeliveryModeConfiguration ( ) throws Exception { } @ Test ( timeout = 10000 ) public void testAnonymousProducerThrowsUOEWhenExplictDestinationNotProvided ( ) throws Exception { } @ Test ( timeout = 10000 ) public void testExplicitProducerThrowsUOEWhenExplictDestinationIsProvided ( ) throws Exception { } @ Test ( timeout = 10000 ) public void testAnonymousDestinationProducerThrowsIDEWhenNullDestinationIsProvided ( ) throws Exception { } }

Fix:
@ Test ( timeout = 10000 )
Buggy code:
public abstract class Connection { private SmppSessionState connectionState = SmppSessionState . INIT_IDLE ; public abstract void connect ( ) throws SmppTransportException { } public abstract void disconnect ( ) throws SmppTransportException { } public abstract ByteBuffer getRequestBuffer ( ) { } public abstract ByteBuffer getResponseBuffer ( ) { } public abstract void write ( ByteBuffer writeBuffer ) throws SmppTransportException { } <START_BUG> public abstract void read ( ByteBuffer readBuffer ) throws SmppTransportException ; <END_BUG> public abstract int getLazyWriteWait ( ) { } public abstract int getThreadPoolSize ( ) { } public abstract String getEsmeLabel ( ) { } public abstract ChannelMode getMode ( ) { } public abstract void setMode ( ChannelMode mode ) { } public SmppSessionState getConnectionState ( ) { } public void setConnectionState ( SmppSessionState newState ) throws SmppTransportException { } }

Fix:
public abstract int read ( ByteBuffer readBuffer ) throws SmppTransportException ;
Buggy code:
public class EncryptMessageAction extends CheckBoxAction { public EncryptMessageAction ( ComposerController composerController ) { } public void actionPerformed ( ActionEvent evt ) { log . debug ( "start<seq2seq4repair_space>encryption..." ) ; <START_BUG> ComposerModel model = ( ( ComposerModel ) ( ( ( ComposerController ) ( getFrameController ( ) ) ) . getModel ( ) ) ) ; <END_BUG> model . setEncryptMessage ( getCheckBoxMenuItem ( ) . isSelected ( ) ) ; } }

Fix:
ComposerModel model = ( ( ComposerModel ) ( ( ( ComposerController ) ( getFrameMediator ( ) ) ) . getModel ( ) ) ) ;
Buggy code:
boolean useLocalCloudML = true ; <START_BUG> boolean useExternalLoadBalancer = false ; <END_BUG>

Fix:
boolean useExternalLoadBalancer = true ;
Buggy code:
public class PersistenceMetaDataFactory extends AbstractCFMetaDataFactory implements Configurable { private static final Localizer _loc = Localizer . forPackage ( PersistenceMetaDataFactory . class ) ; private AnnotationPersistenceMetaDataParser _annoParser = null ; private XMLPersistenceMetaDataParser _xmlParser = null ; private PersistenceMetaDataDefaults _def = null ; private Map < URL , Set > _xml = null ; private Set < URL > _unparsed = null ; private boolean _fieldOverride = true ; private int _access = ClassMetaData . ACCESS_FIELD ; public void setFieldOverride ( boolean field ) { } public boolean getFieldOverride ( ) { } public void setDefaultAccessType ( String type ) { } public AnnotationPersistenceMetaDataParser getAnnotationParser ( ) { } public void setAnnotationParser ( AnnotationPersistenceMetaDataParser parser ) { } protected AnnotationPersistenceMetaDataParser newAnnotationParser ( ) { } public XMLPersistenceMetaDataParser getXMLParser ( ) { } public void setXMLParser ( XMLPersistenceMetaDataParser parser ) { } protected XMLPersistenceMetaDataParser newXMLParser ( boolean loading ) { } protected XMLPersistenceMetaDataSerializer newXMLSerializer ( ) { } public void load ( Class cls , int mode , ClassLoader envLoader ) { } private void parseXML ( URL xml , Class cls , int mode , ClassLoader envLoader ) { ClassLoader loader = repos . getConfiguration ( ) . getClassResolverInstance ( ) . getClassLoader ( cls , envLoader ) ; XMLPersistenceMetaDataParser xmlParser = getXMLParser ( ) ; <START_BUG> xmlParser . setClassLoader ( loader ) ; <END_BUG> xmlParser . setEnvClassLoader ( envLoader ) ; xmlParser . setMode ( mode ) ; try { xmlParser . parse ( xml ) ; } catch ( IOException ioe ) { throw new GeneralException ( ioe ) ; } } private URL findXML ( Class cls ) { } @ Override protected void mapPersistentTypeNames ( Object rsrc , String [ ] names ) { } @ Override public Class getQueryScope ( String queryName , ClassLoader loader ) { } private boolean hasNamedQuery ( String query , NamedQuery ... queries ) { } @ Override protected MetaDataFilter newMetaDataFilter ( ) { } private void validateStrategies ( ClassMetaData meta ) { } public MetaDataDefaults getDefaults ( ) { } @ Override public ClassArgParser newClassArgParser ( ) { } @ Override public void clear ( ) { } protected Parser newParser ( boolean loading ) { } protected Serializer newSerializer ( ) { } @ Override protected void parse ( MetaDataParser parser , Class [ ] cls ) { } protected File defaultSourceFile ( ClassMetaData meta ) { } protected File defaultSourceFile ( QueryMetaData query , Map clsNames ) { } protected File defaultSourceFile ( SequenceMetaData seq , Map clsNames ) { } private File defaultXMLFile ( ) { } public void setConfiguration ( Configuration conf ) { } public void startConfiguration ( ) { } public void endConfiguration ( ) { } }

Fix:
xmlParser . setClassLoader ( envLoader ) ;
Buggy code:
public class DatabaseConnection { static final String DB_URL = PropertyManager . getInstance ( ) . getProperty ( "databasePath" ) ; static final String USER = PropertyManager . getInstance ( ) . getProperty ( "databaseUser" ) ; static final String PASS = PropertyManager . getInstance ( ) . getProperty ( "databasePass" ) ; Connection conn = null ; EntityManagerFactory entityManagerFactory ; EntityManager entityManager ; private void connectToDatabase ( ) { } private void connectJPA ( ) { } private void closeDatabaseConnection ( ) { } public void initializeDatabase ( ) { } public void writeMultipleAnimalsToDatabase ( ArrayList < Animal > animals ) { } public List < Animal > getAllAnimalsFromDatabase ( ) { } public Animal getAnimalById ( int id ) { Animal result ; connectToDatabase ( ) ; connectJPA ( ) ; TypedQuery < Animal > query = entityManager . createNamedQuery ( "Animal.findById" , Animal . class ) ; <START_BUG> query . setParameter ( "id" , id ) ; <END_BUG> result = query . getResultList ( ) . get ( 0 ) ; return result ; } public void updateMultipleAnimalsInDatabase ( ArrayList < Animal > animalsAll ) { } public boolean updateAnimalInDatabase ( Animal a ) { } }

Fix:
query . setParameter ( "id" , new Long ( id ) ) ;
Buggy code:
public class SpanTermQuery extends SpanQuery { protected Term term ; public SpanTermQuery ( Term term ) { } public Term getTerm ( ) { } @ Override public String getField ( ) { } @ Override public void extractTerms ( Set < Term > terms ) { } @ Override public String toString ( String field ) { } @ Override public int hashCode ( ) { } @ Override public boolean equals ( Object obj ) { } @ Override public Spans getSpans ( final AtomicReaderContext context ) throws IOException { final IndexReader reader = context . reader ; final DocsAndPositionsEnum postings = reader . termPositionsEnum ( reader . getLiveDocs ( ) , term . field ( ) , term . bytes ( ) ) ; if ( postings != null ) { return new TermSpans ( postings , term ) ; } else { if ( ( reader . termDocsEnum ( reader . getLiveDocs ( ) , term . field ( ) , term . bytes ( ) ) ) != null ) { <START_BUG> throw new IllegalStateException ( ( ( ( ( "field<seq2seq4repair_space>\"" + ( term . field ( ) ) ) + "\"<seq2seq4repair_space>was<seq2seq4repair_space>indexed<seq2seq4repair_space>with<seq2seq4repair_space>Field.omitTermFreqAndPositions=true;<seq2seq4repair_space>cannot<seq2seq4repair_space>run<seq2seq4repair_space>SpanTermQuery<seq2seq4repair_space>(term=" ) + ( term . text ( ) ) ) + ")" ) ) ; <END_BUG> } else { return TermSpans . EMPTY_TERM_SPANS ; } } } }

Fix:
throw new IllegalStateException ( ( ( ( ( "field<seq2seq4repair_space>\"" + ( term . field ( ) ) ) + "\"<seq2seq4repair_space>was<seq2seq4repair_space>indexed<seq2seq4repair_space>without<seq2seq4repair_space>position<seq2seq4repair_space>data;<seq2seq4repair_space>cannot<seq2seq4repair_space>run<seq2seq4repair_space>SpanTermQuery<seq2seq4repair_space>(term=" ) + ( term . text ( ) ) ) + ")" ) ) ;
Buggy code:
public class MultipartUrlConfig implements Serializable { public static String MULTIPART_FORM = "multipart//form-data" ; private static String BOUNDARY = "boundary" ; private String boundary ; private String filename ; private String fileField ; private String mimetype ; private Arguments args ; public MultipartUrlConfig ( ) { } public MultipartUrlConfig ( String boundary ) { } public void setBoundary ( String boundary ) { } public String getBoundary ( ) { } public void setFilename ( String filename ) { } public String getFilename ( ) { } public Arguments getArguments ( ) { } public void setFileFieldName ( String name ) { } public String getFileFieldName ( ) { } public void setMimeType ( String type ) { } public String getMimeType ( ) { } public void addArgument ( String name , String value ) { } public void addArgument ( String name , String value , String metadata ) { } public void addEncodedArgument ( String name , String value ) { Arguments args = getArguments ( ) ; HTTPArgument arg = new HTTPArgument ( name , value , true ) ; if ( ( arg . getName ( ) . equals ( arg . getEncodedName ( ) ) ) && ( arg . getValue ( ) . equals ( arg . getEncodedValue ( ) ) ) ) { arg . setAlwaysEncoded ( false ) ; } <START_BUG> args . addArgument ( new HTTPArgument ( name , value , true ) ) ; <END_BUG> } public void parseArguments ( String queryString ) { } }

Fix:
args . addArgument ( arg ) ;
Buggy code:
public class CommandSearch extends Command { @ Override public void execute ( HttpServletRequest request , HttpServletResponse response ) throws IOException , ServletException { String query = request . getParameter ( "q" ) ; request . setAttribute ( "query" , query ) ; System . out . println ( ( "searching<seq2seq4repair_space>for<seq2seq4repair_space>" + query ) ) ; request . setAttribute ( "results" , QueryProcessor . performQuery ( query ) ) ; request . setAttribute ( "time-to-match" , QueryProcessor . getMatchingTime ( ) ) ; <START_BUG> RequestDispatcher rd = request . getRequestDispatcher ( super . getJSPPAth ( "search.jsp" ) ) ; <END_BUG> rd . forward ( request , response ) ; } }

Fix:
RequestDispatcher rd = request . getRequestDispatcher ( super . getJSPPAth ( "results.jsp" ) ) ;
Buggy code:
public class Cab extends MatchingTask { private File cabFile ; private File baseDir ; private Vector filesets = new Vector ( ) ; private boolean doCompress = true ; private boolean doVerbose = false ; private String cmdOptions ; protected String archiveType = "cab" ; private static String myos ; private static boolean isWindows ; public void setCabfile ( File cabFile ) { } public void setBasedir ( File baseDir ) { } public void setCompress ( boolean compress ) { } public void setVerbose ( boolean verbose ) { } public void setOptions ( String options ) { } public void addFileset ( FileSet set ) { } protected void checkConfiguration ( ) throws BuildException { } protected ExecTask createExec ( ) throws BuildException { } protected boolean isUpToDate ( Vector files ) { } protected Commandline createCommand ( File listFile ) { Commandline command = new Commandline ( ) ; command . setExecutable ( "cabarc" ) ; command . createArgument ( ) . setValue ( "-r" ) ; command . createArgument ( ) . setValue ( "-p" ) ; if ( ! ( doCompress ) ) { command . createArgument ( ) . setValue ( "-m" ) ; command . createArgument ( ) . setValue ( "none" ) ; } if ( ( cmdOptions ) != null ) { <START_BUG> command . createArgument ( ) . setValue ( cmdOptions ) ; <END_BUG> } command . createArgument ( ) . setValue ( "n" ) ; command . createArgument ( ) . setFile ( cabFile ) ; command . createArgument ( ) . setValue ( ( "@" + ( listFile . getAbsolutePath ( ) ) ) ) ; return command ; } private static int counter = ( new Random ( ) . nextInt ( ) ) % 100000 ; protected File createTempFile ( String prefix , String suffix ) { } protected File createListFile ( Vector files ) throws IOException { } protected void appendFiles ( Vector files , DirectoryScanner ds ) { } protected Vector getFileList ( ) throws BuildException { } public void execute ( ) throws BuildException { } }

Fix:
command . createArgument ( ) . setLine ( cmdOptions ) ;
Buggy code:
public class ThrowStatement extends Statement { public Expression exception ; public TypeBinding exceptionType ; public ThrowStatement ( Expression exception , int startPosition ) { } public FlowInfo analyseCode ( BlockScope currentScope , FlowContext flowContext , FlowInfo flowInfo ) { } public void generateCode ( BlockScope currentScope , CodeStream codeStream ) { } public StringBuffer printStatement ( int indent , StringBuffer output ) { } public void resolve ( BlockScope scope ) { exceptionType = exception . resolveTypeExpecting ( scope , scope . getJavaLangThrowable ( ) ) ; <START_BUG> if ( ( ( exceptionType ) == ( NullBinding ) ) && ( ( scope . compilerOptions ( ) . complianceLevel ) <= ( ClassFileConstants . JDK1_3 ) ) ) { <END_BUG> scope . problemReporter ( ) . cannotThrowNull ( this ) ; } exception . computeConversion ( scope , exceptionType , exceptionType ) ; } public void traverse ( ASTVisitor visitor , BlockScope blockScope ) { } }

Fix:
if ( ( ( exceptionType ) == ( TypeBinding . NULL ) ) && ( ( scope . compilerOptions ( ) . complianceLevel ) <= ( ClassFileConstants . JDK1_3 ) ) ) {
Buggy code:
public class SubsystemParsingUnitTestCase extends AbstractSubsystemTest { public SubsystemParsingUnitTestCase ( ) { } @ Test public void testParseAndMarshalModel ( ) throws Exception { String subsystemXml = readResource ( "subsystem.xml" ) ; AdditionalInitialization additionalInit = AdditionalInitialization . MANAGEMENT ; KernelServices servicesA = super . installInController ( additionalInit , subsystemXml ) ; ModelNode modelA = servicesA . readWholeModel ( ) ; String marshalled = servicesA . getPersistedSubsystemXml ( ) ; servicesA . shutdown ( ) ; System . out . println ( marshalled ) ; KernelServices servicesB = super . installInController ( additionalInit , marshalled ) ; ModelNode modelB = servicesB . readWholeModel ( ) ; super . compare ( modelA , modelB ) ; <START_BUG> assertRemoveSubsystemResources ( servicesA ) ; <END_BUG> } }

Fix:
assertRemoveSubsystemResources ( servicesB ) ;
Buggy code:
public class Calculator { public void strSplit ( String in , char delimiter , Vector < String > strings ) { } public static void main ( String [ ] args ) { System . out . println ( "><seq2seq4repair_space>" ) ; Vector < String > sp ; int n = 1 ; while ( n != 999 ) { Scanner st = new Scanner ( System . in ) ; String s = st . nextLine ( ) ; <START_BUG> ExpressionProcessor Perhitungan = new ExpressionProcessor ( s , "BilanganArab" ) ; <END_BUG> System . out . println ( Perhitungan . toString ( ) ) ; } } }

Fix:
ExpressionProcessor Perhitungan = new ExpressionProcessor ( s ) ;
Buggy code:
public class ObjectTableModel extends DefaultTableModel { private static final Logger log = LoggingManager . getLoggerForClass ( ) ; private static final long serialVersionUID = 240L ; private transient ArrayList < Object > objects = new ArrayList < Object > ( ) ; private transient List < String > headers = new ArrayList < String > ( ) ; private transient ArrayList < Class < ? > > classes = new ArrayList < Class < ? > > ( ) ; private transient ArrayList < Functor > readFunctors = new ArrayList < Functor > ( ) ; private transient ArrayList < Functor > writeFunctors = new ArrayList < Functor > ( ) ; private transient Class < ? > objectClass = null ; private transient boolean cellEditable = true ; public ObjectTableModel ( String [ ] headers , Class < ? > _objClass , Functor [ ] readFunctors , Functor [ ] writeFunctors , Class < ? > [ ] editorClasses ) { } public ObjectTableModel ( String [ ] headers , Class < ? > _objClass , Functor [ ] readFunctors , Functor [ ] writeFunctors , Class < ? > [ ] editorClasses , boolean cellEditable ) { } public ObjectTableModel ( String [ ] headers , Functor [ ] readFunctors , Functor [ ] writeFunctors , Class < ? > [ ] editorClasses ) { } private Object readResolve ( ) { } public Iterator < ? > iterator ( ) { } public void clearData ( ) { } public void addRow ( Object value ) { } public void insertRow ( Object value , int index ) { } @ Override public int getColumnCount ( ) { } @ Override public String getColumnName ( int col ) { } @ Override public int getRowCount ( ) { } @ Override public Object getValueAt ( int row , int col ) { } @ Override public boolean isCellEditable ( int arg0 , int arg1 ) { } @ Override public void moveRow ( int start , int end , int to ) { <START_BUG> List < Object > subList = objects . subList ( start , end ) ; <END_BUG> for ( int x = end - 1 ; x >= start ; x -- ) { objects . remove ( x ) ; } objects . addAll ( to , subList ) ; super . fireTableChanged ( new TableModelEvent ( this ) ) ; } @ Override public void removeRow ( int row ) { } @ Override public void setValueAt ( Object cellValue , int row , int col ) { } @ Override public Class < ? > getColumnClass ( int arg0 ) { } @ SuppressWarnings ( "deprecation" ) public boolean checkFunctors ( Object _value , Class < ? > caller ) { } public Object getObjectList ( ) { } public void setRows ( Iterable < ? > rows ) { } }

Fix:
List < Object > subList = new ArrayList ( objects . subList ( start , end ) ) ;
Buggy code:
final class DocFieldProcessor extends DocConsumer { final DocFieldConsumer consumer ; final StoredFieldsWriter fieldsWriter ; DocFieldProcessorPerField [ ] fields = new DocFieldProcessorPerField [ 1 ] ; int fieldCount ; DocFieldProcessorPerField [ ] fieldHash = new DocFieldProcessorPerField [ 2 ] ; int hashMask = 1 ; int totalFieldCount ; float docBoost ; int fieldGen ; final DocState docState ; public DocFieldProcessor ( DocumentsWriterPerThread docWriter , DocFieldConsumer consumer ) { } @ Override public void flush ( SegmentWriteState state ) throws IOException { Map < FieldInfo , DocFieldConsumerPerField > childFields = new HashMap < FieldInfo , DocFieldConsumerPerField > ( ) ; Collection < DocFieldConsumerPerField > fields = fields ( ) ; for ( DocFieldConsumerPerField f : fields ) { childFields . put ( f . getFieldInfo ( ) , f ) ; } fieldsWriter . flush ( state ) ; consumer . flush ( childFields , state ) ; final String fileName = IndexFileNames . segmentFileName ( state . segmentName , "" , FIELD_INFOS_EXTENSION ) ; state . fieldInfos . write ( state . directory , fileName ) ; for ( DocValuesConsumer consumers : docValues . values ( ) ) { consumers . finish ( state . numDocs ) ; } <START_BUG> IOUtils . closeSafely ( true , perDocConsumers . values ( ) ) ; <END_BUG> } @ Override public void abort ( ) { } @ Override public boolean freeRAM ( ) { } public Collection < DocFieldConsumerPerField > fields ( ) { } @ Override void doAfterFlush ( ) { } private void rehash ( ) { } @ Override public void processDocument ( FieldInfos fieldInfos ) throws IOException { } private static final Comparator < DocFieldProcessorPerField > fieldsComp = new Comparator < DocFieldProcessorPerField > ( ) { public int compare ( DocFieldProcessorPerField o1 , DocFieldProcessorPerField o2 ) { } } ; @ Override void finishDocument ( ) throws IOException { } private final Map < String , DocValuesConsumer > docValues = new HashMap < String , DocValuesConsumer > ( ) ; private final Map < Integer , PerDocConsumer > perDocConsumers = new HashMap < Integer , PerDocConsumer > ( ) ; DocValuesConsumer docValuesConsumer ( DocState docState , FieldInfo fieldInfo ) throws IOException { } }

Fix:
IOUtils . closeSafely ( false , perDocConsumers . values ( ) ) ;