apparently the problem is that different versions of Java throw different errors. So it might be best to catch this here and pass it on as a different exception, perhaps JmolCloneAtomException.
Is that easy to do? Bob René Kanters wrote: > Hi, > > When I use Eclipse and comment out the try/catch clause around around > the return (Atom)super.clone(), I only get the message the > the CloneNotSupportedException is not caught. I can not get the > javadoc for the particular javax.vecmath.Point3f class, so it is hard > to tell which exceptions could be thrown. When checking the online > java3d Point3f documentation I see it descends from the Tuple3f and > that class's clone method only throws a java.lang.OutOfMemoryError > (and doesn't mention the clone not supported one). > > It seems to me that the safest thing to do is to not catch the > exception if there is not something useful you can do with it. This > means that a lot of methods need to have the 'throws ....' added to > them, but it should make the interface clearer and allow the 'highest > level' caller, usually the reader (or some symmetry calculation which > can produce more atoms in an atomset), to be able to figure out that > something was wrong when the file was read. > > As Miguel points out it can be very dangerous to return a null when > there really was an 'exceptional' condition in the execution of the > code, unless you rethrow the exception (but in that case I don't think > the return value even comes back to the callee....). > > Just my rusty thoughts this subject.... > > Cheers, > René > > On Feb 10, 2007, at 7:02 AM, Bob Hanson wrote: > >> Thanks, Miguel. Yes, that's very helpful. The context is the copying >> of a coordinate data set for vibrations and such. >> >> Can someone remind me when it is that this error became a problem? >> >> Is it >> >> (a) that certain implementations of Java don't clone our atoms, and >> so were properly throwing this clone exception, or >> >> (b) that we were looking for the wrong exception in those cases, and >> although >> the exception was never actually thrown, the presence of the try/catch >> was not compiling on those machines? >> >> Bob >> >> >> >> ------------------------------------------------------------------------- >> Using Tomcat but need to do more? Need to support web services, security? >> Get stuff done quickly with pre-integrated technology to make your >> job easier. >> Download IBM WebSphere Application Server v.1.0.1 based on Apache >> Geronimo >> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 >> <http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642> >> _______________________________________________ >> Jmol-developers mailing list >> [email protected] >> <mailto:[email protected]> >> https://lists.sourceforge.net/lists/listinfo/jmol-developers > > > >------------------------------------------------------------------------ > >------------------------------------------------------------------------- >Using Tomcat but need to do more? Need to support web services, security? >Get stuff done quickly with pre-integrated technology to make your job easier. >Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo >http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 > >------------------------------------------------------------------------ > >_______________________________________________ >Jmol-developers mailing list >[email protected] >https://lists.sourceforge.net/lists/listinfo/jmol-developers > > ------------------------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier. Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 _______________________________________________ Jmol-developers mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/jmol-developers
