When a Java thread issues an access request in a doPrivileged() block,the stack frame of the calling thread is annotated according to the calling thread's protection domain.A thread with an annotated stack frame can make subsequent method calls that require certain privileges.Thus,the annotation serves to mark a calling thread as being privileged.By allowing a Java program to directly alter the annotations of a stack frame,a program could potentially perform an operation for which it does not have the necessary permissions,thus violating the security model of Java.
When a Java thread issues an access request in a doPrivileged() block,the stack frame of the calling thread is annotated according to the calling thread's protection domain.A thread with an annotated stack frame can make subsequent method calls that require certain privileges.Thus,the annotation serves to mark a calling thread as being privileged.By allowing a Java program to directly alter the annotations of a stack frame,a program could potentially perform an operation for which it does not have the necessary permissions,thus violating the security model of Java.