There are some issues in the example MutatingSootClass. #702
Unanswered
SeeUMonster
asked this question in
Q&A
Replies: 1 comment
-
Sry for the late reply - this sounds serious - can you share your test code? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm new to SootUp. So I rebuilt a project, imported SootUp, and wrote a program based on the example code. I have basically copied all the sample code for MutatingSootClass, but when I ran it, I found an error at the first assertEquals, which means that the program did not successfully replace the method. I tried to print all the methods in the replaced class and found that two main methods appeared. That is to say, the program was not successfully replaced and the previous old method was retained. So I debugged and tracked the replacement method and found that:
The remove method calculates the hash value of the object. The method for calculating hash values using SootMethod is as follows:
After debugging, I found that the first two parameters have little impact, but the last two parameters, although the contents of Set and List are the same, they are different objects, which can result in different hash values, so that remove will not remove the previous method.
I am not very familiar with the Java language. I was wondering if I could have some feedbacks.
Beta Was this translation helpful? Give feedback.
All reactions