gnu-arch-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Gnu-arch-users] Re: [OT] Java is fun!


From: Tom Lord
Subject: Re: [Gnu-arch-users] Re: [OT] Java is fun!
Date: Wed, 22 Oct 2003 14:52:53 -0700 (PDT)

    > From: address@hidden

    > > otherwise, what about the unfortunate caller who has code:

    > >                 try {
    > >                   List lines=Reader.getLinesOfFile(fileName);
    > >                   Answer a=Parser.parseLines(lines);
    > >                 } catch (IOException e) {
    > >                   ...
    > >                 } catch (ParserException e) {
    > >                   ...
    > >                 }
    > > Hey, who _really_ raised that ParserException?

    > Stop bashing java, you obviously have no idea what you are talking about
    > and are basically making a fool of yourself; your expertise is somewhere
    > else; take the ideas you like and walk away.

    > Just thought you should know.

    > Thomas Zander

Please defend your claim.  You have made a strong claim and given
absolutely no justification (or even clear explanation) of what you
are trying to say.  If I'm a fool I'm a fool but please indulge me and
explain why I should believe so.

I quoted, chapter and verse, sections of the Java Langauge
specification which show how the problem I illustrated with that code
arises.  Which part, exactly, are you claiming is wrong?

To briefly reiterate, the above code is compiled at a time or location
where:

        Reader.getLinesOfFiles
                is declared with:

                throws IOException;

and

        Parser.parseLines
                is declared with:

                throws ParserException;


and it seems (according to _your_ claims (among others) about the
meaning of throws declarations) that the author of a code snippet such
as the above can reasonably assume:


        the body of 'catch (IOException e)'
                is reached because an exception is thrown from
                Reader.getLinesOfFiles

        the body of 'catch (ParserException e)'
                is reached because an exception is thrown from
                Parser.parseLines

Yet the language specs prove that such an assumption is _false_ unless
I (externally to Java) ensure that the code snippet is linked with the
same versions of Reader and Parser it was compiled against.  Do you
claim I have misundersood the spec?  If so, how?

Indeed, your claims aside -- a Java compiler is _required_ to reject
many programs that might make a more conservative assumption (hence
the need for 'catch (Throwable e)'.

What, am I making a syntax error or something that you use as an
excuse to flame me?

What's your point?

One of _my_ points is that given the opportunity to link a new version
of a compiled package with earlier compiled other packages, I can
modify my new version of my package to "break the exception contracts"
that were supposedly in force when the earlier compiled packages were
written.  Another of my points is that even if those other package are
recompiled, the newly broken contracts won't be flagged by the
compiler.  You don't think that those are problems?  Why do you
suppose, then, that the clu designers explicitly solved them?  Did
they also "not know what [they were] talking about?"

-t




reply via email to

[Prev in Thread] Current Thread [Next in Thread]