Java record debug
Answered
How can I set a breakpoint on a property (getter and setter) in a Java record?
Please sign in to leave a comment.
Hello, it's not possible because a record class is just like an enum, it's a Java base type, eg below code:
is compiled to something like this:
However, it's not line to line corresponding to the source code, these extra code is created by the javac tool, so you can't put a breakpoint at the method inside it at the source code.
But if you still want need a get method and debug it, you can define it like this and put a break point in the getAddress() method.
Hope this helps.
Thnx - That's how I did it so far.