mirror of
https://github.com/jlengrand/error-prone-support.git
synced 2026-03-10 08:11:25 +00:00
Upgrade Error Prone 2.21.1 -> 2.22.0 (#800)
See: - https://github.com/google/error-prone/releases/tag/v2.22.0 - https://github.com/google/error-prone/compare/v2.21.1...v2.22.0 - https://github.com/PicnicSupermarket/error-prone/compare/v2.21.1-picnic-1...v2.22.0-picnic-1
This commit is contained in:
@@ -220,7 +220,10 @@ public final class LexicographicalAnnotationAttributeListing extends BugChecker
|
|||||||
private static AnnotationAttributeMatcher createAnnotationAttributeMatcher(
|
private static AnnotationAttributeMatcher createAnnotationAttributeMatcher(
|
||||||
ErrorProneFlags flags) {
|
ErrorProneFlags flags) {
|
||||||
return AnnotationAttributeMatcher.create(
|
return AnnotationAttributeMatcher.create(
|
||||||
flags.getList(INCLUDED_ANNOTATIONS_FLAG), excludedAnnotations(flags));
|
flags.get(INCLUDED_ANNOTATIONS_FLAG).isPresent()
|
||||||
|
? Optional.of(flags.getListOrEmpty(INCLUDED_ANNOTATIONS_FLAG))
|
||||||
|
: Optional.empty(),
|
||||||
|
excludedAnnotations(flags));
|
||||||
}
|
}
|
||||||
|
|
||||||
private static ImmutableList<String> excludedAnnotations(ErrorProneFlags flags) {
|
private static ImmutableList<String> excludedAnnotations(ErrorProneFlags flags) {
|
||||||
|
|||||||
@@ -16,10 +16,7 @@ public final class Flags {
|
|||||||
* provided, or if the flag's value is the empty string.
|
* provided, or if the flag's value is the empty string.
|
||||||
*/
|
*/
|
||||||
public static ImmutableList<String> getList(ErrorProneFlags errorProneFlags, String name) {
|
public static ImmutableList<String> getList(ErrorProneFlags errorProneFlags, String name) {
|
||||||
return errorProneFlags
|
ImmutableList<String> list = errorProneFlags.getListOrEmpty(name);
|
||||||
.getList(name)
|
return list.equals(ImmutableList.of("")) ? ImmutableList.of() : list;
|
||||||
.map(ImmutableList::copyOf)
|
|
||||||
.filter(flags -> !flags.equals(ImmutableList.of("")))
|
|
||||||
.orElseGet(ImmutableList::of);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
4
pom.xml
4
pom.xml
@@ -201,7 +201,7 @@
|
|||||||
<version.auto-value>1.10.4</version.auto-value>
|
<version.auto-value>1.10.4</version.auto-value>
|
||||||
<version.error-prone>${version.error-prone-orig}</version.error-prone>
|
<version.error-prone>${version.error-prone-orig}</version.error-prone>
|
||||||
<version.error-prone-fork>v${version.error-prone-orig}-picnic-1</version.error-prone-fork>
|
<version.error-prone-fork>v${version.error-prone-orig}-picnic-1</version.error-prone-fork>
|
||||||
<version.error-prone-orig>2.21.1</version.error-prone-orig>
|
<version.error-prone-orig>2.22.0</version.error-prone-orig>
|
||||||
<version.error-prone-slf4j>0.1.20</version.error-prone-slf4j>
|
<version.error-prone-slf4j>0.1.20</version.error-prone-slf4j>
|
||||||
<version.guava-beta-checker>1.0</version.guava-beta-checker>
|
<version.guava-beta-checker>1.0</version.guava-beta-checker>
|
||||||
<version.jdk>11</version.jdk>
|
<version.jdk>11</version.jdk>
|
||||||
@@ -1739,8 +1739,6 @@
|
|||||||
false-positives.
|
false-positives.
|
||||||
-XepOpt:CheckReturnValue:CheckAllMethods=true -->
|
-XepOpt:CheckReturnValue:CheckAllMethods=true -->
|
||||||
-XepOpt:InlineMe:SkipInliningsWithComments=false
|
-XepOpt:InlineMe:SkipInliningsWithComments=false
|
||||||
-XepOpt:NamedLikeContextualKeyword:EnableClassNames=true
|
|
||||||
-XepOpt:NamedLikeContextualKeyword:EnableMethodNames=true
|
|
||||||
-XepOpt:NullAway:AnnotatedPackages=tech.picnic
|
-XepOpt:NullAway:AnnotatedPackages=tech.picnic
|
||||||
-XepOpt:NullAway:AssertsEnabled=true
|
-XepOpt:NullAway:AssertsEnabled=true
|
||||||
-XepOpt:NullAway:CheckOptionalEmptiness=true
|
-XepOpt:NullAway:CheckOptionalEmptiness=true
|
||||||
|
|||||||
@@ -42,7 +42,6 @@ import java.util.ArrayList;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
import java.util.Set;
|
|
||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
import org.jspecify.annotations.Nullable;
|
import org.jspecify.annotations.Nullable;
|
||||||
@@ -180,7 +179,7 @@ public final class RefasterRuleCollection extends BugChecker implements Compilat
|
|||||||
|
|
||||||
for (Description description : matches) {
|
for (Description description : matches) {
|
||||||
String ruleName = extractRefasterRuleName(description);
|
String ruleName = extractRefasterRuleName(description);
|
||||||
Set<Replacement> replacements =
|
ImmutableSet<Replacement> replacements =
|
||||||
Iterables.getOnlyElement(description.fixes).getReplacements(endPositions);
|
Iterables.getOnlyElement(description.fixes).getReplacements(endPositions);
|
||||||
for (Replacement replacement : replacements) {
|
for (Replacement replacement : replacements) {
|
||||||
ruleMatches.put(replacement.range(), ruleName);
|
ruleMatches.put(replacement.range(), ruleName);
|
||||||
|
|||||||
Reference in New Issue
Block a user