1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
|
Description: Fixes the build failure with Java 11
Author: Emmanuel Bourg <ebourg@apache.org>
Bug: https://github.com/sitemesh/sitemesh2/pull/36
--- a/src/java/com/opensymphony/module/sitemesh/Factory.java
+++ b/src/java/com/opensymphony/module/sitemesh/Factory.java
@@ -14,7 +14,6 @@
import com.opensymphony.module.sitemesh.util.Container;
import javax.naming.InitialContext;
-import javax.rmi.PortableRemoteObject;
import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
@@ -89,9 +88,8 @@
if (Container.get() != Container.JRUN) {
// TODO: JRun really isn't happy with this
InitialContext ctx = new InitialContext();
- Object o = ctx.lookup("java:comp/env/" + envEntry);
+ result = (String) ctx.lookup("java:comp/env/" + envEntry);
ctx.close();
- result = (String)PortableRemoteObject.narrow(o, String.class); // rmi-iiop friendly.
}
}
catch (Exception e) { } // failed - don't moan, just return default.
|