Add checkstyle rules fit for v2 - #7325
Conversation
|
This pull request has been closed and the conversation has been locked. Comments on closed PRs are hard for our team to see. If you need more assistance, please open a new issue that references this one. |
…g tests to it/ Relocates the marshaller, unmarshaller, and Mapper*Utils classes under an internal/ package, and moves the four tests that make real AWS calls to src/it/java per the v2 layout convention. Adds the v1-coupled S3Link and table-admin tests to the compiler testExcludes until those ports land.
Appendix: full annotation classification
|
mapper v2 "house cleaning" PR
dynamodb-mapper(mapper v2) is a faithful 1:1 port of the EOL v1 DynamoDBMapper. Enabling the full v2 checkstyle ruleset would rename public types, change signatures, reorder members, and add code absent from v1. That turns the port into a refactor which is harder to diff against v1, and poses a behavior change risk.This PR is "house cleaning", it makes sure the mapper module adheres to the v2 style and release requirement every module adheres to (where possible).
I did my best to break down the PR into independent commits by subject. Every subject is listed as a mechanical or low discretion change:
Changes Breakdown:
1. Static analysis suppressions + SDK annotations (mechanical, some discretion)
A faithful port trips three static analysis gates. Rather than adopting the full v2 rulesets, we suppress narrowly:
finalon locals across 17 files. Mechanical.@SdkPublicApi@SdkInternalApi@SdkProtectedApibuild-tools/.../spotbugs-suppressions.xml): 15 bug patterns carried over verbatim from v1, scoped tomapper.dynamodb.*, suppressed to keep the port byte-faithful rather than refactoring. Mechanical.test/architecture-tests): 3 mapper classes added to theshouldNotAbuseWarnLogallowlist;DynamoDBMapperModelFactory,UpdateExpressionGenerator, andVersionAttributeConditionExpressionGeneratormoved tointernal/to satisfyPackageContainmentTest. Mechanical.Cross module note: this PR edits two shared files outside
dynamodb-mapper:build-toolsspotbugs-suppressions.xml, andarchtests/ArchUtils.java(newclassWithInnerClassesToPattern(String)helper, needed to allowlist an inner class warn by name without the arch tests module depending on the mapper).2. Repo layout (mechanical)
Moved marshallers/unmarshallers/utils under
internal/; moved true integ tests tosrc/it/. This is just package relative moves, no code changes.3. Swap remaining v1 imports + logging (mechanical)
Remaining v1 SDK imports → v2 equivalents;
commons-logging→ SLF4J.4. Remove dead code (mechanical)
Deleted unused
DynamoDBReflector/ReflectionUtils; removed deprecatedRequestMetricCollectorfrom config (no v2 equivalent).5. Restore data plane functional tests (mechanical)
Un excluded the DynamoDB Local functional tests that only use table admin for fixture setup (they actually test data plane operations) Pure table admin and S3Link tests stay excluded pending their ports.
6. Replace log4j 1.x with log4j2 (mechanical)
Swapped the log4j 1.x test dep for the SDK standard
log4j-api/log4j-core/log4j-slf4j-impl(bom managed); replacedlog4j.propertieswithlog4j2.xml.7. Build metadata (mechanical)
Declared the module's previously transitive v2 dependencies explicitly (
sdk-core,aws-core,http-client-spi,auth,regions,annotations,utils). added the mapper to the.brazil.jsonmapping exclusion list.Not in this PR (deferred to dedicated port PRs)
Table-admin/GSI port, S3Link port, and the v1 coupled tests they block.