code: public static ThreadContextAccessor getThreadContextAccessor() {
          SecurityManager sm = System.getSecurityManager();
          if (sm != null) {
              // Check for the same permissions that calling
              // getContextClassLoader and setContextClassLoader would require.
              sm.checkPermission(new RuntimePermission("getClassLoader"));
              sm.checkPermission(new RuntimePermission("setContextClassLoader"));
          }
  
          return threadContextAccessor;
      }
docs: Gets an implementation of <code>ThreadContextAccessor</code>. Callers
  should ensure that they do not allow unprivileged code to have access to
  the object returned by this method.
  
  <p>If there is a security manager, then the security manager's
  <code>checkPermission</code> method is called with a
  <code>RuntimePermission("getClassLoader")</code> and
  <code>RuntimePermission("setContextClassLoader")</code> to see if it's
  ok to get and set the context ClassLoader.
  
  @return a <code>ThreadContextAccessor</code> implementation
  @throws SecurityException if a security manager exists and its
  <code>checkPermission</code> method doesn't allow getting or setting the
  context ClassLoader.