Skip to content

Commit

Permalink
Merge pull request #41731 from dk2k/dk2k_malformed_format
Browse files Browse the repository at this point in the history
BugFix Fixed mismatched number of args in string formats
  • Loading branch information
gsmet authored Aug 7, 2024
2 parents b3e6085 + c2b6b86 commit 7e21779
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public CheckCrossReferences(Path srcDir, Path referenceIndexPath)

if (!Files.exists(referenceIndexPath) || !Files.isReadable(referenceIndexPath)) {
throw new IllegalStateException(
String.format("Reference index does not exist or is not readable", referenceIndexPath.toAbsolutePath()));
String.format("Reference index %s does not exist or is not readable", referenceIndexPath.toAbsolutePath()));
}

ObjectMapper om = new ObjectMapper(new YAMLFactory().enable(YAMLGenerator.Feature.MINIMIZE_QUOTES));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public String delete() {
AuditReader auditReader = AuditReaderFactory.get(em);
List<Number> revisions = auditReader.getRevisions(MyAuditedEntity.class, entity.getId());
if (revisions.size() != 2) {
throw new IllegalStateException(String.format("found {} revisions", revisions.size()));
throw new IllegalStateException(String.format("found %d revisions", revisions.size()));
}

for (Number revision : revisions) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public String save(String name) {
AuditReader auditReader = AuditReaderFactory.get(em);
List<Number> revisions = auditReader.getRevisions(MyAuditedEntity.class, entity.getId());
if (revisions.size() != 2) {
throw new IllegalStateException(String.format("found {} revisions", revisions.size()));
throw new IllegalStateException(String.format("found %d revisions", revisions.size()));
}

MyRevisionEntity revEntity = auditReader.findRevision(MyRevisionEntity.class, revisions.get(0));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,8 @@ public static void setHttpClientOptions(OidcCommonConfig oidcConfig, HttpClientO
}
} catch (IOException ex) {
throw new ConfigurationException(String.format(
"OIDC truststore file does not exist or can not be read",
oidcConfig.tls.trustStoreFile.get().toString()), ex);
"OIDC truststore file %s does not exist or can not be read",
oidcConfig.tls.trustStoreFile.get()), ex);
}
}
if (oidcConfig.tls.keyStoreFile.isPresent()) {
Expand All @@ -182,8 +182,8 @@ public static void setHttpClientOptions(OidcCommonConfig oidcConfig, HttpClientO

} catch (IOException ex) {
throw new ConfigurationException(String.format(
"OIDC keystore file does not exist or can not be read",
oidcConfig.tls.keyStoreFile.get().toString()), ex);
"OIDC keystore file %s does not exist or can not be read",
oidcConfig.tls.keyStoreFile.get()), ex);
}
}
Optional<ProxyOptions> proxyOpt = toProxyOptions(oidcConfig.getProxy());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -864,7 +864,7 @@ boolean isEnumConstantMessageKey(String key, IndexView index, ClassInfo bundleIn
return true;
}
throw new MessageBundleException(
String.format("%s is not an enum constant of %: %s", constant, maybeEnum, key));
String.format("%s is not an enum constant of %s: %s", constant, maybeEnum, key));
}
}
}
Expand Down

0 comments on commit 7e21779

Please sign in to comment.