aboutsummaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
authorRoel Spilker <r.spilker@gmail.com>2012-01-23 21:15:13 +0100
committerRoel Spilker <r.spilker@gmail.com>2012-01-23 21:15:13 +0100
commitb7ebd3a6743eb245c614a74ca55fc661f008ffd6 (patch)
treea9f893252436e31c969c09c70ee0767e7de770c1 /src/core
parent4c04aca3fbb12f526b2e0c102f2beaf89a134f25 (diff)
downloadlombok-b7ebd3a6743eb245c614a74ca55fc661f008ffd6.tar.gz
lombok-b7ebd3a6743eb245c614a74ca55fc661f008ffd6.tar.bz2
lombok-b7ebd3a6743eb245c614a74ca55fc661f008ffd6.zip
Fixed bug in reading long and double values
Diffstat (limited to 'src/core')
-rw-r--r--src/core/lombok/bytecode/ClassFileMetaData.java13
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);
}
/**