I agree with Tim on the if/else thing. In most cases, I'm more comfortable with an explicit if/else. For the record, that is an optional warning that is turned off by default in Eclipse so they don't really promote that code style.

@Override is definitely a good thing.

-Ben

Tim Fennell wrote:
Hey John,

Thanks for the patch. I agree we should definitely apply @Override to everywhere that it makes sense.

On the other note, the "unecessarily in else" - honestly I think that's a code style thing. I'd argue quite strongly that the idiom used is better than the one Eclipse seems to want to promote. When I look at code with an if/else, it's clear that if I modify or remove the IF that the ELSE needs to be considered. The same is not always true when it is structured the other way....

-t

On May 16, 2007, at 3:57 PM, Newman, John W wrote:

Hi,

I finally got a little bit of free time here and I got the stripes trunk to build successfully within eclipse. A while back, I spent some time in the Preferences > Java Compiler > Errors & Warnings tab and turned some reasonable warnings on. One thing that I have found to be great is the lack of @Override giving an error … stripes doesn’t use this and I feel that it definitely should.

i.e.

public int hashcode()  {

    return 12342345; // hmmm why doesn’t this ever run

}

If you tag that with @Override you get an error … Similarly if you never intended to override a method that you infact are, you get an error. This can help a ton with complex generics. In the spirit of java5 and good code I have attached a patch from the trunk.

Also I am getting a TON of warnings about

if (something)  {

     return 0;

} else  {

    return 1;  // unnecessarily in else

}

I can submit a patch for that later.

John

<override.patch.txt>
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/_______________________________________________
Stripes-development mailing list
[email protected] <mailto:[email protected]>
https://lists.sourceforge.net/lists/listinfo/stripes-development

------------------------------------------------------------------------

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
------------------------------------------------------------------------

_______________________________________________
Stripes-development mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/stripes-development
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Stripes-development mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/stripes-development

Reply via email to