Skip to content

Commit

Permalink
Avoid repeatedly creating same DotNames in ResteasyReactiveProcessor
Browse files Browse the repository at this point in the history
This is a follow-up of quarkusio#46464.

Given the purpose of the PR was to improve dev mode reload performance,
I think it's worth avoid the extra allocations.
  • Loading branch information
gsmet committed Feb 26, 2025
1 parent f35cd36 commit 064f4c8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
final class DotNames {

static final String POPULATE_METHOD_NAME = "populate";
static final DotName CLASS_NAME = DotName.createSimple(Class.class.getName());
static final DotName OBJECT_NAME = DotName.createSimple(Object.class.getName());
static final DotName STRING_NAME = DotName.createSimple(String.class.getName());
static final DotName BYTE_NAME = DotName.createSimple(byte.class.getName());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -737,7 +737,7 @@ public DotName apply(Type type) {
if (type.kind() == Type.Kind.CLASS) {
return typeName;
} else if (type.kind() == Type.Kind.PARAMETERIZED_TYPE
&& typeName.equals(DotName.createSimple(Class.class))) {
&& DotNames.CLASS_NAME.equals(typeName)) {
// spec allows for Class<SubResource> to be returned that the container should instantiate
return type.asParameterizedType().arguments().get(0).name();
}
Expand Down Expand Up @@ -833,7 +833,7 @@ public DotName apply(Type type) {
}

Set<DotName> all = new HashSet<>();
if (dotName.equals(DotName.createSimple(Object.class.getName()))) {
if (DotNames.OBJECT_NAME.equals(dotName)) {
all.addAll(returnsBySubResources.keySet());
for (DotName name : returnsBySubResources.keySet()) {
//we need to also look for all subclasses and interfaces
Expand Down

0 comments on commit 064f4c8

Please sign in to comment.