nus-yam/ex-repair huggingface dataset:
Buggy code:
public class OperationSlaveStepHandler { private final LocalHostControllerInfo localHostControllerInfo ; private final Map < String , ProxyController > serverProxies ; private final IgnoredDomainResourceRegistry ignoredDomainResourceRegistry ; OperationSlaveStepHandler ( final LocalHostControllerInfo localHostControllerInfo , Map < String , ProxyController > serverProxies , IgnoredDomainResourceRegistry ignoredDomainResourceRegistry ) { } void execute ( OperationContext context , ModelNode operation ) throws OperationFailedException { operation . get ( OPERATION_HEADERS ) . remove ( EXECUTE_FOR_COORDINATOR ) ; addSteps ( context , operation , null , true ) ; <START_BUG> context . completeStep ( ) ; <END_BUG> } void addSteps ( final OperationContext context , final ModelNode operation , final ModelNode response , final boolean recordResponse ) throws OperationFailedException { } private void addBasicStep ( OperationContext context , ModelNode operation ) throws OperationFailedException { } boolean isResourceExcluded ( final PathAddress address ) { } private static class LazyDomainModelProvider implements HostControllerExecutionSupport . DomainModelProvider { private final OperationContext context ; private ModelNode domainModel ; private LazyDomainModelProvider ( OperationContext context ) { } public ModelNode getDomainModel ( ) { } } }

Fix:
context . stepCompleted ( ) ;
Buggy code:
public class NullPredicateTest extends AbstractPredicateTest { @ Test public void testNullPredicate ( ) { } public void ensurePredicateCanBeTypedWithoutWarning ( ) throws Exception { <START_BUG> Predicate < String > predicate = NullPredicate . nullPredicate ( NullPredicate ) ; <END_BUG> assertFalse ( predicate , cString ) ; } @ Override protected Predicate < ? > generatePredicate ( ) { } }

Fix:
final Predicate < String > predicate = NullPredicate . nullPredicate ( NullPredicate ) ;
Buggy code:
final class OutboundQueueImpl implements OutboundQueue { private static final Logger LOG = LoggerFactory . getLogger ( OutboundQueueImpl . class ) ; private static final AtomicIntegerFieldUpdater < OutboundQueueImpl > CURRENT_OFFSET_UPDATER = AtomicIntegerFieldUpdater . newUpdater ( OutboundQueueImpl . class , "reserveOffset" ) ; private static final AtomicIntegerFieldUpdater < OutboundQueueImpl > BARRIER_OFFSET_UPDATER = AtomicIntegerFieldUpdater . newUpdater ( OutboundQueueImpl . class , "barrierOffset" ) ; private final OutboundQueueManager < ? > manager ; private final OutboundQueueEntry [ ] queue ; private final long baseXid ; private final long endXid ; private final int reserve ; private volatile int barrierOffset = - 1 ; private volatile int reserveOffset = 0 ; private int flushOffset ; private int completeCount ; private int lastBarrierOffset = - 1 ; OutboundQueueImpl ( final OutboundQueueManager < ? > manager , final long baseXid , final int maxQueue ) { } private OutboundQueueImpl ( final OutboundQueueManager < ? > manager , final long baseXid , final OutboundQueueEntry [ ] queue ) { } OutboundQueueImpl reuse ( final long baseXid ) { } @ Override public Long reserveEntry ( ) { } @ Override public void commitEntry ( final Long xid , final OfHeader message , final FutureCallback < OfHeader > callback ) { } private Long reserveEntry ( final boolean forBarrier ) { } Long reserveBarrierIfNeeded ( ) { } int startShutdown ( ) { } boolean isShutdown ( final int offset ) { } private boolean isEmpty ( ) { } boolean isFinished ( ) { } boolean isFlushed ( ) { <START_BUG> OutboundQueueImpl . LOG . debug ( "Check<seq2seq4repair_space>queue<seq2seq4repair_space>{}<seq2seq4repair_space>for<seq2seq4repair_space>completeness<seq2seq4repair_space>(offset<seq2seq4repair_space>{},<seq2seq4repair_space>reserve<seq2seq4repair_space>{})" , flushOffset , reserve ) ; <END_BUG> if ( ( flushOffset ) < ( reserve ) ) { return false ; } return ( ( flushOffset ) >= ( queue . length ) ) || ( ! ( queue [ reserve ] . isCommitted ( ) ) ) ; } boolean needsFlush ( ) { } OfHeader flushEntry ( ) { } private boolean xidInRange ( final long xid ) { } private static boolean completeEntry ( final OutboundQueueEntry entry , final OfHeader response ) { } OutboundQueueEntry pairRequest ( @ Nonnull final OfHeader response ) { } private void completeRequests ( final int toOffset ) { } void completeAll ( ) { } int failAll ( final OutboundQueueException cause ) { } }

Fix:
OutboundQueueImpl . LOG . debug ( "Check<seq2seq4repair_space>queue<seq2seq4repair_space>{}<seq2seq4repair_space>for<seq2seq4repair_space>completeness<seq2seq4repair_space>(offset<seq2seq4repair_space>{},<seq2seq4repair_space>reserve<seq2seq4repair_space>{})" , this , flushOffset , reserve ) ;
Buggy code:
public class ConfigHandler { public static File worldFile ; public static Configuration config ; public static void init ( String configPath ) { } private static void loadConfiguration ( ) { } @ SubscribeEvent public void onConfigurationChangedEvent ( ConfigChangedEvent . OnConfigChangedEvent event ) { <START_BUG> if ( event . modID . equalsIgnoreCase ( MOD_ID ) ) { <END_BUG> ConfigHandler . loadConfiguration ( ) ; } } }

Fix:
if ( event . getModID ( ) . equalsIgnoreCase ( MOD_ID ) ) {
Buggy code:
public class MonitorLoaderTest extends BaseTestCase { public void testMonitorLoading ( ) { List < Class < ? extends PaymentServiceMonitor > > services = new PaymentServiceMonitorImplementationLoader ( ) . getAll ( ) ; <START_BUG> assertTrue ( services . contains ( SafaricomKeServiceMonitor . class ) ) ; <END_BUG> } }

Fix:
assertTrue ( services . contains ( ServiceMonitor . class ) ) ;
Buggy code:
public final class ValidationError implements IValidationError { private List < String > keys = new ArrayList < String > ( 1 ) ; private Map < String , Object > vars ; private String message ; public ValidationError ( ) { } public ValidationError addMessageKey ( String key ) { } public ValidationError setVar ( String name , Object value ) { } public Map < String , Object > getVars ( ) { } public ValidationError setVars ( Map < String , Object > vars ) { if ( vars == null ) { <START_BUG> throw new IllegalArgumentException ( "Argument<seq2seq4repair_space>[[params]]<seq2seq4repair_space>cannot<seq2seq4repair_space>be<seq2seq4repair_space>null" ) ; <END_BUG> } this . vars = vars ; return this ; } @ SuppressWarnings ( "unchecked" ) public String getErrorMessage ( IMessageSource messageSource ) { } public String getMessage ( ) { } public ValidationError setMessage ( String message ) { } @ Override public String toString ( ) { } }

Fix:
throw new IllegalArgumentException ( "Argument<seq2seq4repair_space>[[vars]]<seq2seq4repair_space>cannot<seq2seq4repair_space>be<seq2seq4repair_space>null" ) ;
Buggy code:
public class PlayerBuilder { public static PlayerInfo build ( boolean isNormalPlayer , String id , int level , String ... descs ) { } public static PlayerInfo build ( boolean isNormalPlayer , String id , int level , List < Skill > cardBuffs , int heroHpAdj , String ... descs ) { } public static PlayerInfo build ( boolean isNormalPlayer , String id , String descText , int level ) { } public static PlayerInfo build ( boolean isNormalPlayer , String id , String descText , int level , List < Skill > cardBuffs , int heroHpAdj ) { } public static PlayerInfo buildLilith ( LilithDataStore lds , String bossId , boolean withGuards ) { LilithStartupInfo lsi = lds . getStartupInfo ( bossId ) ; if ( lsi == null ) { throw new CardFantasyRuntimeException ( ( "Invalid<seq2seq4repair_space>Lilith<seq2seq4repair_space>ID:<seq2seq4repair_space>" + bossId ) ) ; } DeckStartupInfo dsi = lsi . getDeckStartupInfo ( ) ; <START_BUG> PlayerInfo playerInfo = new PlayerInfo ( false , bossId , 999999 , lsi . getCardBuffs ( ) , 100 , dsi . getRunes ( ) , dsi . getCards ( ) ) ; <END_BUG> if ( ! withGuards ) { for ( Card card : playerInfo . getCards ( ) ) { if ( ( card . getRace ( ) ) != ( Race . BOSS ) ) { playerInfo . removeCard ( card ) ; } } } return playerInfo ; } No newline ; at end ; of file ; }

Fix:
PlayerInfo playerInfo = new PlayerInfo ( false , bossId , 999 , lsi . getCardBuffs ( ) , 100 , dsi . getRunes ( ) , dsi . getCards ( ) ) ;
Buggy code:
public final class UnmodifiableEntrySet < K , V > extends AbstractSetDecorator < Map . Entry < K , V > > implements Unmodifiable { private static final long serialVersionUID = 1678353579659253473L ; public static < K , V > Set < Map . Entry < K , V > > unmodifiableEntrySet ( final Set < Map . Entry < K , V > > set ) { } private UnmodifiableEntrySet ( final Set < Map . Entry < K , V > > set ) { } @ Override public boolean add ( final Map . Entry < K , V > object ) { } @ Override public boolean addAll ( final Collection < ? extends Map . Entry < K , V > > coll ) { } @ Override public void clear ( ) { } @ Override public boolean remove ( final Object object ) { } @ Override public boolean removeAll ( final Collection < ? > coll ) { } @ Override public boolean retainAll ( final Collection < ? > coll ) { } @ Override public Iterator < Map . Entry < K , V > > iterator ( ) { } @ Override @ SuppressWarnings ( "unchecked" ) public Object [ ] toArray ( ) { } @ Override @ SuppressWarnings ( "unchecked" ) public < T > T [ ] toArray ( final T [ ] array ) { } private class UnmodifiableEntrySetIterator extends AbstractIteratorDecorator < Map . Entry < K , V > > { protected UnmodifiableEntrySetIterator ( final Iterator < Map . Entry < K , V > > iterator ) { } @ Override public Map . Entry < K , V > next ( ) { <START_BUG> return new UnmodifiableEntry ( iterator . next ( ) ) ; <END_BUG> } @ Override public void remove ( ) { } } private class UnmodifiableEntry extends AbstractMapEntryDecorator < K , V > { protected UnmodifiableEntry ( final Map . Entry < K , V > entry ) { } @ Override public V setValue ( final V obj ) { } } }

Fix:
return new UnmodifiableEntry ( UnmodifiableEntrySet . UnmodifiableEntrySetIterator . getIterator ( ) . next ( ) ) ;
Buggy code:
public class TestMultipleMappedSuperclassHierarchy extends TestCase { private EntityManagerFactory emf ; public void setUp ( ) { String types = ( ( ( ( MappedSuperclassBase . class . getName ( ) ) + ";" ) + ( MappedSuperclassL2 . class . getName ( ) ) ) + ";" ) + ( EntityL3 . class . getName ( ) ) ; <START_BUG> Map props = new HashMap ( ) ; <END_BUG> props . put ( "openjpa.MetaDataFactory" , ( ( "jpa(Types=" + types ) + ")" ) ) ; emf = Persistence . createEntityManagerFactory ( "test" , props ) ; } public void tearDown ( ) { } public void testPersist ( ) { } public static void main ( String [ ] args ) { } }

Fix:
Map props = new HashMap ( System . getProperties ( ) ) ;
Buggy code:
public class RealImage implements IProxyImage { private String filename ; private Image image ; protected RealImage ( String path , String filename ) { } @ Override public Image getImage ( String path ) { } private void loadIn ( String path , String fileName ) { try { System . out . println ( ( ( ( "RealImage.loadIn:<seq2seq4repair_space>" + path ) + "//" ) + fileName ) ) ; <START_BUG> image = ImageIO . read ( new File ( ( ( path + "//" ) + fileName ) ) ) ; <END_BUG> } catch ( IOException ioe ) { ioe . printStackTrace ( ) ; } } }

Fix:
image = ImageIO . read ( new File ( ( ( ( Constants . IMAGES_PATH ) + "//" ) + fileName ) ) ) ;
Buggy code:
public class MidpointIntegratorTest extends TestCase { public MidpointIntegratorTest ( String name ) { } public void testDimensionCheck ( ) { } public void testDecreasingSteps ( ) throws DerivativeException , IntegratorException { TestProblemAbstract [ ] problems = TestProblemFactory . getProblems ( ) ; for ( int k = 0 ; k < ( problems . length ) ; ++ k ) { double previousError = Double . NaN ; for ( int i = 4 ; i < 10 ; ++ i ) { TestProblemAbstract pb = ( ( TestProblemAbstract ) ( problems [ k ] . clone ( ) ) ) ; double step = ( ( pb . getFinalTime ( ) ) - ( pb . getInitialTime ( ) ) ) * ( Math . pow ( 2.0 , ( - i ) ) ) ; FirstOrderIntegrator integ = new MidpointIntegrator ( step ) ; TestProblemHandler handler = new TestProblemHandler ( pb , integ ) ; integ . setStepHandler ( handler ) ; SwitchingFunction [ ] functions = pb . getSwitchingFunctions ( ) ; for ( int l = 0 ; l < ( functions . length ) ; ++ l ) { <START_BUG> integ . addSwitchingFunction ( functions [ l ] , Double . POSITIVE_INFINITY , ( 1.0E-6 * step ) ) ; <END_BUG> } integ . integrate ( pb , pb . getInitialTime ( ) , pb . getInitialState ( ) , pb . getFinalTime ( ) , new double [ pb . getDimension ( ) ] ) ; double error = handler . getMaximalValueError ( ) ; if ( i > 4 ) { assertTrue ( ( error < ( Math . abs ( previousError ) ) ) ) ; } previousError = error ; assertEquals ( 0 , handler . getMaximalTimeError ( ) , 1.0E-12 ) ; } } } public void testSmallStep ( ) throws DerivativeException , IntegratorException { } public void testBigStep ( ) throws DerivativeException , IntegratorException { } public static Test suite ( ) { } }

Fix:
integ . addSwitchingFunction ( functions [ l ] , Double . POSITIVE_INFINITY , ( 1.0E-6 * step ) , 1000 ) ;
Buggy code:
public abstract class WebApplication extends Application implements ISessionFactory { private static final Log log = LogFactory . getLog ( WebApplication . class ) ; private String applicationKey ; private final Map bufferedResponses = new HashMap ( ) ; private String sessionAttributePrefix ; private ISessionFactory sessionFactory = this ; private WicketFilter wicketFilter ; private IRequestCycleProcessor requestCycleProcessor ; public WebApplication ( ) { } public final String getApplicationKey ( ) { } public final String getInitParameter ( String key ) { } public final IRequestCycleProcessor getRequestCycleProcessor ( ) { } public final ServletContext getServletContext ( ) { } public final String getSessionAttributePrefix ( final WebRequest request ) { } public final WicketFilter getWicketFilter ( ) { } public void logEventTarget ( IRequestTarget target ) { } public void logResponseTarget ( IRequestTarget target ) { } public final void mount ( String path , IRequestTargetUrlCodingStrategy encoder ) { } public final void mount ( final String path , final PackageName packageName ) { } public final void mountBookmarkablePage ( final String path , final Class bookmarkablePageClass ) { } public final void mountBookmarkablePage ( final String path , final String pageMapName , final Class bookmarkablePageClass ) { } public final void mountSharedResource ( final String path , final String resourceKey ) { } public final Session newSession ( ) { } public final Session newSession ( Request request ) { } public Session newSession ( Request request , Response response ) { <START_BUG> return new WebSession ( this , request ) ; <END_BUG> } public void sessionDestroyed ( String sessionId ) { } public final void setSessionFactory ( final ISessionFactory sessionFactory ) { } public final void setWicketFilter ( final WicketFilter wicketFilter ) { } public final void unmount ( String path ) { } private void checkMountPath ( String path ) { } protected IRequestCycleFactory getDefaultRequestCycleFactory ( ) { } protected ISessionFactory getSessionFactory ( ) { } protected void init ( ) { } protected void internalDestroy ( ) { } protected void internalInit ( ) { } protected IRequestCycleProcessor newRequestCycleProcessor ( ) { } protected ISessionStore newSessionStore ( ) { } protected WebRequest newWebRequest ( final HttpServletRequest servletRequest ) { } protected WebResponse newWebResponse ( final HttpServletResponse servletResponse ) { } protected final void setApplicationKey ( String applicationKey ) { } final void addBufferedResponse ( String sessionId , String bufferId , BufferedHttpServletResponse renderedResponse ) { } final WebSession getSession ( final WebRequest request , final WebResponse response ) { } final void logStarted ( ) { } final BufferedHttpServletResponse popBufferedResponse ( String sessionId , String bufferId ) { } }

Fix:
return new WebSession ( this , request , response ) ;
Buggy code:
public class TestMultiPassIndexSplitter extends LuceneTestCase { IndexReader input ; int NUM_DOCS = 11 ; Directory dir ; @ Override public void setUp ( ) throws Exception { super . setUp ( ) ; dir = newDirectory ( ) ; IndexWriter w = new IndexWriter ( dir , newIndexWriterConfig ( TEST_VERSION_CURRENT , new org . apache . lucene . analysis . MockAnalyzer ( random ( ) ) ) . setMergePolicy ( COMPOUND_FILES ) ) ; Document doc ; for ( int i = 0 ; i < ( NUM_DOCS ) ; i ++ ) { doc = new Document ( ) ; doc . add ( newStringField ( "id" , ( i + "" ) , YES ) ) ; doc . add ( newTextField ( "f" , ( ( i + "<seq2seq4repair_space>" ) + i ) , YES ) ) ; w . addDocument ( doc ) ; if ( ( i % 3 ) == 0 ) w . commit ( ) ; } w . commit ( ) ; w . deleteDocuments ( new Term ( "id" , ( "" + ( ( NUM_DOCS ) - 1 ) ) ) ) ; <START_BUG> w . close ( ) ; <END_BUG> input = DirectoryReader . open ( dir ) ; } @ Override public void tearDown ( ) throws Exception { } public void testSplitRR ( ) throws Exception { } public void testSplitSeq ( ) throws Exception { } }

Fix:
w . shutdown ( ) ;
Buggy code:
public class OrderListActivity extends Activity implements OnClickListener , ListItemClickHelp { private Context mContext ; private ListView mOrderLv ; private OrderWineAdapter mOrderAdapter ; private ArrayList < Order > orderList = new ArrayList < Order > ( ) ; private HashMap < String , Object > mMsgMap = new HashMap < String , Object > ( ) ; private ImageView mBackIv ; private String mPhone ; Handler mHandler = new Handler ( ) { @ Override public void handleMessage ( Message msg ) { } } ; @ Override protected void onCreate ( Bundle savedInstanceState ) { } @ Override protected void onResume ( ) { } private void initView ( ) { } private void initData ( ) { mPhone = UserInfoManager . getPhone ( mContext ) ; <START_BUG> OrderLogic . getOrders ( mContext , mHandler , mPhone , "0" , "50" ) ; <END_BUG> } @ Override public void onClick ( View v ) { } @ Override public void onClick ( View item , View widget , int position , int which ) { } }

Fix:
OrderLogic . getOrders ( mContext , mHandler , mPhone , "0" , "20" ) ;
Buggy code:
public class DefaultI18N implements I18N , Serializable { private Map < String , String > values ; private I18N parent ; private Function < String , String > callback ; public DefaultI18N ( InputStream stream ) throws IOException { } public DefaultI18N ( InputStream stream , I18N parent ) throws IOException { } public DefaultI18N ( InputStream stream , I18N parent , Function < String , String > callback ) throws IOException { } public DefaultI18N ( Reader reader ) throws IOException { } public DefaultI18N ( Reader reader , I18N parent ) throws IOException { } public DefaultI18N ( Reader reader , I18N parent , Function < String , String > callback ) throws IOException { } @ Override public String get ( String key ) { } @ Override public String get ( String key , String ... args ) { } @ Override public Set < String > keys ( ) { } @ Override public Set < String > allKeys ( ) { } @ Override public int size ( ) { } @ Override public int total ( ) { <START_BUG> return ( size ( ) ) + ( ( parent ) == null ? 0 : parent . total ( ) ) ; <END_BUG> } @ Override public boolean has ( String key ) { } @ Override public I18N getParent ( ) { } private Map < String , String > toMap ( Reader reader ) throws IOException { } }

Fix:
return allKeys ( ) . size ( ) ;
Buggy code:
public class EditPropertiesAction extends DefaultTableAction { public EditPropertiesAction ( FrameMediator frameController ) { } public void actionPerformed ( ActionEvent evt ) { AddressbookFrameMediator mediator = ( ( AddressbookFrameMediator ) ( frameMediator ) ) ; Object [ ] uids = mediator . getTable ( ) . getUids ( ) ; AddressbookFolder folder = ( ( AddressbookFolder ) ( mediator . getTree ( ) . getSelectedFolder ( ) ) ) ; if ( ( uids . length ) == 0 ) { return ; } <START_BUG> HeaderItem item = mediator . getTable ( ) . getView ( ) . getSelectedItem ( ) ; <END_BUG> if ( item . isContact ( ) ) { ContactCard card = ( ( ContactCard ) ( folder . get ( uids [ 0 ] ) ) ) ; ContactDialog dialog = new ContactDialog ( mediator . getView ( ) ) ; dialog . updateComponents ( card , true ) ; dialog . setVisible ( true ) ; if ( dialog . getResult ( ) ) { dialog . updateComponents ( card , false ) ; folder . modify ( card , uids [ 0 ] ) ; mediator . getTable ( ) . getAddressbookModel ( ) . update ( ) ; } } else { GroupListCard card = ( ( GroupListCard ) ( folder . get ( uids [ 0 ] ) ) ) ; EditGroupDialog dialog = new EditGroupDialog ( mediator . getView ( ) , null ) ; Object [ ] groupUids = card . getUids ( ) ; HeaderItemList members = folder . getHeaderItemList ( groupUids ) ; dialog . updateComponents ( card , members , true ) ; dialog . setVisible ( true ) ; if ( dialog . getResult ( ) ) { dialog . updateComponents ( card , null , false ) ; folder . modify ( card , uids [ 0 ] ) ; mediator . getTable ( ) . getAddressbookModel ( ) . update ( ) ; } } } }

Fix:
HeaderItem item = mediator . getTable ( ) . getSelectedItem ( ) ;
Buggy code:
System . out . println ( charset . length ) ; <START_BUG> for ( int i = 0 ; i < ( ( charset . length ) - 1 ) ; i ++ ) { <END_BUG>

Fix:
for ( int i = 0 ; i < ( charset . length ) ; i ++ ) {
Buggy code:
public class DateUtils { public static final TimeZone UTC = TimeZone . getTimeZone ( "UTC" ) ; public static final TimeZone MIDDAY = TimeZone . getTimeZone ( "GMT-12:00" ) ; public static String formatDate ( Date date ) { } public static String formatDate ( Calendar date ) { } public static String formatDateUnknownTimezone ( Date date ) { Calendar calendar = GregorianCalendar . getInstance ( Locale . US ) ; calendar . setTime ( date ) ; <START_BUG> String formatted = DateUtils . formatDate ( date ) ; <END_BUG> return formatted . substring ( 0 , ( ( formatted . length ( ) ) - 1 ) ) ; } private static String doFormatDate ( Calendar calendar ) { } }

Fix:
String formatted = DateUtils . formatDate ( calendar ) ;
Buggy code:
public class ForwardModel extends Game { private Random randomObs ; private boolean [ ] npcList ; private boolean [ ] immList ; private boolean [ ] movList ; private boolean [ ] resList ; private boolean [ ] portalList ; private boolean [ ] fromAvatar ; private boolean [ ] knownList ; private HashMap < Integer , Observation > observations ; private ArrayList < Observation > [ ] [ ] observationGrid ; public ForwardModel ( Game a_gameState ) { } public final void update ( Game a_gameState ) { } private void updateObservation ( VGDLSprite sprite ) { } public final void removeSpriteObservation ( VGDLSprite sprite ) { } private void updateGrid ( Observation obs , boolean newObs , boolean moved , Vector2d oldPosition ) { } private void removeObservationFromGrid ( Observation obs , Vector2d position ) { } private void addObservationToGrid ( Observation obs , Vector2d position ) { } public void printObservationGrid ( ) { } private Observation createSpriteObservation ( VGDLSprite sprite ) { } private Observation getSpriteObservation ( VGDLSprite sprite ) { } private void checkSpriteFeatures ( VGDLSprite sp , int itype ) { } private int getSpriteCategory ( VGDLSprite sp ) { } private void init ( ) { } private void initNonVolatile ( Game a_gameState ) { } public final Random getRandomGenerator ( ) { } public void setNewSeed ( int seed ) { } protected void tick ( Types . ACTIONS action ) { } public final void advance ( Types . ACTIONS action ) { if ( ! ( isEnded ) ) { tick ( action ) ; eventHandling ( ) ; <START_BUG> clearAll ( ) ; <END_BUG> terminationHandling ( ) ; checkTimeOut ( ) ; updateAllObservations ( ) ; ( gameTick ) ++ ; } } private final void updateAllObservations ( ) { } public final ForwardModel copy ( ) { } public double getGameScore ( ) { } public int getGameTick ( ) { } public WINNER getGameWinner ( ) { } public boolean isGameOver ( ) { } public Dimension getWorldDimension ( ) { } public int getBlockSize ( ) { } public Vector2d getAvatarPosition ( ) { } public double getAvatarSpeed ( ) { } public Vector2d getAvatarOrientation ( ) { } public ArrayList < Types . ACTIONS > getAvatarActions ( boolean includeNIL ) { } public HashMap < Integer , Integer > getAvatarResources ( ) { } public ACTIONS getAvatarLastAction ( ) { } private ArrayList < Observation > [ ] getPositionsFrom ( boolean [ ] groupArray , Vector2d refPosition ) { } public ArrayList < Observation > [ ] [ ] getObservationGrid ( ) { } public TreeSet < Event > getEventsHistory ( ) { } public ArrayList < Observation > [ ] getNPCPositions ( Vector2d refPosition ) { } public ArrayList < Observation > [ ] getImmovablePositions ( Vector2d refPosition ) { } public ArrayList < Observation > [ ] getMovablePositions ( Vector2d refPosition ) { } public ArrayList < Observation > [ ] getResourcesPositions ( Vector2d refPosition ) { } public ArrayList < Observation > [ ] getPortalsPositions ( Vector2d refPosition ) { } public ArrayList < Observation > [ ] getFromAvatarSpPositions ( Vector2d refPosition ) { } public boolean equalObservations ( ForwardModel other ) { } @ Override public void buildLevel ( String gamelvl ) { } }

Fix:
clearAll ( this ) ;
Buggy code:
class Roster { Roster ( ) { } void addOperation ( Roster . Operation op ) { } public Roster . Operation getOperation ( int i ) { } int getOperationCount ( ) { } boolean isEmpty ( ) { } boolean performOperations ( PluginManagerProgress progress ) { } private Vector operations ; static interface Operation { boolean perform ( PluginManagerProgress progress ) ; boolean equals ( Object o ) { } int getMaximum ( ) { } } static class Remove implements Roster . Operation { Remove ( String plugin ) { } public int getMaximum ( ) { } public boolean perform ( PluginManagerProgress progress ) { progress . removing ( MiscUtilities . getFileName ( plugin ) ) ; PluginJAR jar = jEdit . getPluginJAR ( plugin ) ; if ( jar != null ) <START_BUG> jar . closeZipFile ( ) ; <END_BUG> String cachePath = jar . getCachePath ( ) ; if ( cachePath != null ) new File ( cachePath ) . delete ( ) ; File jarFile = new File ( plugin ) ; File srcFile = new File ( plugin . substring ( 0 , ( ( plugin . length ( ) ) - 4 ) ) ) ; boolean ok = true ; Log . log ( NOTICE , this , ( ( "Deleting<seq2seq4repair_space>" + jarFile ) + "<seq2seq4repair_space>recursively" ) ) ; ok &= jarFile . delete ( ) ; if ( srcFile . exists ( ) ) ok &= deleteRecursively ( srcFile ) ; String [ ] args = new String [ ] { plugin } ; if ( ! ok ) GUIUtilities . error ( progress , "plugin-manager.remove-failed" , args ) ; return ok ; } public boolean equals ( Object o ) { } private String plugin ; private boolean deleteRecursively ( File file ) { } } static class Install implements Roster . Operation { int size ; Install ( String url , String installDirectory , int size ) { } public int getMaximum ( ) { } public boolean perform ( final PluginManagerProgress progress ) { try { String fileName = MiscUtilities . getFileName ( url ) ; progress . downloading ( fileName ) ; String path = download ( progress , fileName , url ) ; if ( path == null ) { return false ; } progress . installing ( fileName ) ; install ( progress , path , installDirectory ) ; return true ; } catch ( InterruptedIOException iio ) { return false ; } catch ( final IOException io ) { Log . log ( ERROR , this , io ) ; SwingUtilities . invokeLater ( new Runnable ( ) { public void run ( ) { String [ ] args = new String [ ] { io . getMessage ( ) } ; GUIUtilities . error ( null , "ioerror" , args ) ; } } ) ; return false ; } catch ( Exception e ) { Log . log ( ERROR , this , e ) ; return false ; } } public boolean equals ( Object o ) { } private String url ; private String installDirectory ; private String download ( PluginManagerProgress progress , String fileName , String url ) throws Exception { } private boolean install ( PluginManagerProgress progress , String path , String dir ) throws Exception { } private boolean copy ( PluginManagerProgress progress , InputStream in , OutputStream out , boolean canStop , boolean doProgress ) throws Exception { } static File downloadDir ; static String getDownloadDir ( ) { } } }

Fix:
jEdit . removePluginJAR ( jar , false ) ;
Buggy code:
public class Word implements IClusterable { final List < Letter > letters = new ArrayList < Letter > ( ) ; public Word ( final String word ) { } public String asString ( ) { } public String asString ( final boolean hideUnguessed ) { <START_BUG> final StringBuffer buffer = new StringBuffer ( ) ; <END_BUG> for ( Letter letter : letters ) { if ( hideUnguessed ) { buffer . append ( ( letter . isGuessed ( ) ? letter . asString ( ) : "_" ) ) ; } else { buffer . append ( letter . asString ( ) ) ; } } return buffer . toString ( ) ; } @ Override public boolean equals ( final Object object ) { } public boolean guess ( final Letter letter ) { } @ Override public int hashCode ( ) { } public boolean isGuessed ( ) { } @ Override public String toString ( ) { } }

Fix:
final StringBuilder buffer = new StringBuilder ( ) ;
Buggy code:
public class DefaultMessageContextTests { private DefaultMessageContext context ; @ Before public void setUp ( ) { } @ After public void tearDown ( ) { } @ Test public void addMessage ( ) { MessageBuilder builder = new MessageBuilder ( ) ; MessageResolver message = builder . severity ( ERROR ) . code ( "invalidFormat" ) . resolvableArg ( "mathForm.decimalField" ) . arg ( "#,###.##" ) . defaultText ( "Field<seq2seq4repair_space>must<seq2seq4repair_space>be<seq2seq4repair_space>in<seq2seq4repair_space>format<seq2seq4repair_space>#,###.##" ) . build ( ) ; <START_BUG> context . addMessage ( "mathForm.decimalField" , message ) ; <END_BUG> Map < String , List < Message > > messages = context . getMessages ( ) ; assertEquals ( 1 , messages . size ( ) ) ; assertEquals ( "Decimal<seq2seq4repair_space>Field<seq2seq4repair_space>must<seq2seq4repair_space>be<seq2seq4repair_space>in<seq2seq4repair_space>format<seq2seq4repair_space>#,###.##" , messages . get ( "mathForm.decimalField" ) . get ( 0 ) . getText ( ) ) ; assertEquals ( "Decimal<seq2seq4repair_space>Field<seq2seq4repair_space>must<seq2seq4repair_space>be<seq2seq4repair_space>in<seq2seq4repair_space>format<seq2seq4repair_space>#,###.##" , context . getMessages ( "mathForm.decimalField" ) . get ( 0 ) . getText ( ) ) ; } }

Fix:
context . add ( message , "mathForm.decimalField" ) ;
Buggy code:
public class DebugPostProcessor extends AbstractTestElement implements PostProcessor , TestBean { private static final long serialVersionUID = 240L ; public void process ( ) { StringBuilder sb = new StringBuilder ( 100 ) ; JMeterContext threadContext = getThreadContext ( ) ; PropertyIterator i = threadContext . getCurrentSampler ( ) . propertyIterator ( ) ; while ( i . hasNext ( ) ) { JMeterProperty prop = i . next ( ) ; sb . append ( prop . getName ( ) ) ; sb . append ( "=" ) ; sb . append ( prop . getStringValue ( ) ) ; sb . append ( "\n" ) ; } SampleResult sr = new SampleResult ( ) ; <START_BUG> sr . setResponseData ( sb . toString ( ) . getBytes ( ) ) ; <END_BUG> sr . setDataType ( TEXT ) ; sr . setSampleLabel ( getName ( ) ) ; sr . setSuccessful ( true ) ; sr . setSamplerData ( "SamplerPropertyValues" ) ; threadContext . getPreviousResult ( ) . addSubResult ( sr ) ; } }

Fix:
sr . setResponseData ( sb . toString ( ) , null ) ;
Buggy code:
public class SVSStack extends ImageStack { int nSlices ; ChannelSeparator r ; int tilesHol ; int tilesVert ; int originX ; int originY ; int width ; int height ; int series ; String name ; ColorProcessor cp ; String directory ; public SVSStack ( String directory , String name , int series , int originX , int originY , int roiWidth , int roiHeight , int width , int height ) { } public void addSlice ( String sliceLabel , Object pixels ) { } public void addSlice ( String sliceLabel , ImageProcessor ip ) { } public void addSlice ( String sliceLabel , ImageProcessor ip , int n ) { } public Object getPixels ( int n ) { } public void deleteSlice ( int n ) { } public void deleteLastSlice ( ) { } public void setPixels ( Object pixels , int n ) { } public ImageProcessor getProcessor ( int n ) { int i = ( n - 1 ) % ( tilesHol ) ; <START_BUG> int j = ( ( int ) ( ( n - 1 ) // ( tilesVert ) ) ) ; <END_BUG> int subimageX = ( originX ) + ( ( width ) * i ) ; int subimageY = ( originY ) + ( ( height ) * j ) ; try { byte [ ] R = r . openBytes ( 0 , subimageX , subimageY , width , height ) ; byte [ ] G = r . openBytes ( 1 , subimageX , subimageY , width , height ) ; byte [ ] B = r . openBytes ( 2 , subimageX , subimageY , width , height ) ; cp = new ColorProcessor ( width , height ) ; cp . setRGB ( R , G , B ) ; } catch ( FormatException e ) { e . printStackTrace ( ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } if ( ( cp ) == null ) return null ; return cp ; } public int getSize ( ) { } public String getSliceLabel ( int n ) { } public Object [ ] getImageArray ( ) { } public void setSliceLabel ( String label , int n ) { } public boolean isVirtual ( ) { } public void trim ( ) { } No newline ; at end ; of file ; }

Fix:
int j = ( ( int ) ( ( n - 1 ) // ( tilesHol ) ) ) ;
Buggy code:
public class CharsetManager implements ActionListener { private static final String [ ] charsets = new String [ ] { "auto" , "UTF-8" , "UTF-16" , "ASCII" , "Cp1252" , "ISO-8859-1" , "ISO-8859-15" , "Cp850" , "MacRoman" , "ISO-8859-7" , "MacGreek" , "Cp1253" , "MacIceland" , "ISO-8859-3" , "ISO-8859-4" , "ISO-8859-13" , "Cp1257" , "Cp852" , "ISO-8859-2" , "MacCentralEurope" , "MacCroatian" , "Cp855" , "ISO-8859-5" , "KOI8_R" , "MacCyrillic" , "Cp1251" , "Cp866" , "MacUkraine" , "MacRomania" , "EUC_CN" , "GBK" , "GB18030" , "Big5" , "Big5_HKSCS" , "EUC_TW" , "EUC_JP" , "SJIS" , "EUC_KR" , "JOHAB" , "ISO2022KR" , "TIS620" , "Cp857" , "ISO-8859-9" , "MacTurkish" , "Cp1254" , "Cp1258" } ; private static final String [ ] groups = new String [ ] { "global" , "westeurope" , "easteurope" , "eastasian" , "seswasian" } ; private static final int [ ] groupOffset = new int [ ] { 1 , 4 , 14 , 29 , 40 , 46 } ; private Vector listeners ; private CharsetMenuItem selectedMenuItem ; private int selectedId ; public CharsetManager ( ) { } public JMenu createMenu ( MouseListener handler ) { } public void addCharsetListener ( CharsetListener listener ) { } public void actionPerformed ( ActionEvent e ) { CharsetEvent event ; int charsetId = ( ( CharsetMenuItem ) ( e . getSource ( ) ) ) . getId ( ) ; <START_BUG> event = new CharsetEvent ( charsetId , CharsetManager . charsets [ charsetId ] ) ; <END_BUG> selectedMenuItem . setText ( MailResourceLoader . getString ( "menu" , "mainframe" , ( "menu_view_charset_" + ( CharsetManager . charsets [ event . getId ( ) ] ) ) ) ) ; for ( int i = 0 ; i < ( listeners . size ( ) ) ; i ++ ) ( ( CharsetListener ) ( listeners . get ( i ) ) ) . charsetChanged ( event ) ; } }

Fix:
event = new CharsetEvent ( this , charsetId , CharsetManager . charsets [ charsetId ] ) ;
Buggy code:
public class BasicComponentCreateService implements Service < Component > { private final InjectedValue < DeploymentUnit > deploymentUnit = new InjectedValue < DeploymentUnit > ( ) ; private final ServiceName serviceName ; private final String componentName ; private final Class < ? > componentClass ; private final InterceptorFactory postConstruct ; private final InterceptorFactory preDestroy ; private final Map < Method , InterceptorFactory > componentInterceptors ; private final NamespaceContextSelector namespaceContextSelector ; private BasicComponent component ; public BasicComponentCreateService ( final ComponentConfiguration componentConfiguration ) { } protected boolean requiresInterceptors ( final Method method , final ComponentConfiguration componentConfiguration ) { <START_BUG> return ( Modifier . isPublic ( method . getModifiers ( ) ) ) && ( componentConfiguration . getComponentDescription ( ) . isIntercepted ( ) ) ; <END_BUG> } public synchronized void start ( final StartContext context ) throws StartException { } protected BasicComponent createComponent ( ) { } public synchronized void stop ( final StopContext context ) { } public synchronized Component getValue ( ) throws IllegalArgumentException , IllegalStateException { } public InjectedValue < DeploymentUnit > getDeploymentUnitInjector ( ) { } public String getComponentName ( ) { } public InterceptorFactory getPostConstruct ( ) { } public InterceptorFactory getPreDestroy ( ) { } public Map < Method , InterceptorFactory > getComponentInterceptors ( ) { } public Class < ? > getComponentClass ( ) { } public NamespaceContextSelector getNamespaceContextSelector ( ) { } public ServiceName getServiceName ( ) { } }

Fix:
return ( ( Modifier . isPublic ( method . getModifiers ( ) ) ) && ( ! ( Modifier . isFinal ( method . getModifiers ( ) ) ) ) ) && ( componentConfiguration . getComponentDescription ( ) . isIntercepted ( ) ) ;
Buggy code:
public class CreativeTabsSupernaturalCraft extends CreativeTabs { public CreativeTabsSupernaturalCraft ( String tabLabel ) { } @ Override @ SideOnly ( Side . CLIENT ) public Item getTabIconItem ( ) { <START_BUG> return SupernaturalCraft . AntiPossessionTattoo ; <END_BUG> } No newline ; at end ; of file ; }

Fix:
return SupernaturalCraft . Colt ;
Buggy code:
public class GoElementToReqElement implements TreeModelPrereqs { public String toString ( ) { <START_BUG> return Localizer . localize ( "Tree" , "Element->Required<seq2seq4repair_space>Element" ) ; <END_BUG> } public Object getRoot ( ) { } public void setRoot ( Object r ) { } public Object getChild ( Object parent , int index ) { } public int getChildCount ( Object parent ) { } public int getIndexOfChild ( Object parent , Object child ) { } public boolean isLeaf ( Object node ) { } public void valueForPathChanged ( TreePath path , Object newValue ) { } public void addTreeModelListener ( TreeModelListener l ) { } public void removeTreeModelListener ( TreeModelListener l ) { } public Vector getPrereqs ( ) { } public Vector getProvidedTypes ( ) { } }

Fix:
return Localizer . localize ( "Tree" , "misc.element.required-element" ) ;
Buggy code:
public class ScheduledTasksBeanDefinitionParser extends AbstractSingleBeanDefinitionParser { @ Override protected boolean shouldGenerateId ( ) { } @ Override protected String getBeanClassName ( Element element ) { } @ Override protected void doParse ( Element element , ParserContext parserContext , BeanDefinitionBuilder builder ) { ManagedMap < RuntimeBeanReference , String > cronTaskMap = new ManagedMap < RuntimeBeanReference , String > ( ) ; ManagedMap < RuntimeBeanReference , String > fixedDelayTaskMap = new ManagedMap < RuntimeBeanReference , String > ( ) ; ManagedMap < RuntimeBeanReference , String > fixedRateTaskMap = new ManagedMap < RuntimeBeanReference , String > ( ) ; NodeList childNodes = element . getChildNodes ( ) ; for ( int i = 0 ; i < ( childNodes . getLength ( ) ) ; i ++ ) { Node child = childNodes . item ( i ) ; <START_BUG> if ( ( ! ( child instanceof Element ) ) || ( ! ( child . getLocalName ( ) . equals ( "task" ) ) ) ) { <END_BUG> continue ; } Element taskElement = ( ( Element ) ( child ) ) ; String ref = taskElement . getAttribute ( "ref" ) ; String method = taskElement . getAttribute ( "method" ) ; if ( ( ! ( StringUtils . hasText ( ref ) ) ) || ( ! ( StringUtils . hasText ( method ) ) ) ) { parserContext . getReaderContext ( ) . error ( "Both<seq2seq4repair_space>'ref'<seq2seq4repair_space>and<seq2seq4repair_space>'method'<seq2seq4repair_space>are<seq2seq4repair_space>required" , taskElement ) ; continue ; } RuntimeBeanReference runnableBeanRef = new RuntimeBeanReference ( this . createRunnableBean ( ref , method , taskElement , parserContext ) ) ; String cronAttribute = taskElement . getAttribute ( "cron" ) ; if ( StringUtils . hasText ( cronAttribute ) ) { cronTaskMap . put ( runnableBeanRef , cronAttribute ) ; } else { String fixedDelayAttribute = taskElement . getAttribute ( "fixed-delay" ) ; if ( StringUtils . hasText ( fixedDelayAttribute ) ) { fixedDelayTaskMap . put ( runnableBeanRef , fixedDelayAttribute ) ; } else { String fixedRateAttribute = taskElement . getAttribute ( "fixed-rate" ) ; if ( ! ( StringUtils . hasText ( fixedRateAttribute ) ) ) { parserContext . getReaderContext ( ) . error ( "One<seq2seq4repair_space>of<seq2seq4repair_space>'cron',<seq2seq4repair_space>'fixed-delay',<seq2seq4repair_space>or<seq2seq4repair_space>'fixed-rate'<seq2seq4repair_space>is<seq2seq4repair_space>required" , taskElement ) ; continue ; } fixedRateTaskMap . put ( runnableBeanRef , fixedRateAttribute ) ; } } } String schedulerRef = element . getAttribute ( "scheduler" ) ; if ( StringUtils . hasText ( schedulerRef ) ) { builder . addPropertyReference ( "taskScheduler" , schedulerRef ) ; } builder . addPropertyValue ( "cronTasks" , cronTaskMap ) ; builder . addPropertyValue ( "fixedDelayTasks" , fixedDelayTaskMap ) ; builder . addPropertyValue ( "fixedRateTasks" , fixedRateTaskMap ) ; } private String createRunnableBean ( String ref , String method , Element taskElement , ParserContext parserContext ) { } }

Fix:
if ( ( ! ( child instanceof Element ) ) || ( ! ( child . getLocalName ( ) . equals ( "scheduled" ) ) ) ) {
Buggy code:
@ SuppressWarnings ( "restriction" ) public class XtendXpandBuilder extends IncrementalProjectBuilder { class XtendXpandDeltaVisitor implements IResourceDeltaVisitor , IResourceVisitor { private final IProgressMonitor monitor ; private final Set < String > extensions ; public XtendXpandDeltaVisitor ( final IProgressMonitor monitor ) { } public boolean visit ( final IResourceDelta delta ) throws CoreException { } private boolean isXtendXpandResource ( final IResource resource ) { } public boolean visit ( final IResource resource ) { } } private int incrementalAnalyzerStrategy ; private void updateIncrementalAnalyzerStrategy ( ) { } private boolean analyzeDependentProjectsWhenIncremental ( ) { } private boolean analyseReverseReferencedResources ( ) { } private boolean analyzeWholeProjectWhenIncremental ( ) { } boolean isOnJavaClassPath ( final IResource resource ) { } public static final String getBUILDER_ID ( ) { } private Set < IXtendXpandResource > toAnalyze = null ; @ SuppressWarnings ( "unchecked" ) @ Override protected IProject [ ] build ( final int kind , final Map args , final IProgressMonitor monitor ) throws CoreException { } private void fillToAnalyseWithReverseReferencedResources ( ) { Set < IXtendXpandResource > reverseReferences = new HashSet < IXtendXpandResource > ( ) ; for ( final Object name : toAnalyze ) { final IXtendXpandResource res = ( ( IXtendXpandResource ) ( name ) ) ; final IResource resource = ( ( IResource ) ( res . getUnderlyingStorage ( ) ) ) ; final IProject project = resource . getProject ( ) ; if ( ! ( project . isLinked ( ) ) ) { final IXtendXpandProject xtdxptProject = Activator . getExtXptModelManager ( ) . findProject ( project ) ; IXtendXpandResource [ ] resources = xtdxptProject . getAllRegisteredResources ( ) ; for ( IXtendXpandResource iXtendXpandResource : resources ) { if ( iXtendXpandResource != null ) { for ( String string : iXtendXpandResource . getImportedExtensions ( ) ) { IXtendXpandResource importedResource = xtdxptProject . findExtXptResource ( string , FILE_EXTENSION ) ; <START_BUG> if ( ( importedResource != null ) && ( importedResource . equals ( res ) ) ) { <END_BUG> reverseReferences . add ( iXtendXpandResource ) ; break ; } } } } } } toAnalyze . addAll ( reverseReferences ) ; } private void addProject ( final Map < IXtendXpandProject , ExecutionContext > projects , final IXtendXpandProject xtdxptProject ) { } private Collection < IXtendXpandProject > getDependentProjects ( IXtendXpandProject xtdxptProject ) { } void reloadResource ( final IFile resource ) { } public void handleRemovement ( final IFile resource ) { } protected void fullBuild ( final IProgressMonitor monitor ) throws CoreException { } protected void incrementalBuild ( final IResourceDelta delta , final IProgressMonitor monitor ) throws CoreException { } }

Fix:
if ( importedResource . equals ( res ) ) {
Buggy code:
@ SuppressCodecs ( "Lucene3x" ) public class TestDocValuesIndexing extends LuceneTestCase { public void testDocValuesSimple ( ) throws IOException { } public void testIndexBytesNoDeletes ( ) throws IOException { } public void testIndexBytesDeletes ( ) throws IOException { } public void testIndexNumericsNoDeletes ( ) throws IOException { } public void testIndexNumericsDeletes ( ) throws IOException { } public void testAddIndexes ( ) throws IOException { } public void testAddIndexesRandom ( ) throws IOException { } private IndexWriterConfig writerConfig ( boolean useCompoundFile ) { } @ SuppressWarnings ( "fallthrough" ) public void runTestNumerics ( IndexWriterConfig cfg , boolean withDeletions ) throws IOException { } public void runTestIndexBytes ( IndexWriterConfig cfg , boolean withDeletions ) throws IOException { } public void testGetArrayNumerics ( ) throws IOException { } public void testGetArrayBytes ( ) throws IOException { } private DocValues getDocValues ( IndexReader reader , String field ) throws IOException { } @ SuppressWarnings ( "fallthrough" ) private Source getSource ( DocValues values ) throws IOException { } private static EnumSet < Type > BYTES = EnumSet . of ( BYTES_FIXED_DEREF , BYTES_FIXED_STRAIGHT , BYTES_VAR_DEREF , BYTES_VAR_STRAIGHT , BYTES_FIXED_SORTED , BYTES_VAR_SORTED ) ; private static EnumSet < Type > NUMERICS = EnumSet . of ( VAR_INTS , FIXED_INTS_16 , FIXED_INTS_32 , FIXED_INTS_64 , FIXED_INTS_8 , FLOAT_32 , FLOAT_64 ) ; private FixedBitSet indexValues ( IndexWriter w , int numValues , Type valueType , List < Type > valueVarList , boolean withDeletions , int bytesSize ) throws IOException { } public void testMultiValuedDocValuesField ( ) throws Exception { } public void testDifferentTypedDocValuesField ( ) throws Exception { } public void testSortedBytes ( ) throws IOException { } public int docId ( AtomicReader reader , Term term ) throws IOException { int docFreq = reader . docFreq ( term ) ; assertEquals ( 1 , docFreq ) ; <START_BUG> DocsEnum termDocsEnum = reader . termDocsEnum ( null , term . field , term . bytes , 0 ) ; <END_BUG> int nextDoc = termDocsEnum . nextDoc ( ) ; assertEquals ( NO_MORE_DOCS , termDocsEnum . nextDoc ( ) ) ; return nextDoc ; } public void testWithThreads ( ) throws Exception { } public void testLengthPrefixAcrossTwoPages ( ) throws Exception { } }

Fix:
DocsEnum termDocsEnum = reader . termDocsEnum ( null , term . field , term . bytes , false ) ;
Buggy code:
public class TestPersistenceManagerFactoryImpl extends BaseKernelTest { private OpenJPAConfiguration _conf = null ; public TestPersistenceManagerFactoryImpl ( ) { } public TestPersistenceManagerFactoryImpl ( String test ) { } public void setUp ( ) { } public void testFactoryLifecycleListeners ( ) { } public void testPlatform ( ) { } protected OpenJPAEntityManagerFactory getEmf ( Map props ) { props . put ( "openjpa.BrokerFactory" , TestPersistenceManagerFactoryImpl . BrokerFactoryTest . class . getName ( ) ) ; <START_BUG> return ( ( OpenJPAEntityManagerFactory ) ( getEmf ( props ) ) ) ; <END_BUG> } public static class BrokerFactoryTest extends AbstractBrokerFactory { public static synchronized TestPersistenceManagerFactoryImpl . BrokerFactoryTest getInstance ( ConfigurationProvider cp ) { } public static TestPersistenceManagerFactoryImpl . BrokerFactoryTest newInstance ( ConfigurationProvider cp ) { } protected BrokerFactoryTest ( OpenJPAConfiguration conf ) { } protected StoreManager newStoreManager ( ) { } } }

Fix:
return ( ( OpenJPAEntityManagerFactory ) ( super . getEmf ( props ) ) ) ;