Handle CloneNotSupportedException in a standard and most-correct way.

git-svn-id: svn+ssh://src.earth.threerings.net/nenya/trunk@17 ed5b42cb-e716-0410-a449-f6a68f950b19
This commit is contained in:
Ray Greenwell
2006-07-13 18:08:03 +00:00
parent 62104e811c
commit 005043bf6c
4 changed files with 5 additions and 8 deletions
+1 -2
View File
@@ -136,8 +136,7 @@ public class Tile // implements Cloneable
// try { // try {
// return (Tile)super.clone(); // return (Tile)super.clone();
// } catch (CloneNotSupportedException cnse) { // } catch (CloneNotSupportedException cnse) {
// String errmsg = "All is wrong with the universe: " + cnse; // throw new RuntimeException(cnse);
// throw new RuntimeException(errmsg);
// } // }
// } // }
@@ -118,9 +118,9 @@ public abstract class MisoSceneModel extends SimpleStreamableObject
public Object clone () public Object clone ()
{ {
try { try {
return (MisoSceneModel)super.clone(); return super.clone();
} catch (CloneNotSupportedException cnse) { } catch (CloneNotSupportedException cnse) {
throw new RuntimeException("MisoSceneModel.clone: " + cnse); throw new RuntimeException(cnse);
} }
} }
@@ -154,8 +154,7 @@ public class ObjectInfo extends SimpleStreamableObject
try { try {
return super.clone(); return super.clone();
} catch (CloneNotSupportedException cnse) { } catch (CloneNotSupportedException cnse) {
// notgunnahappen. throw new RuntimeException(cnse);
return null;
} }
} }
@@ -223,8 +223,7 @@ public class SparseMisoSceneModel extends MisoSceneModel
section.objectInfo = (ObjectInfo[])objectInfo.clone(); section.objectInfo = (ObjectInfo[])objectInfo.clone();
return section; return section;
} catch (CloneNotSupportedException cnse) { } catch (CloneNotSupportedException cnse) {
throw new RuntimeException( throw new RuntimeException(cnse);
"SparseMisoSceneModel.Section.clone: " + cnse);
} }
} }