feenkcom/jdt2famix

Text of comments is cut

Closed this issue · 3 comments

Some code comments are cut and the text is not full in the model.
E.g.:
Parsing of (always in the https://github.com/awillemant/puho git repo):

class FrancePublicHolidayService {
   List<LocalDate> getPublicHolidaysByYear(final int year) {
    ....
    }


    //thanks to http://www.aveol.fr/?p=602
    private LocalDate getLundiPaques(final int year) {

    }

}

Give a comment with only // instead of //thanks to http://www.aveol.fr/?p=602

girba commented

Interesting. I will take a look.

Thanks for all these issue! :)

girba commented

It turns out that I do not get the comments because JDT does not provide them. Something seems to be wrong somewhere. If someone is interested in debugging further, the relevant method is in InJavaImporter.ensureCommentFromBodyDeclaration(...). There is a (expected failure) test documenting the problem here: ClassWithCommentsTest.testMethodWithOneLineCommentIncludingALink()

Maybe you should look here: http://stackoverflow.com/questions/3019729/how-to-access-comments-from-the-java-compiler-tree-api-generated-ast/9884987#9884987.

It seems that is not parsed by JDT, and one have to do it by parsing or copying the text itself.