starryCoder commented on code in PR #3483:
URL: https://github.com/apache/hertzbeat/pull/3483#discussion_r2362211798
##########
hertzbeat-manager/src/main/java/org/apache/hertzbeat/manager/service/impl/MonitorServiceImpl.java:
##########
@@ -608,7 +608,7 @@ public Page<Monitor> getMonitors(List<Long> monitorIds,
String app, String searc
if (StringUtils.hasText(search)) {
Predicate predicateHost =
criteriaBuilder.like(root.get("host"), "%" + search + "%");
Predicate predicateName =
criteriaBuilder.like(criteriaBuilder.lower(root.get("name")), "%" +
search.toLowerCase() + "%");
- if (CommonUtil.isNumeric(search)){
+ if (CommonUtil.isLong(search)){
Predicate predicateId =
criteriaBuilder.equal(root.get("id"), Long.parseLong(search));
Review Comment:
Hi,I have switched from `Long.parseLong` to `Longs.tryParse` to safely parse
ID strings, avoiding failures on large numbers or float.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]