feat(java): detect & rename members named after reserved words#705
feat(java): detect & rename members named after reserved words#705RomainMuller merged 4 commits intomasterfrom
Conversation
…ds found in properties and method names to avoid compiler errors
RomainMuller
left a comment
There was a problem hiding this comment.
Would advise adding proactive collision checks, so we bail out with an explicit error message instead of generating code that won't build...
| } | ||
|
|
||
| if (JavaGenerator.RESERVED_KEYWORDS.includes(propertyName)) { | ||
| return `${propertyName}Value`; |
There was a problem hiding this comment.
Might be worth checking whether this is the name of an existing property on the same type... If that is so, just bail out saying you're out of options there...
There was a problem hiding this comment.
Difficult to do, so in the interests of unblocking CDK builds moving ahead without this functionality for now.
| } | ||
|
|
||
| if (JavaGenerator.RESERVED_KEYWORDS.includes(methodName)) { | ||
| return `do${toPascalCase(methodName)}`; |
There was a problem hiding this comment.
Same as above, would be nice to have a collision check.
There was a problem hiding this comment.
Difficult to do, so in the interests of unblocking CDK builds moving ahead without this functionality for now.
…s a property called 'result'. Minor typo in comment fixed.
|
Looks good - just waiting for a confirmation build of the CDK to succeed before I approve this... To be safe... |
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.