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
--- a/jdk/src/share/instrument/JPLISAgent.c Mon Mar 24 16:11:24 2008 -0700
+++ b/jdk/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