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

@@ -130,9 +130,9 @@ public class Capability<T>
}
catch (Exception e)
{
Throwables.propagate(e);
Throwables.throwIfUnchecked(e);
throw new RuntimeException(e);
}
return null;
}
/**
@@ -26,12 +26,10 @@ import java.util.IdentityHashMap;
import java.util.List;
import java.util.concurrent.Callable;
import org.apache.logging.log4j.Level;
import org.objectweb.asm.Type;
import java.util.function.Function;
import com.google.common.base.Preconditions;
import com.google.common.base.Throwables;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
@@ -39,8 +37,6 @@ import net.minecraftforge.common.util.EnumHelper;
import net.minecraftforge.fml.common.FMLLog;
import net.minecraftforge.fml.common.discovery.ASMDataTable;
import javax.annotation.Nullable;
public enum CapabilityManager
{
INSTANCE;
@@ -62,7 +58,7 @@ public enum CapabilityManager
try {
return implementation.newInstance();
} catch (InstantiationException | IllegalAccessException e) {
throw Throwables.propagate(e);
throw new RuntimeException(e);
}
});
}