Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

andras-markos
Copy link

Summary

This PR fixes an issue in the JSONLogic Java implementation where null values are incorrectly treated as missing (not present) instead of present but empty. This behavior can cause LO flows to trigger incorrectly.

For full background, see the JSONLogic Java library wiki page.


Changes in this PR

  • Upstream sync: Incorporates fixes from the original library (v1.0.5 → v1.1.0).
  • Bug fix: Correctly distinguish between null and missing values in JSONLogic evaluation.
  • Code style: Reformats code to standard Java conventions and applies minor safe refactors to pass Checkstyle (e.g., added missing newlines, split long lines, removed redundant braces).
  • Build & release: Updates Gradle and CircleCI config to follow Sailthru’s standard process for releasing JVM libraries and publishing to AWS CodeArtifact.

Review Notes

  • Changes are grouped into separate commits — reviewing commit-by-commit is recommended.
  • Use GitHub’s "Ignore whitespace changes" option for a clearer view of logic changes.

magnarn and others added 24 commits December 30, 2021 10:35
`in` of strings would fail with NullPointerException if the first
argument was `null`. Also add some tests with null in various places.
When missing_some is applied to a `null` data object, it would return
all its arguments, including the threshold. According to the spec, it
should return an array of the missing keys.

Also, if the threshold is 0, it should always return an empty list,
even when data is `null`.
…ring

Avoid NullPointerException if first argument to "in" is null
…f_operations

Removed the redundant storage of operations
* Initial commit for Github actions

* Make uploadArchives conditional on the presence of Sonatype credentials

* Turn off signing conditionally

* Really make signing optional

* Add testing output

* Test publish step

* Attempt to fix path for upload-artifacts action

* Use v4 for upload/download-artifacts

* Fix signing logic to use in memory keys

* Fix push logic in the bump version step

* Use checkout@v4

* Add a rebase before committing

* Hard-code branch name...

* Prepare version 1.0.9-SNAPSHOT for development [skip ci]

* Prepare for merge

* Remove .vscode folder

* Add .vscode to the .gitignore

* Split into multiple files

* Prepare version 1.0.9-SNAPSHOT for development [skip ci]

* Clean up TODOs

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
* Run publish action when a merge is performed on the main branch (is this really how you do it? yuck...)

* Github actions fix
…alid array" (jamsesso#42)

Added tests for different "all in" cases.

Co-authored-by: Rickard Katz <[email protected]>
Co-authored-by: Sam Jesso <[email protected]>
…so#53)

* Adds jsonPath to error messages, so errors can be pinpointed.

The jsonPath can be used to provide better error messages to users trying
to create valid jsonLogic expressions

Also:
Fixes some exception messages to use the right operator. ("none", "or").
Aligns behavior to reference implementation for sums of unparseable strings,
as well as for between comparisons of > and >=, and for comparison operators
with arrays of more than three values.

* Handles edge cases of + and * the way jsonlogic.com does

When presented with an array parameter, jsonlogic.com uses the first
value for + and * expressions.

* Uses fixtures for the error tests.

Also fixes a bug in the jsonPath calculation for and/or.

* Bump version to 1.1.0-SNAPSHOT
…emoved unnecessary blank line, removed unnecessary braces, simplified return expression, added hashCode method to make checkstyle pass
@bge-kernel-panic
Copy link

@andras-markos I think we're trying to do too much at once here, witness the fact that the build fails. I know they're separate commits but I'm having a hard time figuring out what you changed even there.

This thing is still running github actions.

I'd recommend the following sequence:

  1. First incorporate the upstream changes, to ensure old github actions still work
  2. Create a branch here for just your change (no reformatting nothing) so you can submit it upstream
  3. Then update to use circleci (don't forget to get rid of the github actions...). Initially you can turn checkstyle off.
  4. Finally do your actual changes, it's ok if reformatting is included in there, but I really think it's hard to take on everything at once. You can cherry pick your fix from 2. above.

@andras-markos
Copy link
Author

@andras-markos I think we're trying to do too much at once here, witness the fact that the build fails. I know they're separate commits but I'm having a hard time figuring out what you changed even there.

This thing is still running github actions.

I'd recommend the following sequence:

  1. First incorporate the upstream changes, to ensure old github actions still work
  2. Create a branch here for just your change (no reformatting nothing) so you can submit it upstream
  3. Then update to use circleci (don't forget to get rid of the github actions...). Initially you can turn checkstyle off.
  4. Finally do your actual changes, it's ok if reformatting is included in there, but I really think it's hard to take on everything at once. You can cherry pick your fix from 2. above.

I split this PR into more smaller PRs.
I'll decline this one.

@andras-markos andras-markos deleted the LT-1633-Incorrect-JSONLogic-behaviour-for-watched-content-changed-evaluation-when-null-value-provided branch August 15, 2025 05:26
@andras-markos
Copy link
Author

Deleted the feature branch as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants