private < T extends Annotation > boolean checkReusable ( MetricResolver . Of < T > of ) { String name = of . metadata ( ) . getName ( ) ; // If the metric has been registered before (eg. metrics found in RequestScoped beans), // we don't need to worry about re-usable if ( ! of . isInitialDiscovery ( ) ) { return true ; } Metadata existingMetadata = registry . getMetadata ( ) . get ( name ) ; if ( existingMetadata != null && ( existingMetadata . isReusable ( ) == false || of . metadata ( ) . isReusable ( ) == false ) ) { throw new IllegalArgumentException ( "Cannot reuse metric for " + of . metricName ( ) ) ; } return true ; }
Checks whether the metric should be re - usable