From d70ef1d7d2c86c85e02292c6ce32a7257c021c7b Mon Sep 17 00:00:00 2001 From: jochen Date: Fri, 9 Apr 1999 08:10:43 +0000 Subject: [PATCH] differ between long and short constants git-svn-id: https://svn.code.sf.net/p/jode/code/trunk@544 379699f6-c40d-0410-875b-85095c16579e --- jode/jode/obfuscator/FieldIdentifier.java | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/jode/jode/obfuscator/FieldIdentifier.java b/jode/jode/obfuscator/FieldIdentifier.java index 3f58cdf..4e1e011 100644 --- a/jode/jode/obfuscator/FieldIdentifier.java +++ b/jode/jode/obfuscator/FieldIdentifier.java @@ -154,16 +154,12 @@ public class FieldIdentifier extends Identifier{ nameIndex = gcp.putUTF(getAlias()); descriptorIndex = gcp.putUTF(clazz.bundle.getTypeAlias(getType())); constvalIndex = 0; - AttributeInfo attribute = info.findAttribute("ConstantValue"); - if (attribute != null) { - byte[] contents = attribute.getContents(); - if (contents.length != 2) - throw new ClassFormatError("ConstantValue attribute" - + " has wrong length"); - int index = (contents[0] & 0xff) << 8 | (contents[1] & 0xff); + if (info.getConstant() != null) { constvalIndex = gcp.putUTF("ConstantValue"); - constvalcontentIndex = - gcp.copyConstant(clazz.info.getConstantPool(), index); + if (info.getType().stackSize() == 2) + constvalcontentIndex = gcp.putLongConstant(info.getConstant()); + else + constvalcontentIndex = gcp.putConstant(info.getConstant()); } }