<div dir="ltr"><div> Hey Oliver</div><div><br></div><div>The Java compiler does in fact do some "smart" optimizations, which you can easily verify by writing a void function with an early return yourself, compiling it to a class file and decompiling the class file again :) In this case, I assume that having a single point of exit helps the compiler to analyze control flow.<br></div><div><br></div><div>Cheers</div><div><br></div><div>Johannes<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, Jul 7, 2024 at 9:45 AM Oliver Kopp <<a href="mailto:kopp.dev@gmail.com" target="_blank">kopp.dev@gmail.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"><div dir="ltr">Dear all,<br><br>I have a strange thing here in JavaFX - and I seek some guidance, what to do.<br><br>I am searching for the source code of javafx.scene.control.TextInputControl.TextProperty#doSet of "javafx-controls-21-win.jar".<br><br>Using a decompiler, the method reads as follows (shortended):<br><br><br>private void doSet(String var1) {<br>...<br>    if (TextInputControl.this.filterAndSet(var1)) {<br>...<br>        TextInputControl.this.textUpdated();<br>        TextInputControl.this.resetUndoRedoState();<br>    }<br>}<br><br><br>I checked the source on GitHub at <a href="https://github.com/openjdk/jfx/blob/72701e6cb4095b8f5042f54ae6bb2c0cec446bcf/modules/javafx.controls/src/main/java/javafx/scene/control/TextInputControl.java#L1511" target="_blank">https://github.com/openjdk/jfx/blob/72701e6cb4095b8f5042f54ae6bb2c0cec446bcf/modules/javafx.controls/src/main/java/javafx/scene/control/TextInputControl.java#L1511</a>:<br><br><br>private void doSet(String value) {<br>...<br>        if (!filterAndSet(value)) return;<br>...<br>        textUpdated();<br>...<br>   resetUndoRedoState();<br>}<br><br><br>I assume that the Java compiler does not do some "smart" optimizations. Thus, the binary is different from the source somehow.<br><br><br>Can someone explain me what is happening here? Why is the decompiled source different from the Java source?<br><br><br>TYIA and cheers,<br><br>Oliver<br></div>
</blockquote></div>