Skip to content

Commit 87ef365

Browse files
committed
SafeSql for jdbc integration
1 parent 5f2437c commit 87ef365

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

mug-guava/src/main/java/com/google/mu/safesql/SafeQuery.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,10 @@ public int hashCode() {
264264
return query.hashCode();
265265
}
266266

267+
static boolean isTrusted(Object value) {
268+
return value instanceof SafeQuery || value.getClass().getName().equals(TRUSTED_SQL_TYPE_NAME);
269+
}
270+
267271
private SafeQuery parenthesized() {
268272
return new SafeQuery("(" + query + ")");
269273
}
@@ -445,10 +449,6 @@ private static String escapeQuoted(char quoteChar, String s) {
445449
return builder.toString();
446450
}
447451

448-
private static boolean isTrusted(Object value) {
449-
return value instanceof SafeQuery || value.getClass().getName().equals(TRUSTED_SQL_TYPE_NAME);
450-
}
451-
452452
private static void validatePlaceholder(Substring.Match placeholder) {
453453
checkArgument(!placeholder.isImmediatelyBetween("`", "'"), "Incorrectly quoted placeholder: `%s'", placeholder);
454454
checkArgument(!placeholder.isImmediatelyBetween("'", "`"), "Incorrectly quoted placeholder: '%s`", placeholder);

0 commit comments

Comments
 (0)