diff options
author | Sven Gothel <[email protected]> | 2014-07-08 21:09:30 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2014-07-08 21:09:30 +0200 |
commit | a41db57df54863566b0e286cd100bbbc5518eb7f (patch) | |
tree | fb82077e79f54ba2fcf4c77b42458572fd9995eb /src/jogl/classes/jogamp/graph | |
parent | b740161d456c059d1b51029c603ce144eb2b2d44 (diff) |
Findbugs: Use <NumberType>.valueOf(..) instead of 'new <NumberType>(..)'
Diffstat (limited to 'src/jogl/classes/jogamp/graph')
-rw-r--r-- | src/jogl/classes/jogamp/graph/font/typecast/ot/table/CffTable.java | 12 | ||||
-rw-r--r-- | src/jogl/classes/jogamp/graph/font/typecast/ot/table/CharstringType2.java | 10 |
2 files changed, 11 insertions, 11 deletions
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CffTable.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CffTable.java index b0acff575..541c280bc 100644 --- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CffTable.java +++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CffTable.java @@ -100,26 +100,26 @@ public class CffTable implements Table { // 1 byte integer ++_index; - return new Integer(b0 - 139); + return Integer.valueOf(b0 - 139); } else if (247 <= b0 && b0 <= 250) { // 2 byte integer final int b1 = _data[_index + 1]; _index += 2; - return new Integer((b0 - 247) * 256 + b1 + 108); + return Integer.valueOf((b0 - 247) * 256 + b1 + 108); } else if (251 <= b0 && b0 <= 254) { // 2 byte integer final int b1 = _data[_index + 1]; _index += 2; - return new Integer(-(b0 - 251) * 256 - b1 - 108); + return Integer.valueOf(-(b0 - 251) * 256 - b1 - 108); } else if (b0 == 28) { // 3 byte integer final int b1 = _data[_index + 1]; final int b2 = _data[_index + 2]; _index += 3; - return new Integer(b1 << 8 | b2); + return Integer.valueOf(b1 << 8 | b2); } else if (b0 == 29) { // 5 byte integer @@ -128,7 +128,7 @@ public class CffTable implements Table { final int b3 = _data[_index + 3]; final int b4 = _data[_index + 4]; _index += 5; - return new Integer(b1 << 24 | b2 << 16 | b3 << 8 | b4); + return Integer.valueOf(b1 << 24 | b2 << 16 | b3 << 8 | b4); } else if (b0 == 30) { // Real number @@ -143,7 +143,7 @@ public class CffTable implements Table { fString.append(decodeRealNibble(nibble1)); fString.append(decodeRealNibble(nibble2)); } - return new Float(fString.toString()); + return Float.valueOf(fString.toString()); } else { return null; } diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CharstringType2.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CharstringType2.java index 211499357..d96a5848b 100644 --- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CharstringType2.java +++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CharstringType2.java @@ -183,26 +183,26 @@ public class CharstringType2 extends Charstring { // 1 byte integer ++_ip; - return new Integer(b0 - 139); + return Integer.valueOf(b0 - 139); } else if (247 <= b0 && b0 <= 250) { // 2 byte integer final int b1 = _data[_ip + 1]; _ip += 2; - return new Integer((b0 - 247) * 256 + b1 + 108); + return Integer.valueOf((b0 - 247) * 256 + b1 + 108); } else if (251 <= b0 && b0 <= 254) { // 2 byte integer final int b1 = _data[_ip + 1]; _ip += 2; - return new Integer(-(b0 - 251) * 256 - b1 - 108); + return Integer.valueOf(-(b0 - 251) * 256 - b1 - 108); } else if (b0 == 28) { // 3 byte integer final int b1 = _data[_ip + 1]; final int b2 = _data[_ip + 2]; _ip += 3; - return new Integer(b1 << 8 | b2); + return Integer.valueOf(b1 << 8 | b2); } else if (b0 == 255) { // 16-bit signed integer with 16 bits of fraction @@ -211,7 +211,7 @@ public class CharstringType2 extends Charstring { final int b3 = _data[_ip + 3]; final int b4 = _data[_ip + 4]; _ip += 5; - return new Float((b1 << 8 | b2) + ((b3 << 8 | b4) / 65536.0)); + return Float.valueOf((b1 << 8 | b2) + ((b3 << 8 | b4) / 65536f)); } else { return null; } |