unimplemented methods

Øyvind Harboe oyvind.harboe@zylin.com
Sun Mar 2 10:43:00 GMT 2003


> 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();
   }



More information about the Java mailing list