scala-ide/scala-refactoring — pull request #64 by sschaef (2014-09-07 19:41:39+00:00)
Title: Add modifiers to lazy vals

I'm not happy how this problem is fixed but I have honestly no idea on
how to make it better.

The original problem is that after adding a modifier to a lazy val, the
result is

lazy val name = ...

whereas the new modifiers should been added before the lazy val
keywords. This couldn't be fixed easily, because the DefDef of a lazy
val has a different structure as a DefDef for a def. A DefDef of a lazy
val does not have the lazy keyword as part of it, it is part of the ValDef.

However, looking up the lazy modifier in the symbol worked. A nicer fix
would be that the refactoring core logic creates the lazy val keywords by
itself at the right position (instead of forcing the creator of a concrete
refactoring to add all necessary keywords), but this turned out to be
quite difficult to implement due to the existence of a DefDef and a
ValDef tree instead of a single LazyValDef tree.

Re #1002234