From: SourceForge.net <no...@so...> - 2010-08-17 01:15:42
|
Bugs item #3038802, was opened at 2010-08-03 21:38 Message generated for change (Comment added) made by aditsu You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=113153&aid=3038802&group_id=13153 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: Johannes Weberhofer (weberho) Assigned to: Adrian Sandor (aditsu) Summary: patch jtidy2: remove dead code Initial Comment: Eclipse has detected some unused code in the CodeUpdatedAndJava5 branch. I have reviewed and removed that code. ---------------------------------------------------------------------- >Comment By: Adrian Sandor (aditsu) Date: 2010-08-17 09:15 Message: I don't see why "node" couldn't become null inside the while loop (line 2157: node = next;) and throw NPE. The C code in Tidy actually checks for null in the while loop condition. So I think we have a bug here, although I don't have a test case for it. Unless you have a different opinion, I will fix this by checking for null in the while condition, and keeping the existing "break if null" after the loop. ---------------------------------------------------------------------- Comment By: Johannes Weberhofer (weberho) Date: 2010-08-12 18:04 Message: Adrian, yes, the patches could also be applied to trunk. I have checked the Clean.java code, and am yuite sure, that after exiting the "while (node.is(TagId.P) && noMargins(node))" section, there will alwys be remaining nodes: The paragraphs are striped off, and newLineNodes are added instead. As the while-section is only reached when nodes exist, there must be nodes upon leaving, too. Hope I'm right... ---------------------------------------------------------------------- Comment By: Adrian Sandor (aditsu) Date: 2010-08-12 07:37 Message: Doesn't this also apply to trunk? Anyway, it doesn't affect much.. unless it uncovers bugs; I think the dead code in Clean.java needs some review. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=113153&aid=3038802&group_id=13153 |