Re: How is tag interface functionality implemented in Java continued ...?



ankur wrote:
Read the Javadocs and the question is still not answered.
"The method clone for class Object performs a specific cloning
operation. First, if the class of this object does not implement the
interface Cloneable, then a CloneNotSupportedException is thrown. "

How is the exception thrown? I am trying to understand by looking at
Java library code how the exception is thrown ??
I did not(could not) find anything to that effect in Object.java,
Cloneable.java, Exception.java etc !!

First of all: Java is a standard. I very much doubt that the
Java standard specifies how it should be implemented. The
java docs document the contract for all Java implementations.

Second: if we narrow the question to SUN's Java implementation,
then you need to look at the provided source code. If you are
interested in the behavior of Object.clone, then you find
that method in the source. When you do that then you
will see that it is a native method, which tells you that
the exception is thrown from some C code. If you want to
see that C code you should grab a copy of the open source
version of SUN Java (OpenJDK) and find the code. But
there are really not much point - the important part
is described above under "first".

Arne
.



Relevant Pages

  • Java, JNDI, AD, Expired Passwords
    ... I am trying to use Java and JNDI to allow a user to ... the exception of one problem. ... thrown and I cannot use that user's credentials to change his password. ...
    (comp.lang.java.programmer)
  • Re: InvocationTarget Exception missing StackTrace
    ... It is probably because the exception that gets thrown by the method is a non ... Java exception (an exception that derives from System.Exception but not from ... because it prevents you from using the Java reflection API if you want to be ...
    (microsoft.public.dotnet.vjsharp)
  • Re: .Net Exceptions
    ... Errors are only thrown by the JVM. ... If a component throws an Exception, ... I prefer to not get into an argument about JAVA ... >> recover from an exception or it doesn't. ...
    (microsoft.public.dotnet.general)
  • Re: Java vs C++, A Newbies perspective.
    ... It's because Java is right and force you to do all in correct way. ... when it's possible that Exception could be thrown then you ... When will they invent a language that makes it ALL easy?! ...
    (comp.lang.java.programmer)
  • Re: CMutex /CEvent (multiple threads)
    ... deals with exception detection. ...  If your function does not handle an exception in Java, ... designer did not understand what a Mutex was and that the notion that Lock could return ... ...roll back transaction ...
    (microsoft.public.vc.mfc)