suppress still more javac warnings about unchecked casts

master
Stephen Gold 5 years ago
parent 70ae48af1e
commit 1c3ed5122f
  1. 5
      jme3-core/src/main/java/com/jme3/asset/DesktopAssetManager.java
  2. 4
      jme3-core/src/main/java/com/jme3/asset/ImplHandler.java
  3. 2
      jme3-core/src/main/java/com/jme3/material/Material.java
  4. 1
      jme3-core/src/main/java/com/jme3/util/IntMap.java
  5. 2
      jme3-examples/src/main/java/jme3test/TestChooser.java

@ -143,6 +143,7 @@ public class DesktopAssetManager implements AssetManager {
}
}
@SuppressWarnings("unchecked")
public void registerLoader(String clsName, String ... extensions){
Class<? extends AssetLoader> clazz = null;
try{
@ -175,6 +176,7 @@ public class DesktopAssetManager implements AssetManager {
}
}
@SuppressWarnings("unchecked")
public void registerLocator(String rootPath, String clsName){
Class<? extends AssetLocator> clazz = null;
try{
@ -263,6 +265,7 @@ public class DesktopAssetManager implements AssetManager {
* @throws AssetLoadException If failed to load asset due to exception or
* other error.
*/
@SuppressWarnings("unchecked")
protected <T> T loadLocatedAsset(AssetKey<T> key, AssetInfo info, AssetProcessor proc, AssetCache cache) {
AssetLoader loader = handler.aquireLoader(key);
Object obj;
@ -318,6 +321,7 @@ public class DesktopAssetManager implements AssetManager {
* {@link CloneableSmartAsset}, if the cache is null, or if the
* processor did not clone the asset.
*/
@SuppressWarnings("unchecked")
protected <T> T registerAndCloneSmartAsset(AssetKey<T> key, T obj, AssetProcessor proc, AssetCache cache) {
// object obj is the original asset
// create an instance for user
@ -354,6 +358,7 @@ public class DesktopAssetManager implements AssetManager {
}
@Override
@SuppressWarnings("unchecked")
public <T> T loadAsset(AssetKey<T> key){
if (key == null)
throw new IllegalArgumentException("key cannot be null");

@ -208,6 +208,7 @@ final class ImplHandler {
}
}
@SuppressWarnings("unchecked")
public <T extends AssetCache> T getCache(Class<T> cacheClass) {
if (cacheClass == null) {
return null;
@ -234,6 +235,7 @@ final class ImplHandler {
return cache;
}
@SuppressWarnings("unchecked")
public <T extends AssetProcessor> T getProcessor(Class<T> procClass){
if (procClass == null)
return null;
@ -259,6 +261,7 @@ final class ImplHandler {
return proc;
}
@SuppressWarnings("unchecked")
public void addLoader(final Class<? extends AssetLoader> loaderType, String ... extensions){
// Synchronized access must be used for any ops on classToLoaderMap
ImplThreadLocal local = new ImplThreadLocal(loaderType, extensions);
@ -285,6 +288,7 @@ final class ImplHandler {
}
}
@SuppressWarnings("unchecked")
public void addLocator(final Class<? extends AssetLocator> locatorType, String rootPath){
locatorsList.add(new ImplThreadLocal(locatorType, rootPath));
}

@ -416,6 +416,7 @@ public class Material implements CloneableSmartAsset, Cloneable, Savable {
* @param name the parameter name to look up.
* @return current value or null if the parameter wasn't set.
*/
@SuppressWarnings("unchecked")
public <T> T getParamValue(final String name) {
final MatParam param = paramValues.get(name);
return param == null ? null : (T) param.getValue();
@ -1061,6 +1062,7 @@ public class Material implements CloneableSmartAsset, Cloneable, Savable {
}
@Override
@SuppressWarnings("unchecked")
public void read(JmeImporter im) throws IOException {
InputCapsule ic = im.getCapsule(this);

@ -262,6 +262,7 @@ public final class IntMap<T> implements Iterable<Entry<T>>, Cloneable, JmeClonea
}
@Override
@SuppressWarnings("unchecked")
public Entry next() {
if (el >= size)
throw new NoSuchElementException("No more elements!");

@ -393,11 +393,13 @@ public class TestChooser extends JDialog {
private ListModel originalModel;
@Override
@SuppressWarnings("unchecked")
public void setModel(ListModel m) {
originalModel = m;
super.setModel(m);
}
@SuppressWarnings("unchecked")
private void update() {
if (filter == null || filter.length() == 0) {
super.setModel(originalModel);

Loading…
Cancel
Save