diff options
author | Sebastian Bazley <sebb@apache.org> | 2014-05-30 22:51:27 +0000 |
---|---|---|
committer | Sebastian Bazley <sebb@apache.org> | 2014-05-30 22:51:27 +0000 |
commit | 0bccef9117c0f0ccee3d5c7292d8100bc82009bb (patch) | |
tree | 71c030d8e30161501a07dd3c56d52d13d92045b0 /src/main/java/org/apache/bcel/generic/ElementValuePairGen.java | |
parent | fd663802595f71b2ae9d64695ce9029cbfccd56c (diff) | |
download | apache-commons-bcel-0bccef9117c0f0ccee3d5c7292d8100bc82009bb.tar.gz |
Tab police
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/bcel/trunk@1598766 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/main/java/org/apache/bcel/generic/ElementValuePairGen.java')
-rw-r--r-- | src/main/java/org/apache/bcel/generic/ElementValuePairGen.java | 142 |
1 files changed, 71 insertions, 71 deletions
diff --git a/src/main/java/org/apache/bcel/generic/ElementValuePairGen.java b/src/main/java/org/apache/bcel/generic/ElementValuePairGen.java index 5c57549d..22ef83e9 100644 --- a/src/main/java/org/apache/bcel/generic/ElementValuePairGen.java +++ b/src/main/java/org/apache/bcel/generic/ElementValuePairGen.java @@ -25,87 +25,87 @@ import org.apache.bcel.classfile.ElementValuePair; public class ElementValuePairGen { - private int nameIdx; + private int nameIdx; - private ElementValueGen value; + private ElementValueGen value; - private ConstantPoolGen cpool; + private ConstantPoolGen cpool; - public ElementValuePairGen(ElementValuePair nvp, ConstantPoolGen cpool, - boolean copyPoolEntries) - { - this.cpool = cpool; - // J5ASSERT: - // Could assert nvp.getNameString() points to the same thing as - // cpool.getConstant(nvp.getNameIndex()) - // if - // (!nvp.getNameString().equals(((ConstantUtf8)cpool.getConstant(nvp.getNameIndex())).getBytes())) - // { - // throw new RuntimeException("envp buggered"); - // } - if (copyPoolEntries) - { - nameIdx = cpool.addUtf8(nvp.getNameString()); - } - else - { - nameIdx = nvp.getNameIndex(); - } - value = ElementValueGen.copy(nvp.getValue(), cpool, copyPoolEntries); - } + public ElementValuePairGen(ElementValuePair nvp, ConstantPoolGen cpool, + boolean copyPoolEntries) + { + this.cpool = cpool; + // J5ASSERT: + // Could assert nvp.getNameString() points to the same thing as + // cpool.getConstant(nvp.getNameIndex()) + // if + // (!nvp.getNameString().equals(((ConstantUtf8)cpool.getConstant(nvp.getNameIndex())).getBytes())) + // { + // throw new RuntimeException("envp buggered"); + // } + if (copyPoolEntries) + { + nameIdx = cpool.addUtf8(nvp.getNameString()); + } + else + { + nameIdx = nvp.getNameIndex(); + } + value = ElementValueGen.copy(nvp.getValue(), cpool, copyPoolEntries); + } - /** - * Retrieve an immutable version of this ElementNameValuePairGen - */ - public ElementValuePair getElementNameValuePair() - { - ElementValue immutableValue = value.getElementValue(); - return new ElementValuePair(nameIdx, immutableValue, cpool - .getConstantPool()); - } + /** + * Retrieve an immutable version of this ElementNameValuePairGen + */ + public ElementValuePair getElementNameValuePair() + { + ElementValue immutableValue = value.getElementValue(); + return new ElementValuePair(nameIdx, immutableValue, cpool + .getConstantPool()); + } - protected ElementValuePairGen(int idx, ElementValueGen value, - ConstantPoolGen cpool) - { - this.nameIdx = idx; - this.value = value; - this.cpool = cpool; - } + protected ElementValuePairGen(int idx, ElementValueGen value, + ConstantPoolGen cpool) + { + this.nameIdx = idx; + this.value = value; + this.cpool = cpool; + } - public ElementValuePairGen(String name, ElementValueGen value, - ConstantPoolGen cpool) - { - this.nameIdx = cpool.addUtf8(name); - this.value = value; - this.cpool = cpool; - } + public ElementValuePairGen(String name, ElementValueGen value, + ConstantPoolGen cpool) + { + this.nameIdx = cpool.addUtf8(name); + this.value = value; + this.cpool = cpool; + } - protected void dump(DataOutputStream dos) throws IOException - { - dos.writeShort(nameIdx); // u2 name of the element - value.dump(dos); - } + protected void dump(DataOutputStream dos) throws IOException + { + dos.writeShort(nameIdx); // u2 name of the element + value.dump(dos); + } - public int getNameIndex() - { - return nameIdx; - } + public int getNameIndex() + { + return nameIdx; + } - public final String getNameString() - { - // ConstantString cu8 = (ConstantString)cpool.getConstant(nameIdx); - return ((ConstantUtf8) cpool.getConstant(nameIdx)).getBytes(); - } + public final String getNameString() + { + // ConstantString cu8 = (ConstantString)cpool.getConstant(nameIdx); + return ((ConstantUtf8) cpool.getConstant(nameIdx)).getBytes(); + } - public final ElementValueGen getValue() - { - return value; - } + public final ElementValueGen getValue() + { + return value; + } - @Override + @Override public String toString() - { - return "ElementValuePair:[" + getNameString() + "=" - + value.stringifyValue() + "]"; - } + { + return "ElementValuePair:[" + getNameString() + "=" + + value.stringifyValue() + "]"; + } } |