Skip to content

Commit

Permalink
Fix Checkstyle violations
Browse files Browse the repository at this point in the history
  • Loading branch information
trustin committed Jun 3, 2022
1 parent 35a7a8f commit f899257
Showing 1 changed file with 8 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -120,13 +120,10 @@ private Handler createAdminServlet0(Server server, Environment environment, Metr
final MutableServletContextHandler adminContext = environment.getAdminContext();
final HealthCheckRegistry healthChecks = environment.healthChecks();
try {
final Method method = AbstractServerFactory.class.getDeclaredMethod("createAdminServlet",
Server.class,
MutableServletContextHandler.class,
MetricRegistry.class,
HealthCheckRegistry.class,
AdminEnvironment.class);
logger.debug("createAdminServlet0 resolves to dropwizard2.1 version");
final Method method = AbstractServerFactory.class.getDeclaredMethod(
"createAdminServlet", Server.class, MutableServletContextHandler.class,
MetricRegistry.class, HealthCheckRegistry.class, AdminEnvironment.class);
logger.debug("createAdminServlet resolves to Dropwizard v2.1.");
final AdminEnvironment adminEnvironment = environment.admin();
return (Handler) method.invoke(this, server, adminContext, metrics, healthChecks, adminEnvironment);
} catch (NoSuchMethodException e) {
Expand All @@ -137,12 +134,10 @@ private Handler createAdminServlet0(Server server, Environment environment, Metr

try {
//noinspection JavaReflectionMemberAccess - this is false warning on dropwizard2 module
final Method method = AbstractServerFactory.class.getDeclaredMethod("createAdminServlet",
Server.class,
MutableServletContextHandler.class,
MetricRegistry.class,
HealthCheckRegistry.class);
logger.debug("createAdminServlet0 resolves to dropwizard1 or 2.0 version");
final Method method = AbstractServerFactory.class.getDeclaredMethod(
"createAdminServlet", Server.class, MutableServletContextHandler.class,
MetricRegistry.class, HealthCheckRegistry.class);
logger.debug("createAdminServlet resolves to Dropwizard v1 or v2.0.");
return (Handler) method.invoke(this, server, adminContext, metrics, healthChecks);
} catch (IllegalAccessException | NoSuchMethodException | InvocationTargetException e) {
return Exceptions.throwUnsafely(e);
Expand Down

0 comments on commit f899257

Please sign in to comment.