[ROO-3447] Comment structures added by a builder are not written in the ITD Created: 03/Sep/13  Updated: 17/Sep/15  Resolved: 25/Jul/15

Status: Resolved
Project: Spring Roo
Component/s: @ CORE
Affects Version/s: 1.2.4.RELEASE, 1.2.5.RELEASE
Fix Version/s: 2.0.0.M2

Type: Improvement Priority: Minor
Reporter: Mario Martínez Sánchez - gvNIX - DISID Assignee: Juan Carlos García del Canto
Resolution: Complete Votes: 1
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

All


Issue Links:
Duplicate
duplicates ROO-3160 entity fields and ITD's methods javadoc Closed
Relate
relates to ROO-3676 Error adding Javadoc to new method on... Open

 Description   

Builders allow comment structures from Metadata, but not included in the AJ file when write to disk.

It is possible same problem affects comments into properties, classes, methods, ...

Example:

...
CommentStructure comments = new CommentStructure();
JavadocComment javadoc = new JavadocComment("My javadoc comment");
comments.addComment(javadoc, CommentStructure.CommentLocation.BEGINNING);
...
MethodMetadataBuilder methodBuilder = new MethodMetadataBuilder(...);
methodBuilder.setCommentStructure(comments);
...
builder.addMethod(methodBuilder.build());
itdTypeDetails = builder.build();


 Comments   
Comment by Juan Carlos García del Canto [ 25/Jul/15 ]

Now it's possible to include comments on generated ITDs.

The problem was that MethodBuilder includes CommentStructure correctly, but no one includes it on ITDs source file.

This is the commit with the applied changes:

https://github.com/spring-projects/spring-roo/commit/0794f02d2d7894f56ff309794e62211d0fa9bae1

To include multi-line comment, you should use "\n" on your string comment:

CommentStructure comments = new CommentStructure();
JavadocComment javadoc = new JavadocComment("My javadoc comment is \n really long");
comments.addComment(javadoc, CommentLocation.BEGINNING);
....
Generated at Tue Oct 22 23:44:41 UTC 2019 using Jira 7.13.8#713008-sha1:1606a5c1e7006e1ab135aac81f7a9566b2dbc3a6.