diff --git a/activemq-client/pom.xml b/activemq-client/pom.xml index 018333e6..3d2c61df 100644 --- a/activemq-client/pom.xml +++ b/activemq-client/pom.xml @@ -34,11 +34,6 @@ as the former uses javax.jms and latter jakarta.jms. It could be better to make an activemq-client6 module. --> 5.18.3 - - - - java16 @@ -67,7 +62,9 @@ release - 1.6 + 1.6 + 1.6 + 6 diff --git a/activemq-client/src/main/java/zipkin2/reporter/activemq/ActiveMQSender.java b/activemq-client/src/main/java/zipkin2/reporter/activemq/ActiveMQSender.java index fa5e1a44..12262899 100644 --- a/activemq-client/src/main/java/zipkin2/reporter/activemq/ActiveMQSender.java +++ b/activemq-client/src/main/java/zipkin2/reporter/activemq/ActiveMQSender.java @@ -1,5 +1,5 @@ /* - * Copyright 2016-2023 The OpenZipkin Authors + * Copyright 2016-2024 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 @@ -77,7 +77,7 @@ public static final class Builder { ActiveMQConnectionFactory connectionFactory; String queue = "zipkin"; Encoding encoding = Encoding.JSON; - int messageMaxBytes = 500_000; + int messageMaxBytes = 500000; public Builder connectionFactory(ActiveMQConnectionFactory connectionFactory) { if (connectionFactory == null) throw new NullPointerException("connectionFactory == null"); @@ -159,9 +159,9 @@ public final ActiveMQSender build() { @Override public CheckResult check() { try { lazyInit.get(); - } catch (IOException | RuntimeException | Error e) { - Call.propagateIfFatal(e); - return CheckResult.failed(e); + } catch (Throwable t) { + Call.propagateIfFatal(t); + return CheckResult.failed(t); } return lazyInit.result.checkResult; } @@ -210,8 +210,9 @@ void send() throws IOException { try { send(); callback.onSuccess(null); - } catch (IOException | RuntimeException | Error e) { - callback.onError(e); + } catch (Throwable t) { + Call.propagateIfFatal(t); + callback.onError(t); } } } diff --git a/activemq-client/src/test/java/zipkin2/reporter/activemq/ActiveMQExtension.java b/activemq-client/src/test/java/zipkin2/reporter/activemq/ActiveMQExtension.java index 5194276d..238858da 100644 --- a/activemq-client/src/test/java/zipkin2/reporter/activemq/ActiveMQExtension.java +++ b/activemq-client/src/test/java/zipkin2/reporter/activemq/ActiveMQExtension.java @@ -64,7 +64,7 @@ String brokerURL() { // mostly waiting for https://github.com/testcontainers/testcontainers-java/issues/3537 static final class ActiveMQContainer extends GenericContainer { ActiveMQContainer() { - super(parse("ghcr.io/openzipkin/zipkin-activemq:2.26.0")); + super(parse("ghcr.io/openzipkin/zipkin-activemq:2.27.0")); if ("true".equals(System.getProperty("docker.skip"))) { throw new TestAbortedException("${docker.skip} == true"); } diff --git a/amqp-client/pom.xml b/amqp-client/pom.xml index ec7b3eb5..2872e8e9 100644 --- a/amqp-client/pom.xml +++ b/amqp-client/pom.xml @@ -34,9 +34,6 @@ 5.20.0 4.12.0 - - - java16 @@ -97,7 +94,9 @@ release - 1.6 + 1.6 + 1.6 + 6 diff --git a/amqp-client/src/it/amqp_v4/pom.xml b/amqp-client/src/it/amqp_v4/pom.xml index 0324105b..9485497a 100644 --- a/amqp-client/src/it/amqp_v4/pom.xml +++ b/amqp-client/src/it/amqp_v4/pom.xml @@ -1,7 +1,7 @@ - 2.26.0 + 2.27.0 https://github.com/openzipkin/zipkin-reporter-java diff --git a/brave/pom.xml b/brave/pom.xml index 22a05199..5e3f713e 100644 --- a/brave/pom.xml +++ b/brave/pom.xml @@ -31,9 +31,6 @@ zipkin2.reporter.brave ${project.basedir}/.. - - - java16 @@ -75,7 +72,9 @@ release - 1.6 + 1.6 + 1.6 + 6 diff --git a/brave/src/main/java/zipkin2/reporter/brave/ConvertingSpanReporter.java b/brave/src/main/java/zipkin2/reporter/brave/ConvertingSpanReporter.java index fb219905..41f0e5f7 100644 --- a/brave/src/main/java/zipkin2/reporter/brave/ConvertingSpanReporter.java +++ b/brave/src/main/java/zipkin2/reporter/brave/ConvertingSpanReporter.java @@ -1,5 +1,5 @@ /* - * Copyright 2016-2020 The OpenZipkin Authors + * Copyright 2016-2024 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 @@ -129,7 +129,7 @@ enum Consumer implements TagConsumer, AnnotationConsumer generateKindMap() { - Map result = new LinkedHashMap<>(); + Map result = new LinkedHashMap(); // Note: Both Brave and Zipkin treat null kind as a local/in-process span for (Kind kind : Kind.values()) { try { diff --git a/core/pom.xml b/core/pom.xml index dd49fc06..fbb40e85 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -31,9 +31,6 @@ zipkin2.reporter ${project.basedir}/.. - - - java16 @@ -49,7 +46,9 @@ release - 1.6 + 1.6 + 1.6 + 6 diff --git a/core/src/main/java/zipkin2/reporter/AsyncReporter.java b/core/src/main/java/zipkin2/reporter/AsyncReporter.java index 28440e91..ea68b21b 100644 --- a/core/src/main/java/zipkin2/reporter/AsyncReporter.java +++ b/core/src/main/java/zipkin2/reporter/AsyncReporter.java @@ -1,5 +1,5 @@ /* - * Copyright 2016-2020 The OpenZipkin Authors + * Copyright 2016-2024 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 @@ -202,7 +202,7 @@ public AsyncReporter build(BytesEncoder encoder) { "Encoder doesn't match Sender: %s %s", encoder.encoding(), sender.encoding())); } - return new BoundedAsyncReporter<>(this, encoder); + return new BoundedAsyncReporter(this, encoder); } } @@ -222,7 +222,7 @@ static final class BoundedAsyncReporter extends AsyncReporter { private boolean shouldWarnException = true; BoundedAsyncReporter(Builder builder, BytesEncoder encoder) { - this.pending = new ByteBoundedQueue<>(builder.queuedMaxSpans, builder.queuedMaxBytes); + this.pending = new ByteBoundedQueue(builder.queuedMaxSpans, builder.queuedMaxBytes); this.sender = builder.sender; this.messageMaxBytes = builder.messageMaxBytes; this.messageTimeoutNanos = builder.messageTimeoutNanos; @@ -239,7 +239,7 @@ static final class BoundedAsyncReporter extends AsyncReporter { void startFlusherThread() { BufferNextMessage consumer = BufferNextMessage.create(encoder.encoding(), messageMaxBytes, messageTimeoutNanos); - Thread flushThread = threadFactory.newThread(new Flusher<>(this, consumer)); + Thread flushThread = threadFactory.newThread(new Flusher(this, consumer)); flushThread.setName("AsyncReporter{" + sender + "}"); flushThread.setDaemon(true); flushThread.start(); @@ -263,7 +263,7 @@ void startFlusherThread() { @Override public final void flush() { if (closed.get()) throw new ClosedSenderException(); - flush(BufferNextMessage.create(encoder.encoding(), messageMaxBytes, 0)); + flush(BufferNextMessage.create(encoder.encoding(), messageMaxBytes, 0)); } void flush(BufferNextMessage bundler) { @@ -282,7 +282,7 @@ void flush(BufferNextMessage bundler) { metrics.incrementMessageBytes(bundler.sizeInBytes()); // Create the next message. Since we are outside the lock shared with writers, we can encode - ArrayList nextMessage = new ArrayList<>(bundler.count()); + final ArrayList nextMessage = new ArrayList(bundler.count()); bundler.drain(new SpanWithSizeConsumer() { @Override public boolean offer(S next, int nextSizeInBytes) { nextMessage.add(encoder.encode(next)); // speculatively add to the pending message @@ -377,7 +377,10 @@ static final class Flusher implements Runnable { while (!result.closed.get()) { result.flush(consumer); } - } catch (RuntimeException | Error e) { + } catch (RuntimeException e) { + logger.log(Level.WARNING, "Unexpected error flushing spans", e); + throw e; + } catch (Error e) { logger.log(Level.WARNING, "Unexpected error flushing spans", e); throw e; } finally { diff --git a/core/src/main/java/zipkin2/reporter/BufferNextMessage.java b/core/src/main/java/zipkin2/reporter/BufferNextMessage.java index d21b9e07..4811f2b6 100644 --- a/core/src/main/java/zipkin2/reporter/BufferNextMessage.java +++ b/core/src/main/java/zipkin2/reporter/BufferNextMessage.java @@ -1,5 +1,5 @@ /* - * Copyright 2016-2019 The OpenZipkin Authors + * Copyright 2016-2024 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 @@ -19,23 +19,22 @@ /** Use of this type happens off the application's main thread. This type is not thread-safe */ abstract class BufferNextMessage implements SpanWithSizeConsumer { - static BufferNextMessage create(Encoding encoding, int maxBytes, long timeoutNanos) { switch (encoding) { case JSON: - return new BufferNextJsonMessage<>(maxBytes, timeoutNanos); + return new BufferNextJsonMessage(maxBytes, timeoutNanos); case THRIFT: - return new BufferNextThriftMessage<>(maxBytes, timeoutNanos); + return new BufferNextThriftMessage(maxBytes, timeoutNanos); case PROTO3: - return new BufferNextProto3Message<>(maxBytes, timeoutNanos); + return new BufferNextProto3Message(maxBytes, timeoutNanos); } throw new UnsupportedOperationException("encoding: " + encoding); } final int maxBytes; final long timeoutNanos; - final ArrayList spans = new ArrayList<>(); - final ArrayList sizes = new ArrayList<>(); + final ArrayList spans = new ArrayList(); + final ArrayList sizes = new ArrayList(); long deadlineNanoTime; int messageSizeInBytes; diff --git a/core/src/main/java/zipkin2/reporter/InMemoryReporterMetrics.java b/core/src/main/java/zipkin2/reporter/InMemoryReporterMetrics.java index d6c3ce94..6e5d8873 100644 --- a/core/src/main/java/zipkin2/reporter/InMemoryReporterMetrics.java +++ b/core/src/main/java/zipkin2/reporter/InMemoryReporterMetrics.java @@ -1,5 +1,5 @@ /* - * Copyright 2016-2019 The OpenZipkin Authors + * Copyright 2016-2024 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 @@ -30,9 +30,9 @@ enum MetricKey { } private final ConcurrentHashMap metrics = - new ConcurrentHashMap<>(); + new ConcurrentHashMap(); private final ConcurrentHashMap, AtomicLong> messagesDropped = - new ConcurrentHashMap<>(); + new ConcurrentHashMap, AtomicLong>(); @Override public void incrementMessages() { increment(MetricKey.messages, 1); @@ -47,7 +47,8 @@ public long messages() { } public Map, Long> messagesDroppedByCause() { - Map, Long> result = new LinkedHashMap<>(messagesDropped.size()); + Map, Long> result = + new LinkedHashMap, Long>(messagesDropped.size()); for (Map.Entry, AtomicLong> kv : messagesDropped.entrySet()) { result.put(kv.getKey(), kv.getValue().longValue()); } @@ -130,7 +131,7 @@ static void increment(ConcurrentHashMap metrics, K key, int q AtomicLong metric = metrics.get(key); if (metric == null) { metric = metrics.putIfAbsent(key, new AtomicLong(quantity)); - if (metric == null) return; // won race creating the entry + if (metric == null) return; // won race creating the entry } while (true) { diff --git a/core/src/test/java/zipkin2/reporter/AwaitableCallbackTest.java b/core/src/test/java/zipkin2/reporter/AwaitableCallbackTest.java index e0f98e93..99f8cb96 100644 --- a/core/src/test/java/zipkin2/reporter/AwaitableCallbackTest.java +++ b/core/src/test/java/zipkin2/reporter/AwaitableCallbackTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2016-2023 The OpenZipkin Authors + * Copyright 2016-2024 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 @@ -23,19 +23,14 @@ class AwaitableCallbackTest { @Test void awaitIsUninterruptable() { - AtomicBoolean returned = new AtomicBoolean(); AwaitableCallback captor = new AwaitableCallback(); - Thread thread = new Thread(() -> { - captor.await(); - returned.set(true); - }); + Thread thread = new Thread(captor::await); thread.start(); thread.interrupt(); assertThat(thread.isInterrupted()).isTrue(); // The callback thread receiving an interrupt has nothing to do with the caller of the captor assertThat(Thread.currentThread().isInterrupted()).isFalse(); - assertThat(returned.get()).isFalse(); } @Test void onSuccessReturns() { diff --git a/kafka/pom.xml b/kafka/pom.xml index 5b85c517..60476795 100644 --- a/kafka/pom.xml +++ b/kafka/pom.xml @@ -31,9 +31,6 @@ zipkin2.reporter.kafka ${project.basedir}/.. - - - java17 @@ -63,7 +60,9 @@ release - 1.7 + 1.7 + 1.7 + 7 diff --git a/kafka/src/main/java/zipkin2/reporter/kafka/KafkaSender.java b/kafka/src/main/java/zipkin2/reporter/kafka/KafkaSender.java index 6035f4a1..a59d4e99 100644 --- a/kafka/src/main/java/zipkin2/reporter/kafka/KafkaSender.java +++ b/kafka/src/main/java/zipkin2/reporter/kafka/KafkaSender.java @@ -1,5 +1,5 @@ /* - * Copyright 2016-2023 The OpenZipkin Authors + * Copyright 2016-2024 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 @@ -13,7 +13,6 @@ */ package zipkin2.reporter.kafka; -import java.io.IOException; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; @@ -323,15 +322,15 @@ class KafkaCall extends Call.Base { // KafkaFuture is not cancelable this.message = message; } - @Override protected Void doExecute() throws IOException { + @Override protected Void doExecute() { AwaitableCallback callback = new AwaitableCallback(); - get().send(new ProducerRecord<>(topic, message), new CallbackAdapter(callback)); + get().send(new ProducerRecord(topic, message), new CallbackAdapter(callback)); callback.await(); return null; } @Override protected void doEnqueue(Callback callback) { - get().send(new ProducerRecord<>(topic, message), new CallbackAdapter(callback)); + get().send(new ProducerRecord(topic, message), new CallbackAdapter(callback)); } @Override public Call clone() { diff --git a/kafka/src/test/java/zipkin2/reporter/kafka/KafkaExtension.java b/kafka/src/test/java/zipkin2/reporter/kafka/KafkaExtension.java index 8e912578..0d451339 100644 --- a/kafka/src/test/java/zipkin2/reporter/kafka/KafkaExtension.java +++ b/kafka/src/test/java/zipkin2/reporter/kafka/KafkaExtension.java @@ -90,7 +90,7 @@ String bootstrapServer() { // mostly waiting for https://github.com/testcontainers/testcontainers-java/issues/3537 static final class KafkaContainer extends GenericContainer { KafkaContainer() { - super(parse("ghcr.io/openzipkin/zipkin-kafka:2.26.0")); + super(parse("ghcr.io/openzipkin/zipkin-kafka:2.27.0")); if ("true".equals(System.getProperty("docker.skip"))) { throw new TestAbortedException("${docker.skip} == true"); } diff --git a/libthrift/pom.xml b/libthrift/pom.xml index 54a29d66..c55519c6 100644 --- a/libthrift/pom.xml +++ b/libthrift/pom.xml @@ -31,9 +31,6 @@ zipkin2.reporter.libthrift ${project.basedir}/.. - - - java16 @@ -74,7 +71,9 @@ release - 1.6 + 1.6 + 1.6 + 6 diff --git a/libthrift/src/main/java/zipkin2/reporter/libthrift/LibthriftSender.java b/libthrift/src/main/java/zipkin2/reporter/libthrift/LibthriftSender.java index 4e2b2bc5..e2d256c1 100644 --- a/libthrift/src/main/java/zipkin2/reporter/libthrift/LibthriftSender.java +++ b/libthrift/src/main/java/zipkin2/reporter/libthrift/LibthriftSender.java @@ -1,5 +1,5 @@ /* - * Copyright 2016-2019 The OpenZipkin Authors + * Copyright 2016-2024 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 @@ -42,7 +42,7 @@ public static Builder newBuilder() { public static final class Builder { String host; int port = 9410; - int messageMaxBytes = 500_000; // TFramedTransport.DEFAULT_MAX_LENGTH + int messageMaxBytes = 500000; // TFramedTransport.DEFAULT_MAX_LENGTH int connectTimeout = 10 * 1000, socketTimeout = 60 * 1000; Builder(LibthriftSender sender) { @@ -151,7 +151,7 @@ ScribeClient get() { @Override public CheckResult check() { try { - if (get().log(Collections.emptyList())) { + if (get().log(Collections.emptyList())) { return CheckResult.OK; } throw new IllegalStateException("try later"); @@ -197,8 +197,9 @@ class ScribeCall extends Call.Base { callback.onError(new IllegalStateException("try later")); } callback.onSuccess(null); - } catch (TException |RuntimeException | Error e) { - callback.onError(e); + } catch (Throwable t) { + Call.propagateIfFatal(t); + callback.onError(t); } } diff --git a/libthrift/src/test/java/zipkin2/reporter/libthrift/ZipkinExtension.java b/libthrift/src/test/java/zipkin2/reporter/libthrift/ZipkinExtension.java index e4868831..b2f665da 100644 --- a/libthrift/src/test/java/zipkin2/reporter/libthrift/ZipkinExtension.java +++ b/libthrift/src/test/java/zipkin2/reporter/libthrift/ZipkinExtension.java @@ -76,7 +76,7 @@ Response get(String path) throws IOException { // mostly waiting for https://github.com/testcontainers/testcontainers-java/issues/3537 static final class ZipkinContainer extends GenericContainer { ZipkinContainer() { - super(parse("ghcr.io/openzipkin/zipkin:2.26.0")); + super(parse("ghcr.io/openzipkin/zipkin:2.27.0")); if ("true".equals(System.getProperty("docker.skip"))) { throw new TestAbortedException("${docker.skip} == true"); } diff --git a/okhttp3/pom.xml b/okhttp3/pom.xml index ae028db2..590bfe81 100644 --- a/okhttp3/pom.xml +++ b/okhttp3/pom.xml @@ -33,20 +33,9 @@ ${project.basedir}/.. 3.11.0 - - - java17 - - org.jvnet - animal-sniffer-annotation - 1.0 - - provided - - ${project.groupId} zipkin-reporter @@ -104,7 +93,9 @@ release - 1.7 + 1.7 + 1.7 + 7 diff --git a/okhttp3/src/it/okhttp3_v3/pom.xml b/okhttp3/src/it/okhttp3_v3/pom.xml index 0ae0ae37..5ba5d8cd 100644 --- a/okhttp3/src/it/okhttp3_v3/pom.xml +++ b/okhttp3/src/it/okhttp3_v3/pom.xml @@ -1,7 +1,7 @@ - 1.8 - java18 - - + 1.8 1.8 + + 8 + + + 11 + 11 + 11 - 2.23.0 + 2.24.1 - 2.26.0 + 2.27.0 - 5.16.0 + 5.17.0 5.10.1 - 3.24.2 + 3.25.1 4.12.0 - 2.22.0 + 2.22.1 1.19.3 ${skipTests} - 1.23 1.2.8 4.3 5.1.9 - 3.11.0 + 3.12.1 3.6.1 3.1.1 @@ -84,12 +87,12 @@ 3.4.0 3.1.1 3.6.0 - 3.6.2 + 3.6.3 3.3.0 3.0.1 3.5.1 3.3.0 - 3.2.2 + 3.2.3 1.6.13 @@ -219,13 +222,6 @@ - - org.codehaus.mojo.signature - ${main.signature.artifact} - 1.0 - signature - MAIN - com.mycila license-maven-plugin-git @@ -253,10 +249,7 @@ ${maven-compiler-plugin.version} true - ${main.java.version} - ${main.java.version} true - 8 true @@ -382,29 +375,6 @@ ${maven-help-plugin.version} - - org.codehaus.mojo - animal-sniffer-maven-plugin - ${animal-sniffer-maven-plugin.version} - - - org.codehaus.mojo.signature - ${main.signature.artifact} - 1.0 - - false - - - - animal-sniffer - verify - - check - - - - - maven-surefire-plugin ${maven-surefire-plugin.version} @@ -561,8 +531,6 @@ ${maven-compiler-plugin.version} true - ${main.java.version} - ${main.java.version} true true diff --git a/spring-beans/pom.xml b/spring-beans/pom.xml index 3bebfa9c..9a4e4060 100644 --- a/spring-beans/pom.xml +++ b/spring-beans/pom.xml @@ -31,9 +31,6 @@ zipkin2.reporter.beans ${project.basedir}/.. - - - java16 @@ -122,7 +119,9 @@ release - 1.6 + 1.6 + 1.6 + 6 diff --git a/urlconnection/pom.xml b/urlconnection/pom.xml index 253e1caf..ec6b6c8d 100644 --- a/urlconnection/pom.xml +++ b/urlconnection/pom.xml @@ -31,9 +31,6 @@ zipkin2.reporter.urlconnection ${project.basedir}/.. - - - java16 @@ -56,7 +53,9 @@ release - 1.6 + 1.6 + 1.6 + 6 diff --git a/urlconnection/src/main/java/zipkin2/reporter/urlconnection/URLConnectionSender.java b/urlconnection/src/main/java/zipkin2/reporter/urlconnection/URLConnectionSender.java index bbbc274d..9c92fdb4 100644 --- a/urlconnection/src/main/java/zipkin2/reporter/urlconnection/URLConnectionSender.java +++ b/urlconnection/src/main/java/zipkin2/reporter/urlconnection/URLConnectionSender.java @@ -1,5 +1,5 @@ /* - * Copyright 2016-2020 The OpenZipkin Authors + * Copyright 2016-2024 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 @@ -47,7 +47,7 @@ public static Builder newBuilder() { public static final class Builder { URL endpoint; Encoding encoding = Encoding.JSON; - int messageMaxBytes = 500_000; + int messageMaxBytes = 500000; int connectTimeout = 10 * 1000, readTimeout = 60 * 1000; boolean compressionEnabled = true; @@ -275,8 +275,9 @@ class HttpPostCall extends Call.Base { try { send(message, mediaType); callback.onSuccess(null); - } catch (IOException | RuntimeException | Error e) { - callback.onError(e); + } catch (Throwable t) { + Call.propagateIfFatal(t); + callback.onError(t); } }