Skip to content
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

[DE-684] confuse about some code #260

Open
Korov opened this issue Jan 1, 2023 · 5 comments
Open

[DE-684] confuse about some code #260

Korov opened this issue Jan 1, 2023 · 5 comments
Assignees
Labels

Comments

@Korov
Copy link

Korov commented Jan 1, 2023

com.arangodb.springframework.repository.query.derived.DerivedQueryCreator#createCriteria

the code final boolean checkUnique = part.getProperty().toDotPath().split(".").length <= 1; should be final boolean checkUnique = part.getProperty().toDotPath().split("\\.").length <= 1;?

@DevPJ9
Copy link

DevPJ9 commented Jan 1, 2023

@Korov If you are asking regrading the regex, then I think the second approach (final boolean checkUnique = part.getProperty().toDotPath().split("\\.").length <= 1;) is the correct one.

@Korov
Copy link
Author

Korov commented Jan 1, 2023

@DevPJ9 Can I create a PR to fix it?

@DevPJ9
Copy link

DevPJ9 commented Jan 1, 2023

Yeah sure.
I am not related to arongdb. So I am not sure about rest.

However, you can raise a PR and mention it to someone who has admin rights or reviewing right to this repo, so that they can merge your PR.

@Korov Korov mentioned this issue Jan 1, 2023
@rashtao
Copy link
Collaborator

rashtao commented Jan 20, 2023

This looks like a bug to me. AFAICS, fixing the regex with \\. would only lead to further bugs, namely if checkUnique is false then checkUniqueLocation(Part) is never invoked and uniqueLocation is null.
This would generate AQL problems, i.e. accessing location field with null[0], null[1], in case the point is represented as an array of coordinate components.

Note that the code paths for checkUnique=false are in fact not tested.

@rashtao rashtao self-assigned this Jan 20, 2023
@rashtao rashtao added the bug label Jan 20, 2023
@rashtao
Copy link
Collaborator

rashtao commented Jan 24, 2024

Internal tracking: DE-684

@rashtao rashtao changed the title confuse about some code [DE-684] confuse about some code Jan 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants