Rickard Öberg wrote:
> Just checking, should I go ahead and implement @Optional? I.e. assume
> that all method parameters are non-null by default (and throw NPE if
> they are null), and then allow setting @Optional as an annotation if the
> value can be null. This would remove the @NotNull constraint in the
> process, which seems like a good thing (as it is used almost everywhere
> now).
I'm almost done, but there is one change that I did to the above.
Instead of thowing NPE I reused the ConstraintViolationException, since
that makes it easier to do consistent error message handling, and for
parameters it also gives the possibility of using names for even better
error messages.
E.g:
void doStuff(@Optional @Name("optionalParameter") param1,
@Name("mandatoryParameter") param2);
With the above the names will be included in the thrown CVE.
/Rickard
_______________________________________________
qi4j-dev mailing list
[email protected]
http://lists.ops4j.org/mailman/listinfo/qi4j-dev