- /*
- * %W% %E%
- *
- * Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved.
- * ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
- */
- package java.lang;
- import java.io.*;
- import java.util.Properties;
- import java.util.PropertyPermission;
- import java.util.StringTokenizer;
- import java.security.AccessController;
- import java.security.PrivilegedAction;
- import java.security.AllPermission;
- import java.nio.channels.Channel;
- import java.nio.channels.spi.SelectorProvider;
- import sun.nio.ch.Interruptible;
- import sun.reflect.Reflection;
- import sun.security.util.SecurityConstants;
- import sun.reflect.annotation.AnnotationType;
- private static void setJavaLangAccess() {
- // Allow privileged classes outside of java.lang
- sun.misc.SharedSecrets.setJavaLangAccess(new sun.misc.JavaLangAccess(){
- public sun.reflect.ConstantPool getConstantPool(Class klass) {
- return klass.getConstantPool();
- }
- public void setAnnotationType(Class klass, AnnotationType type) {
- klass.setAnnotationType(type);
- }
- public AnnotationType getAnnotationType(Class klass) {
- return klass.getAnnotationType();
- }
- public <E extends Enum<E>>
- E[] getEnumConstantsShared(Class<E> klass) {
- return klass.getEnumConstantsShared();
- }
- public void blockedOn(Thread t, Interruptible b) {
- t.blockedOn(b);
- }
- public void registerShutdownHook(int slot, Runnable r) {
- Shutdown.add(slot, r);
- }
- public int getStackTraceDepth(Throwable t) {
- return t.getStackTraceDepth();
- }
- public StackTraceElement getStackTraceElement(Throwable t, int i) {
- return t.getStackTraceElement(i);
- }
- });
- }
- /* returns the class of the caller. */
- static Class getCallerClass() {
- // NOTE use of more generic Reflection.getCallerClass()
- return Reflection.getCallerClass(3);
- }
- }
复制代码
如上源码,为什么有的方法可以点开,有的点不开,怎样知道点不开的时候,到底应该导入什么源码? |
|