Skip to content

Commit ac27842

Browse files
committed
Include instrumented type in type pool that is offered to frame computation.
1 parent c2d3a30 commit ac27842

File tree

9 files changed

+68
-15
lines changed

9 files changed

+68
-15
lines changed

.mvn/checksums.sha256

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -601,6 +601,7 @@ net.bytebuddy:byte-buddy-maven-plugin:jar:1.13.0 69948daabf5c9aa150d68140af7ec9d
601601
net.bytebuddy:byte-buddy-maven-plugin:jar:1.14.0 cd5194f72dda1e634479278c8feb07125b9043cade15e6620fc8020af7ed3f8d
602602
net.bytebuddy:byte-buddy-maven-plugin:jar:1.14.1 9cb63d477916fa6b02b021fc44681da43172284c8c49e9cc1a5917f4705d82ae
603603
net.bytebuddy:byte-buddy-maven-plugin:jar:1.14.2 f5d2be6baf531ebbde91274181504fcb92ff07d0a2c21c55dcc7ff6a87cbc790
604+
net.bytebuddy:byte-buddy-maven-plugin:jar:1.14.3 3d52c7d65b9fdac180f90612c377a39fc9b81e1d48f02aced9fbdcdfeda57659
604605
net.bytebuddy:byte-buddy-maven-plugin:pom:1.12.19 c2051f8cbdf328692f36077627be07168334ee9167b72e5bf608eae624163b4f
605606
net.bytebuddy:byte-buddy-maven-plugin:pom:1.12.20 2d112ff342e7db7da484d038807749c1a87c81419b789a86b950a37bdd65b207
606607
net.bytebuddy:byte-buddy-maven-plugin:pom:1.12.21 13576ca6b9c44ab9789ada11ee400dcd3f4bcc22a7cab6f7052aeeb49a8c02e1
@@ -610,6 +611,7 @@ net.bytebuddy:byte-buddy-maven-plugin:pom:1.13.0 067042fddc12ef162cc9e323fb61b69
610611
net.bytebuddy:byte-buddy-maven-plugin:pom:1.14.0 77180195e35ece94e22f50d5645c15ee7b31205f6726b42f58175911dde0508d
611612
net.bytebuddy:byte-buddy-maven-plugin:pom:1.14.1 b823df6013839c201a837490dc085af9753cd179d7dd0287d62549d7ec417148
612613
net.bytebuddy:byte-buddy-maven-plugin:pom:1.14.2 d8b553fee46eba6a96de2d9b4bea1efc23fa13e33c9e935b0db492935e447f4c
614+
net.bytebuddy:byte-buddy-maven-plugin:pom:1.14.3 8ddbd06f4a027c86e16d3d5e9e685d5980be893c5f3991ebbda600c6e260fa1e
613615
net.bytebuddy:byte-buddy-parent:pom:1.12.19 72ab6fef409e812921f4728b3c4b6ef4fa53bc25fabb0488fc2cae367368b54d
614616
net.bytebuddy:byte-buddy-parent:pom:1.12.20 ac59dd7bc0316c51ab29e7c44ae7941ba8c7bf84789edb1dc8fbef2f16535b99
615617
net.bytebuddy:byte-buddy-parent:pom:1.12.21 ff66d886607137e2095f20c90ee093f3c80329164eff091a0688bdce37e3e6b2
@@ -619,6 +621,7 @@ net.bytebuddy:byte-buddy-parent:pom:1.13.0 9d03c3cc08c753cf3bab0f2f9ea281af84b90
619621
net.bytebuddy:byte-buddy-parent:pom:1.14.0 c5f22b13c9e304af7d0439d1ce982e07967f6667685c5b610dc3da4888281dde
620622
net.bytebuddy:byte-buddy-parent:pom:1.14.1 1b64c399c745548ac41d6f11429f2f39a749acc33a7cae3d28c5f0301cc9a131
621623
net.bytebuddy:byte-buddy-parent:pom:1.14.2 6db003ef2b312e8c30e67cf5a7f39d8be1eaa3bac99e79d715c03d02c520f587
624+
net.bytebuddy:byte-buddy-parent:pom:1.14.3 18d87a7371f2d5d7bf9473124e51ed8a9ae1ad86ed1085cc151c8266deb519d2
622625
net.bytebuddy:byte-buddy:jar:1.12.19 030704139e46f32c38d27060edee9e0676b0a0fff8a8be53461515154ba8a7be
623626
net.bytebuddy:byte-buddy:jar:1.12.20 0a9b2795e0e2391117062f0fc7f6ae98fa3c2a7c927847ff1e01bb7cffcd9167
624627
net.bytebuddy:byte-buddy:jar:1.12.21 f6f45c2237a7f132c16745ad2a52c4cdde58028b11ee80b09f0d422f4930d685
@@ -628,6 +631,7 @@ net.bytebuddy:byte-buddy:jar:1.13.0 b864bd7ad2399b4d79d6b34b7a6d7ce115eda8123129
628631
net.bytebuddy:byte-buddy:jar:1.14.0 0af7cfa59aaf7dff002de984896eb43c987c596f726ae635e0e0d8229f154297
629632
net.bytebuddy:byte-buddy:jar:1.14.1 63479f9a0a1b28f98313230d688a46b02bd80d09a700e127482d0bd635b47bad
630633
net.bytebuddy:byte-buddy:jar:1.14.2 042e6b26e1f3fdd1e6244e9dcb381065b15d230ecd93838691dcc03918c9d525
634+
net.bytebuddy:byte-buddy:jar:1.14.3 1db7ee74714ed852a2bd23c33d066e8a4f6031411cbd0ce75daa58b7670894ad
631635
net.bytebuddy:byte-buddy:pom:1.12.19 435fb8664aa9b7e120c8dd6c707d4eafa642fa262dff6d5e3f71dc25c69e89eb
632636
net.bytebuddy:byte-buddy:pom:1.12.20 46353d5c52659c40f0f54d05c757665552e492be36087c19307598d1bf07bbfb
633637
net.bytebuddy:byte-buddy:pom:1.12.21 95eb42c89fd04f62187dd33b9cdf04d2df1b876b375c16ad32c0a5a1cc1a070b
@@ -637,6 +641,7 @@ net.bytebuddy:byte-buddy:pom:1.13.0 de30e6a985a016b3ac15c86e6d74f794667bf0014e77
637641
net.bytebuddy:byte-buddy:pom:1.14.0 e8a0805e953c75ed5a5803288e87f2721244df4427a995b0cb962b1c0cc29865
638642
net.bytebuddy:byte-buddy:pom:1.14.1 2b6c20e711394870362fcbeec485abbd5026620974dacad719d454bc1077f192
639643
net.bytebuddy:byte-buddy:pom:1.14.2 c18ad7b621b3910528c7a9038d74e7e33fe79aca88e7f2b58bb853eabb6b33ff
644+
net.bytebuddy:byte-buddy:pom:1.14.3 50e1c99fcf83f3131f32aed4225ee8ff56e40496ffed4daf946b24e50873481d
640645
net.i2p.crypto:eddsa:jar:0.3.0 4dda1120db856640dbec04140ed23242215a075fe127bdefa0dcfa29fb31267d
641646
net.i2p.crypto:eddsa:pom:0.3.0 b6b13878e4bae8b768d7ea5732cb4d66ab2f5e9fe707c0a1a776cde9de52051b
642647
net.java.dev.jna:jna-platform:jar:5.12.1 8ce969116cac95bd61b07a8d5e07174b352e63301473caac72c395e3c08488d2

byte-buddy-agent/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@
6969
<dependency>
7070
<groupId>net.bytebuddy</groupId>
7171
<artifactId>byte-buddy</artifactId>
72-
<version>1.14.2</version>
72+
<version>1.14.3</version>
7373
<scope>test</scope>
7474
</dependency>
7575
</dependencies>

byte-buddy-dep/pom.xml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@
127127
<plugin>
128128
<groupId>net.bytebuddy</groupId>
129129
<artifactId>byte-buddy-maven-plugin</artifactId>
130-
<version>1.14.2</version>
130+
<version>1.14.3</version>
131131
<executions>
132132
<execution>
133133
<phase>compile</phase>
@@ -142,7 +142,7 @@
142142
<transformation>
143143
<groupId>net.bytebuddy</groupId>
144144
<artifactId>byte-buddy</artifactId>
145-
<version>1.14.2</version>
145+
<version>1.14.3</version>
146146
<plugin>net.bytebuddy.build.HashCodeAndEqualsPlugin$WithNonNullableFields</plugin>
147147
<arguments>
148148
<argument>
@@ -154,13 +154,13 @@
154154
<transformation>
155155
<groupId>net.bytebuddy</groupId>
156156
<artifactId>byte-buddy</artifactId>
157-
<version>1.14.2</version>
157+
<version>1.14.3</version>
158158
<plugin>net.bytebuddy.build.CachedReturnPlugin</plugin>
159159
</transformation>
160160
<transformation>
161161
<groupId>net.bytebuddy</groupId>
162162
<artifactId>byte-buddy</artifactId>
163-
<version>1.14.2</version>
163+
<version>1.14.3</version>
164164
<plugin>net.bytebuddy.build.AccessControllerPlugin</plugin>
165165
<arguments>
166166
<argument>
@@ -172,13 +172,13 @@
172172
<transformation>
173173
<groupId>net.bytebuddy</groupId>
174174
<artifactId>byte-buddy</artifactId>
175-
<version>1.14.2</version>
175+
<version>1.14.3</version>
176176
<plugin>net.bytebuddy.build.DispatcherAnnotationPlugin</plugin>
177177
</transformation>
178178
<transformation>
179179
<groupId>net.bytebuddy</groupId>
180180
<artifactId>byte-buddy</artifactId>
181-
<version>1.14.2</version>
181+
<version>1.14.3</version>
182182
<plugin>net.bytebuddy.build.RepeatedAnnotationPlugin</plugin>
183183
</transformation>
184184
</transformations>

byte-buddy-dep/src/main/java/net/bytebuddy/dynamic/scaffold/inline/DecoratingDynamicTypeBuilder.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -505,7 +505,7 @@ protected TypeWriter<T> toTypeWriter(TypePool typePool) {
505505
implementationContextFactory,
506506
typeValidation,
507507
classWriterStrategy,
508-
typePool,
508+
TypePool.Explicit.wrap(instrumentedType, auxiliaryTypes, typePool),
509509
classFileLocator);
510510
}
511511

byte-buddy-dep/src/main/java/net/bytebuddy/dynamic/scaffold/inline/RebaseDynamicTypeBuilder.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ protected TypeWriter<T> toTypeWriter(TypePool typePool) {
243243
implementationContextFactory,
244244
typeValidation,
245245
classWriterStrategy,
246-
typePool,
246+
TypePool.Explicit.wrap(instrumentedType, auxiliaryTypes, typePool),
247247
originalType,
248248
classFileLocator,
249249
methodRebaseResolver);

byte-buddy-dep/src/main/java/net/bytebuddy/dynamic/scaffold/inline/RedefinitionDynamicTypeBuilder.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ protected TypeWriter<T> toTypeWriter(TypePool typePool) {
218218
implementationContextFactory,
219219
typeValidation,
220220
classWriterStrategy,
221-
typePool,
221+
TypePool.Explicit.wrap(instrumentedType, auxiliaryTypes, typePool),
222222
originalType,
223223
classFileLocator);
224224
}

byte-buddy-dep/src/main/java/net/bytebuddy/dynamic/scaffold/subclass/SubclassDynamicTypeBuilder.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ protected TypeWriter<T> toTypeWriter(TypePool typePool) {
228228
implementationContextFactory,
229229
typeValidation,
230230
classWriterStrategy,
231-
typePool);
231+
TypePool.Explicit.wrap(instrumentedType, auxiliaryTypes, typePool));
232232
}
233233

234234
/**

byte-buddy-dep/src/main/java/net/bytebuddy/pool/TypePool.java

Lines changed: 47 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,14 @@
3030
import net.bytebuddy.description.method.MethodList;
3131
import net.bytebuddy.description.method.ParameterDescription;
3232
import net.bytebuddy.description.method.ParameterList;
33-
import net.bytebuddy.description.type.*;
33+
import net.bytebuddy.description.type.PackageDescription;
34+
import net.bytebuddy.description.type.RecordComponentDescription;
35+
import net.bytebuddy.description.type.RecordComponentList;
36+
import net.bytebuddy.description.type.TypeDefinition;
37+
import net.bytebuddy.description.type.TypeDescription;
38+
import net.bytebuddy.description.type.TypeList;
3439
import net.bytebuddy.dynamic.ClassFileLocator;
40+
import net.bytebuddy.dynamic.DynamicType;
3541
import net.bytebuddy.dynamic.loading.ClassLoadingStrategy;
3642
import net.bytebuddy.implementation.bytecode.StackSize;
3743
import net.bytebuddy.matcher.ElementMatcher;
@@ -40,7 +46,17 @@
4046
import net.bytebuddy.utility.nullability.AlwaysNull;
4147
import net.bytebuddy.utility.nullability.MaybeNull;
4248
import net.bytebuddy.utility.nullability.UnknownNull;
43-
import org.objectweb.asm.*;
49+
import org.objectweb.asm.AnnotationVisitor;
50+
import org.objectweb.asm.ClassReader;
51+
import org.objectweb.asm.ClassVisitor;
52+
import org.objectweb.asm.FieldVisitor;
53+
import org.objectweb.asm.Label;
54+
import org.objectweb.asm.MethodVisitor;
55+
import org.objectweb.asm.Opcodes;
56+
import org.objectweb.asm.RecordComponentVisitor;
57+
import org.objectweb.asm.Type;
58+
import org.objectweb.asm.TypePath;
59+
import org.objectweb.asm.TypeReference;
4460
import org.objectweb.asm.signature.SignatureReader;
4561
import org.objectweb.asm.signature.SignatureVisitor;
4662

@@ -49,12 +65,20 @@
4965
import java.lang.annotation.Annotation;
5066
import java.lang.ref.SoftReference;
5167
import java.lang.reflect.GenericSignatureFormatError;
52-
import java.util.*;
68+
import java.util.ArrayList;
69+
import java.util.Collections;
70+
import java.util.HashMap;
71+
import java.util.List;
72+
import java.util.ListIterator;
73+
import java.util.Map;
5374
import java.util.concurrent.ConcurrentHashMap;
5475
import java.util.concurrent.ConcurrentMap;
5576
import java.util.concurrent.atomic.AtomicReference;
5677

57-
import static net.bytebuddy.matcher.ElementMatchers.*;
78+
import static net.bytebuddy.matcher.ElementMatchers.hasDescriptor;
79+
import static net.bytebuddy.matcher.ElementMatchers.hasMethodName;
80+
import static net.bytebuddy.matcher.ElementMatchers.is;
81+
import static net.bytebuddy.matcher.ElementMatchers.named;
5882

5983
/**
6084
* A type pool allows the retrieval of {@link TypeDescription} by its name.
@@ -9130,6 +9154,25 @@ public Explicit(TypePool parent, Map<String, TypeDescription> types) {
91309154
this.types = types;
91319155
}
91329156

9157+
/**
9158+
* Wraps another type pool for an instrumented type and its auxiliary types.
9159+
*
9160+
* @param instrumentedType The instrumented type.
9161+
* @param auxiliaryTypes The auxiliary types.
9162+
* @param typePool The type pool to wrap.
9163+
* @return A type pool that also represents the instrumented type and its auxiliary types.
9164+
*/
9165+
public static TypePool wrap(TypeDescription instrumentedType, List<? extends DynamicType> auxiliaryTypes, TypePool typePool) {
9166+
Map<String, TypeDescription> typeDescriptions = new HashMap<String, TypeDescription>();
9167+
typeDescriptions.put(instrumentedType.getName(), instrumentedType);
9168+
for (DynamicType auxiliaryType : auxiliaryTypes) {
9169+
for (TypeDescription typeDescription : auxiliaryType.getAllTypes().keySet()) {
9170+
typeDescriptions.put(typeDescription.getName(), typeDescription);
9171+
}
9172+
}
9173+
return new Explicit(typePool, typeDescriptions);
9174+
}
9175+
91339176
@Override
91349177
protected Resolution doDescribe(String name) {
91359178
TypeDescription typeDescription = types.get(name);

release-notes.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
Byte Buddy release notes
22
------------------------
33

4+
### 13. March 2023: version 1.14.3
5+
6+
- Make `MethodGraph.Compiler` failsafe when processing incomplete methods.
7+
- Update ASM.
8+
49
### 13. March 2023: version 1.14.2
510

611
- Fix offset mapping for local variable array remapping in `Advice`.

0 commit comments

Comments
 (0)