Skip to content

Commit 63d55d7

Browse files
committed
Generate BeanGenerator.ProviderType values only once
They are used quite a lot and they are generating extra work we can very easily avoid. It doesn't make a HUGE difference but given it's basically free...
1 parent 352f20d commit 63d55d7

File tree

1 file changed

+6
-2
lines changed
  • independent-projects/arc/processor/src/main/java/io/quarkus/arc/processor

1 file changed

+6
-2
lines changed

independent-projects/arc/processor/src/main/java/io/quarkus/arc/processor/BeanGenerator.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2481,9 +2481,13 @@ public TransientReference(ResultHandle provider, ResultHandle contextualInstance
24812481
static final class ProviderType {
24822482

24832483
private final Type type;
2484+
private final String className;
2485+
private final String descriptorName;
24842486

24852487
public ProviderType(Type type) {
24862488
this.type = type;
2489+
this.className = type.name().toString();
2490+
this.descriptorName = DescriptorUtils.typeToString(type);
24872491
}
24882492

24892493
DotName name() {
@@ -2495,15 +2499,15 @@ DotName name() {
24952499
* @return the class name, e.g. {@code org.acme.Foo}
24962500
*/
24972501
String className() {
2498-
return type.name().toString();
2502+
return className;
24992503
}
25002504

25012505
/**
25022506
*
25032507
* @return the name used in JVM descriptors, e.g. {@code Lorg/acme/Foo;}
25042508
*/
25052509
String descriptorName() {
2506-
return DescriptorUtils.typeToString(type);
2510+
return descriptorName;
25072511
}
25082512

25092513
}

0 commit comments

Comments
 (0)