Skip to content

Fix: checking if a parameter is integer in packer by using Integer.isInteger #188

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 16, 2017
Merged

Fix: checking if a parameter is integer in packer by using Integer.isInteger #188

merged 1 commit into from
Jan 16, 2017

Conversation

legraphista
Copy link
Contributor

In the following scenario we have one module that uses a different version of neo4j-driver that the one that is installed in the project.

node_modules/
 - [email protected]
 - module_a/
  - [email protected]

This will result in loading 2 instances of neo4j-driver and 2 instances of the class Integer.

Now lets say that module_a generates an Integer using it's version of the Integer class and then that integer is passed in a query (using the project's version of neo4j-driver). When the packer checks for integer it checks the class, but it check it's version of Integer which is different and fails to parse it as an integer, defaulting to parse it as an object ({low, high}).

image
As seen in the screenshot, in the packer, x is an Integer class, but not the same class that is checked against.

I think a good solution for this is to use the Integer.isInteger implementation to check for integers.

@lutovich
Copy link
Contributor

Hi @legraphista,

Thanks for the fix. It makes perfect sense. I'll merge it to 1.0 and 1.1 branches.

@lutovich lutovich merged commit 2be25cd into neo4j:1.0 Jan 16, 2017
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.

2 participants