Skip to content

Commit d84fce8

Browse files
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

2 files changed

+2
-1
lines changed

allowed-breaking-changes.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4001,3 +4001,4 @@ move:aws-cdk-lib.aws_xray.TransactionSearchConfigReference
40014001
move:aws-cdk-lib.IEnvironmentAware aws-cdk-lib.interfaces.IEnvironmentAware
40024002
move:aws-cdk-lib.ResourceEnvironment aws-cdk-lib.interfaces.ResourceEnvironment
40034003

4004+
removed:aws-cdk-lib.aws_dynamodb.Table.table

packages/aws-cdk-lib/aws-dynamodb/lib/table.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1210,7 +1210,7 @@ export class Table extends TableBase {
12101210
*/
12111211
public readonly tableStreamArn: string | undefined;
12121212

1213-
protected readonly table: CfnTable;
1213+
private readonly table: CfnTable;
12141214

12151215
private readonly keySchema = new Array<CfnTable.KeySchemaProperty>();
12161216
private readonly attributeDefinitions = new Array<CfnTable.AttributeDefinitionProperty>();

0 commit comments

Comments
 (0)