Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing OSGi resolution issues caused by jdk.internal.vm.annotation #1247

Merged
merged 5 commits into from
Aug 21, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions brave-bom/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@
<main.basedir>${project.basedir}/..</main.basedir>

<!-- use the same values in ../pom.xml -->
<zipkin.version>2.21.1</zipkin.version>
<zipkin-reporter.version>2.15.0</zipkin-reporter.version>
<zipkin.version>2.21.7</zipkin.version>
<zipkin-reporter.version>2.15.1</zipkin-reporter.version>
</properties>

<organization>
Expand Down
12 changes: 11 additions & 1 deletion brave/src/main/java/brave/baggage/BaggagePropagation.java
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ public static List<String> allKeyNames(Propagation<String> propagation) {
if (propagation == null) throw new NullPointerException("propagation == null");
// When baggage or similar is in use, the result != TraceContextOrSamplingFlags.EMPTY
TraceContextOrSamplingFlags emptyExtraction =
propagation.extractor((c, k) -> null).extract(Boolean.TRUE);
propagation.extractor(NoopGetter.INSTANCE).extract(Boolean.TRUE);
List<String> baggageKeyNames = getAllKeyNames(emptyExtraction);
if (baggageKeyNames.isEmpty()) return propagation.keys();

Expand All @@ -286,6 +286,16 @@ public static List<String> allKeyNames(Propagation<String> propagation) {
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<Boolean, String> {
INSTANCE;

@Override public String get(Boolean request, String key) {
return null;
}
}

static List<String> getAllKeyNames(TraceContextOrSamplingFlags extracted) {
List<Object> extraList =
extracted.context() != null ? extracted.context().extra() : extracted.extra();
Expand Down
6 changes: 3 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@
<errorprone.version>2.4.0</errorprone.version>

<!-- use the same values in bom/pom.xml -->
<zipkin.version>2.21.1</zipkin.version>
<zipkin-reporter.version>2.15.0</zipkin-reporter.version>
<zipkin.version>2.21.7</zipkin.version>
<zipkin-reporter.version>2.15.1</zipkin-reporter.version>

<!-- Ensure older versions of spring still work -->
<spring5.version>5.2.7.RELEASE</spring5.version>
Expand Down Expand Up @@ -129,7 +129,7 @@
<maven-failsafe-plugin.version>3.0.0-M4</maven-failsafe-plugin.version>
<maven-invoker-plugin.version>3.2.1</maven-invoker-plugin.version>
<maven-enforcer-plugin.version>3.0.0-M3</maven-enforcer-plugin.version>
<maven-bundle-plugin.version>4.2.1</maven-bundle-plugin.version>
<maven-bundle-plugin.version>5.1.1</maven-bundle-plugin.version>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

<license-maven-plugin.version>3.0</license-maven-plugin.version>
</properties>

Expand Down