mirror of
https://github.com/GTNewHorizons/NotEnoughItems.git
synced 2026-11-17 19:15:13 +00:00
Small Cleanup (#518)
* Deobfuscate parameters * Fix generics * Replace deprecated methods * Add `serialVersionUID`s * Fix static access * Add default switch case * Close OutputStreams * Fix wrong variable usage * Explicitly declare exceptions
This commit is contained in:
1 parent
2507634196
commit
165afa2910
31 files changed
+42
-59
No files matched your search
@@ -1,5 +1,6 @@
|
||||
package codechicken.nei.util;
|
||||
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@@ -216,8 +217,9 @@ public class NBTJson {
|
||||
if (obj.has("__custom_type")) {
|
||||
try {
|
||||
final String className = obj.get("__custom_type").getAsString();
|
||||
return (NBTBase) Class.forName(className).newInstance();
|
||||
} catch (ClassNotFoundException | InstantiationException | IllegalAccessException th) {}
|
||||
return (NBTBase) Class.forName(className).getConstructor().newInstance();
|
||||
} catch (InstantiationException | IllegalAccessException | InvocationTargetException | NoSuchMethodException
|
||||
| SecurityException | ClassNotFoundException th) {}
|
||||
}
|
||||
|
||||
return null;
|
||||
|
||||
Reference in new issue
Block a user