scala-ide/scala-refactoring — pull request #62 by sschaef (2014-08-18 20:44:12+00:00)
Title: Add ordering for modifiers

When a refactoring adds modifiers to a tree, they need to be sorted,
otherwise one can produce syntax errors. For example, both the `def`
and the `override` keyword are represented as modifiers, but the
`override` keyword needs to be printed first.

This commit adds such an ordering. Because the `Modifiers` tree has
the field `flags` but also the field `positions`, it is not
straightforward to see where to place the flag. Therefore, this also
adds the `withFlag` method to the `Modifiers` class, which takes care
of correctly specifying the flag.