diff options
Diffstat (limited to 'platform/android/src/geojson/feature.cpp')
-rw-r--r-- | platform/android/src/geojson/feature.cpp | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/platform/android/src/geojson/feature.cpp b/platform/android/src/geojson/feature.cpp index 809ac42ef7..e79c238864 100644 --- a/platform/android/src/geojson/feature.cpp +++ b/platform/android/src/geojson/feature.cpp @@ -8,18 +8,18 @@ namespace geojson { using namespace gson; -mbgl::Feature Feature::convert(jni::JNIEnv& env, jni::Object<Feature> jFeature) { - static auto javaClass = jni::Class<Feature>::Singleton(env); +mbgl::Feature Feature::convert(jni::JNIEnv& env, const jni::Object<Feature>& jFeature) { + static auto& javaClass = jni::Class<Feature>::Singleton(env); static auto id = javaClass.GetMethod<jni::String ()>(env, "id"); static auto geometry = javaClass.GetMethod<jni::Object<Geometry> ()>(env, "geometry"); static auto properties = javaClass.GetMethod<jni::Object<gson::JsonObject> ()>(env, "properties"); - auto jId = jni::SeizeLocal(env, jFeature.Call(env, id)); + auto jId = jFeature.Call(env, id); return mbgl::Feature { - Geometry::convert(env, *jni::SeizeLocal(env, jFeature.Call(env, geometry))), - JsonObject::convert(env, *jni::SeizeLocal(env, jFeature.Call(env, properties))), - jId ? std::experimental::optional<mapbox::geometry::identifier>(jni::Make<std::string>(env, *jId)) + Geometry::convert(env, jFeature.Call(env, geometry)), + JsonObject::convert(env, jFeature.Call(env, properties)), + jId ? std::experimental::optional<mapbox::geometry::identifier>(jni::Make<std::string>(env, jId)) : std::experimental::nullopt }; } @@ -43,21 +43,21 @@ public: } }; -jni::Object<Feature> convertFeature(jni::JNIEnv& env, const mbgl::Feature& value) { - static auto javaClass = jni::Class<Feature>::Singleton(env); +jni::Local<jni::Object<Feature>> convertFeature(jni::JNIEnv& env, const mbgl::Feature& value) { + static auto& javaClass = jni::Class<Feature>::Singleton(env); static auto method = javaClass.GetStaticMethod<jni::Object<Feature> (jni::Object<Geometry>, jni::Object<JsonObject>, jni::String)>(env, "fromGeometry"); return javaClass.Call(env, method, - *jni::SeizeLocal(env, Geometry::New(env, value.geometry)), - *jni::SeizeLocal(env, JsonObject::New(env, value.properties)), - *jni::SeizeLocal(env, jni::Make<jni::String>(env, value.id ? value.id.value().match(FeatureIdVisitor()) : ""))); + Geometry::New(env, value.geometry), + JsonObject::New(env, value.properties), + jni::Make<jni::String>(env, value.id ? value.id.value().match(FeatureIdVisitor()) : "")); } -jni::Array<jni::Object<Feature>> Feature::convert(jni::JNIEnv& env, const std::vector<mbgl::Feature>& value) { +jni::Local<jni::Array<jni::Object<Feature>>> Feature::convert(jni::JNIEnv& env, const std::vector<mbgl::Feature>& value) { auto features = jni::Array<jni::Object<Feature>>::New(env, value.size()); for (size_t i = 0; i < value.size(); i = i + 1) { - features.Set(env, i, *jni::SeizeLocal(env, convertFeature(env, value.at(i)))); + features.Set(env, i, convertFeature(env, value.at(i))); } return features; |