Commit d84fce8
authored
revert: (dynamodb) revert Table.table field to private to fix .NET naming (#36029)
### Issue # (if applicable)
Closes #36025.
### Reason for this change
The `Table` class in aws-dynamodb was incorrectly renamed to `Table_` in .NET bindings starting from v2.222.0, breaking all .NET CDK applications using DynamoDB tables. This regression was introduced in PR #35554 when the internal `table` field was changed from `private` to `protected`, creating a JSII naming conflict in .NET where property names cannot match class names.
### Description of changes
This PR reverts the `table` field visibility from `protected` back to `private` at line 1213 in `packages/aws-cdk-lib/aws-dynamodb/lib/table.ts`.
**Technical details**:
- Changed `protected readonly table: CfnTable;` to `private readonly table: CfnTable;`
- This is a single-line change that resolves the JSII naming conflict
- The field is only used internally within the Table class (7 internal usages verified)
- No subclasses of Table exist in the codebase
- JSII compilation now succeeds without renaming the Table class in .NET
**Impact**:
- Fixes .NET class name from `Table_` back to `Table`
- Restores v2.221.1 behavior
- No impact on TypeScript, Python, Java, or Go bindings
- No functional or API changes
- Better encapsulation by keeping internal implementation details private
### Description of how you validated changes
- **Unit tests**: All 348 existing unit tests in aws-dynamodb pass without modification
- Test suites: 6 passed
- Tests: 348 passed, 0 failed
- **Build validation**:
- TypeScript compilation: SUCCESS
- **JSII verification**: Confirmed no JSII warnings for Table class in build output, indicating .NET bindings will use correct class name
```
% npx lerna run build --scope=aws-cdk-lib --skip-nx-cache
2>&1 | grep -i "table" | grep -i "warning\|conflict\|rename"
```
### Checklist
- [x] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md)
----
*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*1 parent 2eee0a9 commit d84fce8
File tree
2 files changed
+2
-1
lines changed- packages/aws-cdk-lib/aws-dynamodb/lib
2 files changed
+2
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4001 | 4001 | | |
4002 | 4002 | | |
4003 | 4003 | | |
| 4004 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1210 | 1210 | | |
1211 | 1211 | | |
1212 | 1212 | | |
1213 | | - | |
| 1213 | + | |
1214 | 1214 | | |
1215 | 1215 | | |
1216 | 1216 | | |
| |||
0 commit comments