提交 7cd6ae62 编写于 作者: D dcubed

6547358: 2/2 j.l.i.: manifest attribute 'Can-Retransform-Classes' is ignored...

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
上级 2afac1e9
......@@ -259,7 +259,7 @@ initializeJPLISAgent( JPLISAgent * agent,
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 @@ retransformableEnvironment(JPLISAgent * agent) {
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 @@ isModifiableClass(JNIEnv * jnienv, JPLISAgent * agent, jclass clazz) {
jboolean
isRetransformClassesSupported(JNIEnv * jnienv, JPLISAgent * agent) {
return retransformableEnvironment(agent) != NULL;
return agent->mRetransformEnvironment.mIsRetransformer;
}
void
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册