Skip to content

Commit

Permalink
Fail at build time if @Inject is used in JAX-RS Application class
Browse files Browse the repository at this point in the history
Relates to: quarkusio#17441
  • Loading branch information
geoand committed May 25, 2021
1 parent 997d827 commit 3025177
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,10 @@ public static ApplicationScanningResult scanForApplicationClass(IndexView index,
throw new RuntimeException("More than one Application class: " + applications);
}
selectedAppClass = applicationClassInfo;
// FIXME: yell if there's more than one
if (!selectedAppClass.annotations().get(ResteasyReactiveDotNames.CDI_INJECT).isEmpty()) {
throw new RuntimeException("'@Inject' cannot be used with a '" + ResteasyReactiveDotNames.APPLICATION
+ "' class. Offending class is: '" + selectedAppClass.name() + "'");
}
String applicationClass = applicationClassInfo.name().toString();
try {
Class<?> appClass = Thread.currentThread().getContextClassLoader().loadClass(applicationClass);
Expand Down

0 comments on commit 3025177

Please sign in to comment.