-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Comments
P72B
pushed a commit
to P72B/android-maps-utils
that referenced
this issue
Nov 21, 2018
…declaration issues for JSON fields.
P72B
pushed a commit
to P72B/android-maps-utils
that referenced
this issue
Nov 21, 2018
…declaration issues for JSON fields.
P72B
pushed a commit
to P72B/android-maps-utils
that referenced
this issue
Dec 10, 2018
…declaration issues for JSON fields.
amuramoto
added a commit
that referenced
this issue
May 11, 2019
#488 Made Feature member id protected
merged fix from #490 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The text was updated successfully, but these errors were encountered: