diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md
index 643e5e5f77..b95a557b72 100644
--- a/.github/CONTRIBUTING.md
+++ b/.github/CONTRIBUTING.md
@@ -23,7 +23,7 @@ can be automatically added by running `./mvnw com.mycila:license-maven-plugin:fo
```
/**
- * Copyright 2020 The OpenZipkin Authors
+ * Copyright 2023 The OpenZipkin Authors
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at
diff --git a/.github/workflows/create_release.yml b/.github/workflows/create_release.yml
index d9d2a387df..3bb12b15a3 100644
--- a/.github/workflows/create_release.yml
+++ b/.github/workflows/create_release.yml
@@ -11,17 +11,22 @@ on:
jobs:
create_release:
- runs-on: ubuntu-20.04 # newest available distribution, aka focal
+ runs-on: ubuntu-22.04 # newest available distribution, aka jellyfish
steps:
- name: Checkout Repository
- uses: actions/checkout@v2
+ uses: actions/checkout@v4
with:
# Prevent use of implicit GitHub Actions read-only token GITHUB_TOKEN. We don't deploy on
# the tag MAJOR.MINOR.PATCH event, but we still need to deploy the maven-release-plugin master commit.
token: ${{ secrets.GH_TOKEN }}
- fetch-depth: 1 # only need the base commit as license check isn't run
+ fetch-depth: 1 # only need the HEAD commit as license check isn't run
+ - name: Setup java
+ uses: actions/setup-java@v4
+ with:
+ distribution: 'zulu' # zulu as it supports a wide version range
+ java-version: '11' # earliest LTS and last that can compile the 1.6 release profile.
- name: Cache local Maven repository
- uses: actions/cache@v2
+ uses: actions/cache@v3
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml
index aacfe79d48..e4069ac180 100644
--- a/.github/workflows/deploy.yml
+++ b/.github/workflows/deploy.yml
@@ -14,17 +14,22 @@ on:
jobs:
deploy:
- runs-on: ubuntu-20.04 # newest available distribution, aka focal
+ runs-on: ubuntu-22.04 # newest available distribution, aka jellyfish
steps:
- name: Checkout Repository
- uses: actions/checkout@v2
+ uses: actions/checkout@v4
with:
# Prevent use of implicit GitHub Actions read-only token GITHUB_TOKEN.
# We push Javadocs to the gh-pages branch on commit.
token: ${{ secrets.GH_TOKEN }}
- fetch-depth: 0 # allow build-bin/javadoc_to_gh_pages to get the full history
+ fetch-depth: 0 # allow build-bin/idl_to_gh_pages to get the full history
+ - name: Setup java
+ uses: actions/setup-java@v4
+ with:
+ distribution: 'zulu' # zulu as it supports a wide version range
+ java-version: '11' # earliest LTS and last that can compile the 1.6 release profile.
- name: Cache local Maven repository
- uses: actions/cache@v2
+ uses: actions/cache@v3
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
index 49040c10b0..133923247f 100644
--- a/.github/workflows/test.yml
+++ b/.github/workflows/test.yml
@@ -15,21 +15,58 @@ on:
paths-ignore: '**/*.md'
jobs:
+ test-javadoc:
+ name: Test JavaDoc Builds
+ runs-on: ubuntu-22.04 # newest available distribution, aka jellyfish
+ if: "!contains(github.event.head_commit.message, 'maven-release-plugin')"
+ steps:
+ - name: Checkout Repository
+ uses: actions/checkout@v4
+ with:
+ fetch-depth: 0 # full git history for license check
+ - name: Setup java
+ uses: actions/setup-java@v4
+ with:
+ distribution: 'zulu' # zulu as it supports a wide version range
+ java-version: '11' # earliest LTS and last that can compile the 1.6 release profile.
+ - name: Cache local Maven repository
+ uses: actions/cache@v3
+ with:
+ path: ~/.m2/repository
+ key: ${{ runner.os }}-jdk-11-maven-${{ hashFiles('**/pom.xml') }}
+ restore-keys: ${{ runner.os }}-jdk-11-maven-
+ - name: Build JavaDoc
+ run: ./mvnw clean javadoc:aggregate -Prelease
+
test:
- runs-on: ubuntu-20.04 # newest available distribution, aka focal
+ name: test (JDK ${{ matrix.java_version }})
+ runs-on: ubuntu-22.04 # newest available distribution, aka jellyfish
if: "!contains(github.event.head_commit.message, 'maven-release-plugin')"
+ strategy:
+ fail-fast: false # don't fail fast as sometimes failures are operating system specific
+ matrix: # use latest available versions and be consistent on all workflows!
+ include:
+ - java_version: 11 # Last that can compile brave to 1.6
+ maven_args: -Prelease -Dgpg.skip -Dmaven.javadoc.skip=true
+ - java_version: 21 # Most recent LTS
steps:
- name: Checkout Repository
- uses: actions/checkout@v2
+ uses: actions/checkout@v4
+ with:
+ fetch-depth: 0 # full git history for license check
+ - name: Setup java
+ uses: actions/setup-java@v4
with:
- fetch-depth: 0 # full git history for license check
+ distribution: 'zulu' # zulu as it supports a wide version range
+ java-version: ${{ matrix.java_version }}
- name: Cache local Maven repository
- uses: actions/cache@v2
+ uses: actions/cache@v3
with:
path: ~/.m2/repository
- key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
- restore-keys: ${{ runner.os }}-maven-
- # We can't cache Docker without using buildx because GH actions restricts /var/lib/docker
- # That's ok because DOCKER_PARENT_IMAGE is always ghcr.io and local anyway.
+ key: ${{ runner.os }}-jdk-${{ matrix.java_version }}-maven-${{ hashFiles('**/pom.xml') }}
+ restore-keys: ${{ runner.os }}-jdk-${{ matrix.java_version }}-maven-
+ # Don't attempt to cache Docker. Sensitive information can be stolen
+ # via forks, and login session ends up in ~/.docker. This is ok because
+ # we publish DOCKER_PARENT_IMAGE to ghcr.io, hence local to the runner.
- name: Test
run: build-bin/configure_test && build-bin/test
diff --git a/.mvn/wrapper/maven-wrapper.jar b/.mvn/wrapper/maven-wrapper.jar
index 2cc7d4a55c..cb28b0e37c 100644
Binary files a/.mvn/wrapper/maven-wrapper.jar and b/.mvn/wrapper/maven-wrapper.jar differ
diff --git a/.mvn/wrapper/maven-wrapper.properties b/.mvn/wrapper/maven-wrapper.properties
index 0c675e6e69..346d645fd0 100644
--- a/.mvn/wrapper/maven-wrapper.properties
+++ b/.mvn/wrapper/maven-wrapper.properties
@@ -1,2 +1,18 @@
-distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.3/apache-maven-3.6.3-bin.zip
-wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar
\ No newline at end of file
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.6/apache-maven-3.9.6-bin.zip
+wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar
diff --git a/RELEASE.md b/RELEASE.md
index 84e84c544e..aecf4d753e 100644
--- a/RELEASE.md
+++ b/RELEASE.md
@@ -55,11 +55,19 @@ the following:
Before you do the first release of the year, move the SNAPSHOT version back and forth from whatever the current is.
In-between, re-apply the licenses.
+
+Note: the command below is more complex than a normal project because this
+project has a bom.
```bash
-$ ./mvnw versions:set -DnewVersion=1.3.3-SNAPSHOT -DgenerateBackupPoms=false
-$ ./mvnw com.mycila:license-maven-plugin:format
-$ ./mvnw versions:set -DnewVersion=1.3.2-SNAPSHOT -DgenerateBackupPoms=false
-$ git commit -am"Adjusts copyright headers for this year"
+$ mvn=$PWD/mvnw
+$ for p in ./bom .; do
+ (cd $p
+ $mvn versions:set -DnewVersion=2.17.1-SNAPSHOT -DgenerateBackupPoms=false
+ $mvn -o clean install -DskipTests
+ $mvn com.mycila:license-maven-plugin:format
+ $mvn versions:set -DnewVersion=2.17.0-SNAPSHOT -DgenerateBackupPoms=false)
+ done
+$ git commit -asm"Adjusts copyright headers for this year"
```
## Manually releasing
diff --git a/brave-bom/pom.xml b/brave-bom/pom.xml
index 21b273e1ac..f5816d58b9 100644
--- a/brave-bom/pom.xml
+++ b/brave-bom/pom.xml
@@ -36,8 +36,6 @@
2.23.22.16.3
-
- 1.6.8
@@ -315,7 +313,7 @@
org.sonatype.pluginsnexus-staging-maven-plugin
- ${nexus-staging-maven-plugin.version}
+ 1.6.13trueossrh
@@ -326,12 +324,12 @@
maven-deploy-plugin
- 3.0.0-M1
+ 3.1.1maven-gpg-plugin
- 1.6
+ 3.1.0sign-artifacts
diff --git a/brave-tests/pom.xml b/brave-tests/pom.xml
index ef723de9cc..90bc537a68 100644
--- a/brave-tests/pom.xml
+++ b/brave-tests/pom.xml
@@ -27,8 +27,6 @@
${project.basedir}/..
- 1.8
- java18
@@ -61,15 +59,6 @@
-
- net.orfjackal.retrolambda
- retrolambda-maven-plugin
-
-
- none
-
-
-
diff --git a/brave-tests/src/main/java/brave/test/IntegrationTestSpanHandler.java b/brave-tests/src/main/java/brave/test/IntegrationTestSpanHandler.java
index 18ea0a6877..37f6d3a877 100644
--- a/brave-tests/src/main/java/brave/test/IntegrationTestSpanHandler.java
+++ b/brave-tests/src/main/java/brave/test/IntegrationTestSpanHandler.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2013-2020 The OpenZipkin Authors
+ * Copyright 2013-2023 The OpenZipkin Authors
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at
@@ -128,7 +128,7 @@ public final class IntegrationTestSpanHandler extends SpanHandler implements Tes
public IntegrationTestSpanHandler() {
// OrphanTracker detects to see if it should add "brave.flushed" or not, as it is used in
- // production some times and avoiding this could be helpful. This forces a failed match,
+ // production sometimes and avoiding this could be helpful. This forces a failed match,
// so that we can detect orphans even when no data was added.
MutableSpan intentionallyWrongDefaultSpan = new MutableSpan();
intentionallyWrongDefaultSpan.tag("not", "me");
diff --git a/brave-tests/src/test/java/brave/test/IntegrationTestSpanHandlerTest.java b/brave-tests/src/test/java/brave/test/IntegrationTestSpanHandlerTest.java
index ad248e159c..62699357b8 100644
--- a/brave-tests/src/test/java/brave/test/IntegrationTestSpanHandlerTest.java
+++ b/brave-tests/src/test/java/brave/test/IntegrationTestSpanHandlerTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2013-2020 The OpenZipkin Authors
+ * Copyright 2013-2023 The OpenZipkin Authors
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at
@@ -45,7 +45,7 @@ public class IntegrationTestSpanHandlerTest {
assertThatThrownBy(spanHandler::takeLocalSpan)
.hasMessageStartingWith("Orphaned span found")
.hasMessageContaining("brave.flush")
- .hasMessageEndingWith("Look for code missing span.flush() or span.finish().");
+ .hasMessageContaining("Look for code missing span.flush() or span.finish().");
}
@Test public void toString_includesSpans() {
diff --git a/brave/pom.xml b/brave/pom.xml
index 7d997df5c7..1c20b1875a 100644
--- a/brave/pom.xml
+++ b/brave/pom.xml
@@ -31,8 +31,6 @@
brave${project.basedir}/..
- 1.6
- java16-Xep:EqualsUnsafeCast:OFF
@@ -61,19 +59,6 @@
0.18test
-
-
- org.powermock
- powermock-module-junit4
- ${powermock.version}
- test
-
-
- org.powermock
- powermock-api-mockito2
- ${powermock.version}
- test
- io.opentracingopentracing-api
@@ -136,4 +121,40 @@
+
+
+
+ release
+
+
+ 1.6
+ java16
+
+
+
+
+ maven-enforcer-plugin
+ ${maven-enforcer-plugin.version}
+
+
+ enforce-java
+
+ enforce
+
+
+
+
+
+ [11,12)
+
+
+
+
+
+
+
+
+
+
diff --git a/brave/src/main/java/brave/Tracing.java b/brave/src/main/java/brave/Tracing.java
index 291015fdc2..cad13e7127 100644
--- a/brave/src/main/java/brave/Tracing.java
+++ b/brave/src/main/java/brave/Tracing.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2013-2020 The OpenZipkin Authors
+ * Copyright 2013-2023 The OpenZipkin Authors
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at
@@ -50,7 +50,7 @@
* for example via spring or when mocking.
*/
public abstract class Tracing implements Closeable {
- static final AtomicReference CURRENT = new AtomicReference<>();
+ static final AtomicReference CURRENT = new AtomicReference();
public static Builder newBuilder() {
return new Builder();
@@ -148,7 +148,7 @@ public static final class Builder {
boolean alwaysSampleLocal = false, alwaysReportSpans = false, trackOrphans = false;
Propagation.Factory propagationFactory = B3Propagation.FACTORY;
ErrorParser errorParser = new ErrorParser();
- Set spanHandlers = new LinkedHashSet<>(); // dupes not ok
+ Set spanHandlers = new LinkedHashSet(); // dupes not ok
Builder() {
defaultSpan.localServiceName("unknown");
@@ -162,7 +162,7 @@ public static final class Builder {
* @since 5.12
*/
public Set spanHandlers() {
- return Collections.unmodifiableSet(new LinkedHashSet<>(spanHandlers));
+ return Collections.unmodifiableSet(new LinkedHashSet(spanHandlers));
}
/**
@@ -480,7 +480,7 @@ static final class Default extends Tracing {
defaultSpan.localIp(Platform.get().linkLocalIp());
}
- Set spanHandlers = new LinkedHashSet<>(builder.spanHandlers);
+ Set spanHandlers = new LinkedHashSet(builder.spanHandlers);
// When present, the Zipkin handler is invoked after the user-supplied ones.
if (builder.zipkinSpanReporter != null) {
spanHandlers.add(
diff --git a/brave/src/main/java/brave/baggage/BaggagePropagation.java b/brave/src/main/java/brave/baggage/BaggagePropagation.java
index 988774545a..5c7d990977 100644
--- a/brave/src/main/java/brave/baggage/BaggagePropagation.java
+++ b/brave/src/main/java/brave/baggage/BaggagePropagation.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2013-2020 The OpenZipkin Authors
+ * Copyright 2013-2023 The OpenZipkin Authors
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at
@@ -99,8 +99,8 @@ public static FactoryBuilder newFactoryBuilder(Propagation.Factory delegate) {
public static class FactoryBuilder { // not final to backport ExtraFieldPropagation
final Propagation.Factory delegate;
- final List extractKeyNames = new ArrayList<>();
- final Set configs = new LinkedHashSet<>();
+ final List extractKeyNames = new ArrayList();
+ final Set configs = new LinkedHashSet();
FactoryBuilder(Propagation.Factory delegate) {
if (delegate == null) throw new NullPointerException("delegate == null");
@@ -115,7 +115,7 @@ public static class FactoryBuilder { // not final to backport ExtraFieldPropagat
* @since 5.11
*/
public Set configs() {
- return Collections.unmodifiableSet(new LinkedHashSet<>(configs));
+ return Collections.unmodifiableSet(new LinkedHashSet(configs));
}
/**
@@ -183,8 +183,8 @@ static final class Factory extends Propagation.Factory implements Propagation fields = new ArrayList<>();
- Set localFieldNames = new LinkedHashSet<>();
+ List fields = new ArrayList();
+ Set localFieldNames = new LinkedHashSet();
int maxDynamicFields = 0;
for (BaggagePropagationConfig config : factoryBuilder.configs) {
maxDynamicFields += config.maxDynamicFields;
@@ -199,11 +199,11 @@ static final class Factory extends Propagation.Factory implements Propagation BaggagePropagation create(KeyFactory keyFactory) {
- return new BaggagePropagation<>(StringPropagationAdapter.create(get(), keyFactory));
+ return new BaggagePropagation(StringPropagationAdapter.create(get(), keyFactory));
}
@Override public BaggagePropagation get() {
- return new BaggagePropagation<>(this);
+ return new BaggagePropagation(this);
}
@Override public TraceContext decorate(TraceContext context) {
@@ -224,11 +224,11 @@ static final class Factory extends Propagation.Factory implements Propagation Injector injector(Setter setter) {
- return new BaggageInjector<>(this, setter);
+ return new BaggageInjector(this, setter);
}
@Override public Extractor extractor(Getter getter) {
- return new BaggageExtractor<>(this, getter);
+ return new BaggageExtractor(this, getter);
}
}
@@ -280,14 +280,12 @@ public static List allKeyNames(Propagation propagation) {
List baggageKeyNames = getAllKeyNames(emptyExtraction);
if (baggageKeyNames.isEmpty()) return propagation.keys();
- List result = new ArrayList<>(propagation.keys().size() + baggageKeyNames.size());
+ List result = new ArrayList(propagation.keys().size() + baggageKeyNames.size());
result.addAll(propagation.keys());
result.addAll(baggageKeyNames);
return Collections.unmodifiableList(result);
}
- // Not lambda as Retrolambda creates an OSGi dependency on jdk.internal.vm.annotation with JDK 14
- // See https://github.com/luontola/retrolambda/issues/160
enum NoopGetter implements Getter {
INSTANCE;
diff --git a/brave/src/main/java/brave/baggage/BaggagePropagationConfig.java b/brave/src/main/java/brave/baggage/BaggagePropagationConfig.java
index 81b6ec0433..7c46e1daae 100644
--- a/brave/src/main/java/brave/baggage/BaggagePropagationConfig.java
+++ b/brave/src/main/java/brave/baggage/BaggagePropagationConfig.java
@@ -99,7 +99,7 @@ public Builder toBuilder() {
/** @since 5.11 */
public static final class Builder {
final BaggageField field;
- List keyNames = new ArrayList<>();
+ List keyNames = new ArrayList();
Builder(BaggageField field) {
this.field = field;
@@ -107,7 +107,7 @@ public static final class Builder {
Builder(SingleBaggageField input) {
this.field = input.field;
- this.keyNames = new ArrayList<>(input.keyNames());
+ this.keyNames = new ArrayList(input.keyNames());
}
/**
@@ -137,8 +137,11 @@ public SingleBaggageField build() {
? BaggageCodec.NOOP
: SingleFieldBaggageCodec.single(builder.field, builder.keyNames), 0);
field = builder.field;
- keyNames = builder.keyNames.isEmpty() ? Collections.emptySet()
- : Collections.unmodifiableSet(new LinkedHashSet<>(builder.keyNames));
+ if (builder.keyNames.isEmpty()) {
+ keyNames = Collections.emptySet();
+ } else {
+ keyNames = Collections.unmodifiableSet(new LinkedHashSet(builder.keyNames));
+ }
}
public BaggageField field() {
diff --git a/brave/src/main/java/brave/baggage/CorrelationFlushScope.java b/brave/src/main/java/brave/baggage/CorrelationFlushScope.java
index 016c5cacfe..e84fb2212b 100644
--- a/brave/src/main/java/brave/baggage/CorrelationFlushScope.java
+++ b/brave/src/main/java/brave/baggage/CorrelationFlushScope.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2013-2020 The OpenZipkin Authors
+ * Copyright 2013-2023 The OpenZipkin Authors
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at
@@ -46,7 +46,7 @@ final class CorrelationFlushScope extends AtomicBoolean implements Scope {
* BaggageField#updateValue(String)}.
*/
static void flush(BaggageField field, String value) {
- Set syncedContexts = new LinkedHashSet<>();
+ Set syncedContexts = new LinkedHashSet();
for (Object o : updateScopeStack()) {
CorrelationUpdateScope next = ((CorrelationUpdateScope) o);
String name = next.name(field);
@@ -66,12 +66,13 @@ static void flush(BaggageField field, String value) {
}
}
- static final ThreadLocal> updateScopeStack = new ThreadLocal<>();
+ static final ThreadLocal> updateScopeStack =
+ new ThreadLocal>();
static ArrayDeque