Fix formatting string in PolicyVersionUpgrade

The format string had an extra '%s' which was presumably for the
Exception string, but Slog.e already captures that.

Bug: 217923092
Test: errorprone build
Change-Id: I523bd94b65f00bc0332a2c3e3c8ed28de2df1974
This commit is contained in:
Michael Wright
2022-02-04 20:49:14 +00:00
parent 400ea88281
commit c92adae8a3
2 changed files with 2 additions and 1 deletions

View File

@@ -20,6 +20,7 @@ java_defaults {
"-Xep:NullTernary:ERROR",
"-Xep:TryFailThrowable:ERROR",
"-Xep:HashtableContains:ERROR",
"-Xep:FormatString:ERROR",
// NOTE: only enable to generate local patchfiles
// "-XepPatchChecks:refaster:frameworks/base/errorprone/refaster/EfficientXml.java.refaster",
// "-XepPatchLocation:/tmp/refaster/",

View File

@@ -184,7 +184,7 @@ public class PolicyVersionUpgrader {
Files.write(file.toPath(), versionBytes);
versionFile.commit();
} catch (IOException e) {
Slog.e(LOG_TAG, String.format("Writing version %d failed: %s", version), e);
Slog.e(LOG_TAG, String.format("Writing version %d failed", version), e);
versionFile.rollback();
}
}