Skip to content

Commit a2b3660

Browse files
authored
Merge pull request #8844 from stuartwdouglas/stable-recorder-names
Generate stable names for recorded bytecode
2 parents ed99e43 + 13ef51d commit a2b3660

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

core/deployment/src/main/java/io/quarkus/deployment/ExtensionLoader.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -921,7 +921,8 @@ public void execute(final BuildContext bc) {
921921
Object[] methodArgs = new Object[methodParamFns.size()];
922922
BytecodeRecorderImpl bri = isRecorder
923923
? new BytecodeRecorderImpl(recordAnnotation.value() == ExecutionTime.STATIC_INIT,
924-
clazz.getSimpleName(), method.getName())
924+
clazz.getSimpleName(), method.getName(),
925+
Integer.toString(method.toString().hashCode()))
925926
: null;
926927
for (int i = 0; i < methodArgs.length; i++) {
927928
methodArgs[i] = methodParamFns.get(i).apply(bc, bri);

core/deployment/src/main/java/io/quarkus/deployment/recording/BytecodeRecorderImpl.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,6 @@ public class BytecodeRecorderImpl implements RecorderContext {
8888
private static final Class<?> SINGLETON_MAP_CLASS = Collections.singletonMap(1, 1).getClass();
8989

9090
private static final AtomicInteger COUNT = new AtomicInteger();
91-
private static final AtomicInteger OUTPUT_COUNT = new AtomicInteger();
9291
private static final String BASE_PACKAGE = "io.quarkus.deployment.steps.";
9392

9493
private static final String PROXY_KEY = "proxykey";
@@ -128,9 +127,9 @@ public BytecodeRecorderImpl(ClassLoader classLoader, boolean staticInit, String
128127
this.className = className;
129128
}
130129

131-
public BytecodeRecorderImpl(boolean staticInit, String buildStepName, String methodName) {
130+
public BytecodeRecorderImpl(boolean staticInit, String buildStepName, String methodName, String uniqueHash) {
132131
this(Thread.currentThread().getContextClassLoader(), staticInit,
133-
BASE_PACKAGE + buildStepName + "$" + methodName + OUTPUT_COUNT.incrementAndGet());
132+
BASE_PACKAGE + buildStepName + "$" + methodName + uniqueHash);
134133
}
135134

136135
public boolean isEmpty() {

0 commit comments

Comments
 (0)