On 12 July 2014 23:33, Garret Wilson <[email protected]> wrote:
> Sorry for the flood of emails. I'm excited about contributing to Wicket. I > had a few questions about code conventions: > > * The wiki on Eclipse setup > <https://cwiki.apache.org/confluence/display/WICKET/Setup+Eclipse> > indicates that the Sun coding conventions should be used. Might we > promote this to some general "Coding Conventions" wiki page so that > non-Eclipse will be aware, with a link to the conventions? > * Does Wicket use any standard (alas, there is no standard; JSR 305 is > dormant) library for @NonNull annotations and the like? There exists > com.google.code.findbugs.jsr305 at least. (My client is rolling > their own, which I suppose is better than nothing.) I'd recommend > going with /something/ at least, because sometimes the Wicket > Javadoc documentation can be a bit lacking when indicating whether > nulls are allowed; an annotation is so easy that perhaps it would > promote more transparency in this area. > * What does Wicket prefer to use for null-checking? For years I rolled > my own, but finally my client committed to Google Guava, which has a > very nice Preconditions.checkNotNull() and other preconditions. Does > Wicket have any similar dependency that one can use? If not, would > it be OK to add such a class? Such preconditions are very useful and > highly recommended. > > > Cheers, > > Garret > > For null checking I'd prefer if the api changed so that nullable arguments are replaced with an Optional<value>. Java8 java.util.Optional Guava com.google.common.base.Optional This makes using the library simpler (imho) as the argument types clearly say when a value is required. Checking at runtime or via annotations is a pretty poor substitute. One for Wicket 8 ? -- Peter Henderson
