classpath
[Top][All Lists]
Advanced

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

Re: NYIException


From: Dalibor Topic
Subject: Re: NYIException
Date: Mon, 29 Sep 2003 03:50:52 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.3) Gecko/20030312

David Holmes wrote:
Per Bothner wrote:

The latter is true, but the former does not follow.  I
think creating
a new non-portable sub-class is solving a non-existent problem.


Ah I see where you are coming from. If an application wants to run
under a variety of VM's and also wants to deal with Classpath's
limitations, it is not going to be able to compile against a host VM
that doesn't have this Classpath specific exception type. If the
application uses the RuntimeException type in its catch clause then it
will catch genuine RuntimeExceptions too and will have to try and
distinguish them (which means reflectively querying its type for the
Classpath specific exception type).

Say you've caught a RuntimeException e:

if (e.getClass().getName().equals("gnu.classpath.NYIException")) {
        // do the classpath dance
}

can compile just fine against any not-gnu-classpath-using VM. You could use reflection, too, but there is no need here.

cheers,
dalibor topic





reply via email to

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