ticofab / android-gpx-parser

A library to parse XML Gpx files, built for Android.
Apache License 2.0
123 stars 44 forks source link

Change `Point` constructor to `protected` #32

Closed msbit closed 3 years ago

msbit commented 3 years ago

Change the Point constructor from the default package-private access to protected

ticofab commented 3 years ago

Hey @msbit , thanks for opening this PR! What is the purpose/use case of this change?

msbit commented 3 years ago

Ha yes, I was thinking it would tighten up where/how a Point could be instantiated because otherwise you could do something like:

WayPoint.Builder builder = new WayPoint.Builder();
Point point = new Point(builder);

but then when I actually tried to put that together, I get:

error: Point is abstract; cannot be instantiated

(of course).

It's up to you whether that additional protected is useful signal, or confusing noise, I'm happy either way now that I've actually tested it out :)

ticofab commented 3 years ago

Thanks for testing it out and your comment. I'd rather keep things consistent so I'm going to close it without merging and thanks again for your PR and inputs!

msbit commented 3 years ago

Yep all good mate.