From 27447517e34292ee483c0287232f4d254d9fedf3 Mon Sep 17 00:00:00 2001 From: rachytski Date: Mon, 21 May 2012 22:53:59 +0400 Subject: [PATCH] fixed MapStorage.Index creation through constructor. --- android/jni/com/mapswithme/maps/MapStorage.cpp | 11 +++++++---- android/src/com/mapswithme/maps/MapStorage.java | 5 ----- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/android/jni/com/mapswithme/maps/MapStorage.cpp b/android/jni/com/mapswithme/maps/MapStorage.cpp index 8fca668bcf..0ff1483c74 100644 --- a/android/jni/com/mapswithme/maps/MapStorage.cpp +++ b/android/jni/com/mapswithme/maps/MapStorage.cpp @@ -54,14 +54,17 @@ extern "C" { JNIEnv * env = jni::GetEnv(); - jclass klass = env->FindClass("com/mapswithme/maps/MapStorage"); + jclass klass = env->FindClass("com/mapswithme/maps/MapStorage$Index"); ASSERT(klass, ()); - jmethodID methodId = env->GetStaticMethodID(klass, - "createIndex", "(III)Lcom/mapswithme/maps/MapStorage$Index;"); + jint group = idx.m_group; + jint country = idx.m_country; + jint region = idx.m_region; + + jmethodID methodID = env->GetMethodID(klass, "", "(III)V") ASSERT(methodId, ()); - return env->CallStaticObjectMethod(klass, methodId, idx.m_group, idx.m_country, idx.m_region); + return env->NewObject(klass, methodID, group, country, region); } }; diff --git a/android/src/com/mapswithme/maps/MapStorage.java b/android/src/com/mapswithme/maps/MapStorage.java index 595bc2d768..151579e7af 100644 --- a/android/src/com/mapswithme/maps/MapStorage.java +++ b/android/src/com/mapswithme/maps/MapStorage.java @@ -133,9 +133,4 @@ public class MapStorage return mInstance; } - - public static Index createIndex(int group, int country, int region) - { - return new Index(group, country, region); - } }