Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fontus does not taint record classes #30

Closed
leeN opened this issue Aug 28, 2024 · 1 comment
Closed

Fontus does not taint record classes #30

leeN opened this issue Aug 28, 2024 · 1 comment
Assignees
Labels
bug Something isn't working JDK compatibility Fontus behaves different compared to vanilla JDK JDK17

Comments

@leeN
Copy link
Collaborator

leeN commented Aug 28, 2024

Java 15+ has the Record class feature, which allows the creation of concise objects with default implementations of the standard methods.

The code would look like this, for example:

public record Person (String name, String address) {}

This creates a class Person, inheriting from java.lang.Record. The compiler automatically generates accessor methods for the fields (i.e., name and address) and the default methods of Object, i.e., equals, hashcode, and toString.
These are implemented as invokedynamic calls to java/lang/runtime/ObjectMethods.bootstrap. The bootstrap method seems sufficient straightforward.

The toString one seems to be the only problematic of the three, especially as we do some hacky stuff around toString by having two of them, which differ in the descriptor only.

@leeN leeN added bug Something isn't working JDK compatibility Fontus behaves different compared to vanilla JDK JDK17 labels Aug 28, 2024
@leeN leeN self-assigned this Aug 28, 2024
@leeN
Copy link
Collaborator Author

leeN commented Aug 28, 2024

Should be fixed with fe9259b.

@leeN leeN closed this as completed Aug 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working JDK compatibility Fontus behaves different compared to vanilla JDK JDK17
Projects
None yet
Development

No branches or pull requests

1 participant