Skip to content

Commit faf7a32

Browse files
Excavator: Upgrades Baseline to the latest version (palantir#1172)
1 parent 0dd44af commit faf7a32

18 files changed

Lines changed: 44 additions & 1 deletion

‎build.gradle‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ buildscript {
1717
classpath 'com.palantir.javaformat:gradle-palantir-java-format:2.50.0'
1818
classpath 'com.palantir.gradle.revapi:gradle-revapi:1.8.0'
1919
classpath 'com.palantir.javaformat:gradle-palantir-java-format:2.50.0'
20+
classpath 'com.palantir.suppressible-error-prone:gradle-suppressible-error-prone:1.6.0'
2021
classpath 'gradle.plugin.org.inferred:gradle-processors:3.7.0'
2122
}
2223
}

‎idea-plugin/src/main/java/com/palantir/javaformat/intellij/FormatterProvider.java‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ Optional<FormatterService> get(Project project, PalantirJavaFormatSettings setti
6767
settings.injectedVersionIsOutdated()));
6868
}
6969

70+
@SuppressWarnings("for-rollout:Slf4jLogsafeArgs")
7071
private static Optional<FormatterService> createFormatter(FormatterCacheKey cacheKey) {
7172
if (cacheKey.jdkMajorVersion.isEmpty()) {
7273
return Optional.empty();
@@ -107,6 +108,7 @@ private static List<Path> getProvidedImplementationUrls(List<URI> implementation
107108
return implementationClasspath.stream().map(Path::of).collect(Collectors.toList());
108109
}
109110

111+
@SuppressWarnings("for-rollout:Slf4jLogsafeArgs")
110112
private static List<Path> getBundledImplementationUrls() {
111113
// Load from the jars bundled with the plugin.
112114
IdeaPluginDescriptor ourPlugin = Preconditions.checkNotNull(
@@ -116,6 +118,7 @@ private static List<Path> getBundledImplementationUrls() {
116118
return listDirAsUrlsUnchecked(implDir);
117119
}
118120

121+
@SuppressWarnings("for-rollout:Slf4jLogsafeArgs")
119122
private static List<Path> getImplementationUrls(
120123
Optional<List<URI>> implementationClassPath, boolean useBundledImplementation) {
121124
if (useBundledImplementation) {
@@ -163,6 +166,7 @@ private static OptionalInt parseSdkJavaVersion(Sdk sdk) {
163166
return parseSdkJavaVersion(version);
164167
}
165168

169+
@SuppressWarnings("for-rollout:Slf4jLogsafeArgs")
166170
@VisibleForTesting
167171
static OptionalInt parseSdkJavaVersion(String version) {
168172
int indexOfVersionDelimiter = version.indexOf('.');

‎idea-plugin/src/main/java/com/palantir/javaformat/intellij/PalantirJavaFormatConfigurable.java‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,14 @@ class PalantirJavaFormatConfigurable extends BaseConfigurable implements Searcha
4040
private final Project project;
4141
private JPanel panel;
4242
private JCheckBox enable;
43+
44+
@SuppressWarnings("for-rollout:RawTypes")
4345
private JComboBox styleComboBox;
46+
4447
private JLabel formatterVersion;
4548
private JLabel pluginVersion;
4649

50+
@SuppressWarnings("for-rollout:NullAway")
4751
public PalantirJavaFormatConfigurable(Project project) {
4852
this.project = project;
4953
}
@@ -133,6 +137,7 @@ private void createUIComponents() {
133137
*
134138
* @noinspection ALL
135139
*/
140+
@SuppressWarnings("for-rollout:InvalidBlockTag")
136141
private void $$$setupUI$$$() {
137142
createUIComponents();
138143
panel = new JPanel();
@@ -281,6 +286,7 @@ private void createUIComponents() {
281286
}
282287

283288
/** @noinspection ALL */
289+
@SuppressWarnings({"for-rollout:InvalidBlockTag", "for-rollout:MissingSummary"})
284290
public JComponent $$$getRootComponent$$$() {
285291
return panel;
286292
}

‎idea-plugin/src/main/java/com/palantir/javaformat/intellij/PalantirJavaFormatSettings.java‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,25 +34,28 @@
3434
import java.util.stream.Stream;
3535
import javax.annotation.Nullable;
3636

37+
@SuppressWarnings("for-rollout:SameNameButDifferent")
3738
@State(
3839
name = "PalantirJavaFormatSettings",
3940
storages = {@Storage("palantir-java-format.xml")})
4041
class PalantirJavaFormatSettings implements PersistentStateComponent<PalantirJavaFormatSettings.State> {
4142

43+
@SuppressWarnings("for-rollout:SameNameButDifferent")
4244
private State state = new State();
4345

4446
static PalantirJavaFormatSettings getInstance(Project project) {
4547
return ServiceManager.getService(project, PalantirJavaFormatSettings.class);
4648
}
4749

50+
@SuppressWarnings("for-rollout:SameNameButDifferent")
4851
@Nullable
4952
@Override
5053
public State getState() {
5154
return state;
5255
}
5356

5457
@Override
55-
public void loadState(State state) {
58+
public void loadState(@SuppressWarnings("for-rollout:SameNameButDifferent") State state) {
5659
this.state = state;
5760
}
5861

@@ -144,6 +147,7 @@ public void setImplementationClassPath(@Nullable List<String> value) {
144147
.map(strings -> strings.stream().map(URI::create).collect(Collectors.toList()));
145148
}
146149

150+
@SuppressWarnings("for-rollout:NullAway")
147151
public List<String> getImplementationClassPath() {
148152
return implementationClassPath
149153
.map(paths -> paths.stream().map(URI::toString).collect(Collectors.toList()))
@@ -161,6 +165,7 @@ public void setEnabled(@Nullable String enabledStr) {
161165
}
162166
}
163167

168+
@SuppressWarnings("for-rollout:NullAway")
164169
public String getEnabled() {
165170
switch (enabled) {
166171
case ENABLED:

‎palantir-java-format/src/main/java/com/palantir/javaformat/Newlines.java‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ public static int hasNewlineAt(String input, int idx) {
5353
}
5454

5555
/** Returns the terminating line break in the input, or {@code null} if the input does not end in a break. */
56+
@SuppressWarnings("for-rollout:NullAway")
5657
public static String getLineEnding(String input) {
5758
for (String b : BREAKS) {
5859
if (input.endsWith(b)) {
@@ -158,6 +159,7 @@ private static final class LineIterator implements Iterator<String> {
158159
private final String input;
159160
private final Iterator<Integer> indices;
160161

162+
@SuppressWarnings("for-rollout:NullAway")
161163
private LineIterator(String input) {
162164
this.input = input;
163165
this.indices = lineOffsetIterator(input);

‎palantir-java-format/src/main/java/com/palantir/javaformat/doc/LevelDelimitedFlatValueDocVisitor.java‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ public String visitBreak(Break doc) {
5353
return sb.toString();
5454
}
5555

56+
@SuppressWarnings("for-rollout:NullAway")
5657
@Override
5758
public String visitLevel(Level level) {
5859
if (level.getFlat().isEmpty()) {

‎palantir-java-format/src/main/java/com/palantir/javaformat/doc/Obs.java‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ FinishExplorationNode startExplorationNode(
6464
String getOutput();
6565
}
6666

67+
@SuppressWarnings("for-rollout:NullAway")
6768
public static ExplorationNode createRoot(Sink sink) {
6869
return new ExplorationNodeImpl(null, "(initial node)", sink, 0, Optional.empty());
6970
}

‎palantir-java-format/src/main/java/com/palantir/javaformat/java/CommandLineOptionsParser.java‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ final class CommandLineOptionsParser {
3939
Splitter.on(CharMatcher.breakingWhitespace()).omitEmptyStrings().trimResults();
4040

4141
/** Parses {@link CommandLineOptions}. */
42+
@SuppressWarnings("for-rollout:NullAway")
4243
static CommandLineOptions parse(Iterable<String> options) {
4344
CommandLineOptions.Builder optionsBuilder = CommandLineOptions.builder();
4445
List<String> expandedOptions = new ArrayList<>();

‎palantir-java-format/src/main/java/com/palantir/javaformat/java/JavaInput.java‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,7 @@ public String toString() {
266266
* @param text the input text
267267
* @throws FormatterException if the input cannot be parsed
268268
*/
269+
@SuppressWarnings("for-rollout:NullAway")
269270
public JavaInput(String text) throws FormatterException {
270271
this.text = checkNotNull(text);
271272
setLines(ImmutableList.copyOf(Newlines.lineIterator(text)));
@@ -344,6 +345,7 @@ private ImmutableList<Tok> buildToks(String text) throws FormatterException {
344345
* @param stopTokens a set of tokens which should cause lexing to stop. If one of these is found, the returned list
345346
* will include tokens up to but not including that token.
346347
*/
348+
@SuppressWarnings("for-rollout:NullAway")
347349
static ImmutableList<Tok> buildToks(String text, ImmutableSet<TokenKind> stopTokens) throws FormatterException {
348350
stopTokens = ImmutableSet.<TokenKind>builder()
349351
.addAll(stopTokens)

‎palantir-java-format/src/main/java/com/palantir/javaformat/java/JavaInputAstVisitor.java‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -984,6 +984,7 @@ void visitVariables(List<VariableTree> fragments, DeclarationKind declarationKin
984984
}
985985
}
986986

987+
@SuppressWarnings("for-rollout:NullAway")
987988
private TypeWithDims variableFragmentDims(boolean first, int leadingDims, Tree type) {
988989
if (type == null) {
989990
return null;
@@ -1381,6 +1382,7 @@ public Void visitAnnotatedType(AnnotatedTypeTree node, Void unused) {
13811382

13821383
protected static final long RECORD = 1L << 61;
13831384

1385+
@SuppressWarnings("for-rollout:NullAway")
13841386
@Override
13851387
public Void visitMethod(MethodTree node, Void unused) {
13861388
sync(node);
@@ -2997,6 +2999,7 @@ private ExpressionTree getArrayBase(ExpressionTree node) {
29972999
return node;
29983000
}
29993001

3002+
@SuppressWarnings("for-rollout:NullAway")
30003003
private ExpressionTree getMethodReceiver(MethodInvocationTree methodInvocation) {
30013004
ExpressionTree select = methodInvocation.getMethodSelect();
30023005
return select instanceof MemberSelectTree ? ((MemberSelectTree) select).getExpression() : null;
@@ -3328,6 +3331,7 @@ static int rowLength(List<? extends ExpressionTree> row) {
33283331
return size;
33293332
}
33303333

3334+
@SuppressWarnings("for-rollout:NullAway")
33313335
private Integer actualColumn(ExpressionTree expression) {
33323336
Map<Integer, Integer> positionToColumnMap = builder.getInput().getPositionToColumnMap();
33333337
return positionToColumnMap.get(builder.actualStartColumn(getStartPosition(expression)));

0 commit comments

Comments
 (0)