diff --git a/core/json-utils/src/main/java/software/amazon/awssdk/protocols/jsoncore/internal/NullJsonNode.java b/core/json-utils/src/main/java/software/amazon/awssdk/protocols/jsoncore/internal/NullJsonNode.java index 36b68ae8ad61..843d127ee2b8 100644 --- a/core/json-utils/src/main/java/software/amazon/awssdk/protocols/jsoncore/internal/NullJsonNode.java +++ b/core/json-utils/src/main/java/software/amazon/awssdk/protocols/jsoncore/internal/NullJsonNode.java @@ -17,14 +17,18 @@ import java.util.List; import java.util.Map; -import software.amazon.awssdk.annotations.SdkInternalApi; +import software.amazon.awssdk.annotations.SdkProtectedApi; import software.amazon.awssdk.protocols.jsoncore.JsonNode; import software.amazon.awssdk.protocols.jsoncore.JsonNodeVisitor; /** * A null {@link JsonNode}. + * + *

+ * Implementation notes: this class should've been outside internal package, + * but we can't fix it due to backwards compatibility reasons. */ -@SdkInternalApi +@SdkProtectedApi public final class NullJsonNode implements JsonNode { private static final NullJsonNode INSTANCE = new NullJsonNode(); diff --git a/test/architecture-tests/archunit_store/18fc8858-1308-4d5d-b92d-87817d2fab53 b/test/architecture-tests/archunit_store/18fc8858-1308-4d5d-b92d-87817d2fab53 index 00043c4de219..f78399c8b416 100644 --- a/test/architecture-tests/archunit_store/18fc8858-1308-4d5d-b92d-87817d2fab53 +++ b/test/architecture-tests/archunit_store/18fc8858-1308-4d5d-b92d-87817d2fab53 @@ -1,7 +1,4 @@ -Class depends on an internal API from a different module (Class ) Class depends on an internal API from a different module (Class ) -Class depends on an internal API from a different module (Class ) -Class depends on an internal API from a different module (Class ) Class depends on an internal API from a different module (Class ) Class depends on an internal API from a different module (Class ) Class depends on an internal API from a different module (Class ) @@ -9,50 +6,27 @@ Class depends on an internal API from a different module (Class ) Class depends on an internal API from a different module (Class ) Class depends on an internal API from a different module (Class ) -Class depends on an internal API from a different module (Class ) Class depends on an internal API from a different module (Class ) Class depends on an internal API from a different module (Class ) -Class depends on an internal API from a different module (Class ) -Class depends on an internal API from a different module (Class ) -Class depends on an internal API from a different module (Class ) Class depends on an internal API from a different module (Class ) Class depends on an internal API from a different module (Class ) Class depends on an internal API from a different module (Class ) Class depends on an internal API from a different module (Class ) Class depends on an internal API from a different module (Class ) Class depends on an internal API from a different module (Class ) -Class depends on an internal API from a different module (Class ) -Class depends on an internal API from a different module (Class ) Class depends on an internal API from a different module (Class ) -Class depends on an internal API from a different module (Class ) -Class depends on an internal API from a different module (Class ) -Class depends on an internal API from a different module (Class ) -Class depends on an internal API from a different module (Class ) -Class depends on an internal API from a different module (Class ) Class depends on an internal API from a different module (Class ) Class depends on an internal API from a different module (Class ) -Class depends on an internal API from a different module (Class ) Class depends on an internal API from a different module (Class ) Class depends on an internal API from a different module (Class ) Class depends on an internal API from a different module (Class ) -Class depends on an internal API from a different module (Class ) Class depends on an internal API from a different module (Class ) -Class depends on an internal API from a different module (Class ) -Class depends on an internal API from a different module (Class ) Class depends on an internal API from a different module (Class ) -Class depends on an internal API from a different module (Class ) -Class depends on an internal API from a different module (Class ) -Class depends on an internal API from a different module (Class ) -Class depends on an internal API from a different module (Class ) Class depends on an internal API from a different module (Class ) -Class depends on an internal API from a different module (Class ) -Class depends on an internal API from a different module (Class ) Class depends on an internal API from a different module (Class ) Class depends on an internal API from a different module (Class ) Class depends on an internal API from a different module (Class ) -Class depends on an internal API from a different module (Class ) Class depends on an internal API from a different module (Class ) -Class depends on an internal API from a different module (Class ) Class depends on an internal API from a different module (Class ) Class depends on an internal API from a different module (Class ) Class depends on an internal API from a different module (Class ) @@ -62,9 +36,7 @@ Class depends on Class depends on an internal API from a different module (Class ) Class depends on an internal API from a different module (Class ) Class depends on an internal API from a different module (Class ) -Class depends on an internal API from a different module (Class ) Class depends on an internal API from a different module (Class ) -Class depends on an internal API from a different module (Class ) Class depends on an internal API from a different module (Class ) Class depends on an internal API from a different module (Class ) Class depends on an internal API from a different module (Class ) @@ -72,9 +44,6 @@ Class d Class depends on an internal API from a different module (Class ) Class depends on an internal API from a different module (Class ) Class depends on an internal API from a different module (Class ) -Class depends on an internal API from a different module (Class ) -Class depends on an internal API from a different module (Class ) -Class depends on an internal API from a different module (Class ) Class depends on an internal API from a different module (Class ) Class depends on an internal API from a different module (Class ) Class depends on an internal API from a different module (Class ) @@ -83,7 +52,6 @@ Class dep Class depends on an internal API from a different module (Class ) Class depends on an internal API from a different module (Class ) Class depends on an internal API from a different module (Class ) -Class depends on an internal API from a different module (Class ) Class depends on an internal API from a different module (Class ) Class depends on an internal API from a different module (Class ) Class depends on an internal API from a different module (Class ) diff --git a/test/architecture-tests/archunit_store/c898eee1-aeb5-4355-bb3b-ea56bf58cacb b/test/architecture-tests/archunit_store/c898eee1-aeb5-4355-bb3b-ea56bf58cacb index 08079a917a10..62572136f3db 100644 --- a/test/architecture-tests/archunit_store/c898eee1-aeb5-4355-bb3b-ea56bf58cacb +++ b/test/architecture-tests/archunit_store/c898eee1-aeb5-4355-bb3b-ea56bf58cacb @@ -14,6 +14,7 @@ Class does not reside ou Class does not reside outside of package '..internal..' in (ResponseOrException.java:0) Class does not reside outside of package '..internal..' in (WaiterAttribute.java:0) Class does not reside outside of package '..internal..' in (DnsResolverLoader.java:0) +Class does not reside outside of package '..internal..' in (NullJsonNode.java:0) Class does not reside outside of package '..internal..' in (ExponentialDelayWithHalfJitter.java:0) Class does not reside outside of package '..internal..' in (DefaultAwareRetryStrategy.java:0) Class does not reside outside of package '..internal..' in (RetryStrategyDefaults.java:0) diff --git a/test/architecture-tests/src/test/java/software/amazon/awssdk/archtests/InternalApiBoundaryTest.java b/test/architecture-tests/src/test/java/software/amazon/awssdk/archtests/InternalApiBoundaryTest.java index d41cc995f4e5..76bc8fcba69e 100644 --- a/test/architecture-tests/src/test/java/software/amazon/awssdk/archtests/InternalApiBoundaryTest.java +++ b/test/architecture-tests/src/test/java/software/amazon/awssdk/archtests/InternalApiBoundaryTest.java @@ -32,6 +32,8 @@ import java.util.Set; import java.util.stream.Collectors; import org.junit.jupiter.api.Test; +import software.amazon.awssdk.annotations.SdkInternalApi; +import software.amazon.awssdk.annotations.SdkProtectedApi; import software.amazon.awssdk.awscore.internal.AwsProtocolMetadata; import software.amazon.awssdk.awscore.internal.AwsServiceProtocol; import software.amazon.awssdk.core.internal.interceptor.trait.RequestCompression; @@ -90,7 +92,9 @@ public void check(JavaClass item, ConditionEvents events) { } if (JavaClass.Predicates.resideInAPackage("software.amazon.awssdk..internal..").test(dependencyTargetClass)) { - if (!ArchUtils.resideInSameRootPackage(packageName, dependencyPackageName)) { + if (!ArchUtils.resideInSameRootPackage(packageName, dependencyPackageName) && + // Ignore if the dependency class is not annotated with SdkInternalApi since it's an exception case + dependencyTargetClass.isAnnotatedWith(SdkInternalApi.class)) { String errorMessage = String.format("%s depends on an internal API from a different module (%s)", item.getDescription(), dependencyTargetClass.getDescription());