src: use `as_notnullable` in code
[nit.git] / src / model_viz.nit
index 44f539d..20be8c3 100644 (file)
@@ -30,7 +30,7 @@ class MProjectTree
 
        redef fun display(a) do
                if a isa MGroup then
-                       if a.parent == null then return "{a.mproject.name} ({a.filepath})"
+                       if a.parent == null then return "{a.mproject.name} ({a.filepath.to_s})"
                        return a.name + " (group)"
                else if a isa MModule then
                        return a.name
@@ -39,7 +39,7 @@ class MProjectTree
                end
        end
 
-       var linex_comparator: nullable LinexComparator = null
+       private var linex_comparator: nullable LinexComparator = null
 
        # Sort modules and groups with their names
        fun sort_with_alpha
@@ -62,7 +62,7 @@ end
 # Compare modules and groups using the
 # FIXME do not use Object, but a better common interface of MModule and MGroup
 private class LinexComparator
-       super AbstractSorter[Object]
+       super Comparator[Object]
        var mins = new HashMap [MGroup, nullable MModule]
        var maxs = new HashMap [MGroup, nullable MModule]
        fun min(o: Object): nullable MModule do
@@ -148,7 +148,7 @@ class MProjectDot
        # Initially empty, modules can be added
        var mmodules = new HashSet[MModule]
 
-       private fun node_for(mmodule: MModule): nullable String
+       private fun node_for(mmodule: MModule): String
        do
                return "m_{mmodule.object_id}"
        end
@@ -166,7 +166,7 @@ class MProjectDot
                if mgroup.parent == null then
                        # is is a root group, so display the project
                        if project_group then
-                               o.write("subgraph cluster_{mgroup.object_id} \{\nlabel=\"{mgroup.mproject.name}\\n({mgroup.filepath})\"\ncolor=black\nstyle=dotted\n")
+                               o.write("subgraph cluster_{mgroup.object_id} \{\nlabel=\"{mgroup.mproject.name}\\n({mgroup.filepath.to_s})\"\ncolor=black\nstyle=dotted\n")
                        end
                else
                        if cluster_group then