Announcement Announcement Module
No announcement yet.
Overly conservative reserved word detection for enums Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Overly conservative reserved word detection for enums


    I thinks that the reserved word detection for enums should just be java reserved words. Not both java and sql.

    There are lots of sql reserved words like Yes, No, Unknown that make great enum constants. In the context of SQL I think that enum contants will always be literal escaped values anyways.

    Patch follows:

    yonasdev:roo yonasj$ git diff
    diff --git a/classpath/src/main/java/org/springframework/roo/classpath/operations/ b/classpath/src/main/java/org/springframework/roo/classpat
    index 819b7aa..4b45806 100644
    --- a/classpath/src/main/java/org/springframework/roo/classpath/operations/
    +++ b/classpath/src/main/java/org/springframework/roo/classpath/operations/
    @@ -138,7 +138,7 @@ public class ClasspathCommands implements CommandMarker {

    if (!permitReservedWords) {
    // No need to check the "name" as if the class exists it is assumed it is a legal name
    - ReservedWords.verifyReservedWordsNotPresent(fieldN ame);
    + ReservedWords.verifyReservedJavaKeywordsNotPresent (fieldName);

    String declaredByMetadataId = PhysicalTypeIdentifier.createIdentifier(name, Path.SRC_MAIN_JAVA);