CloneBase () { /* * Additionally, when you use the concept of 'co-variant return values' * you create 'bridge' methods. By way of example, because we change the * return type of clone() from Object to CloneBase, Java is forced to * put in a 'bridge' method that has an Object return type, even though * we never actually call it. <p> This has an impact on the code * coverage tool Cobertura, which reports that there is missed code (and * there is, the bridge method). It reports it as being '0' calls to the * 'class' line (the class line is marked red). By making this CloneBase * code do the first level of co-variant return, it is this class which * is victim of the Cobertura reporting, not the multiple subclasses * (like Attribute, Document, Content, etc.). */ try { return (CloneBase)super.clone(); } catch (CloneNotSupportedException e) { throw new IllegalStateException(String.format( "Unable to clone class %s which should always support it.", this.getClass().getName()), e); } }