Program: 5440
Project: 5440
Buggy source:
/** 
 * Constructs a context. To have plugin support, the   {@code pluginInstantiator} must not be null.
 */
protected AbstractContext(Program program,ProgramOptions programOptions,CConfiguration cConf,Set<String> datasets,DatasetFramework dsFramework,TransactionSystemClient txClient,DiscoveryServiceClient discoveryServiceClient,boolean multiThreaded,@Nullable MetricsCollectionService metricsService,Map<String,String> metricsTags,SecureStore secureStore,SecureStoreManager secureStoreManager,MessagingService messagingService,@Nullable PluginInstantiator pluginInstantiator){
  super(program.getId());
  this.program=program;
  this.programOptions=programOptions;
  this.runId=ProgramRunners.getRunId(programOptions);
  this.discoveryServiceClient=discoveryServiceClient;
  this.owners=createOwners(program.getId());
  this.programMetrics=createProgramMetrics(program,runId,metricsService,metricsTags);
  this.userMetrics=new ProgramUserMetrics(programMetrics);
  this.retryStrategy=SystemArguments.getRetryStrategy(programOptions.getUserArguments().asMap(),program.getType(),cConf);
  Map<String,String> runtimeArgs=new HashMap<>(programOptions.getUserArguments().asMap());
  this.logicalStartTime=ProgramRunners.updateLogicalStartTime(runtimeArgs);
  this.runtimeArguments=Collections.unmodifiableMap(runtimeArgs);
  Map<String,Map<String,String>> staticDatasets=new HashMap<>();
  for (  String name : datasets) {
    staticDatasets.put(name,runtimeArguments);
  }
  SystemDatasetInstantiator instantiator=new SystemDatasetInstantiator(dsFramework,program.getClassLoader(),owners);
  this.messagingContext=new MultiThreadMessagingContext(messagingService);
  this.datasetCache=multiThreaded ? new MultiThreadDatasetCache(instantiator,txClient,new NamespaceId(program.getId().getNamespace()),runtimeArguments,programMetrics,staticDatasets,messagingContext) : new SingleThreadDatasetCache(instantiator,txClient,new NamespaceId(program.getId().getNamespace()),runtimeArguments,programMetrics,staticDatasets);
  this.pluginInstantiator=pluginInstantiator;
  this.pluginContext=new DefaultPluginContext(pluginInstantiator,program.getId(),program.getApplicationSpecification().getPlugins());
  this.admin=new DefaultAdmin(dsFramework,program.getId().getNamespaceId(),secureStoreManager,new BasicMessagingAdmin(messagingService,program.getId().getNamespaceId()),retryStrategy);
  this.secureStore=secureStore;
  this.defaultTxTimeout=determineTransactionTimeout(cConf);
  this.transactional=Transactions.createTransactional(getDatasetCache(),defaultTxTimeout);
  if (!multiThreaded) {
    datasetCache.addExtraTransactionAware(messagingContext);
  }
}

Fixed version (ground truth):
/** 
 * Constructs a context. To have plugin support, the   {@code pluginInstantiator} must not be null.
 */
protected AbstractContext(Program program,ProgramOptions programOptions,CConfiguration cConf,Set<String> datasets,DatasetFramework dsFramework,TransactionSystemClient txClient,DiscoveryServiceClient discoveryServiceClient,boolean multiThreaded,@Nullable MetricsCollectionService metricsService,Map<String,String> metricsTags,SecureStore secureStore,SecureStoreManager secureStoreManager,MessagingService messagingService,@Nullable PluginInstantiator pluginInstantiator){
  super(program.getId());
  this.program=program;
  this.programOptions=programOptions;
  this.runId=ProgramRunners.getRunId(programOptions);
  this.discoveryServiceClient=discoveryServiceClient;
  this.owners=createOwners(program.getId());
  this.programMetrics=createProgramMetrics(program,runId,metricsService,metricsTags);
  this.userMetrics=new ProgramUserMetrics(programMetrics);
  this.retryStrategy=SystemArguments.getRetryStrategy(programOptions.getUserArguments().asMap(),program.getType(),cConf);
  Map<String,String> runtimeArgs=new HashMap<>(programOptions.getUserArguments().asMap());
  this.logicalStartTime=ProgramRunners.updateLogicalStartTime(runtimeArgs);
  this.runtimeArguments=Collections.unmodifiableMap(runtimeArgs);
  Map<String,Map<String,String>> staticDatasets=new HashMap<>();
  for (  String name : datasets) {
    staticDatasets.put(name,runtimeArguments);
  }
  SystemDatasetInstantiator instantiator=new SystemDatasetInstantiator(dsFramework,program.getClassLoader(),owners);
  this.messagingContext=new MultiThreadMessagingContext(messagingService);
  TransactionSystemClient retryingTxClient=new RetryingShortTransactionSystemClient(txClient,retryStrategy);
  this.datasetCache=multiThreaded ? new MultiThreadDatasetCache(instantiator,retryingTxClient,new NamespaceId(program.getId().getNamespace()),runtimeArguments,programMetrics,staticDatasets,messagingContext) : new SingleThreadDatasetCache(instantiator,retryingTxClient,new NamespaceId(program.getId().getNamespace()),runtimeArguments,programMetrics,staticDatasets);
  this.pluginInstantiator=pluginInstantiator;
  this.pluginContext=new DefaultPluginContext(pluginInstantiator,program.getId(),program.getApplicationSpecification().getPlugins());
  this.admin=new DefaultAdmin(dsFramework,program.getId().getNamespaceId(),secureStoreManager,new BasicMessagingAdmin(messagingService,program.getId().getNamespaceId()),retryStrategy);
  this.secureStore=secureStore;
  this.defaultTxTimeout=determineTransactionTimeout(cConf);
  this.transactional=Transactions.createTransactional(getDatasetCache(),defaultTxTimeout);
  if (!multiThreaded) {
    datasetCache.addExtraTransactionAware(messagingContext);
  }
}