There are 2 parsing errors I’m getting while trying to reverse engineer Java classes from a recent project.
- switch statements that can switch on strings and can return a value
- record types
Code Examples
public record Person(String name, String address) {
public Person {
Objects.requireNonNull(name);
Objects.requireNonNull(address);
}
}
private long getThreshold(long maxMemory, String property) {
return switch (property) {
case "system.memory.normal" -> maxMemory * 100 / 90;
case "system.memory.warning" -> maxMemory * 100 / 95;
case "system.memory.critical" -> maxMemory * 100 / 98;
default -> maxMemory;
};
}
There may be other examples from newer Java releases but these are the two I am experiencing now.
Is there a plan to update the parser to a more recent Java version?
Thanks