9.0.8
mrjameshamilton
released this
03 Mar 15:40
·
297 commits
to master
since this release
Improved
- Increase
proguard.classfile.VersionConstants.MAX_SUPPORTED_VERSION
to64.65535
(Java 20 + preview enabled). - Fix tracking of
IdentifiedReferenceValue
IDs. - Add new Kotlin visitor SAM interfaces:
KotlinClassVisitor
,KotlinFileFacadeVisitor
,
KotlinMultiFileFacadeVisitor
,KotlinMultiFilePartVisitor
,KotlinSyntheticClassVisitor
.
API changes
JvmTransferRelation
has been refactored to modelIINC
in a separatecomputeIncrement
method.- The
ProcessingFlag.DONT_PROCESS_KOTLIN_MODULE
value was changed from0x00002000
to0x00008000
. - Remove
fromClassPool
suffixes inCfaUtil
methods. - Refactor
CodeLocation
to only take the signature and offset into consideration. IdentifiedReferenceValue
id
field changed fromint
toObject
.ParticularValueFactory.ReferenceFactory
replaced byParticularReferenceValueFactory
.- Add
ValueFactory.createReferenceValue(String type, Clazz referencedClass, boolean mayBeExtension, boolean maybeNull, Clazz creationClass, Method creationMethod, int creationOffset)
to allow creating references identified by their creation site. - Add
JvmCfaReferenceValueFactory
to create references identified by theJvmCfaNode
creation site.
Upgrade considerations
Identified and particular references can now be identified by any Object
instead of a simple int
.
However, this means that code which compared the IDs may need to be modified. For example, the following
code should be changed:
public static boolean equal(IdentifiedReferenceValue a, IdentifiedReferenceValue b) {
return a.id == b.id;
}
It should use the equals
method instead.
public static boolean equal(IdentifiedReferenceValue a, IdentifiedReferenceValue b) {
return a.id.equals(b.id);
}
The ParticularReferenceValueFactory
identifies references with integers by default:
ValueFactory valueFactory = new ParticularReferenceFactory(new ParticularReferenceValueFactory());
Value a = valueFactory.createReferenceValue("Ljava/lang/String;", clazz, false, false);
// a.id will be an integer.
Any Object
can be used as an ID using the createReferenceValueForId
method:
String objectId = "myId";
ValueFactory valueFactory = new ParticularReferenceFactory(new ParticularReferenceValueFactory());
Value a = valueFactory.createReferenceValueForId("Ljava/lang/String;", clazz, false, false, objectId);
// a.id will be objectId