pjfanning commented on code in PR #3483:
URL: https://github.com/apache/hertzbeat/pull/3483#discussion_r2187101500
##########
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:
Long.parseLong can still fail if the number has lots of digits, eg 20 or
more.
9,223,372,036,854,775,807 is the max long in Java.
--
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]