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

added a test for Comment Association and Printing #2636

Merged
merged 4 commits into from
Oct 8, 2018

Conversation

tempuser1909
Copy link
Contributor

For Issue #2482. Added a test class for the following issues:

  1. Comment association are mixed up
  2. And the comment at the end of the file is not printed

@pvojtechovsky
Copy link
Collaborator

Thank you. It is good start, so we can debug it more easily now.
@tdurieux will you have time for this commenting issue? I can may be have a look at it tomorrow evening.

@tempuser1909
Copy link
Contributor Author

tempuser1909 commented Oct 8, 2018

Hi @pvojtechovsky, just wanted to confirm my understanding of comment association.

So for the comment associated with class TestClassWithComments, it is

//end class test

For comments associated with interface testInterface, they are

// ------------------------------------ //
// test / test test     //
// ------------------------------------ //
/**
 * test2
 */ 

And finally, the comment associated with method mytest under testInterface, it is

/**
 * test3
 */ 

Am I right? Also, I would like to ask why is

// ------------------------------------ //
// test / test test     //
// ------------------------------------ //

considered to be to associated with testInterface instead of being comments associated as part of class TestClassWithComments?

@pvojtechovsky
Copy link
Collaborator

just wanted to confirm my understanding of comment association.

you are right

why is // test / test test // considered to be to associated with testInterface instead of being comments associated as part of class TestClassWithComments?

Because in java there is usually true that comment belongs to the element which follows after the comment. But note... there are some rare exceptions from this rule.

@tdurieux
Copy link
Collaborator

tdurieux commented Oct 8, 2018

Sorry @pvojtechovsky, I was not available this weekend.

Your fix seems good, ready for merge?

@tdurieux
Copy link
Collaborator

tdurieux commented Oct 8, 2018

considered to be to associated with testInterface instead of being comments associated as part of class TestClassWithComments?

It is really difficult to find a rule that will work in all the cases. You should probably take into account the number of new lines before and after the comments.

@pvojtechovsky
Copy link
Collaborator

ready for merge?

yes, I just added test contract comment. So then it is ready for merge

@monperrus monperrus merged commit bb0de7a into INRIA:master Oct 8, 2018
@monperrus
Copy link
Collaborator

Thanks a lot!

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

Successfully merging this pull request may close these issues.

4 participants