Menu

#32 DebugAlignWriter.cleanComment() cleans not only comments

v1.0_(example)
open-accepted
5
2009-11-15
2003-11-01
No

when a string literal contains '//' (e.g. URIs), the line
gets garbled:

"http://asdasdasd" ----> "http:

this is because cleanComment does not check
whether '//' is contained in string literal or not:

String cleanComment(String line)
{
int comment = line.indexOf("//");

if (comment == -1)
return line;

if (comment == 0 || line.trim
().startsWith("//"))
return "";

return line.substring(0, comment);
}

Discussion

  • Johann Gyger

    Johann Gyger - 2009-11-15
    • assigned_to: nobody --> jgyger
    • status: open --> open-accepted
     
  • Johann Gyger

    Johann Gyger - 2009-11-15

    Probably still an issue... I have to retest this.

     

Log in to post a comment.

Auth0 Logo