I'm getting an error when I use generics like this:
ArrayList < Foo > fooArrayList;
fooArrayList = new ArrayList < Foo > ();
Checkstyle complains about there not being a space after the last '>' ,
as well as a space being present before the first '('.
Any idea on which way is the correct style, even better, an updated sun
check?
Mark Thomas - 08 Feb 2006 13:29 GMT
> I'm getting an error when I use generics like this:
>
[quoted text clipped - 7 lines]
> Any idea on which way is the correct style, even better, an updated sun
> check?
I would always write it like this:
ArrayList<Foo> fooArrayList;
fooArrayList = new ArrayList<Foo>();
ArrayList<Foo> is one type, so no spaces.
ArrayList<Foo>() is one constructor, so no spaces.
Mark