Code review comment: In this [comment](https://github.com/apache/beam/pull/25927#discussion_r1174141095)'s context, could we do this? I agree it looks like a game with the checker framework but the benefit of having the checker framework and removing the SuppressWarnings outweighs the cost of this I'd argue. Even if one checks nullorempty in a prior step and still calls getSchema, the checker framework complains. ``` if (!Strings.isNullOrEmpty(configuration.getSchema())) {         String schema = configuration.getSafeSchema(); ... } ```

Code before review:
public PCollectionRowTuple expand(PCollectionRowTuple input) {
checkArgument(
input.getAll().isEmpty() ^ Strings.isNullOrEmpty(configuration.getFilepattern()),
"Either an input PCollection of file patterns or the filepattern parameter must be set,"
+ "but not both.");
String schema = configuration.getSchema();
if (!Strings.isNullOrEmpty(schema)) {
schema = resolveSchemaStringOrFilePath(schema);
configuration = configuration.toBuilder().setSchema(schema).build();
}
PCollection<MatchResult.Metadata> files;
if (!Strings.isNullOrEmpty(configuration.getFilepattern())) {
Pipeline p = input.getPipeline();
FileIO.Match matchFiles = FileIO.match().filepattern(configuration.getFilepattern());
matchFiles = (FileIO.Match) maybeApplyStreaming(matchFiles);
files = p.apply(matchFiles);
} else {
FileIO.MatchAll matchAllFiles = FileIO.matchAll();
matchAllFiles = (FileIO.MatchAll) maybeApplyStreaming(matchAllFiles);
files =
input
.get(INPUT_TAG)
.apply(
"Get filepatterns",
MapElements.into(TypeDescriptors.strings())
.via((row) -> row.getString("filepattern")))
.apply("Match files", matchAllFiles);
}
PCollection<Row> output =
files
.apply(FileIO.readMatches())
.apply("Read files", getProvider().buildTransform(configuration));
return PCollectionRowTuple.of(OUTPUT_TAG, output);
}

Line under review: String schema = configuration.getSchema();

Code after addressing the review:
public PCollectionRowTuple expand(PCollectionRowTuple input) {
checkArgument(
input.getAll().isEmpty() ^ Strings.isNullOrEmpty(configuration.getFilepattern()),
"Either an input PCollection of file patterns or the filepattern parameter must be set,"
+ "but not both.");
String schema = configuration.getSchema();
if (!Strings.isNullOrEmpty(schema)) {
schema = resolveSchemaStringOrFilePath(configuration.getSafeSchema());
configuration = configuration.toBuilder().setSchema(schema).build();
}
PCollection<MatchResult.Metadata> files;
if (useInputPCollection) {
files =
input
.get(INPUT_TAG)
.apply(
"Get filepatterns",
MapElements.into(TypeDescriptors.strings())
.via(
(Row row) ->
Objects.requireNonNull(row.getString(FILEPATTERN_ROW_FIELD_NAME)))
.exceptionsInto(TypeDescriptors.nulls())
.exceptionsVia(
exceptionElement -> {
String faultyFilepattern =
Optional.ofNullable(
exceptionElement
.element()
.getString(FILEPATTERN_ROW_FIELD_NAME))
.orElse("[null filepattern]");
LOG.warn(
"Could not acquire a faulty filepattern: {}. This will be skipped.",
faultyFilepattern);
return null;
}))
.output()
.apply("Match files", (FileIO.MatchAll) buildMatchTransform());
} else {
Pipeline p = input.getPipeline();
files = p.apply((FileIO.Match) buildMatchTransform());
}
PCollection<Row> output =
files
.apply(FileIO.readMatches())
.apply("Read files", getProvider().buildTransform(configuration));
return PCollectionRowTuple.of(OUTPUT_TAG, output);
}