1 package Analysis.SSJava;
3 import java.io.BufferedWriter;
4 import java.io.FileWriter;
5 import java.io.IOException;
6 import java.util.HashMap;
7 import java.util.HashSet;
8 import java.util.Iterator;
12 import IR.ClassDescriptor;
14 import IR.FieldDescriptor;
15 import IR.MethodDescriptor;
16 import IR.VarDescriptor;
18 public class FlowGraph {
22 Set<FlowNode> returnNodeSet;
25 Map<FlowNode, Set<FlowEdge>> mapFlowNodeToOutEdgeSet;
27 Map<NTuple<Location>, FlowNode> mapLocTupleToFlowNode;
28 Map<FlowNode, NTuple<Location>> mapFlowNodeToLocTuple;
30 // maps the composite representation of field/var descriptors to infer nodes
31 Map<NTuple<Descriptor>, FlowNode> mapDescTupleToInferNode;
33 // maps a paramter descriptor to its index
34 Map<Descriptor, Integer> mapParamDescToIdx;
36 // DS for the lattice generation
37 Map<Integer, FlowNode> mapIdxToFlowNode;
39 public static int interseed = 0;
43 public FlowGraph(MethodDescriptor md, Map<Descriptor, Integer> mapParamDescToIdx) {
45 this.mapFlowNodeToLocTuple = new HashMap<FlowNode, NTuple<Location>>();
46 this.mapLocTupleToFlowNode = new HashMap<NTuple<Location>, FlowNode>();
47 this.mapDescTupleToInferNode = new HashMap<NTuple<Descriptor>, FlowNode>();
48 this.mapParamDescToIdx = new HashMap<Descriptor, Integer>();
49 this.mapParamDescToIdx.putAll(mapParamDescToIdx);
50 this.returnNodeSet = new HashSet<FlowNode>();
51 this.mapIdxToFlowNode = new HashMap<Integer, FlowNode>();
52 this.mapFlowNodeToOutEdgeSet = new HashMap<FlowNode, Set<FlowEdge>>();
55 // create a node for 'this' varialbe
56 // NTuple<Descriptor> thisDescTuple = new NTuple<Descriptor>();
57 // thisDescTuple.add(md.getThis());
59 NTuple<Descriptor> thisVarTuple = new NTuple<Descriptor>();
60 thisVarTuple.add(md.getThis());
61 FlowNode thisNode = createNewFlowNode(thisVarTuple);
62 thisNode.setSkeleton(true);
63 thisVarNode = thisNode;
70 public Map<NTuple<Descriptor>, FlowNode> getMapDescTupleToInferNode() {
71 return mapDescTupleToInferNode;
74 public void setMapDescTupleToInferNode(Map<NTuple<Descriptor>, FlowNode> in) {
75 this.mapDescTupleToInferNode.putAll(in);
78 public Map<NTuple<Location>, FlowNode> getMapLocTupleToFlowNode() {
79 return mapLocTupleToFlowNode;
82 public void setMapLocTupleToFlowNode(Map<NTuple<Location>, FlowNode> in) {
83 this.mapLocTupleToFlowNode.putAll(in);
86 public void setReturnNodeSet(Set<FlowNode> in) {
87 this.returnNodeSet.addAll(in);
90 public void setThisVarNode(FlowNode thisVarNode) {
91 this.thisVarNode = thisVarNode;
94 public Map<Descriptor, Integer> getMapParamDescToIdx() {
95 return mapParamDescToIdx;
98 public FlowNode createIntermediateNode() {
99 NTuple<Descriptor> tuple = new NTuple<Descriptor>();
100 Descriptor interDesc = new InterDescriptor(LocationInference.INTERLOC + interseed);
101 tuple.add(interDesc);
104 FlowNode newNode = new FlowNode(tuple);
105 newNode.setIntermediate(true);
107 mapDescTupleToInferNode.put(tuple, newNode);
108 // nodeSet.add(newNode);
110 System.out.println("create new intermediate node= " + newNode);
115 private void setupMapIdxToDesc() {
117 Set<Descriptor> descSet = mapParamDescToIdx.keySet();
118 for (Iterator iterator = descSet.iterator(); iterator.hasNext();) {
119 Descriptor paramDesc = (Descriptor) iterator.next();
120 int idx = mapParamDescToIdx.get(paramDesc);
121 NTuple<Descriptor> descTuple = new NTuple<Descriptor>();
122 descTuple.add(paramDesc);
123 FlowNode paramNode = getFlowNode(descTuple);
124 mapIdxToFlowNode.put(idx, paramNode);
125 paramNode.setSkeleton(true);
130 public int getNumParameters() {
131 return mapIdxToFlowNode.keySet().size();
134 public FlowNode getParamFlowNode(int idx) {
135 return mapIdxToFlowNode.get(idx);
138 public Set<FlowEdge> getEdgeSet() {
139 Set<FlowEdge> edgeSet = new HashSet<FlowEdge>();
141 Set<FlowNode> nodeSet = getNodeSet();
142 for (Iterator iterator = nodeSet.iterator(); iterator.hasNext();) {
143 FlowNode flowNode = (FlowNode) iterator.next();
144 edgeSet.addAll(getOutEdgeSet(flowNode));
150 public Set<FlowNode> getNodeSet() {
151 Set<FlowNode> set = new HashSet<FlowNode>();
152 set.addAll(mapDescTupleToInferNode.values());
156 public MethodDescriptor getMethodDescriptor() {
160 public boolean isParamDesc(Descriptor desc) {
162 if (mapParamDescToIdx.containsKey(desc)) {
163 int idx = mapParamDescToIdx.get(desc);
164 if (!md.isStatic() && idx == 0) {
173 public boolean hasEdge(NTuple<Descriptor> fromDescTuple, NTuple<Descriptor> toDescTuple) {
175 FlowNode fromNode = mapDescTupleToInferNode.get(fromDescTuple);
176 FlowNode toNode = mapDescTupleToInferNode.get(toDescTuple);
178 Set<FlowEdge> fromNodeOutEdgeSet = getOutEdgeSet(fromNode);
179 for (Iterator iterator = fromNodeOutEdgeSet.iterator(); iterator.hasNext();) {
180 FlowEdge flowEdge = (FlowEdge) iterator.next();
181 if (flowEdge.getDst().equals(toNode)) {
184 if (hasEdge(flowEdge.getDst().getDescTuple(), toDescTuple)) {
193 public Set<FlowEdge> getOutEdgeSetStartingFrom(FlowNode startNode) {
195 Descriptor prefixDesc = startNode.getCurrentDescTuple().get(0);
197 // returns the set of edges that share the same prefix of startNode
198 Set<FlowEdge> edgeSet = new HashSet<FlowEdge>();
200 for (Iterator<Set<FlowEdge>> iter = mapFlowNodeToOutEdgeSet.values().iterator(); iter.hasNext();) {
201 Set<FlowEdge> nodeEdgeSet = iter.next();
202 for (Iterator<FlowEdge> iter2 = nodeEdgeSet.iterator(); iter2.hasNext();) {
203 FlowEdge edge = iter2.next();
204 if (edge.getInitTuple().get(0).equals(prefixDesc)) {
213 public Set<FlowEdge> getOutEdgeSet(FlowNode node) {
214 if (!mapFlowNodeToOutEdgeSet.containsKey(node)) {
215 mapFlowNodeToOutEdgeSet.put(node, new HashSet<FlowEdge>());
217 return mapFlowNodeToOutEdgeSet.get(node);
220 public void addValueFlowEdge(NTuple<Descriptor> fromDescTuple, NTuple<Descriptor> toDescTuple) {
222 FlowNode fromNode = getFlowNode(fromDescTuple);
223 FlowNode toNode = getFlowNode(toDescTuple);
225 // System.out.println("create an edge from " + fromNode + " to " + toNode);
227 int fromTupleSize = fromDescTuple.size();
228 NTuple<Descriptor> curFromTuple = new NTuple<Descriptor>();
229 for (int i = 0; i < fromTupleSize; i++) {
230 Descriptor desc = fromDescTuple.get(i);
231 curFromTuple.add(desc);
232 int toTupleSize = toDescTuple.size();
233 NTuple<Descriptor> curToTuple = new NTuple<Descriptor>();
234 for (int k = 0; k < toTupleSize; k++) {
235 Descriptor toDesc = toDescTuple.get(k);
236 curToTuple.add(toDesc);
237 addFlowEdge(getFlowNode(curFromTuple), getFlowNode(curToTuple), fromDescTuple, toDescTuple);
241 // int fromTupleSize = fromDescTuple.size();
242 // NTuple<Descriptor> curTuple = new NTuple<Descriptor>();
243 // for (int i = 0; i < fromTupleSize; i++) {
244 // Descriptor desc = fromDescTuple.get(i);
245 // curTuple.add(desc);
246 // addFlowEdge(getFlowNode(curTuple), toNode, fromDescTuple, toDescTuple);
249 // int toTupleSize = toDescTuple.size();
250 // curTuple = new NTuple<Descriptor>();
251 // for (int i = 0; i < toTupleSize; i++) {
252 // Descriptor desc = toDescTuple.get(i);
253 // curTuple.add(desc);
254 // addFlowEdge(fromNode, getFlowNode(curTuple), fromDescTuple, toDescTuple);
259 private void addFlowEdge(FlowNode fromNode, FlowNode toNode, NTuple<Descriptor> initTuple,
260 NTuple<Descriptor> endTuple) {
262 FlowEdge edge = new FlowEdge(fromNode, toNode, initTuple, endTuple);
263 addOutEdge(fromNode, edge);
265 // System.out.println("add a new edge=" + edge);
268 private void addOutEdge(FlowNode fromNode, FlowEdge edge) {
269 if (!mapFlowNodeToOutEdgeSet.containsKey(fromNode)) {
270 mapFlowNodeToOutEdgeSet.put(fromNode, new HashSet<FlowEdge>());
272 mapFlowNodeToOutEdgeSet.get(fromNode).add(edge);
275 public FlowNode getFlowNode(NTuple<Descriptor> descTuple) {
276 if (!mapDescTupleToInferNode.containsKey(descTuple)) {
277 FlowNode node = createNewFlowNode(descTuple);
278 mapDescTupleToInferNode.put(descTuple, node);
280 return mapDescTupleToInferNode.get(descTuple);
283 public FlowNode getThisVarNode() {
287 public FlowNode createNewFlowNode(NTuple<Descriptor> tuple) {
289 if (!mapDescTupleToInferNode.containsKey(tuple)) {
290 FlowNode node = new FlowNode(tuple);
291 mapDescTupleToInferNode.put(tuple, node);
292 // nodeSet.add(node);
294 mapLocTupleToFlowNode.put(getLocationTuple(node), node);
296 if (tuple.size() > 1) {
297 NTuple<Descriptor> baseTuple = tuple.subList(0, tuple.size() - 1);
298 getFlowNode(baseTuple).addFieldNode(node);
301 // System.out.println("Creating new node=" + node);
304 return mapDescTupleToInferNode.get(tuple);
309 public void addReturnFlowNode(NTuple<Descriptor> tuple) {
311 if (!mapDescTupleToInferNode.containsKey(tuple)) {
312 createNewFlowNode(tuple);
315 FlowNode node = mapDescTupleToInferNode.get(tuple);
316 node.setReturn(true);
318 returnNodeSet.add(node);
321 public Set<FlowNode> getReturnNodeSet() {
322 return returnNodeSet;
325 public Set<FlowNode> getLocalReachFlowNodeSetFrom(FlowNode fn) {
326 Set<FlowNode> set = new HashSet<FlowNode>();
327 recurLocalReachFlowNodeSet(fn, set);
331 private void recurLocalReachFlowNodeSet(FlowNode fn, Set<FlowNode> visited) {
333 Set<FlowEdge> outEdgeSet = getOutEdgeSet(fn);
334 for (Iterator iterator = outEdgeSet.iterator(); iterator.hasNext();) {
335 FlowEdge edge = (FlowEdge) iterator.next();
336 FlowNode dstNode = edge.getDst();
338 if (!visited.contains(dstNode)) {
339 visited.add(dstNode);
340 recurLocalReachFlowNodeSet(dstNode, visited);
346 private void getReachFlowNodeSetFrom(FlowNode fn, Set<FlowNode> visited) {
348 Set<FlowEdge> outEdgeSet = getOutEdgeSet(fn);
349 for (Iterator iterator = outEdgeSet.iterator(); iterator.hasNext();) {
350 FlowEdge edge = (FlowEdge) iterator.next();
352 if (fn.equals(getFlowNode(edge.getInitTuple()))) {
353 FlowNode dstNode = getFlowNode(edge.getEndTuple());
354 if (!visited.contains(dstNode)) {
355 visited.add(dstNode);
356 getReachFlowNodeSetFrom(dstNode, visited);
363 public Set<FlowNode> getReachFlowNodeSetFrom(FlowNode fn) {
364 Set<FlowNode> set = new HashSet<FlowNode>();
365 getReachFlowNodeSetFrom(fn, set);
369 public Set<FlowNode> getReachableSetFrom(NTuple<Descriptor> prefix) {
370 Set<FlowNode> reachableSet = new HashSet<FlowNode>();
372 Set<FlowNode> nodeSet = getNodeSet();
373 for (Iterator iterator = nodeSet.iterator(); iterator.hasNext();) {
374 FlowNode flowNode = (FlowNode) iterator.next();
375 if (flowNode.getCurrentDescTuple().startsWith(prefix)) {
376 recurReachableSetFrom(flowNode, reachableSet);
383 // private void getReachFlowNodeSetFrom(FlowNode fn, Set<FlowNode> visited) {
385 // for (Iterator iterator = fn.getOutEdgeSet().iterator();
386 // iterator.hasNext();) {
387 // FlowEdge edge = (FlowEdge) iterator.next();
389 // if (fn.equals(getFlowNode(edge.getInitTuple()))) {
391 // FlowNode dstNode = getFlowNode(edge.getEndTuple());
393 // if (!visited.contains(dstNode)) {
394 // visited.add(dstNode);
395 // getReachFlowNodeSetFrom(dstNode, visited);
402 private void recurReachableSetFrom(FlowNode curNode, Set<FlowNode> reachableSet) {
404 Set<FlowEdge> edgeSet = getOutEdgeSet(curNode);
405 for (Iterator iterator = edgeSet.iterator(); iterator.hasNext();) {
406 FlowEdge edge = (FlowEdge) iterator.next();
407 FlowNode dstNode = getFlowNode(edge.getEndTuple());
408 if (!reachableSet.contains(dstNode)) {
409 reachableSet.add(dstNode);
410 recurReachableSetFrom(dstNode, reachableSet);
416 public Set<NTuple<Location>> getReachableFlowTupleSet(Set<NTuple<Location>> visited, FlowNode fn) {
418 Set<FlowEdge> outEdgeSet = getOutEdgeSet(fn);
420 for (Iterator iterator = outEdgeSet.iterator(); iterator.hasNext();) {
421 FlowEdge edge = (FlowEdge) iterator.next();
423 if (fn.getDescTuple().equals(edge.getInitTuple())) {
424 FlowNode dstNode = getFlowNode(edge.getEndTuple());
425 NTuple<Location> dstTuple = getLocationTuple(dstNode);
427 if (!visited.contains(dstTuple)) {
428 visited.add(dstTuple);
429 visited.addAll(getReachableFlowTupleSet(visited, dstNode));
437 public NTuple<Location> getLocationTuple(NTuple<Descriptor> descTuple) {
438 return getLocationTuple(getFlowNode(descTuple));
441 public NTuple<Location> getLocationTuple(FlowNode fn) {
443 if (!mapFlowNodeToLocTuple.containsKey(fn)) {
444 NTuple<Descriptor> descTuple = fn.getDescTuple();
445 NTuple<Location> locTuple = new NTuple<Location>();
446 ClassDescriptor cd = null;
448 Descriptor localDesc = fn.getDescTuple().get(0);
450 if (fn.isIntermediate()) {
451 Location interLoc = new Location(md, localDesc.getSymbol());
452 interLoc.setLocDescriptor(localDesc);
453 locTuple.add(interLoc);
454 } else if (localDesc.getSymbol().equals(LocationInference.TOPLOC)) {
455 Location topLoc = new Location(md, Location.TOP);
456 topLoc.setLocDescriptor(LocationInference.TOPDESC);
457 locTuple.add(topLoc);
458 } else if (localDesc.getSymbol().equals(LocationInference.GLOBALLOC)) {
459 Location globalLoc = new Location(md, LocationInference.GLOBALLOC);
460 globalLoc.setLocDescriptor(LocationInference.GLOBALDESC);
461 locTuple.add(globalLoc);
464 for (int i = 0; i < descTuple.size(); i++) {
465 Descriptor curDesc = descTuple.get(i);
468 loc = new Location(md, curDesc.getSymbol());
469 loc.setLocDescriptor(curDesc);
470 cd = ((VarDescriptor) curDesc).getType().getClassDesc();
472 loc = new Location(cd, curDesc.getSymbol());
473 loc.setLocDescriptor(curDesc);
475 if (curDesc instanceof FieldDescriptor) {
476 cd = ((FieldDescriptor) curDesc).getType().getClassDesc();
478 cd = ((LocationDescriptor) curDesc).getEnclosingClassDesc();
486 mapFlowNodeToLocTuple.put(fn, locTuple);
488 return mapFlowNodeToLocTuple.get(fn);
491 public Set<FlowNode> getIncomingFlowNodeSet(FlowNode node) {
492 Set<FlowNode> set = new HashSet<FlowNode>();
493 getIncomingFlowNodeSet(node, set);
497 public void getIncomingFlowNodeSet(FlowNode node, Set<FlowNode> visited) {
499 for (Iterator iterator = getNodeSet().iterator(); iterator.hasNext();) {
500 FlowNode curNode = (FlowNode) iterator.next();
501 Set<FlowEdge> edgeSet = getOutEdgeSet(curNode);
503 for (Iterator iterator2 = edgeSet.iterator(); iterator2.hasNext();) {
504 FlowEdge flowEdge = (FlowEdge) iterator2.next();
506 if (node.equals(getFlowNode(flowEdge.getEndTuple()))) {
507 FlowNode incomingNode = getFlowNode(flowEdge.getInitTuple());
509 if (!visited.contains(incomingNode)) {
510 visited.add(incomingNode);
511 getIncomingFlowNodeSet(incomingNode, visited);
519 public Set<NTuple<Location>> getIncomingFlowTupleSet(FlowNode fn) {
521 NTuple<Descriptor> dstTuple = fn.getDescTuple();
523 Set<NTuple<Location>> set = new HashSet<NTuple<Location>>();
525 ClassDescriptor cd = null;
527 for (Iterator iterator = getNodeSet().iterator(); iterator.hasNext();) {
528 FlowNode node = (FlowNode) iterator.next();
530 Set<FlowEdge> edgeSet = getOutEdgeSet(node);
531 for (Iterator iterator2 = edgeSet.iterator(); iterator2.hasNext();) {
532 FlowEdge flowEdge = (FlowEdge) iterator2.next();
533 if (dstTuple.equals(flowEdge.getEndTuple())) {
534 NTuple<Descriptor> initTuple = flowEdge.getInitTuple();
535 NTuple<Location> locTuple = new NTuple<Location>();
536 for (int i = 0; i < initTuple.size(); i++) {
537 Descriptor d = initTuple.get(i);
540 loc = new Location(md, d.getSymbol());
541 cd = ((VarDescriptor) d).getType().getClassDesc();
543 loc = new Location(cd, d.getSymbol());
544 cd = ((FieldDescriptor) d).getType().getClassDesc();
555 public boolean isParameter(NTuple<Descriptor> tuple) {
556 // return true if a descriptor tuple is started with a parameter descriptor
557 Descriptor firstIdxDesc = tuple.get(0);
558 return mapParamDescToIdx.containsKey(firstIdxDesc);
561 public int getParamIdx(NTuple<Descriptor> tuple) {
562 Descriptor firstIdxDesc = tuple.get(0);
563 return mapParamDescToIdx.get(firstIdxDesc);
566 public FlowGraph clone() {
567 FlowGraph clone = new FlowGraph(md, mapParamDescToIdx);
569 // clone.setNodeSet(getNodeSet());
570 clone.setMapLocTupleToFlowNode(getMapLocTupleToFlowNode());
571 clone.setMapFlowNodeToLocTuple(getMapFlowNodeToLocTuple());
572 clone.setMapDescTupleToInferNode(getMapDescTupleToInferNode());
574 clone.setMapFlowNodeToOutEdgeSet(getMapFlowNodeToOutEdgeSet());
575 clone.setReturnNodeSet(getReturnNodeSet());
576 clone.setThisVarNode(getThisVarNode());
581 public Map<FlowNode, NTuple<Location>> getMapFlowNodeToLocTuple() {
582 return mapFlowNodeToLocTuple;
585 public void setMapFlowNodeToLocTuple(Map<FlowNode, NTuple<Location>> in) {
586 this.mapFlowNodeToLocTuple.putAll(in);
589 public Map<FlowNode, Set<FlowEdge>> getMapFlowNodeToOutEdgeSet() {
590 return mapFlowNodeToOutEdgeSet;
593 public void setMapFlowNodeToOutEdgeSet(Map<FlowNode, Set<FlowEdge>> inMap) {
594 Set<FlowNode> keySet = inMap.keySet();
595 for (Iterator iterator = keySet.iterator(); iterator.hasNext();) {
596 FlowNode key = (FlowNode) iterator.next();
597 Set<FlowEdge> newEdgeSet = new HashSet<FlowEdge>();
598 newEdgeSet.addAll(inMap.get(key));
599 mapFlowNodeToOutEdgeSet.put(key, newEdgeSet);
603 private void drawEdges(FlowNode node, BufferedWriter bw, Set<FlowNode> addedNodeSet,
604 Set<FlowEdge> addedEdgeSet) throws IOException {
606 Set<FlowEdge> edgeSet = getOutEdgeSet(node);
608 for (Iterator<FlowEdge> iterator = edgeSet.iterator(); iterator.hasNext();) {
609 FlowEdge flowEdge = iterator.next();
611 FlowNode u = flowEdge.getSrc();
612 FlowNode v = flowEdge.getDst();
614 if (u.getDescTuple().equals(flowEdge.getInitTuple())
615 && v.getDescTuple().equals(flowEdge.getEndTuple())) {
616 // only draw an edge of the actual value flow
618 if (!addedEdgeSet.contains(flowEdge)) {
620 if (!addedNodeSet.contains(u)) {
624 if (!addedNodeSet.contains(v)) {
629 bw.write("" + u.getID() + " -> " + v.getID() + ";\n");
630 addedEdgeSet.add(flowEdge);
638 private void drawNode(FlowNode node, BufferedWriter bw) throws IOException {
639 bw.write(node.getID() + " [label=\"" + node.getPrettyID() + "\"]" + ";\n");
642 public void writeGraph() throws java.io.IOException {
646 public void writeGraph(String suffix) throws java.io.IOException {
648 String graphName = "flowgraph_" + md.toString() + suffix;
649 graphName = graphName.replaceAll("[\\W]", "");
651 BufferedWriter bw = new BufferedWriter(new FileWriter(graphName + ".dot"));
652 bw.write("digraph " + graphName + " {\n");
653 bw.write("compound=true;\n");
655 // then visit every flow node
657 // Iterator<FlowNode> iter = nodeSet.iterator();
658 Iterator<FlowNode> iter = getNodeSet().iterator();
660 Set<FlowEdge> addedEdgeSet = new HashSet<FlowEdge>();
661 Set<FlowNode> addedNodeSet = new HashSet<FlowNode>();
663 while (iter.hasNext()) {
664 FlowNode node = iter.next();
666 if (node.getDescTuple().size() == 1) {
667 // here, we just care about the local variable
668 if (node.getFieldNodeSet().size() > 0) {
669 drawSubgraph(node, bw, addedEdgeSet);
672 drawEdges(node, bw, addedNodeSet, addedEdgeSet);
681 public boolean constainsNode(FlowNode node) {
682 return getNodeSet().contains(node);
685 private void drawSubgraph(FlowNode node, BufferedWriter bw, Set<FlowEdge> addedSet)
688 bw.write("subgraph cluster_" + node.getID() + "{\n");
689 bw.write("label=\"" + node.getPrettyID() + "\";\n");
691 Set<FlowNode> fieldNodeSet = node.getFieldNodeSet();
692 for (Iterator iterator = fieldNodeSet.iterator(); iterator.hasNext();) {
693 FlowNode fieldNode = (FlowNode) iterator.next();
694 if (fieldNode.getFieldNodeSet().size() > 0) {
695 drawSubgraph(fieldNode, bw, addedSet);
697 Descriptor desc = fieldNode.getDescTuple().getLastElement();
698 if (desc instanceof VarDescriptor) {
699 VarDescriptor varDesc = (VarDescriptor) desc;
700 if (varDesc.getType().isPrimitive()) {
701 bw.write(fieldNode.getID() + " [label=\"" + fieldNode.getPrettyID() + "\"];\n");
703 } else if (desc instanceof FieldDescriptor) {
704 FieldDescriptor fieldDesc = (FieldDescriptor) desc;
705 if (fieldDesc.getType().isPrimitive()) {
706 bw.write(fieldNode.getID() + " [label=\"" + fieldNode.getPrettyID() + "\"];\n");