diff options
author | Roel Spilker <r.spilker@gmail.com> | 2012-01-30 19:48:12 +0100 |
---|---|---|
committer | Roel Spilker <r.spilker@gmail.com> | 2012-01-30 19:48:12 +0100 |
commit | 55384884d380fba1a5fe024e1d82329d71c36f02 (patch) | |
tree | a19f69b9a4da56b58abb96e0a79d852eeb659bb0 /src/core/lombok/bytecode | |
parent | 98875218ea3f6ba68f7f83d3e0458c9901db00f3 (diff) | |
parent | fc7ca61aeb3ee06c426573b5059e97532b601172 (diff) | |
download | lombok-55384884d380fba1a5fe024e1d82329d71c36f02.tar.gz lombok-55384884d380fba1a5fe024e1d82329d71c36f02.tar.bz2 lombok-55384884d380fba1a5fe024e1d82329d71c36f02.zip |
Merge branch 'master' of github.com:rzwitserloot/lombok
Diffstat (limited to 'src/core/lombok/bytecode')
-rw-r--r-- | src/core/lombok/bytecode/ClassFileMetaData.java | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/core/lombok/bytecode/ClassFileMetaData.java b/src/core/lombok/bytecode/ClassFileMetaData.java index 794705cb..68b8bb7d 100644 --- a/src/core/lombok/bytecode/ClassFileMetaData.java +++ b/src/core/lombok/bytecode/ClassFileMetaData.java @@ -214,6 +214,7 @@ public class ClassFileMetaData { * Checks if the constant pool contains the provided string constant, which implies the constant is used somewhere in the code. * * NB: String literals get concatenated by the compiler. + * NB2: This method does NOT do any kind of normalization. */ public boolean containsStringConstant(String value) { int index = findUtf8(value); @@ -282,25 +283,23 @@ public class ClassFileMetaData { private long readLong(int index) { int pos = offsets[index]; - return ((long)read32(pos)) << 32 | read32(pos + 4); + return ((long)read32(pos)) << 32 | (read32(pos + 4) & 0x00000000FFFFFFFFL); } private double readDouble(int index) { - int pos = offsets[index]; - long bits = ((long)read32(pos)) << 32 | (read32(pos + 4) & 0x00000000FFFFFFFF); - return Double.longBitsToDouble(bits); + return Double.longBitsToDouble(readLong(index)); } - private long readInteger(int index) { + private int readInteger(int index) { return read32(offsets[index]); } private float readFloat(int index) { - return Float.intBitsToFloat(read32(offsets[index])); + return Float.intBitsToFloat(readInteger(index)); } private int read32(int pos) { - return (byteCode[pos] & 0xFF) << 24 | (byteCode[pos + 1] & 0xFF) << 16 | (byteCode[pos + 2] & 0xFF) << 8 | (byteCode[pos + 3] &0xFF); + return (byteCode[pos] & 0xFF) << 24 | (byteCode[pos + 1] & 0xFF) << 16 | (byteCode[pos + 2] & 0xFF) << 8 | (byteCode[pos + 3] & 0xFF); } /** |