[Top][All Lists]

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

Re: [cp-patches] [Patch] javax.swing.JTextArea: Suggesting to revert.

From: Meskauskas Audrius
Subject: Re: [cp-patches] [Patch] javax.swing.JTextArea: Suggesting to revert.
Date: Thu, 28 Apr 2005 19:44:05 +0200

-        // This cannot happen as we check offset above.
-        throw new Error("Please report a bug", e);
+ // This cannot happen as we check offset above.

In this world, it is very difficult to say that something really cannot never
happen. The history of Titanic (that cannot sink) or, more recently,
the Columbia shuttle (no need to inspect the reliable themal isolation),
indicates that errors do happen, regardless if we are sure
on something or not.

As we known, one of the first Ariane rockets exploded just because
the computer software has thrown an exception from where it should
never be thrown. The Mars rover had software problems in the past.
These programs were surely written by professionals.

I think, it is especially difficult to be sure about something in the project
like Classpath, where any part of the code may be modified in the
future by another programmer. Even if the code surely does not throw
any exceptions now, the things may change after a couple of years.

Throwing an error makes a potential bug clearly visible. First time it
happens it will be noticed and, thanks to the open source, will be corrected.

The empty catch statement hides the fact that exception has been
thrown. The user may never find that is going wrong, but his/her application
the will not work as expected. The user can just conclude that
Classpath is unstable, preferring some alternative library. The worst,
we may not receive any bug report.

By the way, I think it is especially nasty to return null after catching
that "will never be thrown". In that case the null pointer exception
can be thrown in the users code, probably much later and very far
from the point, where our method has been called.

I think, it might be better to revert this patch.

Audrius Meskauskas

----- Original Message ----- From: "Michael Koch" <address@hidden>
To: <address@hidden>
Sent: Thursday, April 28, 2005 6:55 AM
Subject: [cp-patches] [Patch] javax.swing.JTextArea

Hi list,

I commited the attached patch to merge javax.swing.JTextArea with libgcj


2005-04-28  Michael Koch  <address@hidden>

* javax/swing/
(replaceRange): Removed error throwing.


Classpath-patches mailing list

reply via email to

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