A股上市公司传智教育(股票代码 003032)旗下技术交流社区北京昌平校区

 找回密码
 加入黑马

QQ登录

只需一步,快速开始

© atlas 中级黑马   /  2014-10-13 16:12  /  1206 人查看  /  1 人回复  /   0 人收藏 转载请遵从CC协议 禁止商业使用本文

  1. /*
  2. * %W% %E%
  3. *
  4. * Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved.
  5. * ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
  6. */
  7. package java.lang;

  8. import java.io.*;
  9. import java.util.Properties;
  10. import java.util.PropertyPermission;
  11. import java.util.StringTokenizer;
  12. import java.security.AccessController;
  13. import java.security.PrivilegedAction;
  14. import java.security.AllPermission;
  15. import java.nio.channels.Channel;
  16. import java.nio.channels.spi.SelectorProvider;
  17. import sun.nio.ch.Interruptible;
  18. import sun.reflect.Reflection;
  19. import sun.security.util.SecurityConstants;
  20. import sun.reflect.annotation.AnnotationType;


  21.     private static void setJavaLangAccess() {
  22.         // Allow privileged classes outside of java.lang
  23.         sun.misc.SharedSecrets.setJavaLangAccess(new sun.misc.JavaLangAccess(){
  24.             public sun.reflect.ConstantPool getConstantPool(Class klass) {
  25.                 return klass.getConstantPool();
  26.             }
  27.             public void setAnnotationType(Class klass, AnnotationType type) {
  28.                 klass.setAnnotationType(type);
  29.             }
  30.             public AnnotationType getAnnotationType(Class klass) {
  31.                 return klass.getAnnotationType();
  32.             }
  33.             public <E extends Enum<E>>
  34.                     E[] getEnumConstantsShared(Class<E> klass) {
  35.                 return klass.getEnumConstantsShared();
  36.             }
  37.             public void blockedOn(Thread t, Interruptible b) {
  38.                 t.blockedOn(b);
  39.             }
  40.             public void registerShutdownHook(int slot, Runnable r) {
  41.                 Shutdown.add(slot, r);
  42.             }

  43.             public int getStackTraceDepth(Throwable t) {
  44.                 return t.getStackTraceDepth();
  45.             }
  46.             public StackTraceElement getStackTraceElement(Throwable t, int i) {
  47.                 return t.getStackTraceElement(i);
  48.             }
  49.         });
  50.     }

  51.     /* returns the class of the caller. */
  52.     static Class getCallerClass() {
  53.         // NOTE use of more generic Reflection.getCallerClass()
  54.         return Reflection.getCallerClass(3);
  55.     }
  56. }
复制代码

如上源码,为什么有的方法可以点开,有的点不开,怎样知道点不开的时候,到底应该导入什么源码?

1 个回复

倒序浏览
每一个jar包都有对应的src文件,src就是源码吧
回复 使用道具 举报
您需要登录后才可以回帖 登录 | 加入黑马