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

Upgrade to v2.27.0 #86

Merged
merged 151 commits into from
Apr 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
151 commits
Select commit Hold shift + click to select a range
31cc82f
Add parens to avoid generating `!this == obj`.
cpovirk Oct 19, 2023
1b41065
Improve OperatorPrecedence docs
cushon Oct 19, 2023
fb06f25
Extend `SuperEqualsIsObjectEquals` to cover `hashCode`, renaming it t…
cpovirk Oct 19, 2023
747227a
Fix typos.
cpovirk Oct 19, 2023
661a915
JUnit4TestNotRun: add a heuristic that if the name contains underscor…
graememorgan Oct 24, 2023
c57fd56
Update Checker Framework dataflow and dependencies
cushon Oct 25, 2023
bc4b01b
Add more Guava types to ModifiedButNotUsed.
graememorgan Oct 26, 2023
5152f11
Drop the period from the MemberName diagnostic, given we're concatena…
graememorgan Oct 26, 2023
1991070
Typo fixed in ClosingStandardOutputStreams.md
khalid586 Oct 30, 2023
a63bf9f
PUBLIC: Add a test demonstrating b/308614050 (bug with parameter cast…
kluever Nov 1, 2023
bd43f40
UnnecessaryBoxedAssignment: avoid CCE on method reference
Stephan202 Nov 2, 2023
c83ba54
ASTHelpersSuggestions: don't suggest ASTHelpers inside ASTHelpers
cushon Nov 2, 2023
09a9aa6
Include some more attractive-nuisance runners in TestParametersNotIni…
graememorgan Nov 3, 2023
99bfc0b
Update `NullnessAnnotation`s API to use annotation mirrors and trees …
cushon Nov 3, 2023
5123cd5
Handle annotations on inner types in `MoreAnnotations.getDeclarationA…
cushon Nov 4, 2023
93770e3
No-op tidying of TruthSelfEquals before I start altering it.
graememorgan Nov 6, 2023
af227ac
Remove an unnecessary suppression
cushon Nov 7, 2023
0149a77
Improve AnnotationPosition diagnostics to only mention the annotation…
cushon Nov 7, 2023
18d5cdf
Discourage all nullness annotations in `NullablePrimitive` and `Nulla…
cushon Nov 7, 2023
46122d1
Use `SuppressibleTreePathScanner` instead of rolling our own.
cpovirk Nov 7, 2023
29f4602
Discourage nullness annotations on wildcards and type parameters them…
cushon Nov 7, 2023
dfba048
Discourage multiple nullness annotations
cushon Nov 7, 2023
962f5d1
Loosen the restrictions in TruthSelfEquals to allow anything called `…
graememorgan Nov 8, 2023
6eaf51d
Handle `containsExactlyElementsIn`, etc in TruthSelfEquals.
graememorgan Nov 8, 2023
5ce8792
Fix `BugChecker.isSuppressed` to actually look only at the current tree.
cpovirk Nov 8, 2023
492b882
Move the AlmostJavadoc finding to point at the Javadoc.
graememorgan Nov 9, 2023
5854742
Prefer the Immutable graph types over the interfaces.
graememorgan Nov 10, 2023
58aa646
Complain about `@param foo: blah`.
graememorgan Nov 10, 2023
67b339b
Introduce ConstantExpressions to TruthSelfEquals, which lets us catch…
graememorgan Nov 13, 2023
5c5d9ab
Correct my claims about Kotlin's handling of annotations on wildcards.
cpovirk Nov 14, 2023
0b70afc
Remove the EqualsTester fix from TruthSelfEquals.
graememorgan Nov 16, 2023
aa6e3e7
Update `ASTHelpers.hasDirectAnnotationWithSimpleName` to handle `TYPE…
cushon Nov 16, 2023
7684e85
Remove stray parens.
cpovirk Nov 17, 2023
b0b0b67
Remove the underscore heuristic flag.
graememorgan Nov 20, 2023
6a23848
TruthSelfEquals: handle junit assertions
graememorgan Nov 20, 2023
88a224c
UnusedVariable: flag parameters in _effectively_ private methods, not…
graememorgan Nov 21, 2023
83d2ed5
Rip out the `ThreadSafeChecker:CheckElementUsage` flag.
graememorgan Nov 23, 2023
5395af4
Don't peer at the identifiers on the LHS of assignments in AlreadyChe…
graememorgan Nov 24, 2023
7acf133
Update dataflow version
cushon Nov 27, 2023
4be12bc
Check specific functional interface types (which would otherwise be u…
graememorgan Dec 4, 2023
e5df30c
Fix a typo in the "Finally" bugpattern docs.
java-team-github-bot Dec 5, 2023
336323a
Import eisop/checker-framework from GitHub.
cushon Dec 7, 2023
ac52ca9
AutoValueFinalMethods: support method-level suppression.
graememorgan Dec 8, 2023
aadfdc3
WellKnownThreadSafety: Add common PKIX types to known thread-safe list.
java-team-github-bot Dec 8, 2023
d78dd6d
Don't report NonFinalStaticField findings for fields modified in `@Be…
cushon Dec 14, 2023
affa37a
Do not flag unused parameters on _abstract_ methods.
graememorgan Dec 14, 2023
da7be27
Descend into VariableTrees when looking for variables to check.
graememorgan Dec 14, 2023
654d1db
Handle Joiner.on(...) in AbstractToString.
graememorgan Dec 15, 2023
d272dfa
Automated rollback of commit 654d1dbf1e6dd652cd6e8ca003643ddf02266ec2.
graememorgan Dec 15, 2023
21c190a
Document that javadoc shouldn't appear between annotations and the do…
cushon Dec 18, 2023
5fa727a
Actually test that `hasExtraParameterForEnclosingInstance` works.
cpovirk Dec 28, 2023
63cf192
Update `CanIgnoreReturnValueSuggester` summary.
kluever Dec 29, 2023
fd21bc9
Reflow a comment that didn't appreciate being formatted in unknown co…
graememorgan Jan 2, 2024
58a9e80
Update a few checks (and a class of tests, with AbstractToString) to …
graememorgan Jan 3, 2024
2bd7859
Add an assertion to try to help debug https://github.com/google/error…
cushon Jan 3, 2024
4ef5e53
Add a tests for Dagger `Component.Builder`s and `Subcomponent.Builder…
kluever Jan 3, 2024
25b8dc2
Don't fire `CanIgnoreReturnValueSuggester` on Dagger `@Component.Buil…
kluever Jan 3, 2024
cb1dc06
Treat Dagger `@Component.Builder` and `@Subcomponent.Builder` setter …
kluever Jan 3, 2024
d7de122
Improve fixes for `StatementSwitchToExpressionSwitch`
cushon Jan 4, 2024
34141a8
Deprecate withSignature
cushon Jan 4, 2024
db3e9ad
Update dagger version
cushon Jan 5, 2024
654b1d9
Bump deps.
cpovirk Jan 5, 2024
43e3bd1
Introduce JUnitIncompatibleType, a JUnit analogue of TruthIncompatibl…
graememorgan Jan 8, 2024
817b442
Don't fire CanIgnoreReturnValueSuggester on overrides in anonymous me…
graememorgan Jan 11, 2024
5a68588
Remove incorrect statement from BugPattern index doc
elkkhan Jan 11, 2024
bd0ba3f
Add support for specifying badEnclosingTypes for `BadImport` via flags
hisener Jan 12, 2024
2cbed19
Generalise ProtoRedundantSet to handle autovalues too.
graememorgan Jan 17, 2024
4165ecd
Do not report `NonFinalStaticField` findings for fields modified in `…
hisener Jan 22, 2024
0be7a89
Work around a javac end position bug for empty statements
cushon Jan 25, 2024
417b935
Resolve a couple of lingering @ResultIgnorabilityUnspecified in EP.
graememorgan Jan 26, 2024
7d1ae83
Fix a crash in `UnnecessaryStringBuilder`
graememorgan Jan 26, 2024
6a75fc1
Optionally recommend against static import of `Truth8.assertThat`.
cpovirk Jan 26, 2024
ec9d69a
Add more documentation for LenientFormatStringValidation
cushon Jan 27, 2024
95e66ac
Exempt methods annotated with @StartBundle or @FinishBundle since the…
java-team-github-bot Jan 29, 2024
f5df283
Update Truth version
cushon Jan 30, 2024
e45f6b7
Automatic code cleanup.
cpovirk Jan 30, 2024
e6e2706
Automatic code cleanup.
cpovirk Jan 30, 2024
4eb812d
Migrate usages of `Truth8.assertThat` to equivalent usages of `Truth.…
cpovirk Jan 31, 2024
d7cc8bb
Add some known thread safe types to[]
chaoren Feb 1, 2024
e5a6d0d
Return the "real" `Symbol` instead of sometimes a `Symbol` whose `own…
cpovirk Feb 1, 2024
20562d0
Remove references to `-XepOpt:Android:Java8Libs`
cushon Feb 3, 2024
41fbd95
bump Github workflow actions to latest version
deining Dec 22, 2023
a36ed6f
Update Truth to [1.4.0](https://github.com/google/truth/releases/tag/…
cpovirk Feb 5, 2024
618d488
Add another AndroidJdkLibsChecker regression test
cushon Feb 5, 2024
5f20325
Fix typos
deining Feb 6, 2024
0bd7432
Rollforward of https://github.com/google/error-prone/commit/654d1dbf1…
graememorgan Feb 6, 2024
3ff139f
Automatic code cleanup.
cpovirk Feb 7, 2024
68badf0
ErrorProne: Update TestParameterInjector version
java-team-github-bot Feb 7, 2024
b799927
Automatic code cleanup.
java-team-github-bot Feb 8, 2024
32312a2
Update Android API diff
cushon Feb 12, 2024
a1f4fa7
Drop diagnostics that are reported inside ErrorProneTokens
cushon Feb 14, 2024
4f060e1
Add a test case demonstrating a `CanIgnoreReturnValueSuggester` bug.
kluever Feb 14, 2024
ae3a19f
Add some known thread safe types to[]
java-team-github-bot Feb 14, 2024
404a34b
Add a check for comparing `System.console()` to null
cushon Feb 20, 2024
1eda7f8
ErrorProne check to flag calls to Enum.ordinal().
java-team-github-bot Feb 21, 2024
2afe510
Add an `@Ignore`d unit test for a JUnitIncompatibleType CCE
cushon Feb 21, 2024
19a0731
Internal change.
cushon Feb 21, 2024
0565b72
ModifiedButNotUsed: exempt unused-prefixes.
graememorgan Feb 22, 2024
3108612
Some small behavior-preserving refactoring of CanIgnoreReturnValueSug…
nick-someone Feb 22, 2024
e3725d2
Stop suggesting `@CanIgnoreReturnValue` on Builder methods that retur…
nick-someone Feb 22, 2024
f768b0b
Fix handling of default cases in arrow switches
cushon Feb 22, 2024
f3dbb09
Move the EnumOrdinal.md doc to the right place (it got overwritten by…
graememorgan Feb 23, 2024
297019c
Fix some mistakes in the EnumOrdinal examples
Stephan202 Feb 26, 2024
af37d35
ImpossibleNullComparison: emit empty fixes.
graememorgan Feb 26, 2024
ad513d5
Recommend using `var` for `var unused = ...;` and `var thrown = asser…
kluever Feb 26, 2024
3292632
Increase year range on `Date` usages.
kluever Mar 5, 2024
9da2d55
Ignore disabled checks passed to `-XepPatchChecks`
oxkitsune Mar 5, 2024
0e95364
feat: add jpms definition for `annotations`
sgammon Mar 8, 2024
ea5ef6d
Add the 'compile' goal for 'compile-java9'
cushon Mar 9, 2024
9d99ee7
fix: module name → `com.google.errorprone.annotations`
sgammon Mar 12, 2024
1d99484
Initial implementation of a check for class initialization deadlocks
cushon Mar 13, 2024
1b576a7
Don't check interfaces for class initialization cycles
cushon Mar 14, 2024
ddbeec3
Add heuristics for classes with private constructors/factories, and f…
cushon Mar 14, 2024
7f9c6a1
Tighten the AlmostJavadoc heuristic for HTML tags.
graememorgan Mar 15, 2024
c2a1a7c
ImpossibleNullComparison: match on all primitives.
graememorgan Mar 18, 2024
1b36127
Treat builder setter methods inside `@dagger.producers.ProductionComp…
kluever Mar 18, 2024
0d2f5e5
Detect multiple `set`s on the same proto oneof.
graememorgan Mar 19, 2024
0cb0873
Document some suggested fixes for ClassInitializationDeadlock
cushon Mar 19, 2024
449618c
Fix MultipleNullnessAnnotations's ability to read type annotations fr…
cushon Mar 19, 2024
e5f0814
ClassInitializationDeadlock: improve handling of classes that can't b…
cushon Mar 19, 2024
ec13312
Rip out `TestParametersNotInitialized:MoreRunners` flag.
graememorgan Mar 20, 2024
437293d
When an inlined method refers to method arguments in the true or false
nick-someone Mar 20, 2024
58473c5
Rip out `ImmutableNullComparison:EmitEmptyFixes`.
graememorgan Mar 21, 2024
5840b4d
Fix a typo in `SuggestedFix.checkNotSyntheticConstructor`
graememorgan Mar 22, 2024
9d5491d
Rename TruthSelfEquals to a more sensible name.
graememorgan Mar 25, 2024
cd6a504
Handle exhaustive switches on sealed types in MissingDefault
cushon Mar 25, 2024
af9dad8
Fix a crash in NonCanonicalType with type annotations
cushon Mar 25, 2024
527171c
Tidy some SuggestedFix usages.
graememorgan Mar 26, 2024
29d9335
Remove mutable state from ThreadSafety.
graememorgan Mar 26, 2024
9b2c2a9
Yoda conditions: consider static fields which are in `SHOUTY_CASE` to…
graememorgan Mar 27, 2024
ed4b61d
Fix an ArrayToString false positive for the varargs overload of `Join…
cushon Mar 27, 2024
48ec7d9
Prepare RedundantSetterCall for becoming an ERROR.
graememorgan Mar 28, 2024
474a4ac
Wrangle `MixedArrayDimensions` to be an error internally, but not ext…
graememorgan Apr 2, 2024
e4c9409
Handle unqualified instance method names in refaster
cushon Apr 2, 2024
0c12a77
Warn about returning a null `Table`, too.
cpovirk Apr 2, 2024
4ce508b
Drop text about 'legacy methods' From RestrictedApi methods
cushon Apr 2, 2024
200eb43
Add `@snippet` as a known inline tag.
graememorgan Apr 4, 2024
23547ac
Allow `CONST_CASE != null` in YodaCondition
cushon Apr 5, 2024
53d787c
Don't suggest `ImmutableSet` if `ImmutableList` is unused.
java-team-github-bot Apr 15, 2024
5a7b8d9
NearbyCallers: scan the body of expression lambdas.
graememorgan Apr 15, 2024
a6ab21a
Fix a crash in JUnitIncompatibleType
cushon Apr 16, 2024
9d66272
Correction to UseCorrectAssertInTests.
java-team-github-bot Apr 18, 2024
07c1a7c
Stop mentioning `@Var` in[]
cushon Apr 18, 2024
92c106d
Encourage when/thenReturn over doReturn/when.
graememorgan Apr 23, 2024
3ee6f41
Fix for a crash in RedundantSetterCall.
graememorgan Apr 24, 2024
f289d9e
`VoidUsed`: flag `Void` variables being _used_, where they can simply…
graememorgan Apr 24, 2024
fd9b826
Remove a very literal change-detector test, and move the comment to t…
graememorgan Apr 24, 2024
ebe0a01
Release Error Prone 2.27.0
cushon Apr 26, 2024
bd85693
Merged v2.27.0 from remote
jaredstehler Apr 26, 2024
5e3b69e
exclude additional suppresswarnings tests
jaredstehler Apr 26, 2024
883d2da
update version overrides for 2.27.0
jaredstehler Apr 26, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .blazar.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ provides:
- parent

env:
SET_VERSION_OVERRIDE: "2.23.0-$GIT_BRANCH-SNAPSHOT"
SET_VERSION_OVERRIDE: "2.27.0-$GIT_BRANCH-SNAPSHOT"

12 changes: 6 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:
continue-on-error: ${{ matrix.experimental }}
steps:
- name: Cancel previous
uses: styfle/cancel-workflow-action@0.8.0
uses: styfle/cancel-workflow-action@0.12.0
with:
access_token: ${{ github.token }}
- name: 'Check out repository'
Expand All @@ -58,7 +58,7 @@ jobs:
cache: 'maven'
- name: 'Set up JDK ${{ matrix.java }}'
if: ${{ matrix.java != 'EA' }}
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
java-version: |
11
Expand Down Expand Up @@ -88,9 +88,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: 'Check out repository'
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: 'Set up JDK 17'
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
java-version: 17
distribution: 'zulu'
Expand All @@ -114,9 +114,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: 'Check out repository'
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: 'Set up JDK 17'
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
java-version: 17
distribution: 'zulu'
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ jobs:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v2.4.0
uses: actions/checkout@v4

- name: Set up JDK
uses: actions/setup-java@v2.5.0
uses: actions/setup-java@v4
with:
java-version: 17
distribution: 'zulu'
Expand Down Expand Up @@ -52,7 +52,7 @@ jobs:
git push origin "v${{ github.event.inputs.version }}"

- name: Draft Release Entry
uses: softprops/action-gh-release@v0.1.14
uses: softprops/action-gh-release@v1
with:
draft: true
name: Error Prone ${{ github.event.input.version }}
Expand Down
2 changes: 1 addition & 1 deletion annotation/.blazar.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ depends:
- annotations

env:
SET_VERSION_OVERRIDE: "2.23.0-$GIT_BRANCH-SNAPSHOT"
SET_VERSION_OVERRIDE: "2.27.0-$GIT_BRANCH-SNAPSHOT"

2 changes: 1 addition & 1 deletion annotation/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<parent>
<groupId>com.google.errorprone</groupId>
<artifactId>error_prone_parent</artifactId>
<version>2.23.0</version>
<version>2.27.0</version>
</parent>

<name>@BugPattern annotation</name>
Expand Down
2 changes: 1 addition & 1 deletion annotations/.blazar.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ depends:
- parent

env:
SET_VERSION_OVERRIDE: "2.23.0-$GIT_BRANCH-SNAPSHOT"
SET_VERSION_OVERRIDE: "2.27.0-$GIT_BRANCH-SNAPSHOT"

76 changes: 73 additions & 3 deletions annotations/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<parent>
<groupId>com.google.errorprone</groupId>
<artifactId>error_prone_parent</artifactId>
<version>2.23.0</version>
<version>2.27.0</version>
</parent>

<name>error-prone annotations</name>
Expand Down Expand Up @@ -49,10 +49,80 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>8</source>
<target>8</target>
<compilerArgs combine.self="override" />
</configuration>
<executions>
<execution>
<id>default-compile</id>
<configuration>
<source>1.8</source>
<target>1.8</target>
<excludes>
<exclude>module-info.java</exclude>
</excludes>
</configuration>
</execution>
<execution>
<id>compile-java9</id>
<goals>
<goal>compile</goal>
</goals>
<configuration>
<source>9</source>
<target>9</target>
<release>9</release>
<multiReleaseOutput>true</multiReleaseOutput>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<archive>
<manifestEntries>
<Multi-Release>true</Multi-Release>
</manifestEntries>
</archive>
<excludes>
<exclude>/META-INF/versions/9/com/**/*.class</exclude>
</excludes>
</configuration>
</plugin>
<plugin>
<groupId>biz.aQute.bnd</groupId>
<artifactId>bnd-maven-plugin</artifactId>
<version>6.4.0</version>
<executions>
<execution>
<id>generate-OSGi-manifest</id>
<phase>none</phase>
</execution>
<execution>
<id>generate-OSGi-manifest-annotations</id>
<goals>
<goal>bnd-process</goal>
</goals>
<configuration>
<!--
The OSGi bundle build is overridden here to allow for MRJAR classes in the
versioned class space underneath META-INF.

The `annotations` module also should not have an `Automatic-Module-Name`.
Otherwise, these flags should stay in-sync with the same block in the root
`pom.xml`.
-->
<bnd><![CDATA[
Bundle-SymbolicName: com.google.errorprone.annotations
-exportcontents: com.google.errorprone*,!META-INF.*
-noextraheaders: true
-removeheaders: Private-Package
-fixupmessages: ^Classes found in the wrong directory: .*
]]></bnd>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,5 +130,8 @@
*/
@Documented
@Retention(CLASS)
// TODO(xtof): We'd like to eventually support other cases, but I first need to determine with
// confidence that the checker can ensure all initializations and assignments to such variables are
// compile-time-constant.
@Target({ElementType.PARAMETER, ElementType.FIELD})
public @interface CompileTimeConstant {}
22 changes: 22 additions & 0 deletions annotations/src/main/java/module-info.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/*
* Copyright 2015 The Error Prone Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

open module com.google.errorprone.annotations {
requires java.compiler;

exports com.google.errorprone.annotations;
exports com.google.errorprone.annotations.concurrent;
}
2 changes: 1 addition & 1 deletion check_api/.blazar.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ depends:
- annotations

env:
SET_VERSION_OVERRIDE: "2.23.0-$GIT_BRANCH-SNAPSHOT"
SET_VERSION_OVERRIDE: "2.27.0-$GIT_BRANCH-SNAPSHOT"

4 changes: 2 additions & 2 deletions check_api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<parent>
<groupId>com.google.errorprone</groupId>
<artifactId>error_prone_parent</artifactId>
<version>2.23.0</version>
<version>2.27.0</version>
</parent>

<name>error-prone check api</name>
Expand Down Expand Up @@ -146,7 +146,7 @@
<!-- Apache 2.0 -->
<groupId>com.google.jimfs</groupId>
<artifactId>jimfs</artifactId>
<version>1.2</version>
<version>1.3.0</version>
<scope>test</scope>
</dependency>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -230,12 +230,12 @@ static ErrorProneAnalyzer createAnalyzer(
.customRefactorer()
.or(
() -> {
ScannerSupplier toUse =
ErrorPronePlugins.loadPlugins(scannerSupplier, epOptions, context)
.applyOverrides(epOptions);
ScannerSupplier toUse = ErrorPronePlugins.loadPlugins(scannerSupplier, epOptions, context);
ImmutableSet<String> namedCheckers = epOptions.patchingOptions().namedCheckers();
if (!namedCheckers.isEmpty()) {
toUse = toUse.filter(bci -> namedCheckers.contains(bci.canonicalName()));
} else {
toUse = toUse.applyOverrides(epOptions);
}
return ErrorProneScannerTransformer.create(toUse.get());
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
package com.google.errorprone.bugpatterns;

import static com.google.common.collect.ImmutableSet.toImmutableSet;
import static com.google.errorprone.util.ASTHelpers.getDeclaredSymbol;
import static com.google.errorprone.util.ASTHelpers.getModifiers;
import static com.google.errorprone.util.ASTHelpers.getStartPosition;
import static com.google.errorprone.util.ASTHelpers.getSymbol;

import com.google.common.base.Preconditions;
import com.google.common.collect.ImmutableRangeSet;
Expand Down Expand Up @@ -299,14 +299,29 @@ private boolean isSuppressed(SuppressWarnings suppression) {
* bug checker.
*/
public boolean isSuppressed(Tree tree, VisitorState state) {
Symbol sym = getSymbol(tree);
Symbol sym = getDeclaredSymbol(tree);
/*
* TOOD(cpovirk): At least for @SuppressWarnings, should our suppression checks look for
* annotations only on the kinds of trees that are covered by SuppressibleTreePathScanner? Or,
* now that @SuppressWarnings has been changed to be applicable to all declaration locations,
* should we generalize SuppressibleTreePathScanner to look on all those locations?
*/
return sym != null && isSuppressed(sym, state);
}

/**
* Returns true if the given symbol is annotated with a {@code @SuppressWarnings} or other
* annotation that disables this bug checker.
*/
/*
* TODO(cpovirk): Would we consider deleting this overload (or at least making it `private`)? Its
* callers appear to all have access to a Tree, and callers might accidentally pass
* getSymbol(tree) instead of getDeclaredSymbol(tree), resulting in over-suppression. Fortunately,
* the Tree probably provides all that we need, at least for looking for @SuppressWarnings. It
* does *not* provide all that we need for looking for any @Inherited suppression annotations (if
* such annotations are something that we (a) support and (b) want to support), but we can always
* call getDeclaredSymbol inside the implementation where necessary.
*/
public boolean isSuppressed(Symbol sym, VisitorState state) {
ErrorProneOptions errorProneOptions = state.errorProneOptions();
boolean suppressedInGeneratedCode =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
import org.checkerframework.errorprone.dataflow.cfg.node.ConditionalAndNode;
import org.checkerframework.errorprone.dataflow.cfg.node.ConditionalNotNode;
import org.checkerframework.errorprone.dataflow.cfg.node.ConditionalOrNode;
import org.checkerframework.errorprone.dataflow.cfg.node.DeconstructorPatternNode;
import org.checkerframework.errorprone.dataflow.cfg.node.DoubleLiteralNode;
import org.checkerframework.errorprone.dataflow.cfg.node.EqualToNode;
import org.checkerframework.errorprone.dataflow.cfg.node.ExplicitThisNode;
Expand Down Expand Up @@ -92,7 +93,6 @@
import org.checkerframework.errorprone.dataflow.cfg.node.ReturnNode;
import org.checkerframework.errorprone.dataflow.cfg.node.ShortLiteralNode;
import org.checkerframework.errorprone.dataflow.cfg.node.SignedRightShiftNode;
import org.checkerframework.errorprone.dataflow.cfg.node.StringConcatenateAssignmentNode;
import org.checkerframework.errorprone.dataflow.cfg.node.StringConcatenateNode;
import org.checkerframework.errorprone.dataflow.cfg.node.StringConversionNode;
import org.checkerframework.errorprone.dataflow.cfg.node.StringLiteralNode;
Expand Down Expand Up @@ -653,18 +653,6 @@ Nullness visitBitwiseXor() {
return visitBitwiseOperation();
}

@Override
public final TransferResult<Nullness, AccessPathStore<Nullness>> visitStringConcatenateAssignment(
StringConcatenateAssignmentNode node,
TransferInput<Nullness, AccessPathStore<Nullness>> input) {
Nullness value = visitStringConcatenateAssignment();
return noStoreChanges(value, input);
}

Nullness visitStringConcatenateAssignment() {
return NULLABLE;
}

@Override
public final TransferResult<Nullness, AccessPathStore<Nullness>> visitLessThan(
LessThanNode node, TransferInput<Nullness, AccessPathStore<Nullness>> input) {
Expand Down Expand Up @@ -1034,6 +1022,13 @@ public final TransferResult<Nullness, AccessPathStore<Nullness>> visitExpression
return noStoreChanges(NONNULL, input);
}

@Override
public TransferResult<Nullness, AccessPathStore<Nullness>> visitDeconstructorPattern(
DeconstructorPatternNode node, TransferInput<Nullness, AccessPathStore<Nullness>> input) {
// TODO(b/307371634): handle DeconstructorPatternNode
return noStoreChanges(NONNULL, input);
}

private static final class ReadableUpdates implements Updates {
final Map<AccessPath, Nullness> values = new HashMap<>();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,16 @@

package com.google.errorprone.dataflow.nullnesspropagation;

import java.util.List;
import com.google.common.collect.ImmutableList;
import javax.lang.model.element.AnnotationMirror;

/** Represents a Java method. Used for custom predicates to match non-null-returning methods. */
public interface MethodInfo {
String clazz();

String method();

List<String> annotations();
ImmutableList<AnnotationMirror> annotations();

boolean isStatic();

Expand Down
Loading