Permalink
Browse files

Make libjavacore independent of libnativehelper for the PDK.

Bug: 6369821
Change-Id: Ie038571a5dac1f301c0c3c6fb84df432e67b62c0
  • Loading branch information...
1 parent 88f3ec9 commit 7cd6760f7045d771faae8080a8c6150bf678f679 @enh enh committed May 4, 2012
Showing with 147 additions and 206 deletions.
  1. +1 −0 Android.mk
  2. +8 −5 NativeCode.mk
  3. +47 −84 luni/src/main/native/Register.cpp
  4. +2 −2 luni/src/main/native/java_io_Console.cpp
  5. +2 −2 luni/src/main/native/java_io_File.cpp
  6. +2 −2 luni/src/main/native/java_io_ObjectStreamClass.cpp
  7. +2 −2 luni/src/main/native/java_lang_Character.cpp
  8. +2 −2 luni/src/main/native/java_lang_Math.cpp
  9. +2 −2 luni/src/main/native/java_lang_ProcessManager.cpp
  10. +2 −2 luni/src/main/native/java_lang_RealToString.cpp
  11. +2 −2 luni/src/main/native/java_lang_StrictMath.cpp
  12. +2 −2 luni/src/main/native/java_lang_StringToReal.cpp
  13. +2 −2 luni/src/main/native/java_lang_System.cpp
  14. +2 −2 luni/src/main/native/java_math_NativeBN.cpp
  15. +2 −2 luni/src/main/native/java_nio_ByteOrder.cpp
  16. +2 −2 luni/src/main/native/java_nio_charset_Charsets.cpp
  17. +2 −2 luni/src/main/native/java_text_Bidi.cpp
  18. +2 −2 luni/src/main/native/java_util_regex_Matcher.cpp
  19. +2 −2 luni/src/main/native/java_util_regex_Pattern.cpp
  20. +2 −2 luni/src/main/native/java_util_zip_Adler32.cpp
  21. +2 −2 luni/src/main/native/java_util_zip_CRC32.cpp
  22. +2 −2 luni/src/main/native/java_util_zip_Deflater.cpp
  23. +2 −2 luni/src/main/native/java_util_zip_Inflater.cpp
  24. +4 −4 luni/src/main/native/libcore_icu_ICU.cpp
  25. +2 −2 luni/src/main/native/libcore_icu_NativeBreakIterator.cpp
  26. +2 −2 luni/src/main/native/libcore_icu_NativeCollation.cpp
  27. +2 −2 luni/src/main/native/libcore_icu_NativeConverter.cpp
  28. +2 −2 luni/src/main/native/libcore_icu_NativeDecimalFormat.cpp
  29. +2 −2 luni/src/main/native/libcore_icu_NativeIDN.cpp
  30. +2 −2 luni/src/main/native/libcore_icu_NativeNormalizer.cpp
  31. +2 −2 luni/src/main/native/libcore_icu_NativePluralRules.cpp
  32. +2 −2 luni/src/main/native/libcore_icu_TimeZones.cpp
  33. +2 −2 luni/src/main/native/libcore_io_AsynchronousCloseMonitor.cpp
  34. +2 −2 luni/src/main/native/libcore_io_Memory.cpp
  35. +2 −2 luni/src/main/native/libcore_io_OsConstants.cpp
  36. +2 −2 luni/src/main/native/libcore_io_Posix.cpp
  37. +5 −9 luni/src/main/native/libcore_net_RawSocket.cpp
  38. +14 −23 luni/src/main/native/org_apache_harmony_xml_ExpatParser.cpp
  39. +2 −5 luni/src/main/native/org_apache_harmony_xnet_provider_jsse_NativeCrypto.cpp
  40. +2 −12 luni/src/main/native/sub.mk
View
@@ -58,6 +58,7 @@ ifeq ($(WITH_HOST_DALVIK),true)
dalvik \
$(HOST_OUT)/bin/dalvikvm \
$(HOST_OUT)/bin/dexopt \
+ $(HOST_OUT)/lib/libjavacore.so \
cacerts-host \
$(HOST_OUT)/usr/share/zoneinfo/zoneinfo.dat \
$(HOST_OUT)/usr/share/zoneinfo/zoneinfo.idx \
View
@@ -87,15 +87,15 @@ endif
# Define the rules.
LOCAL_SRC_FILES := $(core_src_files)
LOCAL_C_INCLUDES := $(core_c_includes)
-LOCAL_SHARED_LIBRARIES := $(core_shared_libraries)
+LOCAL_SHARED_LIBRARIES := $(core_shared_libraries) libexpat libicuuc libicui18n libssl libcrypto libz libnativehelper
LOCAL_STATIC_LIBRARIES := $(core_static_libraries)
LOCAL_MODULE_TAGS := optional
LOCAL_MODULE := libjavacore
LOCAL_C_INCLUDES += external/stlport/stlport bionic/ bionic/libstdc++/include
LOCAL_SHARED_LIBRARIES += libstlport
-include $(BUILD_STATIC_LIBRARY)
+include $(BUILD_SHARED_LIBRARY)
#
# Build for the host.
@@ -106,9 +106,12 @@ ifeq ($(WITH_HOST_DALVIK),true)
# Define the rules.
LOCAL_SRC_FILES := $(core_src_files)
LOCAL_CFLAGS += $(core_cflags)
- LOCAL_CPPFLAGS += $(core_cppflags)
LOCAL_C_INCLUDES := $(core_c_includes)
+ LOCAL_CPPFLAGS += $(core_cppflags)
+ LOCAL_LDLIBS += -ldl -lpthread
LOCAL_MODULE_TAGS := optional
- LOCAL_MODULE := libjavacore-host
- include $(BUILD_HOST_STATIC_LIBRARY)
+ LOCAL_MODULE := libjavacore
+ LOCAL_SHARED_LIBRARIES := $(core_shared_libraries) libexpat libicuuc libicui18n libssl libcrypto libz-host
+ LOCAL_STATIC_LIBRARIES := $(core_static_libraries)
+ include $(BUILD_HOST_SHARED_LIBRARY)
endif
@@ -21,93 +21,56 @@
#include <stdlib.h>
-extern int register_java_io_Console(JNIEnv* env);
-extern int register_java_io_File(JNIEnv* env);
-extern int register_java_io_ObjectStreamClass(JNIEnv* env);
-extern int register_java_lang_Character(JNIEnv* env);
-extern int register_java_lang_Math(JNIEnv* env);
-extern int register_java_lang_ProcessManager(JNIEnv* env);
-extern int register_java_lang_RealToString(JNIEnv* env);
-extern int register_java_lang_StrictMath(JNIEnv* env);
-extern int register_java_lang_StringToReal(JNIEnv* env);
-extern int register_java_lang_System(JNIEnv* env);
-extern int register_java_math_NativeBN(JNIEnv* env);
-extern int register_java_nio_ByteOrder(JNIEnv* env);
-extern int register_java_nio_charset_Charsets(JNIEnv* env);
-extern int register_java_text_Bidi(JNIEnv* env);
-extern int register_java_util_regex_Matcher(JNIEnv* env);
-extern int register_java_util_regex_Pattern(JNIEnv* env);
-extern int register_java_util_zip_Adler32(JNIEnv* env);
-extern int register_java_util_zip_CRC32(JNIEnv* env);
-extern int register_java_util_zip_Deflater(JNIEnv* env);
-extern int register_java_util_zip_Inflater(JNIEnv* env);
-extern int register_libcore_icu_ICU(JNIEnv* env);
-extern int register_libcore_icu_NativeBreakIterator(JNIEnv* env);
-extern int register_libcore_icu_NativeCollation(JNIEnv* env);
-extern int register_libcore_icu_NativeConverter(JNIEnv* env);
-extern int register_libcore_icu_NativeDecimalFormat(JNIEnv* env);
-extern int register_libcore_icu_NativeIDN(JNIEnv* env);
-extern int register_libcore_icu_NativeNormalizer(JNIEnv* env);
-extern int register_libcore_icu_NativePluralRules(JNIEnv* env);
-extern int register_libcore_icu_TimeZones(JNIEnv* env);
-extern int register_libcore_io_AsynchronousCloseMonitor(JNIEnv* env);
-extern int register_libcore_io_Memory(JNIEnv* env);
-extern int register_libcore_io_OsConstants(JNIEnv* env);
-extern int register_libcore_io_Posix(JNIEnv* env);
-extern int register_libcore_net_RawSocket(JNIEnv* env);
-extern int register_org_apache_harmony_dalvik_NativeTestTarget(JNIEnv* env);
-extern int register_org_apache_harmony_xml_ExpatParser(JNIEnv* env);
-extern int register_org_apache_harmony_xnet_provider_jsse_NativeCrypto(JNIEnv* env);
-
// DalvikVM calls this on startup, so we can statically register all our native methods.
-int registerCoreLibrariesJni(JNIEnv* env) {
+int JNI_OnLoad(JavaVM* vm, void*) {
+ JNIEnv* env;
+ if (vm->GetEnv(reinterpret_cast<void**>(&env), JNI_VERSION_1_6) != JNI_OK) {
+ ALOGE("JavaVM::GetEnv() failed");
+ abort();
+ }
+
ScopedLocalFrame localFrame(env);
JniConstants::init(env);
- bool result =
- register_java_io_Console(env) != -1 &&
- register_java_io_File(env) != -1 &&
- register_java_io_ObjectStreamClass(env) != -1 &&
- register_java_lang_Character(env) != -1 &&
- register_java_lang_Math(env) != -1 &&
- register_java_lang_ProcessManager(env) != -1 &&
- register_java_lang_RealToString(env) != -1 &&
- register_java_lang_StrictMath(env) != -1 &&
- register_java_lang_StringToReal(env) != -1 &&
- register_java_lang_System(env) != -1 &&
- register_java_math_NativeBN(env) != -1 &&
- register_java_nio_ByteOrder(env) != -1 &&
- register_java_nio_charset_Charsets(env) != -1 &&
- register_java_text_Bidi(env) != -1 &&
- register_java_util_regex_Matcher(env) != -1 &&
- register_java_util_regex_Pattern(env) != -1 &&
- register_java_util_zip_Adler32(env) != -1 &&
- register_java_util_zip_CRC32(env) != -1 &&
- register_java_util_zip_Deflater(env) != -1 &&
- register_java_util_zip_Inflater(env) != -1 &&
- register_libcore_icu_ICU(env) != -1 &&
- register_libcore_icu_NativeBreakIterator(env) != -1 &&
- register_libcore_icu_NativeCollation(env) != -1 &&
- register_libcore_icu_NativeConverter(env) != -1 &&
- register_libcore_icu_NativeDecimalFormat(env) != -1 &&
- register_libcore_icu_NativeIDN(env) != -1 &&
- register_libcore_icu_NativeNormalizer(env) != -1 &&
- register_libcore_icu_NativePluralRules(env) != -1 &&
- register_libcore_icu_TimeZones(env) != -1 &&
- register_libcore_io_AsynchronousCloseMonitor(env) != -1 &&
- register_libcore_io_Memory(env) != -1 &&
- register_libcore_io_OsConstants(env) != -1 &&
- register_libcore_io_Posix(env) != -1 &&
- register_libcore_net_RawSocket(env) != -1 &&
- register_org_apache_harmony_dalvik_NativeTestTarget(env) != -1 &&
- register_org_apache_harmony_xml_ExpatParser(env) != -1 &&
- register_org_apache_harmony_xnet_provider_jsse_NativeCrypto(env) != -1 &&
- true;
-
- if (!result) {
- ALOGE("Failed to initialize the core libraries; aborting...");
- abort();
- }
- return 0;
+#define REGISTER(FN) extern void FN(JNIEnv*); FN(env)
+ REGISTER(register_java_io_Console);
+ REGISTER(register_java_io_File);
+ REGISTER(register_java_io_ObjectStreamClass);
+ REGISTER(register_java_lang_Character);
+ REGISTER(register_java_lang_Math);
+ REGISTER(register_java_lang_ProcessManager);
+ REGISTER(register_java_lang_RealToString);
+ REGISTER(register_java_lang_StrictMath);
+ REGISTER(register_java_lang_StringToReal);
+ REGISTER(register_java_lang_System);
+ REGISTER(register_java_math_NativeBN);
+ REGISTER(register_java_nio_ByteOrder);
+ REGISTER(register_java_nio_charset_Charsets);
+ REGISTER(register_java_text_Bidi);
+ REGISTER(register_java_util_regex_Matcher);
+ REGISTER(register_java_util_regex_Pattern);
+ REGISTER(register_java_util_zip_Adler32);
+ REGISTER(register_java_util_zip_CRC32);
+ REGISTER(register_java_util_zip_Deflater);
+ REGISTER(register_java_util_zip_Inflater);
+ REGISTER(register_libcore_icu_ICU);
+ REGISTER(register_libcore_icu_NativeBreakIterator);
+ REGISTER(register_libcore_icu_NativeCollation);
+ REGISTER(register_libcore_icu_NativeConverter);
+ REGISTER(register_libcore_icu_NativeDecimalFormat);
+ REGISTER(register_libcore_icu_NativeIDN);
+ REGISTER(register_libcore_icu_NativeNormalizer);
+ REGISTER(register_libcore_icu_NativePluralRules);
+ REGISTER(register_libcore_icu_TimeZones);
+ REGISTER(register_libcore_io_AsynchronousCloseMonitor);
+ REGISTER(register_libcore_io_Memory);
+ REGISTER(register_libcore_io_OsConstants);
+ REGISTER(register_libcore_io_Posix);
+ REGISTER(register_libcore_net_RawSocket);
+ REGISTER(register_org_apache_harmony_dalvik_NativeTestTarget);
+ REGISTER(register_org_apache_harmony_xml_ExpatParser);
+ REGISTER(register_org_apache_harmony_xnet_provider_jsse_NativeCrypto);
+#undef REGISTER
+ return JNI_VERSION_1_6;
}
@@ -46,6 +46,6 @@ static jint Console_setEchoImpl(JNIEnv* env, jclass, jboolean on, jint previousS
static JNINativeMethod gMethods[] = {
NATIVE_METHOD(Console, setEchoImpl, "(ZI)I"),
};
-int register_java_io_Console(JNIEnv* env) {
- return jniRegisterNativeMethods(env, "java/io/Console", gMethods, NELEM(gMethods));
+void register_java_io_Console(JNIEnv* env) {
+ jniRegisterNativeMethods(env, "java/io/Console", gMethods, NELEM(gMethods));
}
@@ -168,6 +168,6 @@ static JNINativeMethod gMethods[] = {
NATIVE_METHOD(File, realpath, "(Ljava/lang/String;)Ljava/lang/String;"),
NATIVE_METHOD(File, setLastModifiedImpl, "(Ljava/lang/String;J)Z"),
};
-int register_java_io_File(JNIEnv* env) {
- return jniRegisterNativeMethods(env, "java/io/File", gMethods, NELEM(gMethods));
+void register_java_io_File(JNIEnv* env) {
+ jniRegisterNativeMethods(env, "java/io/File", gMethods, NELEM(gMethods));
}
@@ -63,6 +63,6 @@ static JNINativeMethod gMethods[] = {
NATIVE_METHOD(ObjectStreamClass, hasClinit, "(Ljava/lang/Class;)Z"),
NATIVE_METHOD(ObjectStreamClass, newInstance, "(Ljava/lang/Class;I)Ljava/lang/Object;"),
};
-int register_java_io_ObjectStreamClass(JNIEnv* env) {
- return jniRegisterNativeMethods(env, "java/io/ObjectStreamClass", gMethods, NELEM(gMethods));
+void register_java_io_ObjectStreamClass(JNIEnv* env) {
+ jniRegisterNativeMethods(env, "java/io/ObjectStreamClass", gMethods, NELEM(gMethods));
}
@@ -160,6 +160,6 @@ static JNINativeMethod gMethods[] = {
NATIVE_METHOD(Character, toTitleCaseImpl, "!(I)I"),
NATIVE_METHOD(Character, toUpperCaseImpl, "!(I)I"),
};
-int register_java_lang_Character(JNIEnv* env) {
- return jniRegisterNativeMethods(env, "java/lang/Character", gMethods, NELEM(gMethods));
+void register_java_lang_Character(JNIEnv* env) {
+ jniRegisterNativeMethods(env, "java/lang/Character", gMethods, NELEM(gMethods));
}
@@ -131,6 +131,6 @@ static JNINativeMethod gMethods[] = {
NATIVE_METHOD(Math, tanh, "!(D)D"),
};
-int register_java_lang_Math(JNIEnv* env) {
- return jniRegisterNativeMethods(env, "java/lang/Math", gMethods, NELEM(gMethods));
+void register_java_lang_Math(JNIEnv* env) {
+ jniRegisterNativeMethods(env, "java/lang/Math", gMethods, NELEM(gMethods));
}
@@ -265,6 +265,6 @@ static pid_t ProcessManager_exec(JNIEnv* env, jclass, jobjectArray javaCommands,
static JNINativeMethod methods[] = {
NATIVE_METHOD(ProcessManager, exec, "([Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;Ljava/io/FileDescriptor;Ljava/io/FileDescriptor;Ljava/io/FileDescriptor;Z)I"),
};
-int register_java_lang_ProcessManager(JNIEnv* env) {
- return jniRegisterNativeMethods(env, "java/lang/ProcessManager", methods, NELEM(methods));
+void register_java_lang_ProcessManager(JNIEnv* env) {
+ jniRegisterNativeMethods(env, "java/lang/ProcessManager", methods, NELEM(methods));
}
@@ -237,6 +237,6 @@ void RealToString_bigIntDigitGenerator(JNIEnv* env, jobject obj, jlong f, jint e
static JNINativeMethod gMethods[] = {
NATIVE_METHOD(RealToString, bigIntDigitGenerator, "(JIZI)V"),
};
-int register_java_lang_RealToString(JNIEnv* env) {
- return jniRegisterNativeMethods(env, "java/lang/RealToString", gMethods, NELEM(gMethods));
+void register_java_lang_RealToString(JNIEnv* env) {
+ jniRegisterNativeMethods(env, "java/lang/RealToString", gMethods, NELEM(gMethods));
}
@@ -145,6 +145,6 @@ static JNINativeMethod gMethods[] = {
NATIVE_METHOD(StrictMath, tanh, "!(D)D"),
};
-int register_java_lang_StrictMath(JNIEnv* env) {
- return jniRegisterNativeMethods(env, "java/lang/StrictMath", gMethods, NELEM(gMethods));
+void register_java_lang_StrictMath(JNIEnv* env) {
+ jniRegisterNativeMethods(env, "java/lang/StrictMath", gMethods, NELEM(gMethods));
}
@@ -1008,6 +1008,6 @@ static JNINativeMethod gMethods[] = {
NATIVE_METHOD(StringToReal, parseFltImpl, "(Ljava/lang/String;I)F"),
NATIVE_METHOD(StringToReal, parseDblImpl, "(Ljava/lang/String;I)D"),
};
-int register_java_lang_StringToReal(JNIEnv* env) {
- return jniRegisterNativeMethods(env, "java/lang/StringToReal", gMethods, NELEM(gMethods));
+void register_java_lang_StringToReal(JNIEnv* env) {
+ jniRegisterNativeMethods(env, "java/lang/StringToReal", gMethods, NELEM(gMethods));
}
@@ -88,6 +88,6 @@ static JNINativeMethod gMethods[] = {
NATIVE_METHOD(System, setFieldImpl, "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Object;)V"),
NATIVE_METHOD(System, specialProperties, "()[Ljava/lang/String;"),
};
-int register_java_lang_System(JNIEnv* env) {
- return jniRegisterNativeMethods(env, "java/lang/System", gMethods, NELEM(gMethods));
+void register_java_lang_System(JNIEnv* env) {
+ jniRegisterNativeMethods(env, "java/lang/System", gMethods, NELEM(gMethods));
}
@@ -553,6 +553,6 @@ static JNINativeMethod gMethods[] = {
NATIVE_METHOD(NativeBN, sign, "(I)I"),
NATIVE_METHOD(NativeBN, twosComp2bn, "([BII)Z"),
};
-int register_java_math_NativeBN(JNIEnv* env) {
- return jniRegisterNativeMethods(env, "java/math/NativeBN", gMethods, NELEM(gMethods));
+void register_java_math_NativeBN(JNIEnv* env) {
+ jniRegisterNativeMethods(env, "java/math/NativeBN", gMethods, NELEM(gMethods));
}
@@ -27,6 +27,6 @@ static jboolean ByteOrder_isLittleEndian(JNIEnv*, jclass) {
static JNINativeMethod gMethods[] = {
NATIVE_METHOD(ByteOrder, isLittleEndian, "!()Z"),
};
-int register_java_nio_ByteOrder(JNIEnv* env) {
- return jniRegisterNativeMethods(env, "java/nio/ByteOrder", gMethods, NELEM(gMethods));
+void register_java_nio_ByteOrder(JNIEnv* env) {
+ jniRegisterNativeMethods(env, "java/nio/ByteOrder", gMethods, NELEM(gMethods));
}
@@ -245,6 +245,6 @@ static JNINativeMethod gMethods[] = {
NATIVE_METHOD(Charsets, toIsoLatin1Bytes, "([CII)[B"),
NATIVE_METHOD(Charsets, toUtf8Bytes, "([CII)[B"),
};
-int register_java_nio_charset_Charsets(JNIEnv* env) {
- return jniRegisterNativeMethods(env, "java/nio/charset/Charsets", gMethods, NELEM(gMethods));
+void register_java_nio_charset_Charsets(JNIEnv* env) {
+ jniRegisterNativeMethods(env, "java/nio/charset/Charsets", gMethods, NELEM(gMethods));
}
@@ -187,6 +187,6 @@ static JNINativeMethod gMethods[] = {
NATIVE_METHOD(Bidi, ubidi_setLine, "(JII)J"),
NATIVE_METHOD(Bidi, ubidi_setPara, "(J[CII[B)V"),
};
-int register_java_text_Bidi(JNIEnv* env) {
- return jniRegisterNativeMethods(env, "java/text/Bidi", gMethods, NELEM(gMethods));
+void register_java_text_Bidi(JNIEnv* env) {
+ jniRegisterNativeMethods(env, "java/text/Bidi", gMethods, NELEM(gMethods));
}
@@ -211,6 +211,6 @@ static JNINativeMethod gMethods[] = {
NATIVE_METHOD(Matcher, useAnchoringBoundsImpl, "(IZ)V"),
NATIVE_METHOD(Matcher, useTransparentBoundsImpl, "(IZ)V"),
};
-int register_java_util_regex_Matcher(JNIEnv* env) {
- return jniRegisterNativeMethods(env, "java/util/regex/Matcher", gMethods, NELEM(gMethods));
+void register_java_util_regex_Matcher(JNIEnv* env) {
+ jniRegisterNativeMethods(env, "java/util/regex/Matcher", gMethods, NELEM(gMethods));
}
@@ -95,6 +95,6 @@ static JNINativeMethod gMethods[] = {
NATIVE_METHOD(Pattern, closeImpl, "(I)V"),
NATIVE_METHOD(Pattern, compileImpl, "(Ljava/lang/String;I)I"),
};
-int register_java_util_regex_Pattern(JNIEnv* env) {
- return jniRegisterNativeMethods(env, "java/util/regex/Pattern", gMethods, NELEM(gMethods));
+void register_java_util_regex_Pattern(JNIEnv* env) {
+ jniRegisterNativeMethods(env, "java/util/regex/Pattern", gMethods, NELEM(gMethods));
}
@@ -40,6 +40,6 @@ static JNINativeMethod gMethods[] = {
NATIVE_METHOD(Adler32, updateImpl, "([BIIJ)J"),
NATIVE_METHOD(Adler32, updateByteImpl, "(IJ)J"),
};
-int register_java_util_zip_Adler32(JNIEnv* env) {
- return jniRegisterNativeMethods(env, "java/util/zip/Adler32", gMethods, NELEM(gMethods));
+void register_java_util_zip_Adler32(JNIEnv* env) {
+ jniRegisterNativeMethods(env, "java/util/zip/Adler32", gMethods, NELEM(gMethods));
}
@@ -40,6 +40,6 @@ static JNINativeMethod gMethods[] = {
NATIVE_METHOD(CRC32, updateImpl, "([BIIJ)J"),
NATIVE_METHOD(CRC32, updateByteImpl, "(BJ)J"),
};
-int register_java_util_zip_CRC32(JNIEnv* env) {
- return jniRegisterNativeMethods(env, "java/util/zip/CRC32", gMethods, NELEM(gMethods));
+void register_java_util_zip_CRC32(JNIEnv* env) {
+ jniRegisterNativeMethods(env, "java/util/zip/CRC32", gMethods, NELEM(gMethods));
}
@@ -146,6 +146,6 @@ static JNINativeMethod gMethods[] = {
NATIVE_METHOD(Deflater, setInputImpl, "([BIIJ)V"),
NATIVE_METHOD(Deflater, setLevelsImpl, "(IIJ)V"),
};
-int register_java_util_zip_Deflater(JNIEnv* env) {
- return jniRegisterNativeMethods(env, "java/util/zip/Deflater", gMethods, NELEM(gMethods));
+void register_java_util_zip_Deflater(JNIEnv* env) {
+ jniRegisterNativeMethods(env, "java/util/zip/Deflater", gMethods, NELEM(gMethods));
}
@@ -168,6 +168,6 @@ static JNINativeMethod gMethods[] = {
NATIVE_METHOD(Inflater, setFileInputImpl, "(Ljava/io/FileDescriptor;JIJ)I"),
NATIVE_METHOD(Inflater, setInputImpl, "([BIIJ)V"),
};
-int register_java_util_zip_Inflater(JNIEnv* env) {
- return jniRegisterNativeMethods(env, "java/util/zip/Inflater", gMethods, NELEM(gMethods));
+void register_java_util_zip_Inflater(JNIEnv* env) {
+ jniRegisterNativeMethods(env, "java/util/zip/Inflater", gMethods, NELEM(gMethods));
}
@@ -577,7 +577,7 @@ static JNINativeMethod gMethods[] = {
NATIVE_METHOD(ICU, toLowerCase, "(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;"),
NATIVE_METHOD(ICU, toUpperCase, "(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;"),
};
-int register_libcore_icu_ICU(JNIEnv* env) {
+void register_libcore_icu_ICU(JNIEnv* env) {
std::string path;
path = u_getDataDirectory();
path += "/";
@@ -586,11 +586,11 @@ int register_libcore_icu_ICU(JNIEnv* env) {
#define FAIL_WITH_STRERROR(s) \
ALOGE("Couldn't " s " '%s': %s", path.c_str(), strerror(errno)); \
- return -1;
+ abort();
#define MAYBE_FAIL_WITH_ICU_ERROR(s) \
if (status != U_ZERO_ERROR) {\
ALOGE("Couldn't initialize ICU (" s "): %s (%s)", u_errorName(status), path.c_str()); \
- return -1; \
+ abort(); \
}
// Open the file and get its length.
@@ -627,5 +627,5 @@ int register_libcore_icu_ICU(JNIEnv* env) {
// and bail.
u_init(&status);
MAYBE_FAIL_WITH_ICU_ERROR("u_init");
- return jniRegisterNativeMethods(env, "libcore/icu/ICU", gMethods, NELEM(gMethods));
+ jniRegisterNativeMethods(env, "libcore/icu/ICU", gMethods, NELEM(gMethods));
}
Oops, something went wrong.

0 comments on commit 7cd6760

Please sign in to comment.