wu-sheng opened a new pull request, #13743: URL: https://github.com/apache/skywalking/pull/13743
### Fix LAL `==` and `!=` with numeric literals using object equality instead of numeric comparison - [x] Add a unit test to verify that the fix works. - [x] Explain briefly why the bug exists and how to fix it. **Bug**: When LAL scripts use `==` or `!=` with numeric literals (e.g., `parsed?.response?.responseCode?.value as Integer != 403`), the compiler generated `java.util.Objects.equals(value, Long.valueOf(403L))`. This fails silently when the left side is a different boxed type (e.g., `Integer`) because `Integer.equals(Long)` is always `false` in Java — even when the numeric values are the same. Meanwhile, `>`, `<`, `>=`, `<=` correctly used `generateNumericComparison()` with primitive comparison (`h.toLong(value) > 403L`). **Fix**: `EQ`/`NEQ` with a `NumberConditionValue` right-hand side now route through `generateNumericComparison()` (producing `== 403L` / `!= 403L`). String, boolean, null, and value-access comparisons still use `Objects.equals()`. Also ensures all LAL codegen unit tests both compile (bytecode validation) and assert generated source — previously some tests only asserted source without compiling. - [ ] If this pull request closes/resolves/fixes an existing issue, replace the issue number. Closes #<issue number>. - [ ] Update the [`CHANGES` log](https://github.com/apache/skywalking/blob/master/docs/en/changes/changes.md). -- 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]
