Skip to content

Commit

Permalink
Merge pull request quarkusio#29722 from gsmet/jakarta-progress-28
Browse files Browse the repository at this point in the history
Jakarta - Avoid hardcoded references to a javax class
  • Loading branch information
gsmet authored Dec 7, 2022
2 parents 6e9cee4 + 60ab939 commit 841d750
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,8 @@ public static Map<String, String> generateGlobalMapper(MethodInfo targetMethod,
// generate a constructor that takes the Instance<TargetClass> as an argument in order to avoid missing bean issues if the target has been conditionally disabled
// the body can freely read the instance value because if the target has been conditionally disabled, the generated class will not be instantiated
ctor = cc.getMethodCreator("<init>", void.class, Instance.class).setSignature(
String.format("(Ljavax/enterprise/inject/Instance<L%s;>;)V",
String.format("(L%s<L%s;>;)V",
Instance.class.getName().replace('.', '/'),
targetClass.name().toString().replace('.', '/')));
} else {
// generate a constructor that takes the target class as an argument - this class is a CDI bean so Arc will be able to inject into the generated class
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -522,7 +522,9 @@ private FieldDescriptor generateConstructorAndDelegateField(ClassCreator cc, Cla
if (checkForOptionalBean) {
// generate a constructor that takes the Instance<TargetClass> as an argument
ctor = cc.getMethodCreator("<init>", void.class, Instance.class).setSignature(
String.format("(Ljavax/enterprise/inject/Instance<L%s;>;)V", declaringClassName.replace('.', '/')));
String.format("(L%s<L%s;>;)V",
Instance.class.getName().replace('.', '/'),
declaringClassName.replace('.', '/')));
} else {
// generate a constructor that takes the target class as an argument - this class is a CDI bean so Arc will be able to inject into the generated class
ctor = cc.getMethodCreator("<init>", void.class, declaringClassName);
Expand Down

0 comments on commit 841d750

Please sign in to comment.