Merge declaration and initialization of a variable.

This commit is contained in:
Florian Nücke committed 2013-05-08 20:16:15 +02:00
1 parent 2cca7aa759
commit 8517a824e5
1 file changed
+5 -7
@@ -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