model: `new` factories have a return type.
[nit.git] / src / toolcontext.nit
index fd9ce98..e174145 100644 (file)
@@ -103,7 +103,7 @@ class ToolContext
 
        # Messages
        private var messages = new Array[Message]
-       private var message_sorter = new ComparableSorter[Message]
+       private var message_sorter: Comparator = default_comparator
 
        # Output all current stacked messages.
        # If some errors occurred, exits the program.
@@ -472,7 +472,7 @@ class BashCompletion
                addn "  COMPREPLY=()"
                addn "  cur=\"$\{COMP_WORDS[COMP_CWORD]\}\""
                addn "  prev=\"$\{COMP_WORDS[COMP_CWORD-1]\}\""
-               if option_names != null then
+               if not option_names.is_empty then
                        addn "  opts=\"{option_names.join(" ")}\""
                        addn "  if [[ $\{cur\} == -* ]] ; then"
                        addn "          COMPREPLY=( $(compgen -W \"$\{opts\}\" -- $\{cur\}) )"