Uploaded image for project: 'Spring Roo'
  1. Spring Roo
  2. ROO-3341

Bad entity changes after field is added

This issue belongs to an archived project. You can view it, but you can't modify it. Learn more

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Complete
    • None
    • 1.2.4.RELEASE
    • @ CORE
    • None

    Description

      If a entity (or any .java) is modified by Spring Roo some erroneous changes is made:

      • Bad asterisk imports: "import java.utils.*;" becomes "import java.*;"
      • Lose of Array fields: "String[] strings;" becomes "String strings;"
      • Lose of Array constructor parameters: "Vet(String[] strings)" becomes "Vet(String strings)"

      To test it:

      1. create a new project using clinic.roo script.
      2. replace Vet.java with attached Vet.java.changed file
      3. Use Roo field command to add a field to entity:
        field string --fieldName foo --class ~.domain.Vet
        
      4. When process finish Vet.java looks like Vet.java.error

      Attachments

        1. Vet.java.changed
          1.0 kB
          Jose Manuel Vivó ( Chema ) - DISID.
        2. Vet.java.error
          1.0 kB
          Jose Manuel Vivó ( Chema ) - DISID.

        Issue Links

          Activity

            People

              stewarta Alan Stewart
              jmvivo Jose Manuel Vivó ( Chema ) - DISID.
              Archiver:
              tmarshall Trevor Marshall

              Dates

                Created:
                Updated:
                Resolved:
                Archived: