Community
Participate
Working Groups
20060212 SimpleName.setIdentifier should test that the name is not empty as this isn't a valid identifier.
Empty names can be created when recovering. This isn't super happy, but would you prefer a random identifier in there ? Note: why not...
Jim, was it an oversight that a SimpleName could be created with an empty name, or do you think it is ok to do so. Our code doesn't expect this.
This is a bug in SimpleName.setIdentifier (and possibly elsewhere). The empty string should have been caught and disallowed. The various AST factory methods that create nodes with names include unspecified but legal identifiers; having some invented name is more useful to AST clients than an invisible name.
SimpleName.setIdentifier() already reject empty names. ASTConverter don't use SimpleName.setIdentifier() but SimpleName.internalSetIdentifier(). That's why empty names aren't rejected when created by statements recovery. I will change statements recovery to use an invented names instead of empty names.
Fixed and tests updated DietRecoveryTest#test75() DietRecoveryTest#test76() DietRecoveryTest#test77() DietRecoveryTest#test99() DietRecoveryTest#test114() StatementRecoveryTest#test0037() ASTConverterRecoveryTest#test0005() ASTConverterRecoveryTest#test0013() Empty names are replaced by "$missing$". As the node is flagged as Recovered and the invented name is "$missing$", the chance that this name enter in conflict with a real name is very limited.
Verified using I20060328-0010 for 3.2M6