diff --git a/.baseline/checkstyle/checkstyle.xml b/.baseline/checkstyle/checkstyle.xml
index 268ebe3fc..f541b63e2 100644
--- a/.baseline/checkstyle/checkstyle.xml
+++ b/.baseline/checkstyle/checkstyle.xml
@@ -469,7 +469,7 @@
-
+
diff --git a/.bulldozer.yml b/.bulldozer.yml
index 9e4fa3979..cec43b078 100644
--- a/.bulldozer.yml
+++ b/.bulldozer.yml
@@ -1,3 +1,5 @@
+# Excavator auto-updates this file. Please contribute improvements to the central template.
+
version: 1
merge:
whitelist:
diff --git a/.excavator.yml b/.excavator.yml
index 0f2914560..670c9d8ec 100644
--- a/.excavator.yml
+++ b/.excavator.yml
@@ -1,6 +1,9 @@
+# Excavator auto-updates this file. Please contribute improvements to the central template.
+
auto-label:
names:
versions-props/upgrade-all: [ "merge when ready" ]
circleci/manage-circleci: [ "merge when ready" ]
tags:
roomba: [ "merge when ready" ]
+ automerge: [ "merge when ready" ]
diff --git a/.policy.yml b/.policy.yml
index fc95c213a..f741027d0 100644
--- a/.policy.yml
+++ b/.policy.yml
@@ -1,3 +1,5 @@
+# Excavator auto-updates this file. Please contribute improvements to the central template.
+
policy:
approval:
- or:
@@ -5,8 +7,9 @@ policy:
- two admins have approved
- changelog only and contributor approval
- fixing excavator
- - excavator only touched baseline, circle, gradle files, docker-compose-rule config or versions.props
+ - excavator only touched baseline, circle, gradle files, godel files, docker-compose-rule config or versions.props
- excavator only touched package.json and lock files
+ - excavator only touched config files
disapproval:
requires:
organizations: [ "palantir" ]
@@ -48,7 +51,7 @@ approval_rules:
has_author_in:
users: [ "svc-excavator-bot" ]
- - name: excavator only touched baseline, circle, gradle files, docker-compose-rule config or versions.props
+ - name: excavator only touched baseline, circle, gradle files, godel files, docker-compose-rule config or versions.props
requires:
count: 0
if:
@@ -68,9 +71,22 @@ approval_rules:
- "^gradlew.bat$"
- "^gradle.properties$"
- "^settings.gradle$"
+ - "^godelw$"
+ - "^godel/config/godel.properties$"
- "^versions.props$"
- "^versions.lock$"
+ - name: excavator only touched config files
+ requires:
+ count: 0
+ if:
+ has_author_in:
+ users: [ "svc-excavator-bot" ]
+ only_changed_files:
+ paths:
+ - "^\\..*.yml$"
+ - "^\\.github/.*$"
+
- name: excavator only touched package.json and lock files
requires:
count: 0
diff --git a/build.gradle b/build.gradle
index ed87d456f..68a28341a 100644
--- a/build.gradle
+++ b/build.gradle
@@ -10,10 +10,12 @@ buildscript {
}
dependencies {
+ classpath 'com.palantir.gradle.revapi:gradle-revapi:0.4.1'
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.4'
- classpath 'com.netflix.nebula:nebula-publishing-plugin:13.3.0'
- classpath 'com.palantir.baseline:gradle-baseline-java:2.0.0'
- classpath 'com.palantir.gradle.consistentversions:gradle-consistent-versions:1.12.1'
+ classpath 'com.netflix.nebula:gradle-info-plugin:5.0.3'
+ classpath 'com.netflix.nebula:nebula-publishing-plugin:13.5.1'
+ classpath 'com.palantir.baseline:gradle-baseline-java:2.7.0'
+ classpath 'com.palantir.gradle.consistentversions:gradle-consistent-versions:1.12.4'
classpath 'com.palantir.gradle.gitversion:gradle-git-version:0.12.2'
classpath 'gradle.plugin.org.inferred:gradle-processors:3.1.0'
classpath 'com.google.errorprone:error_prone_core:2.3.3'
diff --git a/changelog/0.15.5/pr-389.v2.yml b/changelog/0.15.5/pr-389.v2.yml
new file mode 100644
index 000000000..c003f5256
--- /dev/null
+++ b/changelog/0.15.5/pr-389.v2.yml
@@ -0,0 +1,6 @@
+type: feature
+feature:
+ description: Use Byte Buddy for Instrumentation by default, reducing excess stack
+ frames from instrumentation.
+ links:
+ - https://github.com/palantir/tritium/pull/389
diff --git a/changelog/@unreleased/pr-407.v2.yml b/changelog/@unreleased/pr-407.v2.yml
new file mode 100644
index 000000000..4e767762a
--- /dev/null
+++ b/changelog/@unreleased/pr-407.v2.yml
@@ -0,0 +1,5 @@
+type: improvement
+improvement:
+ description: Use simple string concatenation over MetricRegistry.name
+ links:
+ - https://github.com/palantir/tritium/pull/407
diff --git a/gradle/publish-jar.gradle b/gradle/publish-jar.gradle
index 973ebe7e4..22d734314 100644
--- a/gradle/publish-jar.gradle
+++ b/gradle/publish-jar.gradle
@@ -7,6 +7,7 @@ apply plugin: 'nebula.maven-nebula-publish'
apply plugin: 'nebula.maven-base-publish'
apply plugin: 'nebula.maven-developer'
apply plugin: 'nebula.maven-manifest'
+apply plugin: 'nebula.info-scm'
apply plugin: 'nebula.maven-scm'
apply plugin: 'nebula.javadoc-jar'
@@ -47,3 +48,8 @@ publishing {
}
}
}
+
+// Turning off module metadata so that all consumers just use regular POMs
+tasks.withType(GenerateModuleMetadata) {
+ enabled = false
+}
diff --git a/tritium-api/build.gradle b/tritium-api/build.gradle
index 2939c76e7..ac555e733 100644
--- a/tritium-api/build.gradle
+++ b/tritium-api/build.gradle
@@ -1,4 +1,5 @@
apply from: "${rootDir}/gradle/publish-jar.gradle"
+apply plugin: 'com.palantir.revapi'
dependencies {
diff --git a/tritium-caffeine/build.gradle b/tritium-caffeine/build.gradle
index 43fb579c9..ac99adfa9 100644
--- a/tritium-caffeine/build.gradle
+++ b/tritium-caffeine/build.gradle
@@ -1,4 +1,5 @@
apply from: "${rootDir}/gradle/publish-jar.gradle"
+apply plugin: 'com.palantir.revapi'
sourceCompatibility = 1.8
targetCompatibility = 1.8
diff --git a/tritium-core/build.gradle b/tritium-core/build.gradle
index 2dc154bd0..580f8e091 100644
--- a/tritium-core/build.gradle
+++ b/tritium-core/build.gradle
@@ -1,4 +1,5 @@
apply from: "${rootDir}/gradle/publish-jar.gradle"
+apply plugin: 'com.palantir.revapi'
dependencies {
diff --git a/tritium-core/src/main/java/com/palantir/tritium/event/InstrumentationFilters.java b/tritium-core/src/main/java/com/palantir/tritium/event/InstrumentationFilters.java
index 696608fba..0aadfdcc1 100644
--- a/tritium-core/src/main/java/com/palantir/tritium/event/InstrumentationFilters.java
+++ b/tritium-core/src/main/java/com/palantir/tritium/event/InstrumentationFilters.java
@@ -24,14 +24,20 @@ public enum InstrumentationFilters implements InstrumentationFilter {
INSTRUMENT_ALL {
@Override
- public boolean shouldInstrument(@Nonnull Object instance, @Nonnull Method method, @Nonnull Object[] args) {
+ public boolean shouldInstrument(
+ @Nonnull Object unusedInstance,
+ @Nonnull Method unusedMethod,
+ @Nonnull Object[] unusedArgs) {
return true;
}
},
INSTRUMENT_NONE {
@Override
- public boolean shouldInstrument(@Nonnull Object instance, @Nonnull Method method, @Nonnull Object[] args) {
+ public boolean shouldInstrument(
+ @Nonnull Object unusedInstance,
+ @Nonnull Method unusedMethod,
+ @Nonnull Object[] unusedArgs) {
return false;
}
};
diff --git a/tritium-core/src/main/java/com/palantir/tritium/event/InstrumentationProperties.java b/tritium-core/src/main/java/com/palantir/tritium/event/InstrumentationProperties.java
index a132a863f..500f0279c 100644
--- a/tritium-core/src/main/java/com/palantir/tritium/event/InstrumentationProperties.java
+++ b/tritium-core/src/main/java/com/palantir/tritium/event/InstrumentationProperties.java
@@ -26,6 +26,7 @@
import java.util.Map;
import java.util.concurrent.TimeUnit;
import java.util.function.Supplier;
+import javax.annotation.Nullable;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -46,8 +47,22 @@ public static BooleanSupplier getSystemPropertySupplier(String name) {
@SuppressWarnings("WeakerAccess") // public API
public static boolean isSpecificEnabled(String name) {
- String qualifiedValue = instrumentationProperties().get(INSTRUMENT_PREFIX + "." + name);
- return "true".equalsIgnoreCase(qualifiedValue) || qualifiedValue == null;
+ return isSpecificEnabled(name, true);
+ }
+
+ @SuppressWarnings("WeakerAccess") // public API
+ public static boolean isSpecificEnabled(String name, boolean defaultValue) {
+ String qualifiedValue = getSpecific(name);
+ if (qualifiedValue == null) {
+ return defaultValue;
+ }
+ return "true".equalsIgnoreCase(qualifiedValue);
+ }
+
+ /** Applies the {@link #INSTRUMENT_PREFIX} and returns the current value. */
+ @Nullable
+ private static String getSpecific(String name) {
+ return instrumentationProperties().get(INSTRUMENT_PREFIX + "." + name);
}
@SuppressWarnings("WeakerAccess") // public API
@@ -100,5 +115,4 @@ private static Map createInstrumentationSystemProperties() {
log.debug("Reloaded instrumentation properties {}", map);
return map;
}
-
}
diff --git a/tritium-core/src/main/java/com/palantir/tritium/event/NoOpInvocationEventHandler.java b/tritium-core/src/main/java/com/palantir/tritium/event/NoOpInvocationEventHandler.java
index 9789b856b..aceec9507 100644
--- a/tritium-core/src/main/java/com/palantir/tritium/event/NoOpInvocationEventHandler.java
+++ b/tritium-core/src/main/java/com/palantir/tritium/event/NoOpInvocationEventHandler.java
@@ -38,12 +38,12 @@ public InvocationContext preInvocation(@Nonnull Object instance, @Nonnull Method
}
@Override
- public void onSuccess(@Nullable InvocationContext context, @Nullable Object result) {
+ public void onSuccess(@Nullable InvocationContext unusedContext, @Nullable Object unusedResult) {
// no-op
}
@Override
- public void onFailure(@Nullable InvocationContext context, @Nonnull Throwable cause) {
+ public void onFailure(@Nullable InvocationContext unusedContext, @Nonnull Throwable unusedCause) {
// no-op
}
}
diff --git a/tritium-core/src/test/java/com/palantir/tritium/event/CompositeInvocationEventHandlerTest.java b/tritium-core/src/test/java/com/palantir/tritium/event/CompositeInvocationEventHandlerTest.java
index e73bc71e6..7fc3e5132 100644
--- a/tritium-core/src/test/java/com/palantir/tritium/event/CompositeInvocationEventHandlerTest.java
+++ b/tritium-core/src/test/java/com/palantir/tritium/event/CompositeInvocationEventHandlerTest.java
@@ -221,10 +221,10 @@ public InvocationContext preInvocation(
}
@Override
- public void onSuccess(@Nullable InvocationContext context, @Nullable Object result) {}
+ public void onSuccess(@Nullable InvocationContext unusedContext, @Nullable Object unusedResult) {}
@Override
- public void onFailure(@Nullable InvocationContext context, @Nonnull Throwable cause) {}
+ public void onFailure(@Nullable InvocationContext unusedContext, @Nonnull Throwable unusedCause) {}
}
}
diff --git a/tritium-core/src/test/java/com/palantir/tritium/event/InstrumentationPropertiesTest.java b/tritium-core/src/test/java/com/palantir/tritium/event/InstrumentationPropertiesTest.java
index 0e7158283..e759eca20 100644
--- a/tritium-core/src/test/java/com/palantir/tritium/event/InstrumentationPropertiesTest.java
+++ b/tritium-core/src/test/java/com/palantir/tritium/event/InstrumentationPropertiesTest.java
@@ -173,4 +173,82 @@ public void onFailure(Throwable throwable) {
assertThat(barrier.getNumberWaiting()).isZero();
});
}
+
+ @Test
+ void testIsSpecificEnabled_notSet() {
+ assertThat(InstrumentationProperties.isSpecificEnabled("not_set")).isTrue();
+ }
+
+ @Test
+ void testIsSpecificEnabled_notSet_defaultTrue() {
+ assertThat(InstrumentationProperties.isSpecificEnabled("not_set", true)).isTrue();
+ }
+
+ @Test
+ void testIsSpecificEnabled_notSet_defaultFalse() {
+ assertThat(InstrumentationProperties.isSpecificEnabled("not_set", false)).isFalse();
+ }
+
+ @Test
+ void testIsSpecificEnabled_setGarbage() {
+ System.setProperty("instrument.garbage", "garbage");
+ InstrumentationProperties.reload();
+ assertThat(InstrumentationProperties.isSpecificEnabled("garbage")).isFalse();
+ }
+
+ @Test
+ void testIsSpecificEnabled_setGarbage_defaultTrue() {
+ System.setProperty("instrument.garbage", "garbage");
+ InstrumentationProperties.reload();
+ assertThat(InstrumentationProperties.isSpecificEnabled("garbage", true)).isFalse();
+ }
+
+ @Test
+ void testIsSpecificEnabled_setGarbage_defaultFalse() {
+ System.setProperty("instrument.garbage", "garbage");
+ InstrumentationProperties.reload();
+ assertThat(InstrumentationProperties.isSpecificEnabled("garbage", false)).isFalse();
+ }
+
+ @Test
+ void testIsSpecificEnabled_setTrue() {
+ System.setProperty("instrument.true", "true");
+ InstrumentationProperties.reload();
+ assertThat(InstrumentationProperties.isSpecificEnabled("true")).isTrue();
+ }
+
+ @Test
+ void testIsSpecificEnabled_setTrue_defaultTrue() {
+ System.setProperty("instrument.true", "true");
+ InstrumentationProperties.reload();
+ assertThat(InstrumentationProperties.isSpecificEnabled("true", true)).isTrue();
+ }
+
+ @Test
+ void testIsSpecificEnabled_setTrue_defaultFalse() {
+ System.setProperty("instrument.true", "true");
+ InstrumentationProperties.reload();
+ assertThat(InstrumentationProperties.isSpecificEnabled("true", false)).isTrue();
+ }
+
+ @Test
+ void testIsSpecificEnabled_setFalse() {
+ System.setProperty("instrument.false", "false");
+ InstrumentationProperties.reload();
+ assertThat(InstrumentationProperties.isSpecificEnabled("false")).isFalse();
+ }
+
+ @Test
+ void testIsSpecificEnabled_setFalse_defaultTrue() {
+ System.setProperty("instrument.false", "false");
+ InstrumentationProperties.reload();
+ assertThat(InstrumentationProperties.isSpecificEnabled("false", true)).isFalse();
+ }
+
+ @Test
+ void testIsSpecificEnabled_setFalse_defaultFalse() {
+ System.setProperty("instrument.false", "false");
+ InstrumentationProperties.reload();
+ assertThat(InstrumentationProperties.isSpecificEnabled("false", false)).isFalse();
+ }
}
diff --git a/tritium-jmh/src/jmh/java/com/palantir/tritium/microbenchmarks/NestedMetricsBenchmark.java b/tritium-jmh/src/jmh/java/com/palantir/tritium/microbenchmarks/NestedMetricsBenchmark.java
index 5207b0400..b55c1cfbf 100644
--- a/tritium-jmh/src/jmh/java/com/palantir/tritium/microbenchmarks/NestedMetricsBenchmark.java
+++ b/tritium-jmh/src/jmh/java/com/palantir/tritium/microbenchmarks/NestedMetricsBenchmark.java
@@ -1,5 +1,9 @@
/*
+<<<<<<< HEAD
* (c) Copyright 2019 Palantir Technologies Inc. All rights reserved.
+=======
+ * Copyright 2019 Palantir Technologies, Inc. All rights reserved.
+>>>>>>> develop
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -32,10 +36,13 @@
import org.openjdk.jmh.annotations.State;
import org.openjdk.jmh.annotations.Warmup;
import org.openjdk.jmh.infra.Blackhole;
+<<<<<<< HEAD
import org.openjdk.jmh.profile.GCProfiler;
import org.openjdk.jmh.runner.Runner;
import org.openjdk.jmh.runner.options.Options;
import org.openjdk.jmh.runner.options.OptionsBuilder;
+=======
+>>>>>>> develop
@BenchmarkMode(Mode.AverageTime)
@OutputTimeUnit(TimeUnit.NANOSECONDS)
@@ -53,13 +60,18 @@ public void before() {
}
@Benchmark
+<<<<<<< HEAD
public void benchmarkGetMetrics(Blackhole blackhole) {
+=======
+ public void benchmark(Blackhole blackhole) {
+>>>>>>> develop
metrics.getMetrics().forEach((name, metric) -> {
blackhole.consume(name);
blackhole.consume(metric);
});
}
+<<<<<<< HEAD
@Benchmark
public void benchmarkForEach(Blackhole blackhole) {
metrics.forEachMetric((name, metric) -> {
@@ -68,6 +80,8 @@ public void benchmarkForEach(Blackhole blackhole) {
});
}
+=======
+>>>>>>> develop
private static TaggedMetricRegistry constructBaseRegistry() {
TaggedMetricRegistry registry = new DefaultTaggedMetricRegistry();
for (int i = 0; i < 50; i++) {
@@ -79,16 +93,21 @@ private static TaggedMetricRegistry constructBaseRegistry() {
private static TaggedMetricRegistry constructSubRegistry() {
TaggedMetricRegistry registry = new DefaultTaggedMetricRegistry();
for (int i = 0; i < 100; i++) {
+<<<<<<< HEAD
Meter meter = registry.meter(MetricName.builder()
.safeName("some metric " + i)
.putSafeTags("some tag", "some tag value")
.build());
+=======
+ Meter meter = registry.meter(MetricName.builder().safeName("some metric " + i).build());
+>>>>>>> develop
for (int j = 0; j < 1000; j++) {
meter.mark();
}
}
return registry;
}
+<<<<<<< HEAD
public static void main(String[] args) throws Exception {
Options opt = new OptionsBuilder()
@@ -97,4 +116,6 @@ public static void main(String[] args) throws Exception {
.build();
new Runner(opt).run();
}
+=======
+>>>>>>> develop
}
diff --git a/tritium-jmh/src/jmh/java/com/palantir/tritium/microbenchmarks/ProxyBenchmark.java b/tritium-jmh/src/jmh/java/com/palantir/tritium/microbenchmarks/ProxyBenchmark.java
index 824897422..ee72cacb3 100644
--- a/tritium-jmh/src/jmh/java/com/palantir/tritium/microbenchmarks/ProxyBenchmark.java
+++ b/tritium-jmh/src/jmh/java/com/palantir/tritium/microbenchmarks/ProxyBenchmark.java
@@ -243,7 +243,7 @@ public String echo(String input) {
}
}
- public static void main(String[] args) throws Exception {
+ public static void main(String[] unusedArgs) throws Exception {
Options options = new OptionsBuilder()
.include(ProxyBenchmark.class.getSimpleName())
.warmupTime(TimeValue.seconds(1))
diff --git a/tritium-lib/build.gradle b/tritium-lib/build.gradle
index 1921626ac..6e1858ca9 100644
--- a/tritium-lib/build.gradle
+++ b/tritium-lib/build.gradle
@@ -1,4 +1,5 @@
apply from: "${rootDir}/gradle/publish-jar.gradle"
+apply plugin: 'com.palantir.revapi'
dependencies {
diff --git a/tritium-lib/src/main/java/com/palantir/tritium/proxy/Instrumentation.java b/tritium-lib/src/main/java/com/palantir/tritium/proxy/Instrumentation.java
index b008cefaf..a94f04826 100644
--- a/tritium-lib/src/main/java/com/palantir/tritium/proxy/Instrumentation.java
+++ b/tritium-lib/src/main/java/com/palantir/tritium/proxy/Instrumentation.java
@@ -59,7 +59,7 @@ static T wrap(Class interfaceClass,
return delegate;
}
- if (InstrumentationProperties.isSpecificEnabled("dynamic-proxy")) {
+ if (InstrumentationProperties.isSpecificEnabled("dynamic-proxy", false)) {
return Proxies.newProxy(interfaceClass, delegate,
new InstrumentationProxy<>(instrumentationFilter, handlers, delegate));
} else {
@@ -132,7 +132,7 @@ public Builder withMetrics(MetricRegistry metricRegistry, String globalPre
this.handlers.add(new MetricsInvocationEventHandler(
metricRegistry,
delegate.getClass(),
- MetricRegistry.name(interfaceClass.getName()),
+ interfaceClass.getName(),
globalPrefix));
return this;
}
diff --git a/tritium-lib/src/test/java/com/palantir/tritium/JitCompilationTest.java b/tritium-lib/src/test/java/com/palantir/tritium/JitCompilationTest.java
index 239a2b251..65ad85629 100644
--- a/tritium-lib/src/test/java/com/palantir/tritium/JitCompilationTest.java
+++ b/tritium-lib/src/test/java/com/palantir/tritium/JitCompilationTest.java
@@ -38,7 +38,7 @@ public final class JitCompilationTest {
TestLogs.logTo("/dev/null");
}
- public static void main(String[] args) {
+ public static void main(String[] unusedArgs) {
JitCompilationTest test = new JitCompilationTest();
test.jitAllSuccess();
test.jitWithSomeExceptions();
diff --git a/tritium-lib/src/test/java/com/palantir/tritium/proxy/InvocationEventProxyTest.java b/tritium-lib/src/test/java/com/palantir/tritium/proxy/InvocationEventProxyTest.java
index aa3f8208f..04f4b612a 100644
--- a/tritium-lib/src/test/java/com/palantir/tritium/proxy/InvocationEventProxyTest.java
+++ b/tritium-lib/src/test/java/com/palantir/tritium/proxy/InvocationEventProxyTest.java
@@ -94,9 +94,9 @@ public void testInstrumentPreInvocationThrows() throws Throwable {
InvocationEventHandler testHandler = new SimpleHandler() {
@Override
public InvocationContext preInvocation(
- @Nonnull Object instance,
- @Nonnull Method method,
- @Nonnull Object[] args) {
+ @Nonnull Object unusedInstance,
+ @Nonnull Method unusedMethod,
+ @Nonnull Object[] unusedArgs) {
throw new IllegalStateException("expected");
}
};
@@ -112,7 +112,7 @@ public InvocationContext preInvocation(
public void testInstrumentOnSuccessThrows() throws Throwable {
InvocationEventHandler testHandler = new SimpleHandler() {
@Override
- public void onSuccess(@Nullable InvocationContext context, @Nullable Object result) {
+ public void onSuccess(@Nullable InvocationContext unusedContext, @Nullable Object unusedResult) {
throw new IllegalStateException("expected");
}
};
@@ -132,12 +132,12 @@ public void onSuccess(@Nullable InvocationContext context, @Nullable Object resu
public void testInstrumentOnFailureThrows() throws Throwable {
InvocationEventHandler testHandler = new SimpleHandler() {
@Override
- public void onSuccess(@Nullable InvocationContext context, @Nullable Object result) {
+ public void onSuccess(@Nullable InvocationContext unusedContext, @Nullable Object unusedResult) {
throw new IllegalStateException("expected");
}
@Override
- public void onFailure(@Nullable InvocationContext context, @Nonnull Throwable cause) {
+ public void onFailure(@Nullable InvocationContext unusedContext, @Nonnull Throwable unusedCause) {
throw new IllegalStateException("expected");
}
};
@@ -331,10 +331,10 @@ public InvocationContext preInvocation(
}
@Override
- public void onSuccess(@Nullable InvocationContext context, @Nullable Object result) {}
+ public void onSuccess(@Nullable InvocationContext unusedContext, @Nullable Object unusedResult) {}
@Override
- public void onFailure(@Nullable InvocationContext context, @Nonnull Throwable cause) {}
+ public void onFailure(@Nullable InvocationContext unusedContext, @Nonnull Throwable unusedCause) {}
}
private static class TestProxy extends InvocationEventProxy {
diff --git a/tritium-metrics-jvm/build.gradle b/tritium-metrics-jvm/build.gradle
index fdf6c83cd..be5f03097 100644
--- a/tritium-metrics-jvm/build.gradle
+++ b/tritium-metrics-jvm/build.gradle
@@ -1,4 +1,5 @@
apply from: "${rootDir}/gradle/publish-jar.gradle"
+apply plugin: 'com.palantir.revapi'
dependencies {
diff --git a/tritium-metrics/build.gradle b/tritium-metrics/build.gradle
index 6e192738a..0c9249388 100644
--- a/tritium-metrics/build.gradle
+++ b/tritium-metrics/build.gradle
@@ -1,4 +1,5 @@
apply from: "${rootDir}/gradle/publish-jar.gradle"
+apply plugin: 'com.palantir.revapi'
dependencies {
diff --git a/tritium-metrics/src/main/java/com/palantir/tritium/event/metrics/MetricsInvocationEventHandler.java b/tritium-metrics/src/main/java/com/palantir/tritium/event/metrics/MetricsInvocationEventHandler.java
index cb103fd83..7ba0eb98f 100644
--- a/tritium-metrics/src/main/java/com/palantir/tritium/event/metrics/MetricsInvocationEventHandler.java
+++ b/tritium-metrics/src/main/java/com/palantir/tritium/event/metrics/MetricsInvocationEventHandler.java
@@ -103,7 +103,7 @@ public InvocationContext preInvocation(@Nonnull Object instance, @Nonnull Method
}
@Override
- public void onSuccess(@Nullable InvocationContext context, @Nullable Object result) {
+ public void onSuccess(@Nullable InvocationContext context, @Nullable Object unusedResult) {
debugIfNullContext(context);
if (context != null) {
long nanos = updateTimer(context);
@@ -116,9 +116,9 @@ public void onFailure(@Nullable InvocationContext context, @Nonnull Throwable ca
markGlobalFailure();
debugIfNullContext(context);
if (context != null) {
- String failuresMetricName = MetricRegistry.name(getBaseMetricName(context), FAILURES);
+ String failuresMetricName = getBaseMetricName(context) + '.' + FAILURES;
metricRegistry.meter(failuresMetricName).mark();
- metricRegistry.meter(MetricRegistry.name(failuresMetricName, cause.getClass().getName())).mark();
+ metricRegistry.meter(failuresMetricName + '.' + cause.getClass().getName()).mark();
long nanos = updateTimer(context);
handleFailureAnnotations(context, nanos);
}
@@ -132,7 +132,7 @@ private long updateTimer(InvocationContext context) {
}
private String getBaseMetricName(InvocationContext context) {
- return MetricRegistry.name(serviceName, context.getMethod().getName());
+ return serviceName + '.' + context.getMethod().getName();
}
private void markGlobalFailure() {
@@ -142,11 +142,11 @@ private void markGlobalFailure() {
private void handleSuccessAnnotations(InvocationContext context, long nanos) {
String metricName = getAnnotatedMetricName(context);
if (metricName != null) {
- metricRegistry.timer(MetricRegistry.name(serviceName, metricName))
+ metricRegistry.timer(serviceName + '.' + metricName)
.update(nanos, TimeUnit.NANOSECONDS);
if (globalGroupPrefix != null) {
- metricRegistry.timer(MetricRegistry.name(globalGroupPrefix, metricName))
+ metricRegistry.timer(globalGroupPrefix + '.' + metricName)
.update(nanos, TimeUnit.NANOSECONDS);
}
}
@@ -155,11 +155,11 @@ private void handleSuccessAnnotations(InvocationContext context, long nanos) {
private void handleFailureAnnotations(InvocationContext context, long nanos) {
String metricName = getAnnotatedMetricName(context);
if (metricName != null) {
- metricRegistry.timer(MetricRegistry.name(serviceName, metricName, FAILURES))
+ metricRegistry.timer(serviceName + '.' + metricName + '.' + FAILURES)
.update(nanos, TimeUnit.NANOSECONDS);
if (globalGroupPrefix != null) {
- metricRegistry.timer(MetricRegistry.name(globalGroupPrefix, metricName, FAILURES))
+ metricRegistry.timer(globalGroupPrefix + '.' + metricName + '.' + FAILURES)
.update(nanos, TimeUnit.NANOSECONDS);
}
}
diff --git a/tritium-metrics/src/main/java/com/palantir/tritium/event/metrics/TaggedMetricsServiceInvocationEventHandler.java b/tritium-metrics/src/main/java/com/palantir/tritium/event/metrics/TaggedMetricsServiceInvocationEventHandler.java
index 82c01a715..9b0a14958 100644
--- a/tritium-metrics/src/main/java/com/palantir/tritium/event/metrics/TaggedMetricsServiceInvocationEventHandler.java
+++ b/tritium-metrics/src/main/java/com/palantir/tritium/event/metrics/TaggedMetricsServiceInvocationEventHandler.java
@@ -87,7 +87,7 @@ public final InvocationContext preInvocation(
}
@Override
- public final void onSuccess(@Nullable InvocationContext context, @Nullable Object result) {
+ public final void onSuccess(@Nullable InvocationContext context, @Nullable Object unusedResult) {
debugIfNullContext(context);
if (context != null) {
long nanos = System.nanoTime() - context.getStartTimeNanos();
diff --git a/tritium-proxy/build.gradle b/tritium-proxy/build.gradle
index 037d9519b..c363c0595 100644
--- a/tritium-proxy/build.gradle
+++ b/tritium-proxy/build.gradle
@@ -1,4 +1,5 @@
apply from: "${rootDir}/gradle/publish-jar.gradle"
+apply plugin: 'com.palantir.revapi'
dependencies {
diff --git a/tritium-registry/build.gradle b/tritium-registry/build.gradle
index fe759f98c..e4c774f79 100644
--- a/tritium-registry/build.gradle
+++ b/tritium-registry/build.gradle
@@ -1,4 +1,5 @@
apply from: "${rootDir}/gradle/publish-jar.gradle"
+apply plugin: 'com.palantir.revapi'
dependencies {
diff --git a/tritium-registry/src/main/java/com/palantir/tritium/metrics/registry/ExtraEntrySortedMap.java b/tritium-registry/src/main/java/com/palantir/tritium/metrics/registry/ExtraEntrySortedMap.java
index e13e5672d..73a21fb95 100644
--- a/tritium-registry/src/main/java/com/palantir/tritium/metrics/registry/ExtraEntrySortedMap.java
+++ b/tritium-registry/src/main/java/com/palantir/tritium/metrics/registry/ExtraEntrySortedMap.java
@@ -131,17 +131,17 @@ public V get(Object key) {
}
@Override
- public V put(K key, V value) {
+ public V put(K _key, V _value) {
throw new UnsupportedOperationException();
}
@Override
- public V remove(Object key) {
+ public V remove(Object _key) {
throw new UnsupportedOperationException();
}
@Override
- public void putAll(Map extends K, ? extends V> other) {
+ public void putAll(Map extends K, ? extends V> _other) {
throw new UnsupportedOperationException();
}
diff --git a/tritium-registry/src/main/java/com/palantir/tritium/metrics/registry/PrehashedSortedMap.java b/tritium-registry/src/main/java/com/palantir/tritium/metrics/registry/PrehashedSortedMap.java
index 4964acb1c..69e9a805c 100644
--- a/tritium-registry/src/main/java/com/palantir/tritium/metrics/registry/PrehashedSortedMap.java
+++ b/tritium-registry/src/main/java/com/palantir/tritium/metrics/registry/PrehashedSortedMap.java
@@ -18,7 +18,6 @@
import com.google.common.collect.ForwardingSortedMap;
import com.google.common.collect.ImmutableSortedMap;
-import java.util.SortedMap;
/**
* A sorted map implementation which prehashes for faster usage in hashmaps.
@@ -28,8 +27,8 @@ final class PrehashedSortedMap extends ForwardingSortedMap {
private final ImmutableSortedMap delegate;
private final int hashCode;
- PrehashedSortedMap(SortedMap delegate) {
- this.delegate = ImmutableSortedMap.copyOf(delegate);
+ PrehashedSortedMap(ImmutableSortedMap delegate) {
+ this.delegate = delegate;
this.hashCode = this.delegate.hashCode();
}
diff --git a/tritium-slf4j/build.gradle b/tritium-slf4j/build.gradle
index 925ea8869..302fe322d 100644
--- a/tritium-slf4j/build.gradle
+++ b/tritium-slf4j/build.gradle
@@ -1,4 +1,5 @@
apply from: "${rootDir}/gradle/publish-jar.gradle"
+apply plugin: 'com.palantir.revapi'
dependencies {
diff --git a/tritium-slf4j/src/main/java/com/palantir/tritium/event/log/LoggingInvocationEventHandler.java b/tritium-slf4j/src/main/java/com/palantir/tritium/event/log/LoggingInvocationEventHandler.java
index 0c89ffa97..7d1f25896 100644
--- a/tritium-slf4j/src/main/java/com/palantir/tritium/event/log/LoggingInvocationEventHandler.java
+++ b/tritium-slf4j/src/main/java/com/palantir/tritium/event/log/LoggingInvocationEventHandler.java
@@ -90,12 +90,12 @@ public final InvocationContext preInvocation(
}
@Override
- public final void onSuccess(@Nullable InvocationContext context, @Nullable Object result) {
+ public final void onSuccess(@Nullable InvocationContext context, @Nullable Object unusedResult) {
logInvocation(context);
}
@Override
- public final void onFailure(@Nullable InvocationContext context, @Nonnull Throwable cause) {
+ public final void onFailure(@Nullable InvocationContext context, @Nonnull Throwable unusedCause) {
logInvocation(context);
}
diff --git a/tritium-test/src/main/java/com/palantir/tritium/test/TestImplementation.java b/tritium-test/src/main/java/com/palantir/tritium/test/TestImplementation.java
index eb6ff1a19..69a170f92 100644
--- a/tritium-test/src/main/java/com/palantir/tritium/test/TestImplementation.java
+++ b/tritium-test/src/main/java/com/palantir/tritium/test/TestImplementation.java
@@ -40,7 +40,7 @@ public String test() {
}
@Override
- public void multiArgumentMethod(String string, int count, Collection foo) {
+ public void multiArgumentMethod(String unusedString, int unusedCount, Collection unusedCollection) {
test();
}
diff --git a/tritium-test/src/main/java/com/palantir/tritium/test/event/ThrowingInvocationEventHandler.java b/tritium-test/src/main/java/com/palantir/tritium/test/event/ThrowingInvocationEventHandler.java
index 00347e70c..056d64b80 100644
--- a/tritium-test/src/main/java/com/palantir/tritium/test/event/ThrowingInvocationEventHandler.java
+++ b/tritium-test/src/main/java/com/palantir/tritium/test/event/ThrowingInvocationEventHandler.java
@@ -34,19 +34,19 @@ public ThrowingInvocationEventHandler(boolean isEnabled) {
@Override
public com.palantir.tritium.event.InvocationContext preInvocation(
- @Nonnull Object instance,
- @Nonnull Method method,
- @Nonnull Object[] args) {
+ @Nonnull Object unusedInstance,
+ @Nonnull Method unusedMethod,
+ @Nonnull Object[] unusedArgs) {
throw new SafeIllegalStateException("preInvocation always throws");
}
@Override
- public void onSuccess(@Nullable InvocationContext context, @Nullable Object result) {
+ public void onSuccess(@Nullable InvocationContext unusedContext, @Nullable Object unusedResult) {
throw new SafeIllegalStateException("onSuccess always throws");
}
@Override
- public void onFailure(@Nullable InvocationContext context, @Nonnull Throwable cause) {
+ public void onFailure(@Nullable InvocationContext unusedContext, @Nonnull Throwable unusedCause) {
throw new SafeIllegalStateException("onFailure always throws");
}
diff --git a/tritium-tracing/build.gradle b/tritium-tracing/build.gradle
index 69a398a05..92cc1c43f 100644
--- a/tritium-tracing/build.gradle
+++ b/tritium-tracing/build.gradle
@@ -1,4 +1,5 @@
apply from: "${rootDir}/gradle/publish-jar.gradle"
+apply plugin: 'com.palantir.revapi'
dependencies {
diff --git a/tritium-tracing/src/main/java/com/palantir/tritium/tracing/RemotingCompatibleTracingInvocationEventHandler.java b/tritium-tracing/src/main/java/com/palantir/tritium/tracing/RemotingCompatibleTracingInvocationEventHandler.java
index e2bdf9012..5c0ce926a 100644
--- a/tritium-tracing/src/main/java/com/palantir/tritium/tracing/RemotingCompatibleTracingInvocationEventHandler.java
+++ b/tritium-tracing/src/main/java/com/palantir/tritium/tracing/RemotingCompatibleTracingInvocationEventHandler.java
@@ -64,7 +64,7 @@ private String getOperationName(Method method) {
}
@Override
- public void onSuccess(@Nullable InvocationContext context, @Nullable Object result) {
+ public void onSuccess(@Nullable InvocationContext context, @Nullable Object unusedResult) {
debugIfNullContext(context);
if (context != null) {
tracer.completeSpan();
@@ -72,7 +72,7 @@ public void onSuccess(@Nullable InvocationContext context, @Nullable Object resu
}
@Override
- public void onFailure(@Nullable InvocationContext context, @Nonnull Throwable cause) {
+ public void onFailure(@Nullable InvocationContext context, @Nonnull Throwable unusedCause) {
debugIfNullContext(context);
if (context != null) {
tracer.completeSpan();
diff --git a/tritium-tracing/src/main/java/com/palantir/tritium/tracing/TracingInvocationEventHandler.java b/tritium-tracing/src/main/java/com/palantir/tritium/tracing/TracingInvocationEventHandler.java
index db53bdc6a..df6e60c41 100644
--- a/tritium-tracing/src/main/java/com/palantir/tritium/tracing/TracingInvocationEventHandler.java
+++ b/tritium-tracing/src/main/java/com/palantir/tritium/tracing/TracingInvocationEventHandler.java
@@ -72,12 +72,12 @@ private String getOperationName(Method method) {
}
@Override
- public void onSuccess(@Nullable InvocationContext context, @Nullable Object result) {
+ public void onSuccess(@Nullable InvocationContext context, @Nullable Object unusedResult) {
complete(context);
}
@Override
- public void onFailure(@Nullable InvocationContext context, @Nonnull Throwable cause) {
+ public void onFailure(@Nullable InvocationContext context, @Nonnull Throwable unusedCause) {
complete(context);
}
diff --git a/tritium-tracing/src/test/java/com/palantir/tritium/tracing/ReflectiveTracerTest.java b/tritium-tracing/src/test/java/com/palantir/tritium/tracing/ReflectiveTracerTest.java
index d9793900f..e272ef3ce 100644
--- a/tritium-tracing/src/test/java/com/palantir/tritium/tracing/ReflectiveTracerTest.java
+++ b/tritium-tracing/src/test/java/com/palantir/tritium/tracing/ReflectiveTracerTest.java
@@ -66,13 +66,13 @@ public void createInvalid() throws Exception {
public static final class MockTracer {
private MockTracer() {}
- public static void start(String name) {}
+ public static void start(String unused) {}
public static void stop() {}
- public static void badStart(Integer id) {}
+ public static void badStart(Integer unused) {}
- public static void badStop(String name) {}
+ public static void badStop(String unused) {}
}
}
diff --git a/versions.lock b/versions.lock
index 23800c693..4fe979382 100644
--- a/versions.lock
+++ b/versions.lock
@@ -40,7 +40,7 @@ net.jqwik:jqwik-api:1.2.0 (2 constraints: ce116f10)
net.jqwik:jqwik-engine:1.2.0 (1 constraints: 9607e86c)
org.apiguardian:apiguardian-api:1.1.0 (8 constraints: cc6e0d03)
org.assertj:assertj-core:3.13.2 (1 constraints: 3b05403b)
-org.awaitility:awaitility:4.0.0 (1 constraints: 0605ff35)
+org.awaitility:awaitility:4.0.1 (1 constraints: 07050036)
org.hamcrest:hamcrest:2.1 (1 constraints: 6f0b2cce)
org.jboss.logging:jboss-logging:3.3.2.Final (1 constraints: be0d7b30)
org.jboss.xnio:xnio-api:3.3.8.Final (2 constraints: 6f1a4d45)
@@ -48,14 +48,14 @@ org.jboss.xnio:xnio-nio:3.3.8.Final (1 constraints: c40da530)
org.jetbrains:annotations:13.0 (1 constraints: df0e795c)
org.jetbrains.kotlin:kotlin-stdlib:1.3.40 (2 constraints: 01173b5e)
org.jetbrains.kotlin:kotlin-stdlib-common:1.3.40 (1 constraints: 410fc47a)
-org.junit.jupiter:junit-jupiter:5.5.1 (1 constraints: 0d051436)
-org.junit.jupiter:junit-jupiter-api:5.5.1 (4 constraints: 2b3e5efe)
-org.junit.jupiter:junit-jupiter-engine:5.5.1 (1 constraints: 080ed53b)
-org.junit.jupiter:junit-jupiter-params:5.5.1 (2 constraints: 1413d83b)
-org.junit.platform:junit-platform-commons:1.5.1 (4 constraints: 11348fab)
-org.junit.platform:junit-platform-engine:1.5.1 (2 constraints: e31ab64d)
+org.junit.jupiter:junit-jupiter:5.5.2 (1 constraints: 0e051536)
+org.junit.jupiter:junit-jupiter-api:5.5.2 (4 constraints: 2e3e6cff)
+org.junit.jupiter:junit-jupiter-engine:5.5.2 (1 constraints: 090ed63b)
+org.junit.jupiter:junit-jupiter-params:5.5.2 (2 constraints: 1613023c)
+org.junit.platform:junit-platform-commons:1.5.2 (4 constraints: 1334c2ab)
+org.junit.platform:junit-platform-engine:1.5.2 (2 constraints: e41ab74d)
org.mockito:mockito-core:3.0.0 (2 constraints: c2132a64)
org.mockito:mockito-junit-jupiter:3.0.0 (1 constraints: 0505fa35)
-org.objenesis:objenesis:2.6 (2 constraints: 271650ee)
+org.objenesis:objenesis:2.6 (1 constraints: b40a14bd)
org.opentest4j:opentest4j:1.2.0 (4 constraints: 01343da7)
org.slf4j:slf4j-simple:1.7.26 (1 constraints: 4205493b)
diff --git a/versions.props b/versions.props
index b3184fd3b..a9b43dec4 100644
--- a/versions.props
+++ b/versions.props
@@ -13,15 +13,15 @@ com.palantir.remoting3:* = 3.46.0
com.palantir.safe-logging:* = 1.10.1
com.palantir.tracing:* = 3.2.0
com.squareup.okhttp3:okhttp = 4.0.0
-com.uber.nullaway:nullaway = 0.7.6
+com.uber.nullaway:nullaway = 0.7.7
io.undertow:undertow-core = 2.0.20.Final
net.bytebuddy:byte-buddy = 1.10.1
org.assertj:assertj-core = 3.13.2
-org.awaitility:awaitility = 4.0.0
+org.awaitility:awaitility = 4.0.1
org.checkerframework:checker-qual = 2.5.0
org.hdrhistogram:* = 2.1.11
org.immutables:* = 2.7.5
-org.junit.jupiter:* = 5.5.1
+org.junit.jupiter:* = 5.5.2
org.mockito:* = 3.0.0
org.mpierce.metrics.reservoir:* = 1.1.2
org.openjdk.jmh:* = 1.21