improve safety of Props.create by allowing Creator<T>, see #3377

Props constructors need to be deprecated instead of being mutated
because we cannot just start throwing exceptions in people’s existing
code. Props.withCreator is deprecated for similar reasons, but also
because Props are about the creators, so replacing that after the fact
is not good style.
This commit is contained in:
Roland 2013-05-28 10:39:38 +02:00
parent 58756be937
commit f8fa825e48
11 changed files with 222 additions and 45 deletions

View file

@ -48,7 +48,8 @@ trait Effect {
/**
* A constructor/factory, takes no parameters but creates a new value of type T every call.
*/
trait Creator[T] {
@SerialVersionUID(1L)
trait Creator[T] extends Serializable {
/**
* This method must return a different instance upon every call.
*/