Spring Roo
  1. Spring Roo
  2. ROO-2208

GAE One-to-many code does not import HashSet

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Complete
    • Affects Version/s: 1.1.2.RELEASE
    • Fix Version/s: 1.1.3.RELEASE
    • Component/s: PERSISTENCE
    • Labels:
      None
    • Environment:
      n/a

      Description

      In the Roo-generated *_Roo_JavaBean.aj files, there are 2 problems with the code generated for @OneToMany fields:

      • HashSet is used in the Set<Key> declarations but not imported.
      • The getters and setters try to create (instanciate) new Set<...>() rather than new HashSet<...>().

        Activity

        Hide
        Alan Stewart added a comment - - edited

        Committed fix in JavaBeanMetadata for import of HashSet in Git ID afc5039febff1fb20d8d657840f4d3de08c29290. However, there is a bug in the equals() method of JavaType that causes the following to be generated:

            public Set<Variable> Smartmeter.getVariables() {
                Set<com.test.shared.test.Variable> localVariables = new Set<com.test.shared.test.Variable>();
        ...
        

        instead of correctly generating:

            public Set<Variable> Smartmeter.getVariables() {
                Set<com.test.shared.test.Variable> localVariables = new HashSet<com.test.shared.test.Variable>();
        ...
        

        Assigning to James to fix.

        Show
        Alan Stewart added a comment - - edited Committed fix in JavaBeanMetadata for import of HashSet in Git ID afc5039febff1fb20d8d657840f4d3de08c29290. However, there is a bug in the equals() method of JavaType that causes the following to be generated: public Set<Variable> Smartmeter.getVariables() { Set<com.test.shared.test.Variable> localVariables = new Set<com.test.shared.test.Variable>(); ... instead of correctly generating: public Set<Variable> Smartmeter.getVariables() { Set<com.test.shared.test.Variable> localVariables = new HashSet<com.test.shared.test.Variable>(); ... Assigning to James to fix.
        Hide
        James Tyrrell added a comment -

        Set and List collection types are now being detected correctly, regardless of parameterisation, in commit 75ac51d4c750d52f3463dffd35e3023edd02e4aa

        Show
        James Tyrrell added a comment - Set and List collection types are now being detected correctly, regardless of parameterisation, in commit 75ac51d4c750d52f3463dffd35e3023edd02e4aa
        Hide
        James Tyrrell added a comment -

        I overlooked the mutator and this is rectified in commit e101d13a3793346e7591e09b8d2a96ced024cace

        Show
        James Tyrrell added a comment - I overlooked the mutator and this is rectified in commit e101d13a3793346e7591e09b8d2a96ced024cace

          People

          • Assignee:
            James Tyrrell
            Reporter:
            Stefaan Vanderheyden
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: