Source code of javafx.scene.control.TextInputControl.TextProperty#doSet of "javafx-controls-21-win.jar"
Johannes Riecken
johannes.riecken at gmail.com
Sun Jul 7 09:46:09 UTC 2024
Hey Oliver
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.
Cheers
Johannes
On Sun, Jul 7, 2024 at 9:45 AM Oliver Kopp <kopp.dev at gmail.com> wrote:
> Dear all,
>
> I have a strange thing here in JavaFX - and I seek some guidance, what to
> do.
>
> I am searching for the source code of
> javafx.scene.control.TextInputControl.TextProperty#doSet of
> "javafx-controls-21-win.jar".
>
> Using a decompiler, the method reads as follows (shortended):
>
>
> private void doSet(String var1) {
> ...
> if (TextInputControl.this.filterAndSet(var1)) {
> ...
> TextInputControl.this.textUpdated();
> TextInputControl.this.resetUndoRedoState();
> }
> }
>
>
> I checked the source on GitHub at
> https://github.com/openjdk/jfx/blob/72701e6cb4095b8f5042f54ae6bb2c0cec446bcf/modules/javafx.controls/src/main/java/javafx/scene/control/TextInputControl.java#L1511
> :
>
>
> private void doSet(String value) {
> ...
> if (!filterAndSet(value)) return;
> ...
> textUpdated();
> ...
> resetUndoRedoState();
> }
>
>
> I assume that the Java compiler does not do some "smart" optimizations.
> Thus, the binary is different from the source somehow.
>
>
> Can someone explain me what is happening here? Why is the decompiled
> source different from the Java source?
>
>
> TYIA and cheers,
>
> Oliver
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/openjfx-discuss/attachments/20240707/3613f895/attachment.htm>
More information about the openjfx-discuss
mailing list