Community
Participate
Working Groups
Using latest JDT/Core, I could not retrieve the right number of comments for a compilation unit if the comments are inside a method body. I will attach a test case.
Created attachment 7686 [details] Test case This compilation unit has three comments (one javadoc, one block comment and one line comment).
Comments need also to be stored by scanner while jumping over method body in diet parse...
Fixed. Now all comments are correctly recorded by scanner and parser. [jdt-core internal] 1) jumpOverMethodBody method in Scanner has been refreshed from getNextToken implementation for comments scan. 2) endParse has been overridden in CommentRecorderParser instead of dietParse in order to store comments positions in compilation unit. This was necessary has for partial parse, dietParse was not called. In case of full parse, endParse is called twice => positions are only set once when null on compilation unit. 3) method buildCommentsTable has been added to ASTConverter to allow a set of this table while parsing partial nodes. Test cases added in jtd.core.test.model.ASTConverterJavadocTest and also in ASTConverterTest2.
Verifeid for 3.0M7