Skip to content

Commit

Permalink
NOD-745: fix coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
fparisitas committed Mar 26, 2024
1 parent f9630ce commit 7d47275
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/java/it/gov/pagopa/node/cfgsync/util/Utils.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public static Object trimValueColumn(Class clazz, String columnName, String valu
try {
int maxColumnLength = clazz.getDeclaredField(columnName).getAnnotation(Column.class).length();
int valueLength = value.length();
int lastIndexTrim = valueLength > maxColumnLength ? maxColumnLength : valueLength;
int lastIndexTrim = Math.min(valueLength, maxColumnLength);
return value.substring(0, lastIndexTrim);
} catch (NoSuchFieldException e) {
throw new SyncDbStatusException(e.getMessage());
Expand Down

0 comments on commit 7d47275

Please sign in to comment.