feenkcom / jdt2famix

Jdt2Famix takes Java sources and produces MSE files that can be imported into Glamorous Toolkit.
https://gtoolkit.com
Eclipse Public License 1.0
37 stars 22 forks source link

Text of comments is cut #16

Closed VincentBlondeau closed 5 years ago

VincentBlondeau commented 8 years ago

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 8 years ago

Interesting. I will take a look.

Thanks for all these issue! :)

girba commented 8 years ago

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()

VincentBlondeau commented 8 years ago

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.