unimplemented methods

Per Bothner per@bothner.com
Sun Mar 2 00:50:00 GMT 2003


A possible refinement:

throw new UnsupportedOperationException ("not implemented");

This makes it clear that it's an unimplemented feature,
rather than the usual collections invalid call.

The string "not implemented" also makes it easy for
our tools to search for, so we can generate more useful summaries.
And it's boilerplate - you can paste the same string into
every method.  We can allow extra information:

"not implemented - needs javax.xx.YY first"

So my suggested coding standard:

throw new UnsupportedOperationException (REASON);
where REASON is a string literal that includes "not implemented"
and all on a single line (to make it easy to grep for).
-- 
	--Per Bothner
per@bothner.com   http://www.bothner.com/per/



More information about the Java mailing list