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

Close

#22 JTidyPrintWriter fails to parse columns

closed-fixed
None
5
2001-12-12
2001-12-12
Thomas Kalka
No

JTidy reports column numbers > 999 with a dot in the
number (i.e 1.234) which causes parseInt in
JTidyPrintWriter.print(String) to fail

this patch will work for number up to 999999

JTidyPrintWriter.print(String)

...
// get line
String line = tok.nextToken();
int pdot = line.indexOf(".");
if (pdot == 0) line = line.substring(1);
if (pdot> 0) line = line.substring(0,pdot)
+ line.substring(pdot+1);
_line = Integer.parseInt(line);
// skip second "column"
tok.nextToken();
// get column
String column = tok.nextToken();
pdot = column.indexOf(".");
if (pdot == 0) column = column.substring
(1);
if (pdot> 0) column = column.substring
(0,pdot) + column.substring(pdot+1);
_column = Integer.parseInt(column);
...

Discussion

  • Russell Gold
    Russell Gold
    2001-12-12

    • assigned_to: nobody --> benoitx
     
  • Russell Gold
    Russell Gold
    2001-12-12

    • status: open --> closed-fixed
     
  • Russell Gold
    Russell Gold
    2001-12-12

    Logged In: YES
    user_id=37920

    The change is now in cvs and will be in the next build