Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Text of comments is cut #16

Closed
VincentBlondeau opened this issue Sep 16, 2016 · 3 comments
Closed

Text of comments is cut #16

VincentBlondeau opened this issue Sep 16, 2016 · 3 comments

Comments

@VincentBlondeau
Copy link

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
Copy link
Member

girba commented Sep 17, 2016

Interesting. I will take a look.

Thanks for all these issue! :)

@girba
Copy link
Member

girba commented Sep 17, 2016

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
Copy link
Author

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.

VincentBlondeau pushed a commit to VincentBlondeau/jdt2famix that referenced this issue Sep 21, 2016
@girba girba mentioned this issue Nov 8, 2016
VincentBlondeau pushed a commit to VincentBlondeau/jdt2famix that referenced this issue Nov 9, 2016
@girba girba closed this as completed Mar 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants