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

Type safety Warning on Result class #479

Open
alallema opened this issue Oct 27, 2022 · 4 comments
Open

Type safety Warning on Result class #479

alallema opened this issue Oct 27, 2022 · 4 comments
Labels
bug Something isn't working

Comments

@alallema
Copy link
Contributor

alallema commented Oct 27, 2022

Description
Type safety is not applied when decoding the Result class throught the JSON handler in the method getKeys() and getTasks()

        Result<Key> result = httpClient.get(urlPath, Result.class, Key.class);
        Result<Task> result = httpClient.get(urlPath, Result.class, Task.class);

This warning is thrown:
Type safety: The expression of type Result needs unchecked conversion to conform to Result<Key>Java(16777748)

Notes
This issue should be implemented before the resolution of #420

@alallema alallema changed the title Type safety Warning on KeysHandler Type safety Warning on Result class Oct 27, 2022
@alallema alallema added the bug Something isn't working label Oct 27, 2022
@ancatoza
Copy link

ancatoza commented Mar 9, 2023

Hi
Can I contribute trying t debug this?

@alallema
Copy link
Contributor Author

Hi @ancatoza,
Yes of course with pleasure 😊

@ancatoza
Copy link

hi :)
I'll start working on this issue inmediately, can you please confirm that the following path is the correct one?
meilisearch-java/src/main/java/com/meilisearch/sdk/model/Results.java

@alallema
Copy link
Contributor Author

alallema commented Mar 27, 2023

As stated in the issue, the warning is displayed in these two classes:

in the method getKeys() and getTasks()

So respectively, in the files TasksHandler.java and KeysHandler.java. But I'm pretty sure the main problem comes with how types are processed in the JsonHandler from decode method.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants