Skip to content

Commit 6fb0d63

Browse files
authored
Update embedded copy of SerialVersionUIDAdder to pick up changes in ASM 9.9 (#10274)
(specifically https://gitlab.ow2.org/asm/asm/-/issues/318032)
1 parent a1ce9ae commit 6fb0d63

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

dd-java-agent/agent-tooling/src/main/java/datadog/trace/agent/tooling/context/asm/SerialVersionUIDAdder.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ public class SerialVersionUIDAdder extends ClassVisitor {
150150
* @throws IllegalStateException If a subclass calls this constructor.
151151
*/
152152
public SerialVersionUIDAdder(final ClassVisitor classVisitor) {
153-
this(/* latest api = */ Opcodes.ASM8, classVisitor);
153+
this(/* latest api = */ Opcodes.ASM9, classVisitor);
154154
if (getClass() != SerialVersionUIDAdder.class) {
155155
throw new IllegalStateException();
156156
}
@@ -159,9 +159,8 @@ public SerialVersionUIDAdder(final ClassVisitor classVisitor) {
159159
/**
160160
* Constructs a new {@link SerialVersionUIDAdder}.
161161
*
162-
* @param api the ASM API version implemented by this visitor. Must be one of {@link
163-
* Opcodes#ASM4}, {@link Opcodes#ASM5}, {@link Opcodes#ASM6}, {@link Opcodes#ASM7} or {@link
164-
* Opcodes#ASM8}.
162+
* @param api the ASM API version implemented by this visitor. Must be one of the {@code
163+
* ASM}<i>x</i> values in {@link Opcodes}.
165164
* @param classVisitor a {@link ClassVisitor} to which this visitor will delegate calls.
166165
*/
167166
protected SerialVersionUIDAdder(final int api, final ClassVisitor classVisitor) {
@@ -424,7 +423,7 @@ protected long computeSVUID() throws IOException {
424423
// DontCheck(AbbreviationAsWordInName): can't be renamed (for backward binary compatibility).
425424
protected byte[] computeSHAdigest(final byte[] value) {
426425
try {
427-
return MessageDigest.getInstance("SHA").digest(value);
426+
return MessageDigest.getInstance("SHA-1").digest(value);
428427
} catch (NoSuchAlgorithmException e) {
429428
throw new UnsupportedOperationException(e);
430429
}

0 commit comments

Comments
 (0)