You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@accumulo.apache.org by GitBox <gi...@apache.org> on 2022/08/30 18:34:52 UTC

[GitHub] [accumulo] ctubbsii commented on a diff in pull request #2901: Narrowed exceptions thrown by MetricsUtil.initialize

ctubbsii commented on code in PR #2901:
URL: https://github.com/apache/accumulo/pull/2901#discussion_r958808811


##########
core/src/main/java/org/apache/accumulo/core/metrics/MetricsUtil.java:
##########
@@ -52,14 +53,18 @@ public class MetricsUtil {
   private static List<Tag> commonTags;
 
   public static void initializeMetrics(final AccumuloConfiguration conf, final String appName,
-      final HostAndPort address) throws Exception {
+      final HostAndPort address) throws ClassNotFoundException, InstantiationException,
+      IllegalAccessException, IllegalArgumentException, InvocationTargetException,
+      NoSuchMethodException, SecurityException {
     initializeMetrics(conf.getBoolean(Property.GENERAL_MICROMETER_ENABLED),
         conf.getBoolean(Property.GENERAL_MICROMETER_JVM_METRICS_ENABLED),
         conf.get(Property.GENERAL_MICROMETER_FACTORY), appName, address);
   }
 
   private static void initializeMetrics(boolean enabled, boolean jvmMetricsEnabled,
-      String factoryClass, String appName, HostAndPort address) throws Exception {
+      String factoryClass, String appName, HostAndPort address) throws ClassNotFoundException,
+      InstantiationException, IllegalAccessException, IllegalArgumentException,
+      InvocationTargetException, NoSuchMethodException, SecurityException {

Review Comment:
   Both the throws here and the catches don't need to be so verbose with all these. ReflectiveOperationException would be a good choice to replace most of these.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@accumulo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org