jts icon indicating copy to clipboard operation
jts copied to clipboard

Is it possible to retrofit generics without breaking API?

Open dr-jts opened this issue 6 years ago • 3 comments

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 avatar Nov 01 '19 16:11 dr-jts

Related: https://github.com/locationtech/jts/issues/146

dbaston avatar Nov 01 '19 17:11 dbaston

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 avatar Nov 01 '19 20:11 dr-jts

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.

dr-jts avatar Nov 01 '19 20:11 dr-jts