diff --git a/common/cpw/mods/fml/common/ILanguageAdapter.java b/common/cpw/mods/fml/common/ILanguageAdapter.java index 8e0f9f015d..74e261f7a2 100644 --- a/common/cpw/mods/fml/common/ILanguageAdapter.java +++ b/common/cpw/mods/fml/common/ILanguageAdapter.java @@ -31,8 +31,6 @@ public interface ILanguageAdapter { @Override public void setProxy(Field target, Class proxyTarget, Object proxy) throws IllegalArgumentException, IllegalAccessException, NoSuchFieldException, SecurityException { - Object targetInstance; - try { // Get the actual singleton class. The two variants are from @@ -53,11 +51,6 @@ public interface ILanguageAdapter { // Get internal class generated by Scala. proxyTarget = Class.forName(proxyTarget.getName() + "$", true, proxyTarget.getClassLoader()); } - - // Get the instance via the MODULE$ field which is - // automatically generated by the Scala compiler for - // singletons. - targetInstance = proxyTarget.getField("MODULE$").get(null); } catch (ClassNotFoundException e) { @@ -66,6 +59,11 @@ public interface ILanguageAdapter { throw new LoaderException(e); } + // Get the instance via the MODULE$ field which is + // automatically generated by the Scala compiler for + // singletons. + Object targetInstance = proxyTarget.getField("MODULE$").get(null); + try { // Find setter function. We do it this way because we can't