classpath-patches
[Top][All Lists]
Advanced

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

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


From: Michael Koch
Subject: Re: [cp-patches] [Patch] javax.swing.JTextArea: Suggesting to revert.
Date: Thu, 28 Apr 2005 22:00:56 +0200
User-agent: mutt-ng 1.5.9-r265i (Debian)

On Thu, Apr 28, 2005 at 07:44:05PM +0200, Meskauskas Audrius wrote:
> >-        // 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.

While I generally agree I disagree in this case.


Michael
-- 
Escape the Java Trap with GNU Classpath!
http://www.gnu.org/philosophy/java-trap.html

Join the community at http://planet.classpath.org/




reply via email to

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