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(
|
||||
ErrorProneFlags flags) {
|
||||
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) {
|
||||
|
||||
@@ -16,10 +16,7 @@ public final class Flags {
|
||||
* provided, or if the flag's value is the empty string.
|
||||
*/
|
||||
public static ImmutableList<String> getList(ErrorProneFlags errorProneFlags, String name) {
|
||||
return errorProneFlags
|
||||
.getList(name)
|
||||
.map(ImmutableList::copyOf)
|
||||
.filter(flags -> !flags.equals(ImmutableList.of("")))
|
||||
.orElseGet(ImmutableList::of);
|
||||
ImmutableList<String> list = errorProneFlags.getListOrEmpty(name);
|
||||
return list.equals(ImmutableList.of("")) ? ImmutableList.of() : list;
|
||||
}
|
||||
}
|
||||
|
||||
4
pom.xml
4
pom.xml
@@ -201,7 +201,7 @@
|
||||
<version.auto-value>1.10.4</version.auto-value>
|
||||
<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-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.guava-beta-checker>1.0</version.guava-beta-checker>
|
||||
<version.jdk>11</version.jdk>
|
||||
@@ -1739,8 +1739,6 @@
|
||||
false-positives.
|
||||
-XepOpt:CheckReturnValue:CheckAllMethods=true -->
|
||||
-XepOpt:InlineMe:SkipInliningsWithComments=false
|
||||
-XepOpt:NamedLikeContextualKeyword:EnableClassNames=true
|
||||
-XepOpt:NamedLikeContextualKeyword:EnableMethodNames=true
|
||||
-XepOpt:NullAway:AnnotatedPackages=tech.picnic
|
||||
-XepOpt:NullAway:AssertsEnabled=true
|
||||
-XepOpt:NullAway:CheckOptionalEmptiness=true
|
||||
|
||||
@@ -42,7 +42,6 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Optional;
|
||||
import java.util.Set;
|
||||
import java.util.regex.Pattern;
|
||||
import javax.inject.Inject;
|
||||
import org.jspecify.annotations.Nullable;
|
||||
@@ -180,7 +179,7 @@ public final class RefasterRuleCollection extends BugChecker implements Compilat
|
||||
|
||||
for (Description description : matches) {
|
||||
String ruleName = extractRefasterRuleName(description);
|
||||
Set<Replacement> replacements =
|
||||
ImmutableSet<Replacement> replacements =
|
||||
Iterables.getOnlyElement(description.fixes).getReplacements(endPositions);
|
||||
for (Replacement replacement : replacements) {
|
||||
ruleMatches.put(replacement.range(), ruleName);
|
||||
|
||||
Reference in New Issue
Block a user