jar包解压与查看class文件

今天在排查问题时,想看看生产上面的包里面代码是怎样的,具体流程如下:
随便找个包(commons-beanutils-1.7.0.jar)
1 解压jar包

jar -xvf commons-beanutils-1.7.0.jar

2 使用javap命令查看class文件内容

javap -v -p DoubleArrayConverter.class

输出如下:

public final class org.apache.commons.beanutils.converters.DoubleArrayConverter extends org.apache.commons.beanutils.converters.AbstractArrayConverter
  minor version: 0
  major version: 46
  flags: ACC_PUBLIC, ACC_FINAL, ACC_SUPER
Constant pool:
    #1 = Methodref          #28.#58       // org/apache/commons/beanutils/converters/AbstractArrayConverter."<init>":()V
    #2 = Fieldref           #27.#59       // org/apache/commons/beanutils/converters/DoubleArrayConverter.defaultValue:Ljava/lang/Object;
    #3 = Fieldref           #27.#60       // org/apache/commons/beanutils/converters/DoubleArrayConverter.useDefault:Z
    #4 = Fieldref           #27.#59       // org/apache/commons/beanutils/converters/DoubleArrayConverter.defaultValue:Ljava/lang/Object;
    #5 = Fieldref           #27.#60       // org/apache/commons/beanutils/converters/DoubleArrayConverter.useDefault:Z
    #6 = Fieldref           #27.#60       // org/apache/commons/beanutils/converters/DoubleArrayConverter.useDefault:Z
    #7 = Fieldref           #27.#59       // org/apache/commons/beanutils/converters/DoubleArrayConverter.defaultValue:Ljava/lang/Object;
    #8 = Class              #61           // org/apache/commons/beanutils/ConversionException
    #9 = String             #62           // No value specified
   #10 = Methodref          #8.#63        // org/apache/commons/beanutils/ConversionException."<init>":(Ljava/lang/String;)V
   #11 = Fieldref           #27.#64       // org/apache/commons/beanutils/converters/DoubleArrayConverter.model:[D
   #12 = Methodref          #65.#66       // java/lang/Object.getClass:()Ljava/lang/Class;
   #13 = Fieldref           #28.#67       // org/apache/commons/beanutils/converters/AbstractArrayConverter.strings:[Ljava/lang/String;
   #14 = Class              #47           // "[Ljava/lang/String;"
   #15 = Methodref          #68.#69       // java/lang/Double.parseDouble:(Ljava/lang/String;)D
   #16 = Class              #70           // java/lang/Exception
   #17 = Fieldref           #27.#60       // org/apache/commons/beanutils/converters/DoubleArrayConverter.useDefault:Z
   #18 = Fieldref           #27.#59       // org/apache/commons/beanutils/converters/DoubleArrayConverter.defaultValue:Ljava/lang/Object;
   #19 = Methodref          #65.#71       // java/lang/Object.toString:()Ljava/lang/String;
   #20 = Methodref          #8.#72        // org/apache/commons/beanutils/ConversionException."<init>":(Ljava/lang/String;Ljava/lang/Throwable;)V
   #21 = Methodref          #27.#73       // org/apache/commons/beanutils/converters/DoubleArrayConverter.parseElements:(Ljava/lang/String;)Ljava/util/List;
   #22 = InterfaceMethodref #74.#75       // java/util/List.size:()I
   #23 = InterfaceMethodref #74.#76       // java/util/List.get:(I)Ljava/lang/Object;
   #24 = Class              #77           // java/lang/String
   #25 = Fieldref           #27.#60       // org/apache/commons/beanutils/converters/DoubleArrayConverter.useDefault:Z
   #26 = Fieldref           #27.#59       // org/apache/commons/beanutils/converters/DoubleArrayConverter.defaultValue:Ljava/lang/Object;
   #27 = Class              #78           // org/apache/commons/beanutils/converters/DoubleArrayConverter
   #28 = Class              #79           // org/apache/commons/beanutils/converters/AbstractArrayConverter
   #29 = Utf8               model
   #30 = Utf8               [D
   #31 = Utf8               <init>
   #32 = Utf8               ()V
   #33 = Utf8               Code
   #34 = Utf8               LineNumberTable
   #35 = Utf8               LocalVariableTable
   #36 = Utf8               this
   #37 = Utf8               Lorg/apache/commons/beanutils/converters/DoubleArrayConverter;
   #38 = Utf8               (Ljava/lang/Object;)V
   #39 = Utf8               defaultValue
   #40 = Utf8               Ljava/lang/Object;
   #41 = Utf8               convert
   #42 = Utf8               (Ljava/lang/Class;Ljava/lang/Object;)Ljava/lang/Object;
   #43 = Utf8               type
   #44 = Utf8               Ljava/lang/Class;
   #45 = Utf8               value
   #46 = Utf8               values
   #47 = Utf8               [Ljava/lang/String;
   #48 = Utf8               results
   #49 = Utf8               i
   #50 = Utf8               I
   #51 = Utf8               e
   #52 = Utf8               Ljava/lang/Exception;
   #53 = Utf8               list
   #54 = Utf8               Ljava/util/List;
   #55 = Utf8               <clinit>
   #56 = Utf8               SourceFile
   #57 = Utf8               DoubleArrayConverter.java
   #58 = NameAndType        #31:#32       // "<init>":()V
   #59 = NameAndType        #39:#40       // defaultValue:Ljava/lang/Object;
   #60 = NameAndType        #80:#81       // useDefault:Z
   #61 = Utf8               org/apache/commons/beanutils/ConversionException
   #62 = Utf8               No value specified
   #63 = NameAndType        #31:#82       // "<init>":(Ljava/lang/String;)V
   #64 = NameAndType        #29:#30       // model:[D
   #65 = Class              #83           // java/lang/Object
   #66 = NameAndType        #84:#85       // getClass:()Ljava/lang/Class;
   #67 = NameAndType        #86:#47       // strings:[Ljava/lang/String;
   #68 = Class              #87           // java/lang/Double
   #69 = NameAndType        #88:#89       // parseDouble:(Ljava/lang/String;)D
   #70 = Utf8               java/lang/Exception
   #71 = NameAndType        #90:#91       // toString:()Ljava/lang/String;
   #72 = NameAndType        #31:#92       // "<init>":(Ljava/lang/String;Ljava/lang/Throwable;)V
   #73 = NameAndType        #93:#94       // parseElements:(Ljava/lang/String;)Ljava/util/List;
   #74 = Class              #95           // java/util/List
   #75 = NameAndType        #96:#97       // size:()I
   #76 = NameAndType        #98:#99       // get:(I)Ljava/lang/Object;
   #77 = Utf8               java/lang/String
   #78 = Utf8               org/apache/commons/beanutils/converters/DoubleArrayConverter
   #79 = Utf8               org/apache/commons/beanutils/converters/AbstractArrayConverter
   #80 = Utf8               useDefault
   #81 = Utf8               Z
   #82 = Utf8               (Ljava/lang/String;)V
   #83 = Utf8               java/lang/Object
   #84 = Utf8               getClass
   #85 = Utf8               ()Ljava/lang/Class;
   #86 = Utf8               strings
   #87 = Utf8               java/lang/Double
   #88 = Utf8               parseDouble
   #89 = Utf8               (Ljava/lang/String;)D
   #90 = Utf8               toString
   #91 = Utf8               ()Ljava/lang/String;
   #92 = Utf8               (Ljava/lang/String;Ljava/lang/Throwable;)V
   #93 = Utf8               parseElements
   #94 = Utf8               (Ljava/lang/String;)Ljava/util/List;
   #95 = Utf8               java/util/List
   #96 = Utf8               size
   #97 = Utf8               ()I
   #98 = Utf8               get
   #99 = Utf8               (I)Ljava/lang/Object;
{
  private static double[] model;
    descriptor: [D
    flags: ACC_PRIVATE, ACC_STATIC

  public org.apache.commons.beanutils.converters.DoubleArrayConverter();
    descriptor: ()V
    flags: ACC_PUBLIC
    Code:
      stack=2, locals=1, args_size=1
         0: aload_0
         1: invokespecial #1                  // Method org/apache/commons/beanutils/converters/AbstractArrayConverter."<init>":()V
         4: aload_0
         5: aconst_null
         6: putfield      #2                  // Field defaultValue:Ljava/lang/Object;
         9: aload_0
        10: iconst_0
        11: putfield      #3                  // Field useDefault:Z
        14: return
      LineNumberTable:
        line 47: 0
        line 49: 4
        line 50: 9
        line 52: 14
      LocalVariableTable:
        Start  Length  Slot  Name   Signature
            0      15     0  this   Lorg/apache/commons/beanutils/converters/DoubleArrayConverter;

  public org.apache.commons.beanutils.converters.DoubleArrayConverter(java.lang.Object);
    descriptor: (Ljava/lang/Object;)V
    flags: ACC_PUBLIC
    Code:
      stack=2, locals=2, args_size=2
         0: aload_0
         1: invokespecial #1                  // Method org/apache/commons/beanutils/converters/AbstractArrayConverter."<init>":()V
         4: aload_0
         5: aload_1
         6: putfield      #4                  // Field defaultValue:Ljava/lang/Object;
         9: aload_0
        10: iconst_1
        11: putfield      #5                  // Field useDefault:Z
        14: return
      LineNumberTable:
        line 61: 0
        line 63: 4
        line 64: 9
        line 66: 14
      LocalVariableTable:
        Start  Length  Slot  Name   Signature
            0      15     0  this   Lorg/apache/commons/beanutils/converters/DoubleArrayConverter;
            0      15     1 defaultValue   Ljava/lang/Object;

  public java.lang.Object convert(java.lang.Class, java.lang.Object);
    descriptor: (Ljava/lang/Class;Ljava/lang/Object;)Ljava/lang/Object;
    flags: ACC_PUBLIC
    Code:
      stack=4, locals=6, args_size=3
         0: aload_2
         1: ifnonnull     26
         4: aload_0
         5: getfield      #6                  // Field useDefault:Z
         8: ifeq          16
        11: aload_0
        12: getfield      #7                  // Field defaultValue:Ljava/lang/Object;
        15: areturn
        16: new           #8                  // class org/apache/commons/beanutils/ConversionException
        19: dup
        20: ldc           #9                  // String No value specified
        22: invokespecial #10                 // Method org/apache/commons/beanutils/ConversionException."<init>":(Ljava/lang/String;)V
        25: athrow
        26: getstatic     #11                 // Field model:[D
        29: invokevirtual #12                 // Method java/lang/Object.getClass:()Ljava/lang/Class;
        32: aload_2
        33: invokevirtual #12                 // Method java/lang/Object.getClass:()Ljava/lang/Class;
        36: if_acmpne     41
        39: aload_2
        40: areturn
        41: getstatic     #13                 // Field org/apache/commons/beanutils/converters/AbstractArrayConverter.strings:[Ljava/lang/String;
        44: invokevirtual #12                 // Method java/lang/Object.getClass:()Ljava/lang/Class;
        47: aload_2
        48: invokevirtual #12                 // Method java/lang/Object.getClass:()Ljava/lang/Class;
        51: if_acmpne     122
        54: aload_2
        55: checkcast     #14                 // class "[Ljava/lang/String;"
        58: astore_3
        59: aload_3
        60: arraylength
        61: newarray       double
        63: astore        4
        65: iconst_0
        66: istore        5
        68: goto          86
        71: aload         4
        73: iload         5
        75: aload_3
        76: iload         5
        78: aaload
        79: invokestatic  #15                 // Method java/lang/Double.parseDouble:(Ljava/lang/String;)D
        82: dastore
        83: iinc          5, 1
        86: iload         5
        88: aload_3
        89: arraylength
        90: if_icmplt     71
        93: aload         4
        95: areturn
        96: astore_3
        97: aload_0
        98: getfield      #17                 // Field useDefault:Z
       101: ifeq          109
       104: aload_0
       105: getfield      #18                 // Field defaultValue:Ljava/lang/Object;
       108: areturn
       109: new           #8                  // class org/apache/commons/beanutils/ConversionException
       112: dup
       113: aload_2
       114: invokevirtual #19                 // Method java/lang/Object.toString:()Ljava/lang/String;
       117: aload_3
       118: invokespecial #20                 // Method org/apache/commons/beanutils/ConversionException."<init>":(Ljava/lang/String;Ljava/lang/Throwable;)V
       121: athrow
       122: aload_0
       123: aload_2
       124: invokevirtual #19                 // Method java/lang/Object.toString:()Ljava/lang/String;
       127: invokevirtual #21                 // Method parseElements:(Ljava/lang/String;)Ljava/util/List;
       130: astore_3
       131: aload_3
       132: invokeinterface #22,  1           // InterfaceMethod java/util/List.size:()I
       137: newarray       double
       139: astore        4
       141: iconst_0
       142: istore        5
       144: goto          169
       147: aload         4
       149: iload         5
       151: aload_3
       152: iload         5
       154: invokeinterface #23,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
       159: checkcast     #24                 // class java/lang/String
       162: invokestatic  #15                 // Method java/lang/Double.parseDouble:(Ljava/lang/String;)D
       165: dastore
       166: iinc          5, 1
       169: iload         5
       171: aload         4
       173: arraylength
       174: if_icmplt     147
       177: aload         4
       179: areturn
       180: astore_3
       181: aload_0
       182: getfield      #25                 // Field useDefault:Z
       185: ifeq          193
       188: aload_0
       189: getfield      #26                 // Field defaultValue:Ljava/lang/Object;
       192: areturn
       193: new           #8                  // class org/apache/commons/beanutils/ConversionException
       196: dup
       197: aload_2
       198: invokevirtual #19                 // Method java/lang/Object.toString:()Ljava/lang/String;
       201: aload_3
       202: invokespecial #20                 // Method org/apache/commons/beanutils/ConversionException."<init>":(Ljava/lang/String;Ljava/lang/Throwable;)V
       205: athrow
      Exception table:
         from    to  target type
            54    95    96   Class java/lang/Exception
           122   179   180   Class java/lang/Exception
      LineNumberTable:
        line 94: 0
        line 95: 4
        line 96: 11
        line 98: 16
        line 103: 26
        line 104: 39
        line 108: 41
        line 110: 54
        line 111: 59
        line 112: 65
        line 113: 71
        line 112: 83
        line 115: 93
        line 117: 96
        line 118: 104
        line 120: 109
        line 128: 122
        line 129: 131
        line 130: 141
        line 131: 147
        line 130: 166
        line 133: 177
        line 135: 180
        line 136: 188
        line 138: 193
      LocalVariableTable:
        Start  Length  Slot  Name   Signature
            0     206     0  this   Lorg/apache/commons/beanutils/converters/DoubleArrayConverter;
            0     206     1  type   Ljava/lang/Class;
            0     206     2 value   Ljava/lang/Object;
           59      37     3 values   [Ljava/lang/String;
           65      31     4 results   [D
           68      28     5     i   I
           97      25     3     e   Ljava/lang/Exception;
          131      49     3  list   Ljava/util/List;
          141      39     4 results   [D
          144      36     5     i   I
          181      25     3     e   Ljava/lang/Exception;

  static {};
    descriptor: ()V
    flags: ACC_STATIC
    Code:
      stack=1, locals=0, args_size=0
         0: iconst_0
         1: newarray       double
         3: putstatic     #11                 // Field model:[D
         6: return
      LineNumberTable:
        line 75: 0
}
SourceFile: "DoubleArrayConverter.java"
©著作权归作者所有,转载或内容合作请联系作者
  • 序言:七十年代末,一起剥皮案震惊了整个滨河市,随后出现的几起案子,更是在滨河造成了极大的恐慌,老刑警刘岩,带你破解...
    沈念sama阅读 213,254评论 6 492
  • 序言:滨河连续发生了三起死亡事件,死亡现场离奇诡异,居然都是意外死亡,警方通过查阅死者的电脑和手机,发现死者居然都...
    沈念sama阅读 90,875评论 3 387
  • 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
    开封第一讲书人阅读 158,682评论 0 348
  • 文/不坏的土叔 我叫张陵,是天一观的道长。 经常有香客问我,道长,这世上最难降的妖魔是什么? 我笑而不...
    开封第一讲书人阅读 56,896评论 1 285
  • 正文 为了忘掉前任,我火速办了婚礼,结果婚礼上,老公的妹妹穿的比我还像新娘。我一直安慰自己,他们只是感情好,可当我...
    茶点故事阅读 66,015评论 6 385
  • 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
    开封第一讲书人阅读 50,152评论 1 291
  • 那天,我揣着相机与录音,去河边找鬼。 笑死,一个胖子当着我的面吹牛,可吹牛的内容都是我干的。 我是一名探鬼主播,决...
    沈念sama阅读 39,208评论 3 412
  • 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
    开封第一讲书人阅读 37,962评论 0 268
  • 序言:老挝万荣一对情侣失踪,失踪者是张志新(化名)和其女友刘颖,没想到半个月后,有当地人在树林里发现了一具尸体,经...
    沈念sama阅读 44,388评论 1 304
  • 正文 独居荒郊野岭守林人离奇死亡,尸身上长有42处带血的脓包…… 初始之章·张勋 以下内容为张勋视角 年9月15日...
    茶点故事阅读 36,700评论 2 327
  • 正文 我和宋清朗相恋三年,在试婚纱的时候发现自己被绿了。 大学时的朋友给我发了我未婚夫和他白月光在一起吃饭的照片。...
    茶点故事阅读 38,867评论 1 341
  • 序言:一个原本活蹦乱跳的男人离奇死亡,死状恐怖,灵堂内的尸体忽然破棺而出,到底是诈尸还是另有隐情,我是刑警宁泽,带...
    沈念sama阅读 34,551评论 4 335
  • 正文 年R本政府宣布,位于F岛的核电站,受9级特大地震影响,放射性物质发生泄漏。R本人自食恶果不足惜,却给世界环境...
    茶点故事阅读 40,186评论 3 317
  • 文/蒙蒙 一、第九天 我趴在偏房一处隐蔽的房顶上张望。 院中可真热闹,春花似锦、人声如沸。这庄子的主人今日做“春日...
    开封第一讲书人阅读 30,901评论 0 21
  • 文/苍兰香墨 我抬头看了看天上的太阳。三九已至,却和暖如春,着一层夹袄步出监牢的瞬间,已是汗流浃背。 一阵脚步声响...
    开封第一讲书人阅读 32,142评论 1 267
  • 我被黑心中介骗来泰国打工, 没想到刚下飞机就差点儿被人妖公主榨干…… 1. 我叫王不留,地道东北人。 一个月前我还...
    沈念sama阅读 46,689评论 2 362
  • 正文 我出身青楼,却偏偏与公主长得像,于是被迫代替她去往敌国和亲。 传闻我的和亲对象是个残疾皇子,可洞房花烛夜当晚...
    茶点故事阅读 43,757评论 2 351

推荐阅读更多精彩内容