<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<p>JEP 411 is quite a conundrum for downstream developers that
depend on SM.<br>
</p>
<p>SecurityManager has its problems, but it's the only authorization
layer we have.</p>
<p>If I had a complaint about SM, it's the implementation of:</p>
<ol>
<li> SocketPermission doesn't allow netmask wild cards. <br>
</li>
<li>Thread inherited AccessControlContext and Executors.</li>
</ol>
<p>My own implementations are not subject to the issues that the
JVM's SM and Policy provider implementations suffer documented in
JEP 411.<br>
</p>
<p>I think if authorization was redesigned from the ground up, Java
would have a privileged mode, or privileged call (where
permissions are checked) and everything else would be
unprivileged, so there is no stack walk required for unpriviledged
code, only privileged and it would be very short and not persist
across threads.<br>
</p>
<p>Java has a very large API surface, compared to other languages.</p>
<p>It's a difficult decision to stick with Java, I keep looking at
the other languages with their smaller API's , I keep wondering if
I'm better off in the long term changing to another development
language. OpenJDK has quite rightly identified that the cost of
maintaining an authorization layer for Java is too high, given
it's vast API surface area, it would be simpler to develop an
authorization layer for another language with a smaller API. For
now I'm trying to stick with Java. But the reality is, I have
until 2030 to transition if I revert to Java 8, and Java 11 gets
us through to 2029. Java has some great new features, but they
come at a cost. Everything is a compromise, and one must select
the right compromise. I have a lot of code I've developed in Java
and have also invested a lot of time into it. It is also likely
there will be more deprecation for removal JEP's in future, I
mean, someone might come up with the argument we don't require
dynamic class loading, because that's for applets. Dynamic class
loading allows loading of untrusted code, so we should only allow
trusted code to run that was installed statically by an
administrator, because Java is only for Servers now. <br>
</p>
<p>This is the message I'm getting loud and clear, Java is only for
servers in future. I'm in the server space, but it's not the
server model that OpenJDK developers have in mind. This reminds
me of the Unix workstation, with Unix retreating to servers then
being replaced by Linux.<br>
</p>
<p>When is Java no longer Java? Rather than continuing to evolve
Java, why not use the JVM to create a new language project, or
maybe a CVM (Clojure virtual machine?) which learns from the
lessons of Java and let Java continue to be Java?<br>
</p>
<p>For now at least, I am trying to stick with Java, but it's not a
clear decision.</p>
<p>It would be an easier decision to make if OpenJDK could provide
some hooks where permission checks are currently made, so that we
can implement our own authorization layer.<br>
</p>
<p>Anyway, these are just my personal thoughts and opinions, I do
realize that they are probably unwelcome here.<br>
</p>
<p>Regards,</p>
<p>Peter.<br>
</p>
<div class="moz-cite-prefix">On 22/07/2021 5:31 am, Sean Mullan
wrote:<br>
</div>
<blockquote type="cite"
cite="mid:9882022f-a1cd-d038-bec8-d11768578569@oracle.com">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
Hi,<br>
<br>
I am not an expert in JSR 223. However, some JSR 223
implementations include a mechanism for restricting access to Java
classes, for example Nashorn [1] and Rhino [2], which might be
sufficient for your needs. (Note, Nashorn was deprecated and
removed from JDK 15 [3]). I think most of the permissions you list
below can be mapped to a small list of Java classes that check
those permissions. Also, with strong encapsulation of JDK
internals enforced by default in JDK 17 [4], you get additional
protection that is not dependent on the Security Manager.<br>
<br>
What JSR 223 implementation do you use?<br>
<br>
--Sean<br>
<br>
[1]
<a class="moz-txt-link-freetext"
href="https://docs.oracle.com/javase/8/docs/technotes/guides/scripting/nashorn/api.html#classfilter_introduction"
moz-do-not-send="true">https://docs.oracle.com/javase/8/docs/technotes/guides/scripting/nashorn/api.html#classfilter_introduction</a><br>
[2]
<a class="moz-txt-link-freetext"
href="https://mozilla.github.io/rhino/javadoc/org/mozilla/javascript/ClassShutter.html"
moz-do-not-send="true">https://mozilla.github.io/rhino/javadoc/org/mozilla/javascript/ClassShutter.html</a><br>
[3] <a class="moz-txt-link-freetext"
href="https://openjdk.java.net/jeps/372" moz-do-not-send="true">https://openjdk.java.net/jeps/372</a><br>
[4] <a class="moz-txt-link-freetext"
href="https://openjdk.java.net/jeps/403" moz-do-not-send="true">https://openjdk.java.net/jeps/403</a><br>
<br>
<div class="moz-cite-prefix">On 7/21/21 12:35 PM, Alexey
Shponarsky wrote:<br>
</div>
<blockquote type="cite"
cite="mid:CAAwknq+gf9Q2b51kwzdWeYxW4YfdzqHdkPAz-mE7tLB_erwM5w@mail.gmail.com">
<div dir="ltr">Hello,
<div><br>
</div>
<div><span
id="gmail-docs-internal-guid-a0cacd73-7fff-ad6e-8866-1c6a3889248a">
<p dir="ltr"
style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:11pt;font-family:Arial;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">At Jelastic PaaS, we are using SecurityManager within Java Scripting (JSR 223). Specifically, Java Scripting allows us and our customers to easily extend the core platform functionality with custom logic. The developers can execute their custom scriptlets inside a Java Scripting runtime environment with pre-injected core platform API methods. For example, </span></p>
<p dir="ltr"
style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"> </p>
<p dir="ltr"
style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:9pt;font-family:"Courier New";color:rgb(0,128,0);background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">//@req(pathFrom, pathTo)</span></p>
<p dir="ltr"
style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:9pt;font-family:"Courier New";color:rgb(0,0,255);background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">var</span><span style="font-size:9pt;font-family:"Courier New";color:rgb(0,0,0);background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap"> mountFrom = </span><span style="font-size:9pt;font-family:"Courier New";color:rgb(163,21,21);background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">"${</span><a
href="http://nodes.build.first.id/"
style="text-decoration-line:none"
moz-do-not-send="true"><span style="font-size:9pt;font-family:"Courier New";background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;text-decoration-line:underline;vertical-align:baseline;white-space:pre-wrap">nodes.build.first.id</span></a><span style="font-size:9pt;font-family:"Courier New";color:rgb(163,21,21);background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">}"</span><span style="font-size:9pt;font-family:"Courier New";color:rgb(0,0,0);background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">,</span></p>
<p dir="ltr"
style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:9pt;font-family:"Courier New";color:rgb(0,0,0);background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap"><span class="gmail-Apple-tab-span" style="white-space:pre"> </span></span><span style="font-size:9pt;font-family:"Courier New";color:rgb(0,0,0);background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">envName = </span><span style="font-size:9pt;font-family:"Courier New";color:rgb(163,21,21);background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">"${settings.targetEnv}"</span><span style="font-size:9pt;font-family:"Courier New";color:rgb(0,0,0);background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">,</span></p>
<p dir="ltr"
style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:9pt;font-family:"Courier New";color:rgb(0,0,0);background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap"><span class="gmail-Apple-tab-span" style="white-space:pre"> </span></span><span style="font-size:9pt;font-family:"Courier New";color:rgb(0,0,0);background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">mountTo = </span><span style="font-size:9pt;font-family:"Courier New";color:rgb(163,21,21);background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">"cp"</span><span style="font-size:9pt;font-family:"Courier New";color:rgb(0,0,0);background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">;</span></p>
<p dir="ltr"
style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:9pt;font-family:"Courier New";color:rgb(0,0,255);background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">var</span><span style="font-size:9pt;font-family:"Courier New";color:rgb(0,0,0);background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap"> resp = jelastic.env.file.RemoveMountPointByGroup(envName, session, mountTo, pathTo);</span></p>
<p dir="ltr"
style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:9pt;font-family:"Courier New";color:rgb(0,0,255);background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">if</span><span style="font-size:9pt;font-family:"Courier New";color:rgb(0,0,0);background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap"> (resp.result != 0) </span><span style="font-size:9pt;font-family:"Courier New";color:rgb(0,0,255);background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">return</span><span style="font-size:9pt;font-family:"Courier New";color:rgb(0,0,0);background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap"> resp;</span></p>
<p dir="ltr"
style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:9pt;font-family:"Courier New";color:rgb(0,0,255);background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">return</span><span style="font-size:9pt;font-family:"Courier New";color:rgb(0,0,0);background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap"> jelastic.env.file.AddMountPointByGroup(envName, session, mountTo, pathTo, </span><span style="font-size:9pt;font-family:"Courier New";color:rgb(163,21,21);background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">'nfs'</span><span style="font-size:9pt;font-family:"Courier New";color:rgb(0,0,0);background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">, </span><span style="font-size:9pt;font-family:"Courier New";color:rgb(163,21,21);background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">null</span><span style="font-size:9pt;font-family:"Courier New";color:rgb(0,0,0);background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">, pathFrom, mountFrom, </span><span style="font-size:9pt;font-family:"Courier New";color:rgb(163,21,21);background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">''</span><span style="font-size:9pt;font-family:"Courier New";color:rgb(0,0,0);background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">, </span><span style="font-size:9pt;font-family:"Courier New";color:rgb(163,21,21);background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">false</span><span style="font-size:9pt;font-family:"Courier New";color:rgb(0,0,0);background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">);</span></p>
<p dir="ltr"
style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:11pt;font-family:Arial;background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap"> </span></p>
<p dir="ltr"
style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:11pt;font-family:Arial;background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">As Java Scripting engine / technology provides quite powerful runtimes, we have to restrict certains actions such as execution of any reflection methods, change of any system environment variables, exit, calling some dangerous static methods, reading files outside of the sandbox folder, etc. The SecurityManager mechanism provided an ability to configure permissions easily.</span></p>
<p dir="ltr"
style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"> </p>
<p dir="ltr"
style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:11pt;font-family:Arial;background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">To achieve this we create an instance of AccessControlContext with required permissions and pass it to </span><a
href="https://docs.oracle.com/javase/8/docs/api/java/security/AccessController.html#doPrivileged-java.security.PrivilegedAction-java.security.AccessControlContext-"
style="text-decoration-line:none"
moz-do-not-send="true"><span style="font-size:11pt;font-family:Arial;background-color:transparent;font-style:italic;font-variant-numeric:normal;font-variant-east-asian:normal;text-decoration-line:underline;vertical-align:baseline;white-space:pre-wrap">AccessController.doPrivileged</span></a><span style="font-size:11pt;font-family:Arial;background-color:transparent;font-style:italic;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap"> </span><span style="font-size:11pt;font-family:Arial;background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">method:</span></p>
<p dir="ltr"
style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"> </p>
<p dir="ltr"
style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:11pt;font-family:Arial;color:rgb(0,0,0);background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">//Create list of </span><span style="font-size:10pt;font-family:"Courier New";color:rgb(0,0,0);font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">Permission</span><span style="font-size:11pt;font-family:Arial;color:rgb(0,0,0);background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">:</span></p>
<p dir="ltr"
style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:10pt;font-family:"Courier New";color:rgb(0,0,0);font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">Collection</span><span style="font-size:10pt;font-family:"Courier New";color:rgb(8,8,8);font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap"><</span><span style="font-size:10pt;font-family:"Courier New";color:rgb(0,0,0);font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">Permission</span><span style="font-size:10pt;font-family:"Courier New";color:rgb(8,8,8);font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">> </span><span style="font-size:10pt;font-family:"Courier New";color:rgb(0,0,0);font-weight:700;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">perms</span><span style="font-size:10pt;font-family:"Courier New";color:rgb(0,0,0);font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap"> </span><span style="font-size:10pt;font-family:"Courier New";color:rgb(8,8,8);font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">= </span><span style="font-size:10pt;font-family:"Courier New";color:rgb(0,51,179);font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">new </span><span style="font-size:10pt;font-family:"Courier New";color:rgb(8,8,8);font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">LinkedList<</span><span style="font-size:10pt;font-family:"Courier New";color:rgb(0,0,0);font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">Permission</span><span style="font-size:10pt;font-family:"Courier New";color:rgb(8,8,8);font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">>();</span></p>
<p dir="ltr"
style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:10pt;font-family:"Courier New";color:rgb(0,0,0);font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">perms</span><span style="font-size:10pt;font-family:"Courier New";color:rgb(8,8,8);font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">.add(</span><span style="font-size:10pt;font-family:"Courier New";color:rgb(0,51,179);font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">new </span><span style="font-size:10pt;font-family:"Courier New";color:rgb(8,8,8);font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">RuntimePermission(</span><span style="font-size:10pt;font-family:"Courier New";color:rgb(6,125,23);font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">"createClassLoader"</span><span style="font-size:10pt;font-family:"Courier New";color:rgb(8,8,8);font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">));</span></p>
<p dir="ltr"
style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:10pt;font-family:"Courier New";color:rgb(0,0,0);font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">perms</span><span style="font-size:10pt;font-family:"Courier New";color:rgb(8,8,8);font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">.add(</span><span style="font-size:10pt;font-family:"Courier New";color:rgb(0,51,179);font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">new </span><span style="font-size:10pt;font-family:"Courier New";color:rgb(8,8,8);font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">RuntimePermission(</span><span style="font-size:10pt;font-family:"Courier New";color:rgb(6,125,23);font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">"getClassLoader"</span><span style="font-size:10pt;font-family:"Courier New";color:rgb(8,8,8);font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">));</span></p>
<p dir="ltr"
style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:10pt;font-family:"Courier New";color:rgb(0,0,0);font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">perms</span><span style="font-size:10pt;font-family:"Courier New";color:rgb(8,8,8);font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">.add(</span><span style="font-size:10pt;font-family:"Courier New";color:rgb(0,51,179);font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">new </span><span style="font-size:10pt;font-family:"Courier New";color:rgb(8,8,8);font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">RuntimePermission(</span><span style="font-size:10pt;font-family:"Courier New";color:rgb(6,125,23);font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">"accessDeclaredMembers"</span><span style="font-size:10pt;font-family:"Courier New";color:rgb(8,8,8);font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">));</span></p>
<p dir="ltr"
style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:10pt;font-family:"Courier New";color:rgb(0,0,0);font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">perms</span><span style="font-size:10pt;font-family:"Courier New";color:rgb(8,8,8);font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">.add(</span><span style="font-size:10pt;font-family:"Courier New";color:rgb(0,51,179);font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">new </span><span style="font-size:10pt;font-family:"Courier New";color:rgb(8,8,8);font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">RuntimePermission(</span><span style="font-size:10pt;font-family:"Courier New";color:rgb(6,125,23);font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">"getProtectionDomain"</span><span style="font-size:10pt;font-family:"Courier New";color:rgb(8,8,8);font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">));</span></p>
<p dir="ltr"
style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:10pt;font-family:"Courier New";color:rgb(0,0,0);font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">perms</span><span style="font-size:10pt;font-family:"Courier New";color:rgb(8,8,8);font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">.add(</span><span style="font-size:10pt;font-family:"Courier New";color:rgb(0,51,179);font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">new </span><span style="font-size:10pt;font-family:"Courier New";color:rgb(8,8,8);font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">PropertyPermission(</span><span style="font-size:10pt;font-family:"Courier New";color:rgb(6,125,23);font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">"*"</span><span style="font-size:10pt;font-family:"Courier New";color:rgb(8,8,8);font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">, </span><span style="font-size:10pt;font-family:"Courier New";color:rgb(6,125,23);font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">"read"</span><span style="font-size:10pt;font-family:"Courier New";color:rgb(8,8,8);font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">));</span></p>
<p dir="ltr"
style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:10pt;font-family:"Courier New";color:rgb(0,0,0);font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">perms</span><span style="font-size:10pt;font-family:"Courier New";color:rgb(8,8,8);font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">.add(</span><span style="font-size:10pt;font-family:"Courier New";color:rgb(0,51,179);font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">new </span><span style="font-size:10pt;font-family:"Courier New";color:rgb(8,8,8);font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">SocketPermission(</span><span style="font-size:10pt;font-family:"Courier New";color:rgb(6,125,23);font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">"*"</span><span style="font-size:10pt;font-family:"Courier New";color:rgb(8,8,8);font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">, </span><span style="font-size:10pt;font-family:"Courier New";color:rgb(6,125,23);font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">"connect,accept,resolve"</span><span style="font-size:10pt;font-family:"Courier New";color:rgb(8,8,8);font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">));</span></p>
<p dir="ltr"
style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:10pt;font-family:"Courier New";color:rgb(0,0,0);font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">perms</span><span style="font-size:10pt;font-family:"Courier New";color:rgb(8,8,8);font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">.add(</span><span style="font-size:10pt;font-family:"Courier New";color:rgb(0,51,179);font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">new </span><span style="font-size:10pt;font-family:"Courier New";color:rgb(8,8,8);font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">SocketPermission(</span><span style="font-size:10pt;font-family:"Courier New";color:rgb(6,125,23);font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">"localhost:0-"</span><span style="font-size:10pt;font-family:"Courier New";color:rgb(8,8,8);font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">, </span><span style="font-size:10pt;font-family:"Courier New";color:rgb(6,125,23);font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">"connect,accept,resolve,listen"</span><span style="font-size:10pt;font-family:"Courier New";color:rgb(8,8,8);font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">));</span></p>
<p dir="ltr"
style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"> </p>
<p dir="ltr"
style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"> </p>
<p dir="ltr"
style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:10pt;font-family:"Courier New";color:rgb(0,0,0);font-weight:700;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">//Create </span><span style="font-size:10pt;font-family:"Courier New";color:rgb(0,0,0);font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">AccessControlContext</span></p>
<p dir="ltr"
style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:10pt;font-family:"Courier New";color:rgb(0,0,0);font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">ProtectionDomain domain </span><span style="font-size:10pt;font-family:"Courier New";color:rgb(8,8,8);font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">= </span><span style="font-size:10pt;font-family:"Courier New";color:rgb(0,51,179);font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">new </span><span style="font-size:10pt;font-family:"Courier New";color:rgb(8,8,8);font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">ProtectionDomain(</span><span style="font-size:10pt;font-family:"Courier New";color:rgb(0,51,179);font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">new </span><span style="font-size:10pt;font-family:"Courier New";color:rgb(8,8,8);font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">CodeSource(</span><span style="font-size:10pt;font-family:"Courier New";color:rgb(0,51,179);font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">null</span><span style="font-size:10pt;font-family:"Courier New";color:rgb(8,8,8);font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">, (</span><span style="font-size:10pt;font-family:"Courier New";color:rgb(0,0,0);font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">Certificate</span><span style="font-size:10pt;font-family:"Courier New";color:rgb(8,8,8);font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">[]) </span><span style="font-size:10pt;font-family:"Courier New";color:rgb(0,51,179);font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">null</span><span style="font-size:10pt;font-family:"Courier New";color:rgb(8,8,8);font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">), </span><span style="font-size:10pt;font-family:"Courier New";color:rgb(0,0,0);font-weight:700;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">perms</span><span style="font-size:10pt;font-family:"Courier New";color:rgb(8,8,8);font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">);</span></p>
<p dir="ltr"
style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:10pt;font-family:"Courier New";color:rgb(0,0,0);font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">AccessControlContext </span><span style="font-size:10pt;font-family:"Courier New";color:rgb(133,22,145);font-weight:700;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">acc</span><span style="font-size:10pt;font-family:"Courier New";color:rgb(0,0,0);font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap"> </span><span style="font-size:10pt;font-family:"Courier New";color:rgb(8,8,8);font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">= </span><span style="font-size:10pt;font-family:"Courier New";color:rgb(0,51,179);font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">new </span><span style="font-size:10pt;font-family:"Courier New";color:rgb(8,8,8);font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">AccessControlContext(</span><span style="font-size:10pt;font-family:"Courier New";color:rgb(0,51,179);font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">new </span><span style="font-size:10pt;font-family:"Courier New";color:rgb(8,8,8);font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">ProtectionDomain[]{</span><span style="font-size:10pt;font-family:"Courier New";color:rgb(0,0,0);font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">domain</span><span style="font-size:10pt;font-family:"Courier New";color:rgb(8,8,8);font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">});</span></p>
<p dir="ltr"
style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"> </p>
<p dir="ltr"
style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:11pt;font-family:Arial;color:rgb(0,0,0);background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">//Run untrusted code using created </span><span style="font-size:10pt;font-family:"Courier New";color:rgb(0,0,0);font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">AccessControlContext</span></p>
<p dir="ltr"
style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:10pt;font-family:"Courier New";color:rgb(158,136,13);font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">@Override</span></p>
<p dir="ltr"
style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:10pt;font-family:"Courier New";color:rgb(0,51,179);font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">public </span><span style="font-size:10pt;font-family:"Courier New";color:rgb(0,0,0);font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">ScriptEvalResponse </span><span style="font-size:10pt;font-family:"Courier New";color:rgb(0,98,122);font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">call</span><span style="font-size:10pt;font-family:"Courier New";color:rgb(8,8,8);font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">() </span><span style="font-size:10pt;font-family:"Courier New";color:rgb(0,51,179);font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">throws </span><span style="font-size:10pt;font-family:"Courier New";color:rgb(0,0,0);font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">Exception </span><span style="font-size:10pt;font-family:"Courier New";color:rgb(8,8,8);font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">{</span></p>
<p dir="ltr"
style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:10pt;font-family:"Courier New";color:rgb(8,8,8);font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap"> </span><span style="font-size:10pt;font-family:"Courier New";color:rgb(0,0,0);font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">Object obj </span><span style="font-size:10pt;font-family:"Courier New";color:rgb(8,8,8);font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">= </span><span style="font-size:10pt;font-family:"Courier New";color:rgb(0,0,0);font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">AccessController</span><span style="font-size:10pt;font-family:"Courier New";color:rgb(8,8,8);font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">.</span><span style="font-size:10pt;font-family:"Courier New";color:rgb(8,8,8);font-style:italic;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">doPrivileged</span><span style="font-size:10pt;font-family:"Courier New";color:rgb(8,8,8);font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">(</span><span style="font-size:10pt;font-family:"Courier New";color:rgb(0,51,179);font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">new </span><span style="font-size:10pt;font-family:"Courier New";color:rgb(0,0,0);font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">PrivilegedAction</span><span style="font-size:10pt;font-family:"Courier New";color:rgb(8,8,8);font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap"><</span><span style="font-size:10pt;font-family:"Courier New";color:rgb(0,0,0);font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">Object</span><span style="font-size:10pt;font-family:"Courier New";color:rgb(8,8,8);font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">>() {</span></p>
<p dir="ltr"
style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"> </p>
<p dir="ltr"
style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:10pt;font-family:"Courier New";color:rgb(8,8,8);font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap"> </span><span style="font-size:10pt;font-family:"Courier New";color:rgb(158,136,13);font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">@Override</span></p>
<p dir="ltr"
style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:10pt;font-family:"Courier New";color:rgb(158,136,13);font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap"> </span><span style="font-size:10pt;font-family:"Courier New";color:rgb(0,51,179);font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">public </span><span style="font-size:10pt;font-family:"Courier New";color:rgb(0,0,0);font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">Object </span><span style="font-size:10pt;font-family:"Courier New";color:rgb(0,98,122);font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">run</span><span style="font-size:10pt;font-family:"Courier New";color:rgb(8,8,8);font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">() {</span></p>
<p dir="ltr"
style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:10pt;font-family:"Courier New";color:rgb(8,8,8);font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap"> </span><span style="font-size:10pt;font-family:"Courier New";color:rgb(0,51,179);font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">try </span><span style="font-size:10pt;font-family:"Courier New";color:rgb(8,8,8);font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">{</span></p>
<p dir="ltr"
style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:10pt;font-family:"Courier New";color:rgb(8,8,8);font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap"> </span><span style="font-size:10pt;font-family:"Courier New";color:rgb(0,0,0);font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">Object response </span><span style="font-size:10pt;font-family:"Courier New";color:rgb(8,8,8);font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">= </span><span style="font-size:10pt;font-family:"Courier New";color:rgb(133,22,145);font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">compiledScript</span><span style="font-size:10pt;font-family:"Courier New";color:rgb(8,8,8);font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">.eval(</span><span style="font-size:10pt;font-family:"Courier New";color:rgb(133,22,145);font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">ctx</span><span style="font-size:10pt;font-family:"Courier New";color:rgb(8,8,8);font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">);</span></p>
<p dir="ltr"
style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:10pt;font-family:"Courier New";color:rgb(8,8,8);font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap"> </span><span style="font-size:10pt;font-family:"Courier New";color:rgb(0,0,0);font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">ScriptEvalResponse evalResponse </span><span style="font-size:10pt;font-family:"Courier New";color:rgb(8,8,8);font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">= </span><span style="font-size:10pt;font-family:"Courier New";color:rgb(0,51,179);font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">new </span><span style="font-size:10pt;font-family:"Courier New";color:rgb(8,8,8);font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">ScriptEvalResponse(</span><span style="font-size:10pt;font-family:"Courier New";color:rgb(0,0,0);font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">Response</span><span style="font-size:10pt;font-family:"Courier New";color:rgb(8,8,8);font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">.</span><span style="font-size:10pt;font-family:"Courier New";color:rgb(135,16,148);font-style:italic;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">OK</span><span style="font-size:10pt;font-family:"Courier New";color:rgb(8,8,8);font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">);</span></p>
<p dir="ltr"
style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:10pt;font-family:"Courier New";color:rgb(8,8,8);font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap"> </span><span style="font-size:10pt;font-family:"Courier New";color:rgb(0,0,0);font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">evalResponse</span><span style="font-size:10pt;font-family:"Courier New";color:rgb(8,8,8);font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">.setResponse(</span><span style="font-size:10pt;font-family:"Courier New";color:rgb(0,0,0);font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">response</span><span style="font-size:10pt;font-family:"Courier New";color:rgb(8,8,8);font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">);</span></p>
<p dir="ltr"
style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:10pt;font-family:"Courier New";color:rgb(8,8,8);font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap"> </span><span style="font-size:10pt;font-family:"Courier New";color:rgb(0,51,179);font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">return </span><span style="font-size:10pt;font-family:"Courier New";color:rgb(0,0,0);font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">evalResponse</span><span style="font-size:10pt;font-family:"Courier New";color:rgb(8,8,8);font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">;</span></p>
<p dir="ltr"
style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:10pt;font-family:"Courier New";color:rgb(8,8,8);font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap"> } </span><span style="font-size:10pt;font-family:"Courier New";color:rgb(0,51,179);font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">catch </span><span style="font-size:10pt;font-family:"Courier New";color:rgb(8,8,8);font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">(</span><span style="font-size:10pt;font-family:"Courier New";color:rgb(0,0,0);font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">Exception </span><span style="font-size:10pt;font-family:"Courier New";color:rgb(8,8,8);font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">ex) {</span></p>
<p dir="ltr"
style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:10pt;font-family:"Courier New";color:rgb(8,8,8);font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap"> </span><span style="font-size:10pt;font-family:"Courier New";color:rgb(135,16,148);font-style:italic;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">logger</span><span style="font-size:10pt;font-family:"Courier New";color:rgb(8,8,8);font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">.debug(</span><span style="font-size:10pt;font-family:"Courier New";color:rgb(6,125,23);font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">"Error occurred during eval script:"</span><span style="font-size:10pt;font-family:"Courier New";color:rgb(8,8,8);font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">, ex);</span></p>
<p dir="ltr"
style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:10pt;font-family:"Courier New";color:rgb(8,8,8);font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap"> </span><span style="font-size:10pt;font-family:"Courier New";color:rgb(0,51,179);font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">return </span><span style="font-size:10pt;font-family:"Courier New";color:rgb(8,8,8);font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">ex;</span></p>
<p dir="ltr"
style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:10pt;font-family:"Courier New";color:rgb(8,8,8);font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap"> }</span></p>
<p dir="ltr"
style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:10pt;font-family:"Courier New";color:rgb(8,8,8);font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap"> }</span></p>
<p dir="ltr"
style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:10pt;font-family:"Courier New";color:rgb(8,8,8);font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap"> }, </span><span style="font-size:10pt;font-family:"Courier New";color:rgb(133,22,145);font-weight:700;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">acc</span><span style="font-size:10pt;font-family:"Courier New";color:rgb(8,8,8);font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">);</span></p>
<p dir="ltr"
style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:10pt;font-family:"Courier New";color:rgb(8,8,8);font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap"> </span><span style="font-size:10pt;font-family:"Courier New";color:rgb(0,51,179);font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">if </span><span style="font-size:10pt;font-family:"Courier New";color:rgb(8,8,8);font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">(</span><span style="font-size:10pt;font-family:"Courier New";color:rgb(0,0,0);font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">obj </span><span style="font-size:10pt;font-family:"Courier New";color:rgb(0,51,179);font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">instanceof </span><span style="font-size:10pt;font-family:"Courier New";color:rgb(0,0,0);font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">Exception</span><span style="font-size:10pt;font-family:"Courier New";color:rgb(8,8,8);font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">) {</span></p>
<p dir="ltr"
style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:10pt;font-family:"Courier New";color:rgb(8,8,8);font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap"> </span><span style="font-size:10pt;font-family:"Courier New";color:rgb(0,51,179);font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">throw </span><span style="font-size:10pt;font-family:"Courier New";color:rgb(8,8,8);font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">(</span><span style="font-size:10pt;font-family:"Courier New";color:rgb(0,0,0);font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">Exception</span><span style="font-size:10pt;font-family:"Courier New";color:rgb(8,8,8);font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">) </span><span style="font-size:10pt;font-family:"Courier New";color:rgb(0,0,0);font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">obj</span><span style="font-size:10pt;font-family:"Courier New";color:rgb(8,8,8);font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">;</span></p>
<p dir="ltr"
style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:10pt;font-family:"Courier New";color:rgb(8,8,8);font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap"> }</span></p>
<p dir="ltr"
style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:10pt;font-family:"Courier New";color:rgb(8,8,8);font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap"> </span><span style="font-size:10pt;font-family:"Courier New";color:rgb(0,51,179);font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">return </span><span style="font-size:10pt;font-family:"Courier New";color:rgb(8,8,8);font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">(</span><span style="font-size:10pt;font-family:"Courier New";color:rgb(0,0,0);font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">ScriptEvalResponse</span><span style="font-size:10pt;font-family:"Courier New";color:rgb(8,8,8);font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">) </span><span style="font-size:10pt;font-family:"Courier New";color:rgb(0,0,0);font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">obj</span><span style="font-size:10pt;font-family:"Courier New";color:rgb(8,8,8);font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">;</span></p>
<p dir="ltr"
style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:10pt;font-family:"Courier New";color:rgb(8,8,8);font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">}</span></p>
<p dir="ltr"
style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"> </p>
<p dir="ltr"
style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"> </p>
<p dir="ltr"
style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:10.5pt;font-family:Roboto,sans-serif;color:rgb(60,64,67);font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">How can we implement a similar solution after the removal of SecurityManager? Could you help us to find an alternative?</span></p>
</span><br class="gmail-Apple-interchange-newline">
<div><br>
</div>
-- <br>
<div dir="ltr" class="gmail_signature"
data-smartmail="gmail_signature">
<div dir="ltr">
<div>
<div dir="ltr">
<div>
<div dir="ltr">
<div>
<div dir="ltr">
<div>
<div dir="ltr">
<div
style="color:rgb(0,0,0);font-size:12.8px"><span style="background-color:transparent;font-size:11pt;font-family:Arial;color:rgb(60,120,216);font-weight:700;vertical-align:baseline;white-space:pre-wrap"><span></span><span></span><img src="https://docs.google.com/uc?export=download&id=1rbId4Ev8etW7ZPYa-_DWvYfkUQGM9_Q0&revid=0B29Q0t2ZHLjgaW5ZVEtFSTlyRjRzVkwwd3dQNXJSUFdKb1VBPQ" moz-do-not-send="true" width="420" height="84">
</span></div>
<div
style="color:rgb(0,0,0);font-size:12.8px"><span style="background-color:transparent;font-size:11pt;font-family:Arial;color:rgb(60,120,216);font-weight:700;vertical-align:baseline;white-space:pre-wrap">Alexey Shponarsky </span><span style="background-color:transparent;font-family:Arial;color:rgb(60,120,216);font-weight:700;vertical-align:baseline;white-space:pre-wrap;font-size:14.6667px">Director of R&D</span><br>
</div>
<div style="color:rgb(0,0,0)"><a
href="https://twitter.com/Jelastic"
style="color:rgb(17,85,204)"
target="_blank"
moz-do-not-send="true"><span style="font-size:11pt;font-family:Arial;background-color:transparent;vertical-align:baseline;white-space:pre-wrap">Twitter</span></a><span style="font-size:11pt;font-family:Arial;background-color:transparent;vertical-align:baseline;white-space:pre-wrap"> </span><a
href="https://www.facebook.com/Jelastic/" style="color:rgb(17,85,204)"
target="_blank"
moz-do-not-send="true"><span style="font-size:11pt;font-family:Arial;background-color:transparent;vertical-align:baseline;white-space:pre-wrap">Facebook</span></a><span style="font-size:11pt;font-family:Arial;background-color:transparent;vertical-align:baseline;white-space:pre-wrap"> </span><a
href="http://www.youtube.com/user/JelasticCloud"
style="color:rgb(17,85,204)"
target="_blank"
moz-do-not-send="true"><span style="font-size:11pt;font-family:Arial;background-color:transparent;vertical-align:baseline;white-space:pre-wrap">YouTube</span></a><span style="font-size:11pt;font-family:Arial;background-color:transparent;vertical-align:baseline;white-space:pre-wrap"> </span><a
href="https://www.linkedin.com/company/2426564/"
style="color:rgb(17,85,204)"
target="_blank"
moz-do-not-send="true"><span style="font-size:11pt;font-family:Arial;background-color:transparent;vertical-align:baseline;white-space:pre-wrap">LinkedIn</span></a><span style="font-size:11pt;font-family:Arial;background-color:transparent;vertical-align:baseline;white-space:pre-wrap"> </span><a
href="https://plus.google.com/+JelasticInc" style="color:rgb(17,85,204)"
target="_blank"
moz-do-not-send="true"><span style="font-size:11pt;font-family:Arial;background-color:transparent;vertical-align:baseline;white-space:pre-wrap">Google+</span></a></div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</blockquote>
<br>
</blockquote>
<pre class="moz-signature" cols="72">
</pre>
</body>
</html>