class Callgraph {

  public Callgraph(Graph<org.eclipse.steady.shared.json.model.ConstructId> _g) {
    if (_g != null) {

      // The problems described in Jira ticket VULAS-1429 look as if the caches survive A2C
      // executions on different modules. Check and clear explicitly.
      if (!this.cachedJarUrls.isEmpty()) {
        log.warn("JAR URL cache not empty, clearing now...");
        this.cachedJarUrls.clear();
      }
      if (!this.jarAnalyzersCache.isEmpty()) {
        log.warn("JarAnalyzer cache not empty, clearing now ...");
        this.jarAnalyzersCache.clear();
      }

      Iterator<org.eclipse.steady.shared.json.model.ConstructId> iter = _g.iterator();
      org.eclipse.steady.shared.json.model.ConstructId src_node = null, tgt_node = null;
      Iterator<org.eclipse.steady.shared.json.model.ConstructId> succNodes = null;
      Integer src_id = null, tgt_id = null, count = -1;

      // Populate the map of constructs and integers
      while (iter.hasNext()) {
        this.nodeCount++;
        src_node = iter.next();
        src_id = this.nodeMap.get(src_node);
        if (src_id == null) {
          src_id = ++count;
          this.nodeMap.put(src_node, src_id);
          this.nodeInfoMap.put(src_id, this.createNodeMetaInformation(src_node, src_id));
          this.nodeId.add(src_node);
          this.idgraph.addNode(src_id);
        }
        // targets
        succNodes = _g.getSuccNodes(src_node);
        while (succNodes.hasNext()) {
          this.edgeCount++;
          tgt_node = succNodes.next();
          tgt_id = this.nodeMap.get(tgt_node);
          if (tgt_id == null) {
            tgt_id = ++count;
            this.nodeMap.put(tgt_node, tgt_id);
            this.nodeInfoMap.put(tgt_id, this.createNodeMetaInformation(tgt_node, tgt_id));
            this.nodeId.add(tgt_node);
            this.idgraph.addNode(tgt_id);
          }
          // add edges
          this.idgraph.addEdge(src_id, tgt_id);
        }
      }
      Callgraph.log.info("Built Graph<Integer> of " + this.idgraph.getNumberOfNodes() + " nodes");
    }
  }

  public  Callgraph(Graph<org.eclipse.steady.shared.json.model.ConstructId> _g);

}