This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Re: unimplemented methods
- From: "Aaron M. Renn" <arenn at urbanophile dot com>
- To: Per Bothner <per at bothner dot com>
- Cc: java at gcc dot gnu dot org, classpath at gnu dot org
- Date: Sat, 1 Mar 2003 19:33:25 -0600
- Subject: Re: unimplemented methods
- Organization: GNU's Not Unix!
- References: <3E614A11.40405@bothner.com>
Per Bothner (per at bothner dot com) wrote:
> I just looked at a couple of classes (java.net.URI
> and java.awt.GridBagLayout) and noticed lots of
> unimplemented methods just do nothing or return null.
>
> This has to stop. If an method does not do what it
> is supposed to do, then it must throw an exception.
...
> That raises the question: What exception to throw?
> We could add a special gnu exception, but I suggest
> UnsupportedOperationException. E.g:
In several cases, an Error("Not implemented yet") is
thrown. I'm in complete agreement that unimplemented
methods should throw some type of exception. Also
the source code should be prominently marked with
FIXME or XXX indicating work to be done.
--
Aaron M. Renn (arenn at urbanophile dot com) http://www.urbanophile.com/arenn/