Program: 49119
Project: 49119
Buggy source:
private PrettyOutput getClusterPrettyOutputCallBack(final ClusterRestClient clusterRestClient,final String id){
  return new PrettyOutput(){
    private String ngSnapshotInJson=null;
    private boolean needUpdate=true;
    private ClusterRead cluster=null;
    public void prettyOutput() throws Exception {
      try {
        if (cluster != null) {
          List<NodeGroupRead> nodeGroups=cluster.getNodeGroups();
          if (nodeGroups != null) {
            for (            NodeGroupRead nodeGroup : nodeGroups) {
              System.out.printf("String_Node_Str",nodeGroup.getName(),nodeGroup.getInstanceNum());
              System.out.printf("String_Node_Str",nodeGroup.getRoles());
              printNodesInfo(nodeGroup.getInstances());
            }
          }
        }
      }
 catch (      Exception e) {
        throw e;
      }
    }
    public boolean isRefresh() throws Exception {
      try {
        cluster=clusterRestClient.get(id,false);
        if (cluster != null) {
          List<NodeGroupRead> nodeGroups=cluster.getNodeGroups();
          if (nodeGroups != null) {
            return checkOutputUpdate(nodeGroups);
          }
        }
        return false;
      }
 catch (      CliRestException expectedException) {
        cluster=null;
        return false;
      }
catch (      Exception e) {
        throw e;
      }
    }
    private void printNodesInfo(    List<NodeRead> nodes) throws Exception {
      if (nodes != null && nodes.size() > 0) {
        LinkedHashMap<String,List<String>> columnNamesWithGetMethodNames=new LinkedHashMap<String,List<String>>();
        columnNamesWithGetMethodNames.put(Constants.FORMAT_TABLE_COLUMN_NAME,Arrays.asList("String_Node_Str"));
        columnNamesWithGetMethodNames.put(Constants.FORMAT_TABLE_COLUMN_IP,Arrays.asList("String_Node_Str"));
        columnNamesWithGetMethodNames.put(Constants.FORMAT_TABLE_COLUMN_STATUS,Arrays.asList("String_Node_Str"));
        columnNamesWithGetMethodNames.put(Constants.FORMAT_TABLE_COLUMN_TASK,Arrays.asList("String_Node_Str"));
        CommandsUtils.printInTableFormat(columnNamesWithGetMethodNames,nodes.toArray(),Constants.OUTPUT_INDENT);
      }
 else {
        System.out.println();
      }
    }
    private boolean checkOutputUpdate(    List<NodeGroupRead> nodeGroups) throws JsonGenerationException, IOException {
      ObjectMapper mapper=new ObjectMapper();
      String ngCurrentInJson=mapper.writeValueAsString(nodeGroups);
      if (ngSnapshotInJson != null && ngSnapshotInJson.equals(ngCurrentInJson)) {
        needUpdate=false;
      }
 else {
        ngSnapshotInJson=ngCurrentInJson;
        needUpdate=true;
      }
      return needUpdate;
    }
  }
;
}

Fixed version (ground truth):
private PrettyOutput getClusterPrettyOutputCallBack(final ClusterRestClient clusterRestClient,final String id){
  return new PrettyOutput(){
    private String ngSnapshotInJson=null;
    private boolean needUpdate=true;
    private ClusterRead cluster=null;
    public void prettyOutput() throws Exception {
      try {
        if (cluster != null) {
          List<NodeGroupRead> nodeGroups=cluster.getNodeGroups();
          if (nodeGroups != null) {
            for (            NodeGroupRead nodeGroup : nodeGroups) {
              System.out.printf("String_Node_Str",nodeGroup.getName(),nodeGroup.getInstanceNum());
              System.out.printf("String_Node_Str",nodeGroup.getRoles());
              printNodesInfo(nodeGroup.getInstances());
            }
          }
        }
      }
 catch (      Exception e) {
        throw e;
      }
    }
    public boolean isRefresh(    boolean realTime) throws Exception {
      try {
        cluster=clusterRestClient.get(id,realTime);
        if (cluster != null) {
          List<NodeGroupRead> nodeGroups=cluster.getNodeGroups();
          if (nodeGroups != null) {
            return checkOutputUpdate(nodeGroups);
          }
        }
        return false;
      }
 catch (      CliRestException expectedException) {
        cluster=null;
        return false;
      }
catch (      Exception e) {
        throw e;
      }
    }
    private void printNodesInfo(    List<NodeRead> nodes) throws Exception {
      if (nodes != null && nodes.size() > 0) {
        LinkedHashMap<String,List<String>> columnNamesWithGetMethodNames=new LinkedHashMap<String,List<String>>();
        columnNamesWithGetMethodNames.put(Constants.FORMAT_TABLE_COLUMN_NAME,Arrays.asList("String_Node_Str"));
        columnNamesWithGetMethodNames.put(Constants.FORMAT_TABLE_COLUMN_IP,Arrays.asList("String_Node_Str"));
        columnNamesWithGetMethodNames.put(Constants.FORMAT_TABLE_COLUMN_STATUS,Arrays.asList("String_Node_Str"));
        columnNamesWithGetMethodNames.put(Constants.FORMAT_TABLE_COLUMN_TASK,Arrays.asList("String_Node_Str"));
        CommandsUtils.printInTableFormat(columnNamesWithGetMethodNames,nodes.toArray(),Constants.OUTPUT_INDENT);
      }
 else {
        System.out.println();
      }
    }
    private boolean checkOutputUpdate(    List<NodeGroupRead> nodeGroups) throws JsonGenerationException, IOException {
      ObjectMapper mapper=new ObjectMapper();
      String ngCurrentInJson=mapper.writeValueAsString(nodeGroups);
      if (ngSnapshotInJson != null && ngSnapshotInJson.equals(ngCurrentInJson)) {
        needUpdate=false;
      }
 else {
        ngSnapshotInJson=ngCurrentInJson;
        needUpdate=true;
      }
      return needUpdate;
    }
  }
;
}