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

GeoJsonFeature fromJson viaolates same JSON name mId #488

Closed
P72B opened this issue Nov 21, 2018 · 1 comment
Closed

GeoJsonFeature fromJson viaolates same JSON name mId #488

P72B opened this issue Nov 21, 2018 · 1 comment

Comments

@P72B
Copy link
Contributor

P72B commented Nov 21, 2018

Summary:

I as a user of the android-maps-utils whant to create a GeoJsonFeature from given JSON string. For example new Gson().fromJson(stringifyedGeoJsonFeature, GeoJsonFeature.class).

Steps to reproduce:

Update the android-maps-utils version from 0.4.4 to 0.5+. Parse a valid given JSON string like: new Gson().fromJson(stringifyedGeoJsonFeature, GeoJsonFeature.class). It will crash.

Expected behavior:

The parsing of the JSON string will succeed and I can use the GeoJsonFeature object in my code.

Observed behavior:

This error message will appear:
java.lang.IllegalArgumentException: class com.google.maps.android.data.geojson.GeoJsonFeature declares multiple JSON fields named mId

Background:
Since v0.5+ the class GeoJsonFeature now extends Feature. And both classes have the private member variable mId. My proposal make the mId inside Feature.java protected and the described issue will be gone. Or rename the member mId inside the GeoJsonFeature.

P72B pushed a commit to P72B/android-maps-utils that referenced this issue Nov 21, 2018
P72B pushed a commit to P72B/android-maps-utils that referenced this issue Nov 21, 2018
P72B pushed a commit to P72B/android-maps-utils that referenced this issue Dec 10, 2018
amuramoto added a commit that referenced this issue May 11, 2019
@amuramoto
Copy link
Member

merged fix from #490

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

No branches or pull requests

2 participants