Safe copying
Hello all.
I'm trying to create an application to produce arithmetic functions that use a generic Guess interface, but I'm not sure how to ensure that I have a "clean" Guess object for my calculations. A simple object reference could originate from a source I don't trust and therefore be attacked during the calculation. I'm therefore trying to work out if it's possible to make a defensive copy of an Interface class whose implementation I don't know.
I've settled on the idea of an abstract class that implements the Cloneable interface as well as Guess, with a 'protected final' clone() method that simply calls super.clone() (ie, Object's).
Is this sufficient, or will it simply return a binary copy of my abstract class whatever subclass it's called from because it's declared final? There seems to be very little info on the mechanics of the Cloneable interface and exactly how this works.
Alternatively, has anyone else run into this problem and, if so, how did you solve it?
Thanks in advance
Winston

