clone() modernization.

git-svn-id: svn+ssh://src.earth.threerings.net/nenya/trunk@872 ed5b42cb-e716-0410-a449-f6a68f950b19
This commit is contained in:
Ray Greenwell
2010-01-13 18:28:28 +00:00
parent a21a692f31
commit f0eaa44cab
6 changed files with 23 additions and 25 deletions
@@ -88,11 +88,10 @@ public abstract class ShaderConfig
}
@Override // documentation inherited
public Object clone ()
public ShaderConfig clone ()
{
ShaderConfig other = null;
try {
other = (ShaderConfig)super.clone();
ShaderConfig other = (ShaderConfig)super.clone();
other._state =
DisplaySystem.getDisplaySystem().getRenderer().createGLSLShaderObjectsState();
other._state.setProgramID(_state.getProgramID());
@@ -112,10 +111,11 @@ public abstract class ShaderConfig
other._textures[ii] = (TextureConfig)_textures[ii].clone();
}
}
return other;
} catch (CloneNotSupportedException e) {
// will not happen
throw new AssertionError(e);
}
return other;
}
/**
@@ -309,13 +309,12 @@ public abstract class ShaderConfig
}
@Override // documentation inherited
public Object clone ()
public LightConfig clone ()
{
try {
return super.clone();
return (LightConfig) super.clone();
} catch (CloneNotSupportedException e) {
// will not happen
return null;
throw new AssertionError(e);
}
}
@@ -341,13 +340,12 @@ public abstract class ShaderConfig
}
@Override // documentation inherited
public Object clone ()
public TextureConfig clone ()
{
try {
return super.clone();
return (TextureConfig) super.clone();
} catch (CloneNotSupportedException e) {
// will not happen
return null;
throw new AssertionError(e);
}
}
+2 -2
View File
@@ -135,12 +135,12 @@ public class Tile // implements Cloneable
// /**
// * Creates a shallow copy of this tile object.
// */
// public Object clone ()
// public Tile clone ()
// {
// try {
// return (Tile)super.clone();
// } catch (CloneNotSupportedException cnse) {
// throw new RuntimeException(cnse);
// throw new AssertionError(cnse);
// }
// }
@@ -112,12 +112,12 @@ public abstract class MisoSceneModel extends SimpleStreamableObject
public abstract boolean removeObject (ObjectInfo info);
@Override
public Object clone ()
public MisoSceneModel clone ()
{
try {
return super.clone();
return (MisoSceneModel) super.clone();
} catch (CloneNotSupportedException cnse) {
throw new RuntimeException(cnse);
throw new AssertionError(cnse);
}
}
}
@@ -166,12 +166,12 @@ public class ObjectInfo extends SimpleStreamableObject
}
@Override
public Object clone ()
public ObjectInfo clone ()
{
try {
return super.clone();
return (ObjectInfo) super.clone();
} catch (CloneNotSupportedException cnse) {
throw new RuntimeException(cnse);
throw new AssertionError(cnse);
}
}
@@ -189,7 +189,7 @@ public class SimpleMisoSceneModel extends MisoSceneModel
}
@Override
public Object clone ()
public SimpleMisoSceneModel clone ()
{
SimpleMisoSceneModel model = (SimpleMisoSceneModel)super.clone();
model.baseTileIds = baseTileIds.clone();
@@ -226,7 +226,7 @@ public class SparseMisoSceneModel extends MisoSceneModel
}
@Override
public Object clone () {
public Section clone () {
try {
Section section = (Section)super.clone();
section.baseTileIds = baseTileIds.clone();
@@ -236,7 +236,7 @@ public class SparseMisoSceneModel extends MisoSceneModel
section.objectInfo = objectInfo.clone();
return section;
} catch (CloneNotSupportedException cnse) {
throw new RuntimeException(cnse);
throw new AssertionError(cnse);
}
}
@@ -453,7 +453,7 @@ public class SparseMisoSceneModel extends MisoSceneModel
}
@Override
public Object clone ()
public SparseMisoSceneModel clone ()
{
SparseMisoSceneModel model = (SparseMisoSceneModel)super.clone();
model._sections = new StreamableHashIntMap<Section>();