Community
Participate
Working Groups
Discovering this part of code leads up to to a misplaced comment attachment in Java model : comment is attached to the block rather than to the last statement. public static void main(String[] args) { int i = 1; /* a comment */ int j = 0; }
Created attachment 182370 [details] A proposed patch
Hi Gabriel, i need your opinion about the patch i propose here to resolve this case, since it deals with recent modifications in "CommentsManager.jdtLocationSearch()". I removed some "inside comments" process but i need to know if this recent process was responding to some specific use case not well managed in "CommentsManager.alternateLocationSearch()". Test Junits are ok.
I have commited some junit test associated to this bug, without adding it in AllTests.java until an effective fix.
(In reply to comment #2) Hello Fabien, Perhaps I've not made the work for every block, but for comments inside a type, they are processed a second time using the alternative algorithm. It is to deal with the example you have provided (blank lines or white-spaces in general between a comment and a statement/expression/field/methods/...). So a solution could be to not process at all "inside comments" using the first algorithm, and use only the alternative algorithm. Regards Gabriel
ok, the patch has been commited into SVN (revision 3584).
Bug fixed via a patch.