[jdom-interest] XMLOutputter to the rescue (get/setText)

Richard Cook rpc at prismtechnologies.com
Thu Jul 12 07:52:09 PDT 2001


I think java licensing makes it OK for the nuclear bit.
but data oriented could be fooled by recursion:
  <group>
    <entry>fred</entry>
    <entry>jim</entry>
  </group>
traversing in a composite like way I find a node with "fred..jim" and nodes
with "fred" and "jim"
but as long as the action is consistent and documented it doesn't matter too
much. Sun are quite happy to put all their .equals() requirements in the
javadoc.



-----Original Message-----
From: jdom-interest-admin at jdom.org [mailto:jdom-interest-admin at jdom.org]On
Behalf Of Elliotte Rusty Harold
Sent: 12 July 2001 14:25
To: 'JDOM Interest List'
Subject: Re: [jdom-interest] XMLOutputter to the rescue (get/setText)

At 5:37 PM -0700 7/11/01, guru at stinky.com wrote:


>>  The current behavior is simply not an option, even with a Javadoc
>> note on the point. It's just way too dangerous.
>
>It's dangerous because...?  I agree it's a little unintuitive, but not
>dangerous.  (Not as dangerous as an unchecked exception, for instance,
>which could unexpectedly kill a thread without warning.)
>

The current behavior is dangerous because I might write code, test it, see
that it's working, put it into production and have it run correctly for two
weeks at which points somebody throws a document that's formed in a slightly
different way at it and it processes it incorrectly. Consequently a trade
doesn't get executed that should be, or vice versa, or it gets executed at
the wrong price. A laser scalpel cuts along the wrong coordinates. A nuclear
reactor fails to shut down. Most cases would be less catastrophic than this,
but you get the idea.

If I have designed my code to miss handling an important case, then it
should immediately notify someone that it's entered an unexpected state that
it cannot properly handle. I would prefer to make this particular exception
a checked exception so that programmers would be forced to consider the
possibility of mixed content and how they'll handle it if it arrives. But
regardless of whether the exception is checked or unchecked, silent failure
is not an option. The method either succeeds or it tells somebody that it
failed.
--

+-----------------------+------------------------+-------------------+
| Elliotte Rusty Harold | elharo at metalab.unc.edu | Writer/Programmer |
+-----------------------+------------------------+-------------------+
|          The XML Bible, 2nd Edition (Hungry Minds, 2001)           |
|              http://www.ibiblio.org/xml/books/bible2/              |
|   http://www.amazon.com/exec/obidos/ISBN=0764547607/cafeaulaitA/   |
+----------------------------------+---------------------------------+
|  Read Cafe au Lait for Java News:  http://www.cafeaulait.org/      |
|  Read Cafe con Leche for XML News: http://www.ibiblio.org/xml/     |
+----------------------------------+---------------------------------+
_______________________________________________
To control your jdom-interest membership:
http://lists.denveronline.net/mailman/options/jdom-interest/youraddr@yourhos
t.com




More information about the jdom-interest mailing list