Skip to content

Commit c70902d

Browse files
committed
Remove reference of java 9 types:
1 parent 798c59d commit c70902d

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

mug-safesql/src/main/java/com/google/mu/safesql/ResultMapper.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,11 +191,12 @@ static Set<String> getCanonicalColumnNames(ResultSetMetaData metadata)
191191
private static String getNameForSql(Parameter param) {
192192
SqlName sqlName = param.getAnnotation(SqlName.class);
193193
if (sqlName != null) {
194+
String name = sqlName.value().trim();
194195
checkArgument(
195-
!sqlName.value().isBlank(),
196+
name.length() > 0,
196197
"@SqlName defined in %s shouldn't be empty or blank: %s",
197198
param.getDeclaringExecutable().getDeclaringClass(), param);
198-
return sqlName.value().trim();
199+
return name;
199200
}
200201
String paramName = param.getName();
201202
boolean noRealName =

mug/src/main/java/com/google/mu/util/CharPredicate.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ default boolean matchesNoneOf(CharSequence sequence) {
231231
* @since 9.0
232232
*/
233233
default boolean isPrefixOf(CharSequence sequence) {
234-
return !sequence.isEmpty() && test(sequence.charAt(0));
234+
return sequence.length() > 0 && test(sequence.charAt(0));
235235
}
236236

237237
/**
@@ -240,6 +240,7 @@ default boolean isPrefixOf(CharSequence sequence) {
240240
* @since 9.0
241241
*/
242242
default boolean isSuffixOf(CharSequence sequence) {
243-
return !sequence.isEmpty() && test(sequence.charAt(sequence.length() - 1));
243+
int len = sequence.length();
244+
return len > 0 && test(sequence.charAt(len - 1));
244245
}
245246
}

0 commit comments

Comments
 (0)