Commit af7ff80
authored
Ignore java.lang.Object methods (identified by method name plus method descriptor) when creating muzzle references. (#9649)
This helps when compiling with Java 18+ because javac will now use INVOKEINTERFACE with the interface name to call
java.lang.Object methods (so the 'owner' is now seen as the interface) whereas before it was using INVOKEVIRTUAL
with java.lang.Object as the method 'owner'.
the key change is described in https://bugs.openjdk.org/browse/JDK-8272715:
"invocations of java.lang.Object methods on interfaces in the classfile will use invokeinterface referring
to the interface, which is consistent with JLS 9.2. This will be done regardless of whether the interface
declares the method explicitly or not."1 parent f945e4b commit af7ff80
File tree
1 file changed
+19
-1
lines changed- dd-java-agent/agent-tooling/src/main/java/datadog/trace/agent/tooling/muzzle
1 file changed
+19
-1
lines changeddd-java-agent/agent-tooling/src/main/java/datadog/trace/agent/tooling/muzzle/ReferenceCreator.java
Lines changed: 19 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
| |||
39 | 40 | | |
40 | 41 | | |
41 | 42 | | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
42 | 52 | | |
43 | 53 | | |
44 | 54 | | |
| |||
323 | 333 | | |
324 | 334 | | |
325 | 335 | | |
326 | | - | |
| 336 | + | |
327 | 337 | | |
328 | 338 | | |
329 | 339 | | |
| |||
490 | 500 | | |
491 | 501 | | |
492 | 502 | | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
493 | 511 | | |
0 commit comments