src/share/classes/com/sun/tools/classfile/DefaultAttribute.java

changeset 1874
891c5ecb8306
parent 581
f2fdd52e4e87
child 2525
2eb010b6cb22
equal deleted inserted replaced
1873:66147d50d8d6 1874:891c5ecb8306
1 /* 1 /*
2 * Copyright (c) 2007, 2008, Oracle and/or its affiliates. All rights reserved. 2 * Copyright (c) 2007, 2013, 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
31 * This code and its internal interfaces are subject to change or 31 * This code and its internal interfaces are subject to change or
32 * deletion without notice.</b> 32 * deletion without notice.</b>
33 */ 33 */
34 public class DefaultAttribute extends Attribute { 34 public class DefaultAttribute extends Attribute {
35 DefaultAttribute(ClassReader cr, int name_index, byte[] data) { 35 DefaultAttribute(ClassReader cr, int name_index, byte[] data) {
36 this(cr, name_index, data, null);
37 }
38
39 DefaultAttribute(ClassReader cr, int name_index, byte[] data, String reason) {
36 super(name_index, data.length); 40 super(name_index, data.length);
37 info = data; 41 info = data;
42 this.reason = reason;
38 } 43 }
39 44
40 public DefaultAttribute(ConstantPool constant_pool, int name_index, byte[] info) { 45 public DefaultAttribute(ConstantPool constant_pool, int name_index, byte[] info) {
46 this(constant_pool, name_index, info, null);
47 }
48
49 public DefaultAttribute(ConstantPool constant_pool, int name_index,
50 byte[] info, String reason) {
41 super(name_index, info.length); 51 super(name_index, info.length);
42 this.info = info; 52 this.info = info;
53 this.reason = reason;
43 } 54 }
44 55
45 public <R, P> R accept(Visitor<R, P> visitor, P p) { 56 public <R, P> R accept(Visitor<R, P> visitor, P p) {
46 return visitor.visitDefault(this, p); 57 return visitor.visitDefault(this, p);
47 } 58 }
48 59
49 public final byte[] info; 60 public final byte[] info;
61 /** Why did we need to generate a DefaultAttribute
62 */
63 public final String reason;
50 } 64 }

mercurial