suppress more javac warnings about unchecked casts
This commit is contained in:
parent
88c9371a4d
commit
822bcd1300
@ -438,6 +438,7 @@ public class Tweens {
|
|||||||
this.method.setAccessible(true);
|
this.method.setAccessible(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
private static Method findMethod(Class type, String name, Object... args) {
|
private static Method findMethod(Class type, String name, Object... args) {
|
||||||
for (Method m : type.getDeclaredMethods()) {
|
for (Method m : type.getDeclaredMethods()) {
|
||||||
if (!Objects.equals(m.getName(), name)) {
|
if (!Objects.equals(m.getName(), name)) {
|
||||||
|
@ -718,6 +718,7 @@ public class LegacyApplication implements Application, SystemListener {
|
|||||||
* @param runnable The runnable to run in the main jME3 thread
|
* @param runnable The runnable to run in the main jME3 thread
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
public void enqueue(Runnable runnable){
|
public void enqueue(Runnable runnable){
|
||||||
enqueue(new RunnableWrapper(runnable));
|
enqueue(new RunnableWrapper(runnable));
|
||||||
}
|
}
|
||||||
|
@ -242,6 +242,7 @@ public class AppStateManager {
|
|||||||
* @return First attached state that is an instance of stateClass. If failOnMiss is true
|
* @return First attached state that is an instance of stateClass. If failOnMiss is true
|
||||||
* then an IllegalArgumentException is thrown if the state is not attached.
|
* then an IllegalArgumentException is thrown if the state is not attached.
|
||||||
*/
|
*/
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
public <T extends AppState> T getState(Class<T> stateClass, boolean failOnMiss){
|
public <T extends AppState> T getState(Class<T> stateClass, boolean failOnMiss){
|
||||||
synchronized (states){
|
synchronized (states){
|
||||||
AppState[] array = getStates();
|
AppState[] array = getStates();
|
||||||
|
@ -65,6 +65,7 @@ public final class AssetConfig {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
public static void loadText(AssetManager assetManager, URL configUrl) throws IOException{
|
public static void loadText(AssetManager assetManager, URL configUrl) throws IOException{
|
||||||
InputStream in = configUrl.openStream();
|
InputStream in = configUrl.openStream();
|
||||||
try {
|
try {
|
||||||
|
@ -59,6 +59,7 @@ public class AssetKey<T> implements Savable, Cloneable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
public AssetKey<T> clone() {
|
public AssetKey<T> clone() {
|
||||||
try {
|
try {
|
||||||
return (AssetKey<T>) super.clone();
|
return (AssetKey<T>) super.clone();
|
||||||
|
@ -56,6 +56,7 @@ public class SimpleAssetCache implements AssetCache {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
public <T> T getFromCache(AssetKey<T> key) {
|
public <T> T getFromCache(AssetKey<T> key) {
|
||||||
return (T) keyToAssetMap.get(key);
|
return (T) keyToAssetMap.get(key);
|
||||||
}
|
}
|
||||||
|
@ -95,6 +95,7 @@ public class WeakRefAssetCache implements AssetCache {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
public <T> T getFromCache(AssetKey<T> key) {
|
public <T> T getFromCache(AssetKey<T> key) {
|
||||||
AssetRef ref = assetCache.get(key);
|
AssetRef ref = assetCache.get(key);
|
||||||
if (ref != null){
|
if (ref != null){
|
||||||
|
@ -157,6 +157,7 @@ public class WeakRefCloneAssetCache implements AssetCache {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
public <T> T getFromCache(AssetKey<T> key) {
|
public <T> T getFromCache(AssetKey<T> key) {
|
||||||
AssetRef smartInfo = smartCache.get(key);
|
AssetRef smartInfo = smartCache.get(key);
|
||||||
if (smartInfo == null) {
|
if (smartInfo == null) {
|
||||||
|
@ -284,6 +284,7 @@ public class AnimationEvent extends AbstractCinematicEvent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
public void initEvent(Application app, Cinematic cinematic) {
|
public void initEvent(Application app, Cinematic cinematic) {
|
||||||
super.initEvent(app, cinematic);
|
super.initEvent(app, cinematic);
|
||||||
this.cinematic = cinematic;
|
this.cinematic = cinematic;
|
||||||
@ -451,6 +452,7 @@ public class AnimationEvent extends AbstractCinematicEvent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
public void dispose() {
|
public void dispose() {
|
||||||
super.dispose();
|
super.dispose();
|
||||||
if (cinematic != null) {
|
if (cinematic != null) {
|
||||||
|
@ -368,6 +368,7 @@ public class EnvironmentCamera extends BaseAppState {
|
|||||||
JobProgressListener<TextureCubeMap> callback;
|
JobProgressListener<TextureCubeMap> callback;
|
||||||
Spatial scene;
|
Spatial scene;
|
||||||
|
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
public SnapshotJob(JobProgressListener callback, Spatial scene) {
|
public SnapshotJob(JobProgressListener callback, Spatial scene) {
|
||||||
this.callback = callback;
|
this.callback = callback;
|
||||||
this.scene = scene;
|
this.scene = scene;
|
||||||
|
@ -101,6 +101,7 @@ public class IrradianceSphericalHarmonicsGenerator extends RunnableWithProgress
|
|||||||
app.enqueue(new Callable<Void>() {
|
app.enqueue(new Callable<Void>() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
public Void call() throws Exception {
|
public Void call() throws Exception {
|
||||||
listener.done(6);
|
listener.done(6);
|
||||||
return null;
|
return null;
|
||||||
|
@ -137,6 +137,7 @@ public class PrefilteredEnvMapFaceGenerator extends RunnableWithProgress {
|
|||||||
app.enqueue(new Callable<Void>() {
|
app.enqueue(new Callable<Void>() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
public Void call() throws Exception {
|
public Void call() throws Exception {
|
||||||
listener.done(face);
|
listener.done(face);
|
||||||
return null;
|
return null;
|
||||||
|
@ -90,6 +90,7 @@ public class SavableClassUtil {
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
public static int[] getSavableVersions(Class<? extends Savable> clazz) throws IOException{
|
public static int[] getSavableVersions(Class<? extends Savable> clazz) throws IOException{
|
||||||
ArrayList<Integer> versionList = new ArrayList<Integer>();
|
ArrayList<Integer> versionList = new ArrayList<Integer>();
|
||||||
Class superclass = clazz;
|
Class superclass = clazz;
|
||||||
@ -105,6 +106,7 @@ public class SavableClassUtil {
|
|||||||
return versions;
|
return versions;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
public static int getSavableVersion(Class<? extends Savable> clazz) throws IOException{
|
public static int getSavableVersion(Class<? extends Savable> clazz) throws IOException{
|
||||||
try {
|
try {
|
||||||
Field field = clazz.getField("SAVABLE_VERSION");
|
Field field = clazz.getField("SAVABLE_VERSION");
|
||||||
@ -221,6 +223,7 @@ public class SavableClassUtil {
|
|||||||
*
|
*
|
||||||
* @return the pre-existing constructor (not null)
|
* @return the pre-existing constructor (not null)
|
||||||
*/
|
*/
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
private static Constructor findNoArgConstructor(String className)
|
private static Constructor findNoArgConstructor(String className)
|
||||||
throws ClassNotFoundException, InstantiationException {
|
throws ClassNotFoundException, InstantiationException {
|
||||||
Class clazz = Class.forName(className);
|
Class clazz = Class.forName(className);
|
||||||
|
@ -551,6 +551,7 @@ public class FilterPostProcessor implements SceneProcessor, 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);
|
||||||
oc.write(numSamples, "numSamples", 0);
|
oc.write(numSamples, "numSamples", 0);
|
||||||
@ -558,6 +559,7 @@ public class FilterPostProcessor implements SceneProcessor, 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);
|
||||||
numSamples = ic.readInt("numSamples", 0);
|
numSamples = ic.readInt("numSamples", 0);
|
||||||
@ -593,6 +595,7 @@ public class FilterPostProcessor implements SceneProcessor, Savable {
|
|||||||
* @param filterType the filter type
|
* @param filterType the filter type
|
||||||
* @return a filter assignable form the given type
|
* @return a filter assignable form the given type
|
||||||
*/
|
*/
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
public <T extends Filter> T getFilter(Class<T> filterType) {
|
public <T extends Filter> T getFilter(Class<T> filterType) {
|
||||||
for (Filter c : filters.getArray()) {
|
for (Filter c : filters.getArray()) {
|
||||||
if (filterType.isAssignableFrom(c.getClass())) {
|
if (filterType.isAssignableFrom(c.getClass())) {
|
||||||
|
@ -62,6 +62,7 @@ public class GLTiming implements InvocationHandler {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
|
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
|
||||||
String methodName = method.getName();
|
String methodName = method.getName();
|
||||||
if (methodName.equals("resetStats")) {
|
if (methodName.equals("resetStats")) {
|
||||||
|
@ -149,6 +149,7 @@ public class GeometryList implements Iterable<Geometry>{
|
|||||||
/**
|
/**
|
||||||
* Sorts the elements in the list according to their Comparator.
|
* Sorts the elements in the list according to their Comparator.
|
||||||
*/
|
*/
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
public void sort() {
|
public void sort() {
|
||||||
if (size > 1) {
|
if (size > 1) {
|
||||||
// sort the spatial list using the comparator
|
// sort the spatial list using the comparator
|
||||||
|
@ -837,6 +837,7 @@ public abstract class Spatial implements Savable, Cloneable, Collidable, Cloneab
|
|||||||
*
|
*
|
||||||
* @see Spatial#addControl(com.jme3.scene.control.Control)
|
* @see Spatial#addControl(com.jme3.scene.control.Control)
|
||||||
*/
|
*/
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
public <T extends Control> T getControl(Class<T> controlType) {
|
public <T extends Control> T getControl(Class<T> controlType) {
|
||||||
for (Control c : controls.getArray()) {
|
for (Control c : controls.getArray()) {
|
||||||
if (controlType.isAssignableFrom(c.getClass())) {
|
if (controlType.isAssignableFrom(c.getClass())) {
|
||||||
@ -1435,6 +1436,7 @@ public abstract class Spatial implements Savable, Cloneable, Collidable, Cloneab
|
|||||||
* Called internally by com.jme3.util.clone.Cloner. Do not call directly.
|
* Called internally by com.jme3.util.clone.Cloner. Do not call directly.
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
public void cloneFields( Cloner cloner, Object original ) {
|
public void cloneFields( Cloner cloner, Object original ) {
|
||||||
|
|
||||||
// Clone all of the fields that need fix-ups and/or potential
|
// Clone all of the fields that need fix-ups and/or potential
|
||||||
@ -1502,6 +1504,7 @@ public abstract class Spatial implements Savable, Cloneable, Collidable, Cloneab
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
public Collection<String> getUserDataKeys() {
|
public Collection<String> getUserDataKeys() {
|
||||||
if (userData != null) {
|
if (userData != null) {
|
||||||
return userData.keySet();
|
return userData.keySet();
|
||||||
@ -1540,6 +1543,7 @@ public abstract class Spatial implements Savable, Cloneable, Collidable, Cloneab
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
public void write(JmeExporter ex) throws IOException {
|
public void write(JmeExporter ex) throws IOException {
|
||||||
OutputCapsule capsule = ex.getCapsule(this);
|
OutputCapsule capsule = ex.getCapsule(this);
|
||||||
capsule.write(name, "name", null);
|
capsule.write(name, "name", null);
|
||||||
@ -1558,6 +1562,7 @@ public abstract class Spatial implements Savable, Cloneable, Collidable, Cloneab
|
|||||||
}
|
}
|
||||||
|
|
||||||
@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);
|
||||||
|
|
||||||
|
@ -375,6 +375,7 @@ public class InstancedGeometry extends Geometry {
|
|||||||
return geometries;
|
return geometries;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
public VertexBuffer[] getAllInstanceData() {
|
public VertexBuffer[] getAllInstanceData() {
|
||||||
ArrayList<VertexBuffer> allData = new ArrayList();
|
ArrayList<VertexBuffer> allData = new ArrayList();
|
||||||
if (transformInstanceData != null) {
|
if (transformInstanceData != null) {
|
||||||
|
@ -226,6 +226,7 @@ public class BufferObject extends NativeObject {
|
|||||||
* @param <T> the value's type.
|
* @param <T> the value's type.
|
||||||
* @return the current value.
|
* @return the current value.
|
||||||
*/
|
*/
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
public <T> T getFieldValue(final String name) {
|
public <T> T getFieldValue(final String name) {
|
||||||
|
|
||||||
final BufferObjectField field = fields.get(name);
|
final BufferObjectField field = fields.get(name);
|
||||||
@ -492,6 +493,7 @@ public class BufferObject extends NativeObject {
|
|||||||
* @param data the data buffer.
|
* @param data the data buffer.
|
||||||
* @param value the value.
|
* @param value the value.
|
||||||
*/
|
*/
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
protected void writeMat3Array(final ByteBuffer data, final Object value) {
|
protected void writeMat3Array(final ByteBuffer data, final Object value) {
|
||||||
|
|
||||||
if (value instanceof Matrix3f[]) {
|
if (value instanceof Matrix3f[]) {
|
||||||
@ -523,6 +525,7 @@ public class BufferObject extends NativeObject {
|
|||||||
* @param data the data buffer.
|
* @param data the data buffer.
|
||||||
* @param value the value.
|
* @param value the value.
|
||||||
*/
|
*/
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
protected void writeMat4Array(final ByteBuffer data, final Object value) {
|
protected void writeMat4Array(final ByteBuffer data, final Object value) {
|
||||||
|
|
||||||
if (value instanceof Matrix4f[]) {
|
if (value instanceof Matrix4f[]) {
|
||||||
@ -555,6 +558,7 @@ public class BufferObject extends NativeObject {
|
|||||||
* @param data the data buffer.
|
* @param data the data buffer.
|
||||||
* @param value the value.
|
* @param value the value.
|
||||||
*/
|
*/
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
protected void writeVec4Array(final ByteBuffer data, final Object value) {
|
protected void writeVec4Array(final ByteBuffer data, final Object value) {
|
||||||
|
|
||||||
if (value instanceof Object[]) {
|
if (value instanceof Object[]) {
|
||||||
@ -586,6 +590,7 @@ public class BufferObject extends NativeObject {
|
|||||||
* @param data the data buffer.
|
* @param data the data buffer.
|
||||||
* @param value the value.
|
* @param value the value.
|
||||||
*/
|
*/
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
protected void writeVec3Array(final ByteBuffer data, final Object value) {
|
protected void writeVec3Array(final ByteBuffer data, final Object value) {
|
||||||
|
|
||||||
if (value instanceof Vector3f[]) {
|
if (value instanceof Vector3f[]) {
|
||||||
@ -617,6 +622,7 @@ public class BufferObject extends NativeObject {
|
|||||||
* @param data the data buffer.
|
* @param data the data buffer.
|
||||||
* @param value the value.
|
* @param value the value.
|
||||||
*/
|
*/
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
protected void writeVec2Array(final ByteBuffer data, final Object value) {
|
protected void writeVec2Array(final ByteBuffer data, final Object value) {
|
||||||
|
|
||||||
if (value instanceof Vector2f[]) {
|
if (value instanceof Vector2f[]) {
|
||||||
|
@ -194,6 +194,7 @@ public abstract class ShaderGenerator {
|
|||||||
* @param info the ShaderGenerationInfo
|
* @param info the ShaderGenerationInfo
|
||||||
* @param type the Shader type
|
* @param type the Shader type
|
||||||
*/
|
*/
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
protected void generateDeclarationAndMainBody(List<ShaderNode> shaderNodes, StringBuilder sourceDeclaration, StringBuilder source, ShaderGenerationInfo info, Shader.ShaderType type) {
|
protected void generateDeclarationAndMainBody(List<ShaderNode> shaderNodes, StringBuilder sourceDeclaration, StringBuilder source, ShaderGenerationInfo info, Shader.ShaderType type) {
|
||||||
for (ShaderNode shaderNode : shaderNodes) {
|
for (ShaderNode shaderNode : shaderNodes) {
|
||||||
if (info.getUnusedNodes().contains(shaderNode.getName())) {
|
if (info.getUnusedNodes().contains(shaderNode.getName())) {
|
||||||
|
@ -328,6 +328,7 @@ public abstract class AbstractShadowFilter<T extends AbstractShadowRenderer> ext
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
public AbstractShadowFilter<T> jmeClone() {
|
public AbstractShadowFilter<T> jmeClone() {
|
||||||
try {
|
try {
|
||||||
return (AbstractShadowFilter<T>) super.clone();
|
return (AbstractShadowFilter<T>) super.clone();
|
||||||
|
@ -80,6 +80,7 @@ public final class IntMap<T> implements Iterable<Entry<T>>, Cloneable, JmeClonea
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
public IntMap<T> clone(){
|
public IntMap<T> clone(){
|
||||||
try{
|
try{
|
||||||
IntMap<T> clone = (IntMap<T>) super.clone();
|
IntMap<T> clone = (IntMap<T>) super.clone();
|
||||||
@ -137,6 +138,7 @@ public final class IntMap<T> implements Iterable<Entry<T>>, Cloneable, JmeClonea
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
public T get(int key) {
|
public T get(int key) {
|
||||||
int index = key & mask;
|
int index = key & mask;
|
||||||
for (Entry e = table[index]; e != null; e = e.next){
|
for (Entry e = table[index]; e != null; e = e.next){
|
||||||
@ -147,6 +149,7 @@ public final class IntMap<T> implements Iterable<Entry<T>>, Cloneable, JmeClonea
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
public T put(int key, T value) {
|
public T put(int key, T value) {
|
||||||
int index = key & mask;
|
int index = key & mask;
|
||||||
// Check if key already exists.
|
// Check if key already exists.
|
||||||
@ -186,6 +189,7 @@ public final class IntMap<T> implements Iterable<Entry<T>>, Cloneable, JmeClonea
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
public T remove(int key) {
|
public T remove(int key) {
|
||||||
int index = key & mask;
|
int index = key & mask;
|
||||||
Entry prev = table[index];
|
Entry prev = table[index];
|
||||||
@ -320,6 +324,7 @@ public final class IntMap<T> implements Iterable<Entry<T>>, Cloneable, JmeClonea
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
public Entry<T> clone(){
|
public Entry<T> clone(){
|
||||||
try{
|
try{
|
||||||
Entry<T> clone = (Entry<T>) super.clone();
|
Entry<T> clone = (Entry<T>) super.clone();
|
||||||
|
@ -74,6 +74,7 @@ public final class ListMap<K, V> extends AbstractMap<K, V> implements Cloneable,
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
public boolean equals(Object obj) {
|
public boolean equals(Object obj) {
|
||||||
if (obj == null) {
|
if (obj == null) {
|
||||||
return false;
|
return false;
|
||||||
@ -103,18 +104,21 @@ public final class ListMap<K, V> extends AbstractMap<K, V> implements Cloneable,
|
|||||||
|
|
||||||
// private final ArrayList<ListMapEntry<K,V>> entries;
|
// private final ArrayList<ListMapEntry<K,V>> entries;
|
||||||
|
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
public ListMap(){
|
public ListMap(){
|
||||||
entries = new ListMapEntry[4];
|
entries = new ListMapEntry[4];
|
||||||
backingMap = new HashMap<K, V>(4);
|
backingMap = new HashMap<K, V>(4);
|
||||||
// entries = new ArrayList<ListMapEntry<K,V>>();
|
// entries = new ArrayList<ListMapEntry<K,V>>();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
public ListMap(int initialCapacity){
|
public ListMap(int initialCapacity){
|
||||||
entries = new ListMapEntry[initialCapacity];
|
entries = new ListMapEntry[initialCapacity];
|
||||||
backingMap = new HashMap<K, V>(initialCapacity);
|
backingMap = new HashMap<K, V>(initialCapacity);
|
||||||
// entries = new ArrayList<ListMapEntry<K, V>>(initialCapacity);
|
// entries = new ArrayList<ListMapEntry<K, V>>(initialCapacity);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
public ListMap(Map<? extends K, ? extends V> map){
|
public ListMap(Map<? extends K, ? extends V> map){
|
||||||
entries = new ListMapEntry[map.size()];
|
entries = new ListMapEntry[map.size()];
|
||||||
backingMap = new HashMap<K, V>(map.size());
|
backingMap = new HashMap<K, V>(map.size());
|
||||||
@ -195,6 +199,7 @@ public final class ListMap<K, V> extends AbstractMap<K, V> implements Cloneable,
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
public V put(K key, V value) {
|
public V put(K key, V value) {
|
||||||
if (backingMap.containsKey(key)){
|
if (backingMap.containsKey(key)){
|
||||||
// set the value on the entry
|
// set the value on the entry
|
||||||
|
@ -131,6 +131,7 @@ public class ListSort<T> {
|
|||||||
*
|
*
|
||||||
* @param len
|
* @param len
|
||||||
*/
|
*/
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
public final void allocateStack(int len) {
|
public final void allocateStack(int len) {
|
||||||
|
|
||||||
length = len;
|
length = len;
|
||||||
@ -995,6 +996,7 @@ public class ListSort<T> {
|
|||||||
/*
|
/*
|
||||||
* test case
|
* test case
|
||||||
*/
|
*/
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
public static void main(String[] argv) {
|
public static void main(String[] argv) {
|
||||||
Integer[] arr = new Integer[]{5, 6, 2, 9, 10, 11, 12, 8, 3, 12, 3, 7, 12, 32, 458, 12, 5, 3, 78, 45, 12, 32, 58, 45, 65, 45, 98, 45, 65, 2, 3, 47, 21, 35};
|
Integer[] arr = new Integer[]{5, 6, 2, 9, 10, 11, 12, 8, 3, 12, 3, 7, 12, 32, 458, 12, 5, 3, 78, 45, 12, 32, 58, 45, 65, 45, 98, 45, 65, 2, 3, 47, 21, 35};
|
||||||
ListSort ls = new ListSort();
|
ListSort ls = new ListSort();
|
||||||
|
@ -299,6 +299,7 @@ public class MaterialDebugAppState extends AbstractAppState {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
public void reload() {
|
public void reload() {
|
||||||
Field[] fields1 = filter.getClass().getDeclaredFields();
|
Field[] fields1 = filter.getClass().getDeclaredFields();
|
||||||
Field[] fields2 = filter.getClass().getSuperclass().getDeclaredFields();
|
Field[] fields2 = filter.getClass().getSuperclass().getDeclaredFields();
|
||||||
|
@ -104,6 +104,7 @@ public class SafeArrayList<E> implements List<E>, Cloneable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
public SafeArrayList<E> clone() {
|
public SafeArrayList<E> clone() {
|
||||||
try {
|
try {
|
||||||
SafeArrayList<E> clone = (SafeArrayList<E>)super.clone();
|
SafeArrayList<E> clone = (SafeArrayList<E>)super.clone();
|
||||||
@ -122,6 +123,7 @@ public class SafeArrayList<E> implements List<E>, Cloneable {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
protected final <T> T[] createArray(Class<T> type, int size) {
|
protected final <T> T[] createArray(Class<T> type, int size) {
|
||||||
return (T[])java.lang.reflect.Array.newInstance(type, size);
|
return (T[])java.lang.reflect.Array.newInstance(type, size);
|
||||||
}
|
}
|
||||||
@ -194,6 +196,7 @@ public class SafeArrayList<E> implements List<E>, Cloneable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
public <T> T[] toArray(T[] a) {
|
public <T> T[] toArray(T[] a) {
|
||||||
|
|
||||||
E[] array = getArray();
|
E[] array = getArray();
|
||||||
|
@ -73,6 +73,7 @@ public class SortUtil {
|
|||||||
end procedure
|
end procedure
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
public static void gsort(Object[] a, Comparator comp) {
|
public static void gsort(Object[] a, Comparator comp) {
|
||||||
int pos = 1;
|
int pos = 1;
|
||||||
int last = 0;
|
int last = 0;
|
||||||
@ -241,6 +242,7 @@ end procedure
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
public static void qsort(int[] a, int lo0, int hi0, Comparator comp) {
|
public static void qsort(int[] a, int lo0, int hi0, Comparator comp) {
|
||||||
// bail out if we're already done
|
// bail out if we're already done
|
||||||
if (hi0 <= lo0) {
|
if (hi0 <= lo0) {
|
||||||
@ -324,6 +326,7 @@ end procedure
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
private static void merge(Object[] src, Object[] dest,
|
private static void merge(Object[] src, Object[] dest,
|
||||||
int low, int middle, int high, Comparator comp) {
|
int low, int middle, int high, Comparator comp) {
|
||||||
int leftEnd = middle - 1;
|
int leftEnd = middle - 1;
|
||||||
|
@ -46,6 +46,7 @@ public class J3MLoaderTest {
|
|||||||
private MaterialDef materialDef;
|
private MaterialDef materialDef;
|
||||||
|
|
||||||
@Before
|
@Before
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
public void setUp() throws Exception {
|
public void setUp() throws Exception {
|
||||||
when(assetKey.getExtension()).thenReturn(".j3m");
|
when(assetKey.getExtension()).thenReturn(".j3m");
|
||||||
when(assetInfo.getManager()).thenReturn(assetManager);
|
when(assetInfo.getManager()).thenReturn(assetManager);
|
||||||
|
@ -348,6 +348,7 @@ public class TextureAtlas {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
private Image convertImageToAwt(Image source) {
|
private Image convertImageToAwt(Image source) {
|
||||||
//use awt dependent classes without actual dependency via reflection
|
//use awt dependent classes without actual dependency via reflection
|
||||||
try {
|
try {
|
||||||
|
@ -261,6 +261,7 @@ public class JmeDesktopSystem extends JmeSystemDelegate {
|
|||||||
return ctx;
|
return ctx;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
private <T> T newObject(String className) {
|
private <T> T newObject(String className) {
|
||||||
try {
|
try {
|
||||||
Class<T> clazz = (Class<T>) Class.forName(className);
|
Class<T> clazz = (Class<T>) Class.forName(className);
|
||||||
|
@ -260,6 +260,7 @@ public class OGGLoader implements AssetLoader {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
private AudioData load(InputStream in, boolean readStream, boolean streamCache) throws IOException{
|
private AudioData load(InputStream in, boolean readStream, boolean streamCache) throws IOException{
|
||||||
if (readStream && streamCache){
|
if (readStream && streamCache){
|
||||||
oggStream = new CachedOggStream(in);
|
oggStream = new CachedOggStream(in);
|
||||||
|
@ -288,6 +288,7 @@ public abstract class LwjglContext implements JmeContext {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
protected void initOpenCL(final long window) {
|
protected void initOpenCL(final long window) {
|
||||||
logger.info("Initialize OpenCL with LWJGL3");
|
logger.info("Initialize OpenCL with LWJGL3");
|
||||||
|
|
||||||
|
@ -47,6 +47,7 @@ public class Filters
|
|||||||
* Creates a filter that returns true for any value in the specified
|
* Creates a filter that returns true for any value in the specified
|
||||||
* list of values and false for all other cases.
|
* list of values and false for all other cases.
|
||||||
*/
|
*/
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
public static <T> Filter<T> in( T... values )
|
public static <T> Filter<T> in( T... values )
|
||||||
{
|
{
|
||||||
return in( new HashSet<T>(Arrays.asList(values)) );
|
return in( new HashSet<T>(Arrays.asList(values)) );
|
||||||
@ -66,6 +67,7 @@ public class Filters
|
|||||||
* list of values and false for all other cases. This is the equivalent
|
* list of values and false for all other cases. This is the equivalent
|
||||||
* of calling not(in(values)).
|
* of calling not(in(values)).
|
||||||
*/
|
*/
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
public static <T> Filter<T> notIn( T... values )
|
public static <T> Filter<T> notIn( T... values )
|
||||||
{
|
{
|
||||||
return not( in( values ) );
|
return not( in( values ) );
|
||||||
|
@ -410,6 +410,7 @@ public class DefaultClient implements Client
|
|||||||
* Either calls the ErrorListener or closes the connection
|
* Either calls the ErrorListener or closes the connection
|
||||||
* if there are no listeners.
|
* if there are no listeners.
|
||||||
*/
|
*/
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
protected void handleError( Throwable t )
|
protected void handleError( Throwable t )
|
||||||
{
|
{
|
||||||
// If there are no listeners then close the connection with
|
// If there are no listeners then close the connection with
|
||||||
|
@ -129,6 +129,7 @@ public class ObjectStore {
|
|||||||
Serializer.registerClass(RemoteMethodReturnMessage.class, s);
|
Serializer.registerClass(RemoteMethodReturnMessage.class, s);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
public ObjectStore(Client client) {
|
public ObjectStore(Client client) {
|
||||||
this.client = client;
|
this.client = client;
|
||||||
client.addMessageListener(clientEventHandler,
|
client.addMessageListener(clientEventHandler,
|
||||||
@ -187,6 +188,7 @@ public class ObjectStore {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
public <T> T getExposedObject(String name, Class<T> type, boolean waitFor) throws InterruptedException{
|
public <T> T getExposedObject(String name, Class<T> type, boolean waitFor) throws InterruptedException{
|
||||||
RemoteObject ro = remoteObjects.get(name);
|
RemoteObject ro = remoteObjects.get(name);
|
||||||
if (ro == null){
|
if (ro == null){
|
||||||
|
@ -235,6 +235,7 @@ public class RmiSerializer extends Serializer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
public <T> T readObject(ByteBuffer data, Class<T> c) throws IOException {
|
public <T> T readObject(ByteBuffer data, Class<T> c) throws IOException {
|
||||||
if (c == RemoteObjectDefMessage.class){
|
if (c == RemoteObjectDefMessage.class){
|
||||||
return (T) readObjectDefs(data);
|
return (T) readObjectDefs(data);
|
||||||
|
@ -55,6 +55,7 @@ public class FieldSerializer extends Serializer {
|
|||||||
private static Map<Class, SavedField[]> savedFields = new HashMap<Class, SavedField[]>();
|
private static Map<Class, SavedField[]> savedFields = new HashMap<Class, SavedField[]>();
|
||||||
private static Map<Class, Constructor> savedCtors = new HashMap<Class, Constructor>();
|
private static Map<Class, Constructor> savedCtors = new HashMap<Class, Constructor>();
|
||||||
|
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
protected void checkClass(Class clazz) {
|
protected void checkClass(Class clazz) {
|
||||||
|
|
||||||
// See if the class has a public no-arg constructor
|
// See if the class has a public no-arg constructor
|
||||||
|
@ -60,6 +60,7 @@ public abstract class AbstractService<S extends ServiceManager> implements Servi
|
|||||||
* Retrieves the first sibling service of the specified
|
* Retrieves the first sibling service of the specified
|
||||||
* type.
|
* type.
|
||||||
*/
|
*/
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
protected <T extends Service<S>> T getService( Class<T> type ) {
|
protected <T extends Service<S>> T getService( Class<T> type ) {
|
||||||
return type.cast(serviceManager.getService(type));
|
return type.cast(serviceManager.getService(type));
|
||||||
}
|
}
|
||||||
|
@ -160,6 +160,7 @@ public class RmiClientService extends AbstractClientService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
public void start() {
|
public void start() {
|
||||||
super.start();
|
super.start();
|
||||||
|
|
||||||
|
@ -180,6 +180,7 @@ public class RmiHostedService extends AbstractHostedService {
|
|||||||
* This method is called automatically for all new connections if
|
* This method is called automatically for all new connections if
|
||||||
* autohost is set to true.
|
* autohost is set to true.
|
||||||
*/
|
*/
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
public void startHostingOnConnection( HostedConnection hc ) {
|
public void startHostingOnConnection( HostedConnection hc ) {
|
||||||
if( log.isLoggable(Level.FINEST) ) {
|
if( log.isLoggable(Level.FINEST) ) {
|
||||||
log.log(Level.FINEST, "startHostingOnConnection:{0}", hc);
|
log.log(Level.FINEST, "startHostingOnConnection:{0}", hc);
|
||||||
|
@ -73,6 +73,7 @@ public class RpcClientService extends AbstractClientService {
|
|||||||
* Used internally to setup the RpcConnection and MessageDelegator.
|
* Used internally to setup the RpcConnection and MessageDelegator.
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
protected void onInitialize( ClientServiceManager serviceManager ) {
|
protected void onInitialize( ClientServiceManager serviceManager ) {
|
||||||
Client client = serviceManager.getClient();
|
Client client = serviceManager.getClient();
|
||||||
this.rpc = new RpcConnection(client);
|
this.rpc = new RpcConnection(client);
|
||||||
@ -86,6 +87,7 @@ public class RpcClientService extends AbstractClientService {
|
|||||||
* was previously added to the network Client.
|
* was previously added to the network Client.
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
public void terminate( ClientServiceManager serviceManager ) {
|
public void terminate( ClientServiceManager serviceManager ) {
|
||||||
Client client = serviceManager.getClient();
|
Client client = serviceManager.getClient();
|
||||||
client.removeMessageListener(delegator, delegator.getMessageTypes());
|
client.removeMessageListener(delegator, delegator.getMessageTypes());
|
||||||
|
@ -110,6 +110,7 @@ public final class FbxMesh extends FbxNodeAttribute<IntMap<Mesh>> {
|
|||||||
return skinDeformer;
|
return skinDeformer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
public void applyCluster(FbxCluster cluster) {
|
public void applyCluster(FbxCluster cluster) {
|
||||||
if (boneIndices == null) {
|
if (boneIndices == null) {
|
||||||
boneIndices = new ArrayList[positions.length];
|
boneIndices = new ArrayList[positions.length];
|
||||||
|
@ -63,6 +63,7 @@ public class CustomContentManager {
|
|||||||
return output;
|
return output;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
private <T> T readExtension(String name, JsonElement el, T input) throws AssetLoadException, IOException {
|
private <T> T readExtension(String name, JsonElement el, T input) throws AssetLoadException, IOException {
|
||||||
JsonElement extensions = el.getAsJsonObject().getAsJsonObject("extensions");
|
JsonElement extensions = el.getAsJsonObject().getAsJsonObject("extensions");
|
||||||
if (extensions == null) {
|
if (extensions == null) {
|
||||||
@ -93,6 +94,7 @@ public class CustomContentManager {
|
|||||||
return input;
|
return input;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
private <T> T readExtras(String name, JsonElement el, T input) throws AssetLoadException {
|
private <T> T readExtras(String name, JsonElement el, T input) throws AssetLoadException {
|
||||||
if (key == null) {
|
if (key == null) {
|
||||||
return input;
|
return input;
|
||||||
|
@ -1105,6 +1105,7 @@ public class DOMInputCapsule implements InputCapsule {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
public ArrayList<Savable> readSavableArrayList(String name, ArrayList defVal) throws IOException {
|
public ArrayList<Savable> readSavableArrayList(String name, ArrayList defVal) throws IOException {
|
||||||
try {
|
try {
|
||||||
Element tmpEl = findChildElement(currentElem, name);
|
Element tmpEl = findChildElement(currentElem, name);
|
||||||
@ -1139,6 +1140,7 @@ public class DOMInputCapsule implements InputCapsule {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
public ArrayList<Savable>[] readSavableArrayListArray(
|
public ArrayList<Savable>[] readSavableArrayListArray(
|
||||||
String name, ArrayList[] defVal) throws IOException {
|
String name, ArrayList[] defVal) throws IOException {
|
||||||
try {
|
try {
|
||||||
@ -1185,6 +1187,7 @@ public class DOMInputCapsule implements InputCapsule {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
public ArrayList<Savable>[][] readSavableArrayListArray2D(String name, ArrayList[][] defVal) throws IOException {
|
public ArrayList<Savable>[][] readSavableArrayListArray2D(String name, ArrayList[][] defVal) throws IOException {
|
||||||
try {
|
try {
|
||||||
Element tmpEl = findChildElement(currentElem, name);
|
Element tmpEl = findChildElement(currentElem, name);
|
||||||
|
@ -83,6 +83,7 @@ public class BresenhamTerrainPicker implements TerrainPicker {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
public int getTerrainIntersection(Ray worldPick, CollisionResults results) {
|
public int getTerrainIntersection(Ray worldPick, CollisionResults results) {
|
||||||
int numCollisions = 0;
|
int numCollisions = 0;
|
||||||
worldPickRay.set(worldPick);
|
worldPickRay.set(worldPick);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user