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

Is it possible to retrofit generics without breaking API? #492

Open
dr-jts opened this issue Nov 1, 2019 · 3 comments
Open

Is it possible to retrofit generics without breaking API? #492

dr-jts opened this issue Nov 1, 2019 · 3 comments

Comments

@dr-jts
Copy link
Contributor

dr-jts commented Nov 1, 2019

Would it be possible to retrofit some generics to JTS? How much can this be done without breaking API? Would this be helpful?

@dr-jts dr-jts changed the title Retrofit generics in JTS? Is it possible to retrofit generics without breaking API? Nov 1, 2019
@dbaston
Copy link
Contributor

dbaston commented Nov 1, 2019

Related: #146

@dr-jts
Copy link
Contributor Author

dr-jts commented Nov 1, 2019

As noted on #146 and here [1], it looks like types can be made generic but still used without type arguments (as raw types). So that should allow generics to be added to JTS container classes (such as indexes) without changing API (apart from more warnings, probably).

The next question: is it possible to define generic type parameters on method arguments and yet call them with a raw type?

[1] http://www.angelikalanger.com/GenericsFAQ/FAQSections/ParameterizedTypes.html#FAQ201

@dr-jts
Copy link
Contributor Author

dr-jts commented Nov 1, 2019

The next question: is it possible to define generic type parameters on method arguments and yet call them with a raw type?

My understanding of this Generics FAQ answer is that the answer is YES.

So it sounds like generics can be added essentially everywhere in the JTS API with the only effect being possibly more compiler warnings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants