google / google/google-java-format

Unclear error messages for invisible whitespace

Ouverte
#954 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub
IntelliJ
Langage dominant
Java
Étoiles
6.2k
Forks
937
Merge moyen
6 min
PR mergées (30 j)
3

Description

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
```

Guide de contribution

Ouvrir le guide de contribution

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.