diff options
author | 2018-02-22 15:03:05 -0800 | |
---|---|---|
committer | 2018-02-22 15:28:50 -0800 | |
commit | 06537f7a6f0772cbef08bdded933828378b2d32a (patch) | |
tree | e1505a3dea19d6585973d2db0d9dd6988bf0f03d /runtime/native/java_lang_String.cc | |
parent | a502c7202f56b8f5f2c5de567359fa7f6bab406f (diff) |
native: Cleanup jni usage code
Make the C++ signature consistent with the JNI descriptor by using the
same type as the descriptor whenever possible.
e.g. "()Ljava/lang/String;" should actually be "jstring fn(JNIEnv*,jobject)"
instead of "jobject fn(JNIEnv*,jobject)".
Bug: 35325126
Change-Id: I72318525fc3b18b013b8d6fa604d8dd6b5dd4400
Test: make -j32 test-art-host # and also manually that it boots
Diffstat (limited to 'runtime/native/java_lang_String.cc')
-rw-r--r-- | runtime/native/java_lang_String.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/runtime/native/java_lang_String.cc b/runtime/native/java_lang_String.cc index 9295ff7071..b5aea7ca7c 100644 --- a/runtime/native/java_lang_String.cc +++ b/runtime/native/java_lang_String.cc @@ -37,7 +37,7 @@ static jchar String_charAt(JNIEnv* env, jobject java_this, jint index) { return soa.Decode<mirror::String>(java_this)->CharAt(index); } -static jint String_compareTo(JNIEnv* env, jobject java_this, jobject java_rhs) { +static jint String_compareTo(JNIEnv* env, jobject java_this, jstring java_rhs) { ScopedFastNativeObjectAccess soa(env); if (UNLIKELY(java_rhs == nullptr)) { ThrowNullPointerException("rhs == null"); @@ -48,7 +48,7 @@ static jint String_compareTo(JNIEnv* env, jobject java_this, jobject java_rhs) { } } -static jstring String_concat(JNIEnv* env, jobject java_this, jobject java_string_arg) { +static jstring String_concat(JNIEnv* env, jobject java_this, jstring java_string_arg) { ScopedFastNativeObjectAccess soa(env); if (UNLIKELY(java_string_arg == nullptr)) { ThrowNullPointerException("string arg == null"); |