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

SeriesBuilder missing generics parameter #185

Closed
Bethibande opened this issue Jul 12, 2024 · 1 comment
Closed

SeriesBuilder missing generics parameter #185

Bethibande opened this issue Jul 12, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@Bethibande
Copy link
Contributor

Bethibande commented Jul 12, 2024

Describe the bug
Not exactly a bug, but the SeriesBuilder class is pretty much unusable, the static getmethod is the only way of instantiating it but doesn't accept a generic type. Why have the generic type in the first place if you cannot use it?

Steps or code example to Reproduce
The following code will cause a compiler error, since the withData method expects a parameter of type capture of ?... which isn't possible. There is no way to set the generic type of the SeriesBuilder class without using an unsafe cast.

final Series series = SeriesBuilder.get().withData(1.0).build()

The current implementation of the get method is as follows

public static SeriesBuilder<?> get() {
    return new SeriesBuilder();
}

Expected behavior
I'd expect the static get method to have a generic type, changing it to:

public static <T> SeriesBuilder<T> get() {
    return new SeriesBuilder<>();
}
@Bethibande Bethibande added the bug Something isn't working label Jul 12, 2024
Bethibande added a commit to Bethibande/apexcharts-flow that referenced this issue Jul 12, 2024
@Loahrs
Copy link
Collaborator

Loahrs commented Jul 22, 2024

Fixed by #186

@Loahrs Loahrs closed this as completed Jul 22, 2024
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