Question 1: How would I change the signatures of entries within the ConstPool
? For example, lets say I had a methodref
to a method with a signature "()Ljava.util.Collection;
". How can I change that to say, "()I
"?
I want to do this because when a release comes out for an API, and a dependency on the updated API still uses the old method, I want to change the signature used, making sure that the dependent application implements this safely.
Question 2: How can I iterate through the LongVector
of constant pool entries, without having to use reflection every single step of the way? Since LongVector
is package private, ConstInfo
is package private, and I would have to use reflection to get all the method return types, in a loop too.
This will be used in tandem with problem number 1 to iterate through the constant pool and modify the signatures and store their information in a class lookup.