Commit d069582
committed
Ignore java.lang.Object methods (identified by method name plus method descriptor) when creating muzzle references.
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 bd72002 commit d069582
1 file changed
Lines changed: 19 additions & 1 deletion
File tree
- dd-java-agent/agent-tooling/src/main/java/datadog/trace/agent/tooling/muzzle
dd-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