changeset 139:719789c7132c

6547358: 2/2 j.l.i.: manifest attribute 'Can-Retransform-Classes' is ignored by isRetransformClassesSupported() Summary: isRetransformClassesSupported() should return the capability rather than give the agent the capability Reviewed-by: ohair, sspitsyn
author dcubed
date Mon, 24 Mar 2008 16:23:21 -0700
parents 31959ddaf501
children ba825e4b1b8b
files src/share/instrument/JPLISAgent.c
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/instrument/JPLISAgent.c	Mon Mar 24 16:11:24 2008 -0700
+++ b/src/share/instrument/JPLISAgent.c	Mon Mar 24 16:23:21 2008 -0700
@@ -259,7 +259,7 @@
     agent->mNormalEnvironment.mIsRetransformer       = JNI_FALSE;
     agent->mRetransformEnvironment.mJVMTIEnv         = NULL;        /* NULL until needed */
     agent->mRetransformEnvironment.mAgent            = agent;
-    agent->mRetransformEnvironment.mIsRetransformer  = JNI_TRUE;
+    agent->mRetransformEnvironment.mIsRetransformer  = JNI_FALSE;   /* JNI_FALSE until mJVMTIEnv is set */
     agent->mAgentmainCaller                          = NULL;
     agent->mInstrumentationImpl                      = NULL;
     agent->mPremainCaller                            = NULL;
@@ -998,6 +998,7 @@
     if (jvmtierror == JVMTI_ERROR_NONE) {
         // install the retransforming environment
         agent->mRetransformEnvironment.mJVMTIEnv = retransformerEnv;
+        agent->mRetransformEnvironment.mIsRetransformer = JNI_TRUE;
 
         // Make it for ClassFileLoadHook handling
         jvmtierror = (*retransformerEnv)->SetEnvironmentLocalStorage(
@@ -1032,7 +1033,7 @@
 
 jboolean
 isRetransformClassesSupported(JNIEnv * jnienv, JPLISAgent * agent) {
-    return retransformableEnvironment(agent) != NULL;
+    return agent->mRetransformEnvironment.mIsRetransformer;
 }
 
 void