Merge "Fix static analyzer complaints" am: a3bde81205

am: 3e0a8b1d2b

Change-Id: Ia66a6a5ab4fd59772a5df71ede75227d353e5d25
This commit is contained in:
George Burgess IV
2017-07-19 17:41:55 +00:00
committed by android-build-merger
2 changed files with 5 additions and 3 deletions

View File

@@ -1090,7 +1090,7 @@ void AndroidRuntime::start(const char* className, const Vector<String8>& options
* Start VM. This thread becomes the main thread of the VM, and will
* not return until the VM exits.
*/
char* slashClassName = toSlashClassName(className);
char* slashClassName = toSlashClassName(className != NULL ? className : "");
jclass startClass = env->FindClass(slashClassName);
if (startClass == NULL) {
ALOGE("JavaVM unable to locate class '%s'\n", slashClassName);

View File

@@ -345,8 +345,10 @@ static jlong android_view_MotionEvent_nativeInitialize(JNIEnv* env, jclass clazz
return 0;
}
MotionEvent* event = reinterpret_cast<MotionEvent*>(nativePtr);
if (!event) {
MotionEvent* event;
if (nativePtr) {
event = reinterpret_cast<MotionEvent*>(nativePtr);
} else {
event = new MotionEvent();
}