brooklyncentral/brooklyn — pull request #36 by aledsage (2012-04-26 22:54:03+00:00)
Title: Support setting default values for fields with SetFromFlag

This seemed like a good idea at the time, but now I'm not so sure :-(

It's currently needed because AbstractEntity.configure() is called during AbstractEntity's constructor. So if a field in the sub-class is marked as @SetFromFlag and also has an explicit value then the explicit value will be set after the super-constructor is called - so the config value will be lost. E.g. if you wrote:
@SetFromFlag String foo = "myval"

But there was talk of refactoring this so we don't have the horribleness of calling configure in the super-class's constructor. That would make this default value in SetFromFlag completely unnecessary I believe...