Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BugFix Fixed mismatched number of args in string formats #41731

Merged
merged 2 commits into from
Aug 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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