Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#535 False + : JavadocMethod/RedundantThrows

release_4.4
closed
nobody
None
5
2013-11-27
2008-12-11
Romain PELISSE
No

Hi,

The attached zip file contains a small Ant project reproducing the issue (does require a maven2 repository though). Basicly when confronted to multiple unresolved throws, checkstyle seems to fail somehow on the first @Throws and therefore spot the following @Throws tag as missing.

(This entry is most likely a clone of https://sourceforge.net/tracker/?func=detail&atid=397078&aid=1755944&group_id=29721)

Discussion

  • Romain PELISSE
    Romain PELISSE
    2008-12-11

    small ant project reproducting the issue

     
    Attachments
  • Romain PELISSE
    Romain PELISSE
    2008-12-12

    Unit test reproducing the issue

     
  • Romain PELISSE
    Romain PELISSE
    2008-12-12

    Hi,

    I have just added a small patch to help reproduce this issue inside a Checkstyle unit test (the patch is based on Checkstyle 4.4). I'm willing to fix this annoying issue, but any advice on any "how to do so" we'll definitly be appreciated !

     
  • Oliver Burn
    Oliver Burn
    2008-12-14

    It sounds like you have done the hard bit - which to be able to reliably reproduce the bug in a unit test. From there it is a matter of fixing the bug in the processing logic to not abandon checking the other @throws.

     
  • Romain PELISSE
    Romain PELISSE
    2008-12-14

    full-patch-with-fix-but-broken-unit-test

     
  • Romain PELISSE
    Romain PELISSE
    2008-12-14

    Well I managed to fix my issue, but as you foresee (which was quite easy to forecast :) ) my fixe broke some other test. I'll try to fix this by myself, but I would appreciate any bits of advice of this matter (as I don't understand everything the JavadocMethod code).

    I've attached the appropriate patch (with all my modification).

     
  • Romain PELISSE
    Romain PELISSE
    2008-12-16

    Final fix for 4.4

     
    Attachments
  • Romain PELISSE
    Romain PELISSE
    2008-12-16

    Ok I managed to fix the issue... Nasty piece of code. I would like a little bit more comment on how the algorithm was proceding... Anyway, all tests are ok now and my patch passed the checkstyle.checkstyle task.

    Anyway, this fix is for the 4.4. I'll gladly try to port it to the trunk, but i'll wait that this patch is validated (and applied) before doing so.

     
  • Romain PELISSE
    Romain PELISSE
    2008-12-26

    Hi,

    You probably simply not have the time to look at my patch, but just in case it has been forgotten, i add this new comment as a reminder :)

    (yeah, i know this is vile :) )

     
  • Oliver Burn
    Oliver Burn
    2009-01-09

    can you please say which file contains the final patch. I looked at fix-rc1.patch and cannot understand how the algorithm differs from that already implemented version 4.4.

     
  • Romain PELISSE
    Romain PELISSE
    2009-01-09

    Well, I did have to struggle a little beat to get the algorithm and find the fix, so i totally understand your issue :)

    For what I rememeber, there was a vicious side effect with this:
    while (!found && throwIt.hasNext())

    At some point, found was setted to true but the iteration should continue anyway (to fix my issue), so i separate it from the while and add a break where needed, so that the "! found" does not really drive anymore the end of the loop. (On a personal point of view, i also think this is clearer, but that is quite subjective).

    Perhaps the best way for you is to add, first, my unit test (which reproduce the issue) and then run my code to see that it fixes the issue. (As i read my own patch i do realize it sounds a bit like nothing has changer, but i'll assure this fix the issue)

     
  • Romain PELISSE
    Romain PELISSE
    2009-02-02

    Hi Oburn and Checkstyle guys,

    Any news on this entry ? Did I you add the unit test and reproduced the issue ? Do you want me to do something for you on this matter ?

     
  • Romain PELISSE
    Romain PELISSE
    2009-05-18

    Hi,

    It seems that o.burn gave up and my patch :(

    What can I do to help any other commiter to test & apply this patch ?

     
  • Roman Ivanov
    Roman Ivanov
    2013-11-27

    • status: open --> closed