This is the mail archive of the java@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]