regression of issue #1008 on idea-plugin
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 45/100
Research direction
No repository file or test is named. Start by reproducing the Java 21 switch example with idea-plugin 1.27.0 and compare its formatting with the CLI; done when the plugin handles case null, default consistently with the CLI without requiring the workaround.
Written by the indexing model from the issue text.
Description
Previously, when Issue #1008 was reported, it was resolved.
However, with the recent update to the idea-plugin to version 1.27.0, this issue resurfaced.
This piece of code:
switch (value) {
case 0 -> "it was 0";
case 1 -> "it was 1";
case 2 -> "it was 2";
case null, default -> "unexpected value";
};
Works fine with the CLI version of google-java-formatter, but will fail for the idea-plugin version of google-java-formatter.
The only solution is to revert the above switch pattern into
case null -> "null value";
default -> "unexpected value";
A simple class to allow easy testing of this
public class Test {
public static void main(String[] args) {
Object obj = null; // or some other object
String result = switch (obj) {
case null, default -> "handled";
};
System.out.println(result);
}
}
JDK Used: https://adoptium.net/en-GB/temurin/releases/?version=21
- Dominant language
- Java
- Stars
- 6.2k
- Forks
- 936
- Avg merge
- 6m
- Merged PRs (30d)
- 5
Getting set up
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from google/google-java-format
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
google/google-java-format#1094 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 55/100
google/google-java-format#1439 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 3/5 1-2 days Newbie friendliness 62/100
google/google-java-format#1436 · 2 comments ·
Maintainers usually reply within 1 day
-
Eclipse
Difficulty 3/5 1-2 days Newbie friendliness 48/100
google/google-java-format#1428 · 4 comments ·
Maintainers usually reply within 1 day
-
Eclipse
Difficulty 3/5 1-2 days Newbie friendliness 55/100
google/google-java-format#1417 ·
Maintainers usually reply within 1 day
All issues in google/google-java-format
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
bisq-network/bisq#8097 ·
Maintainers usually reply within 1 day
-
area/frontend good first issue kind/cooldown
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
apache/datasketches-java#773 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 92/100
cpinitiative/usaco-guide#6665 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
trinodb/trino-gateway#1301 ·
Maintainers usually reply within 1 day