meilisearch / meilisearch/meilisearch-java

Type safety Warning on `Result` class

Open
#479 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Java
Stars
245
Forks
152
PR merge metrics
No merged PRs in 30d

Description

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the getKeys() and getTasks() entry points and inspect the JSON handler's decoding of Result.class with Key.class and Task.class. Check how the Result type is declared and how #420 affects the work; done means the unchecked conversion warning is resolved while both results remain correctly typed.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
api
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.