From c5bb18ec8032f4b80a59d0f7f551d8ef766464a8 Mon Sep 17 00:00:00 2001 From: Tyler Gregg Date: Tue, 14 Jan 2025 12:39:42 -0800 Subject: [PATCH] Minor cleanups. --- .../java/com/amazon/ion/system/IonReaderBuilder.java | 3 +-- .../com/amazon/ion/util/ZstdStreamInterceptorTest.java | 9 ++++++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/amazon/ion/system/IonReaderBuilder.java b/src/main/java/com/amazon/ion/system/IonReaderBuilder.java index 205c1df69..76725c9a7 100644 --- a/src/main/java/com/amazon/ion/system/IonReaderBuilder.java +++ b/src/main/java/com/amazon/ion/system/IonReaderBuilder.java @@ -277,8 +277,7 @@ public IonBufferConfiguration getBufferConfiguration() { * is required, it is up to the caller to provide a custom interceptor implementation to * achieve this. *

- * As an alternative, or in addition, to adding stream interceptors manually using this method, - * users may register implementations as service providers on the classpath. + * Users may also or instead register implementations as service providers on the classpath. * See {@link ServiceLoader} for details about how to do this. *

* The list of stream interceptors available to the reader always begins with diff --git a/src/test/java/com/amazon/ion/util/ZstdStreamInterceptorTest.java b/src/test/java/com/amazon/ion/util/ZstdStreamInterceptorTest.java index 115a71a17..89caa971c 100644 --- a/src/test/java/com/amazon/ion/util/ZstdStreamInterceptorTest.java +++ b/src/test/java/com/amazon/ion/util/ZstdStreamInterceptorTest.java @@ -32,14 +32,14 @@ import com.github.luben.zstd.ZstdInputStream; import com.github.luben.zstd.ZstdOutputStream; -import org.junit.Test; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.RepeatedTest; +import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.EnumSource; -import static org.junit.Assert.assertSame; import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertSame; import static org.junit.jupiter.api.Assertions.assertThrows; import static org.junit.jupiter.api.Assertions.assertTrue; @@ -55,7 +55,7 @@ public static class ZstdStreamInterceptor implements InputStreamInterceptor { @Override public String formatName() { - return "Zstd"; + return "zstd"; } @Override @@ -310,7 +310,9 @@ public void differentClassLoadersInEachThread() throws Exception { assertEquals(1, streamInterceptors.size()); assertSame(GzipStreamInterceptor.INSTANCE, streamInterceptors.get(0)); }); + AtomicReference withDefaultClassLoaderError = registerExceptionHandler(withDefaultClassLoader); + Thread withCustomClassLoader = new Thread(() -> { AtomicReference> streamInterceptors = new AtomicReference<>(); executeWithCustomClassLoader( @@ -331,6 +333,7 @@ public void differentClassLoadersInEachThread() throws Exception { } ); }); + AtomicReference withCustomClassLoaderError = registerExceptionHandler(withCustomClassLoader); withCustomClassLoader.setContextClassLoader(new CustomInterceptorClassLoader());