File: java11-compatibility.patch

package info (click to toggle)
sitemesh 2.4.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,792 kB
  • sloc: java: 6,708; xml: 551; jsp: 393; perl: 64; makefile: 11
file content (24 lines) | stat: -rw-r--r-- 1,087 bytes parent folder | download | duplicates (2)
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.