Re: EnumSet + contains: strange behavior
- From: Thomas Hawtin <usenet@xxxxxxxxxxxxxxxxx>
- Date: Wed, 31 May 2006 19:29:20 +0100
Oliver Wong wrote:
"Ulrich Scholz" <d4@xxxxxxxxxxx> wrote in message news:1149087937.551514.198980@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
if(result.contains(EnumTest.ONE));
{
There are semicolons after the if statement. Get rid of them.
I once spent a day or two trying to optimise some embedded code before I realised I had a semicolon in the middle of an if statement (pessimising the code would have actually made it sound better).
So, always put opening braces where god intended (and as instructed by the Java coding standard). And never treat them as optional in if/else/for/do/while statements (except in the else-if chain idiom).</code-style-police>
Tom Hawtin
--
Unemployed English Java programmer
http://jroller.com/page/tackline/
.
- References:
- EnumSet + contains: strange behavior
- From: Ulrich Scholz
- Re: EnumSet + contains: strange behavior
- From: Oliver Wong
- EnumSet + contains: strange behavior
- Prev by Date: Re: Passing tab char in command line
- Next by Date: Send both parameters and objects to servlet
- Previous by thread: Re: EnumSet + contains: strange behavior
- Next by thread: SoftReference operation synchronization detail
- Index(es):