Skip to content

Tab characters are not removed from single line comment #1149

Open
@romani

Description

@romani

content with tab:

public class Test {
  /**
   * The client's first name.
   *
   * @serialField serial String some test some testsome testsome testsome testsome testsome test
   * 			Path components separated by separator loooooooooooooooonooooooooooooooooooooog.
   */
  public String	thirdName;
  // here is tab 	.
  private serial	serial;
}

visualization of tabs and formatting:

$ cat -A Test.java 
public class Test {$
  /**$
   * The client's first name.$
   *$
   * @serialField serial String some test some testsome testsome testsome testsome testsome test$
   * ^I^I^IPath components separated by separator loooooooooooooooonooooooooooooooooooooog.$
   */$
  public String^IthirdName;$
  // here is tab ^I.$
  private serial^Iserial;$
}$


$ java -jar google-java-format-1.23.0-all-deps.jar Test.java > TestUpdated.java

$ cat -T TestUpdated.java 
public class Test {
  /**
   * The client's first name.
   *
   * @serialField serial String some test some testsome testsome testsome testsome testsome test
   *     Path components separated by separator loooooooooooooooonooooooooooooooooooooog.
   */
  public String thirdName;

  // here is tab ^I.
  private serial serial;
}

all tabs are removed except for singleline comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions