nus-yam/ex-repair huggingface dataset:
Program: 62106
Project: 62106
Buggy source:
private Optional<DataHubKey> findFirstDifferentResult(DataHubKey inputKey,QueryResult<OrderedRows<String,String,DataHubCompositeValue>> queryResult){
  OrderedRows<String,String,DataHubCompositeValue> rows=queryResult.get();
  String inputKeyString=keyRenderer.keyToString(inputKey);
  for (  Row<String,String,DataHubCompositeValue> row : rows) {
    ColumnSlice<String,DataHubCompositeValue> columnSlice=row.getColumnSlice();
    Optional<DataHubKey> rowResult=findItemInRow(inputKeyString,columnSlice);
    if (rowResult.isPresent()) {
      return rowResult;
    }
  }
  return Optional.absent();
}

Fixed version (ground truth):
private Optional<DataHubKey> findFirstDifferentResult(DataHubKey inputKey,QueryResult<OrderedRows<String,String,DataHubCompositeValue>> queryResult,boolean reversed){
  OrderedRows<String,String,DataHubCompositeValue> rows=queryResult.get();
  List<Row<String,String,DataHubCompositeValue>> rowsList=rows.getList();
  ListIterator<Row<String,String,DataHubCompositeValue>> rowIterator=rowsList.listIterator(reversed ? rowsList.size() : 0);
  String inputKeyString=keyRenderer.keyToString(inputKey);
  while (canIterate(reversed,rowIterator)) {
    Row<String,String,DataHubCompositeValue> row=getRow(reversed,rowIterator);
    ColumnSlice<String,DataHubCompositeValue> columnSlice=row.getColumnSlice();
    Optional<DataHubKey> rowResult=findItemInRow(inputKeyString,columnSlice);
    if (rowResult.isPresent()) {
      return rowResult;
    }
  }
  return Optional.absent();
}
Program: 62107
Project: 62107
Buggy source:
private Optional<DataHubKey> queryAndFindResult(String channelName,DataHubKey key,DataHubKey maxKey,boolean reversed){
  QueryResult<OrderedRows<String,String,DataHubCompositeValue>> queryResult=queryRange(channelName,key,maxKey,reversed);
  return findFirstDifferentResult(key,queryResult);
}

Fixed version (ground truth):
private Optional<DataHubKey> queryAndFindResult(String channelName,DataHubKey key,DataHubKey maxKey,boolean reversed){
  QueryResult<OrderedRows<String,String,DataHubCompositeValue>> queryResult=queryRange(channelName,key,maxKey,reversed);
  return findFirstDifferentResult(key,queryResult,reversed);
}
Program: 62109
Project: 62109
Buggy source:
public void Generate(boolean emptyFirst){
  if (!hasGenerated) {
    try {
      ApplicationDao daoApp=getDatabaseHelper().getApplicationDao();
      NotificationItemDao daoNtf=getDatabaseHelper().getNotificationDao();
      if (emptyFirst) {
        TableUtils.clearTable(getDatabaseHelper().getConnectionSource(),Application.class);
        TableUtils.clearTable(getDatabaseHelper().getConnectionSource(),NotificationItem.class);
      }
      for (      AppMock app : apps) {
        daoApp.create(app.application);
      }
      for (int i=0; i < 5000; i++) {
        AppMock a=GenerateApplication();
        NotificationItem ntf=new NotificationItem(a.application.getPackageName(),dates.get(i),GenerateApplicationMessage(a));
        daoNtf.create(ntf);
      }
    }
 catch (    SQLException e) {
      e.printStackTrace();
    }
    this.close();
  }
 else {
    hasGenerated=true;
  }
}

Fixed version (ground truth):
public void Generate(boolean emptyFirst){
  if (!hasGenerated) {
    try {
      ApplicationDao daoApp=getDatabaseHelper().getApplicationDao();
      NotificationItemDao daoNtf=getDatabaseHelper().getNotificationDao();
      if (emptyFirst) {
        TableUtils.clearTable(getDatabaseHelper().getConnectionSource(),Application.class);
        TableUtils.clearTable(getDatabaseHelper().getConnectionSource(),NotificationItem.class);
      }
      for (      AppMock app : apps) {
        daoApp.create(app.application);
      }
      for (int i=0; i < notificationsAmount; i++) {
        AppMock a=GenerateApplication();
        NotificationItem ntf=new NotificationItem(a.application.getPackageName(),dates.get(i),GenerateApplicationMessage(a));
        daoNtf.create(ntf);
      }
    }
 catch (    SQLException e) {
      e.printStackTrace();
    }
    this.close();
  }
 else {
    hasGenerated=true;
  }
}
Program: 62111
Project: 62111
Buggy source:
/** 
 * enables intercept touchevents
 */
public void enableScroll(){
  ViewParent parent=getParent();
  parent.requestDisallowInterceptTouchEvent(false);
}

Fixed version (ground truth):
/** 
 * enables intercept touchevents
 */
public void enableScroll(){
  ViewParent parent=getParent();
  try {
    parent.requestDisallowInterceptTouchEvent(false);
  }
 catch (  NullPointerException e) {
  }
}
Program: 62113
Project: 62113
Buggy source:
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  historyPagerAdapter=new HistoryPagerAdapter(getFragmentManager());
  mViewPager=(ViewPager)findViewById(R.id.pager);
  mViewPager.setOffscreenPageLimit(3);
  mViewPager.setAdapter(historyPagerAdapter);
  mViewPager.setOnPageChangeListener(new ViewPager.SimpleOnPageChangeListener(){
    @Override public void onPageSelected(    int position){
      super.onPageSelected(position);
      getActionBar().setSelectedNavigationItem(position);
    }
  }
);
  ActionBar actionBar=getActionBar();
  actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);
  ActionBar.TabListener tabListener=new ActionBar.TabListener(){
    @Override public void onTabSelected(    ActionBar.Tab tab,    FragmentTransaction fragmentTransaction){
      setCurrentItem(tab.getPosition());
    }
    @Override public void onTabUnselected(    ActionBar.Tab tab,    FragmentTransaction fragmentTransaction){
    }
    @Override public void onTabReselected(    ActionBar.Tab tab,    FragmentTransaction fragmentTransaction){
    }
  }
;
  ActionBar.Tab tabDaily=actionBar.newTab().setText(R.string.history_daily).setTabListener(tabListener);
  ActionBar.Tab tabWeekly=actionBar.newTab().setText(R.string.history_weekly).setTabListener(tabListener);
  ActionBar.Tab tabMonthly=actionBar.newTab().setText(R.string.history_monthly).setTabListener(tabListener);
  actionBar.addTab(tabDaily);
  actionBar.addTab(tabWeekly);
  actionBar.addTab(tabMonthly);
}

Fixed version (ground truth):
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  ActionBar actionBar=getActionBar();
  actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);
  ActionBar.TabListener tabListener=new ActionBar.TabListener(){
    @Override public void onTabSelected(    ActionBar.Tab tab,    FragmentTransaction fragmentTransaction){
      int position=tab.getPosition();
      if (position == 0) {
        fragmentTransaction.replace(R.id.frame_layout,dailyFrag);
      }
 else       if (position == 1) {
        fragmentTransaction.replace(R.id.frame_layout,weeklyFrag);
      }
 else       if (position == 2) {
        fragmentTransaction.replace(R.id.frame_layout,monthlyFrag);
      }
    }
    @Override public void onTabUnselected(    ActionBar.Tab tab,    FragmentTransaction fragmentTransaction){
    }
    @Override public void onTabReselected(    ActionBar.Tab tab,    FragmentTransaction fragmentTransaction){
    }
  }
;
  ActionBar.Tab tabDaily=actionBar.newTab().setText(R.string.history_daily).setTabListener(tabListener);
  ActionBar.Tab tabWeekly=actionBar.newTab().setText(R.string.history_weekly).setTabListener(tabListener);
  ActionBar.Tab tabMonthly=actionBar.newTab().setText(R.string.history_monthly).setTabListener(tabListener);
  actionBar.addTab(tabDaily);
  actionBar.addTab(tabWeekly);
  actionBar.addTab(tabMonthly);
}
Program: 62114
Project: 62114
Buggy source:
@Override public void onTabSelected(ActionBar.Tab tab,FragmentTransaction fragmentTransaction){
  setCurrentItem(tab.getPosition());
}

Fixed version (ground truth):
@Override public void onTabSelected(ActionBar.Tab tab,FragmentTransaction fragmentTransaction){
  int position=tab.getPosition();
  if (position == 0) {
    fragmentTransaction.replace(R.id.frame_layout,dailyFrag);
  }
 else   if (position == 1) {
    fragmentTransaction.replace(R.id.frame_layout,weeklyFrag);
  }
 else   if (position == 2) {
    fragmentTransaction.replace(R.id.frame_layout,monthlyFrag);
  }
}
Program: 62115
Project: 62115
Buggy source:
public HistoryViewPagerActivity(){
  super(R.layout.viewpager_history);
}

Fixed version (ground truth):
public HistoryViewPagerActivity(){
  super(R.layout.viewpager_history);
  dailyFrag=new HistoryDailyFragment();
  weeklyFrag=new HistoryWeeklyFragment();
  monthlyFrag=new HistoryMonthlyFragment();
}
Program: 62116
Project: 62116
Buggy source:
public HistoryFragment(int layoutId){
  this.layoutId=layoutId;
}

Fixed version (ground truth):
public HistoryFragment(){
  this.layoutId=R.layout.fragment_history;
  this.paintWhite.setColor(Color.WHITE);
}
Program: 62118
Project: 62118
Buggy source:
@Override public List<NotificationAppView> getOverviewWeek(Date date) throws SQLException {
  DateFormat df=new SimpleDateFormat("String_Node_Str");
  String dateString=df.format(date);
  String rawQuery="String_Node_Str" + NotificationItem.FIELD_PACKAGE_NAME + "String_Node_Str"+ NotificationItem.FIELD_TABLE_NAME+ "String_Node_Str"+ NotificationItem.FIELD_DATE+ "String_Node_Str"+ dateString+ "String_Node_Str"+ "String_Node_Str"+ NotificationItem.FIELD_PACKAGE_NAME+ "String_Node_Str"+ "String_Node_Str"+ Application.FIELD_PACKAGE_NAME+ "String_Node_Str"+ Application.FIELD_TABLE_NAME+ "String_Node_Str"+ Application.FIELD_IGNORE+ "String_Node_Str"+ "String_Node_Str"+ NotificationItem.FIELD_PACKAGE_NAME;
  return this.getOverviewGeneric(rawQuery);
}

Fixed version (ground truth):
@Override public List<NotificationAppView> getOverviewWeek(Date date) throws SQLException {
  Calendar cal=Calendar.getInstance();
  cal.setFirstDayOfWeek(Calendar.MONDAY);
  cal.setTime(date);
  cal.set(Calendar.DAY_OF_WEEK,cal.getFirstDayOfWeek());
  Date firstDayOfWeek=cal.getTime();
  cal.add(Calendar.DATE,6);
  Date lastDayOfWeek=cal.getTime();
  DateFormat df=new SimpleDateFormat("String_Node_Str");
  String dateStringFirstDay=df.format(firstDayOfWeek);
  String dateStringLastDay=df.format(lastDayOfWeek);
  String rawQuery="String_Node_Str" + NotificationItem.FIELD_PACKAGE_NAME + "String_Node_Str"+ NotificationItem.FIELD_TABLE_NAME+ "String_Node_Str"+ NotificationItem.FIELD_DATE+ "String_Node_Str"+ dateStringFirstDay+ "String_Node_Str"+ "String_Node_Str"+ NotificationItem.FIELD_DATE+ "String_Node_Str"+ dateStringLastDay+ "String_Node_Str"+ "String_Node_Str"+ NotificationItem.FIELD_PACKAGE_NAME+ "String_Node_Str"+ "String_Node_Str"+ Application.FIELD_PACKAGE_NAME+ "String_Node_Str"+ Application.FIELD_TABLE_NAME+ "String_Node_Str"+ Application.FIELD_IGNORE+ "String_Node_Str"+ "String_Node_Str"+ NotificationItem.FIELD_PACKAGE_NAME;
  return this.getOverviewGeneric(rawQuery);
}
Program: 62119
Project: 62119
Buggy source:
@Override public List<NotificationDayView> getSummaryLastDays() throws SQLException {
  LinkedList<NotificationDayView> list=new LinkedList<NotificationDayView>();
  GenericRawResults<String[]> rawResults=this.queryRaw("String_Node_Str" + NotificationItem.FIELD_DATE + "String_Node_Str"+ NotificationItem.FIELD_TABLE_NAME+ "String_Node_Str"+ NotificationItem.FIELD_DATE+ "String_Node_Str");
  List<String[]> results=rawResults.getResults();
  SimpleDateFormat formatter=new SimpleDateFormat("String_Node_Str");
  for (int i=0; i < results.size(); i++) {
    try {
      Date date=formatter.parse(results.get(i)[0]);
      Integer notifications=Integer.parseInt(results.get(i)[1]);
      list.add(new NotificationDayView(date,notifications));
    }
 catch (    ParseException e) {
      e.printStackTrace();
    }
  }
  return list;
}

Fixed version (ground truth):
@Override public List<NotificationDayView> getSummaryLastDays() throws SQLException {
  LinkedList<NotificationDayView> list=new LinkedList<NotificationDayView>();
  GenericRawResults<String[]> rawResults=this.queryRaw("String_Node_Str" + NotificationItem.FIELD_DATE + "String_Node_Str"+ NotificationItem.FIELD_TABLE_NAME+ "String_Node_Str"+ NotificationItem.FIELD_PACKAGE_NAME+ "String_Node_Str"+ "String_Node_Str"+ Application.FIELD_PACKAGE_NAME+ "String_Node_Str"+ Application.FIELD_TABLE_NAME+ "String_Node_Str"+ Application.FIELD_IGNORE+ "String_Node_Str"+ "String_Node_Str"+ NotificationItem.FIELD_DATE+ "String_Node_Str");
  List<String[]> results=rawResults.getResults();
  SimpleDateFormat formatter=new SimpleDateFormat("String_Node_Str");
  for (int i=0; i < results.size(); i++) {
    try {
      Date date=formatter.parse(results.get(i)[0]);
      Integer notifications=Integer.parseInt(results.get(i)[1]);
      list.add(new NotificationDayView(date,notifications));
    }
 catch (    ParseException e) {
      e.printStackTrace();
    }
  }
  return list;
}
Program: 62120
Project: 62120
Buggy source:
/** 
 * Try to resolve an artifact from all configured resolver plugins and repositories
 * @param artifactReference reference of the artifact inside the repository
 * @param repositoryURL     the repository's URL
 * @param repositoryType    the type of the repository
 * @param credentials       the credentials to retrieve the artifact
 * @return the artifact's path downloaded locally, null if artifact cannot be resolved
 */
public String resolveArtifact(String artifactReference,String repositoryURL,String repositoryType,Map<String,Object> credentials){
  if ("String_Node_Str".equals(repositoryType)) {
    return null;
  }
  for (  IConfigurableArtifactResolver configurableArtifactResolver : registeredResolvers.values()) {
    String resolvedArtifact=configurableArtifactResolver.resolveArtifact(artifactReference,repositoryURL,repositoryType,credentials);
    if (resolvedArtifact != null) {
      return resolvedArtifact;
    }
  }
  for (  Map<String,IArtifactResolver> resolverMap : resolverRegistry.getInstancesByPlugins().values()) {
    for (    IArtifactResolver resolver : resolverMap.values()) {
      String resolvedArtifact=resolver.resolveArtifact(artifactReference,repositoryURL,repositoryType,credentials);
      if (resolvedArtifact != null) {
        return resolvedArtifact;
      }
    }
  }
  return null;
}

Fixed version (ground truth):
/** 
 * Try to resolve an artifact from all configured resolver plugins and repositories This can be ignored with a4c_ignore.
 * @param artifactReference reference of the artifact inside the repository
 * @param repositoryURL     the repository's URL
 * @param repositoryType    the type of the repository
 * @param credentials       the credentials to retrieve the artifact
 * @return the artifact's path downloaded locally, null if artifact cannot be resolved
 */
public String resolveArtifact(String artifactReference,String repositoryURL,String repositoryType,Map<String,Object> credentials){
  if ("String_Node_Str".equals(repositoryType)) {
    return "String_Node_Str";
  }
  for (  IConfigurableArtifactResolver configurableArtifactResolver : registeredResolvers.values()) {
    String resolvedArtifact=configurableArtifactResolver.resolveArtifact(artifactReference,repositoryURL,repositoryType,credentials);
    if (resolvedArtifact != null) {
      return resolvedArtifact;
    }
  }
  for (  Map<String,IArtifactResolver> resolverMap : resolverRegistry.getInstancesByPlugins().values()) {
    for (    IArtifactResolver resolver : resolverMap.values()) {
      String resolvedArtifact=resolver.resolveArtifact(artifactReference,repositoryURL,repositoryType,credentials);
      if (resolvedArtifact != null) {
        return resolvedArtifact;
      }
    }
  }
  return null;
}
Program: 62122
Project: 62122
Buggy source:
@SneakyThrows(IOException.class) private void updateGitLocation(GitLocation newGitLocation){
  Path tempPath=tempDirPath.resolve(UUID.randomUUID().toString());
  GitLocation previousLocation=gitLocationDao.findById(newGitLocation.getId());
  if (previousLocation != null) {
    FileUtil.copy(localGitManager.getLocalGitPath(previousLocation),tempPath);
    localGitManager.deleteLocalGit(previousLocation);
  }
  localGitManager.checkout(newGitLocation);
  gitLocationDao.save(newGitLocation);
  if (tempPath != null) {
    User currentUser=AuthorizationUtil.getCurrentUser();
    FileUtil.copy(tempPath,localGitManager.getLocalGitPath(newGitLocation),true);
    localGitManager.commitAndPush(newGitLocation,currentUser.getUsername(),currentUser.getEmail(),"String_Node_Str");
    FileUtil.delete(tempPath);
  }
}

Fixed version (ground truth):
@SneakyThrows(IOException.class) private void updateGitLocation(GitLocation newGitLocation){
  Path tempPath=tempDirPath.resolve(UUID.randomUUID().toString());
  GitLocation previousLocation=gitLocationDao.findById(newGitLocation.getId());
  if (previousLocation != null) {
    FileUtil.copy(localGitManager.getLocalGitPath(previousLocation),tempPath);
    localGitManager.deleteLocalGit(previousLocation);
  }
  localGitManager.checkout(newGitLocation);
  gitLocationDao.save(newGitLocation);
  if (Files.exists(tempPath)) {
    User currentUser=AuthorizationUtil.getCurrentUser();
    FileUtil.copy(tempPath,localGitManager.getLocalGitPath(newGitLocation),true);
    localGitManager.commitAndPush(newGitLocation,currentUser.getUsername(),currentUser.getEmail(),"String_Node_Str");
    FileUtil.delete(tempPath);
  }
}
Program: 62127
Project: 62127
Buggy source:
private static void checkListPropertyConstraint(String propertyName,List<Object> listPropertyValue,PropertyDefinition propertyDefinition,Consumer<String> missingPropertyConsumer) throws ConstraintValueDoNotMatchPropertyTypeException, ConstraintViolationException {
  if (!ToscaTypes.LIST.equals(propertyDefinition.getType())) {
    throw new ConstraintValueDoNotMatchPropertyTypeException("String_Node_Str" + propertyDefinition.getType());
  }
  PropertyDefinition entrySchema=propertyDefinition.getEntrySchema();
  if (entrySchema == null) {
    throw new ConstraintValueDoNotMatchPropertyTypeException("String_Node_Str" + propertyDefinition.getType() + "String_Node_Str");
  }
  checkLengthConstraints(propertyDefinition.getConstraints(),listPropertyValue);
  for (int i=0; i < listPropertyValue.size(); i++) {
    checkPropertyConstraint(propertyName + "String_Node_Str" + String.valueOf(i)+ "String_Node_Str",listPropertyValue.get(i),entrySchema,missingPropertyConsumer);
  }
}

Fixed version (ground truth):
private static void checkListPropertyConstraint(String propertyName,List<Object> listPropertyValue,PropertyDefinition propertyDefinition,Consumer<String> missingPropertyConsumer) throws ConstraintValueDoNotMatchPropertyTypeException, ConstraintViolationException {
  if (!ToscaTypes.LIST.equals(propertyDefinition.getType())) {
    throwConstraintValueDoNotMatchPropertyTypeException("String_Node_Str" + propertyDefinition.getType(),propertyName,ToscaTypes.LIST,null);
  }
  PropertyDefinition entrySchema=propertyDefinition.getEntrySchema();
  if (entrySchema == null) {
    throw new ConstraintValueDoNotMatchPropertyTypeException("String_Node_Str" + propertyDefinition.getType() + "String_Node_Str");
  }
  checkLengthConstraints(propertyDefinition.getConstraints(),listPropertyValue);
  for (int i=0; i < listPropertyValue.size(); i++) {
    checkPropertyConstraint(propertyName + "String_Node_Str" + String.valueOf(i)+ "String_Node_Str",listPropertyValue.get(i),entrySchema,missingPropertyConsumer);
  }
}
Program: 62128
Project: 62128
Buggy source:
private static void checkMapPropertyConstraint(String propertyName,Map<String,Object> mapPropertyValue,PropertyDefinition propertyDefinition,Consumer<String> missingPropertyConsumer) throws ConstraintValueDoNotMatchPropertyTypeException, ConstraintViolationException {
  if (!ToscaTypes.MAP.equals(propertyDefinition.getType())) {
    throw new ConstraintValueDoNotMatchPropertyTypeException("String_Node_Str" + propertyDefinition.getType());
  }
  PropertyDefinition entrySchema=propertyDefinition.getEntrySchema();
  if (entrySchema == null) {
    throw new ConstraintValueDoNotMatchPropertyTypeException("String_Node_Str" + propertyDefinition.getType() + "String_Node_Str");
  }
  checkLengthConstraints(propertyDefinition.getConstraints(),mapPropertyValue);
  for (  Map.Entry<String,Object> complexPropertyValueEntry : mapPropertyValue.entrySet()) {
    checkPropertyConstraint(propertyName + "String_Node_Str" + complexPropertyValueEntry.getKey(),complexPropertyValueEntry.getValue(),entrySchema,missingPropertyConsumer);
  }
}

Fixed version (ground truth):
private static void checkMapPropertyConstraint(String propertyName,Map<String,Object> mapPropertyValue,PropertyDefinition propertyDefinition,Consumer<String> missingPropertyConsumer) throws ConstraintValueDoNotMatchPropertyTypeException, ConstraintViolationException {
  if (!ToscaTypes.MAP.equals(propertyDefinition.getType())) {
    throwConstraintValueDoNotMatchPropertyTypeException("String_Node_Str" + propertyDefinition.getType(),propertyName,ToscaTypes.MAP,null);
  }
  PropertyDefinition entrySchema=propertyDefinition.getEntrySchema();
  if (entrySchema == null) {
    throw new ConstraintValueDoNotMatchPropertyTypeException("String_Node_Str" + propertyDefinition.getType() + "String_Node_Str");
  }
  checkLengthConstraints(propertyDefinition.getConstraints(),mapPropertyValue);
  for (  Map.Entry<String,Object> complexPropertyValueEntry : mapPropertyValue.entrySet()) {
    checkPropertyConstraint(propertyName + "String_Node_Str" + complexPropertyValueEntry.getKey(),complexPropertyValueEntry.getValue(),entrySchema,missingPropertyConsumer);
  }
}
Program: 62130
Project: 62130
Buggy source:
protected boolean doMergeNode(Topology topology,FlowExecutionContext context,String templateId,NodePropsOverride nodePropsOverride){
  final ConfigChanged configChanged=new ConfigChanged();
  T template=getTemplates(topology).get(templateId);
  NodeType nodeType=ToscaContext.get(NodeType.class,template.getType());
  template.setProperties(mergeProperties(nodePropsOverride.getProperties(),template.getProperties(),nodeType.getProperties(),propertyName -> {
    configChanged.changed=true;
    context.log().info("String_Node_Str" + propertyName + "String_Node_Str"+ getSubject()+ "String_Node_Str"+ templateId+ "String_Node_Str");
  }
));
  return configChanged.changed;
}

Fixed version (ground truth):
protected boolean doMergeNode(Topology topology,FlowExecutionContext context,String templateId,NodePropsOverride nodePropsOverride){
  final ConfigChanged configChanged=new ConfigChanged();
  U template=getTemplates(topology).get(templateId);
  T toscaType=ToscaContext.get(getToscaTypeClass(),template.getType());
  template.setProperties(mergeProperties(nodePropsOverride.getProperties(),template.getProperties(),toscaType.getProperties(),propertyName -> {
    configChanged.changed=true;
    context.log().info("String_Node_Str" + propertyName + "String_Node_Str"+ getSubject()+ "String_Node_Str"+ templateId+ "String_Node_Str");
  }
));
  return configChanged.changed;
}
Program: 62131
Project: 62131
Buggy source:
abstract Map<String,T> getTemplates(Topology topology);

Fixed version (ground truth):
abstract Map<String,U> getTemplates(Topology topology);
Program: 62133
Project: 62133
Buggy source:
public void deleteAllByTopologyVersionId(String versionId){
  List<Path> paths=localGitRepositoryPathResolver.findAllLocalDeploymentConfigGitPath();
  for (  Path path : paths) {
    try {
      RepositoryManager.dropStash(path,"String_Node_Str" + versionId);
      RepositoryManager.deleteBranch(path,versionId,false);
    }
 catch (    GitException e) {
      log.error("String_Node_Str" + versionId + "String_Node_Str",e);
    }
  }
}

Fixed version (ground truth):
public void deleteAllByTopologyVersionId(String applicationId,String versionId){
  List<Path> paths=localGitRepositoryPathResolver.findAllEnvironmentSetupLocalPath(applicationId);
  for (  Path path : paths) {
    try {
      RepositoryManager.dropStash(path,"String_Node_Str" + versionId);
      RepositoryManager.deleteBranch(path,versionId,false);
    }
 catch (    GitException e) {
      log.error("String_Node_Str" + versionId + "String_Node_Str",e);
    }
  }
}
Program: 62134
Project: 62134
Buggy source:
public void deleteAllByEnvironmentId(String environmentId){
  Path path=localGitRepositoryPathResolver.findLocalPathRelatedToEnvironment(environmentId);
  deleteDirectory(path);
}

Fixed version (ground truth):
public void deleteAllByEnvironmentId(String applicationId,String environmentId){
  Path path=localGitRepositoryPathResolver.findEnvironmentSetupLocalPath(applicationId,environmentId);
  deleteDirectory(path);
}
Program: 62135
Project: 62135
Buggy source:
/** 
 * Called after yaml parsing.
 */
private void finalizeParsedWorkflows(TopologyContext topologyContext,Node node){
  if (MapUtils.isEmpty(topologyContext.getTopology().getWorkflows())) {
    return;
  }
  normalizeWorkflowNames(topologyContext.getTopology().getWorkflows());
  for (  Workflow wf : topologyContext.getTopology().getWorkflows().values()) {
    wf.setStandard(WorkflowUtils.isStandardWorkflow(wf));
    if (wf.getSteps() != null) {
      for (      WorkflowStep step : wf.getSteps().values()) {
        if (step.getOnSuccess() != null) {
          Iterator<String> followingIds=step.getOnSuccess().iterator();
          while (followingIds.hasNext()) {
            String followingId=followingIds.next();
            WorkflowStep followingStep=wf.getSteps().get(followingId);
            if (followingStep == null) {
              followingIds.remove();
              ParsingContextExecution.getParsingErrors().add(new ParsingError(ParsingErrorLevel.WARNING,ErrorCode.UNKNWON_WORKFLOW_STEP,null,node.getStartMark(),null,node.getEndMark(),followingId));
            }
 else {
              followingStep.addPreceding(step.getName());
            }
          }
        }
      }
    }
    WorkflowUtils.fillHostId(wf,topologyContext);
    int errorCount=workflowBuilderService.validateWorkflow(topologyContext,wf);
    if (errorCount > 0) {
      processWorkflowErrors(wf,wf.getErrors(),node);
    }
  }
}

Fixed version (ground truth):
/** 
 * Called after yaml parsing.
 */
private void finalizeParsedWorkflows(TopologyContext topologyContext,Node node){
  if (MapUtils.isEmpty(topologyContext.getTopology().getWorkflows())) {
    return;
  }
  normalizeWorkflowNames(topologyContext.getTopology().getWorkflows());
  for (  Workflow wf : topologyContext.getTopology().getWorkflows().values()) {
    wf.setStandard(WorkflowUtils.isStandardWorkflow(wf));
    if (wf.getSteps() != null) {
      for (      WorkflowStep step : wf.getSteps().values()) {
        if (step.getOnSuccess() != null) {
          Iterator<String> followingIds=step.getOnSuccess().iterator();
          while (followingIds.hasNext()) {
            String followingId=followingIds.next();
            WorkflowStep followingStep=wf.getSteps().get(followingId);
            if (followingStep == null) {
              followingIds.remove();
              ParsingContextExecution.getParsingErrors().add(new ParsingError(ParsingErrorLevel.WARNING,ErrorCode.UNKNWON_WORKFLOW_STEP,null,node.getStartMark(),null,node.getEndMark(),followingId));
            }
 else {
              followingStep.addPreceding(step.getName());
            }
          }
        }
      }
    }
    try {
      WorkflowUtils.fillHostId(wf,topologyContext);
    }
 catch (    NotFoundException e) {
      log.trace("String_Node_Str",e);
    }
    int errorCount=workflowBuilderService.validateWorkflow(topologyContext,wf);
    if (errorCount > 0) {
      processWorkflowErrors(wf,wf.getErrors(),node);
    }
  }
}
Program: 62136
Project: 62136
Buggy source:
/** 
 * To filter the confidential parameters inside the request body
 * @param original A json string of request body
 * @param method A method to be audited
 * @return A new string already formatting the filtered parameters
 * @throws IOException
 */
private String filterRequestBody(String original,final Method method) throws IOException {
  if (StringUtils.isEmpty(original)) {
    return original;
  }
  Map<String,Object> body=JsonUtil.toMap(original);
  for (  String filteredParameter : method.getBodyHiddenFields()) {
    body.computeIfPresent(filteredParameter,(k,v) -> String.join("String_Node_Str",Collections.nCopies(10,AuditConfiguration.FORMATTER)));
  }
  return JsonUtil.toString(body);
}

Fixed version (ground truth):
/** 
 * To filter the confidential parameters inside the request body
 * @param original A json string of request body
 * @param method A method to be audited
 * @return A new string already formatting the filtered parameters
 * @throws IOException
 */
private String filterRequestBody(String original,final Method method) throws IOException {
  if (StringUtils.isEmpty(original) || ArrayUtils.isEmpty(method.getBodyHiddenFields())) {
    return original;
  }
  Map<String,Object> body=JsonUtil.toMap(original);
  for (  String filteredParameter : method.getBodyHiddenFields()) {
    body.computeIfPresent(filteredParameter,(k,v) -> String.join("String_Node_Str",Collections.nCopies(10,AuditConfiguration.FORMATTER)));
  }
  return JsonUtil.toString(body);
}
Program: 62138
Project: 62138
Buggy source:
/** 
 * Launch a given workflow.
 */
public synchronized void launchWorkflow(SecretProviderConfigurationAndCredentials secretProviderConfigurationAndCredentials,String applicationEnvironmentId,String workflowName,Map<String,Object> params,IPaaSCallback<?> iPaaSCallback){
  Deployment deployment=deploymentService.getActiveDeploymentOrFail(applicationEnvironmentId);
  DeploymentTopology deploymentTopology=deploymentRuntimeStateService.getRuntimeTopologyFromEnvironment(deployment.getEnvironmentId());
  IOrchestratorPlugin orchestratorPlugin=orchestratorPluginService.getOrFail(deployment.getOrchestratorId());
  PaaSDeploymentContext deploymentContext=new PaaSDeploymentContext(deployment,deploymentTopology,secretProviderConfigurationAndCredentials);
  orchestratorPlugin.launchWorkflow(deploymentContext,workflowName,params,iPaaSCallback);
}

Fixed version (ground truth):
/** 
 * Launch a given workflow.
 */
public synchronized void launchWorkflow(SecretProviderConfigurationAndCredentials secretProviderConfigurationAndCredentials,String applicationEnvironmentId,String workflowName,Map<String,Object> params,IPaaSCallback<?> iPaaSCallback){
  Deployment deployment=deploymentService.getActiveDeploymentOrFail(applicationEnvironmentId);
  DeploymentTopology deploymentTopology=deploymentRuntimeStateService.getRuntimeTopologyFromEnvironment(deployment.getEnvironmentId());
  IOrchestratorPlugin orchestratorPlugin=orchestratorPluginService.getOrFail(deployment.getOrchestratorId());
  final DeploymentTopology topology=alienMonitorDao.findById(DeploymentTopology.class,deployment.getId());
  Map<String,String> locationIds=TopologyLocationUtils.getLocationIds(topology);
  Map<String,Location> locations=deploymentTopologyService.getLocations(locationIds);
  PaaSDeploymentContext deploymentContext=new PaaSDeploymentContext(deployment,deploymentTopology,secretProviderService.generateSecretConfiguration(locations,secretProviderConfigurationAndCredentials.getSecretProviderConfiguration().getPluginName(),secretProviderConfigurationAndCredentials.getCredentials()));
  orchestratorPlugin.launchWorkflow(deploymentContext,workflowName,params,iPaaSCallback);
}
Program: 62139
Project: 62139
Buggy source:
public SecretProviderConfigurationAndCredentials generateSecretConfiguration(SecretProviderConfiguration locationConfiguration,Object credentials){
  if (credentials == null) {
    return null;
  }
  ISecretProvider secretProvider=this.getPluginBean(locationConfiguration.getPluginName());
  Object configuration=this.getPluginConfiguration(locationConfiguration.getPluginName(),locationConfiguration.getConfiguration());
  SecretAuthResponse authResponse=secretProvider.auth(configuration,this.getCredentials(locationConfiguration.getPluginName(),configuration,credentials));
  SecretProviderConfigurationAndCredentials result=new SecretProviderConfigurationAndCredentials();
  SecretProviderConfiguration secretProviderConfiguration=new SecretProviderConfiguration();
  secretProviderConfiguration.setPluginName(locationConfiguration.getPluginName());
  secretProviderConfiguration.setConfiguration(authResponse.getConfiguration());
  result.setSecretProviderConfiguration(secretProviderConfiguration);
  result.setCredentials(authResponse.getCredentials());
  return result;
}

Fixed version (ground truth):
/** 
 * Generate a token wrapped in an instance of SecretProviderConfigurationAndCredentials by authenticating the credentials (username, password) with ldap
 * @param locationConfiguration
 * @param credentials
 * @return SecretProviderConfigurationAndCredentials wrapping a token
 */
private SecretProviderConfigurationAndCredentials generateSecretConfiguration(SecretProviderConfiguration locationConfiguration,Object credentials){
  if (credentials == null) {
    return null;
  }
  ISecretProvider secretProvider=this.getPluginBean(locationConfiguration.getPluginName());
  Object configuration=this.getPluginConfiguration(locationConfiguration.getPluginName(),locationConfiguration.getConfiguration());
  SecretAuthResponse authResponse=secretProvider.auth(configuration,this.getCredentials(locationConfiguration.getPluginName(),configuration,credentials));
  SecretProviderConfigurationAndCredentials result=new SecretProviderConfigurationAndCredentials();
  SecretProviderConfiguration secretProviderConfiguration=new SecretProviderConfiguration();
  secretProviderConfiguration.setPluginName(locationConfiguration.getPluginName());
  secretProviderConfiguration.setConfiguration(authResponse.getConfiguration());
  result.setSecretProviderConfiguration(secretProviderConfiguration);
  result.setCredentials(authResponse.getCredentials());
  return result;
}
Program: 62140
Project: 62140
Buggy source:
private PaaSTopologyDeploymentContext saveDeploymentTopologyAndGenerateDeploymentContext(final SecretProviderCredentials secretProviderCredentials,final DeploymentTopology deploymentTopology,final Deployment deployment,final Map<String,Location> locations){
  String deploymentTopologyId=deploymentTopology.getId();
  deploymentTopology.setId(deployment.getId());
  deploymentTopology.setDeployed(true);
  alienMonitorDao.save(deploymentTopology);
  deploymentTopology.setId(deploymentTopologyId);
  SecretProviderConfigurationAndCredentials secretProviderConfigurationAndCredentials=generateSecretConfiguration(locations,secretProviderCredentials);
  PaaSTopologyDeploymentContext deploymentContext=deploymentContextService.buildTopologyDeploymentContext(secretProviderConfigurationAndCredentials,deployment,locations,deploymentTopology);
  serviceResourceRelationshipService.process(deploymentContext);
  artifactProcessorService.processArtifacts(deploymentContext);
  return deploymentContext;
}

Fixed version (ground truth):
private PaaSTopologyDeploymentContext saveDeploymentTopologyAndGenerateDeploymentContext(final SecretProviderCredentials secretProviderCredentials,final DeploymentTopology deploymentTopology,final Deployment deployment,final Map<String,Location> locations){
  String deploymentTopologyId=deploymentTopology.getId();
  deploymentTopology.setId(deployment.getId());
  deploymentTopology.setDeployed(true);
  alienMonitorDao.save(deploymentTopology);
  deploymentTopology.setId(deploymentTopologyId);
  SecretProviderConfigurationAndCredentials secretProviderConfigurationAndCredentials=secretProviderService.generateSecretConfiguration(locations,secretProviderCredentials);
  PaaSTopologyDeploymentContext deploymentContext=deploymentContextService.buildTopologyDeploymentContext(secretProviderConfigurationAndCredentials,deployment,locations,deploymentTopology);
  serviceResourceRelationshipService.process(deploymentContext);
  artifactProcessorService.processArtifacts(deploymentContext);
  return deploymentContext;
}
Program: 62141
Project: 62141
Buggy source:
private void doScale(final String nodeTemplateId,final int instances,final IPaaSCallback<Object> callback,final Deployment deployment,final DeploymentTopology topology,SecretProviderConfigurationAndCredentials secretProviderConfigurationAndCredentials){
  NodeTemplate nodeTemplate=TopologyUtils.getNodeTemplate(topology,nodeTemplateId);
  Map<String,String> locationIds=TopologyLocationUtils.getLocationIds(topology);
  Map<String,Location> locations=deploymentTopologyService.getLocations(locationIds);
  secretProviderConfigurationAndCredentials=deployService.generateSecretConfiguration(locations,secretProviderConfigurationAndCredentials.getSecretProviderConfiguration().getPluginName(),secretProviderConfigurationAndCredentials.getCredentials());
  Capability clusterControllerCapability=NodeTemplateUtils.getCapabilityByType(nodeTemplate,AlienCapabilityTypes.CLUSTER_CONTROLLER);
  if (clusterControllerCapability == null) {
    doScaleNode(nodeTemplateId,instances,callback,deployment,topology,nodeTemplate,secretProviderConfigurationAndCredentials);
  }
 else {
    triggerClusterManagerScaleOperation(nodeTemplateId,instances,callback,deployment,topology,clusterControllerCapability,secretProviderConfigurationAndCredentials);
  }
}

Fixed version (ground truth):
private void doScale(final String nodeTemplateId,final int instances,final IPaaSCallback<Object> callback,final Deployment deployment,final DeploymentTopology topology,SecretProviderConfigurationAndCredentials secretProviderConfigurationAndCredentials){
  NodeTemplate nodeTemplate=TopologyUtils.getNodeTemplate(topology,nodeTemplateId);
  Map<String,String> locationIds=TopologyLocationUtils.getLocationIds(topology);
  Map<String,Location> locations=deploymentTopologyService.getLocations(locationIds);
  secretProviderConfigurationAndCredentials=secretProviderService.generateSecretConfiguration(locations,secretProviderConfigurationAndCredentials.getSecretProviderConfiguration().getPluginName(),secretProviderConfigurationAndCredentials.getCredentials());
  Capability clusterControllerCapability=NodeTemplateUtils.getCapabilityByType(nodeTemplate,AlienCapabilityTypes.CLUSTER_CONTROLLER);
  if (clusterControllerCapability == null) {
    doScaleNode(nodeTemplateId,instances,callback,deployment,topology,nodeTemplate,secretProviderConfigurationAndCredentials);
  }
 else {
    triggerClusterManagerScaleOperation(nodeTemplateId,instances,callback,deployment,topology,clusterControllerCapability,secretProviderConfigurationAndCredentials);
  }
}
Program: 62142
Project: 62142
Buggy source:
/** 
 * Build the deployment context from an operation execution request
 * @param request the operation execution request
 * @return the deployment context
 */
public PaaSTopologyDeploymentContext buildPaaSTopologyDeploymentContext(OperationExecRequest request){
  Deployment deployment=deploymentService.getActiveDeploymentOrFail(request.getApplicationEnvironmentId());
  DeploymentTopology deploymentTopology=deploymentRuntimeStateService.getRuntimeTopologyFromEnvironment(deployment.getEnvironmentId());
  Map<String,String> locationIds=TopologyLocationUtils.getLocationIds(deploymentTopology);
  Map<String,Location> locations=deploymentTopologyService.getLocations(locationIds);
  SecretProviderConfigurationAndCredentials secretProviderConfigurationAndCredentials=deployService.generateSecretConfiguration(locations,request.getSecretProviderPluginName(),request.getSecretProviderCredentials());
  return deploymentContextService.buildTopologyDeploymentContext(secretProviderConfigurationAndCredentials,deployment,deploymentTopologyService.getLocations(deploymentTopology),deploymentTopology);
}

Fixed version (ground truth):
/** 
 * Build the deployment context from an operation execution request
 * @param request the operation execution request
 * @return the deployment context
 */
public PaaSTopologyDeploymentContext buildPaaSTopologyDeploymentContext(OperationExecRequest request){
  Deployment deployment=deploymentService.getActiveDeploymentOrFail(request.getApplicationEnvironmentId());
  DeploymentTopology deploymentTopology=deploymentRuntimeStateService.getRuntimeTopologyFromEnvironment(deployment.getEnvironmentId());
  Map<String,String> locationIds=TopologyLocationUtils.getLocationIds(deploymentTopology);
  Map<String,Location> locations=deploymentTopologyService.getLocations(locationIds);
  SecretProviderConfigurationAndCredentials secretProviderConfigurationAndCredentials=secretProviderService.generateSecretConfiguration(locations,request.getSecretProviderPluginName(),request.getSecretProviderCredentials());
  return deploymentContextService.buildTopologyDeploymentContext(secretProviderConfigurationAndCredentials,deployment,deploymentTopologyService.getLocations(deploymentTopology),deploymentTopology);
}
Program: 62143
Project: 62143
Buggy source:
private void undeploy(SecretProviderConfigurationAndCredentials secretProviderConfigurationAndCredentials,final Deployment deployment){
  deploymentLockService.doWithDeploymentWriteLock(deployment.getOrchestratorDeploymentId(),() -> {
    log.info("String_Node_Str",deployment.getId(),deployment.getOrchestratorId());
    IOrchestratorPlugin orchestratorPlugin=orchestratorPluginService.getOrFail(deployment.getOrchestratorId());
    DeploymentTopology deployedTopology=deploymentRuntimeStateService.getRuntimeTopology(deployment.getId());
    PaaSDeploymentContext deploymentContext=new PaaSDeploymentContext(deployment,deployedTopology,secretProviderConfigurationAndCredentials);
    orchestratorPlugin.undeploy(deploymentContext,new IPaaSCallback<ResponseEntity>(){
      @Override public void onSuccess(      ResponseEntity data){
        deploymentService.markUndeployed(deployment);
        log.info("String_Node_Str",deployment.getId(),deployment.getOrchestratorId());
      }
      @Override public void onFailure(      Throwable throwable){
        log.warn("String_Node_Str",deployment.getId(),deployment.getOrchestratorId());
      }
    }
);
    return null;
  }
);
}

Fixed version (ground truth):
private void undeploy(SecretProviderConfigurationAndCredentials secretProviderConfigurationAndCredentials,final Deployment deployment){
  deploymentLockService.doWithDeploymentWriteLock(deployment.getOrchestratorDeploymentId(),() -> {
    log.info("String_Node_Str",deployment.getId(),deployment.getOrchestratorId());
    IOrchestratorPlugin orchestratorPlugin=orchestratorPluginService.getOrFail(deployment.getOrchestratorId());
    DeploymentTopology deployedTopology=deploymentRuntimeStateService.getRuntimeTopology(deployment.getId());
    Map<String,String> locationIds=TopologyLocationUtils.getLocationIds(deployedTopology);
    Map<String,Location> locations=deploymentTopologyService.getLocations(locationIds);
    final SecretProviderConfigurationAndCredentials authResponse=secretProviderService.generateSecretConfiguration(locations,secretProviderConfigurationAndCredentials.getSecretProviderConfiguration().getPluginName(),secretProviderConfigurationAndCredentials.getCredentials());
    PaaSDeploymentContext deploymentContext=new PaaSDeploymentContext(deployment,deployedTopology,authResponse);
    orchestratorPlugin.undeploy(deploymentContext,new IPaaSCallback<ResponseEntity>(){
      @Override public void onSuccess(      ResponseEntity data){
        deploymentService.markUndeployed(deployment);
        log.info("String_Node_Str",deployment.getId(),deployment.getOrchestratorId());
      }
      @Override public void onFailure(      Throwable throwable){
        log.warn("String_Node_Str",deployment.getId(),deployment.getOrchestratorId());
      }
    }
);
    return null;
  }
);
}
Program: 62145
Project: 62145
Buggy source:
private void assertPropMapContains(Map<String,PropertyValue> map,Map<String,AbstractPropertyValue> expectedMap){
  map=safe(map);
  for (  Entry<String,AbstractPropertyValue> entry : expectedMap.entrySet()) {
    assertEquals(entry.getValue(),map.get(entry.getKey()));
  }
}

Fixed version (ground truth):
private void assertPropMapContains(Map<String,AbstractPropertyValue> map,Map<String,AbstractPropertyValue> expectedMap){
  map=safe(map);
  for (  Entry<String,AbstractPropertyValue> entry : expectedMap.entrySet()) {
    assertEquals(entry.getValue(),map.get(entry.getKey()));
  }
}
Program: 62146
Project: 62146
Buggy source:
private void execute(List<ITopologyModifier> modifiers,FlowExecutionContext context){
  for (int i=0; i < modifiers.size(); i++) {
    modifiers.get(i).process(context.getTopology(),context);
    if (!context.log().isValid()) {
      return;
    }
  }
}

Fixed version (ground truth):
private void execute(List<ITopologyModifier> modifiers,FlowExecutionContext context){
  for (int i=0; i < modifiers.size(); i++) {
    long start=System.currentTimeMillis();
    modifiers.get(i).process(context.getTopology(),context);
    log.info("String_Node_Str" + modifiers.get(i).getClass().getSimpleName() + "String_Node_Str"+ (System.currentTimeMillis() - start));
    if (!context.log().isValid()) {
      return;
    }
  }
}
Program: 62147
Project: 62147
Buggy source:
@Override public void process(Topology topology,FlowExecutionContext context){
  Optional<DeploymentMatchingConfiguration> configurationOptional=context.getConfiguration(DeploymentMatchingConfiguration.class,this.getClass().getSimpleName());
  if (!configurationOptional.isPresent()) {
    context.log().error(new LocationPolicyTask());
    return;
  }
  DeploymentMatchingConfiguration matchingConfiguration=configurationOptional.get();
  Map<String,String> lastUserSubstitutions=getUserMatches(matchingConfiguration);
  Map<String,V> matchesById=getMatchesById(context);
  Map<String,T> topologyTemplateMap=getTopologyTemplates(topology);
  Map<String,T> originalTemplates=Maps.newHashMap();
  for (  Map.Entry<String,String> substitutedNodeEntry : lastUserSubstitutions.entrySet()) {
    String templateId=substitutedNodeEntry.getKey();
    String matchedLocationResourceId=substitutedNodeEntry.getValue();
    originalTemplates.put(templateId,topologyTemplateMap.get(templateId));
    processReplacement(topology,topologyTemplateMap,matchesById,templateId,matchedLocationResourceId);
  }
  context.getExecutionCache().put(getOriginalTemplateCacheKey(),originalTemplates);
}

Fixed version (ground truth):
@Override public void process(Topology topology,FlowExecutionContext context){
  Optional<DeploymentMatchingConfiguration> configurationOptional=context.getConfiguration(DeploymentMatchingConfiguration.class,this.getClass().getSimpleName());
  if (!configurationOptional.isPresent()) {
    context.log().error(new LocationPolicyTask());
    return;
  }
  DeploymentMatchingConfiguration matchingConfiguration=configurationOptional.get();
  Map<String,String> lastUserSubstitutions=getUserMatches(matchingConfiguration);
  Map<String,V> matchesById=getMatchesById(context);
  Map<String,T> topologyTemplateMap=getTopologyTemplates(topology);
  Map<String,T> originalTemplates=Maps.newHashMap();
  Map<String,T> replacedTemplates=Maps.newHashMap();
  for (  Map.Entry<String,String> substitutedNodeEntry : lastUserSubstitutions.entrySet()) {
    String templateId=substitutedNodeEntry.getKey();
    String matchedLocationResourceId=substitutedNodeEntry.getValue();
    originalTemplates.put(templateId,topologyTemplateMap.get(templateId));
    processReplacement(topology,topologyTemplateMap,matchesById,templateId,matchedLocationResourceId);
    replacedTemplates.put(templateId,topologyTemplateMap.get(templateId));
  }
  context.getExecutionCache().put(getOriginalTemplateCacheKey(),originalTemplates);
  context.getExecutionCache().put(getReplacedTemplateCacheKey(),replacedTemplates);
}
Program: 62149
Project: 62149
Buggy source:
private void execute(List<ITopologyModifier> modifiers,FlowExecutionContext context){
  for (int i=0; i < modifiers.size(); i++) {
    modifiers.get(i).process(context.getTopology(),context);
    if (!context.log().isValid()) {
      return;
    }
  }
}

Fixed version (ground truth):
private void execute(List<ITopologyModifier> modifiers,FlowExecutionContext context){
  for (int i=0; i < modifiers.size(); i++) {
    long start=System.currentTimeMillis();
    modifiers.get(i).process(context.getTopology(),context);
    log.info("String_Node_Str" + modifiers.get(i).getClass().getSimpleName() + "String_Node_Str"+ (System.currentTimeMillis() - start));
    if (!context.log().isValid()) {
      return;
    }
  }
}