# HG changeset patch # User dcubed # Date 1206401535 25200 # Node ID 988fe6228d498555dd8d8bd28dd8d197fa8f7748 # Parent e0911cc0a5d1ab41879b7b5138f49577edcb7d66 6547500: 2/2 j.l.i.: .retransformClasses throws unexpected InternalError Summary: retransformClasses() should catch both an empty classes array and a classes array that contains a NULL element. Reviewed-by: ohair, sspitsyn diff -r e0911cc0a5d1 -r 988fe6228d49 jdk/src/share/instrument/JPLISAgent.c --- a/jdk/src/share/instrument/JPLISAgent.c Mon Mar 24 16:23:21 2008 -0700 +++ b/jdk/src/share/instrument/JPLISAgent.c Mon Mar 24 16:32:15 2008 -0700 @@ -1076,6 +1076,12 @@ numClasses = (*jnienv)->GetArrayLength(jnienv, classes); errorOccurred = checkForThrowable(jnienv); jplis_assert(!errorOccurred); + + if (!errorOccurred && numClasses == 0) { + jplis_assert(numClasses != 0); + errorOccurred = JNI_TRUE; + errorCode = JVMTI_ERROR_NULL_POINTER; + } } if (!errorOccurred) { @@ -1097,6 +1103,13 @@ if (errorOccurred) { break; } + + if (classArray[index] == NULL) { + jplis_assert(classArray[index] != NULL); + errorOccurred = JNI_TRUE; + errorCode = JVMTI_ERROR_NULL_POINTER; + break; + } } }