<div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"> Yes, it is certainly true that we’re changing something and, sadly, providing integrity by default requires us to do just that in multiple areas. <br></blockquote><div><br></div><div>The pursuit of integrity is good, but this does not mean that any feature that is labeled as "breaking integrity" should be thrown into the warning zone.</div><div>FFI is such an important and widely used feature that it deserves to be treated as a normal feature.<br></div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">I hope and believe that most Java users think that’s a very, very good thing. But to allow that, we have to make some (hopefully not as drastic) changes in the way a Java application is composed and deployed, because we saw the pain caused by lack of integrity in the 8 -> 9+ migration, and we don’t want that risk to continue forever. So yes, there will be some work required now, we’ll be in a much better place on the other side.<br></blockquote><div><br></div><div>Have you surveyed the maintainers and user groups of widely used libraries in the Java ecosystem that require FFI?</div><div>I don't think anyone would be satisfied with such a crude decision.<br></div><div><br></div><div>Glavo</div></div></div></div></div></div></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Aug 29, 2023 at 6:27 AM Ron Pressler <<a href="mailto:ron.pressler@oracle.com">ron.pressler@oracle.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br>
<br>
> On 28 Aug 2023, at 23:04, Constantin Christoph <<a href="mailto:4evnyuij@gmail.com" target="_blank">4evnyuij@gmail.com</a>> wrote:<br>
> <br>
> But now, what if instead of making an application using a JNI-using library, I am making a library using JNI myself? I have absolutely zero control over whether JNI will work when my library is used, it is up to the user of the library to figure out that a flag needs to be added to the startup arguments. Now imagine that a few more libraries are in between my library (using JNI), and the end user. The JNI-heavy feature is now behind several layers of abstraction, and may not even get called until a very niche use case happens, and if the startup argument isn't present at that time, the program crashes. A notice from me regarding my library's usage of JNI *will* be overlooked at some point, and you can't always feasibly catch errors like this in testing.<br>
<br>
See the Future Work section. Modules offer strong encapsulation (integrity) and reliable configuration. Now that we have a model for both, we can offer them at different times.<br>
<br>
> <br>
> This is just another example of what will inevitably happen when these changes are in full effect, and the tradeoff is just not worth the hours of lost developer time that will undoubtedly need to be sacrificed to fix issues like these.<br>
> <br>
> As mentioned, a fix to issues like these would be to either<br>
> - Make the JNI flag a module setting; or<br>
> - Make JNI usage opt-out instead of opt-in; or<br>
> - Don't restrict JNI usage at all.<br>
> <br>
> This is my final stance on the subject manner: The changes should not be made in their current state. You just cannot change such an old interface that drastically, a lot of libraries will break, and a lot of developers will be disappointed.<br>
<br>
You say that a tradeoff is not worth it but only mention one of its arms. Still, you can disagree about the tradeoff, but requiring the addition of a couple more tokens to a command line that has dozens more is not drastic. Yes, it is certainly true that we’re changing something and, sadly, providing integrity by default requires us to do just that in multiple areas. What has changed drastically is the pace in which the JDK is changing (*much* faster now than ever before in the last 20 years) and the way it is written (more in Java, less in native, which makes the platform more sensitive to Java-level integrity guarantees). I hope and believe that most Java users think that’s a very, very good thing. But to allow that, we have to make some (hopefully not as drastic) changes in the way a Java application is composed and deployed, because we saw the pain caused by lack of integrity in the 8 -> 9+ migration, and we don’t want that risk to continue forever. So yes, there will be some work required now, we’ll be in a much better place on the other side.<br>
<br>
— Ron<br>
<br>
</blockquote></div>