Steve,
On Mon, 24 Nov 2003, Rankin, SE (Stephen) wrote:
> ParseException in
> /apps/cvsbuild/java/source/hdx/src/main/uk/ac/starlink/hdx/HdxDocument.java
> Last useful checkpoint:
> "uk.ac.starlink.hdx.HdxDocument.createDocumentFragment()"
> Encountered "final class" at line 129, column 9.
> Was expecting one of:
> [...]
I'm afraid that, as Mark points out, it's the javancss tool that's messing
up, since the `final' qualifier is legit on a local inner class. It
is almost redundant, however, so it could be removed if you thought it
were really necessary.
If you want to file a JavaNCSS bug report, you might cite section 5.3 of
the JPL book, third edition, which says ``The only modification which
can be applied to local class declarations is final---which, as usual,
prevents the class from being extended''. I can't find any similarly
unambiguous remark in the JLS, but equally nothing which disagrees with
this; the Java grammar has nothing to say about it; nor does the JLS
section on class declarations. Still, the compiler doesn't object,
and so if JavaNCSS wanted to claim it was illegal, they'd have to cite
chapter and verse.
It's in the code because I thought `ooh, that's probably a Good Idea',
and could catch a (albeit unlikely) gotcha, rather than because it's
doing anything crucial.
Norman
--
---------------------------------------------------------------------------
Norman Gray http://www.astro.gla.ac.uk/users/norman/
Physics and Astronomy, University of Glasgow, UK [log in to unmask]
|