Program: 4576
Project: 4576
Buggy source:
@Test @SuppressWarnings("String_Node_Str") public void testWorkflowToken() throws Exception {
  Assert.assertEquals(200,deploy(AppWithWorkflow.class).getStatusLine().getStatusCode());
  Id.Application appId=Id.Application.from(Id.Namespace.DEFAULT,AppWithWorkflow.NAME);
  final Id.Workflow workflowId=Id.Workflow.from(appId,AppWithWorkflow.SampleWorkflow.NAME);
  String outputPath=new File(tmpFolder.newFolder(),"String_Node_Str").getAbsolutePath();
  startProgram(workflowId,ImmutableMap.of("String_Node_Str",createInput("String_Node_Str"),"String_Node_Str",outputPath));
  Tasks.waitFor(1,new Callable<Integer>(){
    @Override public Integer call() throws Exception {
      return getProgramRuns(workflowId,ProgramRunStatus.COMPLETED).size();
    }
  }
,60,TimeUnit.SECONDS);
  List<RunRecord> programRuns=getProgramRuns(workflowId,ProgramRunStatus.COMPLETED);
  Assert.assertEquals(1,programRuns.size());
  RunRecord runRecord=programRuns.get(0);
  String pid=runRecord.getPid();
  WorkflowTokenDetail workflowTokenDetail=getWorkflowToken(workflowId,pid,null,null);
  List<WorkflowTokenDetail.NodeValueDetail> nodeValueDetails=workflowTokenDetail.getTokenData().get(AppWithWorkflow.DummyAction.TOKEN_KEY);
  Assert.assertEquals(2,nodeValueDetails.size());
  Assert.assertEquals(AppWithWorkflow.SampleWorkflow.FIRST_ACTION,nodeValueDetails.get(0).getNode());
  Assert.assertEquals(AppWithWorkflow.SampleWorkflow.SECOND_ACTION,nodeValueDetails.get(1).getNode());
  Assert.assertEquals(AppWithWorkflow.DummyAction.TOKEN_VALUE,nodeValueDetails.get(0).getValue());
  Assert.assertEquals(AppWithWorkflow.DummyAction.TOKEN_VALUE,nodeValueDetails.get(1).getValue());
  workflowTokenDetail=getWorkflowToken(workflowId,pid,WorkflowToken.Scope.USER,AppWithWorkflow.DummyAction.TOKEN_KEY);
  nodeValueDetails=workflowTokenDetail.getTokenData().get(AppWithWorkflow.DummyAction.TOKEN_KEY);
  Assert.assertEquals(2,nodeValueDetails.size());
  Assert.assertEquals(AppWithWorkflow.SampleWorkflow.FIRST_ACTION,nodeValueDetails.get(0).getNode());
  Assert.assertEquals(AppWithWorkflow.SampleWorkflow.SECOND_ACTION,nodeValueDetails.get(1).getNode());
  Assert.assertEquals(AppWithWorkflow.DummyAction.TOKEN_VALUE,nodeValueDetails.get(0).getValue());
  Assert.assertEquals(AppWithWorkflow.DummyAction.TOKEN_VALUE,nodeValueDetails.get(1).getValue());
  WorkflowTokenNodeDetail nodeDetail=getWorkflowToken(workflowId,pid,AppWithWorkflow.SampleWorkflow.NAME,WorkflowToken.Scope.USER,null);
  Map<String,String> tokenData=nodeDetail.getTokenDataAtNode();
  Assert.assertEquals(2,tokenData.size());
  Assert.assertEquals(AppWithWorkflow.SampleWorkflow.INITIALIZE_TOKEN_VALUE,tokenData.get(AppWithWorkflow.SampleWorkflow.INITIALIZE_TOKEN_KEY));
  Assert.assertEquals(AppWithWorkflow.SampleWorkflow.DESTROY_TOKEN_SUCCESS_VALUE,tokenData.get(AppWithWorkflow.SampleWorkflow.DESTROY_TOKEN_KEY));
  WorkflowTokenNodeDetail tokenAtNode=getWorkflowToken(workflowId,pid,AppWithWorkflow.SampleWorkflow.FIRST_ACTION,null,null);
  Map<String,String> tokenDataAtNode=tokenAtNode.getTokenDataAtNode();
  Assert.assertEquals(1,tokenDataAtNode.size());
  Assert.assertEquals(AppWithWorkflow.DummyAction.TOKEN_VALUE,tokenDataAtNode.get(AppWithWorkflow.DummyAction.TOKEN_KEY));
  tokenAtNode=getWorkflowToken(workflowId,pid,AppWithWorkflow.SampleWorkflow.FIRST_ACTION,WorkflowToken.Scope.USER,AppWithWorkflow.DummyAction.TOKEN_KEY);
  tokenDataAtNode=tokenAtNode.getTokenDataAtNode();
  Assert.assertEquals(1,tokenDataAtNode.size());
  Assert.assertEquals(AppWithWorkflow.DummyAction.TOKEN_VALUE,tokenDataAtNode.get(AppWithWorkflow.DummyAction.TOKEN_KEY));
}

Fixed version (ground truth):
@Test @SuppressWarnings("String_Node_Str") public void testWorkflowToken() throws Exception {
  Assert.assertEquals(200,deploy(AppWithWorkflow.class).getStatusLine().getStatusCode());
  Id.Application appId=Id.Application.from(Id.Namespace.DEFAULT,AppWithWorkflow.NAME);
  final Id.Workflow workflowId=Id.Workflow.from(appId,AppWithWorkflow.SampleWorkflow.NAME);
  String outputPath=new File(tmpFolder.newFolder(),"String_Node_Str").getAbsolutePath();
  startProgram(workflowId,ImmutableMap.of("String_Node_Str",createInput("String_Node_Str"),"String_Node_Str",outputPath));
  Tasks.waitFor(1,() -> getProgramRuns(workflowId,ProgramRunStatus.COMPLETED).size(),60,TimeUnit.SECONDS);
  List<RunRecord> programRuns=getProgramRuns(workflowId,ProgramRunStatus.COMPLETED);
  Assert.assertEquals(1,programRuns.size());
  RunRecord runRecord=programRuns.get(0);
  String pid=runRecord.getPid();
  WorkflowTokenDetail workflowTokenDetail=getWorkflowToken(workflowId,pid,null,null);
  List<WorkflowTokenDetail.NodeValueDetail> nodeValueDetails=workflowTokenDetail.getTokenData().get(AppWithWorkflow.DummyAction.TOKEN_KEY);
  Assert.assertEquals(2,nodeValueDetails.size());
  Assert.assertEquals(AppWithWorkflow.SampleWorkflow.FIRST_ACTION,nodeValueDetails.get(0).getNode());
  Assert.assertEquals(AppWithWorkflow.SampleWorkflow.SECOND_ACTION,nodeValueDetails.get(1).getNode());
  Assert.assertEquals(AppWithWorkflow.DummyAction.TOKEN_VALUE,nodeValueDetails.get(0).getValue());
  Assert.assertEquals(AppWithWorkflow.DummyAction.TOKEN_VALUE,nodeValueDetails.get(1).getValue());
  workflowTokenDetail=getWorkflowToken(workflowId,pid,WorkflowToken.Scope.USER,AppWithWorkflow.DummyAction.TOKEN_KEY);
  nodeValueDetails=workflowTokenDetail.getTokenData().get(AppWithWorkflow.DummyAction.TOKEN_KEY);
  Assert.assertEquals(2,nodeValueDetails.size());
  Assert.assertEquals(AppWithWorkflow.SampleWorkflow.FIRST_ACTION,nodeValueDetails.get(0).getNode());
  Assert.assertEquals(AppWithWorkflow.SampleWorkflow.SECOND_ACTION,nodeValueDetails.get(1).getNode());
  Assert.assertEquals(AppWithWorkflow.DummyAction.TOKEN_VALUE,nodeValueDetails.get(0).getValue());
  Assert.assertEquals(AppWithWorkflow.DummyAction.TOKEN_VALUE,nodeValueDetails.get(1).getValue());
  WorkflowTokenNodeDetail nodeDetail=getWorkflowToken(workflowId,pid,AppWithWorkflow.SampleWorkflow.NAME,WorkflowToken.Scope.USER,null);
  Map<String,String> tokenData=nodeDetail.getTokenDataAtNode();
  Assert.assertEquals(2,tokenData.size());
  Assert.assertEquals(AppWithWorkflow.SampleWorkflow.INITIALIZE_TOKEN_VALUE,tokenData.get(AppWithWorkflow.SampleWorkflow.INITIALIZE_TOKEN_KEY));
  Assert.assertEquals(AppWithWorkflow.SampleWorkflow.DESTROY_TOKEN_SUCCESS_VALUE,tokenData.get(AppWithWorkflow.SampleWorkflow.DESTROY_TOKEN_KEY));
  WorkflowTokenNodeDetail tokenAtNode=getWorkflowToken(workflowId,pid,AppWithWorkflow.SampleWorkflow.FIRST_ACTION,null,null);
  Map<String,String> tokenDataAtNode=tokenAtNode.getTokenDataAtNode();
  Assert.assertEquals(1,tokenDataAtNode.size());
  Assert.assertEquals(AppWithWorkflow.DummyAction.TOKEN_VALUE,tokenDataAtNode.get(AppWithWorkflow.DummyAction.TOKEN_KEY));
  tokenAtNode=getWorkflowToken(workflowId,pid,AppWithWorkflow.SampleWorkflow.FIRST_ACTION,WorkflowToken.Scope.USER,AppWithWorkflow.DummyAction.TOKEN_KEY);
  tokenDataAtNode=tokenAtNode.getTokenDataAtNode();
  Assert.assertEquals(1,tokenDataAtNode.size());
  Assert.assertEquals(AppWithWorkflow.DummyAction.TOKEN_VALUE,tokenDataAtNode.get(AppWithWorkflow.DummyAction.TOKEN_KEY));
}