Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / First Aid / February 2006

Tip: Looking for answers? Try searching our database.

Ant problem using CheckStyle with sun checks

Thread view: 
JoshRountree@gmail.com - 07 Feb 2006 18:56 GMT
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


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.