@Test public void testParseConfiguration() { final LinkedHashMap<String,String> properties = new LinkedHashMap<>(); properties.put("sa.integration.*.disable", ""); properties.put("sa.exporter.*.disable", ""); properties.put("sa.integration.okhttp.enable", ""); properties.put("sa.integration.concurrent.enable", ""); properties.put("sa.integration.concurrent.verbose", ""); properties.put("sa.integration.lettuce:5.?.enable", ""); properties.put("sa.integration.okhttp.disable", ""); properties.put("sa.exporter.jaeger.enable", ""); properties.put("sa.exporter.jaeger.enable", "false"); properties.put("sa.exporter.lightstep.enable", ""); properties.put("sa.classpath", "exporter.jar"); testParseConfiguration(properties); }
static File[] parseConfiguration(final Map<String,String> properties, final List<String> verbosePluginNames, final Map<String,Boolean> integrationRuleNameToEnable, final Map<String,Boolean> traceExporterNameToEnable) { final String[] deprecatedKeys = new String[] {"sa.instrumentation.plugin.include", "sa.instrumentation.plugin.", "sa.tracer.plugin."}; final String[] currentKeys = new String[] {"sa.classpath", "sa.integration.", "sa.exporter."}; final File[] includedPlugins1 = parseConfiguration(deprecatedKeys, currentKeys, properties, verbosePluginNames, integrationRuleNameToEnable, traceExporterNameToEnable); final File[] includedPlugins2 = parseConfiguration(currentKeys, currentKeys, properties, verbosePluginNames, integrationRuleNameToEnable, traceExporterNameToEnable); if (includedPlugins1 == null) return includedPlugins2; if (includedPlugins2 != null) throw new IllegalArgumentException("Conflicting \"sa.instrumentation.plugin.include\" (" + Arrays.toString(includedPlugins1) + ") and \"sa.classpath\" (" + Arrays.toString(includedPlugins2) + ") properties specified"); return includedPlugins1; }
SpecialAgentUtil { static File[] parseConfiguration(final Map<String,String> properties, final List<String> verbosePluginNames, final Map<String,Boolean> integrationRuleNameToEnable, final Map<String,Boolean> traceExporterNameToEnable) { final String[] deprecatedKeys = new String[] {"sa.instrumentation.plugin.include", "sa.instrumentation.plugin.", "sa.tracer.plugin."}; final String[] currentKeys = new String[] {"sa.classpath", "sa.integration.", "sa.exporter."}; final File[] includedPlugins1 = parseConfiguration(deprecatedKeys, currentKeys, properties, verbosePluginNames, integrationRuleNameToEnable, traceExporterNameToEnable); final File[] includedPlugins2 = parseConfiguration(currentKeys, currentKeys, properties, verbosePluginNames, integrationRuleNameToEnable, traceExporterNameToEnable); if (includedPlugins1 == null) return includedPlugins2; if (includedPlugins2 != null) throw new IllegalArgumentException("Conflicting \"sa.instrumentation.plugin.include\" (" + Arrays.toString(includedPlugins1) + ") and \"sa.classpath\" (" + Arrays.toString(includedPlugins2) + ") properties specified"); return includedPlugins1; } }
SpecialAgentUtil { static File[] parseConfiguration(final Map<String,String> properties, final List<String> verbosePluginNames, final Map<String,Boolean> integrationRuleNameToEnable, final Map<String,Boolean> traceExporterNameToEnable) { final String[] deprecatedKeys = new String[] {"sa.instrumentation.plugin.include", "sa.instrumentation.plugin.", "sa.tracer.plugin."}; final String[] currentKeys = new String[] {"sa.classpath", "sa.integration.", "sa.exporter."}; final File[] includedPlugins1 = parseConfiguration(deprecatedKeys, currentKeys, properties, verbosePluginNames, integrationRuleNameToEnable, traceExporterNameToEnable); final File[] includedPlugins2 = parseConfiguration(currentKeys, currentKeys, properties, verbosePluginNames, integrationRuleNameToEnable, traceExporterNameToEnable); if (includedPlugins1 == null) return includedPlugins2; if (includedPlugins2 != null) throw new IllegalArgumentException("Conflicting \"sa.instrumentation.plugin.include\" (" + Arrays.toString(includedPlugins1) + ") and \"sa.classpath\" (" + Arrays.toString(includedPlugins2) + ") properties specified"); return includedPlugins1; } private  SpecialAgentUtil(); }
SpecialAgentUtil { static File[] parseConfiguration(final Map<String,String> properties, final List<String> verbosePluginNames, final Map<String,Boolean> integrationRuleNameToEnable, final Map<String,Boolean> traceExporterNameToEnable) { final String[] deprecatedKeys = new String[] {"sa.instrumentation.plugin.include", "sa.instrumentation.plugin.", "sa.tracer.plugin."}; final String[] currentKeys = new String[] {"sa.classpath", "sa.integration.", "sa.exporter."}; final File[] includedPlugins1 = parseConfiguration(deprecatedKeys, currentKeys, properties, verbosePluginNames, integrationRuleNameToEnable, traceExporterNameToEnable); final File[] includedPlugins2 = parseConfiguration(currentKeys, currentKeys, properties, verbosePluginNames, integrationRuleNameToEnable, traceExporterNameToEnable); if (includedPlugins1 == null) return includedPlugins2; if (includedPlugins2 != null) throw new IllegalArgumentException("Conflicting \"sa.instrumentation.plugin.include\" (" + Arrays.toString(includedPlugins1) + ") and \"sa.classpath\" (" + Arrays.toString(includedPlugins2) + ") properties specified"); return includedPlugins1; } private  SpecialAgentUtil(); static Enumeration<T> enumeration(final T[] a); }
SpecialAgentUtil { static File[] parseConfiguration(final Map<String,String> properties, final List<String> verbosePluginNames, final Map<String,Boolean> integrationRuleNameToEnable, final Map<String,Boolean> traceExporterNameToEnable) { final String[] deprecatedKeys = new String[] {"sa.instrumentation.plugin.include", "sa.instrumentation.plugin.", "sa.tracer.plugin."}; final String[] currentKeys = new String[] {"sa.classpath", "sa.integration.", "sa.exporter."}; final File[] includedPlugins1 = parseConfiguration(deprecatedKeys, currentKeys, properties, verbosePluginNames, integrationRuleNameToEnable, traceExporterNameToEnable); final File[] includedPlugins2 = parseConfiguration(currentKeys, currentKeys, properties, verbosePluginNames, integrationRuleNameToEnable, traceExporterNameToEnable); if (includedPlugins1 == null) return includedPlugins2; if (includedPlugins2 != null) throw new IllegalArgumentException("Conflicting \"sa.instrumentation.plugin.include\" (" + Arrays.toString(includedPlugins1) + ") and \"sa.classpath\" (" + Arrays.toString(includedPlugins2) + ") properties specified"); return includedPlugins1; } private  SpecialAgentUtil(); static Enumeration<T> enumeration(final T[] a);  }