I was pondering, playing around with some code. I came across the following method in the Thread class: checkAccess()
.
The documentation (literally) says "Does nothing." Why would this possibly be in the Thread class if it does nothing? - Are we possibly dealing with developer trolls?
Screenshot:
Thread.checkAccess()
is from core Java APIs so that's why it exists in Android
as well, however it is not implemented.
Android's java.lang.Thread.checkAccess() doesn't provide this implementation because it is not trusting SecurityManagers.
Security managers do not provide a secure environment for executing untrusted code. Untrusted code cannot be safely isolated within the Dalvik VM.
And this is how Thread.checkAccess
is implemented inside OpenJDK.
public final void checkAccess() {
SecurityManager security = System.getSecurityManager();
if (security != null) {
security.checkAccess(this);
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With