How to extend Soot to Support isRecord() for Java Record Classes? #2126
Unanswered
LorenzoProSky
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello everyone,
I am working on a static analysis tool which uses Soot, and a small part of my analysis involves handling Java Record classes. My goal is to extend Soot in order to support a new method isRecord(), in order to check if a SootClass represents a Record or not. This is the only functionality I need to add; I am not looking for any other features related to Records.
I attempted to implement this by following the pattern used for other methods like isAbstract(). Here’s what I’ve done:
In soot.SootClass:
In soot.Modifier:
Soot compiles successfully, and I can use the modified .jar file in my project and the new method in my code. However, when I give to Soot a Record class, it throws an error:
I also checked SootUp's sootup.core.model.ClassModifier hoping to find the new feature implemented, but there is no keyword "record".
Is it possible to achieve this functionality with minimal modifications, or would this require significant changes to the framework? If anyone has experience or insights into extending Soot in this way, I would greatly appreciate your help!
Thank you in advance.
Beta Was this translation helpful? Give feedback.
All reactions