refactor: implement single-package architecture (ADR-007 Option B)#5
Merged
Merged
Conversation
|
The author of this PR, MarketDataDev03, is not an activated member of this organization on Codecov. |
MarketDataDev01
approved these changes
May 11, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
refactor: implement single-package architecture (ADR-007 Option B)
Implements Option B from ADR-007: collapses the
com.marketdata.sdk.internalsubpackage into the SDK root and drops thepublicmodifier from every infra class so the consumer's compiler simply cannot reference them. Closes the "internal types leak via public constructor signatures" gap that every non-modular Java SDK has, with pure Java visibility — no JPMS, no module-info, no asterisk on classpath consumers.What's included
Source moves + visibility drop
Four infra classes move from
com.marketdata.sdk.internal→com.marketdata.sdk(root) and switch frompublic final classtofinal class(package-private):internal/Configuration.javaConfiguration.javapublic final class→final classinternal/EnvVars.javaEnvVars.javapublic final class→final classinternal/Tokens.javaTokens.javapublic final class→final classinternal/Version.javaVersion.javapublic final class→final classThe
internal/package-info.javais deleted; the directory disappears from the source tree. After this PR:A consumer attempting
import com.marketdata.sdk.Configuration;will not compile — the type is invisible from outside the package. The same will apply to every infra class that lands in subsequent endpoint work (HttpTransport,RequestSpec,AsyncSemaphore, deserializers, etc.).Test moves
The matching unit tests move alongside their subjects so they keep package-private access:
test/.../internal/ConfigurationTest.javatest/.../ConfigurationTest.javatest/.../internal/TokensTest.javatest/.../TokensTest.javaMarketDataClientTest.javadid not move (already in root) but its staleimport com.marketdata.sdk.internal.Configurationis removed — references toConfiguration.DEFAULT_BASE_URLetc. resolve via same-package access now.MarketDataClient
The four
import com.marketdata.sdk.internal.*lines are removed. No body change — the resolution code (Configuration.loadFromProcess(),Tokens.redact(...),Version.current(),EnvVars.TOKEN) all still works because everything is now in the same package.What is not in this PR
MarketDataClientconstructors,RateLimits, exception hierarchy — all unchanged).markets/,stocks/,options/,funds/,utilities/resource façades will land in subsequent branches and will follow the same convention by construction (resource class ispublic final classin the root, constructor is package-private, internal helpers stay package-private alongside).module-info.java. Per ADR-007's rejected Option A, JPMS is available as a complementary measure later if modulepath signal becomes desirable on top of the compile-time enforcement Option B already provides.