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

False positives by UnusedVariable on unnamed variables (Java 22) #4451

Closed
ksobolew opened this issue Jun 26, 2024 · 0 comments
Closed

False positives by UnusedVariable on unnamed variables (Java 22) #4451

ksobolew opened this issue Jun 26, 2024 · 0 comments

Comments

@ksobolew
Copy link

Compiling code like this:

var _ = someExpression();

Results in this report from Error Prone (2.28.0):

java: [UnusedVariable] The local variable '' is never read.
    (see https://errorprone.info/bugpattern/UnusedVariable)
  Did you mean to remove this line?

This is a new feature in Java 22, which can be used to deliberately ignore a return value e.g. from methods declared as "must use return value". Note that the UnusedVariable check works fine in this case if the variable is called "ignored" or something like that.

copybara-service bot pushed a commit that referenced this issue Jul 16, 2024
benkard pushed a commit to benkard/jgvariant that referenced this issue Jul 19, 2024
This MR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [com.google.errorprone:error_prone_core](https://errorprone.info) ([source](https://github.com/google/error-prone)) |  | minor | `2.28.0` -> `2.29.2` |
| [com.google.errorprone:error_prone_annotations](https://errorprone.info) ([source](https://github.com/google/error-prone)) | compile | minor | `2.28.0` -> `2.29.2` |

---

### Release Notes

<details>
<summary>google/error-prone</summary>

### [`v2.29.2`](https://github.com/google/error-prone/releases/tag/v2.29.2): Error Prone 2.29.2

[Compare Source](google/error-prone@v2.29.1...v2.29.2)

This release contains all of the changes in [2.29.0](https://github.com/google/error-prone/releases/tag/v2.29.0) and [2.29.1](https://github.com/google/error-prone/releases/tag/v2.29.1), plus:

-   a bug fix for a crash in `TraditionalSwitchExpression` (google/error-prone#4479)
-   restores the `module-info` for the annotations jar, which was accidentally removed (google/error-prone#4480)

Full Changelog: google/error-prone@v2.29.1...v2.29.2

### [`v2.29.1`](https://github.com/google/error-prone/releases/tag/v2.29.1): Error Prone 2.29.1

[Compare Source](google/error-prone@v2.29.0...v2.29.1)

This release contains all of the changes in [2.29.0](https://github.com/google/error-prone/releases/tag/v2.29.0), plus:

-   a bug fix to `UnusedVariable` to handle unnamed `_` variables (google/error-prone#4451)
-   a bug fix for a crash in `SetUnrecognized` (google/error-prone#4475)

Full Changelog: google/error-prone@v2.29.0...v2.29.1

### [`v2.29.0`](https://github.com/google/error-prone/releases/tag/v2.29.0): Error Prone 2.29.0

[Compare Source](google/error-prone@v2.28.0...v2.29.0)

New checks:

-   [`MissingRuntimeRetention`](https://errorprone.info/bugpattern/MissingRuntimeRetention)
-   [`SetUnrecognized`](https://errorprone.info/bugpattern/SetUnrecognized)
-   [`StatementSwitchToExpressionSwitch`](https://errorprone.info/bugpattern/StatementSwitchToExpressionSwitch)

Closed issues: [#&#8203;4318](google/error-prone#4318), [#&#8203;4429](google/error-prone#4429), [#&#8203;4467](google/error-prone#4467)

Full Changelog: google/error-prone@v2.28.0...v2.29.0

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever MR is behind base branch, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this MR and you won't be reminded about these updates again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this MR, check this box

---

This MR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNC4yNC4wIiwidXBkYXRlZEluVmVyIjoiMzQuMjQuMCJ9-->
lqiu96 pushed a commit to googleapis/sdk-platform-java that referenced this issue Jul 23, 2024
… to v2.29.2 (#3059)

[![Mend
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.errorprone:error_prone_annotations](https://errorprone.info)
([source](https://github.com/google/error-prone)) | `2.28.0` ->
`2.29.2` |
[![age](https://developer.mend.io/api/mc/badges/age/maven/com.google.errorprone:error_prone_annotations/2.29.2?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/maven/com.google.errorprone:error_prone_annotations/2.29.2?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/maven/com.google.errorprone:error_prone_annotations/2.28.0/2.29.2?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/maven/com.google.errorprone:error_prone_annotations/2.28.0/2.29.2?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|

---

> [!WARNING]
> Some dependencies could not be looked up. Check the Dependency
Dashboard for more information.

---

### Release Notes

<details>
<summary>google/error-prone
(com.google.errorprone:error_prone_annotations)</summary>

###
[`v2.29.2`](https://github.com/google/error-prone/releases/tag/v2.29.2):
Error Prone 2.29.2

This release contains all of the changes in
[2.29.0](https://github.com/google/error-prone/releases/tag/v2.29.0)
and
[2.29.1](https://github.com/google/error-prone/releases/tag/v2.29.1),
plus:

- a bug fix for a crash in `TraditionalSwitchExpression`
([google/error-prone#4479)
- restores the `module-info` for the annotations jar, which was
accidentally removed
([google/error-prone#4480)

Full Changelog:
google/error-prone@v2.29.1...v2.29.2

###
[`v2.29.1`](https://github.com/google/error-prone/releases/tag/v2.29.1):
Error Prone 2.29.1

This release contains all of the changes in
[2.29.0](https://github.com/google/error-prone/releases/tag/v2.29.0),
plus:

- a bug fix to `UnusedVariable` to handle unnamed `_` variables
([google/error-prone#4451)
- a bug fix for a crash in `SetUnrecognized`
([google/error-prone#4475)

Full Changelog:
google/error-prone@v2.29.0...v2.29.1

###
[`v2.29.0`](https://github.com/google/error-prone/releases/tag/v2.29.0):
Error Prone 2.29.0

[Compare
Source](https://github.com/google/error-prone/compare/v2.28.0...v2.29.0)

New checks:

-
[`MissingRuntimeRetention`](https://errorprone.info/bugpattern/MissingRuntimeRetention)
-
[`SetUnrecognized`](https://errorprone.info/bugpattern/SetUnrecognized)
-
[`StatementSwitchToExpressionSwitch`](https://errorprone.info/bugpattern/StatementSwitchToExpressionSwitch)

Closed issues:
[#&#8203;4318](https://github.com/google/error-prone/issues/4318),
[#&#8203;4429](https://github.com/google/error-prone/issues/4429),
[#&#8203;4467](https://github.com/google/error-prone/issues/4467)

Full Changelog:
google/error-prone@v2.28.0...v2.29.0

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - 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, check
this box

---

This PR was generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View the
[repository job
log](https://developer.mend.io/github/googleapis/sdk-platform-java).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy40MzguMCIsInVwZGF0ZWRJblZlciI6IjM3LjQzOC4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119-->
lqiu96 pushed a commit to googleapis/sdk-platform-java that referenced this issue Jul 23, 2024
… to v2.29.2 (#3058)

[![Mend
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.errorprone:error_prone_annotations](https://errorprone.info)
([source](https://github.com/google/error-prone)) | `2.28.0` ->
`2.29.2` |
[![age](https://developer.mend.io/api/mc/badges/age/maven/com.google.errorprone:error_prone_annotations/2.29.2?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/maven/com.google.errorprone:error_prone_annotations/2.29.2?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/maven/com.google.errorprone:error_prone_annotations/2.28.0/2.29.2?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/maven/com.google.errorprone:error_prone_annotations/2.28.0/2.29.2?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|

---

> [!WARNING]
> Some dependencies could not be looked up. Check the Dependency
Dashboard for more information.

---

### Release Notes

<details>
<summary>google/error-prone
(com.google.errorprone:error_prone_annotations)</summary>

###
[`v2.29.2`](https://github.com/google/error-prone/releases/tag/v2.29.2):
Error Prone 2.29.2

[Compare
Source](https://github.com/google/error-prone/compare/v2.29.1...v2.29.2)

This release contains all of the changes in
[2.29.0](https://github.com/google/error-prone/releases/tag/v2.29.0)
and
[2.29.1](https://github.com/google/error-prone/releases/tag/v2.29.1),
plus:

- a bug fix for a crash in `TraditionalSwitchExpression`
([google/error-prone#4479)
- restores the `module-info` for the annotations jar, which was
accidentally removed
([google/error-prone#4480)

Full Changelog:
google/error-prone@v2.29.1...v2.29.2

###
[`v2.29.1`](https://github.com/google/error-prone/releases/tag/v2.29.1):
Error Prone 2.29.1

[Compare
Source](https://github.com/google/error-prone/compare/v2.29.0...v2.29.1)

This release contains all of the changes in
[2.29.0](https://github.com/google/error-prone/releases/tag/v2.29.0),
plus:

- a bug fix to `UnusedVariable` to handle unnamed `_` variables
([google/error-prone#4451)
- a bug fix for a crash in `SetUnrecognized`
([google/error-prone#4475)

Full Changelog:
google/error-prone@v2.29.0...v2.29.1

###
[`v2.29.0`](https://github.com/google/error-prone/releases/tag/v2.29.0):
Error Prone 2.29.0

[Compare
Source](https://github.com/google/error-prone/compare/v2.28.0...v2.29.0)

New checks:

-
[`MissingRuntimeRetention`](https://errorprone.info/bugpattern/MissingRuntimeRetention)
-
[`SetUnrecognized`](https://errorprone.info/bugpattern/SetUnrecognized)
-
[`StatementSwitchToExpressionSwitch`](https://errorprone.info/bugpattern/StatementSwitchToExpressionSwitch)

Closed issues:
[#&#8203;4318](https://github.com/google/error-prone/issues/4318),
[#&#8203;4429](https://github.com/google/error-prone/issues/4429),
[#&#8203;4467](https://github.com/google/error-prone/issues/4467)

Full Changelog:
google/error-prone@v2.28.0...v2.29.0

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - 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, check
this box

---

This PR was generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View the
[repository job
log](https://developer.mend.io/github/googleapis/sdk-platform-java).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy40MzguMCIsInVwZGF0ZWRJblZlciI6IjM3LjQzOC4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119-->
github-merge-queue bot pushed a commit to camunda/camunda that referenced this issue Jul 30, 2024
… to v2.29.2 (main) (#20292)

[![Mend
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.errorprone:error_prone_annotations](https://errorprone.info)
([source](https://github.com/google/error-prone)) | `2.28.0` ->
`2.29.2` |
[![age](https://developer.mend.io/api/mc/badges/age/maven/com.google.errorprone:error_prone_annotations/2.29.2?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/maven/com.google.errorprone:error_prone_annotations/2.29.2?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/maven/com.google.errorprone:error_prone_annotations/2.28.0/2.29.2?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/maven/com.google.errorprone:error_prone_annotations/2.28.0/2.29.2?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|

---

### Release Notes

<details>
<summary>google/error-prone
(com.google.errorprone:error_prone_annotations)</summary>

###
[`v2.29.2`](https://github.com/google/error-prone/releases/tag/v2.29.2):
Error Prone 2.29.2

[Compare
Source](https://github.com/google/error-prone/compare/v2.29.1...v2.29.2)

This release contains all of the changes in
[2.29.0](https://github.com/google/error-prone/releases/tag/v2.29.0)
and
[2.29.1](https://github.com/google/error-prone/releases/tag/v2.29.1),
plus:

- a bug fix for a crash in `TraditionalSwitchExpression`
([google/error-prone#4479)
- restores the `module-info` for the annotations jar, which was
accidentally removed
([google/error-prone#4480)

Full Changelog:
google/error-prone@v2.29.1...v2.29.2

###
[`v2.29.1`](https://github.com/google/error-prone/releases/tag/v2.29.1):
Error Prone 2.29.1

[Compare
Source](https://github.com/google/error-prone/compare/v2.29.0...v2.29.1)

This release contains all of the changes in
[2.29.0](https://github.com/google/error-prone/releases/tag/v2.29.0),
plus:

- a bug fix to `UnusedVariable` to handle unnamed `_` variables
([google/error-prone#4451)
- a bug fix for a crash in `SetUnrecognized`
([google/error-prone#4475)

Full Changelog:
google/error-prone@v2.29.0...v2.29.1

###
[`v2.29.0`](https://github.com/google/error-prone/releases/tag/v2.29.0):
Error Prone 2.29.0

[Compare
Source](https://github.com/google/error-prone/compare/v2.28.0...v2.29.0)

New checks:

-
[`MissingRuntimeRetention`](https://errorprone.info/bugpattern/MissingRuntimeRetention)
-
[`SetUnrecognized`](https://errorprone.info/bugpattern/SetUnrecognized)
-
[`StatementSwitchToExpressionSwitch`](https://errorprone.info/bugpattern/StatementSwitchToExpressionSwitch)

Closed issues:
[#&#8203;4318](https://github.com/google/error-prone/issues/4318),
[#&#8203;4429](https://github.com/google/error-prone/issues/4429),
[#&#8203;4467](https://github.com/google/error-prone/issues/4467)

Full Changelog:
google/error-prone@v2.28.0...v2.29.0

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Enabled.

♻ **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, check
this box

---

This PR was generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View the
[repository job log](https://developer.mend.io/github/camunda/camunda).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy40MzEuNCIsInVwZGF0ZWRJblZlciI6IjM3LjQ0MC43IiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJhdXRvbWVyZ2UiXX0=-->
github-merge-queue bot pushed a commit to camunda/camunda that referenced this issue Jul 30, 2024
… to v2.29.2 (main) (#20292)

[![Mend
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.errorprone:error_prone_annotations](https://errorprone.info)
([source](https://github.com/google/error-prone)) | `2.28.0` ->
`2.29.2` |
[![age](https://developer.mend.io/api/mc/badges/age/maven/com.google.errorprone:error_prone_annotations/2.29.2?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/maven/com.google.errorprone:error_prone_annotations/2.29.2?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/maven/com.google.errorprone:error_prone_annotations/2.28.0/2.29.2?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/maven/com.google.errorprone:error_prone_annotations/2.28.0/2.29.2?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|

---

### Release Notes

<details>
<summary>google/error-prone
(com.google.errorprone:error_prone_annotations)</summary>

###
[`v2.29.2`](https://github.com/google/error-prone/releases/tag/v2.29.2):
Error Prone 2.29.2

[Compare
Source](https://github.com/google/error-prone/compare/v2.29.1...v2.29.2)

This release contains all of the changes in
[2.29.0](https://github.com/google/error-prone/releases/tag/v2.29.0)
and
[2.29.1](https://github.com/google/error-prone/releases/tag/v2.29.1),
plus:

- a bug fix for a crash in `TraditionalSwitchExpression`
([google/error-prone#4479)
- restores the `module-info` for the annotations jar, which was
accidentally removed
([google/error-prone#4480)

Full Changelog:
google/error-prone@v2.29.1...v2.29.2

###
[`v2.29.1`](https://github.com/google/error-prone/releases/tag/v2.29.1):
Error Prone 2.29.1

[Compare
Source](https://github.com/google/error-prone/compare/v2.29.0...v2.29.1)

This release contains all of the changes in
[2.29.0](https://github.com/google/error-prone/releases/tag/v2.29.0),
plus:

- a bug fix to `UnusedVariable` to handle unnamed `_` variables
([google/error-prone#4451)
- a bug fix for a crash in `SetUnrecognized`
([google/error-prone#4475)

Full Changelog:
google/error-prone@v2.29.0...v2.29.1

###
[`v2.29.0`](https://github.com/google/error-prone/releases/tag/v2.29.0):
Error Prone 2.29.0

[Compare
Source](https://github.com/google/error-prone/compare/v2.28.0...v2.29.0)

New checks:

-
[`MissingRuntimeRetention`](https://errorprone.info/bugpattern/MissingRuntimeRetention)
-
[`SetUnrecognized`](https://errorprone.info/bugpattern/SetUnrecognized)
-
[`StatementSwitchToExpressionSwitch`](https://errorprone.info/bugpattern/StatementSwitchToExpressionSwitch)

Closed issues:
[#&#8203;4318](https://github.com/google/error-prone/issues/4318),
[#&#8203;4429](https://github.com/google/error-prone/issues/4429),
[#&#8203;4467](https://github.com/google/error-prone/issues/4467)

Full Changelog:
google/error-prone@v2.28.0...v2.29.0

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Enabled.

♻ **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, check
this box

---

This PR was generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View the
[repository job log](https://developer.mend.io/github/camunda/camunda).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy40MzEuNCIsInVwZGF0ZWRJblZlciI6IjM3LjQ0MC43IiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJhdXRvbWVyZ2UiXX0=-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant