eclipse-modisco / org.eclipse.modisco

Eclipse Public License 2.0
0 stars 0 forks source link

Java Discoverer : misplaced comments between blank lines #590

Closed eclipse-modisco-bot closed 3 hours ago

eclipse-modisco-bot commented 3 hours ago

| --- | --- | | Bugzilla Link | 329423 | | Status | CLOSED FIXED | | Importance | P2 normal | | Reported | Nov 04, 2010 06:35 EDT | | Modified | Jan 11, 2011 05:16 EDT | | Version | 0.9.0 | | Reporter | Fabien Giquel |

Description

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;\
    }
eclipse-modisco-bot commented 3 hours ago

By Fabien Giquel on Nov 04, 2010 10:14

Created attachment 182370 A proposed patch

:notepad_spiral: org.eclipse.gmt.modisco.java.discoverer.patch

eclipse-modisco-bot commented 3 hours ago

By Fabien Giquel on Nov 04, 2010 10:20

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.

eclipse-modisco-bot commented 3 hours ago

By Fabien Giquel on Nov 04, 2010 10:58

I have commited some junit test associated to this bug, without adding it in AllTests.java until an effective fix.

eclipse-modisco-bot commented 3 hours ago

By Gabriel BARBIER on Nov 08, 2010 04:07

(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

eclipse-modisco-bot commented 3 hours ago

By Fabien Giquel on Nov 08, 2010 13:45

ok, the patch has been commited into SVN (revision 3584).

eclipse-modisco-bot commented 3 hours ago

By Hugo Bruneliere on Jan 11, 2011 05:16

Bug fixed via a patch.