[Nice-commit] Nice/src/gnu/bytecode MiscAttr.java,1.2,1.3
Brought to you by:
bonniot
From: Daniel B. <bo...@us...> - 2004-10-07 14:55:32
|
Update of /cvsroot/nice/Nice/src/gnu/bytecode In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1901/src/gnu/bytecode Modified Files: MiscAttr.java Log Message: Easier creation of attributes with no value. Index: MiscAttr.java =================================================================== RCS file: /cvsroot/nice/Nice/src/gnu/bytecode/MiscAttr.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** MiscAttr.java 3 Nov 2003 15:42:53 -0000 1.2 --- MiscAttr.java 7 Oct 2004 14:54:34 -0000 1.3 *************** *** 22,38 **** this.length = length; } ! public MiscAttr(String name, byte[] data) { this(name, data, 0, data.length); } ! ! public static Attribute synthetic() { ! return new MiscAttr("Synthetic", nobytes); } private static final byte[] nobytes = new byte[0]; public int getLength() { return length; } --- 22,43 ---- this.length = length; } ! public MiscAttr(String name, byte[] data) { this(name, data, 0, data.length); } ! ! public MiscAttr(String name) { ! this(name, nobytes, 0, 0); } private static final byte[] nobytes = new byte[0]; + public static Attribute synthetic() + { + return new MiscAttr("Synthetic"); + } + public int getLength() { return length; } |