This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
RE: unimplemented methods
- From: Øyvind Harboe <oyvind dot harboe at zylin dot com>
- To: "Per Bothner" <per at bothner dot com>,<java at gcc dot gnu dot org>
- Date: Sun, 2 Mar 2003 11:38:06 +0100
- Subject: RE: unimplemented methods
> This has to stop. If an method does not do what it
> is supposed to do, then it must throw an exception.
I think this is generally a good idea. My first encounter
with this sort of thing was Thread.interrupt(), which is
a C++ method, though I assume the same rules apply.
Perhaps the behaviour of unimplemented methods could be
made run-time configurable?
E.g, instead of:
public URI (String scheme, String ssp, String fragment)
throws URISyntaxException
{
throw new UnsupportedOperationException();
}
-->
class TBD
{
static Object unsupported()
{
if (flags)
{
do nothing? log?, etc.
return something??
} else
{
throw new UnsupportedOperationException();
}
}
}
public URI (String scheme, String ssp, String fragment)
throws URISyntaxException
{
return TBD.unsupported();
}