nus-yam/ex-repair huggingface dataset:
Buggy code:
public class LocaleUtilsTest extends TestCase { private static final Locale LOCALE_EN = new Locale ( "en" , "" ) ; private static final Locale LOCALE_EN_US = new Locale ( "en" , "US" ) ; private static final Locale LOCALE_EN_US_ZZZZ = new Locale ( "en" , "US" , "ZZZZ" ) ; private static final Locale LOCALE_FR = new Locale ( "fr" , "" ) ; private static final Locale LOCALE_FR_CA = new Locale ( "fr" , "CA" ) ; private static final Locale LOCALE_QQ = new Locale ( "qq" , "" ) ; private static final Locale LOCALE_QQ_ZZ = new Locale ( "qq" , "ZZ" ) ; public LocaleUtilsTest ( String name ) { } public static void main ( String [ ] args ) { } public static Test suite ( ) { } public void testConstructor ( ) { } private void assertValidToLocale ( String language ) { } private void assertValidToLocale ( String localeString , String language , String country ) { } private void assertValidToLocale ( String localeString , String language , String country , String variant ) { } public void testToLocale_1Part ( ) { } public void testToLocale_2Part ( ) { } public void testToLocale_3Part ( ) { } private void assertLocaleLookupList ( Locale locale , Locale defaultLocale , Locale [ ] expected ) { } public void testLocaleLookupList_Locale ( ) { assertLocaleLookupList ( null , null , new Locale [ 0 ] ) ; assertLocaleLookupList ( LocaleUtilsTest . LOCALE_QQ , null , new Locale [ ] { LocaleUtilsTest . LOCALE_QQ } ) ; assertLocaleLookupList ( LocaleUtilsTest . LOCALE_EN , null , new Locale [ ] { LocaleUtilsTest . LOCALE_EN } ) ; assertLocaleLookupList ( LocaleUtilsTest . LOCALE_EN , null , new Locale [ ] { LocaleUtilsTest . LOCALE_EN } ) ; assertLocaleLookupList ( LocaleUtilsTest . LOCALE_EN_US , null , new Locale [ ] { LocaleUtilsTest . LOCALE_EN_US , LocaleUtilsTest . LOCALE_EN } ) ; <START_BUG> assertLocaleLookupList ( LocaleUtilsTest . LOCALE_EN_US_ZZZZ , null , new Locale [ ] { LocaleUtilsTest . LOCALE_EN_US_ZZZZ , LocaleUtilsTest . LOCALE_EN_US , new Locale ( "en" ) } ) ; <END_BUG> } public void testLocaleLookupList_LocaleLocale ( ) { } public void testAvailableLocaleList ( ) { } public void testAvailableLocaleSet ( ) { } public void testIsAvailableLocale ( ) { } private void assertLanguageByCountry ( String country , String [ ] languages ) { } public void testLanguagesByCountry ( ) { } private void assertCountriesByLanguage ( String language , String [ ] countries ) { } public void testCountriesByLanguage ( ) { } }

Fix:
assertLocaleLookupList ( LocaleUtilsTest . LOCALE_EN_US_ZZZZ , null , new Locale [ ] { LocaleUtilsTest . LOCALE_EN_US_ZZZZ , LocaleUtilsTest . LOCALE_EN_US , new Locale ( "en" , "" ) } ) ;
Buggy code:
public class PossibleMatch implements ICompilationUnit { public static final String NO_SOURCE_FILE_NAME = "NO<seq2seq4repair_space>SOURCE<seq2seq4repair_space>FILE<seq2seq4repair_space>NAME" ; public IResource resource ; public Openable openable ; public MatchingNodeSet nodeSet ; public char [ ] [ ] compoundName ; CompilationUnitDeclaration parsedUnit ; public SearchDocument document ; private String sourceFileName ; private char [ ] source ; public PossibleMatch ( MatchLocator locator , IResource resource , Openable openable , SearchDocument document ) { } public void cleanUp ( ) { } public boolean equals ( Object obj ) { } public char [ ] getContents ( ) { } public char [ ] getFileName ( ) { } public char [ ] getMainTypeName ( ) { } public char [ ] [ ] getPackageName ( ) { } private char [ ] getQualifiedName ( ) { if ( ( this . openable ) instanceof CompilationUnit ) { String fileName = this . resource . getFullPath ( ) . lastSegment ( ) ; <START_BUG> char [ ] mainTypeName = fileName . substring ( 0 , ( ( fileName . length ( ) ) - 5 ) ) . toCharArray ( ) ; <END_BUG> CompilationUnit cu = ( ( CompilationUnit ) ( this . openable ) ) ; return cu . getType ( new String ( mainTypeName ) ) . getFullyQualifiedName ( ) . toCharArray ( ) ; } else if ( ( this . openable ) instanceof ClassFile ) { String fileName = getSourceFileName ( ) ; if ( fileName == ( PossibleMatch . NO_SOURCE_FILE_NAME ) ) return ( ( ClassFile ) ( this . openable ) ) . getType ( ) . getFullyQualifiedName ( '.' ) . toCharArray ( ) ; int index = Util . indexOfJavaLikeExtension ( fileName ) ; String simpleName = ( index == ( - 1 ) ) ? fileName : fileName . substring ( 0 , index ) ; PackageFragment pkg = ( ( PackageFragment ) ( this . openable . getParent ( ) ) ) ; return Util . concatWith ( pkg . names , simpleName , '.' ) . toCharArray ( ) ; } return null ; } private String getSourceFileName ( ) { } public int hashCode ( ) { } public String toString ( ) { } }

Fix:
char [ ] mainTypeName = Util . getNameWithoutJavaLikeExtension ( fileName ) . toCharArray ( ) ;
Buggy code:
public class TimeExtent { public static final double NOW_ACCURACY = 1000 ; public static final double UNKNOWN = Double . MAX_VALUE ; public static final double NOW = Double . MIN_VALUE ; protected double baseTime = Double . NaN ; protected double timeBias = 0 ; protected double timeStep = 0 ; protected double leadTimeDelta = 0 ; protected double lagTimeDelta = 0 ; protected boolean baseAtNow = false ; protected boolean endNow = false ; protected boolean beginNow = false ; protected int timeZone = 0 ; public static TimeExtent getNowInstant ( ) { } public static TimeExtent getPeriodStartingNow ( double stopTime ) { } public static TimeExtent getPeriodEndingNow ( double startTime ) { } public TimeExtent ( ) { } public TimeExtent ( double baseJulianTime ) { } public TimeExtent ( double startTime , double stopTime ) { } public TimeExtent copy ( ) { } public TimeExtent ( double baseJulianTime , double timeBiasSeconds , double timeStepSeconds , double leadTimeDeltaSeconds , double lagTimeDeltaSeconds ) { } public void setBaseTime ( double baseJulianTime ) { } public void setTimeBias ( double seconds ) { } public void setTimeStep ( double seconds ) { } public void setLeadTimeDelta ( double seconds ) { } public void setLagTimeDelta ( double seconds ) { } public void setDeltaTimes ( double leadDeltaSeconds , double lagDeltaSeconds ) { } public double getBaseTime ( ) { } public double getAdjustedTime ( ) { } public double getTimeBias ( ) { } public double getTimeStep ( ) { } public double getLeadTimeDelta ( ) { } public double getLagTimeDelta ( ) { } public double getTimeRange ( ) { } public double getAdjustedLeadTime ( ) { } public double getAdjustedLagTime ( ) { } public boolean isBaseAtNow ( ) { } public void setBaseAtNow ( boolean baseAtNow ) { } public boolean isBeginNow ( ) { } public void setBeginNow ( boolean beginNow ) { } public boolean isEndNow ( ) { } public void setEndNow ( boolean endNow ) { } public int getNumberOfSteps ( ) { } public double [ ] getTimes ( ) { } public String toString ( ) { } @ Override public boolean equals ( Object obj ) { } public boolean equals ( TimeExtent timeExtent ) { } public boolean contains ( double time ) { } public boolean contains ( TimeExtent timeExtent ) { } public boolean intersects ( TimeExtent timeExtent ) { } public boolean isNull ( ) { } public boolean isTimeInstant ( ) { } public void nullify ( ) { } public void resizeToContain ( double t ) { } private double now = 0 ; private double getNow ( ) { <START_BUG> double exactNow = ( System . currentTimeMillis ( ) ) // 1000 ; <END_BUG> if ( ( exactNow - ( now ) ) > ( TimeExtent . NOW_ACCURACY ) ) now = exactNow ; return now ; } public double getStartTime ( ) { } public void setStartTime ( double startTime ) { } public double getStopTime ( ) { } public void setStopTime ( double stopTime ) { } public String getIsoString ( int zone ) { } public int getTimeZone ( ) { } public void setTimeZone ( int timeZone ) { } }

Fix:
double exactNow = ( System . currentTimeMillis ( ) ) // 1000.0 ;
Buggy code:
public class RecipeActivity extends Activity { @ Override protected void onCreate ( Bundle savedInstanceState ) { super . onCreate ( savedInstanceState ) ; setContentView ( activity_recipe ) ; findViewById ( tomotos ) . setOnClickListener ( new View . OnClickListener ( ) { @ Override public void onClick ( View v ) { <START_BUG> findViewById ( tomotos_image ) . setVisibility ( VISIBLE ) ; <END_BUG> } } ) ; findViewById ( bonus_button ) . setOnClickListener ( new View . OnClickListener ( ) { @ Override public void onClick ( View v ) { startBonusActivity ( ) ; } } ) ; } private void startBonusActivity ( ) { } }

Fix:
findViewById ( tomago_recipe ) . setVisibility ( VISIBLE ) ;
Buggy code:
public class EditCapacityController extends Controller < EditCapacityView > { public EditCapacityController ( EditCapacityView view ) { } @ Override String getTitle ( ) { } public void updateCapacity ( ) { Unit unit = ( ( Unit ) ( Cache . getInstance ( ) . retrieve ( "unit" ) ) ) ; try { unit . setAvailableBeds ( Integer . parseInt ( view . getAvailableBedsUiElement ( ) . getValue ( ) ) ) ; unit . setPotentialDc ( Integer . parseInt ( view . getPotentialDcUiElement ( ) . getValue ( ) ) ) ; unit . setDcByDeadline ( Integer . parseInt ( view . getDcByDeadlineUiElement ( ) . getValue ( ) ) ) ; unit . setTotalAdmits ( Integer . parseInt ( view . getTotalAdmitsUiElement ( ) . getValue ( ) ) ) ; unit . setAdmitsByDeadline ( Integer . parseInt ( view . getAdmitsByDeadlineUiElement ( ) . getValue ( ) ) ) ; } catch ( NumberFormatException e ) { } Service . updateOrSaveUnit ( unit ) ; <START_BUG> FACTORY . newDispatcher ( ) . goToCapacityOverview ( ) ; <END_BUG> } }

Fix:
FACTORY . newDispatcher ( ) . goToCapacityOverview ( this ) ;
Buggy code:
public class PropertyRule implements Rule < JDefinedClass , JDefinedClass > { private final RuleFactory ruleFactory ; protected PropertyRule ( RuleFactory ruleFactory ) { } @ Override public JDefinedClass apply ( String nodeName , JsonNode node , JDefinedClass jclass , Schema schema ) { } private JsonNode resolveRefs ( JsonNode node , Schema parent ) { } private boolean isObject ( JsonNode node ) { } private boolean isArrayOfObjects ( JsonNode node , Schema parent ) { } private JMethod addGetter ( JDefinedClass c , JFieldVar field , String jsonPropertyName ) { } private JMethod addSetter ( JDefinedClass c , JFieldVar field , String jsonPropertyName ) { } private JMethod addBuilder ( JDefinedClass c , JFieldVar field ) { } private String getPropertyName ( String nodeName ) { nodeName = ruleFactory . getNameHelper ( ) . replaceIllegalCharacters ( nodeName ) ; <START_BUG> nodeName = ruleFactory . getNameHelper ( ) . normalizeName ( nodeName ) ; <END_BUG> if ( SourceVersion . isKeyword ( nodeName ) ) { nodeName = "_" + nodeName ; } if ( SourceVersion . isKeyword ( nodeName ) ) { nodeName += "_" ; } return nodeName ; } private String getSetterName ( String propertyName ) { } private String getBuilderName ( String propertyName ) { } private String getGetterName ( String propertyName , JType type ) { } }

Fix:
nodeName = ruleFactory . getNameHelper ( ) . normalizeName ( nodeName , false ) ;
Buggy code:
public class Compiler implements ITypeRequestor , ProblemSeverities { public Parser parser ; ICompilerRequestor requestor ; public CompilerOptions options ; public ProblemReporter problemReporter ; CompilationUnitDeclaration [ ] unitsToProcess ; int totalUnits ; public LookupEnvironment lookupEnvironment ; public static boolean DEBUG = false ; public int parseThreshold = - 1 ; public static IDebugRequestor DebugRequestor = null ; public Compiler ( INameEnvironment environment , IErrorHandlingPolicy policy , Map settings , final ICompilerRequestor requestor , IProblemFactory problemFactory ) { } public Compiler ( INameEnvironment environment , IErrorHandlingPolicy policy , Map settings , final ICompilerRequestor requestor , IProblemFactory problemFactory , boolean parseLiteralExpressionsAsConstants ) { } public void accept ( IBinaryType binaryType , PackageBinding packageBinding ) { } public void accept ( ICompilationUnit sourceUnit ) { } public void accept ( ISourceType [ ] sourceTypes , PackageBinding packageBinding ) { } protected void addCompilationUnit ( ICompilationUnit sourceUnit , CompilationUnitDeclaration parsedUnit ) { } protected void beginToCompile ( ICompilationUnit [ ] sourceUnits ) { } public void compile ( ICompilationUnit [ ] sourceUnits ) { } protected void getMethodBodies ( CompilationUnitDeclaration unit , int place ) { if ( unit . ignoreMethodBodies ) { unit . ignoreFurtherInvestigation = true ; return ; } if ( place < ( parseThreshold ) ) return ; <START_BUG> parser . scanner . setSourceBuffer ( unit . compilationResult . compilationUnit . getContents ( ) ) ; <END_BUG> if ( ( unit . types ) != null ) { for ( int i = unit . types . length ; ( -- i ) >= 0 ; ) unit . types [ i ] . parseMethod ( parser , unit ) ; } } protected void handleInternalException ( Throwable internalException , CompilationUnitDeclaration unit , CompilationResult result ) { } protected void handleInternalException ( org . eclipse . jdt . internal . compiler . problem . AbortCompilation abortException , CompilationUnitDeclaration unit ) { } private void process ( CompilationUnitDeclaration unit , int i ) { } public void reset ( ) { } public CompilationUnitDeclaration resolve ( ICompilationUnit sourceUnit ) { } }

Fix:
parser . scanner . setSource ( unit . compilationResult . compilationUnit . getContents ( ) ) ;
Buggy code:
public class InteractiveMapActivity extends ActionBarActivity { private static final String TAG = "InteractiveMap" ; public static final int FILTER_REQUEST = 1 ; private GoogleMap mMap ; private List < Observation > mObservations ; private LatLng mLastMapPosition ; private LatLng mLastUserPosition ; private Map < Marker , Observation > mMarkerObservationMap ; private GoogleApiClient mGoogleApiClient ; private SearchFilter mSearchFilter ; @ Override protected void onCreate ( Bundle savedInstanceState ) { } @ Override protected void onResume ( ) { } @ Override protected void onStop ( ) { } @ Override protected void onRestart ( ) { } @ Override public boolean onCreateOptionsMenu ( Menu menu ) { } @ Override public boolean onOptionsItemSelected ( MenuItem item ) { } @ Override protected void onActivityResult ( int requestCode , int resultCode , Intent data ) { } private void setUpMapIfNeeded ( ) { } private void setUpMap ( ) { } private void buildGoogleApiClient ( ) { } class LocationConnectionCallbacks implements GoogleApiClient . ConnectionCallbacks { @ Override public void onConnected ( Bundle connectionHint ) { Location loc = FusedLocationApi . getLastLocation ( mGoogleApiClient ) ; if ( loc != null ) { mLastMapPosition = new LatLng ( loc . getLatitude ( ) , loc . getLongitude ( ) ) ; mLastUserPosition = new LatLng ( loc . getLatitude ( ) , loc . getLongitude ( ) ) ; } else { <START_BUG> mLastMapPosition = new LatLng ( 0.0 , 0.0 ) ; <END_BUG> mLastUserPosition = null ; } mMap . moveCamera ( CameraUpdateFactory . newLatLngZoom ( mLastMapPosition , 15.0F ) ) ; } @ Override public void onConnectionSuspended ( int cause ) { } } private LatLngBounds getScreenBoundingBox ( ) { } private void showObservations ( SearchFilter sf ) { } class GetObservationsTask extends AsyncTask < LatLngBounds , Void , ArrayList < Observation > > { protected ArrayList < Observation > doInBackground ( LatLngBounds ... latLngBounds ) { } protected void onPostExecute ( ArrayList < Observation > result ) { } } class ImageInfoWindowAdapter implements InfoWindowAdapter { @ Override public View getInfoContents ( final Marker marker ) { } @ Override public View getInfoWindow ( Marker marker ) { } } private class InfoWindowRefresher implements Callback { private Marker mMarkerToRefresh ; private InfoWindowRefresher ( Marker markerToRefresh ) { } @ Override public void onSuccess ( ) { } @ Override public void onError ( ) { } } }

Fix:
mLastMapPosition = new LatLng ( 33.2 , ( - 87.5 ) ) ;
Buggy code:
public class ResponseTimeTest { @ Before public void setUp ( ) throws ConfigurationException { Config config = mock ( Config . class ) ; Config . setInstance ( config ) ; when ( config . getAppId ( ) ) . thenReturn ( "myApp" ) ; when ( config . getDdaUrl ( ) ) . thenReturn ( "whatever" ) ; when ( config . getKbUrl ( ) ) . thenReturn ( "http:////localhost:3030" ) ; when ( config . isStartSyncingWithKB ( ) ) . thenReturn ( false ) ; <START_BUG> AppDataCollectorFactory . init ( "it.polimi.modaclouds" ) ; <END_BUG> } @ Test public void test ( ) throws Exception { } @ Monitor ( type = "register" ) private void register ( ) throws InterruptedException { } @ Monitor ( type = "outgoingCall" ) @ ExternalCall private void outgoingCall ( ) throws InterruptedException { } @ Monitor ( type = "unreachableOutgoingCall" ) private void unreachableOutgoingCall ( ) throws InterruptedException { } }

Fix:
AppDataCollectorFactory . init ( ) ;
Buggy code:
public class WicketServlet extends HttpServlet { private static final long serialVersionUID = 1L ; private static final Logger log = LoggerFactory . getLogger ( WicketServlet . class ) ; protected WicketFilter wicketFilter ; @ Override public final void doGet ( final HttpServletRequest servletRequest , final HttpServletResponse servletResponse ) throws IOException , ServletException { } @ Override public final void doPost ( final HttpServletRequest servletRequest , final HttpServletResponse servletResponse ) throws IOException , ServletException { } private void fallback ( HttpServletRequest request , HttpServletResponse response ) throws IOException { ServletWebRequest req = new ServletWebRequest ( request ) ; <START_BUG> String url = req . getURL ( ) ; <END_BUG> if ( ( url . indexOf ( '?' ) ) != ( - 1 ) ) { url = Strings . beforeFirst ( url , '?' ) ; } if ( ( ( ( url . length ( ) ) > 0 ) && ( ( url . charAt ( 0 ) ) != '//' ) ) || ( ( url . length ( ) ) == 0 ) ) { url = '//' + url ; } InputStream stream = getServletContext ( ) . getResourceAsStream ( url ) ; String mimeType = getServletContext ( ) . getMimeType ( url ) ; if ( stream == null ) { response . sendError ( SC_NOT_FOUND ) ; } else { if ( mimeType != null ) { response . setContentType ( mimeType ) ; } Streams . copy ( stream , response . getOutputStream ( ) ) ; } } @ Override public void init ( ) throws ServletException { } protected WicketFilter newWicketFilter ( ) { } @ Override public void destroy ( ) { } @ Override protected long getLastModified ( final HttpServletRequest servletRequest ) { } }

Fix:
String url = req . getUrl ( ) . toString ( ) ;
Buggy code:
public class Unavailable extends HttpServlet { static int attempt = 0 ; public void init ( ServletConfig conf ) throws ServletException { System . out . println ( "Try<seq2seq4repair_space>to<seq2seq4repair_space>init<seq2seq4repair_space>" ) ; ( Unavailable . attempt ) ++ ; if ( ( Unavailable . attempt ) < 2 ) <START_BUG> throw new UnavailableException ( 10 , this , "Testing<seq2seq4repair_space>" ) ; <END_BUG> System . out . println ( "Init<seq2seq4repair_space>ok<seq2seq4repair_space>" ) ; } public void service ( HttpServletRequest req , HttpServletResponse res ) throws IOException { } }

Fix:
throw new UnavailableException ( "Testing<seq2seq4repair_space>" , 10 ) ;
Buggy code:
public class QualifiedType extends Type { int index ; public static final ChildPropertyDescriptor QUALIFIER_PROPERTY = new ChildPropertyDescriptor ( QualifiedType . class , "qualifier" , Type . class , ASTNode . MANDATORY , ASTNode . CYCLE_RISK ) ; public static final ChildPropertyDescriptor NAME_PROPERTY = new ChildPropertyDescriptor ( QualifiedType . class , "name" , SimpleName . class , ASTNode . MANDATORY , ASTNode . NO_CYCLE_RISK ) ; private static final List PROPERTY_DESCRIPTORS ; public static List propertyDescriptors ( int apiLevel ) { } private Type qualifier = null ; private SimpleName name = null ; QualifiedType ( AST ast ) { } final List internalStructuralPropertiesForType ( int apiLevel ) { } final ASTNode internalGetSetChildProperty ( ChildPropertyDescriptor property , boolean get , ASTNode child ) { } final int getNodeType0 ( ) { } ASTNode clone0 ( AST target ) { QualifiedType result = new QualifiedType ( target ) ; <START_BUG> result . setSourceRange ( this . getStartPosition ( ) , this . getLength ( ) ) ; <END_BUG> result . setQualifier ( ( ( Type ) ( ( ( ASTNode ) ( getQualifier ( ) ) ) . clone ( target ) ) ) ) ; result . setName ( ( ( SimpleName ) ( ( ( ASTNode ) ( getName ( ) ) ) . clone ( target ) ) ) ) ; return result ; } final boolean subtreeMatch0 ( ASTMatcher matcher , Object other ) { } void accept0 ( ASTVisitor visitor ) { } public Type getQualifier ( ) { } public void setQualifier ( Type type ) { } public SimpleName getName ( ) { } public void setName ( SimpleName name ) { } int memSize ( ) { } int treeSize ( ) { } }

Fix:
result . setSourceRange ( getStartPosition ( ) , getLength ( ) ) ;
Buggy code:
public class SignUp_Endpoint_Communicator extends AsyncTask < Pair < Context , UserinfoModel > , Void , ResponseMessages > { private Context maincontext ; private UserinfoModelApi userinfo_api ; private UserinfoModel userdata ; private SignUp_Endpoint_Communicator . manipulate_Signup ms ; @ Override protected ResponseMessages doInBackground ( Pair < Context , UserinfoModel > ... params ) { if ( ( userinfo_api ) == null ) { <START_BUG> UserinfoModelApi . Builder builder = new UserinfoModelApi . Builder ( com . google . api . client . extensions . android . http . AndroidHttp . newCompatibleTransport ( ) , new com . google . api . client . extensions . android . json . AndroidJsonFactory ( ) , null ) . setRootUrl ( "http:////10.0.2.2:8080//_ah//api//" ) . setGoogleClientRequestInitializer ( new GoogleClientRequestInitializer ( ) { <END_BUG> @ Override public void initialize ( AbstractGoogleClientRequest < ? > abstractGoogleClientRequest ) throws IOException { abstractGoogleClientRequest . setDisableGZipContent ( true ) ; } } ) ; userinfo_api = builder . build ( ) ; } maincontext = params [ 0 ] . first ; userdata = params [ 0 ] . second ; try { ResponseMessages response = new ResponseMessages ( ) ; response = userinfo_api . setUserInfo ( userdata ) . execute ( ) ; return response ; } catch ( IOException e ) { e . printStackTrace ( ) ; return null ; } } protected void onPostExecute ( ResponseMessages response ) { } public interface manipulate_Signup { public void setResponseMessage ( ResponseMessages response ) { } } }

Fix:
UserinfoModelApi . Builder builder = new UserinfoModelApi . Builder ( com . google . api . client . extensions . android . http . AndroidHttp . newCompatibleTransport ( ) , new com . google . api . client . extensions . android . json . AndroidJsonFactory ( ) , null ) . setRootUrl ( "http:////10.0.3.2:8080//_ah//api//" ) . setGoogleClientRequestInitializer ( new GoogleClientRequestInitializer ( ) {
Buggy code:
public class PersistentBundleInstallService extends AbstractService < Void > { static final ServiceName SERVICE_NAME_BASE = OSGiConstants . SERVICE_BASE_NAME . append ( "persistent" , "bundle" , "install" ) ; private final InjectedValue < BundleManager > injectedBundleManager = new InjectedValue < BundleManager > ( ) ; private final InjectedValue < StorageStateProvider > injectedStorageProvider = new InjectedValue < StorageStateProvider > ( ) ; private final InitialDeploymentTracker deploymentTracker ; private final Deployment deployment ; private PersistentBundleInstallService ( InitialDeploymentTracker deploymentTracker , Deployment deployment ) { } public static ServiceName addService ( InitialDeploymentTracker deploymentTracker , DeploymentPhaseContext phaseContext , Deployment deployment ) { } private static ServiceName getServiceName ( DeploymentUnit depUnit ) { } public synchronized void start ( StartContext context ) throws StartException { ServiceController < ? > controller = context . getController ( ) ; <START_BUG> OSGiLogger . LOGGER . debugf ( "Starting:<seq2seq4repair_space>%s<seq2seq4repair_space>in<seq2seq4repair_space>mode<seq2seq4repair_space>%s" , controller . getName ( ) , controller . getMode ( ) ) ; <END_BUG> try { BundleManager bundleManager = injectedBundleManager . getValue ( ) ; StorageStateProvider storageStateProvider = injectedStorageProvider . getValue ( ) ; StorageState storageState = storageStateProvider . getByLocation ( deployment . getLocation ( ) ) ; if ( storageState != null ) { deployment . addAttachment ( StorageState . class , storageState ) ; } ServiceListener < Bundle > listener = deploymentTracker . getBundleInstallListener ( ) ; bundleManager . installBundle ( deployment , listener ) ; } catch ( Throwable th ) { throw OSGiMessages . MESSAGES . startFailedToInstallDeployment ( th , deployment ) ; } } }

Fix:
OSGiLogger . LOGGER . tracef ( "Starting:<seq2seq4repair_space>%s<seq2seq4repair_space>in<seq2seq4repair_space>mode<seq2seq4repair_space>%s" , controller . getName ( ) , controller . getMode ( ) ) ;
Buggy code:
public class SqlDateConverter extends AbstractConverter < Date > { private static final long serialVersionUID = 1L ; public Date convertToObject ( final String value , Locale locale ) { if ( ( value == null ) || ( Strings . isEmpty ( value ) ) ) { return null ; } else { <START_BUG> return new Date ( ( ( java . util . Date ) ( parse ( getDateFormat ( locale ) , value , locale ) ) ) . getTime ( ) ) ; <END_BUG> } } @ Override public String convertToString ( final Date value , Locale locale ) { } public DateFormat getDateFormat ( Locale locale ) { } @ Override protected Class < Date > getTargetType ( ) { } }

Fix:
return new Date ( parse ( getDateFormat ( locale ) , value , locale ) . getTime ( ) ) ;
Buggy code:
public abstract class AbstractPageableView extends OrderedRepeatingView implements IPageable { private int itemsPerPage = Integer . MAX_VALUE ; private int currentPage ; private int cachedItemCount ; private IItemReuseStrategy itemReuseStrategy ; public AbstractPageableView ( String id , IModel model ) { } public AbstractPageableView ( String id ) { } protected void internalOnBeginRequest ( ) { } protected void addItems ( Iterator items ) { } public Iterator getItems ( ) { } protected abstract Iterator getItemModels ( int offset , int size ) { } public IItemReuseStrategy getItemReuseStrategy ( ) { } public void setItemReuseStrategy ( IItemReuseStrategy strategy ) { } protected Item newItem ( final String id , int index , final IModel model ) { } protected abstract void populateItem ( final Item item ) { } private void clearCachedItemCount ( ) { } private void setCachedItemCount ( int itemCount ) { } private int getCachedItemCount ( ) { } private boolean isItemCountCached ( ) { } protected final int internalGetItemsPerPage ( ) { } protected final void internalSetItemsPerPage ( int items ) { } protected abstract int internalGetItemCount ( ) { } public final int getItemCount ( ) { } public final int getCurrentPage ( ) { } public final void setCurrentPage ( int page ) { if ( ( page < 0 ) || ( page > ( getPageCount ( ) ) ) ) { <START_BUG> throw new IndexOutOfBoundsException ( ) ; <END_BUG> } if ( ( currentPage ) != page ) { addStateChange ( new Change ( ) { private static final long serialVersionUID = 1L ; private final int old = currentPage ; public void undo ( ) { currentPage = old ; } } ) ; } currentPage = page ; } public final int getPageCount ( ) { } protected int getViewOffset ( ) { } protected int getViewSize ( ) { } private static class CappedIteratorAdapter implements Iterator { private int max ; private int index ; private Iterator delegate ; public CappedIteratorAdapter ( Iterator delegate , int max ) { } public void remove ( ) { } public boolean hasNext ( ) { } public Object next ( ) { } } }

Fix:
throw new IndexOutOfBoundsException ( ( ( ( "argument<seq2seq4repair_space>[page]=" + page ) + ",<seq2seq4repair_space>must<seq2seq4repair_space>be<seq2seq4repair_space>0<=page<=" ) + ( getPageCount ( ) ) ) ) ;
Buggy code:
public class MapController { private MapRenderModel mapModel ; private MapRenderView mapView ; public MapController ( int screenResolutionWidth , int screenResolutionHeight ) { } public MapRenderView getView ( ) { } public void updateView ( int [ ] coords ) { int [ ] cellCoords = new int [ ] { coords [ 0 ] , coords [ 1 ] } ; int [ ] roomCoords = new int [ ] { coords [ 2 ] , coords [ 3 ] } ; int [ ] currentRoom = mapModel . getCurrentRoom ( ) ; if ( ( ( roomCoords [ 0 ] ) != ( currentRoom [ 0 ] ) ) || ( ( roomCoords [ 1 ] ) != ( currentRoom [ 1 ] ) ) ) { <START_BUG> mapModel . updateMapRenderModel ( roomCoords [ 0 ] , roomCoords [ 1 ] , "overworld" ) ; <END_BUG> mapView . updateMapRenderView ( ) ; } else if ( mapModel . isLink ( cellCoords [ 0 ] , cellCoords [ 1 ] ) ) { mapModel . updateMapRenderModel ( roomCoords [ 0 ] , roomCoords [ 1 ] , mapModel . linksTo ( cellCoords [ 0 ] , cellCoords [ 1 ] ) ) ; mapView . updateMapRenderView ( ) ; } } public boolean isWalkable ( int [ ] playerCoords ) { } }

Fix:
mapModel . updateMapRenderModel ( roomCoords [ 0 ] , roomCoords [ 1 ] , null ) ;
Buggy code:
public class Tengu extends Mob { private static final int JUMP_DELAY = 5 ; private int timeToJump = Tengu . JUMP_DELAY ; @ Override public int damageRoll ( ) { } @ Override public int attackSkill ( Char target ) { } @ Override public int dr ( ) { } @ Override public void die ( Object cause ) { } @ Override protected boolean getCloser ( int target ) { } @ Override protected boolean canAttack ( Char enemy ) { <START_BUG> return ( Ballistica . cast ( pos , enemy . pos , false , true ) ) == ( enemy . pos ) ; <END_BUG> } @ Override protected boolean doAttack ( Char enemy ) { } private void jump ( ) { } @ Override public void notice ( ) { } @ Override public String description ( ) { } private static final HashSet < Class < ? > > RESISTANCES = new HashSet < Class < ? > > ( ) ; @ Override public HashSet < Class < ? > > resistances ( ) { } }

Fix:
return ( ( Ballistica . cast ( pos , enemy . pos , false , true ) ) == ( enemy . pos ) ) && ( ! ( isCharmedBy ( enemy ) ) ) ;
Buggy code:
public class DummyConsoleSourceContainer implements ISourceContainer { @ Override public Object getAdapter ( @ SuppressWarnings ( "rawtypes" ) Class adapter ) { } @ Override public void init ( ISourceLookupDirector director ) { } @ Override public Object [ ] findSourceElements ( String name ) throws CoreException { <START_BUG> if ( name . equals ( "rascal.console.dummy" ) ) { <END_BUG> return new Object [ ] { new IFileStore ( ) { @ Override public Object getAdapter ( @ SuppressWarnings ( "rawtypes" ) Class adapter ) { return null ; } @ Override public URI toURI ( ) { return null ; } @ Override public File toLocalFile ( int options , IProgressMonitor monitor ) throws CoreException { return null ; } @ Override public void putInfo ( IFileInfo info , int options , IProgressMonitor monitor ) throws CoreException { } @ Override public OutputStream openOutputStream ( int options , IProgressMonitor monitor ) throws CoreException { return null ; } @ Override public InputStream openInputStream ( int options , IProgressMonitor monitor ) throws CoreException { return null ; } @ Override public void move ( IFileStore destination , int options , IProgressMonitor monitor ) throws CoreException { } @ Override public IFileStore mkdir ( int options , IProgressMonitor monitor ) throws CoreException { return null ; } @ Override public boolean isParentOf ( IFileStore other ) { return false ; } @ Override public IFileStore getParent ( ) { return null ; } @ Override public String getName ( ) { return RascalSourceLookupParticipant . RASCAL_CONSOLE_DUMMY ; } @ Override public IFileSystem getFileSystem ( ) { return null ; } @ Override public IFileStore getFileStore ( IPath path ) { return null ; } @ Override public IFileStore getChild ( String name ) { return null ; } @ Override public IFileStore getChild ( IPath path ) { return null ; } @ Override public IFileInfo fetchInfo ( int options , IProgressMonitor monitor ) throws CoreException { return null ; } @ Override public IFileInfo fetchInfo ( ) { return null ; } @ Override public void delete ( int options , IProgressMonitor monitor ) throws CoreException { } @ Override public void copy ( IFileStore destination , int options , IProgressMonitor monitor ) throws CoreException { } @ Override public IFileStore [ ] childStores ( int options , IProgressMonitor monitor ) throws CoreException { return null ; } @ Override public String [ ] childNames ( int options , IProgressMonitor monitor ) throws CoreException { return null ; } @ Override public IFileInfo [ ] childInfos ( int options , IProgressMonitor monitor ) throws CoreException { return null ; } } } ; } return null ; } @ Override public String getName ( ) { } @ Override public ISourceContainer [ ] getSourceContainers ( ) throws CoreException { } @ Override public boolean isComposite ( ) { } @ Override public ISourceContainerType getType ( ) { } @ Override public void dispose ( ) { } }

Fix:
if ( ( name . equals ( "rascal.console.dummy" ) ) || ( name . startsWith ( "stdin:" ) ) ) {
Buggy code:
abstract class Member extends SourceRefElement implements IMember { protected Member ( int type , IJavaElement parent , String name ) { } protected static Object convertConstant ( Constant constant ) { } protected boolean equalsDOMNode ( IDOMNode node ) throws JavaModelException { } protected IMethod findCorrespondingMethod ( IMethod method , IMethod [ ] methods ) { String elementName = method . getElementName ( ) ; String [ ] parameters = method . getParameterTypes ( ) ; int paramLength = parameters . length ; String [ ] simpleNames = new String [ paramLength ] ; for ( int i = 0 ; i < paramLength ; i ++ ) { simpleNames [ i ] = Signature . getSimpleName ( Signature . toString ( parameters [ i ] ) ) ; } next : for ( int i = 0 , length = methods . length ; i < length ; i ++ ) { IMethod existingMethod = methods [ i ] ; if ( existingMethod . getElementName ( ) . equals ( elementName ) ) { String [ ] existingParams = existingMethod . getParameterTypes ( ) ; int existingParamLength = existingParams . length ; if ( existingParamLength == paramLength ) { for ( int j = 0 ; j < paramLength ; j ++ ) { String simpleName = Signature . getSimpleName ( Signature . toString ( existingParams [ j ] ) ) ; if ( ! ( simpleNames [ j ] . equals ( simpleName ) ) ) { <START_BUG> break next ; <END_BUG> } } return existingMethod ; } } } return null ; } public IClassFile getClassFile ( ) { } public IType getDeclaringType ( ) { } public int getFlags ( ) throws JavaModelException { } protected char getHandleMementoDelimiter ( ) { } public ISourceRange getNameRange ( ) throws JavaModelException { } public boolean isBinary ( ) { } public boolean isReadOnly ( ) { } public void offsetSourceRange ( int amount ) { } public String readableName ( ) { } public void triggerSourceEndOffset ( int amount , int nameStart , int nameEnd ) { } public void triggerSourceRangeOffset ( int amount , int nameStart , int nameEnd ) { } protected void updateNameRange ( int nameStart , int nameEnd ) { } }

Fix:
continue next ;
Buggy code:
public class ClearStatisticsHandler implements OperationStepHandler { private final List < StatisticsPlugin > stats ; public ClearStatisticsHandler ( StatisticsPlugin ... stats ) { } @ Override public void execute ( OperationContext context , ModelNode operation ) throws OperationFailedException { <START_BUG> if ( ( context . getType ( ) ) == ( Type . SERVER ) ) { <END_BUG> context . addStep ( new OperationStepHandler ( ) { public void execute ( OperationContext context , ModelNode operation ) throws OperationFailedException { for ( StatisticsPlugin statsPlugin : stats ) { statsPlugin . clear ( ) ; } context . completeStep ( ) ; } } , RUNTIME ) ; } context . completeStep ( ) ; } }

Fix:
if ( context . isNormalServer ( ) ) {
Buggy code:
public class ItNotification extends AbstractItemModel < ItNotification > { public static enum TYPE { LikeIt , Reply , ProductTag ; } private String refWhoMade ; private String refWhoMadeId ; private String type ; private String typeRefId ; private int imageNumber ; private int mainImageWidth ; private int mainImageHeight ; public ItNotification ( ) { } public ItNotification ( String whoMade , String whoMadeId , String refId , String refWhoMade , String refWhoMadeId , String content , ItNotification . TYPE type , int imageNumber , int mainImageWidth , int mainImageHeight ) { } public String getRefWhoMade ( ) { } public void setRefWhoMade ( String refWhoMade ) { } public String getRefWhoMadeId ( ) { } public void setRefWhoMadeId ( String refWhoMadeId ) { } public String getType ( ) { } public void setType ( String type ) { } public void fixType ( ItNotification . TYPE type ) { } public String getTypeRefId ( ) { } public void setTypeRefId ( String typeRefId ) { } public int getImageNumber ( ) { } public void setImageNumber ( int imageNumber ) { } public int getMainImageWidth ( ) { } public void setMainImageWidth ( int mainImageWidth ) { } public int getMainImageHeight ( ) { } public void setMainImageHeight ( int mainImageHeight ) { } public String notiContent ( ) { ItApplication app = ItApplication . getInstance ( ) ; ItUser myItUser = app . getObjectPrefHelper ( ) . get ( ItUser . class ) ; String refWhoMade = "" ; if ( getRefWhoMadeId ( ) . equals ( myItUser . getId ( ) ) ) { refWhoMade = app . getResources ( ) . getString ( my_item ) ; } else { <START_BUG> refWhoMade = ( getRefWhoMade ( ) ) + ( app . getResources ( ) . getString ( of_item ) ) ; <END_BUG> } String type = "" ; if ( getType ( ) . equals ( ItNotification . TYPE . LikeIt . toString ( ) ) ) { type = app . getResources ( ) . getString ( noti_like ) ; } else if ( getType ( ) . equals ( ItNotification . TYPE . Reply . toString ( ) ) ) { type = app . getResources ( ) . getString ( noti_reply ) ; } else if ( getType ( ) . equals ( ItNotification . TYPE . ProductTag . toString ( ) ) ) { type = app . getResources ( ) . getString ( noti_product_tag ) ; } String content = "" ; if ( getType ( ) . equals ( ItNotification . TYPE . ProductTag . toString ( ) ) ) { content = String . format ( Locale . US , app . getResources ( ) . getString ( noti_product_tag_content ) , refWhoMade , type ) ; } else { content = String . format ( Locale . US , app . getResources ( ) . getString ( noti_general_content ) , getWhoMade ( ) , refWhoMade , type ) ; } return content ; } public Item makeItem ( ) { } }

Fix:
refWhoMade = String . format ( Locale . US , app . getResources ( ) . getString ( of_item ) , getRefWhoMade ( ) ) ;
Buggy code:
public class SystemTable { private static Logger logger = LoggerFactory . getLogger ( SystemTable . class ) ; public static final String STATUS_CF = "LocationInfo" ; public static final String INDEX_CF = "IndexInfo" ; public static final String NODE_ID_CF = "NodeIdInfo" ; private static final ByteBuffer LOCATION_KEY = ByteBufferUtil . bytes ( "L" ) ; private static final ByteBuffer RING_KEY = ByteBufferUtil . bytes ( "Ring" ) ; private static final ByteBuffer BOOTSTRAP_KEY = ByteBufferUtil . bytes ( "Bootstrap" ) ; private static final ByteBuffer COOKIE_KEY = ByteBufferUtil . bytes ( "Cookies" ) ; private static final ByteBuffer BOOTSTRAP = ByteBufferUtil . bytes ( "B" ) ; private static final ByteBuffer TOKEN = ByteBufferUtil . bytes ( "Token" ) ; private static final ByteBuffer GENERATION = ByteBufferUtil . bytes ( "Generation" ) ; private static final ByteBuffer CLUSTERNAME = ByteBufferUtil . bytes ( "ClusterName" ) ; private static final ByteBuffer PARTITIONER = ByteBufferUtil . bytes ( "Partioner" ) ; private static final ByteBuffer CURRENT_LOCAL_NODE_ID_KEY = ByteBufferUtil . bytes ( "CurrentLocal" ) ; private static final ByteBuffer ALL_LOCAL_NODE_ID_KEY = ByteBufferUtil . bytes ( "Local" ) ; private static DecoratedKey decorate ( ByteBuffer key ) { } public static void purgeIncompatibleHints ( ) throws IOException { } public static synchronized void updateToken ( InetAddress ep , Token token ) { <START_BUG> if ( ep == ( FBUtilities . getBroadcastAddress ( ) ) ) <END_BUG> return ; IPartitioner p = StorageService . getPartitioner ( ) ; ColumnFamily cf = ColumnFamily . create ( SYSTEM_TABLE , SystemTable . STATUS_CF ) ; cf . addColumn ( new Column ( p . getTokenFactory ( ) . toByteArray ( token ) , ByteBuffer . wrap ( ep . getAddress ( ) ) , System . currentTimeMillis ( ) ) ) ; RowMutation rm = new RowMutation ( Table . SYSTEM_TABLE , SystemTable . RING_KEY ) ; rm . add ( cf ) ; try { rm . apply ( ) ; } catch ( IOException e ) { throw new IOError ( e ) ; } SystemTable . forceBlockingFlush ( SystemTable . STATUS_CF ) ; } public static synchronized void removeToken ( Token token ) { } public static synchronized void updateToken ( Token token ) { } private static void forceBlockingFlush ( String cfname ) { } public static HashMap < Token , InetAddress > loadTokens ( ) { } public static void checkHealth ( ) throws IOException , ConfigurationException { } public static Token getSavedToken ( ) { } public static int incrementAndGetGeneration ( ) throws IOException { } public static boolean isBootstrapped ( ) { } public static void setBootstrapped ( boolean isBootstrapped ) { } public static boolean isIndexBuilt ( String table , String indexName ) { } public static void setIndexBuilt ( String table , String indexName ) { } public static void setIndexRemoved ( String table , String indexName ) { } public static NodeId getCurrentLocalNodeId ( ) { } public static void writeCurrentLocalNodeId ( NodeId oldNodeId , NodeId newNodeId , long now ) { } public static List < NodeId . NodeIdRecord > getOldLocalNodeIds ( ) { } }

Fix:
if ( ep == ( FBUtilities . getLocalAddress ( ) ) )
Buggy code:
public class CDROutputStreamTest extends ORBTestCase { private CDROutputStream objectUnderTest ; @ Before public void setUp ( ) throws Exception { } @ After public void tearDown ( ) throws Exception { } @ Test public void testIncreaseSize ( ) { } @ Test public void testCDRStreamSizeCtor ( ) { <START_BUG> CDROutputStream co = new CDROutputStream ( orb , 1000 , false ) ; <END_BUG> co . increaseSize ( 8 ) ; byte [ ] result = co . releaseBuffer ( ) ; co . close ( ) ; assertTrue ( ( ( result . length ) == 1023 ) ) ; } @ Test public void testDefaultEncodingChar ( ) throws Exception { } @ Test public void testDefaultEncodingWChar ( ) throws Exception { } @ Test public void testUCS2EncodingWChar ( ) throws Exception { } @ Test public void testDefaultEncodingWCharGiop1_1 ( ) throws Exception { } @ Test public void testUTF8EncodingCharGiop1_1 ( ) throws Exception { } @ Test public void testUTF8EncodingWCharGiop1_1 ( ) throws Exception { } @ Test public void testUTF8EncodingWChar ( ) throws Exception { } private void selectCodeSets ( String charCodeSet , String wideCharCodeSet ) { } private static void assertEquals ( String comment , byte [ ] expected , byte [ ] actual ) { } private static final int BYTES_PER_GROUP = 8 ; private static final int GROUPS_PER_LINE = 8 ; private static final int BYTES_PER_LINE = ( CDROutputStreamTest . BYTES_PER_GROUP ) * ( CDROutputStreamTest . GROUPS_PER_LINE ) ; private static final int LAST_IN_GROUP = ( CDROutputStreamTest . BYTES_PER_GROUP ) - 1 ; private static void append ( StringBuffer sb , String comment , byte [ ] bytes ) { } private static void formatOneByte ( StringBuffer sb , byte aByte ) { } @ Test public void testDoesNotLikeNonJacORB ( ) { } }

Fix:
CDROutputStream co = new CDROutputStream ( orb , 1000 ) ;
Buggy code:
public class MyPoint extends Point2D { public double x ; public double y ; public boolean lineTo ; public MyPoint ( double x , double y , boolean lineTo ) { } public double distSqr ( double px , double py ) { } public boolean isEqual ( double px , double py ) { } @ Override public String toString ( ) { } public double distance ( MyPoint p ) { } public GeoPoint2 getGeoPoint ( Construction cons ) { } public boolean getLineTo ( ) { } @ Override public double getX ( ) { } @ Override public double getY ( ) { <START_BUG> return x ; <END_BUG> } @ Override public double distance ( double x1 , double y1 ) { } @ Override public void setX ( double x ) { } @ Override public void setY ( double y ) { } @ Override public double distance ( Point2D q ) { } }

Fix:
return y ;
Buggy code:
public class TestContainerSerializers extends HppcTestBase { public void testByteSerializer ( ) throws Exception { } public void testShortSerializer ( ) throws Exception { } public void testIntSerializer ( ) throws Exception { } public void testLongSerializer ( ) throws Exception { } public void testCharSerializer ( ) throws Exception { ObjectMapper mapper = mapperWithModule ( ) ; CharArrayList array = new CharArrayList ( ) ; array . add ( 'a' , 'b' , 'c' ) ; assertEquals ( "\"abc\"" , mapper . writeValueAsString ( array ) ) ; CharHashSet set = new CharHashSet ( ) ; set . addAll ( 'd' , 'e' ) ; String str = mapper . writeValueAsString ( set ) ; <START_BUG> if ( ( ! ( "[\"de\"]" . equals ( str ) ) ) && ( ! ( "\"ed\"" . equals ( str ) ) ) ) { <END_BUG> fail ( ( "Incorrect<seq2seq4repair_space>serialization:<seq2seq4repair_space>" + str ) ) ; } } public void testFloatSerializer ( ) throws Exception { } public void testDoubleSerializer ( ) throws Exception { } public void testObjectContainerSerializer ( ) throws Exception { } public void testBitSetSerializer ( ) throws Exception { } }

Fix:
if ( ( ! ( "\"de\"" . equals ( str ) ) ) && ( ! ( "\"ed\"" . equals ( str ) ) ) ) {
Buggy code:
public class TAMACallFlowControllerScenarioTest { private TAMATreeRegistry treeRegistry ; @ Mock private PillReminderService pillReminderService ; @ Mock private VoiceOutboxService voiceOutboxService ; @ Mock private TAMAIVRContextFactory contextFactory ; @ Mock private AllPatients allPatients ; @ Mock private KooKooIVRContext kooKooIVRContext ; @ Mock private PillRegimenSnapshot pillRegimenSnapshot ; private TAMACallFlowController callFlowController ; private TAMAIVRContextForTest ivrContext ; private PatientPreferences patientPreferences ; @ Before public void setUp ( ) { initMocks ( this ) ; <START_BUG> treeRegistry = new TAMATreeRegistry ( null , null , null , null , null , null , null ) ; <END_BUG> callFlowController = new TAMACallFlowController ( treeRegistry , pillReminderService , voiceOutboxService , allPatients , contextFactory ) ; ivrContext = new TAMAIVRContextForTest ( ) ; Patient patient = new Patient ( ) ; patientPreferences = new PatientPreferences ( ) ; patient . setPatientPreferences ( patientPreferences ) ; ivrContext . pillRegimenSnapshot ( pillRegimenSnapshot ) . patient ( patient ) . callState ( STARTED ) ; when ( contextFactory . create ( kooKooIVRContext ) ) . thenReturn ( ivrContext ) ; } private void callPreference ( CallPreference callPreference ) { } private void callDirection ( CallDirection callDirection ) { } private void currentDosageTaken ( boolean taken ) { } private void previousDosageCaptured ( boolean captured ) { } private void callState ( CallState callState ) { } private void assertURL ( String url ) { } private void assertTree ( String treeName ) { } private void treeComplete ( String tree ) { } private void messagesInOutbox ( int number ) { } @ Test public void OnPillReminder_OutgoingCall_CurrentDosageNotTaken__NotFeelingWell ( ) { } @ Test public void OnPillReminder_OutgoingCall_CurrentDosageNotTaken_PreviousDosageCaptured__ConfirmingCurrentDosage ( ) { } @ Test public void OnPillReminder_OutgoingCall_CurrentDosageNotTaken_PreviousDosageNotCaptured ( ) { } @ Test public void OnPillReminder_IncomingCall_CurrentDosageTaken ( ) { } }

Fix:
treeRegistry = new TAMATreeRegistry ( null , null , null , null , null , null , null , null ) ;