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());