Add wildcard types for generics to suppress warnings

This commit is contained in:
Kevin Breslin 2016-05-23 01:35:58 -04:00 committed by Mike Primm
parent 1a6ed552ea
commit 2fef8eac1e
3 changed files with 8 additions and 8 deletions

View File

@ -90,7 +90,7 @@ public abstract class BukkitVersionHelper {
/** /**
* Get tile entities map from chunk * Get tile entities map from chunk
*/ */
public abstract Map getTileEntitiesForChunk(Chunk c); public abstract Map<?, ?> getTileEntitiesForChunk(Chunk c);
/** /**
* Get X coordinate of tile entity * Get X coordinate of tile entity
*/ */

View File

@ -24,8 +24,8 @@ public abstract class BukkitVersionHelperGeneric extends BukkitVersionHelper {
protected String nms_package; // Package used for net.minecraft.server protected String nms_package; // Package used for net.minecraft.server
private boolean failed; private boolean failed;
protected static final Object[] nullargs = new Object[0]; protected static final Object[] nullargs = new Object[0];
protected static final Class[] nulltypes = new Class[0]; protected static final Class<?>[] nulltypes = new Class[0];
private static final Map nullmap = Collections.emptyMap(); private static final Map<?, ?> nullmap = Collections.emptyMap();
/** CraftChunkSnapshot */ /** CraftChunkSnapshot */
private Class<?> craftchunksnapshot; private Class<?> craftchunksnapshot;
@ -249,7 +249,7 @@ public abstract class BukkitVersionHelperGeneric extends BukkitVersionHelper {
/** /**
* Get method * Get method
*/ */
protected Method getMethod(Class<?> cls, String[] ids, Class[] args) { protected Method getMethod(Class<?> cls, String[] ids, Class<?>[] args) {
if(cls == null) return null; if(cls == null) return null;
for(String id : ids) { for(String id : ids) {
try { try {
@ -262,7 +262,7 @@ public abstract class BukkitVersionHelperGeneric extends BukkitVersionHelper {
failed = true; failed = true;
return null; return null;
} }
protected Method getMethodNoFail(Class<?> cls, String[] ids, Class[] args) { protected Method getMethodNoFail(Class<?> cls, String[] ids, Class<?>[] args) {
if(cls == null) return null; if(cls == null) return null;
for(String id : ids) { for(String id : ids) {
try { try {
@ -360,10 +360,10 @@ public abstract class BukkitVersionHelperGeneric extends BukkitVersionHelper {
} }
/** Get tile entities map from chunk */ /** Get tile entities map from chunk */
public Map getTileEntitiesForChunk(Chunk c) { public Map<?, ?> getTileEntitiesForChunk(Chunk c) {
Object omsc = callMethod(c, cc_gethandle, nullargs, null); Object omsc = callMethod(c, cc_gethandle, nullargs, null);
if(omsc != null) { if(omsc != null) {
return (Map)getFieldValue(omsc, nmsc_tileentities, nullmap); return (Map<?, ?>)getFieldValue(omsc, nmsc_tileentities, nullmap);
} }
return nullmap; return nullmap;
} }

View File

@ -98,7 +98,7 @@ public class BukkitVersionHelperGlowstone extends BukkitVersionHelper {
} }
@Override @Override
public Map getTileEntitiesForChunk(Chunk c) { public Map<?, ?> getTileEntitiesForChunk(Chunk c) {
// TODO Auto-generated method stub // TODO Auto-generated method stub
return Collections.emptyMap(); return Collections.emptyMap();
} }