nus-yam/ex-repair huggingface dataset:
Buggy code:
public class MCIProxyImpl implements MCIProxy { private static final Logger LOG = LoggerFactory . getLogger ( MCIProxyImpl . class ) ; private static final String SOAPACTION_GET_TOKEN = "GetToken" ; private static final String SOAPACTION_RECHARGE = "Recharge" ; private static final String SOAPACTION_GET_REMAINED_BROKER_RECHARGE = "GetRemainedBrokerRecharge" ; private static final String SOAPACTION_RECHARGE_VERIFY = "RechargeVerify" ; private final String url ; private final String username ; private final String password ; private final String namespace ; public MCIProxyImpl ( String url , String username , String password , String namespace ) { } @ Override public MCIProxyGetTokenResponse getToken ( ) { } @ Override public MCIProxyRechargeResponse recharge ( String token , String consumer , int amount , long trId ) { } @ Override public MCIProxyRechargeVerifyResponse rechargeVerify ( String token , String consumer , long trId ) { } @ Override public MCIProxyGetRemainedBrokerRechargeResponse getRemainedBrokerRecharge ( String token , int amount ) { SOAPMessage request = SOAPHelper . createSOAPRequest ( namespace , ( ( namespace ) + ( MCIProxyImpl . SOAPACTION_GET_REMAINED_BROKER_RECHARGE ) ) ) ; try { SOAPHeader header = request . getSOAPHeader ( ) ; SOAPHeaderElement headerElement = header . addHeaderElement ( new QName ( namespace , "AuthHeader" , "ns" ) ) ; SOAPElement usernameElement = headerElement . addChildElement ( new QName ( namespace , "UserName" , "ns" ) ) ; usernameElement . setValue ( username ) ; SOAPElement passwordElement = headerElement . addChildElement ( new QName ( namespace , "Password" , "ns" ) ) ; String combination = ( ( ( ( username . toUpperCase ( ) ) + "|" ) + ( password ) ) + "|" ) + token ; passwordElement . setValue ( HashGenerator . getMD5 ( combination ) ) ; SOAPBody body = request . getSOAPBody ( ) ; SOAPBodyElement bodyElement = body . addBodyElement ( new QName ( namespace , MCIProxyImpl . SOAPACTION_GET_REMAINED_BROKER_RECHARGE , "ns" ) ) ; SOAPElement element = bodyElement . addChildElement ( new QName ( namespace , "BrokerID" , "ns" ) ) ; element . addTextNode ( username ) ; element = bodyElement . addChildElement ( new QName ( namespace , "CardAmount" , "ns" ) ) ; element . addTextNode ( Integer . toString ( amount ) ) ; request . saveChanges ( ) ; } catch ( SOAPException e ) { throw new RuntimeException ( "soap<seq2seq4repair_space>extended<seq2seq4repair_space>request<seq2seq4repair_space>creation<seq2seq4repair_space>error" , e ) ; } SOAPMessage soapResponse = SOAPHelper . callSOAP ( request , url ) ; <START_BUG> MCIProxyGetRemainedBrokerRechargeResponse response = SOAPHelper . parseResponse ( soapResponse , namespace , "GetRemainedRechargeResponse" , MCIProxyGetRemainedBrokerRechargeResponse . class ) ; <END_BUG> return response ; } }

Fix:
MCIProxyGetRemainedBrokerRechargeResponse response = SOAPHelper . parseResponse ( soapResponse , namespace , "GetRemainedBrokerRechargeResponse" , MCIProxyGetRemainedBrokerRechargeResponse . class ) ;
Buggy code:
public class MainActivity extends Activity implements OnSyncStateChangedListener , EventItemClickListener { @ Override protected void onCreate ( Bundle savedInstanceState ) { super . onCreate ( savedInstanceState ) ; ExtendedCalendarView calendarView = new ExtendedCalendarView ( this , this ) ; CalendarSyncStateView syncStateView = new CalendarSyncStateView ( this , this ) ; <START_BUG> setContentView ( syncStateView ) ; <END_BUG> } @ Override public void OnEventItemClicked ( Event event ) { } @ Override public void onSyncStateChanged ( CalendarData data , Switch switchView ) { } }

Fix:
setContentView ( calendarView ) ;
Buggy code:
public class TestIndexWriterCommit extends LuceneTestCase { public void testCommitOnClose ( ) throws IOException { } public void testCommitOnCloseAbort ( ) throws IOException { } public void testCommitOnCloseDiskUsage ( ) throws IOException { } public void testCommitOnCloseForceMerge ( ) throws IOException { } public void testCommitThreadSafety ( ) throws Throwable { final int NUM_THREADS = 5 ; final double RUN_SEC = 0.5 ; final Directory dir = newDirectory ( ) ; final RandomIndexWriter w = new RandomIndexWriter ( random , dir , newIndexWriterConfig ( TEST_VERSION_CURRENT , new MockAnalyzer ( random ) ) . setMergePolicy ( newLogMergePolicy ( ) ) ) ; _TestUtil . reduceOpenFiles ( w . w ) ; w . commit ( ) ; final AtomicBoolean failed = new AtomicBoolean ( ) ; Thread [ ] threads = new Thread [ NUM_THREADS ] ; final long endTime = ( System . currentTimeMillis ( ) ) + ( ( long ) ( RUN_SEC * 1000 ) ) ; for ( int i = 0 ; i < NUM_THREADS ; i ++ ) { final int finalI = i ; threads [ i ] = new Thread ( ) { @ Override public void run ( ) { try { final Document doc = new Document ( ) ; DirectoryReader r = IndexReader . open ( dir ) ; Field f = newField ( "f" , "" , TYPE_UNSTORED ) ; doc . add ( f ) ; int count = 0 ; do { if ( failed . get ( ) ) break ; for ( int j = 0 ; j < 10 ; j ++ ) { final String s = ( finalI + "_" ) + ( String . valueOf ( ( count ++ ) ) ) ; <START_BUG> f . setValue ( s ) ; <END_BUG> w . addDocument ( doc ) ; w . commit ( ) ; DirectoryReader r2 = DirectoryReader . openIfChanged ( r ) ; assertNotNull ( r2 ) ; assertTrue ( ( r2 != r ) ) ; r . close ( ) ; r = r2 ; assertEquals ( ( ( ( "term=f:" + s ) + ";<seq2seq4repair_space>r=" ) + r ) , 1 , r . docFreq ( new Term ( "f" , s ) ) ) ; } } while ( ( System . currentTimeMillis ( ) ) < endTime ) ; r . close ( ) ; } catch ( Throwable t ) { failed . set ( true ) ; throw new RuntimeException ( t ) ; } } } ; threads [ i ] . start ( ) ; } for ( int i = 0 ; i < NUM_THREADS ; i ++ ) { threads [ i ] . join ( ) ; } assertFalse ( failed . get ( ) ) ; w . close ( ) ; dir . close ( ) ; } public void testForceCommit ( ) throws IOException { } public void testFutureCommit ( ) throws Exception { } public void testZeroCommits ( ) throws Exception { } public void testPrepareCommit ( ) throws IOException { } public void testPrepareCommitRollback ( ) throws IOException { } public void testPrepareCommitNoChanges ( ) throws IOException { } public void testCommitUserData ( ) throws IOException { } }

Fix:
f . setStringValue ( s ) ;
Buggy code:
public class BarChartView extends ChartView { private static final int GAP_WIDTH = 10 ; private RectF barRect ; public BarChartView ( Context context , AttributeSet attrs ) { } public BarChartView ( Context context , AttributeSet attrs , int defStyle ) { } private void init ( ) { } protected void onDraw ( Canvas canvas ) { if ( ( mDataSet . size ( ) ) == 0 ) return ; if ( mShowHorGrid ) { for ( Float point : mDataSet . getMajorPoints ( ) ) canvas . drawLine ( 0 , calcY ( point ) , getWidth ( ) , calcY ( point ) , mGridPaint ) ; } int i = 0 ; <START_BUG> int width = ( ( ( getWidth ( ) ) - ( getPaddingLeft ( ) ) ) - ( getPaddingRight ( ) ) ) // ( mDataSet . size ( ) ) ; <END_BUG> mColorPalette . reset ( ) ; for ( DataEntry entry : mDataSet ) { mChartPaint . setColor ( mColorPalette . next ( ) ) ; float x = ( i * width ) + ( getPaddingLeft ( ) ) ; barRect . set ( ( x + ( ( BarChartView . GAP_WIDTH ) // 2 ) ) , calcY ( entry . getyValue ( ) ) , ( ( x + width ) - ( ( BarChartView . GAP_WIDTH ) // 2 ) ) , getHeight ( ) ) ; canvas . drawRect ( barRect , mChartPaint ) ; if ( mShowValues ) { canvas . drawText ( entry . getStringValue ( mDataSet . getMax ( ) ) , ( x + ( width // 2 ) ) , ( ( calcY ( entry . getyValue ( ) ) ) + ( ( mValuePaint . getTextSize ( ) ) * 1.3F ) ) , mValuePaint ) ; } i ++ ; } } private float calcY ( float value ) { } }

Fix:
float width = ( ( ( getWidth ( ) ) - ( getPaddingLeft ( ) ) ) - ( getPaddingRight ( ) ) ) // ( ( float ) ( mDataSet . size ( ) ) ) ;
Buggy code:
public class Message implements Cloneable { private Header header ; private Vector [ ] sections ; private int size ; private byte [ ] wireFormat ; private boolean frozen ; boolean TSIGsigned ; boolean TSIGverified ; public Message ( int id ) { } public Message ( ) { } public static Message newQuery ( Record r ) { } public static Message newUpdate ( Name zone ) { } Message ( DataByteInputStream in ) throws IOException { } public Message ( byte [ ] b ) throws IOException { } public void setHeader ( Header h ) { } public Header getHeader ( ) { } public void addRecord ( Record r , int section ) { } public boolean removeRecord ( Record r , int section ) { } public void removeAllRecords ( int section ) { } public boolean findRecord ( Record r , int section ) { } public boolean findRecord ( Record r ) { } public boolean findRRset ( Name name , short type , int section ) { for ( int i = 0 ; i < ( sections [ section ] . size ( ) ) ; i ++ ) { Record r = ( ( Record ) ( sections [ section ] . elementAt ( i ) ) ) ; <START_BUG> if ( ( ( r . getType ( ) ) == type ) || ( name . equals ( r . getName ( ) ) ) ) <END_BUG> return true ; } return false ; } public boolean findRRset ( Name name , short type ) { } public Record getQuestion ( ) { } public TSIGRecord getTSIG ( ) { } public boolean isSigned ( ) { } public boolean isVerified ( ) { } public OPTRecord getOPT ( ) { } public short getRcode ( ) { } public Enumeration getSection ( int section ) { } public Record [ ] getSectionArray ( int section ) { } void toWire ( DataByteOutputStream out ) throws IOException { } public byte [ ] toWire ( ) throws IOException { } public void freeze ( ) { } public void thaw ( ) { } public int numBytes ( ) { } public String sectionToString ( int i ) { } public String toString ( ) { } public Object clone ( ) { } }

Fix:
if ( ( ( r . getType ( ) ) == type ) && ( name . equals ( r . getName ( ) ) ) )
Buggy code:
public class ElfoTest { @ Test public void testaConstrutor ( ) { } @ Test public void testaSobrecargaConstrutor ( ) { } @ Test public void testaAtirarUmaFlecha ( ) { } @ Test public void testaAtirarDuasFlechas ( ) { } @ Test public void testaAtirarTresFlechas ( ) { } @ Test public void testaToString ( ) { } @ Test public void testaToString1 ( ) { } @ Test public void testaToString2 ( ) { Elfo elfo = new Elfo ( "Orelha" , 100 ) ; <START_BUG> elfo . atirarFlecha ( new Dwarf ( null ) ) ; <END_BUG> assertEquals ( elfo . toString ( ) , "Orelha<seq2seq4repair_space>possui<seq2seq4repair_space>99<seq2seq4repair_space>flechas<seq2seq4repair_space>e<seq2seq4repair_space>1<seq2seq4repair_space>nível<seq2seq4repair_space>de<seq2seq4repair_space>experiência." ) ; } }

Fix:
elfo . atirarFlecha ( new Dwarf ( "Anao" ) ) ;
Buggy code:
public class BoonEventBusProxyCreator implements EventBusProxyCreator { private static final String flushMethodNames = Sys . sysProp ( "io.advantageous.qbit.events.EventBusProxyCreator.flushMethodNames" , "clientProxyFlush,flushEvents" ) ; private final Set < String > flushMethodNameSet = Sets . set ( Str . split ( BoonEventBusProxyCreator . flushMethodNames , ',' ) ) ; @ Override public < T > T createProxy ( final EventManager eventManager , final Class < T > eventBusProxyInterface ) { } @ Override public < T > T createProxyWithChannelPrefix ( final EventManager eventManager , final Class < T > eventBusProxyInterface , final String channelPrefix ) { if ( ! ( eventBusProxyInterface . isInterface ( ) ) ) { throw new IllegalArgumentException ( "Must<seq2seq4repair_space>be<seq2seq4repair_space>an<seq2seq4repair_space>interface<seq2seq4repair_space>for<seq2seq4repair_space>eventBusProxyInterface<seq2seq4repair_space>argument" ) ; } final Map < String , String > methodToChannelMap = createMethodToChannelMap ( channelPrefix , eventBusProxyInterface ) ; final InvocationHandler invocationHandler = ( proxy , method , args ) -> { if ( flushMethodNameSet . contains ( method . getName ( ) ) ) { flushServiceProxy ( eventManager ) ; return null ; } final String channelName = methodToChannelMap . get ( method . toString ( ) ) ; eventManager . sendArray ( channelName , args ) ; return null ; } ; <START_BUG> final Object o = Proxy . newProxyInstance ( Thread . currentThread ( ) . getContextClassLoader ( ) , new Class [ ] { eventBusProxyInterface , ClientProxy . class } , invocationHandler ) ; <END_BUG> return ( ( T ) ( o ) ) ; } private < T > Map < String , String > createMethodToChannelMap ( final String channelPrefix , final Class < T > eventBusProxyInterface ) { } }

Fix:
final Object o = Proxy . newProxyInstance ( eventBusProxyInterface . getClassLoader ( ) , new Class [ ] { eventBusProxyInterface , ClientProxy . class } , invocationHandler ) ;
Buggy code:
public class EntityManagerFactoryImpl implements Closeable , OpenJPAEntityManagerFactory , OpenJPAEntityManagerFactorySPI { private static final Localizer _loc = Localizer . forPackage ( EntityManagerFactoryImpl . class ) ; private DelegatingBrokerFactory _factory = null ; private transient Constructor < FetchPlan > _plan = null ; private transient StoreCache _cache = null ; private transient QueryResultCache _queryCache = null ; public EntityManagerFactoryImpl ( ) { } public EntityManagerFactoryImpl ( BrokerFactory factory ) { } public BrokerFactory getBrokerFactory ( ) { } public void setBrokerFactory ( BrokerFactory factory ) { } public OpenJPAConfiguration getConfiguration ( ) { } public Properties getProperties ( ) { } public Object putUserObject ( Object key , Object val ) { } public Object getUserObject ( Object key ) { } public StoreCache getStoreCache ( ) { } public StoreCache getStoreCache ( String cacheName ) { } public QueryResultCache getQueryResultCache ( ) { } public OpenJPAEntityManagerSPI createEntityManager ( ) { } public OpenJPAEntityManagerSPI createEntityManager ( Map props ) { } protected EntityManagerImpl newEntityManagerImpl ( Broker broker ) { } public void addLifecycleListener ( Object listener , Class ... classes ) { } public void removeLifecycleListener ( Object listener ) { } public void addTransactionListener ( Object listener ) { } public void removeTransactionListener ( Object listener ) { } public void close ( ) { } public boolean isOpen ( ) { } public int hashCode ( ) { } public boolean equals ( Object other ) { } FetchPlan toFetchPlan ( Broker broker , FetchConfiguration fetch ) { } public Cache getCache ( ) { } public QueryBuilder getQueryBuilder ( ) { <START_BUG> return new QueryBuilderImpl ( ) ; <END_BUG> } public Set < String > getSupportedProperties ( ) { } }

Fix:
return new QueryBuilderImpl ( this ) ;
Buggy code:
public class FlashAttributeResultMatchers { protected FlashAttributeResultMatchers ( ) { } public < T > ResultMatcher attribute ( final String name , final Matcher < T > matcher ) { } public < T > ResultMatcher attribute ( final String name , final Object value ) { return new ResultMatcher ( ) { @ SuppressWarnings ( "unchecked" ) public void match ( MvcResult result ) throws Exception { <START_BUG> assertEquals ( "Flash<seq2seq4repair_space>attribute" , value , ( ( T ) ( result . getFlashMap ( ) . get ( name ) ) ) ) ; <END_BUG> } } ; } public < T > ResultMatcher attributeExists ( final String ... names ) { } public < T > ResultMatcher attributeCount ( final int count ) { } }

Fix:
assertEquals ( "Flash<seq2seq4repair_space>attribute" , value , result . getFlashMap ( ) . get ( name ) ) ;
Buggy code:
public class Menus { public static final int NONE = - 1 ; public static final int MAIN = 0 ; public static final int MENU = 1 ; public static final int OPTIONS = 2 ; public static final int BATTLES = 3 ; public static final int SAVES = 4 ; public List < Buttons [ ] > buttons = new ArrayList < > ( ) ; public String [ ] [ ] names = new String [ ] [ ] { new String [ ] { "New<seq2seq4repair_space>Game" , "Resume<seq2seq4repair_space>Game" , "Load<seq2seq4repair_space>Game" , "Options" , "Exit" } , new String [ ] { "Resume" , "Options" , "Save" , "Load" , "Exit" } } ; public String resolution = ( ( Resolution . width ( ) ) + "<seq2seq4repair_space>*<seq2seq4repair_space>" ) + ( Resolution . height ( ) ) ; public List < Buttons > button = new ArrayList < > ( ) ; public List < TextBox > textboxes = new ArrayList < > ( ) ; public static int menu = 0 ; public static boolean mainMenu = true ; public static int getLastMenuState ( ) { } public InputHandler input ; public Destinyor game ; public ResolutionButton rButton = new ResolutionButton ( this ) ; public boolean isOn = true ; public int buttonSelected = 0 ; public Menus ( Destinyor game , InputHandler input ) { } public void checkMenu ( ) { <START_BUG> if ( Keys . Escape ( ) ) { <END_BUG> Menus . menu = 1 ; Menus . movement ( ) ; } } public void render ( Screen screen ) { } public void mouseChecker ( Mouse mouse , int width , int height ) { } public void mainMenu ( Mouse mouse ) { } public void pauseMenu ( Mouse mouse ) { } public void optionsMenu ( Mouse mouse ) { } public void inputChecker ( ) { } public void click ( ) { } public static void movement ( ) { } }

Fix:
if ( ( Keys . Escape ( ) ) && ( ! ( Cutscene . playing ) ) ) {
Buggy code:
public class TestFieldCache extends LuceneTestCase { private static AtomicReader reader ; private static int NUM_DOCS ; private static int NUM_ORDS ; private static String [ ] unicodeStrings ; private static BytesRef [ ] [ ] multiValued ; private static Directory directory ; @ BeforeClass public static void beforeClass ( ) throws Exception { } @ AfterClass public static void afterClass ( ) throws Exception { } public void testInfoStream ( ) throws Exception { } public void test ( ) throws IOException { } public void testEmptyIndex ( ) throws Exception { } private static String generateString ( int i ) { } public void testDocsWithField ( ) throws Exception { } public void testGetDocsWithFieldThreadSafety ( ) throws Exception { } public void testDocValuesIntegration ( ) throws Exception { } public void testNonexistantFields ( ) throws Exception { } public void testNonIndexedFields ( ) throws Exception { } public void testLongFieldCache ( ) throws IOException { } public void testIntFieldCache ( ) throws IOException { Directory dir = newDirectory ( ) ; IndexWriterConfig cfg = newIndexWriterConfig ( TEST_VERSION_CURRENT , new org . apache . lucene . analysis . MockAnalyzer ( random ( ) ) ) ; cfg . setMergePolicy ( newLogMergePolicy ( ) ) ; <START_BUG> RandomIndexWriter iw = new RandomIndexWriter ( random ( ) , dir ) ; <END_BUG> Document doc = new Document ( ) ; IntField field = new IntField ( "f" , 0 , Store . YES ) ; doc . add ( field ) ; final int [ ] values = new int [ _TestUtil . nextInt ( random ( ) , 1 , 10 ) ] ; for ( int i = 0 ; i < ( values . length ) ; ++ i ) { final int v ; switch ( random ( ) . nextInt ( 10 ) ) { case 0 : v = Integer . MIN_VALUE ; break ; case 1 : v = 0 ; break ; case 2 : v = Integer . MAX_VALUE ; break ; default : v = _TestUtil . nextInt ( random ( ) , ( - 10 ) , 10 ) ; break ; } values [ i ] = v ; if ( ( v == 0 ) && ( random ( ) . nextBoolean ( ) ) ) { iw . addDocument ( new Document ( ) ) ; } else { field . setIntValue ( v ) ; iw . addDocument ( doc ) ; } } iw . forceMerge ( 1 ) ; final DirectoryReader reader = iw . getReader ( ) ; final FieldCache . Ints ints = DEFAULT . getInts ( getOnlySegmentReader ( reader ) , "f" , false ) ; for ( int i = 0 ; i < ( values . length ) ; ++ i ) { assertEquals ( values [ i ] , ints . get ( i ) ) ; } reader . close ( ) ; iw . close ( ) ; dir . close ( ) ; } }

Fix:
RandomIndexWriter iw = new RandomIndexWriter ( random ( ) , dir , cfg ) ;
Buggy code:
public class FormatExtension { protected final String name ; protected final SpotlessExtension root ; public FormatExtension ( String name , SpotlessExtension root ) { } protected FileCollection target ; @ SuppressWarnings ( "unchecked" ) public void target ( Object target ) { } protected List < FormatterStep > steps = new ArrayList < > ( ) ; public void customLazy ( String name , Supplier < Function < String , String > > formatterSupplier ) { } public void custom ( String name , Closure < String > formatter ) { } public void custom ( String name , Function < String , String > formatter ) { } public void customReplace ( String name , CharSequence original , CharSequence after ) { } public void customReplaceRegex ( String name , String regex , String replacement ) { } public void trimTrailingWhitespace ( ) { } public void indentWithSpaces ( int tabToSpaces ) { } public void indentWithSpaces ( ) { } public void indentWithTabs ( int tabToSpaces ) { } public void indentWithTabs ( ) { <START_BUG> indentWithSpaces ( 4 ) ; <END_BUG> } public void licenseHeader ( String licenseHeader , String delimiter ) { } public void licenseHeaderFile ( Object licenseHeaderFile , String delimiter ) { } protected void setupTask ( FormatTask task ) throws Exception { } protected Project getProject ( ) { } }

Fix:
indentWithTabs ( 4 ) ;
Buggy code:
public class MainActivity extends AppCompatActivity { private static final String RECEIPT_TYPE = "ReceiptType" ; private static final String JSON_DATA = "JsonData" ; private static final String TEMPLATE_HTML = "template.html" ; private static final String MINI_STATEMENT_TEMPLATE_HTML = "miniStatementTemplate.html" ; private WebViewPrint webViewPrint ; private TextView statusTextView ; @ Override protected void onCreate ( Bundle savedInstanceState ) { } private Bitmap getQRBitmap ( ) { } private void createPhoto ( ) throws JSONException { } private void createQR ( ) { } boolean isResumeOnce = false ; @ Override public void onResume ( ) { } public static Bitmap createImageFromString ( String hexString ) { } public static final byte [ ] hexStringToByteArray2 ( final String hex ) { } public static String bytesToHexString ( byte [ ] bytes ) { } public static byte [ ] convertFileToByte ( InputStream is ) { } private void checkPrintStatus ( ) { } private File getHtmlFile ( ) throws IOException { } private String getHtml ( ) throws IOException { } private Integer getReceiptType ( ) { String receiptType = this . getIntent ( ) . getStringExtra ( MainActivity . RECEIPT_TYPE ) ; if ( receiptType == null ) { <START_BUG> receiptType = "17" ; <END_BUG> } return Integer . parseInt ( receiptType ) ; } private String getJsonString ( ) { } private String getDummyHexStringForPhoto ( ) { } private String getDummyJsonString ( int receipt ) { } No newline ; at end ; of file ; }

Fix:
receiptType = "19" ;
Buggy code:
public class OpenMessageWithComposerCommand extends Command { protected ComposerController controller ; protected ComposerModel model ; protected AbstractMessageFolder folder ; protected Object uid ; public OpenMessageWithComposerCommand ( ICommandReference reference ) { } public void updateGUI ( ) throws Exception { } public void execute ( WorkerStatusController worker ) throws Exception { } private void initBody ( Message message , boolean preferHtml ) throws Exception { MimeTree mimeTree = message . getMimePartTree ( ) ; LocalMimePart bodyPart = null ; if ( preferHtml ) { bodyPart = ( ( LocalMimePart ) ( mimeTree . getFirstTextPart ( "html" ) ) ) ; } else { bodyPart = ( ( LocalMimePart ) ( mimeTree . getFirstTextPart ( "plain" ) ) ) ; } if ( bodyPart != null ) { MimeHeader header = bodyPart . getHeader ( ) ; if ( header . getMimeType ( ) . getSubtype ( ) . equals ( "html" ) ) { model . setHtml ( true ) ; } else { model . setHtml ( false ) ; } InputStream bodyStream = folder . getMimePartBodyStream ( uid , bodyPart . getAddress ( ) ) ; switch ( header . getContentTransferEncoding ( ) ) { case MimeHeader . QUOTED_PRINTABLE : { bodyStream = new QuotedPrintableDecoderInputStream ( bodyStream ) ; break ; } case MimeHeader . BASE64 : { bodyStream = new Base64DecoderInputStream ( bodyStream ) ; } } String charset = header . getContentParameter ( "charset" ) ; if ( charset != null ) { try { bodyStream = new CharsetDecoderInputStream ( bodyStream , Charset . forName ( charset ) ) ; model . setCharset ( Charset . forName ( charset ) ) ; } catch ( UnsupportedCharsetException e ) { } } <START_BUG> model . setBodyText ( StreamUtils . readInString ( bodyStream ) . toString ( ) ) ; <END_BUG> } initAttachments ( mimeTree , bodyPart ) ; } private void initHeader ( Message message ) { } private void initAttachments ( MimeTree collection , MimePart bodyPart ) { } }

Fix:
model . setBodyText ( StreamUtils . readCharacterStream ( bodyStream ) . toString ( ) ) ;
Buggy code:
public class NotifyAtDeadlineTest extends AndroidTestCase { @ SuppressLint ( "NewApi" ) private static final int MILLIS_PER_HOUR = ( ( int ) ( TimeUnit . HOURS . toMillis ( 1 ) ) ) ; private final Task dueAtNoon = new Task ( ) { } ; private ReminderService reminderService ; private Preferences preferences ; @ Override public void setUp ( ) { <START_BUG> preferences = new Preferences ( getContext ( ) ) ; <END_BUG> reminderService = new ReminderService ( getContext ( ) , preferences ) ; freezeAt ( new DateTime ( 2014 , 1 , 24 , 17 , 23 , 37 ) ) ; } @ Override public void tearDown ( ) { } public void testScheduleReminderAtDueTime ( ) { } public void testNoReminderWhenNoDueDate ( ) { } public void testNoReminderWhenNotifyAtDeadlineFlagNotSet ( ) { } public void testDontNotifyMoreThanOncePerDay ( ) { } public void disabled_testNotifyIfLastNotificationWasMoreThanOneDayAgo ( ) { } public void testDuringQuietHoursSetNotificationAtEnd ( ) { } public void testAfterQuietHoursSetNotificationOnePeriodCloserToDueDate ( ) { } public void testBeforeQuietStartDueDateMoreThanOnePeriodAfterEnd ( ) { } public void testBeforeQuietStartDueDateLessThanOnePeriodAfterEnd ( ) { } public void testNoAlarmAfterQuietHoursStartWithWrap ( ) { } public void testSetToQuietAlarmEndWithWrap ( ) { } public void testSetReminderOnePeriodFromNowBeforeQuietHourStartWithWrap ( ) { } public void testSetReminderOnePeriodFromNowNoQuietHours ( ) { } private void setQuietHours ( int start , int end ) { } }

Fix:
preferences = new Preferences ( getContext ( ) , null ) ;
Buggy code:
public class Server < C extends Connection > extends EndPointServer < C > { public static String getVersion ( ) { <START_BUG> return "1.6" ; <END_BUG> } @ Property public static int backlogConnectionCount = 50 ; private final ServerBootstrap localBootstrap ; private final ServerBootstrap tcpBootstrap ; private final Bootstrap udpBootstrap ; private final ServerBootstrap udtBootstrap ; private final int tcpPort ; private final int udpPort ; private final int udtPort ; private final String localChannelName ; public Server ( ) throws InitializationException , IOException , SecurityException { } @ SuppressWarnings ( "AutoBoxing" ) public Server ( Configuration options ) throws InitializationException , IOException , SecurityException { } public void bind ( ) { } @ SuppressWarnings ( "AutoBoxing" ) public void bind ( boolean blockUntilTerminate ) { } }

Fix:
return "1.8" ;
Buggy code:
public class INS { public DenseMatrix64F Pos_b = new DenseMatrix64F ( 3 , 1 ) ; public DenseMatrix64F Vel_b = new DenseMatrix64F ( 3 , 1 ) ; public DenseMatrix64F Cbn = new DenseMatrix64F ( 3 , 3 ) ; public DenseMatrix64F gravity = new DenseMatrix64F ( 3 , 1 ) ; public INS . DataAccum accum = new INS . DataAccum ( ) ; private DenseMatrix64F acc = new DenseMatrix64F ( 3 , 1 ) ; private DenseMatrix64F gyro = new DenseMatrix64F ( 3 , 1 ) ; DenseMatrix64F rotv = new DenseMatrix64F ( 3 , 1 ) ; DenseMatrix64F mx_a = new DenseMatrix64F ( 3 , 3 ) ; DenseMatrix64F mx_b = new DenseMatrix64F ( 3 , 3 ) ; DenseMatrix64F vr_a = new DenseMatrix64F ( 3 , 1 ) ; public INS ( float [ ] pos , float [ ] vel , float [ ] dcm ) { } public void set_dcm ( float [ ] dcm ) { } public void set_pos ( float [ ] pos ) { } public void set_vel ( float [ ] vel ) { } public double [ ] get_dcm ( ) { } public double [ ] get_pos ( ) { } public void get_posn ( float [ ] out ) { } public void get_gravity ( float [ ] out ) { } public void update_attI ( float [ ] gdat , float dt ) { } public void rot2dcm ( DenseMatrix64F rotvec , DenseMatrix64F dcm ) { } public void update_velI ( float [ ] adat , float dt ) { } public void update_velII ( float [ ] gdat , float dt ) { } public void update_posI ( float [ ] gdat , float dt ) { } public void update_posII ( float dt ) { } public static void skew ( DenseMatrix64F vec , DenseMatrix64F smat ) { } public void update ( DenseMatrix64F dx ) { } class DataAccum { private DenseMatrix64F acacc = new DenseMatrix64F ( 3 , 1 ) ; private DenseMatrix64F acgyro = new DenseMatrix64F ( 3 , 1 ) ; private int acina = 0 ; private int acing = 0 ; private DenseMatrix64F vr_a = new DenseMatrix64F ( 3 , 1 ) ; public void clear ( ) { } public void addacc ( float [ ] dat ) { } public void addgyro ( float [ ] dat ) { } public void avacc ( float [ ] out ) { } public void avgyro ( float [ ] out ) { } public void avacc ( DenseMatrix64F out ) { } public void avgyro ( DenseMatrix64F out ) { if ( ( acing ) > 0 ) { <START_BUG> CommonOps . scale ( ( 1 // ( acing ) ) , acgyro , out ) ; <END_BUG> INS . skew ( vr_a , out ) ; } else out . zero ( ) ; } } No newline ; at end ; of file ; }

Fix:
CommonOps . scale ( ( 1 // ( acing ) ) , acgyro , vr_a ) ;
Buggy code:
public class TypeValidator extends StringValidator { private Locale locale = null ; private Class type ; public TypeValidator ( final Class type ) { } public TypeValidator ( final Class type , final Locale locale ) { } public final Class getType ( ) { } public void onValidate ( String value ) { if ( ! ( Strings . isEmpty ( value ) ) ) { <START_BUG> final IConverter converter = getComponent ( ) . getConverter ( ) ; <END_BUG> try { converter . convert ( value , type ) ; } catch ( ConversionException e ) { error ( messageModel ( e ) ) ; } } } public String toString ( ) { } protected Map messageModel ( final ConversionException e ) { } private final Locale getLocale ( ) { } }

Fix:
final IConverter converter = getFormComponent ( ) . getConverter ( ) ;
Buggy code:
public class MainActivity extends Activity implements OnClickListener { private FragmentManager fragmentManager ; private RadioGroup radioGroup ; private ActionBar actionBar ; private HeadBar headBar ; private Fragment fragment ; private PopupWindow popupwindow ; private Button rightButton ; private View customView ; @ Override protected void onCreate ( Bundle savedInstanceState ) { super . onCreate ( savedInstanceState ) ; setContentView ( activity_main ) ; LayoutInflater layoutInflater = LayoutInflater . from ( this ) ; customView = layoutInflater . inflate ( popview_item , null ) ; fragmentManager = getFragmentManager ( ) ; radioGroup = ( ( RadioGroup ) ( findViewById ( rg_tab ) ) ) ; rightButton = ( ( Button ) ( findViewById ( button_right ) ) ) ; actionBar = getActionBar ( ) ; actionBar . hide ( ) ; headBar = ( ( HeadBar ) ( findViewById ( head_bar ) ) ) ; headBar . setLeftButtonNoused ( ) ; radioGroup . setOnCheckedChangeListener ( new RadioGroup . OnCheckedChangeListener ( ) { @ Override public void onCheckedChanged ( RadioGroup group , int checkedId ) { try { FragmentTransaction transaction = fragmentManager . beginTransaction ( ) ; fragment = FragmentFactory . getInstanceByIndex ( checkedId ) ; transaction . replace ( content , fragment ) ; transaction . commit ( ) ; } catch ( Exception e ) { Log . i ( "fuck" , e . toString ( ) ) ; } } } ) ; headBar . setRightButtonListener ( new View . OnClickListener ( ) { @ Override public void onClick ( View v ) { if ( ( v . getId ( ) ) == ( id . button_right ) ) { if ( ( ( popupwindow ) != null ) && ( popupwindow . isShowing ( ) ) ) { popupwindow . dismiss ( ) ; return ; } else { initmPopupWindowView ( ) ; <START_BUG> popupwindow . showAsDropDown ( v , 0 , 5 ) ; <END_BUG> } } } } ) ; } private void initmPopupWindowView ( ) { } @ Override public void onClick ( View v ) { } }

Fix:
popupwindow . showAsDropDown ( v , 0 , 3 ) ;
Buggy code:
public class Clock { private long startTime ; private long maxTime ; private long currentTime ; private boolean stopClock ; public Clock ( long maxTime ) { } public boolean timeOut ( ) { } public void resetTimer ( ) { } public long timePassed ( ) { <START_BUG> if ( ( stopClock ) == false ) { <END_BUG> return ( System . currentTimeMillis ( ) ) - ( startTime ) ; } else { return maxTime ; } } public void stopClock ( ) { } public long getMaxTime ( ) { } }

Fix:
if ( ! ( stopClock ) ) {
Buggy code:
public class AttributeModifierComponentTest extends TestCase { private static Log log = LogFactory . getLog ( AttributeModifierComponentTest . class ) ; private MockWebApplication application ; public AttributeModifierComponentTest ( final String name ) { } protected void setUp ( ) throws Exception { super . setUp ( ) ; application = new MockWebApplication ( null ) ; <START_BUG> application . getPages ( ) . setHomePage ( AttributeModifierComponentPage . class ) ; <END_BUG> } public void testComponentTagAttributeModification ( ) throws Exception { } private boolean validateDocument ( String document ) { } }

Fix:
application . getRequiredPageSettings ( ) . setHomePage ( AttributeModifierComponentPage . class ) ;
Buggy code:
class StormServerHandler extends SimpleChannelUpstreamHandler { private static final Logger LOG = LoggerFactory . getLogger ( StormServerHandler . class ) ; Server server ; private AtomicInteger failure_count ; StormServerHandler ( Server server ) { } @ Override public void channelConnected ( ChannelHandlerContext ctx , ChannelStateEvent e ) { } @ Override public void messageReceived ( ChannelHandlerContext ctx , MessageEvent e ) { Object msg = e . getMessage ( ) ; if ( msg == null ) return ; <START_BUG> if ( msg . equals ( ControlMessage . eobMessage ( ) ) ) { <END_BUG> Channel channel = ctx . getChannel ( ) ; StormServerHandler . LOG . debug ( "Send<seq2seq4repair_space>back<seq2seq4repair_space>response<seq2seq4repair_space>..." ) ; if ( ( failure_count . get ( ) ) == 0 ) channel . write ( ControlMessage . okResponse ( ) ) ; else channel . write ( ControlMessage . failureResponse ( ) ) ; return ; } try { server . enqueue ( ( ( TaskMessage ) ( msg ) ) ) ; } catch ( InterruptedException e1 ) { StormServerHandler . LOG . info ( "failed<seq2seq4repair_space>to<seq2seq4repair_space>enqueue<seq2seq4repair_space>a<seq2seq4repair_space>request<seq2seq4repair_space>message" , e ) ; failure_count . incrementAndGet ( ) ; } } @ Override public void exceptionCaught ( ChannelHandlerContext ctx , ExceptionEvent e ) { } }

Fix:
if ( msg == ( ControlMessage . eobMessage ( ) ) ) {
Buggy code:
public class Visit < R > implements IVisit < R > { private static enum Action { CONTINUE , CONTINUE_BUT_DONT_GO_DEEPER , STOP ; } private R result ; private Visit . Action action = Visit . Action . CONTINUE ; public void stop ( ) { } <START_BUG> public void stop ( R result ) { <END_BUG> action = Visit . Action . STOP ; this . result = result ; } public void dontGoDeeper ( ) { } public boolean isStopped ( ) { } public boolean isContinue ( ) { } public boolean isDontGoDeeper ( ) { } public R getResult ( ) { } }

Fix:
public void stop ( final R result ) {
Buggy code:
public class Shallow { static Category cat = Category . getInstance ( Shallow . class ) ; public static void main ( String [ ] argv ) { } static void usage ( String msg ) { } static void init ( String configFile ) { } static void test ( ) { } static void delay ( int amount ) { try { <START_BUG> Thread . currentThread ( ) . sleep ( amount ) ; <END_BUG> } catch ( Exception e ) { } } }

Fix:
Thread . sleep ( amount ) ;
Buggy code:
public class ComplimentService extends Service { private static String [ ] listOfCompliments ; private Set < Integer > numSet = new TreeSet < Integer > ( ) ; static boolean initialize ( Context c , String [ ] compliments ) { } @ Override public void onStart ( Intent i , int startId ) { int rand = ComplimentService . randInt ( 0 , ( ( ComplimentService . listOfCompliments . length ) - 1 ) ) ; if ( numSet . contains ( rand ) ) { while ( numSet . contains ( rand ) ) { rand = ComplimentService . randInt ( 0 , ( ( ComplimentService . listOfCompliments . length ) - 1 ) ) ; } } numSet . add ( rand ) ; <START_BUG> String message = ComplimentService . listOfCompliments [ rand ] ; <END_BUG> NotificationPusher . notify ( getBaseContext ( ) , message ) ; Log . d ( "HappiestAppInTheWorld" , "Notification<seq2seq4repair_space>service<seq2seq4repair_space>called." ) ; Log . d ( "HappiestAppInTheWorld" , message ) ; } @ Override public IBinder onBind ( Intent intent ) { } public static int randInt ( int min , int max ) { } No newline ; at end ; of file ; }

Fix:
String message = getResources ( ) . getStringArray ( compliments_arr ) [ rand ] ;
Buggy code:
public class ScopedComponentResolver implements IComponentResolver { private static final long serialVersionUID = 1L ; public ScopedComponentResolver ( ) { } public boolean resolve ( final MarkupContainer container , final MarkupStream markupStream , final ComponentTag tag ) { final String id = tag . getId ( ) ; MarkupContainer parent = container ; while ( ( ( ! ( parent instanceof Page ) ) && ( ! ( parent instanceof Panel ) ) ) && ( parent != null ) ) { parent = parent . getParent ( ) ; if ( parent == null ) { return false ; } final Component component = parent . get ( id ) ; if ( ( component != null ) && ( component instanceof IScopedComponent ) ) { IScopedComponent sc = ( ( IScopedComponent ) ( component ) ) ; if ( sc . isRenderableInSubContainers ( ) ) { <START_BUG> component . render ( markupStream ) ; <END_BUG> return true ; } } } return false ; } }

Fix:
component . render ( ) ;
Buggy code:
public class CCUpdate extends ClearCase { public static final String FLAG_GRAPHICAL = "-graphical" ; public static final String FLAG_LOG = "-log" ; public static final String FLAG_OVERWRITE = "-overwrite" ; public static final String FLAG_NOVERWRITE = "-noverwrite" ; public static final String FLAG_RENAME = "-rename" ; public static final String FLAG_CURRENTTIME = "-ctime" ; public static final String FLAG_PRESERVETIME = "-ptime" ; private boolean m_Graphical = false ; private boolean m_Overwrite = false ; private boolean m_Rename = false ; private boolean m_Ctime = false ; private boolean m_Ptime = false ; private String m_Log = null ; public void setCurrentTime ( boolean ct ) { } public void setGraphical ( boolean graphical ) { } public void setLog ( String log ) { } public void setOverwrite ( boolean ow ) { } public void setPreserveTime ( boolean pt ) { } public void setRename ( boolean ren ) { } public boolean getCurrentTime ( ) { } public boolean getGraphical ( ) { } public String getLog ( ) { } public boolean getOverwrite ( ) { } public boolean getPreserveTime ( ) { } public boolean getRename ( ) { } public void execute ( ) throws TaskException { Commandline commandLine = new Commandline ( ) ; Project aProj = getProject ( ) ; int result = 0 ; if ( ( getViewPath ( ) ) == null ) { <START_BUG> setViewPath ( aProj . getBaseDir ( ) . getPath ( ) ) ; <END_BUG> } commandLine . setExecutable ( getClearToolCommand ( ) ) ; commandLine . createArgument ( ) . setValue ( COMMAND_UPDATE ) ; checkOptions ( commandLine ) ; System . out . println ( commandLine . toString ( ) ) ; result = run ( commandLine ) ; if ( result != 0 ) { String msg = "Failed<seq2seq4repair_space>executing:<seq2seq4repair_space>" + ( commandLine . toString ( ) ) ; throw new TaskException ( msg ) ; } } private void getLogCommand ( Commandline cmd ) { } private void checkOptions ( Commandline cmd ) { } }

Fix:
setViewPath ( getBaseDirectory ( ) . getPath ( ) ) ;
Buggy code:
public class HtmlParser implements Serializable { private static transient Logger log = Hierarchy . getDefaultHierarchy ( ) . getLoggerFor ( "jmeter.protocol.http" ) ; protected static String utfEncodingName ; private int compilerOptions = ( ( Perl5Compiler . CASE_INSENSITIVE_MASK ) | ( Perl5Compiler . MULTILINE_MASK ) ) | ( Perl5Compiler . READ_ONLY_MASK ) ; private static PatternCacheLRU patternCache = new PatternCacheLRU ( 1000 , new Perl5Compiler ( ) ) ; private static ThreadLocal localMatcher = new ThreadLocal ( ) { protected Object initialValue ( ) { } } ; public HtmlParser ( ) { } public static synchronized boolean isAnchorMatched ( HTTPSampler newLink , HTTPSampler config ) throws MalformedPatternException { } public static synchronized boolean isArgumentMatched ( Argument arg , Argument patternArg ) throws MalformedPatternException { } public static Tidy getParser ( ) { } public static Node getDOM ( String text ) throws SAXException { } public static String getUTFEncodingName ( ) { } public static Document createEmptyDoc ( ) { <START_BUG> return new Tidy ( ) . createEmptyDocument ( ) ; <END_BUG> } public static HTTPSampler createUrlFromAnchor ( String parsedUrlString , HTTPSampler context ) throws MalformedURLException { } public static List createURLFromForm ( Node doc , HTTPSampler context ) { } private static boolean recurseForm ( Node tempNode , LinkedList urlConfigs , HTTPSampler context , String selectName , boolean inForm ) { } private static String getAttributeValue ( NamedNodeMap att , String attName ) { } private static String printNode ( Node node ) { } public static class Test extends TestCase { private static transient Logger log = Hierarchy . getDefaultHierarchy ( ) . getLoggerFor ( "jmeter.test" ) ; public Test ( String name ) { } public void testGetUTFEncodingName ( ) { } protected void setUp ( ) { } } private static HTTPSampler createFormUrlConfig ( Node tempNode , HTTPSampler context ) throws MalformedURLException { } }

Fix:
return Tidy . createEmptyDocument ( ) ;
Buggy code:
public class RecyclerAdapter extends RecyclerView . Adapter < RecyclerAdapter . EntryListRowHolder > { private List < UKEntry > entries ; private LayoutInflater inflater ; private RecyclerAdapter . ClickListener clickListener ; private String [ ] months ; public RecyclerAdapter ( Context context , List < UKEntry > entries ) { } @ Override public RecyclerAdapter . EntryListRowHolder onCreateViewHolder ( ViewGroup parent , int viewType ) { } @ Override public void onBindViewHolder ( RecyclerAdapter . EntryListRowHolder EntryListRowHolder , int i ) { UKEntry entry = entries . get ( i ) ; Date date = entry . getDate ( ) ; <START_BUG> EntryListRowHolder . date . setText ( ( ( ( date . getDay ( ) ) + ".<seq2seq4repair_space>" ) + ( months [ date . getMonth ( ) ] ) ) ) ; <END_BUG> EntryListRowHolder . content . setText ( entry . getContent ( ) ) ; } public void setClickListener ( RecyclerAdapter . ClickListener clickListener ) { } @ Override public int getItemCount ( ) { } public interface ClickListener { public void itemClicked ( View view , int position ) { } } public class EntryListRowHolder extends RecyclerView . ViewHolder implements View . OnClickListener { protected TextView date ; protected TextView content ; public EntryListRowHolder ( View view ) { } @ Override public void onClick ( View v ) { } } }

Fix:
EntryListRowHolder . date . setText ( ( ( ( date . getDate ( ) ) + ".<seq2seq4repair_space>" ) + ( months [ date . getMonth ( ) ] ) ) ) ;
Buggy code:
public final class DomainControllerDeploymentItem implements Serializable , DeploymentItem { private static final long serialVersionUID = 4835276878814763612L ; <START_BUG> public void install ( final DeploymentItemContext context ) { <END_BUG> } }

Fix:
public void install ( final BatchBuilder builder ) {
Buggy code:
public class ActivityUtil { private String DATE_FORMAT_NOW = "yyyy-MM-dd" ; private SimpleDateFormat sdf = new SimpleDateFormat ( DATE_FORMAT_NOW ) ; private Activity activity ; public ActivityUtil ( Activity activity ) { } public void popupInputMethodWindow ( ) { } private static final int SECOND_MILLIS = 1000 ; private static final int MINUTE_MILLIS = 60 * ( ActivityUtil . SECOND_MILLIS ) ; private static final int HOUR_MILLIS = 60 * ( ActivityUtil . MINUTE_MILLIS ) ; private static final int DAY_MILLIS = 24 * ( ActivityUtil . HOUR_MILLIS ) ; public String getTimeAgo ( long time ) { if ( time < 1000000000000L ) { time *= 1000 ; } long now = new DateTime ( ) . getMillis ( ) ; if ( ( time > now ) || ( time <= 0 ) ) { return null ; } final long diff = now - time ; if ( diff < ( ActivityUtil . MINUTE_MILLIS ) ) { return this . activity . getString ( timeago_just_now ) ; } else if ( diff < ( 2 * ( ActivityUtil . MINUTE_MILLIS ) ) ) { return 1 + ( this . activity . getString ( timeago_min ) ) ; } else if ( diff < ( 50 * ( ActivityUtil . MINUTE_MILLIS ) ) ) { <START_BUG> return ( diff // ( ActivityUtil . MINUTE_MILLIS ) ) + ( this . activity . getString ( timeago_just_now ) ) ; <END_BUG> } else if ( diff < ( 90 * ( ActivityUtil . MINUTE_MILLIS ) ) ) { return 1 + ( this . activity . getString ( timeago_hrs ) ) ; } else if ( diff < ( 24 * ( ActivityUtil . HOUR_MILLIS ) ) ) { return ( diff // ( ActivityUtil . HOUR_MILLIS ) ) + ( this . activity . getString ( timeago_hrs ) ) ; } else if ( diff < ( 48 * ( ActivityUtil . HOUR_MILLIS ) ) ) { return this . activity . getString ( timeago_yesterday ) ; } else if ( diff < ( 14 * ( ActivityUtil . DAY_MILLIS ) ) ) { return ( diff // ( ActivityUtil . DAY_MILLIS ) ) + ( this . activity . getString ( timeago_days ) ) ; } else { Date date = new Date ( time ) ; return sdf . format ( date ) ; } } public int getRealDimension ( int size ) { } public String getResponseBody ( Response response ) { } public boolean isOnline ( ) { } }

Fix:
return ( diff // ( ActivityUtil . MINUTE_MILLIS ) ) + ( this . activity . getString ( timeago_min ) ) ;
Buggy code:
public class TestRollingUpdates extends LuceneTestCase { @ Test public void testRollingUpdates ( ) throws Exception { Random random = new Random ( random ( ) . nextLong ( ) ) ; <START_BUG> final MockDirectoryWrapper dir = newDirectory ( ) ; <END_BUG> dir . setCheckIndexOnClose ( false ) ; final LineFileDocs docs = new LineFileDocs ( random , true ) ; if ( random ( ) . nextBoolean ( ) ) { Codec . setDefault ( _TestUtil . alwaysPostingsFormat ( new org . apache . lucene . codecs . memory . MemoryPostingsFormat ( random ( ) . nextBoolean ( ) , random . nextFloat ( ) ) ) ) ; } final IndexWriter w = new IndexWriter ( dir , newIndexWriterConfig ( TEST_VERSION_CURRENT , new org . apache . lucene . analysis . MockAnalyzer ( random ( ) ) ) ) ; final int SIZE = atLeast ( 20 ) ; int id = 0 ; IndexReader r = null ; final int numUpdates = ( ( int ) ( SIZE * ( 2 + ( TEST_NIGHTLY ? 200 * ( random ( ) . nextDouble ( ) ) : 5 * ( random ( ) . nextDouble ( ) ) ) ) ) ) ; if ( VERBOSE ) { System . out . println ( ( "TEST:<seq2seq4repair_space>numUpdates=" + numUpdates ) ) ; } for ( int docIter = 0 ; docIter < numUpdates ; docIter ++ ) { final Document doc = docs . nextDoc ( ) ; final String myID = "" + id ; if ( id == ( SIZE - 1 ) ) { id = 0 ; } else { id ++ ; } ( ( Field ) ( doc . getField ( "docid" ) ) ) . setStringValue ( myID ) ; w . updateDocument ( new Term ( "docid" , myID ) , doc ) ; if ( ( docIter >= SIZE ) && ( ( random ( ) . nextInt ( 50 ) ) == 17 ) ) { if ( r != null ) { r . close ( ) ; } final boolean applyDeletions = random ( ) . nextBoolean ( ) ; r = w . getReader ( applyDeletions ) ; assertTrue ( ( ( ( ( ( "applyDeletions=" + applyDeletions ) + "<seq2seq4repair_space>r.numDocs()=" ) + ( r . numDocs ( ) ) ) + "<seq2seq4repair_space>vs<seq2seq4repair_space>SIZE=" ) + SIZE ) , ( ( ! applyDeletions ) || ( ( r . numDocs ( ) ) == SIZE ) ) ) ; } } if ( r != null ) { r . close ( ) ; } w . commit ( ) ; assertEquals ( SIZE , w . numDocs ( ) ) ; w . close ( ) ; docs . close ( ) ; _TestUtil . checkIndex ( dir ) ; dir . close ( ) ; } public void testUpdateSameDoc ( ) throws Exception { } static class IndexingThread extends Thread { final LineFileDocs docs ; final IndexWriter writer ; final int num ; public IndexingThread ( LineFileDocs docs , IndexWriter writer , int num ) { } public void run ( ) { } } }

Fix:
final BaseDirectoryWrapper dir = newDirectory ( ) ;