-
Notifications
You must be signed in to change notification settings - Fork 17
Fix gradle-baseline excavator #6710
Changes from 8 commits
77b4882
42ac984
b3b311a
f1bae4d
6cd1200
c710083
a1dfcfa
12b449f
bd074de
2c04fc8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1240,7 +1240,7 @@ private static String escapeText(String input) { | |
| break; | ||
| default: | ||
| // Check for other control characters | ||
| if (c >= 0x0000 && c <= 0x001F) { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👍 |
||
| if (c <= 0x001F) { | ||
| appendEscapedUnicode(builder, c); | ||
| } else if (Character.isHighSurrogate(c)) { | ||
| // Encode the surrogate pair using 2 six-character sequence (\\uXXXX\\uXXXX) | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -165,13 +165,15 @@ public static boolean isQueryRegistered(String key) { | |
| * @param dbType Look for queries registered with this override first | ||
| * @return a SQLString object representing the stored query | ||
| */ | ||
| @SuppressWarnings("GuardedByChecker") | ||
| static FinalSQLString getByKey(final String key, DBType dbType) { | ||
| assert isValidKey(key) : "Keys only consist of word characters"; // $NON-NLS-1$ | ||
| assert registeredValues.containsKey(key) || registeredValuesOverride.containsKey(key) | ||
| : "Couldn't find SQLString key: " + key + ", dbtype " + dbType; // $NON-NLS-1$ //$NON-NLS-2$ | ||
|
|
||
| FinalSQLString cached = cachedKeyed.get(key); | ||
| FinalSQLString cached; | ||
| synchronized (cacheLock) { | ||
| cached = cachedKeyed.get(key); | ||
|
||
| } | ||
| if (null != cached) { | ||
| callbackOnUse.noteUse((SQLString) cached.delegate); | ||
| return cached; | ||
|
|
@@ -209,7 +211,6 @@ public static boolean isValidKey(final String key) { | |
| * @param sql The string to be used in a query | ||
| * @return a SQLString object representing the given SQL | ||
| */ | ||
| @SuppressWarnings("GuardedByChecker") | ||
| static FinalSQLString getUnregisteredQuery(String sql) { | ||
| assert !isValidKey(sql) : "Unregistered Queries should not look like keys"; // $NON-NLS-1$ | ||
| return new FinalSQLString(new SQLString(sql)); | ||
|
|
@@ -423,9 +424,10 @@ protected static ImmutableMap<String, FinalSQLString> getCachedUnregistered() { | |
| @Deprecated | ||
| protected static void setCachedUnregistered(ImmutableMap<String, FinalSQLString> _cachedUnregistered) {} | ||
|
|
||
| @SuppressWarnings("GuardedByChecker") | ||
| protected static ImmutableMap<String, FinalSQLString> getCachedKeyed() { | ||
| return cachedKeyed; | ||
| synchronized (cacheLock) { | ||
| return cachedKeyed; | ||
| } | ||
| } | ||
|
|
||
| protected static void setCachedKeyed(ImmutableMap<String, FinalSQLString> cachedKeyed) { | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could be refactored, but as written may make the synchronization more obvious. Either way works for me