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

Unclear error messages for invisible whitespace

Open
#954 0 comments 0 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
38/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
java
Domain
tooling

Research direction

Run the supplied Main.java reproducer with google-java-format 1.17.0 and inspect the formatter's parsing and diagnostic path for the zero-width space after println. Done means the formatter reports an understandable error that identifies the invisible character or its location, with coverage for this reproducer.

Written by the indexing model from the issue text.

Description

IntelliJ

The following program with a zero width space after the println is executable but cannot not be formatted

public class Main {
    public static void main(String[] args) {
        System.out.println​("hello");
    }
}
% java -version
openjdk version "19.0.1" 2022-10-18
OpenJDK Runtime Environment Zulu19.30+11-CA (build 19.0.1+10)
OpenJDK 64-Bit Server VM Zulu19.30+11-CA (build 19.0.1+10, mixed mode, sharing)
% javac Main.java
% java Main
hello
% google-java-format --version
google-java-format: Version 1.17.0
% google-java-format Main.java
Main.java:3:10: error: expected token: 'println'; generated println instead
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.