Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Tab characters are not removed from single line comment

Open
#1,149 0 comments 2 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
45/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
java
Domain
tooling

Research direction

Reproduce the issue with the supplied Test.java content and google-java-format-1.23.0-all-deps.jar, then compare the formatted output with the cat -T visualization. Trace the formatter path for the single-line comment containing a tab. Done means tabs are removed there as they are in the other shown locations, without changing the expected formatting.

Written by the indexing model from the issue text.

Description

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

Dominant language
Java
Stars
6.2k
Forks
936
Avg merge
6m
Merged PRs (30d)
3

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from google/google-java-format

All issues in google/google-java-format

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.