I'm looking in the codestyle-eclipse-java.xml configuration file. The
IDEA configuration doesn't require whitespace around wildcards (actually
it doesn't say anything about that, so it uses the default).
Checkstyle indeed doesn't seem to complain either way, and although we
do include WILDCARD_TYPE in the WhitespaceAround check, I think that one
isn't actually taken into account. The current documentation doesn't
mention WILDCARD_TYPE as a valid token to include in this configuration,
so we could remove it from checkstyle.xml.
On 07/18/2014 12:45 PM, vincent(a)massol.net wrote:
Isn’t this checkstyle’s default? In general when I
coded the first checkstyle.xml I tried to follow the default as much as possible since the
checkstyle’s team has usually defined sensible defaults after comparing various projects.
Are you sure we’re checking this in checkstyle btw? I’m asking because I remember using
it without spaces recently and checkstyle not complaining
Otherwise I’m +0 to change it (where is it defined?).
Thanks
-Vincent
On 18 Jul 2014 at 18:38:41, Sergiu Dumitriu (sergiu@xwiki.org(mailto:sergiu@xwiki.org))
wrote:
Hi devs,
The current codestyle for wildcard type parameters is to use spaces
around it, as in:
List< ? >
Map< ? , ? >
Map
As opposed to specific parameters:
List
List
Map
Map
This might have a historical reason, when we defined the codestyle,
Eclipse couldn't make the difference between "?" as a wildcard type and
"?" as the ternary operator.
The standard Java, Eclipse, and IDEA style conventions don't use the
extra space.
Personally, I don't think that the wildcard needs the extra space, so +1
for this change.
--
Sergiu Dumitriu
http://purl.org/net/sergiu _______________________________________________
devs mailing list
devs(a)xwiki.org
http://lists.xwiki.org/mailman/listinfo/devs