[platform][jni] review fixes

This commit is contained in:
Arsentiy Milchakov 2018-02-02 10:40:27 +03:00 committed by Roman Kuznetsov
parent 2f11131c9f
commit 0b60716879
4 changed files with 12 additions and 11 deletions

View file

@ -291,20 +291,20 @@ void DumpDalvikReferenceTables()
jobject ToKeyValue(JNIEnv * env, std::pair<std::string, std::string> src)
{
static jmethodID const PairInit = jni::GetConstructorID(
static jmethodID const keyValueInit = jni::GetConstructorID(
env, g_keyValueClazz, "(Ljava/lang/String;Ljava/lang/String;)V");
jni::TScopedLocalRef key(env, jni::ToJavaString(env, src.first));
jni::TScopedLocalRef value(env, jni::ToJavaString(env, src.second));
return env->NewObject(g_keyValueClazz, PairInit, key.get(), value.get());
return env->NewObject(g_keyValueClazz, keyValueInit, key.get(), value.get());
}
std::pair<std::string, std::string> ToNativeKeyValue(JNIEnv * env, jobject pairOfStrings)
{
static jfieldID const keyId = env->GetFieldID(g_keyValueClazz, "key",
static jfieldID const keyId = env->GetFieldID(g_keyValueClazz, "mKey",
"Ljava/lang/String;");
static jfieldID const valueId = env->GetFieldID(g_keyValueClazz, "value",
static jfieldID const valueId = env->GetFieldID(g_keyValueClazz, "mValue",
"Ljava/lang/String;");
jni::ScopedLocalRef<jstring> const key(

View file

@ -99,7 +99,7 @@ public final class HttpClient
for (KeyValue header : p.headers)
{
connection.setRequestProperty(header.key, header.value);
connection.setRequestProperty(header.mKey, header.mValue);
}
if (!TextUtils.isEmpty(p.inputFilePath) || p.data != null)

View file

@ -4,6 +4,7 @@ import android.support.annotation.NonNull;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
final class HttpUploader
{
@ -12,9 +13,9 @@ final class HttpUploader
@NonNull
private final String mUrl;
@NonNull
private final ArrayList<KeyValue> mParams;
private final List<KeyValue> mParams;
@NonNull
private final ArrayList<KeyValue> mHeaders;
private final List<KeyValue> mHeaders;
@NonNull
private final String mFileKey;
@NonNull

View file

@ -6,12 +6,12 @@ final class KeyValue
{
KeyValue(@NonNull String key, @NonNull String value)
{
this.key = key;
this.value = value;
mKey = key;
mValue = value;
}
@NonNull
public final String key;
public final String mKey;
@NonNull
public final String value;
public final String mValue;
}