File tree Expand file tree Collapse file tree
main/java/io/opentelemetry/contrib/dynamic/policy/registry
test/java/io/opentelemetry/contrib/dynamic/policy/registry Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -255,17 +255,15 @@ private static DeclarativeConfigProperties getGeneralDeclarativeConfig(
255255 ConfigProvider configProvider ) {
256256 // Prefer the general config accessor when available in the API/runtime.
257257 try {
258- Method method = configProvider .getClass ().getDeclaredMethod ("getGeneralConfig" );
259- if (!method .isAccessible ()) {
260- method .setAccessible (true );
261- }
258+ Method method = configProvider .getClass ().getMethod ("getGeneralConfig" );
262259 Object maybeConfig = method .invoke (configProvider );
263260 if (maybeConfig instanceof DeclarativeConfigProperties ) {
264261 return (DeclarativeConfigProperties ) maybeConfig ;
265262 }
266- } catch (NoSuchMethodException ignored ) {
267- // Fall through to backwards-compatible accessor below.
268- } catch (IllegalAccessException | InvocationTargetException ignored ) {
263+ } catch (NoSuchMethodException
264+ | IllegalAccessException
265+ | InvocationTargetException
266+ | RuntimeException ignored ) {
269267 // Fall through to backwards-compatible accessor below.
270268 }
271269 return configProvider .getGeneralInstrumentationConfig ();
Original file line number Diff line number Diff line change @@ -336,6 +336,7 @@ private static DeclarativeConfigProperties mappingConfig() {
336336 return mapping ;
337337 }
338338
339+ @ SuppressWarnings ("EffectivelyPrivate" )
339340 private static final class ConfigProviderWithGeneralConfig implements ConfigProvider {
340341 private final DeclarativeConfigProperties generalConfig ;
341342
@@ -349,7 +350,7 @@ public DeclarativeConfigProperties getInstrumentationConfig() {
349350 }
350351
351352 @ SuppressWarnings ("unused" )
352- DeclarativeConfigProperties getGeneralConfig () {
353+ public DeclarativeConfigProperties getGeneralConfig () {
353354 return generalConfig ;
354355 }
355356 }
You can’t perform that action at this time.
0 commit comments