Skip to content

Commit

Permalink
Merge pull request #86 from HubSpot/js-update-to-2-27-0
Browse files Browse the repository at this point in the history
Upgrade to v2.27.0
  • Loading branch information
jaredstehler authored Apr 29, 2024
2 parents 3f47389 + 883d2da commit 02e0b65
Show file tree
Hide file tree
Showing 237 changed files with 6,795 additions and 1,462 deletions.
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

0 comments on commit 02e0b65

Please sign in to comment.