浏览代码

suppress more javac warnings about unchecked casts

Stephen Gold 5 年之前
父节点
当前提交
822bcd1300
共有 45 个文件被更改,包括 78 次插入0 次删除
  1. 1 0
      jme3-core/src/main/java/com/jme3/anim/tween/Tweens.java
  2. 1 0
      jme3-core/src/main/java/com/jme3/app/LegacyApplication.java
  3. 1 0
      jme3-core/src/main/java/com/jme3/app/state/AppStateManager.java
  4. 1 0
      jme3-core/src/main/java/com/jme3/asset/AssetConfig.java
  5. 1 0
      jme3-core/src/main/java/com/jme3/asset/AssetKey.java
  6. 1 0
      jme3-core/src/main/java/com/jme3/asset/cache/SimpleAssetCache.java
  7. 1 0
      jme3-core/src/main/java/com/jme3/asset/cache/WeakRefAssetCache.java
  8. 1 0
      jme3-core/src/main/java/com/jme3/asset/cache/WeakRefCloneAssetCache.java
  9. 2 0
      jme3-core/src/main/java/com/jme3/cinematic/events/AnimationEvent.java
  10. 1 0
      jme3-core/src/main/java/com/jme3/environment/EnvironmentCamera.java
  11. 1 0
      jme3-core/src/main/java/com/jme3/environment/generation/IrradianceSphericalHarmonicsGenerator.java
  12. 1 0
      jme3-core/src/main/java/com/jme3/environment/generation/PrefilteredEnvMapFaceGenerator.java
  13. 3 0
      jme3-core/src/main/java/com/jme3/export/SavableClassUtil.java
  14. 3 0
      jme3-core/src/main/java/com/jme3/post/FilterPostProcessor.java
  15. 1 0
      jme3-core/src/main/java/com/jme3/renderer/opengl/GLTiming.java
  16. 1 0
      jme3-core/src/main/java/com/jme3/renderer/queue/GeometryList.java
  17. 5 0
      jme3-core/src/main/java/com/jme3/scene/Spatial.java
  18. 1 0
      jme3-core/src/main/java/com/jme3/scene/instancing/InstancedGeometry.java
  19. 6 0
      jme3-core/src/main/java/com/jme3/shader/BufferObject.java
  20. 1 0
      jme3-core/src/main/java/com/jme3/shader/ShaderGenerator.java
  21. 1 0
      jme3-core/src/main/java/com/jme3/shadow/AbstractShadowFilter.java
  22. 5 0
      jme3-core/src/main/java/com/jme3/util/IntMap.java
  23. 5 0
      jme3-core/src/main/java/com/jme3/util/ListMap.java
  24. 2 0
      jme3-core/src/main/java/com/jme3/util/ListSort.java
  25. 1 0
      jme3-core/src/main/java/com/jme3/util/MaterialDebugAppState.java
  26. 3 0
      jme3-core/src/main/java/com/jme3/util/SafeArrayList.java
  27. 3 0
      jme3-core/src/main/java/com/jme3/util/SortUtil.java
  28. 1 0
      jme3-core/src/test/java/com/jme3/material/plugins/J3MLoaderTest.java
  29. 1 0
      jme3-core/src/tools/java/jme3tools/optimize/TextureAtlas.java
  30. 1 0
      jme3-desktop/src/main/java/com/jme3/system/JmeDesktopSystem.java
  31. 1 0
      jme3-jogg/src/main/java/com/jme3/audio/plugins/OGGLoader.java
  32. 1 0
      jme3-lwjgl3/src/main/java/com/jme3/system/lwjgl/LwjglContext.java
  33. 2 0
      jme3-networking/src/main/java/com/jme3/network/Filters.java
  34. 1 0
      jme3-networking/src/main/java/com/jme3/network/base/DefaultClient.java
  35. 2 0
      jme3-networking/src/main/java/com/jme3/network/rmi/ObjectStore.java
  36. 1 0
      jme3-networking/src/main/java/com/jme3/network/rmi/RmiSerializer.java
  37. 1 0
      jme3-networking/src/main/java/com/jme3/network/serializing/serializers/FieldSerializer.java
  38. 1 0
      jme3-networking/src/main/java/com/jme3/network/service/AbstractService.java
  39. 1 0
      jme3-networking/src/main/java/com/jme3/network/service/rmi/RmiClientService.java
  40. 1 0
      jme3-networking/src/main/java/com/jme3/network/service/rmi/RmiHostedService.java
  41. 2 0
      jme3-networking/src/main/java/com/jme3/network/service/rpc/RpcClientService.java
  42. 1 0
      jme3-plugins/src/fbx/java/com/jme3/scene/plugins/fbx/mesh/FbxMesh.java
  43. 2 0
      jme3-plugins/src/gltf/java/com/jme3/scene/plugins/gltf/CustomContentManager.java
  44. 3 0
      jme3-plugins/src/xml/java/com/jme3/export/xml/DOMInputCapsule.java
  45. 1 0
      jme3-terrain/src/main/java/com/jme3/terrain/geomipmap/picking/BresenhamTerrainPicker.java

+ 1 - 0
jme3-core/src/main/java/com/jme3/anim/tween/Tweens.java

@@ -438,6 +438,7 @@ public class Tweens {
             this.method.setAccessible(true);
         }
 
+        @SuppressWarnings("unchecked")
         private static Method findMethod(Class type, String name, Object... args) {
             for (Method m : type.getDeclaredMethods()) {
                 if (!Objects.equals(m.getName(), name)) {

+ 1 - 0
jme3-core/src/main/java/com/jme3/app/LegacyApplication.java

@@ -718,6 +718,7 @@ public class LegacyApplication implements Application, SystemListener {
      * @param runnable The runnable to run in the main jME3 thread
      */
     @Override
+    @SuppressWarnings("unchecked")
     public void enqueue(Runnable runnable){
         enqueue(new RunnableWrapper(runnable));
     }

+ 1 - 0
jme3-core/src/main/java/com/jme3/app/state/AppStateManager.java

@@ -242,6 +242,7 @@ public class AppStateManager {
      * @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.
      */
+    @SuppressWarnings("unchecked")
     public <T extends AppState> T getState(Class<T> stateClass, boolean failOnMiss){
         synchronized (states){
             AppState[] array = getStates();

+ 1 - 0
jme3-core/src/main/java/com/jme3/asset/AssetConfig.java

@@ -65,6 +65,7 @@ public final class AssetConfig {
         }
     }
     
+    @SuppressWarnings("unchecked")
     public static void loadText(AssetManager assetManager, URL configUrl) throws IOException{
         InputStream in = configUrl.openStream();
         try {

+ 1 - 0
jme3-core/src/main/java/com/jme3/asset/AssetKey.java

@@ -59,6 +59,7 @@ public class AssetKey<T> implements Savable, Cloneable {
     }
 
     @Override
+    @SuppressWarnings("unchecked")
     public AssetKey<T> clone() {
         try {
             return (AssetKey<T>) super.clone();

+ 1 - 0
jme3-core/src/main/java/com/jme3/asset/cache/SimpleAssetCache.java

@@ -56,6 +56,7 @@ public class SimpleAssetCache implements AssetCache {
     }
 
     @Override
+    @SuppressWarnings("unchecked")
     public <T> T getFromCache(AssetKey<T> key) {
         return (T) keyToAssetMap.get(key);
     }

+ 1 - 0
jme3-core/src/main/java/com/jme3/asset/cache/WeakRefAssetCache.java

@@ -95,6 +95,7 @@ public class WeakRefAssetCache implements AssetCache {
     }
 
     @Override
+    @SuppressWarnings("unchecked")
     public <T> T getFromCache(AssetKey<T> key) {
         AssetRef ref = assetCache.get(key);
         if (ref != null){

+ 1 - 0
jme3-core/src/main/java/com/jme3/asset/cache/WeakRefCloneAssetCache.java

@@ -157,6 +157,7 @@ public class WeakRefCloneAssetCache implements AssetCache {
     }
 
     @Override
+    @SuppressWarnings("unchecked")
     public <T> T getFromCache(AssetKey<T> key) {
         AssetRef smartInfo = smartCache.get(key);
         if (smartInfo == null) {

+ 2 - 0
jme3-core/src/main/java/com/jme3/cinematic/events/AnimationEvent.java

@@ -284,6 +284,7 @@ public class AnimationEvent extends AbstractCinematicEvent {
     }
 
     @Override
+    @SuppressWarnings("unchecked")
     public void initEvent(Application app, Cinematic cinematic) {
         super.initEvent(app, cinematic);
         this.cinematic = cinematic;
@@ -451,6 +452,7 @@ public class AnimationEvent extends AbstractCinematicEvent {
     }
 
     @Override
+    @SuppressWarnings("unchecked")
     public void dispose() {
         super.dispose();
         if (cinematic != null) {

+ 1 - 0
jme3-core/src/main/java/com/jme3/environment/EnvironmentCamera.java

@@ -368,6 +368,7 @@ public class EnvironmentCamera extends BaseAppState {
         JobProgressListener<TextureCubeMap> callback;
         Spatial scene;
 
+        @SuppressWarnings("unchecked")
         public SnapshotJob(JobProgressListener callback, Spatial scene) {
             this.callback = callback;
             this.scene = scene;

+ 1 - 0
jme3-core/src/main/java/com/jme3/environment/generation/IrradianceSphericalHarmonicsGenerator.java

@@ -101,6 +101,7 @@ public class IrradianceSphericalHarmonicsGenerator extends RunnableWithProgress
         app.enqueue(new Callable<Void>() {
 
             @Override
+            @SuppressWarnings("unchecked")
             public Void call() throws Exception {
                 listener.done(6);
                 return null;

+ 1 - 0
jme3-core/src/main/java/com/jme3/environment/generation/PrefilteredEnvMapFaceGenerator.java

@@ -137,6 +137,7 @@ public class PrefilteredEnvMapFaceGenerator extends RunnableWithProgress {
         app.enqueue(new Callable<Void>() {
 
             @Override
+            @SuppressWarnings("unchecked")
             public Void call() throws Exception {
                 listener.done(face);
                 return null;

+ 3 - 0
jme3-core/src/main/java/com/jme3/export/SavableClassUtil.java

@@ -90,6 +90,7 @@ public class SavableClassUtil {
         return result;
     }
 
+    @SuppressWarnings("unchecked")
     public static int[] getSavableVersions(Class<? extends Savable> clazz) throws IOException{
         ArrayList<Integer> versionList = new ArrayList<Integer>();
         Class superclass = clazz;
@@ -105,6 +106,7 @@ public class SavableClassUtil {
         return versions;
     }
     
+    @SuppressWarnings("unchecked")
     public static int getSavableVersion(Class<? extends Savable> clazz) throws IOException{
         try {
             Field field = clazz.getField("SAVABLE_VERSION");
@@ -221,6 +223,7 @@ public class SavableClassUtil {
      *
      * @return the pre-existing constructor (not null)
      */
+    @SuppressWarnings("unchecked")
     private static Constructor findNoArgConstructor(String className)
             throws ClassNotFoundException, InstantiationException {
         Class clazz = Class.forName(className);

+ 3 - 0
jme3-core/src/main/java/com/jme3/post/FilterPostProcessor.java

@@ -551,6 +551,7 @@ public class FilterPostProcessor implements SceneProcessor, Savable {
     }
 
     @Override
+    @SuppressWarnings("unchecked")
     public void write(JmeExporter ex) throws IOException {
         OutputCapsule oc = ex.getCapsule(this);
         oc.write(numSamples, "numSamples", 0);
@@ -558,6 +559,7 @@ public class FilterPostProcessor implements SceneProcessor, Savable {
     }
 
     @Override
+    @SuppressWarnings("unchecked")
     public void read(JmeImporter im) throws IOException {
         InputCapsule ic = im.getCapsule(this);
         numSamples = ic.readInt("numSamples", 0);
@@ -593,6 +595,7 @@ public class FilterPostProcessor implements SceneProcessor, Savable {
      * @param filterType the filter type
      * @return a filter assignable form the given type 
      */
+    @SuppressWarnings("unchecked")
     public <T extends Filter> T getFilter(Class<T> filterType) {
         for (Filter c : filters.getArray()) {
             if (filterType.isAssignableFrom(c.getClass())) {

+ 1 - 0
jme3-core/src/main/java/com/jme3/renderer/opengl/GLTiming.java

@@ -62,6 +62,7 @@ public class GLTiming implements InvocationHandler {
     }
     
     @Override
+    @SuppressWarnings("unchecked")
     public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
         String methodName = method.getName();
         if (methodName.equals("resetStats")) {

+ 1 - 0
jme3-core/src/main/java/com/jme3/renderer/queue/GeometryList.java

@@ -149,6 +149,7 @@ public class GeometryList implements Iterable<Geometry>{
     /**
      * Sorts the elements in the list according to their Comparator.
      */
+    @SuppressWarnings("unchecked")
     public void sort() {
         if (size > 1) {
             // sort the spatial list using the comparator

+ 5 - 0
jme3-core/src/main/java/com/jme3/scene/Spatial.java

@@ -837,6 +837,7 @@ public abstract class Spatial implements Savable, Cloneable, Collidable, Cloneab
      *
      * @see Spatial#addControl(com.jme3.scene.control.Control)
      */
+    @SuppressWarnings("unchecked")
     public <T extends Control> T getControl(Class<T> controlType) {
         for (Control c : controls.getArray()) {
             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.
      */
     @Override
+    @SuppressWarnings("unchecked")
     public void cloneFields( Cloner cloner, Object original ) {
 
         // 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() {
         if (userData != null) {
             return userData.keySet();
@@ -1540,6 +1543,7 @@ public abstract class Spatial implements Savable, Cloneable, Collidable, Cloneab
     }
 
     @Override
+    @SuppressWarnings("unchecked")
     public void write(JmeExporter ex) throws IOException {
         OutputCapsule capsule = ex.getCapsule(this);
         capsule.write(name, "name", null);
@@ -1558,6 +1562,7 @@ public abstract class Spatial implements Savable, Cloneable, Collidable, Cloneab
     }
 
     @Override
+    @SuppressWarnings("unchecked")
     public void read(JmeImporter im) throws IOException {
         InputCapsule ic = im.getCapsule(this);
 

+ 1 - 0
jme3-core/src/main/java/com/jme3/scene/instancing/InstancedGeometry.java

@@ -375,6 +375,7 @@ public class InstancedGeometry extends Geometry {
         return geometries;
     }
 
+    @SuppressWarnings("unchecked")
     public VertexBuffer[] getAllInstanceData() {
         ArrayList<VertexBuffer> allData = new ArrayList();
         if (transformInstanceData != null) {

+ 6 - 0
jme3-core/src/main/java/com/jme3/shader/BufferObject.java

@@ -226,6 +226,7 @@ public class BufferObject extends NativeObject {
      * @param <T> the value's type.
      * @return the current value.
      */
+    @SuppressWarnings("unchecked")
     public <T> T getFieldValue(final String name) {
 
         final BufferObjectField field = fields.get(name);
@@ -492,6 +493,7 @@ public class BufferObject extends NativeObject {
      * @param data  the data buffer.
      * @param value the value.
      */
+    @SuppressWarnings("unchecked")
     protected void writeMat3Array(final ByteBuffer data, final Object value) {
 
         if (value instanceof Matrix3f[]) {
@@ -523,6 +525,7 @@ public class BufferObject extends NativeObject {
      * @param data  the data buffer.
      * @param value the value.
      */
+    @SuppressWarnings("unchecked")
     protected void writeMat4Array(final ByteBuffer data, final Object value) {
 
         if (value instanceof Matrix4f[]) {
@@ -555,6 +558,7 @@ public class BufferObject extends NativeObject {
      * @param data  the data buffer.
      * @param value the value.
      */
+    @SuppressWarnings("unchecked")
     protected void writeVec4Array(final ByteBuffer data, final Object value) {
 
         if (value instanceof Object[]) {
@@ -586,6 +590,7 @@ public class BufferObject extends NativeObject {
      * @param data  the data buffer.
      * @param value the value.
      */
+    @SuppressWarnings("unchecked")
     protected void writeVec3Array(final ByteBuffer data, final Object value) {
 
         if (value instanceof Vector3f[]) {
@@ -617,6 +622,7 @@ public class BufferObject extends NativeObject {
      * @param data  the data buffer.
      * @param value the value.
      */
+    @SuppressWarnings("unchecked")
     protected void writeVec2Array(final ByteBuffer data, final Object value) {
 
         if (value instanceof Vector2f[]) {

+ 1 - 0
jme3-core/src/main/java/com/jme3/shader/ShaderGenerator.java

@@ -194,6 +194,7 @@ public abstract class ShaderGenerator {
      * @param info the ShaderGenerationInfo
      * @param type the Shader type
      */
+    @SuppressWarnings("unchecked")
     protected void generateDeclarationAndMainBody(List<ShaderNode> shaderNodes, StringBuilder sourceDeclaration, StringBuilder source, ShaderGenerationInfo info, Shader.ShaderType type) {
         for (ShaderNode shaderNode : shaderNodes) {
             if (info.getUnusedNodes().contains(shaderNode.getName())) {

+ 1 - 0
jme3-core/src/main/java/com/jme3/shadow/AbstractShadowFilter.java

@@ -328,6 +328,7 @@ public abstract class AbstractShadowFilter<T extends AbstractShadowRenderer> ext
     }
 
     @Override
+    @SuppressWarnings("unchecked")
     public AbstractShadowFilter<T> jmeClone() {
         try {
             return (AbstractShadowFilter<T>) super.clone();

+ 5 - 0
jme3-core/src/main/java/com/jme3/util/IntMap.java

@@ -80,6 +80,7 @@ public final class IntMap<T> implements Iterable<Entry<T>>, Cloneable, JmeClonea
     }
 
     @Override
+    @SuppressWarnings("unchecked")
     public IntMap<T> clone(){
         try{
             IntMap<T> clone = (IntMap<T>) super.clone();
@@ -137,6 +138,7 @@ public final class IntMap<T> implements Iterable<Entry<T>>, Cloneable, JmeClonea
         return false;
     }
 
+    @SuppressWarnings("unchecked")
     public T get(int key) {
         int index = key & mask;
         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;
     }
 
+    @SuppressWarnings("unchecked")
     public T put(int key, T value) {
         int index = key & mask;
         // Check if key already exists.
@@ -186,6 +189,7 @@ public final class IntMap<T> implements Iterable<Entry<T>>, Cloneable, JmeClonea
         return null;
     }
 
+    @SuppressWarnings("unchecked")
     public T remove(int key) {
         int index = key & mask;
         Entry prev = table[index];
@@ -320,6 +324,7 @@ public final class IntMap<T> implements Iterable<Entry<T>>, Cloneable, JmeClonea
         }
 
         @Override
+        @SuppressWarnings("unchecked")
         public Entry<T> clone(){
             try{
                 Entry<T> clone = (Entry<T>) super.clone();

+ 5 - 0
jme3-core/src/main/java/com/jme3/util/ListMap.java

@@ -74,6 +74,7 @@ public final class ListMap<K, V> extends AbstractMap<K, V> implements Cloneable,
         }
 
         @Override
+        @SuppressWarnings("unchecked")
         public boolean equals(Object obj) {
             if (obj == null) {
                 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;
 
+    @SuppressWarnings("unchecked")
     public ListMap(){
         entries = new ListMapEntry[4];
         backingMap = new HashMap<K, V>(4);
 //       entries = new ArrayList<ListMapEntry<K,V>>();
     }
 
+    @SuppressWarnings("unchecked")
     public ListMap(int initialCapacity){
         entries = new ListMapEntry[initialCapacity];
         backingMap = new HashMap<K, V>(initialCapacity);
 //        entries = new ArrayList<ListMapEntry<K, V>>(initialCapacity);
     }
 
+    @SuppressWarnings("unchecked")
     public ListMap(Map<? extends K, ? extends V> map){
         entries = new ListMapEntry[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
+    @SuppressWarnings("unchecked")
     public V put(K key, V value) {
         if (backingMap.containsKey(key)){
             // set the value on the entry

+ 2 - 0
jme3-core/src/main/java/com/jme3/util/ListSort.java

@@ -131,6 +131,7 @@ public class ListSort<T> {
      *
      * @param len
      */
+    @SuppressWarnings("unchecked")
     public final void allocateStack(int len) {
 
         length = len;
@@ -995,6 +996,7 @@ public class ListSort<T> {
     /*
      * test case
      */
+    @SuppressWarnings("unchecked")
     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};
         ListSort ls = new ListSort();

+ 1 - 0
jme3-core/src/main/java/com/jme3/util/MaterialDebugAppState.java

@@ -299,6 +299,7 @@ public class MaterialDebugAppState extends AbstractAppState {
         }
 
         @Override
+        @SuppressWarnings("unchecked")
         public void reload() {
             Field[] fields1 = filter.getClass().getDeclaredFields();
             Field[] fields2 = filter.getClass().getSuperclass().getDeclaredFields();

+ 3 - 0
jme3-core/src/main/java/com/jme3/util/SafeArrayList.java

@@ -104,6 +104,7 @@ public class SafeArrayList<E> implements List<E>, Cloneable {
     }
 
     @Override
+    @SuppressWarnings("unchecked")
     public SafeArrayList<E> clone() {
         try {
             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) {
         return (T[])java.lang.reflect.Array.newInstance(type, size);
     }
@@ -194,6 +196,7 @@ public class SafeArrayList<E> implements List<E>, Cloneable {
     }
 
     @Override
+    @SuppressWarnings("unchecked")
     public <T> T[] toArray(T[] a) {
 
         E[] array = getArray();

+ 3 - 0
jme3-core/src/main/java/com/jme3/util/SortUtil.java

@@ -73,6 +73,7 @@ public class SortUtil {
 end procedure
      */
     
+    @SuppressWarnings("unchecked")
     public static void gsort(Object[] a, Comparator comp) {
         int pos = 1;
         int last = 0;
@@ -241,6 +242,7 @@ end procedure
         }
     }
 
+    @SuppressWarnings("unchecked")
     public static void qsort(int[] a, int lo0, int hi0, Comparator comp) {
         // bail out if we're already done
         if (hi0 <= lo0) {
@@ -324,6 +326,7 @@ end procedure
         }
     }
     
+    @SuppressWarnings("unchecked")
     private static void merge(Object[] src, Object[] dest,
             int low, int middle, int high, Comparator comp) {
         int leftEnd = middle - 1;

+ 1 - 0
jme3-core/src/test/java/com/jme3/material/plugins/J3MLoaderTest.java

@@ -46,6 +46,7 @@ public class J3MLoaderTest {
     private MaterialDef materialDef;
 
     @Before
+    @SuppressWarnings("unchecked")
     public void setUp() throws Exception {
         when(assetKey.getExtension()).thenReturn(".j3m");
         when(assetInfo.getManager()).thenReturn(assetManager);

+ 1 - 0
jme3-core/src/tools/java/jme3tools/optimize/TextureAtlas.java

@@ -348,6 +348,7 @@ public class TextureAtlas {
         }
     }
 
+    @SuppressWarnings("unchecked")
     private Image convertImageToAwt(Image source) {
         //use awt dependent classes without actual dependency via reflection
         try {

+ 1 - 0
jme3-desktop/src/main/java/com/jme3/system/JmeDesktopSystem.java

@@ -261,6 +261,7 @@ public class JmeDesktopSystem extends JmeSystemDelegate {
         return ctx;
     }
 
+    @SuppressWarnings("unchecked")
     private <T> T newObject(String className) {
         try {
             Class<T> clazz = (Class<T>) Class.forName(className);

+ 1 - 0
jme3-jogg/src/main/java/com/jme3/audio/plugins/OGGLoader.java

@@ -260,6 +260,7 @@ public class OGGLoader implements AssetLoader {
         }
     }
     
+    @SuppressWarnings("unchecked")
     private AudioData load(InputStream in, boolean readStream, boolean streamCache) throws IOException{
         if (readStream && streamCache){
             oggStream = new CachedOggStream(in);

+ 1 - 0
jme3-lwjgl3/src/main/java/com/jme3/system/lwjgl/LwjglContext.java

@@ -288,6 +288,7 @@ public abstract class LwjglContext implements JmeContext {
         }
     }
 
+    @SuppressWarnings("unchecked")
     protected void initOpenCL(final long window) {
         logger.info("Initialize OpenCL with LWJGL3");
         

+ 2 - 0
jme3-networking/src/main/java/com/jme3/network/Filters.java

@@ -47,6 +47,7 @@ public class Filters
      *  Creates a filter that returns true for any value in the specified
      *  list of values and false for all other cases.
      */
+    @SuppressWarnings("unchecked")
     public static <T> Filter<T> in( T... 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
      *  of calling not(in(values)).
      */
+    @SuppressWarnings("unchecked")
     public static <T> Filter<T> notIn( T... values )
     {
         return not( in( values ) );

+ 1 - 0
jme3-networking/src/main/java/com/jme3/network/base/DefaultClient.java

@@ -410,6 +410,7 @@ public class DefaultClient implements Client
      *  Either calls the ErrorListener or closes the connection
      *  if there are no listeners.  
      */ 
+    @SuppressWarnings("unchecked")
     protected void handleError( Throwable t )
     {
         // If there are no listeners then close the connection with

+ 2 - 0
jme3-networking/src/main/java/com/jme3/network/rmi/ObjectStore.java

@@ -129,6 +129,7 @@ public class ObjectStore {
         Serializer.registerClass(RemoteMethodReturnMessage.class, s);
     }
 
+    @SuppressWarnings("unchecked")
     public ObjectStore(Client client) {
         this.client = client;
         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{
         RemoteObject ro = remoteObjects.get(name);
         if (ro == null){

+ 1 - 0
jme3-networking/src/main/java/com/jme3/network/rmi/RmiSerializer.java

@@ -235,6 +235,7 @@ public class RmiSerializer extends Serializer {
     }
             
     @Override
+    @SuppressWarnings("unchecked")
     public <T> T readObject(ByteBuffer data, Class<T> c) throws IOException {
         if (c == RemoteObjectDefMessage.class){
             return (T) readObjectDefs(data);

+ 1 - 0
jme3-networking/src/main/java/com/jme3/network/serializing/serializers/FieldSerializer.java

@@ -55,6 +55,7 @@ public class FieldSerializer extends Serializer {
     private static Map<Class, SavedField[]> savedFields = new HashMap<Class, SavedField[]>();
     private static Map<Class, Constructor> savedCtors = new HashMap<Class, Constructor>();
 
+    @SuppressWarnings("unchecked")
     protected void checkClass(Class clazz) {
     
         // See if the class has a public no-arg constructor

+ 1 - 0
jme3-networking/src/main/java/com/jme3/network/service/AbstractService.java

@@ -60,6 +60,7 @@ public abstract class AbstractService<S extends ServiceManager> implements Servi
      *  Retrieves the first sibling service of the specified
      *  type.
      */   
+    @SuppressWarnings("unchecked")
     protected <T extends Service<S>> T getService( Class<T> type ) {
         return type.cast(serviceManager.getService(type));
     }    

+ 1 - 0
jme3-networking/src/main/java/com/jme3/network/service/rmi/RmiClientService.java

@@ -160,6 +160,7 @@ public class RmiClientService extends AbstractClientService {
     }
     
     @Override
+    @SuppressWarnings("unchecked")
     public void start() {
         super.start();
         

+ 1 - 0
jme3-networking/src/main/java/com/jme3/network/service/rmi/RmiHostedService.java

@@ -180,6 +180,7 @@ public class RmiHostedService extends AbstractHostedService {
      *  This method is called automatically for all new connections if
      *  autohost is set to true.
      */
+    @SuppressWarnings("unchecked")
     public void startHostingOnConnection( HostedConnection hc ) {
         if( log.isLoggable(Level.FINEST) ) {
             log.log(Level.FINEST, "startHostingOnConnection:{0}", hc);

+ 2 - 0
jme3-networking/src/main/java/com/jme3/network/service/rpc/RpcClientService.java

@@ -73,6 +73,7 @@ public class RpcClientService extends AbstractClientService {
      *  Used internally to setup the RpcConnection and MessageDelegator.
      */
     @Override
+    @SuppressWarnings("unchecked")
     protected void onInitialize( ClientServiceManager serviceManager ) {        
         Client client = serviceManager.getClient();
         this.rpc = new RpcConnection(client);
@@ -86,6 +87,7 @@ public class RpcClientService extends AbstractClientService {
      *  was previously added to the network Client.
      */
     @Override
+    @SuppressWarnings("unchecked")
     public void terminate( ClientServiceManager serviceManager ) {
         Client client = serviceManager.getClient();
         client.removeMessageListener(delegator, delegator.getMessageTypes());                   

+ 1 - 0
jme3-plugins/src/fbx/java/com/jme3/scene/plugins/fbx/mesh/FbxMesh.java

@@ -110,6 +110,7 @@ public final class FbxMesh extends FbxNodeAttribute<IntMap<Mesh>> {
         return skinDeformer;
     }
     
+    @SuppressWarnings("unchecked")
     public void applyCluster(FbxCluster cluster) {
         if (boneIndices == null) {
             boneIndices = new ArrayList[positions.length];

+ 2 - 0
jme3-plugins/src/gltf/java/com/jme3/scene/plugins/gltf/CustomContentManager.java

@@ -63,6 +63,7 @@ public class CustomContentManager {
         return output;
     }
 
+    @SuppressWarnings("unchecked")
     private <T> T readExtension(String name, JsonElement el, T input) throws AssetLoadException, IOException {
         JsonElement extensions = el.getAsJsonObject().getAsJsonObject("extensions");
         if (extensions == null) {
@@ -93,6 +94,7 @@ public class CustomContentManager {
         return input;
     }
 
+    @SuppressWarnings("unchecked")
     private <T> T readExtras(String name, JsonElement el, T input) throws AssetLoadException {
         if (key == null) {
             return input;

+ 3 - 0
jme3-plugins/src/xml/java/com/jme3/export/xml/DOMInputCapsule.java

@@ -1105,6 +1105,7 @@ public class DOMInputCapsule implements InputCapsule {
     }
 
     @Override
+    @SuppressWarnings("unchecked")
     public ArrayList<Savable> readSavableArrayList(String name, ArrayList defVal) throws IOException {
         try {
             Element tmpEl = findChildElement(currentElem, name);
@@ -1139,6 +1140,7 @@ public class DOMInputCapsule implements InputCapsule {
     }
 
     @Override
+    @SuppressWarnings("unchecked")
     public ArrayList<Savable>[] readSavableArrayListArray(
             String name, ArrayList[] defVal) throws IOException {
         try {
@@ -1185,6 +1187,7 @@ public class DOMInputCapsule implements InputCapsule {
     }
 
     @Override
+    @SuppressWarnings("unchecked")
     public ArrayList<Savable>[][] readSavableArrayListArray2D(String name, ArrayList[][] defVal) throws IOException {
         try {
             Element tmpEl = findChildElement(currentElem, name);

+ 1 - 0
jme3-terrain/src/main/java/com/jme3/terrain/geomipmap/picking/BresenhamTerrainPicker.java

@@ -83,6 +83,7 @@ public class BresenhamTerrainPicker implements TerrainPicker {
     }
 
     @Override
+    @SuppressWarnings("unchecked")
     public int getTerrainIntersection(Ray worldPick, CollisionResults results) {
         int numCollisions = 0;
         worldPickRay.set(worldPick);