Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix indentation of case statements on JDK 17 #654

Merged
merged 1 commit into from Aug 25, 2021

Conversation

copybara-service[bot]
Copy link

Fix indentation of case statements on JDK 17

Fixes #643

@google-cla google-cla bot added the cla: yes label Aug 25, 2021
Fixes #643

PiperOrigin-RevId: 392966720
@copybara-service copybara-service bot merged commit 79257ed into master Aug 25, 2021
@copybara-service copybara-service bot deleted the test_392567001 branch August 25, 2021 20:26
gcf-merge-on-green bot pushed a commit to googleapis/google-oauth-java-client that referenced this pull request Oct 26, 2021
…a-format to v1.12.0 (#763)

[![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [com.google.googlejavaformat:google-java-format](https://togithub.com/google/google-java-format) | `1.7` -> `1.12.0` | [![age](https://badges.renovateapi.com/packages/maven/com.google.googlejavaformat:google-java-format/1.12.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.googlejavaformat:google-java-format/1.12.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.googlejavaformat:google-java-format/1.12.0/compatibility-slim/1.7)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.googlejavaformat:google-java-format/1.12.0/confidence-slim/1.7)](https://docs.renovatebot.com/merge-confidence/) |

---

### Release Notes

<details>
<summary>google/google-java-format</summary>

### [`v1.12.0`](https://togithub.com/google/google-java-format/releases/v1.12.0)

[Compare Source](https://togithub.com/google/google-java-format/compare/v1.11.0...v1.12.0)

#### What's Changed

-   Format type annotation as part of the type, not part of the modifiers list ([google/google-java-format#653)
-   Fix indentation of case statements on JDK 17 ([google/google-java-format#654)

**Full Changelog**: google/google-java-format@v1.11.0...v1.12.0

### [`v1.11.0`](https://togithub.com/google/google-java-format/releases/v1.11.0)

[Compare Source](https://togithub.com/google/google-java-format/compare/v1.10.0...v1.11.0)

`google-java-format` now has improved support for running on JDK 17 early access builds.

Changes:

-   Handle `final` variables in `instanceof` patterns ([#&#8203;588](https://togithub.com/google/google-java-format/issues/588))
-   Fix handling of annotations in compact record constructors ([#&#8203;574](https://togithub.com/google/google-java-format/issues/574))
-   Fix a crash in `instanceof` pattern handling ([#&#8203;594](https://togithub.com/google/google-java-format/issues/594))
-   Wrap multiple values in switch expression case ([#&#8203;540](https://togithub.com/google/google-java-format/issues/540))
-   Fix formatting of module trees after [JDK-8255464](https://bugs.openjdk.java.net/browse/JDK-8255464)
-   Support `sealed` classes ([#&#8203;603](https://togithub.com/google/google-java-format/issues/603))

### [`v1.10.0`](https://togithub.com/google/google-java-format/releases/v1.10.0)

`google-java-format` now supports running on JDK 16. The following flags are required when running on JDK 16, due to [JEP 396: Strongly Encapsulate JDK Internals by Default](https://openjdk.java.net/jeps/396):

    java \
      --add-exports jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED \
      --add-exports jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED \
      --add-exports jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED \
      --add-exports jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED \
      --add-exports jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED \
      -jar google-java-format-1.10.0-all-deps.jar T...

Other changes:

-   Handle extra `;` in import lists (google/google-java-format@b769e81)
-   Add missing space between unary `-` and negative literals (google/google-java-format@6da736d)
-   Fix an off-by-one issue on the reflowing of string literals (google/google-java-format@b9fd8d2)

</details>

---

### Configuration

📅 **Schedule**: At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, click this checkbox.

---

This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/google-oauth-java-client).
gcf-merge-on-green bot pushed a commit to googleapis/google-cloud-java that referenced this pull request Nov 15, 2021
…a-format to v1.12.0 (#7719)

[![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [com.google.googlejavaformat:google-java-format](https://togithub.com/google/google-java-format) | `1.11.0` -> `1.12.0` | [![age](https://badges.renovateapi.com/packages/maven/com.google.googlejavaformat:google-java-format/1.12.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.googlejavaformat:google-java-format/1.12.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.googlejavaformat:google-java-format/1.12.0/compatibility-slim/1.11.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.googlejavaformat:google-java-format/1.12.0/confidence-slim/1.11.0)](https://docs.renovatebot.com/merge-confidence/) |

---

### Release Notes

<details>
<summary>google/google-java-format</summary>

### [`v1.12.0`](https://togithub.com/google/google-java-format/releases/v1.12.0)

[Compare Source](https://togithub.com/google/google-java-format/compare/v1.11.0...v1.12.0)

##### What's Changed

-   Format type annotation as part of the type, not part of the modifiers list ([google/google-java-format#653)
-   Fix indentation of case statements on JDK 17 ([google/google-java-format#654)

**Full Changelog**: google/google-java-format@v1.11.0...v1.12.0

</details>

---

### Configuration

📅 **Schedule**: At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, click this checkbox.

---

This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/google-cloud-java).
gcf-merge-on-green bot pushed a commit to googleapis/google-auth-library-java that referenced this pull request Nov 17, 2021
)

[![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [com.google.googlejavaformat:google-java-format](https://togithub.com/google/google-java-format) | `1.7` -> `1.12.0` | [![age](https://badges.renovateapi.com/packages/maven/com.google.googlejavaformat:google-java-format/1.12.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.googlejavaformat:google-java-format/1.12.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.googlejavaformat:google-java-format/1.12.0/compatibility-slim/1.7)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.googlejavaformat:google-java-format/1.12.0/confidence-slim/1.7)](https://docs.renovatebot.com/merge-confidence/) |

---

### Release Notes

<details>
<summary>google/google-java-format</summary>

### [`v1.12.0`](https://togithub.com/google/google-java-format/releases/v1.12.0)

[Compare Source](https://togithub.com/google/google-java-format/compare/v1.11.0...v1.12.0)

##### What's Changed

-   Format type annotation as part of the type, not part of the modifiers list ([google/google-java-format#653)
-   Fix indentation of case statements on JDK 17 ([google/google-java-format#654)

**Full Changelog**: google/google-java-format@v1.11.0...v1.12.0

### [`v1.11.0`](https://togithub.com/google/google-java-format/releases/v1.11.0)

[Compare Source](https://togithub.com/google/google-java-format/compare/v1.10.0...v1.11.0)

`google-java-format` now has improved support for running on JDK 17 early access builds.

Changes:

-   Handle `final` variables in `instanceof` patterns ([#&#8203;588](https://togithub.com/google/google-java-format/issues/588))
-   Fix handling of annotations in compact record constructors ([#&#8203;574](https://togithub.com/google/google-java-format/issues/574))
-   Fix a crash in `instanceof` pattern handling ([#&#8203;594](https://togithub.com/google/google-java-format/issues/594))
-   Wrap multiple values in switch expression case ([#&#8203;540](https://togithub.com/google/google-java-format/issues/540))
-   Fix formatting of module trees after [JDK-8255464](https://bugs.openjdk.java.net/browse/JDK-8255464)
-   Support `sealed` classes ([#&#8203;603](https://togithub.com/google/google-java-format/issues/603))

### [`v1.10.0`](https://togithub.com/google/google-java-format/releases/v1.10.0)

`google-java-format` now supports running on JDK 16. The following flags are required when running on JDK 16, due to [JEP 396: Strongly Encapsulate JDK Internals by Default](https://openjdk.java.net/jeps/396):

    java \
      --add-exports jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED \
      --add-exports jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED \
      --add-exports jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED \
      --add-exports jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED \
      --add-exports jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED \
      -jar google-java-format-1.10.0-all-deps.jar T...

Other changes:

-   Handle extra `;` in import lists (google/google-java-format@b769e81)
-   Add missing space between unary `-` and negative literals (google/google-java-format@6da736d)
-   Fix an off-by-one issue on the reflowing of string literals (google/google-java-format@b9fd8d2)

</details>

---

### Configuration

📅 **Schedule**: At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Renovate will not automatically rebase this PR, because other commits have been found.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, click this checkbox.

---

This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/google-auth-library-java).
gcf-merge-on-green bot pushed a commit to googleapis/google-http-java-client that referenced this pull request Nov 17, 2021
[![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [com.google.googlejavaformat:google-java-format](https://togithub.com/google/google-java-format) | `1.7` -> `1.12.0` | [![age](https://badges.renovateapi.com/packages/maven/com.google.googlejavaformat:google-java-format/1.12.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.googlejavaformat:google-java-format/1.12.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.googlejavaformat:google-java-format/1.12.0/compatibility-slim/1.7)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.googlejavaformat:google-java-format/1.12.0/confidence-slim/1.7)](https://docs.renovatebot.com/merge-confidence/) |

---

### Release Notes

<details>
<summary>google/google-java-format</summary>

### [`v1.12.0`](https://togithub.com/google/google-java-format/releases/v1.12.0)

[Compare Source](https://togithub.com/google/google-java-format/compare/v1.11.0...v1.12.0)

##### What's Changed

-   Format type annotation as part of the type, not part of the modifiers list ([google/google-java-format#653)
-   Fix indentation of case statements on JDK 17 ([google/google-java-format#654)

**Full Changelog**: google/google-java-format@v1.11.0...v1.12.0

### [`v1.11.0`](https://togithub.com/google/google-java-format/releases/v1.11.0)

[Compare Source](https://togithub.com/google/google-java-format/compare/v1.10.0...v1.11.0)

`google-java-format` now has improved support for running on JDK 17 early access builds.

Changes:

-   Handle `final` variables in `instanceof` patterns ([#&#8203;588](https://togithub.com/google/google-java-format/issues/588))
-   Fix handling of annotations in compact record constructors ([#&#8203;574](https://togithub.com/google/google-java-format/issues/574))
-   Fix a crash in `instanceof` pattern handling ([#&#8203;594](https://togithub.com/google/google-java-format/issues/594))
-   Wrap multiple values in switch expression case ([#&#8203;540](https://togithub.com/google/google-java-format/issues/540))
-   Fix formatting of module trees after [JDK-8255464](https://bugs.openjdk.java.net/browse/JDK-8255464)
-   Support `sealed` classes ([#&#8203;603](https://togithub.com/google/google-java-format/issues/603))

### [`v1.10.0`](https://togithub.com/google/google-java-format/releases/v1.10.0)

`google-java-format` now supports running on JDK 16. The following flags are required when running on JDK 16, due to [JEP 396: Strongly Encapsulate JDK Internals by Default](https://openjdk.java.net/jeps/396):

    java \
      --add-exports jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED \
      --add-exports jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED \
      --add-exports jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED \
      --add-exports jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED \
      --add-exports jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED \
      -jar google-java-format-1.10.0-all-deps.jar T...

Other changes:

-   Handle extra `;` in import lists (google/google-java-format@b769e81)
-   Add missing space between unary `-` and negative literals (google/google-java-format@6da736d)
-   Fix an off-by-one issue on the reflowing of string literals (google/google-java-format@b9fd8d2)

</details>

---

### Configuration

📅 **Schedule**: At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, click this checkbox.

---

This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/google-http-java-client).
copybara-service bot pushed a commit that referenced this pull request Feb 4, 2022
Since the last plugin update was almost half a year ago, I thought it would be prudent to update it and resolve most of the issues regarding updating the plugin.

It took around half an hour once I managed to correctly set up the module due to the gradle plugin version 1.2.1 + intellij version 2020.3 requiring java 11 to develop.

All of the included annotation changes were requested by IntelliJ to add since the overrides added them as well.

The change of `<? extends TextRange>` to `<TextRange>` was to resolve the syntax errors introduced by a change removing the wildcard requirement.

NotificationGroup was deprecated and moved into the plugin xml file as per the SDK docs
The same was required for `StdFileTypes.JAVA` being deprecated with the fix being `JavaFileType.INSTANCE` + changing the depend module to add that fix.

I had to change the project SDK to JDK 11 on my end to have the gradle build work.

I also tested the plugin with 1.12 and 1.10 on some test files such as from #653 and #654. Would be good to have some double checking though because I've had issues trying to get the test file reformatted in #558 working. Probably because it's locked behind an experimental flag?

Fixes #688

COPYBARA_INTEGRATE_REVIEW=#688 from ze:idea-1.12.0 53f216c
PiperOrigin-RevId: 426491735
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Indentation level difference after case between Java 11 and 17
1 participant