Tom Tromey writes:
> >>>>> "Mario" == Mario Torre <[EMAIL PROTECTED]> writes:
>
> I spoke too soon, sorry :(
>
> Mario> for (p = 0;
> Mario> p < data.length && data[p].getType() ==
> ElementSpec.EndTagType;
> Mario> - p++);
> Mario> + p++) continue;
>
> Loops like this are idiomatic. Adding a 'continue' looks weird.
I agree, this is unpleasant. Is there some sort of compiler bug here,
or does Java have some syntatctical restrictions I don't know about?
A for loop with no body is, as you say, quite usual.
In general I'm opposed to this kind of change. We've got perfectly
correct idiomatic Java code and we're being jerked around any an
unhelpful compiler warning.
A few of the changes are good, though, such as this one:
Index: gnu/java/nio/charset/ByteCharset.java
===================================================================
RCS file: /cvsroot/classpath/classpath/gnu/java/nio/charset/ByteCharset.java,v
retrieving revision 1.3
diff -u -r1.3 ByteCharset.java
--- gnu/java/nio/charset/ByteCharset.java 25 Sep 2006 19:19:47 -0000
1.3
+++ gnu/java/nio/charset/ByteCharset.java 19 Dec 2006 01:03:37 -0000
@@ -115,8 +115,9 @@
return CoderResult.OVERFLOW;
}
- if((c = lookup[(int) (b & 0xFF)]) == NONE);
- // return CoderResult.unmappableForLength (1);
+ //if((c = lookup[(int) (b & 0xFF)]) == NONE);
+ // return CoderResult.unmappableForLength (1);
+ c = lookup[(int) (b & 0xFF)];
out.put (c);
}
This code was so misleading as to be dangerous, and it's good to have
made this fix.
Ultimately, we have to answer a question: do we follow our own style
guidelines, or those made up by the author of a compiler? Some of
these changes make the code worse, or at least harder to understand.
Andrew.