-
Notifications
You must be signed in to change notification settings - Fork 1
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
Work around vacuous type parameters in LabelingIOService.load #4
Comments
So, I have been thinking about the type params. What are your thoughts on that? |
My main concern is with the vacuous type parameters. I don't think that As far as the other two are concerned, I think that they must be rewritten to the broadest return allowed by ImgLabeling<?, ? extends IntegerType<?>> loadNew(String file) throws IOException; If you want nice type safety, you'd need to probably:
|
I suppose I have to go a hybrid approach or only use class arguments. I will try the hybrid approach tomorrow. |
Update for today: The other option would be to allow the user to add (de-)serializers and call the Gson Parser API, which would result in code similar to the Bson Codecs from before. |
This is a step forward, for sure. Thanks @tomburke-rse It is unfortunate, though, that it forces an explicit Gson dependency on anyone wanting to use this method. |
That's true...And hardly acceptable from a usability point of view. Then
it's back to class arguments and I'll see if I can build the tokens or a
parser from that.
Gabriel Selzer ***@***.***> schrieb am Do., 7. Apr. 2022,
17:45:
… load("Somepath", new TypeToken<LabelingData<Example,Example>>())
This is a step forward, for sure. Thanks @tomburke-rse
<https://github.com/tomburke-rse>
It is unfortunate, though, that it forces an explicit Gson dependency on
anyone wanting to use this method.
—
Reply to this email directly, view it on GitHub
<#4 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AQR5MT636XCKSM74CGRHGYLVD37I5ANCNFSM5SWKDWEQ>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
The type parameters in
LabelingIOService.load()
are vacuous, which could lead to some nastyClassCastException
s.See #3 (comment)
The text was updated successfully, but these errors were encountered: