Clean up uses of deprecated library functions (#4130)

Avoid catching and rethrowing runtime exceptions
Append error messages to exceptions instead of the log
This commit is contained in:
Ben Staddon authored and mezz committed 2017-07-12 21:50:28 -07:00
1 parent ead0e81025
commit 0fde64ac38
44 files changed
+118 -232

No files matched your search

@@ -33,7 +33,6 @@ import net.minecraftforge.fml.common.discovery.ASMDataTable.ASMData;
import net.minecraftforge.fml.common.registry.GameRegistry;
import net.minecraftforge.fml.common.registry.GameRegistry.ObjectHolder;
import com.google.common.base.Throwables;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
@@ -105,10 +104,9 @@ public enum ObjectHolderRegistry
clazz = Class.forName(className, extractFromValue, getClass().getClassLoader());
classCache.put(className, clazz);
}
catch (Exception ex)
catch (ClassNotFoundException ex)
{
// unpossible?
Throwables.throwIfUnchecked(ex);
throw new RuntimeException(ex);
}
}
@@ -133,10 +131,9 @@ public enum ObjectHolderRegistry
Field f = clazz.getDeclaredField(annotationTarget);
addHolderReference(new ObjectHolderRef(f, new ResourceLocation(value), extractFromValue));
}
catch (Exception ex)
catch (NoSuchFieldException ex)
{
// unpossible?
Throwables.throwIfUnchecked(ex);
throw new RuntimeException(ex);
}
}