nus-yam/ex-repair huggingface dataset:
Buggy code:
public abstract class UpdatePropertiesHandler { private ConsoleWrapper theConsole ; public UpdatePropertiesHandler ( ConsoleWrapper theConsole ) { } abstract void persist ( String [ ] entry , File file ) throws IOException { } abstract String consoleUserMessage ( String fileName ) { } abstract String consoleRolesMessage ( String fileName ) { } abstract String errorMessage ( String fileName , Throwable e ) { } State update ( StateValues stateValues ) { String [ ] entry = new String [ 2 ] ; try { String hash = new UsernamePasswordHashUtil ( ) . generateHashedHexURP ( stateValues . getUserName ( ) , stateValues . getRealm ( ) , stateValues . getPassword ( ) ) ; entry [ 0 ] = stateValues . getUserName ( ) ; entry [ 1 ] = hash ; } catch ( NoSuchAlgorithmException e ) { return new ErrorState ( theConsole , e . getMessage ( ) , null , stateValues ) ; } <START_BUG> for ( File current : stateValues . getPropertiesFiles ( ) ) { <END_BUG> try { persist ( entry , current ) ; if ( ( stateValues . isSilent ( ) ) == false ) { theConsole . printf ( consoleUserMessage ( current . getCanonicalPath ( ) ) ) ; theConsole . printf ( AddPropertiesUser . NEW_LINE ) ; } } catch ( Exception e ) { return new ErrorState ( theConsole , errorMessage ( current . getAbsolutePath ( ) , e ) , null , stateValues ) ; } } if ( ( ! ( stateValues . isManagement ( ) ) ) && ( ( stateValues . getRoles ( ) ) != null ) ) { for ( final File current : stateValues . getRoleFiles ( ) ) { String [ ] role = new String [ ] { stateValues . getUserName ( ) , stateValues . getRoles ( ) } ; try { persist ( role , current ) ; if ( ( stateValues . isSilent ( ) ) == false ) { theConsole . printf ( consoleRolesMessage ( current . getCanonicalPath ( ) ) ) ; theConsole . printf ( AddPropertiesUser . NEW_LINE ) ; } } catch ( IOException e ) { return new ErrorState ( theConsole , errorMessage ( current . getAbsolutePath ( ) , e ) , null , stateValues ) ; } } } return null ; } }

Fix:
for ( File current : stateValues . getUserFiles ( ) ) {
Buggy code:
public class InternalNamingConventions { private static final char [ ] DEFAULT_NAME = "name" . toCharArray ( ) ; private static Scanner getNameScanner ( CompilerOptions compilerOptions ) { <START_BUG> return new Scanner ( false , false , false , ( ( compilerOptions . sourceLevel ) >= ( JDK1_4 ) ) , null , null ) ; <END_BUG> } public static void suggestArgumentNames ( IJavaProject javaProject , char [ ] packageName , char [ ] qualifiedTypeName , int dim , char [ ] [ ] excludedNames , INamingRequestor requestor ) { } public static void suggestFieldNames ( IJavaProject javaProject , char [ ] packageName , char [ ] qualifiedTypeName , int dim , int modifiers , char [ ] [ ] excludedNames , INamingRequestor requestor ) { } public static void suggestLocalVariableNames ( IJavaProject javaProject , char [ ] packageName , char [ ] qualifiedTypeName , int dim , char [ ] [ ] excludedNames , INamingRequestor requestor ) { } private static void suggestNames ( char [ ] packageName , char [ ] qualifiedTypeName , int dim , char [ ] [ ] prefixes , char [ ] [ ] suffixes , char [ ] [ ] excludedNames , Scanner nameScanner , INamingRequestor requestor ) { } private static void acceptName ( char [ ] name , char [ ] prefix , char [ ] suffix , boolean isFirstPrefix , boolean isFirstSuffix , INamingRequestor requestor ) { } private static char [ ] computeBaseTypeNames ( char firstName , char [ ] [ ] excludedNames ) { } private static char [ ] [ ] computeNames ( char [ ] sourceName ) { } private static char [ ] excludeNames ( char [ ] suffixName , char [ ] prefixName , char [ ] suffix , char [ ] [ ] excludedNames ) { } }

Fix:
return new Scanner ( false , false , false , compilerOptions . sourceLevel , null , null ) ;
Buggy code:
public class EventLoopProgressMonitor extends ProgressMonitorWrapper implements IProgressMonitorWithBlocking { private static int T_THRESH = 100 ; private static int T_MAX = 50 ; private long lastTime = System . currentTimeMillis ( ) ; public EventLoopProgressMonitor ( IProgressMonitor monitor ) { } public void beginTask ( String name , int totalWork ) { } public void clearBlocked ( ) { } public void done ( ) { } public void internalWorked ( double work ) { } public boolean isCanceled ( ) { } private void runEventLoop ( ) { long t = System . currentTimeMillis ( ) ; if ( ( t - ( lastTime ) ) < ( EventLoopProgressMonitor . T_THRESH ) ) { return ; } lastTime = t ; Display disp = Display . getDefault ( ) ; if ( disp == null ) { return ; } <START_BUG> ExceptionHandler handler = new ExceptionHandler ( ) ; <END_BUG> for ( ; ; ) { try { if ( ! ( disp . readAndDispatch ( ) ) ) break ; } catch ( Throwable e ) { handler . handleException ( e ) ; break ; } if ( ( ( System . currentTimeMillis ( ) ) - t ) > ( EventLoopProgressMonitor . T_MAX ) ) { break ; } } } public void setBlocked ( IStatus reason ) { } public void setCanceled ( boolean b ) { } public void setTaskName ( String name ) { } public void subTask ( String name ) { } public void worked ( int work ) { } }

Fix:
ExceptionHandler handler = ExceptionHandler . getInstance ( ) ;
Buggy code:
public class EncogReadHelper { private final BufferedReader reader ; private final List < String > lines = new ArrayList < String > ( ) ; private String currentSectionName = "" ; private String currentSubSectionName = "" ; private EncogFileSection section ; public EncogReadHelper ( final InputStream is ) { } public final void close ( ) { } public final EncogFileSection readNextSection ( ) { } private double [ ] readLargeArray ( String line ) throws IOException { String str = line . substring ( 9 ) ; int l = Integer . parseInt ( str ) ; double [ ] result = new double [ l ] ; int index = 0 ; while ( ( line = this . reader . readLine ( ) ) != null ) { line = line . trim ( ) ; if ( line . startsWith ( "////" ) ) { continue ; } else if ( line . startsWith ( "##end" ) ) { break ; } <START_BUG> double [ ] t = NumberList . fromList ( EG_FORMAT , str ) ; <END_BUG> EngineArray . arrayCopy ( t , 0 , result , index , t . length ) ; index += t . length ; } return result ; } }

Fix:
double [ ] t = NumberList . fromList ( EG_FORMAT , line ) ;
Buggy code:
public class TestTopKInEachNodeResultHandler extends LuceneTestCase { @ Test public void testSimple ( ) throws Exception { } private void prvt_add ( DefaultFacetIndexingParams iParams , RandomIndexWriter iw , TaxonomyWriter tw , String ... strings ) throws IOException , CorruptIndexException { ArrayList < CategoryPath > cps = new ArrayList < CategoryPath > ( ) ; CategoryPath cp = new CategoryPath ( strings ) ; cps . add ( cp ) ; Document d = new Document ( ) ; new org . apache . lucene . facet . index . CategoryDocumentBuilder ( tw , iParams ) . setCategoryPaths ( cps ) . build ( d ) ; <START_BUG> d . add ( new org . apache . lucene . document . Field ( "content" , "alpha" , TextField . TYPE_STORED ) ) ; <END_BUG> iw . addDocument ( d ) ; } }

Fix:
d . add ( new org . apache . lucene . document . TextField ( "content" , "alpha" , Store . YES ) ) ;
Buggy code:
public class BusGraphManager extends GraphManager { private ArrayList < BusStopDistance > prevBusStopDistances ; private String prevServiceNum ; public BusGraphManager ( ) { } public void buildBusGraph ( BusStopDistance busStopDistance , int [ ] [ ] distanceData ) { if ( this . prevServiceNum . equals ( busStopDistance . getBusServiceNum ( ) ) ) { for ( BusStopDistance prevStopDistance : this . prevBusStopDistances ) { double distance = ( busStopDistance . getDistance ( ) ) - ( prevStopDistance . getDistance ( ) ) ; if ( distance < 0 ) { System . out . println ( "Negative<seq2seq4repair_space>distance<seq2seq4repair_space>encountered<seq2seq4repair_space>:<seq2seq4repair_space>" ) ; System . out . println ( ( ( ( "" + ( busStopDistance . getBusServiceNum ( ) ) ) + "<seq2seq4repair_space>-<seq2seq4repair_space>" ) + ( busStopDistance . getBusStopId ( ) ) ) ) ; System . out . println ( distance ) ; System . exit ( 0 ) ; } int stopDelay = ( ( ( prevBusStopDistances . size ( ) ) - ( prevBusStopDistances . indexOf ( prevStopDistance ) ) ) - 1 ) * ( GraphManager . BUS_STOP_DELAY ) ; <START_BUG> int duration = ( ( ( GraphManager . GRID_TO_BUS_STOP ) + ( + stopDelay ) ) + ( ( int ) ( distance // ( GraphManager . BUS_SPEED_KMPS ) ) ) ) + ( GraphManager . GRID_TO_BUS_STOP ) ; <END_BUG> if ( ( ( distanceData [ prevStopDistance . getGridIndex ( ) ] [ busStopDistance . getGridIndex ( ) ] ) == ( GraphManager . NO_EDGE ) ) || ( ( distanceData [ prevStopDistance . getGridIndex ( ) ] [ busStopDistance . getGridIndex ( ) ] ) > duration ) ) { distanceData [ prevStopDistance . getGridIndex ( ) ] [ busStopDistance . getGridIndex ( ) ] = duration ; } } } else { this . prevBusStopDistances . clear ( ) ; } this . prevBusStopDistances . add ( busStopDistance ) ; this . prevServiceNum = busStopDistance . getBusServiceNum ( ) ; } }

Fix:
int duration = ( ( ( GraphManager . GRID_TO_BUS_STOP ) + stopDelay ) + ( ( int ) ( distance // ( GraphManager . BUS_SPEED_KMPS ) ) ) ) + ( GraphManager . GRID_TO_BUS_STOP ) ;
Buggy code:
public class ReflectionBasedReferenceTypeDelegateFactory { public static ReflectionBasedReferenceTypeDelegate createDelegate ( ReferenceType forReferenceType , World inWorld ) { } private static ReflectionBasedReferenceTypeDelegate create15Delegate ( ReferenceType forReferenceType , Class forClass , World inWorld ) { } public static ResolvedMember createResolvedMember ( Member reflectMember , World inWorld ) { } public static ResolvedMember createResolvedMethod ( Method aMethod , World inWorld ) { } public static ResolvedMember createResolvedAdviceMember ( Method aMethod , World inWorld ) { } public static ResolvedMember createStaticInitMember ( Class forType , World inWorld ) { } public static ResolvedMember createResolvedConstructor ( Constructor aConstructor , World inWorld ) { } public static ResolvedMember createResolvedField ( Field aField , World inWorld ) { } public static ResolvedMember createHandlerMember ( Class exceptionType , Class inType , World inWorld ) { } private static ResolvedType [ ] toResolvedTypeArray ( Class [ ] classes , World inWorld ) { ResolvedType [ ] ret = new ResolvedType [ classes . length ] ; for ( int i = 0 ; i < ( ret . length ) ; i ++ ) { <START_BUG> ret [ i ] = inWorld . resolve ( classes [ i ] . getName ( ) ) ; <END_BUG> } return ret ; } }

Fix:
ret [ i ] = ( ( ReflectionWorld ) ( inWorld ) ) . resolve ( classes [ i ] ) ;
Buggy code:
public class Application implements ApplicationMBean { private final org . apache . wicket . Application application ; private final WebApplication webApplication ; public Application ( org . apache . wicket . Application application ) { } public void clearMarkupCache ( ) throws IOException { } public String getApplicationClass ( ) throws IOException { } public String getConfigurationType ( ) { } public String getHomePageClass ( ) throws IOException { <START_BUG> return application . getClass ( ) . getName ( ) ; <END_BUG> } public int getMarkupCacheSize ( ) throws IOException { } public String [ ] getMounts ( ) throws IOException { } public String getWicketVersion ( ) throws IOException { } }

Fix:
return application . getHomePage ( ) . getName ( ) ;
Buggy code:
public class TestCodecHoldsOpenFiles extends LuceneTestCase { public void test ( ) throws Exception { Directory d = newDirectory ( ) ; RandomIndexWriter w = new RandomIndexWriter ( random ( ) , d ) ; int numDocs = atLeast ( 100 ) ; for ( int i = 0 ; i < numDocs ; i ++ ) { Document doc = new Document ( ) ; doc . add ( newField ( "foo" , "bar" , TYPE_NOT_STORED ) ) ; w . addDocument ( doc ) ; } IndexReader r = w . getReader ( ) ; <START_BUG> w . close ( ) ; <END_BUG> for ( String fileName : d . listAll ( ) ) { try { d . deleteFile ( fileName ) ; } catch ( IOException ioe ) { } } for ( AtomicReaderContext cxt : r . leaves ( ) ) { TestUtil . checkReader ( cxt . reader ( ) ) ; } r . close ( ) ; d . close ( ) ; } }

Fix:
w . shutdown ( ) ;
Buggy code:
public class PooledConnectionFactoryDefinition extends SimpleResourceDefinition { public static final PathElement PATH = PathElement . pathElement ( POOLED_CONNECTION_FACTORY ) ; private static ConnectionFactoryAttribute [ ] define ( ConnectionFactoryAttribute [ ] common , ConnectionFactoryAttribute ... specific ) { int size = ( common . length ) + ( specific . length ) ; ConnectionFactoryAttribute [ ] result = new ConnectionFactoryAttribute [ size ] ; System . arraycopy ( common , 0 , result , 0 , common . length ) ; System . arraycopy ( specific , 0 , result , common . length , specific . length ) ; for ( int i = 0 ; i < ( result . length ) ; i ++ ) { ConnectionFactoryAttribute attribute = result [ i ] ; <START_BUG> if ( ( attribute . getDefinition ( ) ) == ( CommonAttributes . RECONNECT_ATTEMPTS ) ) { <END_BUG> result [ i ] = ConnectionFactoryAttribute . create ( RECONNECT_ATTEMPTS , RECONNECT_ATTEMPTS_PROP_NAME , true ) ; } } return result ; } public static final ConnectionFactoryAttribute [ ] ATTRIBUTES = PooledConnectionFactoryDefinition . define ( Pooled . ATTRIBUTES , Common . ATTRIBUTES ) ; private static final DescriptionProvider DESC = new DescriptionProvider ( ) { @ Override public ModelNode getModelDescription ( Locale locale ) { } } ; private final boolean registerRuntimeOnly ; public PooledConnectionFactoryDefinition ( final boolean registerRuntimeOnly ) { } @ Override public void registerAttributes ( ManagementResourceRegistration registry ) { } @ Override public void registerOperations ( ManagementResourceRegistration registry ) { } }

Fix:
if ( ( attribute . getDefinition ( ) ) == ( Common . RECONNECT_ATTEMPTS ) ) {
Buggy code:
public class BasicClock implements IClock , ISetableClock { private static final Log LOGGER = LogFactory . getLog ( BasicClock . class ) ; protected Lock _lock = new ReentrantLock ( ) ; protected Condition _timeChangeCondition = _lock . newCondition ( ) ; private volatile double _globalTime = - 0.001 ; private double _timeShift ; private boolean _ignoreTimeDiscrepencies = false ; private BasicClock . WaitFor _waitFor ; private BasicClock . WaitFor _waitForAny ; private long _defaultWaitTime = 100 ; private static double _timeSlipTolerance = 0.025 ; private static final double PRECISION ; public static double getTimeSlipTolerance ( ) { } public BasicClock ( ) { } public void setTimeSlipTolerance ( double tolerance ) { } protected long getDefaultWaitTime ( ) { } protected void setDefaultWaitTime ( long waitTime ) { } protected BasicClock . WaitFor createWaitForTime ( ) { } protected BasicClock . WaitFor createWaitForAny ( ) { } protected BasicClock . WaitFor getWaitForAny ( ) { } protected BasicClock . WaitFor getWaitForTime ( ) { } public double getTime ( ) { } public boolean isIgnoringDiscrepencies ( ) { } public void setIgnoreDiscrepencies ( boolean ignore ) { } public double waitForChange ( ) throws InterruptedException { } public double waitForTime ( double localTime ) throws InterruptedException { } private double await ( BasicClock . IClockWaiter waiter , double targetGlobalTime , long maxWait ) throws InterruptedException { } public static double constrainPrecision ( double time ) { } public double setTime ( double localTime ) { } protected boolean requestTime ( double globalRequestedTime ) throws InterruptedException { } protected double setTimeInternal ( double localTime ) { } public double getTimeShift ( ) { } public void setTimeShift ( double shift ) { } public static interface IClockWaiter { public boolean shouldWait ( double currentTime ) ; } public class WaitFor implements BasicClock . IClockWaiter { private ThreadLocal < Double > _timeToWait = new ThreadLocal < Double > ( ) ; private double _epsilon = 1 // ( 10 * ( BasicClock . PRECISION ) ) ; protected double getEpsilon ( ) { } public void setWaitForTime ( double time ) { } protected double getWaitForTime ( ) { } public boolean shouldWait ( double currentTime ) { double delta = ( getWaitForTime ( ) ) - currentTime ; <START_BUG> boolean shouldWait = delta > ( getEpsilon ( ) ) ; <END_BUG> if ( ( ! shouldWait ) && ( delta > 0 ) ) { if ( BasicClock . LOGGER . isWarnEnabled ( ) ) BasicClock . LOGGER . warn ( String . format ( "Adjusting<seq2seq4repair_space>time<seq2seq4repair_space>shift<seq2seq4repair_space>by<seq2seq4repair_space>%.5f" , delta ) ) ; setTimeShift ( ( ( getTimeShift ( ) ) + delta ) ) ; } return shouldWait ; } } }

Fix:
boolean shouldWait = delta >= ( getEpsilon ( ) ) ;
Buggy code:
public class GroupBy implements OnGoingGroupByCondition { private final List < Selector > groups = new ArrayList < Selector > ( ) ; private ConditionBuilder havingCondition ; public String createQueryFragment ( StringBuilder builder , AtomicInteger incrementor ) { } public void addGroup ( Selector selector ) { } @ Override public < T > ValueOnGoingCondition < T > having ( T object ) { } @ Override public < V , T extends Comparable < V > > OnGoingComparableCondition < V > having ( T object ) { } @ Override public OnGoingStringCondition < String > having ( String object ) { } @ Override public < T > OnGoingCollectionCondition < T > having ( Collection < T > object ) { } @ Override public < T > ValueOnGoingCondition < T > having ( Function < T > function ) { } @ Override public < T extends Comparable < ? > > OnGoingComparableCondition < T > having ( ComparableFunction < T > function ) { } @ Override public OnGoingLogicalCondition having ( OnGoingLogicalCondition condition ) { } public Condition getCondition ( ) { <START_BUG> return havingCondition ; <END_BUG> } }

Fix:
return ConditionHelper . getConditionClause ( havingCondition ) ;
Buggy code:
public class PinochleComputerPlayerDumb extends PinochleComputerPlayer { public PinochleComputerPlayerDumb ( String name ) { } protected GameAction biddingPhase ( ) { numBiddingTo = 5 ; <START_BUG> numBiddingTo += ( meldAmount ( ) ) * 1.2 ; <END_BUG> int numCounters = 0 ; int [ ] suits = new int [ 4 ] ; for ( Card card : state . getPlayerCards ( ) . get ( playerNum ) ) { ( suits [ card . getSuit ( ) . ordinal ( ) ] ) ++ ; if ( card . isCounter ( ) ) { ( suits [ card . getSuit ( ) . ordinal ( ) ] ) ++ ; numCounters ++ ; } } numBiddingTo += numCounters ; int largestValue = 0 ; for ( int i = 0 ; i < ( suits . length ) ; i ++ ) { if ( ( suits [ i ] ) > largestValue ) { largestValue = suits [ i ] ; } } if ( largestValue > 5 ) { numBiddingTo += largestValue * 2 ; } Log . i ( ( "Dumb<seq2seq4repair_space>Computer<seq2seq4repair_space>" + ( playerNum ) ) , ( "Bid<seq2seq4repair_space>to<seq2seq4repair_space>" + ( numBiddingTo ) ) ) ; if ( ( state . getCurrentBid ( ) ) > ( ( ( numBiddingTo ) + ( ( int ) ( ( Math . random ( ) ) * 4 ) ) ) - 2 ) ) { if ( ( ( meldAmount ( ) ) + numCounters ) > 15 ) { return new PinochlePassWithHelpAction ( this , name ) ; } else { return new PinochlePassAction ( this , name ) ; } } else { if ( ( state . getCurrentBid ( ) ) == 0 ) return new PinochleBidAction ( this , name , 25 ) ; int bid = ( state . getCurrentBid ( ) ) + 1 ; return new PinochleBidAction ( this , name , bid ) ; } } protected GameAction chooseTrumpSuit ( ) { } protected GameAction passingPhase ( ) { } protected GameAction trickTaking ( ) { } private int meldAmount ( ) { } }

Fix:
numBiddingTo += meldAmount ( ) ;
Buggy code:
public class ContainerFetcher extends Fetcher { private Descriptor descriptor ; public ContainerFetcher ( Descriptor descriptor ) { } private static final String TAG = ContainerFetcher . class . getName ( ) ; public Fetcher [ ] fetch ( ) { try { Log . i ( ContainerFetcher . TAG , descriptor . getUrl ( ) ) ; setHasMore ( false ) ; Document doc = Jsoup . connect ( descriptor . getUrl ( ) ) . get ( ) ; URI uri = URI . create ( descriptor . getUrl ( ) ) ; List < Fetcher > fetchers = new ArrayList < > ( ) ; for ( Element element : doc . select ( descriptor . getItemSelector ( ) ) ) { String link = element . select ( descriptor . getLinkSelector ( ) ) . attr ( "href" ) ; String name = element . select ( descriptor . getNameSelector ( ) ) . text ( ) ; if ( ! ( link . isEmpty ( ) ) ) { Descriptor childDescriptor = descriptor . getHandler ( ) . clone ( ) ; childDescriptor . setUrl ( uri . resolve ( link ) . toString ( ) ) ; if ( ( childDescriptor . getType ( ) ) == ( Type . CONTAINER ) ) { ContainerFetcher fetcher = new ContainerFetcher ( childDescriptor ) ; fetcher . setName ( name ) ; fetchers . add ( fetcher ) ; } else { MangaFetcher fetcher = new MangaFetcher ( childDescriptor ) ; fetcher . setName ( name ) ; fetchers . add ( fetcher ) ; } } } if ( ( descriptor . getNextPageSelector ( ) ) != null ) { Elements nextPageLink = doc . select ( descriptor . getNextPageSelector ( ) ) ; <START_BUG> setHasMore ( ( ( nextPageLink . size ( ) ) > 0 ) ) ; <END_BUG> if ( hasMore ( ) ) { descriptor . setUrl ( uri . resolve ( nextPageLink . get ( 0 ) . attr ( "href" ) ) . toString ( ) ) ; } } else { setHasMore ( false ) ; } return fetchers . toArray ( new Fetcher [ fetchers . size ( ) ] ) ; } catch ( IOException e ) { return new Fetcher [ 0 ] ; } } @ Override public boolean isContainerProvider ( ) { } }

Fix:
setHasMore ( ( ( ( nextPageLink . size ( ) ) > 0 ) && ( ! ( nextPageLink . get ( 0 ) . attr ( "href" ) . isEmpty ( ) ) ) ) ) ;
Buggy code:
public class SourceTrackers { private static final Localizer _loc = Localizer . forPackage ( SourceTrackers . class ) ; private static final String SEP = J2DoPrivHelper . getLineSeparator ( ) ; public static String getSourceLocationMessage ( SourceTracker [ ] trackers ) { <START_BUG> StringBuffer buf = new StringBuffer ( ( 20 * ( ( trackers . length ) + 1 ) ) ) ; <END_BUG> buf . append ( SourceTrackers . _loc . get ( "source-trackers-location-header" ) ) . append ( SourceTrackers . SEP ) ; String sourceFilePath ; for ( int i = 0 ; i < ( trackers . length ) ; i ++ ) { sourceFilePath = ( ( trackers [ i ] . getSourceFile ( ) ) == null ) ? SourceTrackers . _loc . get ( "source-tracker-file-unknown" ) . getMessage ( ) : AccessController . doPrivileged ( J2DoPrivHelper . getAbsolutePathAction ( trackers [ i ] . getSourceFile ( ) ) ) ; buf . append ( "<seq2seq4repair_space>" ) . append ( SourceTrackers . _loc . get ( "source-trackers-location-line-item" , trackers [ i ] . getResourceName ( ) , sourceFilePath ) ) ; if ( i < ( ( trackers . length ) - 1 ) ) buf . append ( SourceTrackers . SEP ) ; } return buf . toString ( ) ; } }

Fix:
StringBuilder buf = new StringBuilder ( ( 20 * ( ( trackers . length ) + 1 ) ) ) ;
Buggy code:
public final class AccessStackPageMap extends PageMap implements Serializable { private static final long serialVersionUID = 1L ; private static final Log log = LogFactory . getLog ( AccessStackPageMap . class ) ; private final ArrayListStack < AccessStackPageMap . Access > accessStack = new ArrayListStack < AccessStackPageMap . Access > ( 8 ) ; public static class Access implements Serializable { private static final long serialVersionUID = 1L ; int id ; int version ; @ Override public boolean equals ( Object obj ) { } public final int getId ( ) { } public final int getVersion ( ) { } @ Override public int hashCode ( ) { } @ Override public String toString ( ) { } } public AccessStackPageMap ( final String name , final Session session ) { } @ Override public final void clear ( ) { } public final ArrayListStack < AccessStackPageMap . Access > getAccessStack ( ) { } public final int getVersions ( ) { } public final IPageMapEntry lastAccessedEntry ( ) { } @ Override public final void removeEntry ( final IPageMapEntry entry ) { } @ Override protected final Page get ( final int id , int versionNumber ) { } @ Override protected final void put ( final Page page ) { <START_BUG> if ( ! ( page . isStateless ( ) ) ) { <END_BUG> Session session = getSession ( ) ; final IPageMapEntry entry = page . getPageMapEntry ( ) ; pushAccess ( entry ) ; final String attribute = attributeForId ( entry . getNumericId ( ) ) ; if ( ( session . getAttribute ( attribute ) ) == null ) { session . setAttribute ( attribute , entry ) ; } else { session . dirtyPage ( page ) ; } session . getApplication ( ) . getSessionSettings ( ) . getPageMapEvictionStrategy ( ) . evict ( this ) ; } } private final void access ( final IPageMapEntry entry , final int version ) { } private final AccessStackPageMap . Access peekAccess ( ) { } private final AccessStackPageMap . Access popAccess ( ) { } private final void pushAccess ( IPageMapEntry entry ) { } private final int versionOf ( final IPageMapEntry entry ) { } }

Fix:
if ( ! ( page . isPageStateless ( ) ) ) {
Buggy code:
public class CookieValuePersisterTest extends TestCase { private MockWebApplication application ; protected void setUp ( ) throws Exception { super . setUp ( ) ; application = new MockWebApplication ( null ) ; <START_BUG> application . getPages ( ) . setHomePage ( CookieValuePersisterTestPage . class ) ; <END_BUG> application . setupRequestAndResponse ( ) ; application . processRequestCycle ( ) ; } public void test1 ( ) throws Exception { } private void copyCookieFromResponseToRequest ( final RequestCycle cycle ) { } private Cookie [ ] getRequestCookies ( final RequestCycle cycle ) { } private List getResponseCookies ( final RequestCycle cycle ) { } }

Fix:
application . getRequiredPageSettings ( ) . setHomePage ( CookieValuePersisterTestPage . class ) ;
Buggy code:
public class PickPocket extends Ability { private SneakSkillManager manager ; public PickPocket ( SneakSkillManager sneakSkillManager ) { } @ Override public void perform ( Avatar avatar ) { if ( hasMana ( avatar ) ) { removeMana ( avatar ) ; int pickpocketSkill = manager . getPickPocketSkill ( ) ; if ( ( ( Math . random ( ) ) + ( pickpocketSkill // 100 ) ) < 0.75 ) { TileCoordinate nextLocation = avatar . nextLocation ( ) ; Entity entity = EntityManager . getSingleton ( ) . getEntityAtLocation ( nextLocation ) ; if ( entity != null ) { TakeableItem [ ] items = entity . getItems ( ) ; int countItems = 0 ; for ( int i = 0 ; i < ( items . length ) ; ++ i ) { if ( ( items [ i ] ) != null ) { ++ countItems ; } } int randomCount = ( ( int ) ( ( Math . random ( ) ) * countItems ) ) ; TakeableItem randomItem = null ; for ( int i = 0 ; i < ( items . length ) ; ++ i ) { if ( ( items [ i ] ) != null ) { if ( ( randomCount -- ) == 0 ) { randomItem = items [ i ] ; break ; } } } entity . removeItem ( randomItem ) ; avatar . addItem ( randomItem ) ; } } else { Entity entity = EntityManager . getSingleton ( ) . getEntityAtLocation ( avatar . nextLocation ( ) ) ; if ( entity != null ) { <START_BUG> entity . push ( new TrooperBehavior ( ) ) ; <END_BUG> } } } } }

Fix:
entity . push ( new TrooperBehavior ( 7 ) ) ;
Buggy code:
@ ConsoleCommand ( name = "jar" ) public class Jar extends Command { private String [ ] libraryPaths ; private String jarPath ; private static final Jar . JarFilter JAR_FILTER = new Jar . JarFilter ( ) ; private static class JarFilter implements FileFilter { @ Override public boolean accept ( File pathname ) { } } @ Override protected void execute ( ) throws ExecutionException { } @ Override protected String commandDescription ( ) { } @ CommandInput ( consoleFormat = "-lib" , defaultValue = "" , mandatory = false , description = "additional<seq2seq4repair_space>library<seq2seq4repair_space>directories<seq2seq4repair_space>to<seq2seq4repair_space>be<seq2seq4repair_space>loaded<seq2seq4repair_space>(comma<seq2seq4repair_space>separated)" ) public void setLibraryPaths ( String [ ] libraryPaths ) { } @ PositionalInput ( description = "the<seq2seq4repair_space>complete<seq2seq4repair_space>path<seq2seq4repair_space>of<seq2seq4repair_space>the<seq2seq4repair_space>jar<seq2seq4repair_space>to<seq2seq4repair_space>be<seq2seq4repair_space>loaded" , name = "jarPath" , position = 1 ) public void setJarPath ( String jarPath ) { } private class LocalLoader extends ClassLoader { Map < String , byte [ ] > jarFiles ; public LocalLoader ( Map < String , byte [ ] > jarFiles ) { } public Map < String , Class < ? extends Command > > loadCommands ( ) { Map < String , Class < ? extends Command > > commands = new HashMap < > ( ) ; byte [ ] classBytes ; String className ; String classPath ; Class c ; Class sc ; LinkedList < String > waiting = new LinkedList < > ( jarFiles . keySet ( ) ) ; <START_BUG> while ( waiting . isEmpty ( ) ) { <END_BUG> classPath = waiting . poll ( ) ; className = checkClass ( classPath ) ; if ( ! ( "" . equals ( className ) ) ) { try { classBytes = jarFiles . get ( classPath ) ; c = defineClass ( className , classBytes , 0 , classBytes . length ) ; sc = c ; while ( ( sc = sc . getSuperclass ( ) ) != null ) { if ( sc == ( Command . class ) ) { commands . put ( className , c ) ; break ; } } } catch ( NoClassDefFoundError ex ) { waiting . add ( classPath ) ; } } } return commands ; } private String checkClass ( String classPath ) { } } }

Fix:
while ( ! ( waiting . isEmpty ( ) ) ) {
Buggy code:
public class StyleTest extends BuildFileTest { public StyleTest ( String s ) { } protected void setUp ( ) throws Exception { } protected void tearDown ( ) throws Exception { } public void testStyleIsSet ( ) throws Exception { } public void testTransferParameterSet ( ) throws Exception { } public void testTransferParameterEmpty ( ) throws Exception { } public void testTransferParameterUnset ( ) throws Exception { } public void testTransferParameterUnsetWithIf ( ) throws Exception { } public void testNewerStylesheet ( ) throws Exception { } public void testDefaultMapper ( ) throws Exception { } public void testCustomMapper ( ) throws Exception { } private String getFileString ( String filename ) throws IOException { Reader r = null ; try { r = new FileReader ( getProject ( ) . resolveFile ( filename ) ) ; <START_BUG> return FileUtils . newFileUtils ( ) . readFully ( r ) ; <END_BUG> } finally { try { r . close ( ) ; } catch ( Throwable ignore ) { } } } private String getFileString ( String target , String filename ) throws IOException { } private void expectFileContains ( String target , String filename , String contains ) throws IOException { } }

Fix:
return FileUtils . readFully ( r ) ;
Buggy code:
public abstract class BaseResourceCollectionWrapper extends DataType implements Cloneable , ResourceCollection { private static final String ONE_NESTED_MESSAGE = "<seq2seq4repair_space>expects<seq2seq4repair_space>exactly<seq2seq4repair_space>one<seq2seq4repair_space>nested<seq2seq4repair_space>resource<seq2seq4repair_space>collection." ; private ResourceCollection rc ; private Collection coll = null ; private boolean cache = true ; public synchronized void setCache ( boolean b ) { } public synchronized boolean isCache ( ) { } public synchronized void add ( ResourceCollection c ) throws BuildException { } public final synchronized Iterator iterator ( ) { if ( isReference ( ) ) { return ( ( BaseResourceCollectionWrapper ) ( getCheckedRef ( ) ) ) . iterator ( ) ; } dieOnCircularReference ( ) ; <START_BUG> return cacheCollection ( ) . iterator ( ) ; <END_BUG> } public synchronized int size ( ) { } public synchronized boolean isFilesystemOnly ( ) { } protected synchronized void dieOnCircularReference ( Stack stk , Project p ) throws BuildException { } protected final synchronized ResourceCollection getResourceCollection ( ) { } protected abstract Collection getCollection ( ) { } public synchronized String toString ( ) { } private synchronized Collection cacheCollection ( ) { } private void throwOneNested ( ) throws BuildException { } }

Fix:
return new FailFast ( this , cacheCollection ( ) . iterator ( ) ) ;
Buggy code:
public class CheckGpsFix extends AutomatedCheck { private static final String GPS_DIFF = I18n . textc ( "DIFF" , "Use<seq2seq4repair_space>a<seq2seq4repair_space>single<seq2seq4repair_space>small<seq2seq4repair_space>word" ) ; private static final String GPS_3D = I18n . textc ( "3D" , "Use<seq2seq4repair_space>a<seq2seq4repair_space>single<seq2seq4repair_space>small<seq2seq4repair_space>word" ) ; private static final String GPS_2D = I18n . textc ( "2D" , "Use<seq2seq4repair_space>a<seq2seq4repair_space>single<seq2seq4repair_space>small<seq2seq4repair_space>word" ) ; private static final String GPS_NO_FIX = I18n . textc ( "NoFix" , "Use<seq2seq4repair_space>a<seq2seq4repair_space>single<seq2seq4repair_space>small<seq2seq4repair_space>word" ) ; public CheckGpsFix ( boolean maintainState ) { } @ Subscribe public void on ( GpsFix msg ) { <START_BUG> if ( ! ( msg . getSourceName ( ) . equals ( msg . getSourceName ( ) ) ) ) <END_BUG> return ; GpsFix . TYPE fixType = msg . getType ( ) ; int fixValidity = msg . getValidity ( ) ; if ( fixType == ( TYPE . DEAD_RECKONING ) ) { setState ( NOT_VALIDATED ) ; setValuesLabelText ( CheckGpsFix . GPS_NO_FIX ) ; } else if ( fixType == ( TYPE . STANDALONE ) ) { setState ( VALIDATED_WITH_WARNINGS ) ; setValuesLabelText ( CheckGpsFix . GPS_2D ) ; if ( ( fixValidity & ( GpsFix . GFV_VALID_VDOP ) ) != 0 ) { setState ( VALIDATED ) ; setValuesLabelText ( CheckGpsFix . GPS_3D ) ; } } else if ( fixType == ( TYPE . DIFFERENTIAL ) ) { setState ( VALIDATED ) ; setValuesLabelText ( CheckGpsFix . GPS_DIFF ) ; } } @ Override public void validateCheck ( ) { } }

Fix:
if ( ! ( messageFromMainVehicle ( msg . getSourceName ( ) ) ) )
Buggy code:
public class ApplicationContextProcessor implements DeploymentUnitProcessor { public void deploy ( DeploymentPhaseContext phaseContext ) throws DeploymentUnitProcessingException { final DeploymentUnit deploymentUnit = phaseContext . getDeploymentUnit ( ) ; if ( ( deploymentUnit . getParent ( ) ) != null ) { return ; } final ServiceTarget serviceTarget = phaseContext . getServiceTarget ( ) ; final ServiceName applicationContextServiceName = ContextServiceNameBuilder . app ( deploymentUnit ) ; final RootContextService contextService = new RootContextService ( ) ; serviceTarget . addService ( applicationContextServiceName , contextService ) . install ( ) ; final BinderService < String > applicationNameBinder = new BinderService < String > ( "AppName" , Values . immediateValue ( deploymentUnit . getName ( ) ) ) ; <START_BUG> serviceTarget . addService ( applicationContextServiceName . append ( "app-name" ) , applicationNameBinder ) . addDependency ( applicationContextServiceName , Context . class , applicationNameBinder . getContextInjector ( ) ) . install ( ) ; <END_BUG> final ContextService envContextService = new ContextService ( JndiName . of ( "env" ) ) ; serviceTarget . addService ( applicationContextServiceName . append ( "env" ) , envContextService ) . addDependency ( applicationContextServiceName , Context . class , envContextService . getParentContextInjector ( ) ) . install ( ) ; phaseContext . getDeploymentUnit ( ) . putAttachment ( APPLICATION_CONTEXT_CONFIG , new NamingContextConfig ( applicationContextServiceName ) ) ; } public void undeploy ( DeploymentUnit context ) { } }

Fix:
serviceTarget . addService ( applicationContextServiceName . append ( "AppName" ) , applicationNameBinder ) . addDependency ( applicationContextServiceName , Context . class , applicationNameBinder . getContextInjector ( ) ) . install ( ) ;
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 , response ) ; <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 ) ;
Buggy code:
public class FileHelper { private File cafeFile ; private long size ; public Vector < Module > modules ; public FileHelper ( String path ) { } public FileHelper ( File f ) { } public long getSize ( ) { } public String readFileAsTxt ( ) { } public Vector < Module > parseCafeFile ( ) { } public void parseModule ( BufferedReader br , String currentLine , Module mod ) { } public void parseLine ( String line , Module mod , BufferedReader br ) { } public void parseNameLine ( String line , String before , Module mod ) { } public void parseImportLine ( String line , String importString , Module mod ) { } public void parseSortDecLine ( String line , Module mod ) { } public void parseOpLine ( String line , Module mod ) { } public void parseOpsLine ( String line , Module mod ) { } public void parseVarLine ( String line , Module mod ) { } public void parseEq ( String line , Module mod , CafeEquation eq ) { String condition = "" ; <START_BUG> line = line . replace ( "." , "" ) ; <END_BUG> if ( line . startsWith ( "eq" ) ) { line = line . split ( "(eq)\\s+" ) [ 1 ] ; } else { if ( line . startsWith ( "ceq" ) ) { condition = line . split ( "(\\s+)if(\\s+)" ) [ 1 ] . trim ( ) ; line = line . split ( "(\\s+)if(\\s+)" ) [ 0 ] . split ( "(ceq)\\s+" ) [ 1 ] . trim ( ) ; } } if ( ! ( condition . equals ( "" ) ) ) { eq . setCondition ( TermParser . parseEqTerm ( condition . trim ( ) ) ) ; } try { eq . setLeftTerm ( TermParser . parseEqTerm ( TermParser . eqToTree ( line ) . get ( 0 ) ) ) ; eq . setRightTerm ( TermParser . parseEqTerm ( TermParser . eqToTree ( line ) . get ( 1 ) ) ) ; } catch ( Exception e ) { e . printStackTrace ( ) ; } } public Vector < Module > getModules ( ) { } }

Fix:
line = line . replace ( "." , "" ) . replace ( "==" , "=" ) ;
Buggy code:
public class JacORBExtension implements Extension { private static final JacORBSubsystemParser PARSER = JacORBSubsystemParser . INSTANCE ; public static final String SUBSYSTEM_NAME = "jacorb" ; private static final String RESOURCE_NAME = ( JacORBExtension . class . getPackage ( ) . getName ( ) ) + ".LocalDescriptions" ; static ResourceDescriptionResolver getResourceDescriptionResolver ( final String keyPrefix ) { } @ Override public void initialize ( ExtensionContext context ) { <START_BUG> final SubsystemRegistration subsystem = context . registerSubsystem ( JacORBExtension . SUBSYSTEM_NAME , 1 , 0 ) ; <END_BUG> final ManagementResourceRegistration subsystemRegistration = subsystem . registerSubsystemModel ( INSTANCE ) ; subsystemRegistration . registerOperationHandler ( DESCRIBE , GenericSubsystemDescribeHandler . INSTANCE , GenericSubsystemDescribeHandler . INSTANCE , false , PRIVATE ) ; subsystem . registerXMLElementWriter ( JacORBExtension . PARSER ) ; } @ Override public void initializeParsers ( ExtensionParsingContext context ) { } }

Fix:
final SubsystemRegistration subsystem = context . registerSubsystem ( JacORBExtension . SUBSYSTEM_NAME , 1 , 1 ) ;
Buggy code:
public class ParagraphMenu extends IMenu implements ActionListener , ContainerListener , Observer { public static final String [ ] STYLES = new String [ ] { "Normal" , "Preformatted" , "Heading<seq2seq4repair_space>1" , "Heading<seq2seq4repair_space>2" , "Heading<seq2seq4repair_space>3" , "Address" } ; public static final HTML . Tag [ ] STYLE_TAGS = new HTML . Tag [ ] { HTML . Tag . P , HTML . Tag . PRE , HTML . Tag . H1 , HTML . Tag . H2 , HTML . Tag . H3 , HTML . Tag . ADDRESS } ; public static final String [ ] STYLE_STRINGS = new String [ ] { HTML . Tag . P . toString ( ) , HTML . Tag . PRE . toString ( ) , HTML . Tag . H1 . toString ( ) , HTML . Tag . H2 . toString ( ) , HTML . Tag . H3 . toString ( ) , HTML . Tag . ADDRESS . toString ( ) } ; ButtonGroup group ; public ParagraphMenu ( FrameMediator controller ) { } protected void initMenu ( ) { } public void update ( Observable arg0 , Object arg1 ) { } private void selectMenuItem ( HTML . Tag tag ) { } public HTML . Tag getTagFromString ( String tagStr ) { } public void actionPerformed ( ActionEvent arg0 ) { } public void componentAdded ( ContainerEvent e ) { <START_BUG> log . debug ( "Re-registering<seq2seq4repair_space>as<seq2seq4repair_space>observer<seq2seq4repair_space>on<seq2seq4repair_space>editor<seq2seq4repair_space>controller" ) ; <END_BUG> ( ( org . columba . mail . gui . composer . ComposerController ) ( getController ( ) ) ) . getEditorController ( ) . addObserver ( this ) ; } public void componentRemoved ( ContainerEvent e ) { } }

Fix:
log . info ( "Re-registering<seq2seq4repair_space>as<seq2seq4repair_space>observer<seq2seq4repair_space>on<seq2seq4repair_space>editor<seq2seq4repair_space>controller" ) ;
Buggy code:
public class PageProvider implements IPageProvider { private Integer renderCount ; private IPageSource pageSource ; private IRequestablePage pageInstance ; private Class < ? extends IRequestablePage > pageClass ; private Integer pageId ; private PageParameters pageParameters ; public PageProvider ( final int pageId , final Integer renderCount ) { } public PageProvider ( final int pageId , final Class < ? extends IRequestablePage > pageClass , Integer renderCount ) { } public PageProvider ( final int pageId , final Class < ? extends IRequestablePage > pageClass , final PageParameters pageParameters , final Integer renderCount ) { } public PageProvider ( final Class < ? extends IRequestablePage > pageClass , final PageParameters pageParameters ) { } public PageProvider ( Class < ? extends IRequestablePage > pageClass ) { } public PageProvider ( IRequestablePage page ) { } public IRequestablePage getPageInstance ( ) { } public PageParameters getPageParameters ( ) { } public boolean isNewPageInstance ( ) { } public Class < ? extends IRequestablePage > getPageClass ( ) { } protected boolean prepareForRenderNewPage ( ) { } protected IPageSource getPageSource ( ) { if ( ( pageSource ) != null ) { return pageSource ; } if ( Application . exists ( ) ) { <START_BUG> return Application . get ( ) . getEncoderContext ( ) ; <END_BUG> } else { throw new IllegalStateException ( "No<seq2seq4repair_space>application<seq2seq4repair_space>is<seq2seq4repair_space>bound<seq2seq4repair_space>to<seq2seq4repair_space>current<seq2seq4repair_space>thread.<seq2seq4repair_space>Call<seq2seq4repair_space>setPageSource()<seq2seq4repair_space>to<seq2seq4repair_space>manually<seq2seq4repair_space>assign<seq2seq4repair_space>pageSource<seq2seq4repair_space>to<seq2seq4repair_space>this<seq2seq4repair_space>provider." ) ; } } private IRequestablePage getPageInstance ( Integer pageId , Class < ? extends IRequestablePage > pageClass , PageParameters pageParameters , Integer renderCount ) { } public void detach ( ) { } public void setPageSource ( IPageSource pageSource ) { } private void setPageClass ( Class < ? extends IRequestablePage > pageClass ) { } private void setPageParameters ( PageParameters pageParameters ) { } private void touchPageInstance ( ) { } }

Fix:
return Application . get ( ) . getMapperContext ( ) ;
Buggy code:
public class JXPath extends Task implements PropertyInterceptor { public static String PREFIX = "jxpath:" ; JXPathContext jxpathCtx ; public JXPath ( ) { } public JXPathContext getJXPathContext ( ) { } public boolean setProperty ( Object c , String ns , String name , Object v ) { } public Object getProperty ( Object p , String ns , String name ) { } String foo ; public void setFoo ( String s ) { } public String getFoo ( ) { } public void execute ( ) { JXPathIntrospector . registerDynamicClass ( Hashtable . class , JXPath . JXPathHashtableHandler . class ) ; <START_BUG> PropertyHelper phelper = PropertyHelper . getPropertyHelper ( project ) ; <END_BUG> phelper . addPropertyInterceptor ( this ) ; project . addReference ( "jxpathTask" , this ) ; jxpathCtx = JXPathContext . newContext ( project ) ; jxpathCtx . setVariables ( new JXPath . AntVariables ( ) ) ; } public static class JXPathHashtableHandler implements DynamicPropertyHandler { private static final String [ ] STRING_ARRAY = new String [ 0 ] ; public String [ ] getPropertyNames ( Object object ) { } public Object getProperty ( Object object , String propertyName ) { } public void setProperty ( Object object , String propertyName , Object value ) { } } public class AntVariables implements Variables { protected AntVariables ( ) { } public void declareVariable ( String varName , Object value ) { } public Object getVariable ( String varName ) { } public boolean isDeclaredVariable ( String varName ) { } public void undeclareVariable ( String varName ) { } } }

Fix:
PropertyHelper2 phelper = PropertyHelper2 . getPropertyHelper ( project ) ;
Buggy code:
public class Assignments { private List < PotentialAssignment > fAssigned ; private final List < ParameterSignature > fUnassigned ; private final TestClass fClass ; public Assignments ( List < PotentialAssignment > assigned , List < ParameterSignature > unassigned , TestClass testClass ) { } public static Assignments allUnassigned ( Method testMethod , TestClass testClass ) throws Exception { } public boolean isComplete ( ) { } public ParameterSignature nextUnassigned ( ) { } public Assignments assignNext ( PotentialAssignment source ) { } public Object [ ] getActualValues ( int start , int stop , boolean nullsOk ) throws CouldNotGenerateValueException { } public List < PotentialAssignment > potentialsForNextUnassigned ( ) throws IllegalAccessException , InstantiationException { } public ParameterSupplier getSupplier ( ParameterSignature unassigned ) throws IllegalAccessException , InstantiationException { ParameterSupplier supplier = getAnnotatedSupplier ( unassigned ) ; if ( supplier != null ) return supplier ; <START_BUG> return new AllMembersSupplier ( fClass . getJavaClass ( ) ) ; <END_BUG> } public ParameterSupplier getAnnotatedSupplier ( ParameterSignature unassigned ) throws IllegalAccessException , InstantiationException { } public Object [ ] getConstructorArguments ( boolean nullsOk ) throws CouldNotGenerateValueException { } public Object [ ] getMethodArguments ( boolean nullsOk ) throws CouldNotGenerateValueException { } public Object [ ] getAllArguments ( boolean nullsOk ) throws CouldNotGenerateValueException { } private int getConstructorParameterCount ( ) { } }

Fix:
return new AllMembersSupplier ( fClass ) ;