suppress javac warnings about unchecked casts in read() and write()

This commit is contained in:
Stephen Gold 2020-04-15 16:43:18 -07:00
parent 60967b9f04
commit 297443ada4
23 changed files with 25 additions and 0 deletions

View File

@ -166,6 +166,7 @@ public class CompoundCollisionShape extends CollisionShape {
* @throws IOException from importer * @throws IOException from importer
*/ */
@Override @Override
@SuppressWarnings("unchecked")
public void read(JmeImporter im) throws IOException { public void read(JmeImporter im) throws IOException {
super.read(im); super.read(im);
InputCapsule capsule = im.getCapsule(this); InputCapsule capsule = im.getCapsule(this);

View File

@ -1045,6 +1045,7 @@ public class PhysicsRigidBody extends PhysicsCollisionObject {
* @throws IOException from importer * @throws IOException from importer
*/ */
@Override @Override
@SuppressWarnings("unchecked")
public void read(JmeImporter e) throws IOException { public void read(JmeImporter e) throws IOException {
super.read(e); super.read(e);

View File

@ -643,6 +643,7 @@ public class PhysicsVehicle extends PhysicsRigidBody {
* @throws IOException from importer * @throws IOException from importer
*/ */
@Override @Override
@SuppressWarnings("unchecked")
public void read(JmeImporter im) throws IOException { public void read(JmeImporter im) throws IOException {
InputCapsule capsule = im.getCapsule(this); InputCapsule capsule = im.getCapsule(this);
tuning = new VehicleTuning(); tuning = new VehicleTuning();

View File

@ -330,6 +330,7 @@ public class AnimComposer extends AbstractControl {
} }
@Override @Override
@SuppressWarnings("unchecked")
public void read(JmeImporter im) throws IOException { public void read(JmeImporter im) throws IOException {
super.read(im); super.read(im);
InputCapsule ic = im.getCapsule(this); InputCapsule ic = im.getCapsule(this);

View File

@ -261,6 +261,7 @@ public class Armature implements JmeCloneable, Savable {
@Override @Override
@SuppressWarnings("unchecked")
public void read(JmeImporter im) throws IOException { public void read(JmeImporter im) throws IOException {
InputCapsule input = im.getCapsule(this); InputCapsule input = im.getCapsule(this);

View File

@ -333,6 +333,7 @@ public class Joint implements Savable, JmeCloneable, HasLocalTransform {
} }
@Override @Override
@SuppressWarnings("unchecked")
public void write(JmeExporter ex) throws IOException { public void write(JmeExporter ex) throws IOException {
OutputCapsule output = ex.getCapsule(this); OutputCapsule output = ex.getCapsule(this);

View File

@ -365,6 +365,7 @@ public final class AnimControl extends AbstractControl implements Cloneable, Jme
} }
@Override @Override
@SuppressWarnings("unchecked")
public void read(JmeImporter im) throws IOException { public void read(JmeImporter im) throws IOException {
super.read(im); super.read(im);
InputCapsule in = im.getCapsule(this); InputCapsule in = im.getCapsule(this);

View File

@ -62,6 +62,7 @@ public class TrackInfo implements Savable, JmeCloneable {
} }
@Override @Override
@SuppressWarnings("unchecked")
public void read(JmeImporter im) throws IOException { public void read(JmeImporter im) throws IOException {
InputCapsule c = im.getCapsule(this); InputCapsule c = im.getCapsule(this);
tracks = c.readSavableArrayList("tracks", null); tracks = c.readSavableArrayList("tracks", null);

View File

@ -234,6 +234,7 @@ public class Cinematic extends AbstractCinematicEvent implements AppState {
* @throws IOException * @throws IOException
*/ */
@Override @Override
@SuppressWarnings("unchecked")
public void read(JmeImporter im) throws IOException { public void read(JmeImporter im) throws IOException {
super.read(im); super.read(im);
InputCapsule ic = im.getCapsule(this); InputCapsule ic = im.getCapsule(this);

View File

@ -77,6 +77,7 @@ public class KeyFrame implements Savable {
} }
@Override @Override
@SuppressWarnings("unchecked")
public void read(JmeImporter im) throws IOException { public void read(JmeImporter im) throws IOException {
InputCapsule ic = im.getCapsule(this); InputCapsule ic = im.getCapsule(this);
cinematicEvents = ic.readSavableArrayList("cinematicEvents", null); cinematicEvents = ic.readSavableArrayList("cinematicEvents", null);

View File

@ -105,6 +105,7 @@ public class TimeLine extends HashMap<Integer, KeyFrame> implements Savable {
} }
@Override @Override
@SuppressWarnings("unchecked")
public void write(JmeExporter ex) throws IOException { public void write(JmeExporter ex) throws IOException {
OutputCapsule oc = ex.getCapsule(this); OutputCapsule oc = ex.getCapsule(this);
ArrayList list = new ArrayList(); ArrayList list = new ArrayList();

View File

@ -340,6 +340,7 @@ public final class LightList implements Iterable<Light>, Savable, Cloneable, Jme
} }
@Override @Override
@SuppressWarnings("unchecked")
public void read(JmeImporter im) throws IOException { public void read(JmeImporter im) throws IOException {
InputCapsule ic = im.getCapsule(this); InputCapsule ic = im.getCapsule(this);
// owner = (Spatial) ic.readSavable("owner", null); // owner = (Spatial) ic.readSavable("owner", null);

View File

@ -177,6 +177,7 @@ public class ShaderGenerationInfo implements Savable, Cloneable {
} }
@Override @Override
@SuppressWarnings("unchecked")
public void read(JmeImporter im) throws IOException { public void read(JmeImporter im) throws IOException {
InputCapsule ic = im.getCapsule(this); InputCapsule ic = im.getCapsule(this);
attributes = ic.readSavableArrayList("attributes", new ArrayList<ShaderNodeVariable>()); attributes = ic.readSavableArrayList("attributes", new ArrayList<ShaderNodeVariable>());

View File

@ -682,6 +682,7 @@ public class TechniqueDef implements Savable, Cloneable {
} }
@Override @Override
@SuppressWarnings("unchecked")
public void read(JmeImporter im) throws IOException{ public void read(JmeImporter im) throws IOException{
InputCapsule ic = im.getCapsule(this); InputCapsule ic = im.getCapsule(this);
name = ic.readString("name", null); name = ic.readString("name", null);

View File

@ -455,6 +455,7 @@ public class Spline implements Savable {
} }
@Override @Override
@SuppressWarnings("unchecked")
public void read(JmeImporter im) throws IOException { public void read(JmeImporter im) throws IOException {
InputCapsule in = im.getCapsule(this); InputCapsule in = im.getCapsule(this);

View File

@ -161,6 +161,7 @@ public class AssetLinkNode extends Node {
} }
@Override @Override
@SuppressWarnings("unchecked")
public void read(JmeImporter e) throws IOException { public void read(JmeImporter e) throws IOException {
super.read(e); super.read(e);

View File

@ -1575,6 +1575,7 @@ public class Mesh implements Savable, Cloneable, JmeCloneable {
} }
@Override @Override
@SuppressWarnings("unchecked")
public void write(JmeExporter ex) throws IOException { public void write(JmeExporter ex) throws IOException {
OutputCapsule out = ex.getCapsule(this); OutputCapsule out = ex.getCapsule(this);
@ -1618,6 +1619,7 @@ public class Mesh implements Savable, Cloneable, JmeCloneable {
} }
@Override @Override
@SuppressWarnings("unchecked")
public void read(JmeImporter im) throws IOException { public void read(JmeImporter im) throws IOException {
InputCapsule in = im.getCapsule(this); InputCapsule in = im.getCapsule(this);
meshBound = (BoundingVolume) in.readSavable("modelBound", null); meshBound = (BoundingVolume) in.readSavable("modelBound", null);

View File

@ -735,12 +735,14 @@ public class Node extends Spatial {
this.updateList = cloner.clone(updateList); this.updateList = cloner.clone(updateList);
} }
@Override @Override
@SuppressWarnings("unchecked")
public void write(JmeExporter e) throws IOException { public void write(JmeExporter e) throws IOException {
super.write(e); super.write(e);
e.getCapsule(this).writeSavableArrayList(new ArrayList(children), "children", null); e.getCapsule(this).writeSavableArrayList(new ArrayList(children), "children", null);
} }
@Override @Override
@SuppressWarnings("unchecked")
public void read(JmeImporter e) throws IOException { public void read(JmeImporter e) throws IOException {
// XXX: Load children before loading itself!! // XXX: Load children before loading itself!!
// This prevents empty children list if controls query // This prevents empty children list if controls query

View File

@ -194,6 +194,7 @@ public class ShaderNode implements Savable, Cloneable {
* @throws IOException * @throws IOException
*/ */
@Override @Override
@SuppressWarnings("unchecked")
public void read(JmeImporter im) throws IOException { public void read(JmeImporter im) throws IOException {
InputCapsule ic = im.getCapsule(this); InputCapsule ic = im.getCapsule(this);
name = ic.readString("name", ""); name = ic.readString("name", "");

View File

@ -229,6 +229,7 @@ public class ShaderNodeDefinition implements Savable {
* @throws IOException * @throws IOException
*/ */
@Override @Override
@SuppressWarnings("unchecked")
public void read(JmeImporter im) throws IOException { public void read(JmeImporter im) throws IOException {
InputCapsule ic = im.getCapsule(this); InputCapsule ic = im.getCapsule(this);
name = ic.readString("name", ""); name = ic.readString("name", "");

View File

@ -133,6 +133,7 @@ public class CompoundCollisionShape extends CollisionShape {
} }
@Override @Override
@SuppressWarnings("unchecked")
public void read(JmeImporter im) throws IOException { public void read(JmeImporter im) throws IOException {
super.read(im); super.read(im);
InputCapsule capsule = im.getCapsule(this); InputCapsule capsule = im.getCapsule(this);

View File

@ -684,6 +684,7 @@ public class PhysicsRigidBody extends PhysicsCollisionObject {
* @throws IOException from importer * @throws IOException from importer
*/ */
@Override @Override
@SuppressWarnings("unchecked")
public void read(JmeImporter e) throws IOException { public void read(JmeImporter e) throws IOException {
super.read(e); super.read(e);

View File

@ -477,6 +477,7 @@ public class PhysicsVehicle extends PhysicsRigidBody {
} }
@Override @Override
@SuppressWarnings("unchecked")
public void read(JmeImporter im) throws IOException { public void read(JmeImporter im) throws IOException {
InputCapsule capsule = im.getCapsule(this); InputCapsule capsule = im.getCapsule(this);
tuning = new VehicleTuning(); tuning = new VehicleTuning();