<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div class="elementToProof" style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Thanks for your analysis and explanation.</div>
<div class="elementToProof" style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div class="elementToProof" style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
I took the liberty to propose a PR for JDK-8353840:</div>
<div class="elementToProof" style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<a href="https://github.com/openjdk/jdk/pull/24499" id="OWAe45422c7-efde-1385-6c86-b9ebbd380351" class="OWAAutoLink">https://github.com/openjdk/jdk/pull/24499</a> </div>
<div class="elementToProof" style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div class="elementToProof" style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
I would really appreciate a review on this. </div>
<div class="elementToProof" style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div class="elementToProof" style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div id="appendonsend"></div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> Jorn Vernee <jorn.vernee@oracle.com><br>
<b>Sent:</b> Monday, April 7, 2025 3:46 AM<br>
<b>To:</b> Danish Nawab <dnawab@outlook.com>; core-libs-dev@openjdk.org <core-libs-dev@openjdk.org><br>
<b>Subject:</b> Re: Usage feedback: jnativescan</font>
<div> </div>
</div>
<div>
<p>Hello,</p>
<p><br>
</p>
<p>I had a look here, and can reproduce the error.</p>
<p><br>
</p>
<p>jnativescan does have handling for Multi-Release jars. By default it uses the current JDK version, which in your case would be 24. An exact version can be specified using --release. The issue in this case is that the error originates from the class file
<font face="monospace">reactor.core.publisher.CallSiteSupplierFactory$SharedSecretsCallSiteSupplierFactory$TracingException</font>, which does not have a class file entry in the META-INF/versions directory. There is one for the enclosing class
<font face="monospace">reactor.core.publisher.CallSiteSupplierFactory</font>, but not for this nested class. jnativescan doesn't try to determine whether a class file is used, it just scans all the class files in the jar file that belong to a particular runtime
version, so in this case, it doesn't see that the <font face="monospace">TracingException</font> class is not actually being used.</p>
<p><br>
</p>
<p>I think your idea of emitting a warning instead of an error is probably the right one. We won't be able to determine whether a method being referenced is restricted or not, since you need the class file to be able to look at the annotations, but if the class
can not be loaded on the particular runtime version, then even if the method was restricted, it could never be called any way.</p>
<p><br>
</p>
<p>Thank you for submitting this useful piece of feedback! I've filed: <a class="x_moz-txt-link-freetext" href="https://bugs.openjdk.org/browse/JDK-8353840">
https://bugs.openjdk.org/browse/JDK-8353840</a><br>
</p>
<p><br>
</p>
<p>Jorn<br>
</p>
<p><br>
</p>
<div class="x_moz-cite-prefix">On 4-4-2025 18:58, Danish Nawab wrote:<br>
</div>
<blockquote type="cite"><style type="text/css" style="display:none">
<!--
p
{margin-top:0;
margin-bottom:0}
-->
</style>
<div class="x_elementToProof" style="text-align:left; text-indent:0px; background-color:rgb(255,255,255); margin:0px; font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<code>jnativescan</code> terminates when ran on a JAR with a missing class.</div>
<div class="x_elementToProof" style="text-align:left; text-indent:0px; background-color:rgb(255,255,255); margin:0px; font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
Example:<br>
<br>
</div>
<div class="x_elementToProof" style="text-align:left; text-indent:0px; background-color:rgb(255,255,255); margin:0px; font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
```</div>
<div class="x_elementToProof" style="text-align:left; text-indent:0px; line-height:normal; background-color:rgb(255,255,255); margin:0px; font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
jnativescan --class-path reactor-core-3.7.4.jar</div>
<div class="x_elementToProof" style="text-align:left; text-indent:0px; line-height:normal; background-color:rgb(255,255,255); margin:0px; font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<div class="x_elementToProof" style="text-align:left; text-indent:0px; line-height:normal; background-color:rgb(255,255,255); margin:0px; font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
ERROR: Error while processing method: reactor.core.publisher.CallSiteSupplierFactory$SharedSecretsCallSiteSupplierFactory$TracingException::get()String</div>
<div class="x_elementToProof" style="text-align:left; text-indent:0px; line-height:normal; background-color:rgb(255,255,255); margin:0px; font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
CAUSED BY: System class can not be found: sun.misc.JavaLangAccess</div>
<div class="x_elementToProof" style="text-align:left; text-indent:0px; line-height:normal; background-color:rgb(255,255,255); margin:0px; font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
``` </div>
<div class="x_elementToProof" style="text-align:left; text-indent:0px; line-height:normal; background-color:rgb(255,255,255); margin:0px; font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<div class="x_elementToProof" style="text-align:left; text-indent:0px; line-height:normal; background-color:rgb(255,255,255); margin:0px; font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
(above jar downloaded from [1]) </div>
<div class="x_elementToProof" style="text-align:left; text-indent:0px; line-height:normal; background-color:rgb(255,255,255); margin:0px; font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<div class="x_elementToProof" style="text-align:left; text-indent:0px; line-height:normal; background-color:rgb(255,255,255); margin:0px; font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
The offending class seems to refer to a now unavailable <code>sun.misc.JavaLangAccess</code> but still handles this error scenario silently [2]</div>
<div class="x_elementToProof" style="text-align:left; text-indent:0px; line-height:normal; background-color:rgb(255,255,255); margin:0px; font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<div class="x_elementToProof" style="text-align:left; text-indent:0px; line-height:normal; background-color:rgb(255,255,255); margin:0px; font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
Because <code>jnativescan</code> terminates early, I can't say whether or not this library uses native/restricted features. Perhaps it would be better if instead of terminating,
<code>jnativescan</code> continued the analysis after warning about the missing class.</div>
<div class="x_elementToProof" style="text-align:left; text-indent:0px; line-height:normal; background-color:rgb(255,255,255); margin:0px; font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<div class="x_elementToProof" style="text-align:left; text-indent:0px; line-height:normal; background-color:rgb(255,255,255); margin:0px; font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
Also, the above JAR seems to be a Multi-Release Jar, where the Java 11+ version of the code does not even refer sun.misc.JavaLangAccess [3].</div>
<div class="x_elementToProof" style="text-align:left; text-indent:0px; line-height:normal; background-color:rgb(255,255,255); margin:0px; font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
Should <code>jnativescan</code> have special handling for Multi-Release JARs by analysing the version that would be applicable for the current JDK?</div>
<div class="x_elementToProof" style="text-align:left; text-indent:0px; line-height:normal; background-color:rgb(255,255,255); margin:0px; font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<div class="x_elementToProof" style="text-align:left; text-indent:0px; line-height:normal; background-color:rgb(255,255,255); margin:0px; font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
Versions:</div>
<div class="x_elementToProof" style="text-align:left; text-indent:0px; line-height:normal; background-color:rgb(255,255,255); margin:0px; font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
```</div>
<div class="x_elementToProof" style="text-align:left; text-indent:0px; line-height:normal; background-color:rgb(255,255,255); margin:0px; font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
java --version</div>
<div class="x_elementToProof" style="text-align:left; text-indent:0px; line-height:normal; background-color:rgb(255,255,255); margin:0px; font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
openjdk 24 2025-03-18</div>
<div class="x_elementToProof" style="text-align:left; text-indent:0px; line-height:normal; background-color:rgb(255,255,255); margin:0px; font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
OpenJDK Runtime Environment (build 24+36-3646)</div>
<div class="x_elementToProof" style="text-align:left; text-indent:0px; line-height:normal; background-color:rgb(255,255,255); margin:0px; font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
OpenJDK 64-Bit Server VM (build 24+36-3646, mixed mode, sharing)</div>
<div class="x_elementToProof" style="text-align:left; text-indent:0px; line-height:normal; background-color:rgb(255,255,255); margin:0px; font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<div class="x_elementToProof" style="text-align:left; text-indent:0px; line-height:normal; background-color:rgb(255,255,255); margin:0px; font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
jnativescan --version</div>
<div class="x_elementToProof" style="text-align:left; text-indent:0px; line-height:normal; background-color:rgb(255,255,255); margin:0px; font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
24</div>
<div class="x_elementToProof" style="text-align:left; text-indent:0px; line-height:normal; background-color:rgb(255,255,255); margin:0px; font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
```</div>
<div class="x_elementToProof" style="text-align:left; text-indent:0px; line-height:normal; background-color:rgb(255,255,255); margin:0px; font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<div class="x_elementToProof" style="text-align:left; text-indent:0px; line-height:normal; background-color:rgb(255,255,255); margin:0px; font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
Overall, <code>jnativescan</code> is extremely helpful in finding the dependencies using native/restricted features. </div>
<div class="x_elementToProof" style="text-align:left; text-indent:0px; line-height:normal; background-color:rgb(255,255,255); margin:0px; font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<div class="x_elementToProof" style="text-align:left; text-indent:0px; line-height:normal; background-color:rgb(255,255,255); margin:0px; font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
[1] <a href="https://repo1.maven.org/maven2/io/projectreactor/reactor-core/3.7.4/reactor-core-3.7.4.jar" target="_blank" id="OWAec8539e4-a795-1906-25ed-5e3fa4b4787b" class="x_x_OWAAutoLink x_x_elementToProof x_moz-txt-link-freetext" title="https://repo1.maven.org/maven2/io/projectreactor/reactor-core/3.7.4/reactor-core-3.7.4.jar" rel="noopener noreferrer" data-linkindex="0" data-auth="NotApplicable" style="margin:0px; text-align:left">
https://repo1.maven.org/maven2/io/projectreactor/reactor-core/3.7.4/reactor-core-3.7.4.jar</a></div>
<div class="x_elementToProof" style="text-align:left; text-indent:0px; line-height:normal; background-color:rgb(255,255,255); margin:0px; font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
[2] <a href="https://github.com/reactor/reactor-core/blob/7dee739/reactor-core/src/main/java/reactor/core/publisher/CallSiteSupplierFactory.java#L56-L64" target="_blank" id="OWA38d05e4a-6376-f197-cd90-9e781b3f6a08" class="x_x_OWAAutoLink x_moz-txt-link-freetext" title="https://github.com/reactor/reactor-core/blob/7dee739/reactor-core/src/main/java/reactor/core/publisher/CallSiteSupplierFactory.java#L56-L64" rel="noopener noreferrer" data-linkindex="1" data-auth="NotApplicable" style="margin:0px">
https://github.com/reactor/reactor-core/blob/7dee739/reactor-core/src/main/java/reactor/core/publisher/CallSiteSupplierFactory.java#L56-L64</a></div>
<div class="x_elementToProof" style="text-align:left; text-indent:0px; line-height:normal; background-color:rgb(255,255,255); margin:0px; font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
[3] <a href="https://github.com/reactor/reactor-core/blob/0b93178/reactor-core/src/main/java11/reactor/core/publisher/CallSiteSupplierFactory.java" target="_blank" id="OWA86a65431-511c-8e53-6eee-9e94dbd4cd7e" class="x_x_OWAAutoLink x_moz-txt-link-freetext" title="https://github.com/reactor/reactor-core/blob/0b93178/reactor-core/src/main/java11/reactor/core/publisher/CallSiteSupplierFactory.java" rel="noopener noreferrer" data-linkindex="2" data-auth="NotApplicable" style="margin:0px">
https://github.com/reactor/reactor-core/blob/0b93178/reactor-core/src/main/java11/reactor/core/publisher/CallSiteSupplierFactory.java</a></div>
<div class="x_elementToProof" style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
</blockquote>
</div>
</body>
</html>