nus-yam/ex-repair huggingface dataset:
Buggy code:
public class GameMain extends Game { SpriteBatch batch ; Texture img ; static int screenWidth = 960 ; static int screenHeight = 540 ; OrthographicCamera camera ; Renderer r ; ShapeRenderer shape ; Controls c ; FPSLogger log ; BitmapFont font ; @ Override public void create ( ) { } @ Override public void render ( ) { gl . glClear ( GL_COLOR_BUFFER_BIT ) ; r . render ( ) ; c . update ( r ) ; batch . begin ( ) ; font . draw ( batch , ( "fps:<seq2seq4repair_space>" + ( graphics . getFramesPerSecond ( ) ) ) , 20 , 30 ) ; font . draw ( batch , ( "draw<seq2seq4repair_space>calls:<seq2seq4repair_space>" + ( GLProfiler . drawCalls ) ) , 20 , 45 ) ; GLProfiler . reset ( ) ; Iterator < Integer > xIt = r . xBatch . iterator ( ) ; Iterator < Integer > y1It = r . y1Batch . iterator ( ) ; Iterator < Integer > y2It = r . y2Batch . iterator ( ) ; Iterator < Integer > lineHeight = r . lineHeightBatch . iterator ( ) ; Iterator < Integer > temp = r . testBatch . iterator ( ) ; int textX = 0 ; while ( y2It . hasNext ( ) ) { int tempY = y2It . next ( ) ; int tempY1 = y1It . next ( ) ; float height = tempY1 - tempY ; <START_BUG> batch . draw ( img , ( ( ( float ) ( xIt . next ( ) ) ) * 3.2F ) , ( ( float ) ( tempY ) ) , 3.2F , ( ( float ) ( height ) ) , temp . next ( ) , 0 , 1 , 64 , false , true ) ; <END_BUG> if ( textX == 64 ) { textX = 0 ; } else { textX ++ ; } } batch . end ( ) ; r . xBatch . clear ( ) ; r . y1Batch . clear ( ) ; r . y2Batch . clear ( ) ; } }

Fix:
batch . draw ( img , ( ( float ) ( xIt . next ( ) ) ) , ( ( float ) ( tempY ) ) , 3.2F , ( ( float ) ( height ) ) , temp . next ( ) , 0 , 1 , 64 , false , true ) ;
Buggy code:
@ RunWith ( Arquillian . class ) @ RunAsClient public class NoApplicationIntegrationTestCase { @ Deployment ( testable = false ) public static Archive < ? > deploy ( ) { WebArchive war = ShrinkWrap . create ( WebArchive . class , "jaxrsnoap.war" ) ; war . addPackage ( HttpRequest . class . getPackage ( ) ) ; war . addClasses ( NoApplicationIntegrationTestCase . class , HelloWorldResource . class ) ; <START_BUG> war . addAsWebResource ( WebXml . get ( ( "<servlet-mapping>\n" + ( ( ( "<seq2seq4repair_space><servlet-name>javax.ws.rs.core.Application<//servlet-name>\n" + "<seq2seq4repair_space><url-pattern>//myjaxrs//*<//url-pattern>\n" ) + "<seq2seq4repair_space><//servlet-mapping>\n" ) + "\n" ) ) ) , "web.xml" ) ; <END_BUG> return war ; } private static String performCall ( String urlPattern ) throws Exception { } @ Test public void testJaxRsWithNoApplication ( ) throws Exception { } }

Fix:
war . addAsWebInfResource ( WebXml . get ( ( "<servlet-mapping>\n" + ( ( ( "<seq2seq4repair_space><servlet-name>javax.ws.rs.core.Application<//servlet-name>\n" + "<seq2seq4repair_space><url-pattern>//myjaxrs//*<//url-pattern>\n" ) + "<seq2seq4repair_space><//servlet-mapping>\n" ) + "\n" ) ) ) , "web.xml" ) ;
Buggy code:
public class GossipDigestSynVerbHandler implements IVerbHandler { private static Logger logger_ = LoggerFactory . getLogger ( GossipDigestSynVerbHandler . class ) ; public void doVerb ( Message message ) { InetAddress from = message . getFrom ( ) ; if ( GossipDigestSynVerbHandler . logger_ . isTraceEnabled ( ) ) GossipDigestSynVerbHandler . logger_ . trace ( "Received<seq2seq4repair_space>a<seq2seq4repair_space>GossipDigestSynMessage<seq2seq4repair_space>from<seq2seq4repair_space>{}" , from ) ; if ( ! ( instance . isEnabled ( ) ) ) { if ( GossipDigestSynVerbHandler . logger_ . isTraceEnabled ( ) ) GossipDigestSynVerbHandler . logger_ . trace ( "Ignoring<seq2seq4repair_space>GossipDigestSynMessage<seq2seq4repair_space>because<seq2seq4repair_space>gossip<seq2seq4repair_space>is<seq2seq4repair_space>disabled" ) ; return ; } byte [ ] bytes = message . getMessageBody ( ) ; DataInputStream dis = new DataInputStream ( new ByteArrayInputStream ( bytes ) ) ; try { <START_BUG> GossipDigestSynMessage gDigestMessage = GossipDigestSynMessage . serializer ( ) . deserialize ( dis ) ; <END_BUG> if ( ! ( gDigestMessage . clusterId_ . equals ( DatabaseDescriptor . getClusterName ( ) ) ) ) { GossipDigestSynVerbHandler . logger_ . warn ( ( ( ( ( ( "ClusterName<seq2seq4repair_space>mismatch<seq2seq4repair_space>from<seq2seq4repair_space>" + from ) + "<seq2seq4repair_space>" ) + ( gDigestMessage . clusterId_ ) ) + "!=" ) + ( DatabaseDescriptor . getClusterName ( ) ) ) ) ; return ; } List < GossipDigest > gDigestList = gDigestMessage . getGossipDigests ( ) ; if ( GossipDigestSynVerbHandler . logger_ . isTraceEnabled ( ) ) { StringBuilder sb = new StringBuilder ( ) ; for ( GossipDigest gDigest : gDigestList ) { sb . append ( gDigest ) ; sb . append ( "<seq2seq4repair_space>" ) ; } GossipDigestSynVerbHandler . logger_ . trace ( ( "Gossip<seq2seq4repair_space>syn<seq2seq4repair_space>digests<seq2seq4repair_space>are<seq2seq4repair_space>:<seq2seq4repair_space>" + ( sb . toString ( ) ) ) ) ; } instance . notifyFailureDetector ( gDigestList ) ; doSort ( gDigestList ) ; List < GossipDigest > deltaGossipDigestList = new ArrayList < GossipDigest > ( ) ; Map < InetAddress , EndpointState > deltaEpStateMap = new HashMap < InetAddress , EndpointState > ( ) ; instance . examineGossiper ( gDigestList , deltaGossipDigestList , deltaEpStateMap ) ; GossipDigestAckMessage gDigestAck = new GossipDigestAckMessage ( deltaGossipDigestList , deltaEpStateMap ) ; Message gDigestAckMessage = instance . makeGossipDigestAckMessage ( gDigestAck , message . getVersion ( ) ) ; if ( GossipDigestSynVerbHandler . logger_ . isTraceEnabled ( ) ) GossipDigestSynVerbHandler . logger_ . trace ( "Sending<seq2seq4repair_space>a<seq2seq4repair_space>GossipDigestAckMessage<seq2seq4repair_space>to<seq2seq4repair_space>{}" , from ) ; MessagingService . instance ( ) . sendOneWay ( gDigestAckMessage , from ) ; } catch ( IOException e ) { throw new RuntimeException ( e ) ; } } private void doSort ( List < GossipDigest > gDigestList ) { } }

Fix:
GossipDigestSynMessage gDigestMessage = GossipDigestSynMessage . serializer ( ) . deserialize ( dis , message . getVersion ( ) ) ;
Buggy code:
public class HobsonPluginEventLoopWrapper implements EventListener , HobsonPlugin , ServiceListener { private final Logger logger = LoggerFactory . getLogger ( getClass ( ) ) ; private volatile ActionManager actionManager ; private volatile DeviceManager deviceManager ; private volatile DiscoManager discoManager ; private volatile EventManager eventManager ; private volatile ExecutorService executorService ; private volatile HubManager hubManager ; private volatile PluginManager pluginManager ; private volatile TaskManager taskManager ; private volatile VariableManager variableManager ; private HobsonPlugin plugin ; public HobsonPluginEventLoopWrapper ( HobsonPlugin plugin ) { } public void start ( ) { } public void stop ( ) { } @ Override public void onHobsonEvent ( final HobsonEvent event ) { plugin . getRuntime ( ) . executeInEventLoop ( new Runnable ( ) { @ Override public void run ( ) { try { if ( ( event instanceof PluginConfigurationUpdateEvent ) && ( plugin . getId ( ) . equals ( ( ( PluginConfigurationUpdateEvent ) ( event ) ) . getPluginId ( ) ) ) ) { PluginConfigurationUpdateEvent pcue = ( ( PluginConfigurationUpdateEvent ) ( event ) ) ; plugin . getRuntime ( ) . onPluginConfigurationUpdate ( pcue . getConfiguration ( ) ) ; } else if ( ( event instanceof DeviceConfigurationUpdateEvent ) && ( plugin . getId ( ) . equals ( ( ( DeviceConfigurationUpdateEvent ) ( event ) ) . getPluginId ( ) ) ) ) { DeviceConfigurationUpdateEvent dcue = ( ( DeviceConfigurationUpdateEvent ) ( event ) ) ; plugin . getRuntime ( ) . onDeviceConfigurationUpdate ( dcue . getDeviceId ( ) , dcue . getConfiguration ( ) ) ; } else { plugin . getRuntime ( ) . onHobsonEvent ( event ) ; } <START_BUG> } catch ( Exception e ) { <END_BUG> logger . error ( "An<seq2seq4repair_space>error<seq2seq4repair_space>occurred<seq2seq4repair_space>processing<seq2seq4repair_space>an<seq2seq4repair_space>event" , e ) ; } } } ) ; } @ Override public String getId ( ) { } @ Override public String getName ( ) { } @ Override public String getVersion ( ) { } @ Override public PluginStatus getStatus ( ) { } @ Override public long getRefreshInterval ( ) { } @ Override public String [ ] getEventTopics ( ) { } @ Override public Collection < ConfigurationPropertyMetaData > getConfigurationPropertyMetaData ( ) { } @ Override public PluginType getType ( ) { } @ Override public boolean isConfigurable ( ) { } @ Override public HobsonPluginRuntime getRuntime ( ) { } @ Override public void serviceChanged ( ServiceEvent serviceEvent ) { } }

Fix:
} catch ( Throwable e ) {
Buggy code:
public class Customer { private String code ; private char type ; private String primaryContact ; private String name ; private int airlineMiles ; public String getCode ( ) { } public void setCode ( String code ) { } public char getType ( ) { } public void setType ( char type ) { if ( ( ( type == 'G' ) || ( type == 'C' ) ) || ( type == 'V' ) ) { this . type = type ; } else { System . out . println ( "That<seq2seq4repair_space>is<seq2seq4repair_space>not<seq2seq4repair_space>a<seq2seq4repair_space>valid<seq2seq4repair_space>customer<seq2seq4repair_space>type<seq2seq4repair_space>code." ) ; <START_BUG> System . out . println ( "Valid<seq2seq4repair_space>customer<seq2seq4repair_space>codes:<seq2seq4repair_space>G,<seq2seq4repair_space>C,<seq2seq4repair_space>V." ) ; <END_BUG> } } public String getPrimaryContact ( ) { } public void setPrimaryContact ( String primaryContact ) { } public String getName ( ) { } public void setName ( String name ) { } public int getAirlineMiles ( ) { } public void setAirlineMiles ( int airlineMiles ) { } public Customer ( String code , char type , String primaryContact , String name , int airlineMiles ) { } }

Fix:
System . out . println ( "Valid<seq2seq4repair_space>customer<seq2seq4repair_space>type<seq2seq4repair_space>codes:<seq2seq4repair_space>G,<seq2seq4repair_space>C,<seq2seq4repair_space>V." ) ;
Buggy code:
public class SendToMethodReturnValueHandler implements HandlerMethodReturnValueHandler { private final SimpMessageSendingOperations messagingTemplate ; private final boolean annotationRequired ; private String defaultDestinationPrefix = "//topic" ; private String defaultUserDestinationPrefix = "//queue" ; public SendToMethodReturnValueHandler ( SimpMessageSendingOperations messagingTemplate , boolean annotationRequired ) { } public void setDefaultDestinationPrefix ( String defaultDestinationPrefix ) { } public String getDefaultDestinationPrefix ( ) { } public void setDefaultUserDestinationPrefix ( String prefix ) { } public String getDefaultUserDestinationPrefix ( ) { } @ Override public boolean supportsReturnType ( MethodParameter returnType ) { } @ Override public void handleReturnValue ( Object returnValue , MethodParameter returnType , Message < ? > inputMessage ) throws Exception { if ( returnValue == null ) { return ; } SimpMessageHeaderAccessor inputHeaders = SimpMessageHeaderAccessor . wrap ( inputMessage ) ; String sessionId = inputHeaders . getSessionId ( ) ; MessagePostProcessor postProcessor = new SendToMethodReturnValueHandler . SessionHeaderPostProcessor ( sessionId ) ; SendToUser sendToUser = returnType . getMethodAnnotation ( SendToUser . class ) ; if ( sendToUser != null ) { if ( ( inputHeaders . getUser ( ) ) == null ) { throw new MissingSessionUserException ( inputMessage ) ; } String user = inputHeaders . getUser ( ) . getName ( ) ; String [ ] destinations = getTargetDestinations ( sendToUser , inputHeaders , this . defaultUserDestinationPrefix ) ; for ( String destination : destinations ) { this . messagingTemplate . convertAndSendToUser ( user , destination , returnValue , postProcessor ) ; } return ; } else { SendTo sendTo = returnType . getMethodAnnotation ( SendTo . class ) ; String [ ] destinations = getTargetDestinations ( sendTo , inputHeaders , this . defaultDestinationPrefix ) ; <START_BUG> for ( String destination : getTargetDestinations ( sendTo , inputHeaders , this . defaultDestinationPrefix ) ) { <END_BUG> this . messagingTemplate . convertAndSend ( destination , returnValue , postProcessor ) ; } } } protected String [ ] getTargetDestinations ( Annotation annot , SimpMessageHeaderAccessor inputHeaders , String defaultPrefix ) { } private final class SessionHeaderPostProcessor implements MessagePostProcessor { private final String sessionId ; public SessionHeaderPostProcessor ( String sessionId ) { } @ Override public Message < ? > postProcessMessage ( Message < ? > message ) { } } @ Override public String toString ( ) { } }

Fix:
for ( String destination : destinations ) {
Buggy code:
public class Email { public static void sendEmail ( TemplateContext context , ScarabUser fromUser , List toUsers , String subject , String template ) throws Exception { TemplateEmail te = new TemplateEmail ( ) ; if ( context == null ) { context = new DefaultTemplateContext ( ) ; } te . setContext ( context ) ; if ( fromUser == null ) { te . setFrom ( Turbine . getConfiguration ( ) . getString ( "scarab.email.default.fromName" , "Scarab<seq2seq4repair_space>System" ) , Turbine . getConfiguration ( ) . getString ( "scarab.email.default.fromAddress" , "help@scarab.tigris.org" ) ) ; } else { te . setFrom ( ( ( fromUser . getFirstName ( ) ) + ( fromUser . getLastName ( ) ) ) , fromUser . getEmail ( ) ) ; } if ( subject == null ) { te . setSubject ( Turbine . getConfiguration ( ) . getString ( "scarab.email.default.subject" ) ) ; } else { te . setSubject ( subject ) ; } if ( template == null ) { te . setTemplate ( Turbine . getConfiguration ( ) . getString ( "scarab.email.default.template" ) ) ; } else { te . setTemplate ( template ) ; } Iterator iter = toUsers . iterator ( ) ; while ( iter . hasNext ( ) ) { ScarabUser toUser = ( ( ScarabUser ) ( iter . next ( ) ) ) ; <START_BUG> te . setTo ( ( ( ( toUser . getFirstName ( ) ) + "<seq2seq4repair_space>" ) + ( toUser . getLastName ( ) ) ) , toUser . getUserName ( ) ) ; <END_BUG> te . send ( ) ; } } public static void sendEmail ( TemplateContext context , ScarabUser fromUser , ScarabUser toUser , String subject , String template ) throws Exception { } }

Fix:
te . setTo ( ( ( ( toUser . getFirstName ( ) ) + "<seq2seq4repair_space>" ) + ( toUser . getLastName ( ) ) ) , toUser . getEmail ( ) ) ;
Buggy code:
public class UpdateActivity extends ListActivity { public static int iconDrawableId = - 1 ; private UpdateActivity . DownloadFileTask downloadTask ; private UpdateInfoAdapter adapter ; public void onCreate ( Bundle savedInstanceState ) { } private void configureView ( ) { } private static void moveViewBelowOrBesideHeader ( Activity activity , int viewID , int headerID , float offset ) { } @ Override public Object onRetainNonConfigurationInstance ( ) { } public void onClickUpdate ( View v ) { } private void startDownloadTask ( ) { } private class DownloadFileTask extends AsyncTask < String , Integer , Boolean > { private Context context ; private String urlString ; private String filename ; private String filePath ; private ProgressDialog progressDialog ; public DownloadFileTask ( Context context , String urlString ) { } public void attach ( Context context ) { } public void detach ( ) { } @ Override protected Boolean doInBackground ( String ... args ) { } @ Override protected void onProgressUpdate ( Integer ... args ) { } @ Override protected void onPostExecute ( Boolean result ) { if ( ( progressDialog ) != null ) { progressDialog . dismiss ( ) ; } if ( result ) { Intent intent = new Intent ( Intent . ACTION_VIEW ) ; <START_BUG> intent . setDataAndType ( Uri . fromFile ( new File ( Environment . getExternalStorageDirectory ( ) , this . filename ) ) , "application//vnd.android.package-archive" ) ; <END_BUG> intent . setFlags ( FLAG_ACTIVITY_NEW_TASK ) ; startActivity ( intent ) ; } else { AlertDialog . Builder builder = new AlertDialog . Builder ( context ) ; builder . setTitle ( download_failed_dialog_title ) ; builder . setMessage ( download_failed_dialog_message ) ; builder . setNegativeButton ( download_failed_dialog_negative_button , new DialogInterface . OnClickListener ( ) { public void onClick ( DialogInterface dialog , int which ) { } } ) ; builder . setPositiveButton ( download_failed_dialog_positive_button , new DialogInterface . OnClickListener ( ) { public void onClick ( DialogInterface dialog , int which ) { downloadTask = new UpdateActivity . DownloadFileTask ( UpdateActivity . this , getIntent ( ) . getStringExtra ( "url" ) ) ; downloadTask . execute ( ) ; } } ) ; builder . create ( ) . show ( ) ; } } private String getURLString ( ) { } } }

Fix:
intent . setDataAndType ( Uri . fromFile ( new File ( this . filePath , this . filename ) ) , "application//vnd.android.package-archive" ) ;
Buggy code:
public class PairedPatternsSimulator { private final CoalescentSimulator coalescentSimulator = new CoalescentSimulator ( ) ; private final SeqGen sequenceSimulator ; private final TaxonList taxa ; private final DemographicModel demographicModel ; private final int locusCount ; public PairedPatternsSimulator ( final TaxonList taxa , final DemographicModel demographicModel , final SiteModel siteModel , final int locusLength , final int locusCount ) { } private Tree simulateTree ( ) { } private Alignment simulateSite ( ) { } public PairedPatterns simulatePatterns ( ) { final PairedPatterns patterns = new PairedPatterns ( Nucleotides . INSTANCE , taxa ) ; for ( int i = 0 ; i < ( locusCount ) ; ++ i ) { final Alignment alignment = simulateSite ( ) ; for ( int j = 0 ; j < ( taxa . getTaxonCount ( ) ) ; ++ j ) { final Taxon a = taxa . getTaxon ( j ) ; final Sequence x = alignment . getSequence ( jebl . evolution . taxa . Taxon . getTaxon ( a . getId ( ) ) ) ; for ( int k = j + 1 ; k < ( taxa . getTaxonCount ( ) ) ; ++ k ) { final Taxon b = taxa . getTaxon ( k ) ; final Sequence y = alignment . getSequence ( jebl . evolution . taxa . Taxon . getTaxon ( b . getId ( ) ) ) ; <START_BUG> for ( int l = 0 ; l < ( alignment . getSiteCount ( ) ) ; ++ i ) <END_BUG> patterns . addPattern ( a , x . getState ( l ) . getIndex ( ) , b , y . getState ( l ) . getIndex ( ) ) ; } } } return patterns ; } public static final AbstractXMLObjectParser PARSER = new AbstractXMLObjectParser ( ) { private static final String LENGTH = "length" ; private static final String LOCI = "loci" ; @ Override public Object parseXMLObject ( final XMLObject xo ) throws XMLParseException { } @ Override public XMLSyntaxRule [ ] getSyntaxRules ( ) { } private final XMLSyntaxRule [ ] rules = new XMLSyntaxRule [ ] { new ElementRule ( TaxonList . class ) , new ElementRule ( DemographicModel . class ) , new ElementRule ( SiteModel . class ) , AttributeRule . newIntegerRule ( LENGTH ) , AttributeRule . newIntegerRule ( LOCI ) } ; @ Override public String getParserDescription ( ) { } @ Override public Class getReturnType ( ) { } @ Override public String getParserName ( ) { } } ; }

Fix:
for ( int l = 0 ; l < ( alignment . getSiteCount ( ) ) ; ++ l )
Buggy code:
public class TreeColumn extends Item { Tree parent ; int width ; boolean resizable = true ; public TreeColumn ( Tree parent , int style ) { } public TreeColumn ( Tree parent , int style , int index ) { } public void addControlListener ( ControlListener listener ) { } public void addSelectionListener ( SelectionListener listener ) { } static Tree checkNull ( Tree tree ) { } static int checkStyle ( int style ) { } protected void checkSubclass ( ) { } public void dispose ( ) { } void dispose ( boolean notifyParent ) { } public int getAlignment ( ) { } int getContentWidth ( GC gc ) { } int getIndex ( ) { <START_BUG> TreeColumn [ ] columns = parent . getColumns ( ) ; <END_BUG> for ( int i = 0 ; i < ( columns . length ) ; i ++ ) { if ( ( columns [ i ] ) == ( this ) ) return i ; } return - 1 ; } public Tree getParent ( ) { } int getPreferredWidth ( ) { } public boolean getResizable ( ) { } public int getWidth ( ) { } int getX ( ) { } void paint ( GC gc ) { } public void pack ( ) { } public void removeControlListener ( ControlListener listener ) { } public void removeSelectionListener ( SelectionListener listener ) { } public void setAlignment ( int alignment ) { } public void setImage ( Image value ) { } public void setResizable ( boolean value ) { } public void setText ( String value ) { } public void setWidth ( int value ) { } }

Fix:
TreeColumn [ ] columns = parent . columns ;
Buggy code:
public class AbstractLinkTest { private WicketTester wicketTester ; @ Before public void before ( ) { } @ After public void after ( ) { } @ Test public void testSetBodyModel ( ) { final String linkBody = "Link<seq2seq4repair_space>body" ; MockPageWithLink mockPageWithLink = new MockPageWithLink ( ) ; AbstractLink link = new AbstractLink ( "link" ) { private static final long serialVersionUID = 1L ; } ; link . setMarkupId ( "link" ) ; <START_BUG> link . setBodyModel ( Model . of ( linkBody ) ) ; <END_BUG> mockPageWithLink . add ( link ) ; wicketTester . startPage ( mockPageWithLink ) ; TagTester tagTester = wicketTester . getTagById ( "link" ) ; Assert . assertEquals ( linkBody , tagTester . getValue ( ) ) ; } }

Fix:
link . setBody ( Model . of ( linkBody ) ) ;
Buggy code:
public class EditorReference extends WorkbenchPartReference implements IEditorReference { private final EditorManager manager ; private IMemento editorMemento ; private IMemento editorState = null ; private boolean expectingInputChange = false ; private boolean reportedMalfunctioningEditor = false ; String name ; String factoryId ; IEditorInput restoredInput ; private IEditorReference [ ] multiEditorChildren = null ; public EditorReference ( EditorManager manager , IEditorInput input , EditorDescriptor desc ) { } public EditorReference ( EditorManager manager , IEditorInput input , EditorDescriptor desc , IMemento editorState ) { } EditorReference ( EditorManager manager , IMemento memento ) { } public EditorDescriptor getDescriptor ( ) { } private EditorDescriptor getDescriptor ( String id ) { } private void initListenersAndHandlers ( ) { } protected PartPane createPane ( ) { } public void pinStatusUpdated ( ) { } public String getFactoryId ( ) { } protected String computePartName ( ) { } public String getName ( ) { } public IEditorPart getEditor ( boolean restore ) { } protected void releaseReferences ( ) { } void setName ( String name ) { } public IMemento getMemento ( ) { } public IWorkbenchPage getPage ( ) { } protected void doDisposePart ( ) { } public IEditorInput getEditorInput ( ) throws PartInitException { } private IEditorInput getRestoredInput ( ) throws PartInitException { } public ImageDescriptor computeImageDescriptor ( ) { ImageDescriptor descriptor = super . computeImageDescriptor ( ) ; if ( ! ( isPinned ( ) ) ) { return descriptor ; } IPreferenceStore prefStore = WorkbenchPlugin . getDefault ( ) . getPreferenceStore ( ) ; <START_BUG> boolean bUsePin = ( prefStore . getBoolean ( REUSE_EDITORS_BOOLEAN ) ) || ( ( ( org . eclipse . ui . internal . tweaklets . TabBehaviour ) ( org . eclipse . ui . internal . tweaklets . Tweaklets . get ( org . eclipse . ui . internal . tweaklets . TabBehaviour . class ) ) ) . alwaysShowPinAction ( ) ) ; <END_BUG> if ( ! bUsePin ) { return descriptor ; } ImageDescriptor pinDesc = this . manager . getEditorPinImageDesc ( ) ; if ( pinDesc == null ) { return descriptor ; } return new OverlayIcon ( descriptor , pinDesc , new Point ( 16 , 16 ) ) ; } protected IWorkbenchPart createPart ( ) { } protected void partPropertyChanged ( Object source , int propId ) { } public boolean setInput ( IEditorInput input ) { } private void reportMalfunction ( String string ) { } private IEditorPart createPartHelper ( ) throws PartInitException { } public boolean isMultiReference ( ) { } public IEditorPart getEmptyEditor ( EditorDescriptor descr ) { } }

Fix:
boolean bUsePin = ( prefStore . getBoolean ( REUSE_EDITORS_BOOLEAN ) ) || ( ( ( org . eclipse . ui . internal . tweaklets . TabBehaviour ) ( org . eclipse . ui . internal . tweaklets . Tweaklets . get ( TabBehaviour . KEY ) ) ) . alwaysShowPinAction ( ) ) ;
Buggy code:
public class IncomingServerPanel extends DefaultPanel implements ActionListener { private static final Logger LOG = Logger . getLogger ( "org.columba.mail.gui.config.account" ) ; private static final Pattern AUTH_MODE_TOKENIZE_PATTERN = Pattern . compile ( "(\\d+);?" ) ; private JLabel loginLabel ; private JTextField loginTextField ; private JLabel passwordLabel ; private JTextField passwordTextField ; private JLabel hostLabel ; private JTextField hostTextField ; private JLabel portLabel ; private JSpinner portSpinner ; private JLabel typeLabel ; private JComboBox typeComboBox ; private JCheckBox storePasswordCheckBox ; private JCheckBox secureCheckBox ; private JLabel authenticationLabel ; private JComboBox authenticationComboBox ; private JLabel typeDescriptionLabel ; private PopAttributPanel popPanel ; private ImapAttributPanel imapPanel ; private IDefaultItem serverItem = null ; private AccountItem accountItem ; private JCheckBox defaultAccountCheckBox ; private ReceiveOptionsPanel receiveOptionsPanel ; private JButton checkAuthMethods ; private JComboBox sslComboBox ; private JDialog dialog ; public IncomingServerPanel ( JDialog dialog , AccountItem account , ReceiveOptionsPanel receiveOptionsPanel ) { } public String getHost ( ) { } public String getLogin ( ) { } public boolean isPopAccount ( ) { } protected void updateComponents ( boolean b ) { } protected void showDefaultAccountWarning ( ) { } protected void layoutComponents ( ) { } protected void initComponents ( ) { } private void updateAuthenticationComboBox ( ) { } public void actionPerformed ( ActionEvent e ) { } private void showPortChangeMessageBox ( ) { } private IDefaultItem getCurrentDialogSettings ( ) { } private void fetchAuthMechanisms ( ) { List list = new LinkedList ( ) ; IDefaultItem serverItem = getCurrentDialogSettings ( ) ; if ( isPopAccount ( ) ) { POP3Store store = new POP3Store ( ( ( PopItem ) ( serverItem ) ) ) ; try { list = store . checkSupportedAuthenticationMethods ( ) ; } catch ( Exception e ) { new ExceptionHandler ( ) . processException ( e ) ; } } else { <START_BUG> IMAPServer server = new IMAPServer ( ( ( ImapItem ) ( serverItem ) ) , null ) ; <END_BUG> try { list = server . checkSupportedAuthenticationMethods ( ) ; } catch ( Exception e ) { new ExceptionHandler ( ) . processException ( e ) ; } } if ( ( list . size ( ) ) > 0 ) { StringBuffer authMethods = new StringBuffer ( ) ; Iterator it = list . iterator ( ) ; authMethods . append ( it . next ( ) ) ; while ( it . hasNext ( ) ) { authMethods . append ( ';' ) ; authMethods . append ( it . next ( ) ) ; } if ( isPopAccount ( ) ) { accountItem . setString ( POPSERVER , "authentication_methods" , authMethods . toString ( ) ) ; } else { accountItem . setString ( "imapserver" , "authentication_methods" , authMethods . toString ( ) ) ; } } updateAuthenticationComboBox ( ) ; } public boolean isFinished ( ) { } }

Fix:
IMAPServer server = new IMAPServer ( ( ( ImapItem ) ( serverItem ) ) ) ;
Buggy code:
public class NativeTabItem extends WidgetTabItem { public NativeTabItem ( NativeTabFolder parent , int index ) { } public Rectangle getBounds ( ) { } public void setInfo ( PartInfo info ) { TabItem widget = ( ( TabItem ) ( getWidget ( ) ) ) ; if ( ! ( Util . equals ( widget . getText ( ) , info . name ) ) ) { widget . setText ( info . name ) ; } String oldToolTip = Util . safeString ( widget . getToolTipText ( ) ) ; if ( ! ( Util . equals ( info . toolTip , oldToolTip ) ) ) { String toolTip = info . toolTip ; <START_BUG> if ( toolTip . equals ( "" ) ) { <END_BUG> toolTip = null ; } widget . setToolTipText ( toolTip ) ; } } }

Fix:
if ( ( toolTip . length ( ) ) == 0 ) {
Buggy code:
public class HomeActivity extends ActionBarActivity implements AdapterView . OnItemSelectedListener { private static final String TAG = "HomeActivity" ; private static final int OPTION_UPDATE = 1 ; private App mApp ; private HomeFragment mDataFragment ; private LinearLayout mLayout ; private ProgressBar mProgress ; private Spinner mCountries ; private Spinner mCities ; private TextView mText ; @ Override public void onCreate ( Bundle savedInstanceState ) { } private void setUi ( ) { } private void loadData ( ) { } private void showProgress ( ) { } private void setCountries ( ) { } private void setCities ( int countryId ) { } private void setWeather ( ) { } @ Override protected void onResume ( ) { super . onPostResume ( ) ; LocalBroadcastManager . getInstance ( this ) . registerReceiver ( mReceiver , new android . content . IntentFilter ( getPackageName ( ) ) ) ; if ( isMyServiceRunning ( LoadCities . class ) ) { showProgress ( ) ; } else { <START_BUG> if ( ( ( mDataFragment . mCountries ) == null ) || ( ( ( System . currentTimeMillis ( ) ) - ( mApp . getPrefLong ( TIME_CITIES ) ) ) > ( Constants . CACHE_TIME ) ) ) { <END_BUG> loadData ( ) ; } else { setUi ( ) ; if ( ( mDataFragment . mWeather ) != null ) { setWeather ( ) ; } } } } @ Override protected void onPause ( ) { } @ Override public void onItemSelected ( AdapterView < ? > parent , View view , int position , long id ) { } @ Override public void onNothingSelected ( AdapterView < ? > parent ) { } @ Override public boolean onCreateOptionsMenu ( Menu menu ) { } @ Override public boolean onOptionsItemSelected ( MenuItem item ) { } private final BroadcastReceiver mReceiver = new BroadcastReceiver ( ) { @ Override public void onReceive ( Context context , Intent intent ) { } } ; private boolean isMyServiceRunning ( Class < ? > serviceClass ) { } }

Fix:
if ( ( ( System . currentTimeMillis ( ) ) - ( mApp . getPrefLong ( TIME_CITIES ) ) ) > ( Constants . CACHE_TIME ) ) {
Buggy code:
public class IncrementalFacadeTest extends AbstractIncrementalTest { @ Override public String getWorkflowFileName ( ) { <START_BUG> return "//workflow//incrementalfacade.mwe" ; <END_BUG> } @ Override public boolean writesDiff ( ) { } }

Fix:
return "//resources//workflow//incrementalfacade.mwe" ;
Buggy code:
public class PresentSelector extends BaseSelector { private File targetdir = null ; private Mapper mapperElement = null ; private FileNameMapper map = null ; private boolean destmustexist = true ; public PresentSelector ( ) { } public String toString ( ) { <START_BUG> StringBuffer buf = new StringBuffer ( "{presentselector<seq2seq4repair_space>targetdir:<seq2seq4repair_space>" ) ; <END_BUG> if ( ( targetdir ) == null ) { buf . append ( "NOT<seq2seq4repair_space>YET<seq2seq4repair_space>SET" ) ; } else { buf . append ( targetdir . getName ( ) ) ; } buf . append ( "<seq2seq4repair_space>present:<seq2seq4repair_space>" ) ; if ( destmustexist ) { buf . append ( "both" ) ; } else { buf . append ( "srconly" ) ; } if ( ( map ) != null ) { buf . append ( map . toString ( ) ) ; } else if ( ( mapperElement ) != null ) { buf . append ( mapperElement . toString ( ) ) ; } buf . append ( "}" ) ; return buf . toString ( ) ; } public void setTargetdir ( File targetdir ) { } public Mapper createMapper ( ) throws BuildException { } public void addConfigured ( FileNameMapper fileNameMapper ) { } public void setPresent ( PresentSelector . FilePresence fp ) { } public void verifySettings ( ) { } public boolean isSelected ( File basedir , String filename , File file ) { } public static class FilePresence extends EnumeratedAttribute { public String [ ] getValues ( ) { } } }

Fix:
StringBuilder buf = new StringBuilder ( "{presentselector<seq2seq4repair_space>targetdir:<seq2seq4repair_space>" ) ;
Buggy code:
public class MainWindow extends JFrame { public HoraireController horaireController ; public Statistiques statFenetre ; public Note fenetreNote ; public Dimension initialDimension ; public Point initialActivitePoint ; public Point delta ; private boolean horaireEstCharge ; Vector < String > messagesDerreurs ; public MainWindow ( ) { } @ SuppressWarnings ( "unchecked" ) private void initComponents ( ) { } private void updateLogMessage ( MouseEvent evt ) { } private void quitterButtonActionPerformed ( ActionEvent evt ) { } private void noteButtonActionPerformed ( ActionEvent evt ) { } private void statistiquesButtonActionPerformed ( ActionEvent evt ) { } private void planificationAutomatiqueButtonActionPerformed ( ActionEvent evt ) { } private void validationAutoCheckBoxActionPerformed ( ActionEvent evt ) { } private void menuFileNewActionPerformed ( ActionEvent evt ) { } private void drawingPanelMouseMoved ( MouseEvent evt ) { } private void drawingPanelMouseDragged ( MouseEvent evt ) { <START_BUG> horaireController . moveActivite ( horaireController . verificationDrop ( evt . getPoint ( ) ) ) ; <END_BUG> updateLogMessage ( evt ) ; drawingPanel . repaint ( ) ; } private void drawingPanelMouseReleased ( MouseEvent evt ) { } private void drawingPanelMousePressed ( MouseEvent evt ) { } private JPanel buttonPanel ; private DrawingPanel drawingPanel ; private JScrollPane drawingPanelContainer ; private JTextArea logMsgTextArea ; private JPanel mainPanel ; private JMenu menuExport ; private JMenuItem menuExportCopy ; private JMenuItem menuExportPic ; private JMenu menuFile ; private JMenuItem menuFileNew ; private JMenuItem menuFileOpen ; private JMenuItem menuFileQuit ; private JMenuItem menuFileSave ; private JMenuItem menuFileSaveAs ; private JMenu menuHelp ; private JMenuItem menuHelpAbout ; private JMenuItem menuHelpWindow ; private JButton noteButton ; private JButton planificationAutomatiqueButton ; private JButton quitterButton ; private JButton statistiquesButton ; private JLabel titreFichierLabel ; private JMenuBar topMenuBar ; private JCheckBox validationAutoCheckBox ; }

Fix:
horaireController . moveActivite ( evt . getPoint ( ) ) ;
Buggy code:
public class TestBooleanMinShouldMatch extends LuceneTestCase { private static Directory index ; private static IndexReader r ; private static IndexSearcher s ; @ BeforeClass public static void beforeClass ( ) throws Exception { String [ ] data = new String [ ] { "A<seq2seq4repair_space>1<seq2seq4repair_space>2<seq2seq4repair_space>3<seq2seq4repair_space>4<seq2seq4repair_space>5<seq2seq4repair_space>6" , "Z<seq2seq4repair_space>4<seq2seq4repair_space>5<seq2seq4repair_space>6" , null , "B<seq2seq4repair_space>2<seq2seq4repair_space>4<seq2seq4repair_space>5<seq2seq4repair_space>6" , "Y<seq2seq4repair_space>3<seq2seq4repair_space>5<seq2seq4repair_space>6" , null , "C<seq2seq4repair_space>3<seq2seq4repair_space>6" , "X<seq2seq4repair_space>4<seq2seq4repair_space>5<seq2seq4repair_space>6" } ; TestBooleanMinShouldMatch . index = newDirectory ( ) ; RandomIndexWriter w = new RandomIndexWriter ( random ( ) , TestBooleanMinShouldMatch . index ) ; for ( int i = 0 ; i < ( data . length ) ; i ++ ) { Document doc = new Document ( ) ; doc . add ( newStringField ( "id" , String . valueOf ( i ) , YES ) ) ; doc . add ( newStringField ( "all" , "all" , YES ) ) ; if ( null != ( data [ i ] ) ) { doc . add ( newTextField ( "data" , data [ i ] , YES ) ) ; } w . addDocument ( doc ) ; } TestBooleanMinShouldMatch . r = w . getReader ( ) ; TestBooleanMinShouldMatch . s = newSearcher ( TestBooleanMinShouldMatch . r ) ; <START_BUG> w . close ( ) ; <END_BUG> } @ AfterClass public static void afterClass ( ) throws Exception { } public void verifyNrHits ( Query q , int expected ) throws Exception { } public void testAllOptional ( ) throws Exception { } public void testOneReqAndSomeOptional ( ) throws Exception { } public void testSomeReqAndSomeOptional ( ) throws Exception { } public void testOneProhibAndSomeOptional ( ) throws Exception { } public void testSomeProhibAndSomeOptional ( ) throws Exception { } public void testOneReqOneProhibAndSomeOptional ( ) throws Exception { } public void testSomeReqOneProhibAndSomeOptional ( ) throws Exception { } public void testOneReqSomeProhibAndSomeOptional ( ) throws Exception { } public void testSomeReqSomeProhibAndSomeOptional ( ) throws Exception { } public void testMinHigherThenNumOptional ( ) throws Exception { } public void testMinEqualToNumOptional ( ) throws Exception { } public void testOneOptionalEqualToMin ( ) throws Exception { } public void testNoOptionalButMin ( ) throws Exception { } public void testNoOptionalButMin2 ( ) throws Exception { } public void testRandomQueries ( ) throws Exception { } private void assertSubsetOfSameScores ( Query q , TopDocs top1 , TopDocs top2 ) { } public void testRewriteCoord1 ( ) throws Exception { } public void testRewriteNegate ( ) throws Exception { } protected void printHits ( String test , ScoreDoc [ ] h , IndexSearcher searcher ) throws Exception { } }

Fix:
w . shutdown ( ) ;
Buggy code:
public class ModuleRegisterProcessor implements DeploymentUnitProcessor { private final ModuleRegistrationTracker registrationTracker ; public ModuleRegisterProcessor ( ModuleRegistrationTracker tracker ) { } @ Override public void deploy ( final DeploymentPhaseContext phaseContext ) throws DeploymentUnitProcessingException { final DeploymentUnit depUnit = phaseContext . getDeploymentUnit ( ) ; if ( DeploymentTypeMarker . isType ( EAR , depUnit ) ) return ; <START_BUG> if ( depUnit . hasAttachment ( INSTALLED_BUNDLE_KEY ) ) <END_BUG> return ; final Module module = depUnit . getAttachment ( MODULE ) ; final ModuleSpecification moduleSpecification = depUnit . getAttachment ( MODULE_SPECIFICATION ) ; if ( ( module == null ) || ( moduleSpecification . isPrivateModule ( ) ) ) return ; OSGiMetaData metadata = depUnit . getAttachment ( OSGI_METADATA_KEY ) ; registrationTracker . registerModule ( module , metadata ) ; } @ Override public void undeploy ( final DeploymentUnit depUnit ) { } }

Fix:
if ( depUnit . hasAttachment ( BUNDLE_KEY ) )
Buggy code:
public class ApplyRemoteMasterDomainModelHandler implements OperationStepHandler , DescriptionProvider { public static final String OPERATION_NAME = "apply-remote-domain-model" ; private boolean appliedExensions ; private final ExtensionContext extensionContext ; public ApplyRemoteMasterDomainModelHandler ( ExtensionContext extensionContext ) { } public void execute ( OperationContext context , ModelNode operation ) throws OperationFailedException { final ModelNode domainModel = operation . get ( DOMAIN_MODEL ) ; if ( ! ( appliedExensions ) ) { for ( final ModelNode resourceDescription : domainModel . asList ( ) ) { appliedExensions = true ; final PathAddress resourceAddress = PathAddress . pathAddress ( resourceDescription . require ( "domain-resource-address" ) ) ; <START_BUG> final Resource resource = context . createResource ( resourceAddress ) ; <END_BUG> if ( ( ( resourceAddress . size ( ) ) == 1 ) && ( resourceAddress . getElement ( 0 ) . getKey ( ) . equals ( EXTENSION ) ) ) { final String module = resourceAddress . getElement ( 0 ) . getValue ( ) ; try { for ( final Extension extension : Module . loadServiceFromCallerModuleLoader ( ModuleIdentifier . fromString ( module ) , Extension . class ) ) { ClassLoader oldTccl = SecurityActions . setThreadContextClassLoader ( extension . getClass ( ) ) ; try { extension . initialize ( extensionContext ) ; } finally { SecurityActions . setThreadContextClassLoader ( oldTccl ) ; } } } catch ( ModuleLoadException e ) { throw new RuntimeException ( e ) ; } } resource . writeModel ( resourceDescription . get ( "domain-resource-model" ) ) ; } } context . completeStep ( ) ; } public ModelNode getModelDescription ( Locale locale ) { } }

Fix:
final Resource resource = ( ( resourceAddress . size ( ) ) == 0 ) ? context . readResourceForUpdate ( EMPTY_ADDRESS ) : context . createResource ( resourceAddress ) ;
Buggy code:
public class ConfigurationPanel implements Configurable { private boolean modified = false ; private JFilePicker jFilePickerClang ; private JLabeledCombox jLabeledCombox ; private ConfigurationPanel . OptionModifiedListener listener = new ConfigurationPanel . OptionModifiedListener ( this ) ; private ConfigurationPanel . ComboxItemListener combox_listener = new ConfigurationPanel . ComboxItemListener ( this ) ; public static final String OPTION_KEY_CLANG = "macroformatter.clang" ; public static final String OPTION_KEY_STYLE = "macroformatter.style" ; @ Nls @ Override public String getDisplayName ( ) { } @ Nullable @ Override public String getHelpTopic ( ) { } @ Nullable @ Override public JComponent createComponent ( ) { } @ Override public boolean isModified ( ) { } public void setModified ( boolean modified ) { } @ Override public void apply ( ) throws ConfigurationException { } @ Override public void reset ( ) { String clang_path = MacroFormatterSettings . get ( ConfigurationPanel . OPTION_KEY_CLANG ) ; if ( ( clang_path == null ) || ( clang_path . isEmpty ( ) ) ) { <START_BUG> jFilePickerClang . getTextField ( ) . setText ( "clang-format" ) ; <END_BUG> } else { jFilePickerClang . getTextField ( ) . setText ( clang_path ) ; } String code_style = MacroFormatterSettings . get ( ConfigurationPanel . OPTION_KEY_STYLE ) ; if ( ( code_style != null ) && ( ! ( code_style . isEmpty ( ) ) ) ) { jLabeledCombox . getCombobox ( ) . setSelectedItem ( code_style ) ; } modified = false ; } @ Override public void disposeUIResources ( ) { } private static class OptionModifiedListener implements DocumentListener { private final ConfigurationPanel configuration ; public OptionModifiedListener ( ConfigurationPanel configuration ) { } @ Override public void insertUpdate ( DocumentEvent documentEvent ) { } @ Override public void removeUpdate ( DocumentEvent documentEvent ) { } @ Override public void changedUpdate ( DocumentEvent documentEvent ) { } } private static class ComboxItemListener implements ItemListener { private final ConfigurationPanel configuration ; ComboxItemListener ( ConfigurationPanel configuration ) { } @ Override public void itemStateChanged ( ItemEvent e ) { } } }

Fix:
jFilePickerClang . getTextField ( ) . setText ( "//usr//bin//clang-format" ) ;
Buggy code:
class Main { private static ArrayList < String > argumentList ; public static void main ( String [ ] args ) { } public void work ( ) { Bank testBank = new Bank ( "Fred" , 1000 , 20 , true ) ; <START_BUG> testBank . addCustomer ( 500000 ) ; <END_BUG> testBank . printCustomerInfoToFile ( ) ; } }

Fix:
testBank . addCustomer ( 100 ) ;
Buggy code:
public class TestDemoExpressions extends LuceneTestCase { IndexSearcher searcher ; DirectoryReader reader ; Directory dir ; @ Override public void setUp ( ) throws Exception { super . setUp ( ) ; dir = newDirectory ( ) ; RandomIndexWriter iw = new RandomIndexWriter ( random ( ) , dir ) ; Document doc = new Document ( ) ; doc . add ( newStringField ( "id" , "1" , YES ) ) ; doc . add ( newTextField ( "body" , "some<seq2seq4repair_space>contents<seq2seq4repair_space>and<seq2seq4repair_space>more<seq2seq4repair_space>contents" , NO ) ) ; doc . add ( new NumericDocValuesField ( "popularity" , 5 ) ) ; doc . add ( new org . apache . lucene . document . DoubleField ( "latitude" , 40.759011 , Store . NO ) ) ; doc . add ( new org . apache . lucene . document . DoubleField ( "longitude" , ( - 73.9844722 ) , Store . NO ) ) ; iw . addDocument ( doc ) ; doc = new Document ( ) ; doc . add ( newStringField ( "id" , "2" , YES ) ) ; doc . add ( newTextField ( "body" , "another<seq2seq4repair_space>document<seq2seq4repair_space>with<seq2seq4repair_space>different<seq2seq4repair_space>contents" , NO ) ) ; doc . add ( new NumericDocValuesField ( "popularity" , 20 ) ) ; doc . add ( new org . apache . lucene . document . DoubleField ( "latitude" , 40.718266 , Store . NO ) ) ; doc . add ( new org . apache . lucene . document . DoubleField ( "longitude" , ( - 74.007819 ) , Store . NO ) ) ; iw . addDocument ( doc ) ; doc = new Document ( ) ; doc . add ( newStringField ( "id" , "3" , YES ) ) ; doc . add ( newTextField ( "body" , "crappy<seq2seq4repair_space>contents" , NO ) ) ; doc . add ( new NumericDocValuesField ( "popularity" , 2 ) ) ; doc . add ( new org . apache . lucene . document . DoubleField ( "latitude" , 40.7051157 , Store . NO ) ) ; doc . add ( new org . apache . lucene . document . DoubleField ( "longitude" , ( - 74.0088305 ) , Store . NO ) ) ; iw . addDocument ( doc ) ; reader = iw . getReader ( ) ; searcher = new IndexSearcher ( reader ) ; <START_BUG> iw . close ( ) ; <END_BUG> } @ Override public void tearDown ( ) throws Exception { } public void test ( ) throws Exception { } public void testSortValues ( ) throws Exception { } public void testTwoOfSameBinding ( ) throws Exception { } public void testExpressionRefersToExpression ( ) throws Exception { } public void testLotsOfBindings ( ) throws Exception { } private void doTestLotsOfBindings ( int n ) throws Exception { } public void testDistanceSort ( ) throws Exception { } }

Fix:
iw . shutdown ( ) ;
Buggy code:
public class TestSegmentReader extends LuceneTestCase { private MockRAMDirectory dir ; private Document testDoc = new Document ( ) ; private SegmentReader reader = null ; public TestSegmentReader ( String s ) { } @ Override protected void setUp ( ) throws Exception { } @ Override protected void tearDown ( ) throws Exception { } public void test ( ) { } public void testDocument ( ) throws IOException { } public void testDelete ( ) throws IOException { Document docToDelete = new Document ( ) ; DocHelper . setupDoc ( docToDelete ) ; SegmentInfo info = DocHelper . writeDoc ( dir , docToDelete ) ; SegmentReader deleteReader = SegmentReader . get ( false , info , DEFAULT_TERMS_INDEX_DIVISOR ) ; assertTrue ( ( deleteReader != null ) ) ; assertTrue ( ( ( deleteReader . numDocs ( ) ) == 1 ) ) ; deleteReader . deleteDocument ( 0 ) ; <START_BUG> assertTrue ( ( ( deleteReader . isDeleted ( 0 ) ) == true ) ) ; <END_BUG> assertTrue ( ( ( deleteReader . hasDeletions ( ) ) == true ) ) ; assertTrue ( ( ( deleteReader . numDocs ( ) ) == 0 ) ) ; deleteReader . close ( ) ; } public void testGetFieldNameVariations ( ) { } public void testTerms ( ) throws IOException { } public void testNorms ( ) throws IOException { } public static void checkNorms ( IndexReader reader ) throws IOException { } public void testTermVectors ( ) throws IOException { } }

Fix:
assertTrue ( deleteReader . getDeletedDocs ( ) . get ( 0 ) ) ;