-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
A normal scoped bean implemented as Java record cannot be serialised to json #33810
Comments
@JackyAnn thanks for the rerport. Could you be more specific? What exactly does not work? It seems that you're trying to serialize an |
At first glance, I don't think it really matters that the bean is a |
@Ladicek |
OK, that sounds weird. I'll take a proper look. |
I have reproduced this locally with my own code and there's one really frustrating thing. If I declare public class Producers {
@Produces
@ApplicationScoped
public App app() {
return new App("Application");
}
@Produces
@Singleton
public Sing sing() {
return new Sing("Singleton");
}
public record App(String name) {
}
public record Sing(String name) {
}
} then I'm using OpenJDK 17.0.7. |
Ahh I think I know! We do a bytecode transformation on public boolean isRecord() {
// this superclass and final modifier check is not strictly necessary
// they are intrinsified and serve as a fast-path check
return getSuperclass() == java.lang.Record.class &&
(this.getModifiers() & Modifier.FINAL) != 0 &&
isRecord0();
} The class doesn't have the |
I think we probably shouldn't remove the |
Yea, that sounds fishy anyway. |
👍 |
Describe the bug
Expected behavior
No response
Actual behavior
No response
How to Reproduce?
No response
Output of
uname -a
orver
Darwin jackydeMacBook-Pro.local 22.5.0 Darwin Kernel Version 22.5.0: Mon Apr 24 20:51:50 PDT 2023; root:xnu-8796.121.2~5/RELEASE_X86_64 x86_64
Output of
java -version
java version "20" 2023-03-21 Java(TM) SE Runtime Environment (build 20+36-2344) Java HotSpot(TM) 64-Bit Server VM (build 20+36-2344, mixed mode, sharing)
GraalVM version (if different from Java)
No response
Quarkus version or git rev
3.1.0.Final
Build tool (ie. output of
mvnw --version
orgradlew --version
)No response
Additional information
No response
The text was updated successfully, but these errors were encountered: