[Soot-list] DotGraph.getNode javadoc needs a fix

Quentin Sabah quentin.sabah at inria.fr
Fri Mar 2 05:38:38 EST 2012


Hi all, 

I'm currently working with Soot and I may have found a little error in the documentation.
I could not find any bug-tracker for Soot, so here is my report:

In soot/util/dot/DotGraph.java, the Javadoc specify getNode do returns null when there is no node with the given name:

   * @return the node with the specified name, or <code>null</code>
   * if there is no such node.

However, when looking at the code, we observe that getNode returns a fresh node when there is no node with the given name:

  public DotGraphNode getNode(String name){
      DotGraphNode node = nodes.get(name);
      if (node == null) {
          node = new DotGraphNode(name);
          nodes.put(name, node);
      }
      return node;
  }

I think the patch is trivial, change the Javadoc to something like:

   * @return the node with the specified name, adding a new node
   * to the graph if there is no such node.

Regards.

-- 
Quentin Sabah, co-funded Ph.D. student
Grenoble University
INRIA-SARDES                   | STMicroelectronics/AST
Montbonnot, France             | Grenoble, France
mailto:quentin.sabah at inria.fr  | mailto:quentin.sabah at st.com
phone: +33 476 61 52 42        | phone: +33 476 58 44 14


More information about the Soot-list mailing list