diff options
author | John Firebaugh <john.firebaugh@gmail.com> | 2018-08-22 12:27:43 -0700 |
---|---|---|
committer | John Firebaugh <john.firebaugh@gmail.com> | 2018-09-07 09:44:12 -0700 |
commit | 79bf0e8af6bf9ec829a352d56b8e70ccc8f4fa41 (patch) | |
tree | 2b646523d45f0fa9917612ed80de12bbd35d5b1e /platform/android/src/geojson/feature_collection.cpp | |
parent | 5911e3b13f2f2b6741e26db3e41513ed21cc95b4 (diff) | |
download | qtlocation-mapboxgl-79bf0e8af6bf9ec829a352d56b8e70ccc8f4fa41.tar.gz |
[android] jni.hpp 4.0.0
Diffstat (limited to 'platform/android/src/geojson/feature_collection.cpp')
-rw-r--r-- | platform/android/src/geojson/feature_collection.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/platform/android/src/geojson/feature_collection.cpp b/platform/android/src/geojson/feature_collection.cpp index c2825e037b..f90d5226b7 100644 --- a/platform/android/src/geojson/feature_collection.cpp +++ b/platform/android/src/geojson/feature_collection.cpp @@ -6,24 +6,24 @@ namespace mbgl { namespace android { namespace geojson { -mbgl::FeatureCollection FeatureCollection::convert(jni::JNIEnv& env, jni::Object<FeatureCollection> jCollection) { +mbgl::FeatureCollection FeatureCollection::convert(jni::JNIEnv& env, const jni::Object<FeatureCollection>& jCollection) { auto collection = mbgl::FeatureCollection(); if (jCollection) { - auto jFeatureList = jni::SeizeLocal(env, FeatureCollection::features(env, jCollection)); - auto jFeatures = jni::SeizeLocal(env, java::util::List::toArray<Feature>(env, *jFeatureList)); - auto size = size_t(jFeatures->Length(env)); + auto jFeatureList = FeatureCollection::features(env, jCollection); + auto jFeatures = java::util::List::toArray<Feature>(env, jFeatureList); + auto size = size_t(jFeatures.Length(env)); collection.reserve(size); for (size_t i = 0; i < size; i++) { - collection.push_back(Feature::convert(env, *jni::SeizeLocal(env, jFeatures->Get(env, i)))); + collection.push_back(Feature::convert(env, jFeatures.Get(env, i))); } } return collection; } -jni::Object<java::util::List> FeatureCollection::features(jni::JNIEnv& env, jni::Object<FeatureCollection> jCollection) { - static auto javaClass = jni::Class<FeatureCollection>::Singleton(env); +jni::Local<jni::Object<java::util::List>> FeatureCollection::features(jni::JNIEnv& env, const jni::Object<FeatureCollection>& jCollection) { + static auto& javaClass = jni::Class<FeatureCollection>::Singleton(env); static auto method = javaClass.GetMethod<jni::Object<java::util::List> ()>(env, "features"); return jCollection.Call(env, method); } |