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

Roo deletes non-JavaDoc comments when adding entity fields

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Minor
    • Resolution: Complete
    • Affects Version/s: 1.0.1.RELEASE
    • Fix Version/s: 1.2.4.RELEASE
    • Component/s: @ CORE
    • Labels:
      None
    • Environment:
      Win XP SP 3

      Description

      If an entity's .java file contains any non-JavaDoc comments like these ones:

      private String name;
       
      // This comment has the single-line style
       
      private Date birthday;
       
      /*
       * This comment has the multi-line style.
       */
       
      public void foo() {
        ...
      }

      ... then adding a field to this entity via the Roo shell will strip out any such comments. I haven't tested whether this happens when Roo "manages" such files for any other reason.

      This is clearly undesirable behaviour in a source file that's meant to be able to contain hand-written code (as opposed to say the AspectJ ITDs, which are fully maintained by Roo).

        Issue Links

          Activity

          Hide
          balex Ben Alex added a comment -

          This is due to a limitation in JavaParser as per http://code.google.com/p/javaparser/issues/detail?id=9. This is therefore not a bug in Roo but rather an enhancement requirement in JavaParser. I'll switch to it to an enhancement request accordingly.

          Show
          balex Ben Alex added a comment - This is due to a limitation in JavaParser as per http://code.google.com/p/javaparser/issues/detail?id=9 . This is therefore not a bug in Roo but rather an enhancement requirement in JavaParser. I'll switch to it to an enhancement request accordingly.
          Hide
          basilv Basil Vandegriend added a comment -

          I'm using Roo 1.2.1.RELEASE and I've observed Roo delete JavaDoc comments. It sounds like this should not happen and I should likely raise a defect, but I thought I'd comment on this issue to see if it is related.

          Show
          basilv Basil Vandegriend added a comment - I'm using Roo 1.2.1.RELEASE and I've observed Roo delete JavaDoc comments. It sounds like this should not happen and I should likely raise a defect, but I thought I'd comment on this issue to see if it is related.
          Hide
          basilv Basil Vandegriend added a comment -

          I have raised ROO-3147 for the problem of Roo deleting JavaDoc comments.

          Show
          basilv Basil Vandegriend added a comment - I have raised ROO-3147 for the problem of Roo deleting JavaDoc comments.
          Hide
          ankurmitujjain Ankur Jain added a comment - - edited

          It seems that http://code.google.com/p/javaparser/issues/detail?id=9 is never ending issue....

          Comments from owner

          Comment 35 by project member jges...@gmail.com, Feb 24, 2012
          Hello everybody.
           
          Sorry, I don't have time keep updating this project. I really enjoyed working on this thing, but is hard for me act as an active commiter.
           
          Feel free to fork this project. Sometimes I'm going to answer some questions or write some code, but in a very slow manner. 

          Ben you can get the solution in comments section for this issue at same URL
          http://code.google.com/p/javaparser/issues/detail?id=9
          Please use code submitted by members there to solve this issue...

          Thank you

          Show
          ankurmitujjain Ankur Jain added a comment - - edited It seems that http://code.google.com/p/javaparser/issues/detail?id=9 is never ending issue.... Comments from owner Comment 35 by project member jges...@gmail.com, Feb 24, 2012 Hello everybody.   Sorry, I don't have time keep updating this project. I really enjoyed working on this thing, but is hard for me act as an active commiter.   Feel free to fork this project. Sometimes I'm going to answer some questions or write some code, but in a very slow manner. Ben you can get the solution in comments section for this issue at same URL http://code.google.com/p/javaparser/issues/detail?id=9 Please use code submitted by members there to solve this issue... Thank you
          Hide
          jmvivo Jose Manuel Vivó ( Chema ) - DISID. added a comment - - edited

          Moved comment to ROO-3335

          Show
          jmvivo Jose Manuel Vivó ( Chema ) - DISID. added a comment - - edited Moved comment to ROO-3335
          Hide
          tstephenson Tim Stephenson added a comment -

          I retested this today as I felt sure I had not encountered it in my Roo use and sure enough the described behaviour no longer occurs in ROO 1.2.4.RELEASE. At least under Java 7. "Java(TM) SE Runtime Environment (build 1.7.0_45-b18)" I gather this may be as a result of switching from javaparser to antlr-java-parser as discussed in ROO-3335 and ROO-3341 (both complete in 1.2.4-RELEASE).

          Therefore I believe this issue can be closed.

          Show
          tstephenson Tim Stephenson added a comment - I retested this today as I felt sure I had not encountered it in my Roo use and sure enough the described behaviour no longer occurs in ROO 1.2.4.RELEASE. At least under Java 7. "Java(TM) SE Runtime Environment (build 1.7.0_45-b18)" I gather this may be as a result of switching from javaparser to antlr-java-parser as discussed in ROO-3335 and ROO-3341 (both complete in 1.2.4-RELEASE). Therefore I believe this issue can be closed.

            People

            • Assignee:
              stewarta Alan Stewart
              Reporter:
              aswan Andrew Swan
            • Votes:
              15 Vote for this issue
              Watchers:
              12 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: