src/jdk.jdeps/share/classes/com/sun/tools/javap/AttributeWriter.java
changeset 59232 d4ddf19c2624
parent 50735 2f2af62dfac7
equal deleted inserted replaced
59231:2b9027360909 59232:d4ddf19c2624
     1 /*
     1 /*
     2  * Copyright (c) 2007, 2018, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2007, 2019, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.  Oracle designates this
     7  * published by the Free Software Foundation.  Oracle designates this
   124         }
   124         }
   125     }
   125     }
   126 
   126 
   127     @Override
   127     @Override
   128     public Void visitDefault(DefaultAttribute attr, Void ignore) {
   128     public Void visitDefault(DefaultAttribute attr, Void ignore) {
   129         if (attr.reason != null) {
       
   130             report(attr.reason);
       
   131         }
       
   132         byte[] data = attr.info;
   129         byte[] data = attr.info;
   133         int i = 0;
   130         int i = 0;
   134         int j = 0;
   131         int j = 0;
   135         print("  ");
   132         print("  ");
   136         try {
   133         try {
   138         } catch (ConstantPoolException e) {
   135         } catch (ConstantPoolException e) {
   139             report(e);
   136             report(e);
   140             print("attribute name = #" + attr.attribute_name_index);
   137             print("attribute name = #" + attr.attribute_name_index);
   141         }
   138         }
   142         print(": ");
   139         print(": ");
   143         println("length = 0x" + toHex(attr.info.length));
   140         print("length = 0x" + toHex(attr.info.length));
       
   141         if (attr.reason != null) {
       
   142             print(" (" + attr.reason + ")");
       
   143         }
       
   144         println();
   144 
   145 
   145         print("   ");
   146         print("   ");
   146 
   147 
   147         while (i < data.length) {
   148         while (i < data.length) {
   148             print(toHex(data[i], 2));
   149             print(toHex(data[i], 2));