Cd_graph{ void checkInheritanceCycle(ClassGraph cg){{ if(checkMultiInheritance(cg) == true){ System.out.println("Checking for Inheritance Cycle violations. . ."); Strategy st = new Strategy("from Cd_graph via Alternat_ns to Vertex"); TraversalGraph tg = new TraversalGraph(st, cg); tg.traverse(this, new Visitor(){ Ident tempSource; Ident currentChild; Ident tempChild; String iCycle = new String(); HashMap hClasses = new HashMap(); void before(Adjacency ad){ tempSource = ad.get_source().get_vertex_name(); } void before(Alternat_ns alt){ Enumeration eChildren = alt.get_alternat_ns().elements(); while(eChildren.hasMoreElements()){ currentChild = ((Term)eChildren.nextElement()). get_vertex().get_vertex_name(); if(false == hClasses.containsValue(currentChild)){ hClasses.put(currentChild, tempSource); } else{ iCycle += ("Inheritance cycle exists from " + tempSource); while(tempSource != null){ tempChild = tempSource; tempSource = (Ident)hClasses.get(tempChild); if(tempSource != null){ iCycle += (" to " + tempSource); } else{ System.out.println(iCycle); iCycle = ""; } } } } } } ); } }} }