summaryrefslogtreecommitdiff
path: root/src/main/java/com/amazon/carbonado/raw
diff options
context:
space:
mode:
authorBrian S. O'Neill <bronee@gmail.com>2008-03-25 05:38:00 +0000
committerBrian S. O'Neill <bronee@gmail.com>2008-03-25 05:38:00 +0000
commit3db26bff365de7d2d4e7fc45ad31b8104c78a0ae (patch)
treea32ea36c3e356311559d984a4d61524193869f55 /src/main/java/com/amazon/carbonado/raw
parent5ad29e976d528214c6e26065f2fb39126a5ae10a (diff)
Fixes for bugs as reported by FindBugs.
Diffstat (limited to 'src/main/java/com/amazon/carbonado/raw')
-rw-r--r--src/main/java/com/amazon/carbonado/raw/DataEncoder.java9
-rw-r--r--src/main/java/com/amazon/carbonado/raw/KeyEncoder.java4
2 files changed, 4 insertions, 9 deletions
diff --git a/src/main/java/com/amazon/carbonado/raw/DataEncoder.java b/src/main/java/com/amazon/carbonado/raw/DataEncoder.java
index 1049644..6eebc93 100644
--- a/src/main/java/com/amazon/carbonado/raw/DataEncoder.java
+++ b/src/main/java/com/amazon/carbonado/raw/DataEncoder.java
@@ -44,11 +44,6 @@ public class DataEncoder {
/** Byte to use for not-null, high ordering */
static final byte NOT_NULL_BYTE_LOW = (byte)~NOT_NULL_BYTE_HIGH;
- static final byte[] NULL_BYTE_ARRAY_HIGH = {NULL_BYTE_HIGH};
- static final byte[] NULL_BYTE_ARRAY_LOW = {NULL_BYTE_LOW};
- static final byte[] NOT_NULL_BYTE_ARRAY_HIGH = {NOT_NULL_BYTE_HIGH};
- static final byte[] NOT_NULL_BYTE_ARRAY_LOW = {NOT_NULL_BYTE_LOW};
-
/**
* Encodes the given signed integer into exactly 4 bytes.
*
@@ -604,12 +599,12 @@ public class DataEncoder {
public static byte[] encodeSingleNullable(byte[] value, int prefixPadding, int suffixPadding) {
if (prefixPadding <= 0 && suffixPadding <= 0) {
if (value == null) {
- return NULL_BYTE_ARRAY_HIGH;
+ return new byte[] {NULL_BYTE_HIGH};
}
int length = value.length;
if (length == 0) {
- return NOT_NULL_BYTE_ARRAY_HIGH;
+ return new byte[] {NOT_NULL_BYTE_HIGH};
}
byte[] dst = new byte[1 + length];
diff --git a/src/main/java/com/amazon/carbonado/raw/KeyEncoder.java b/src/main/java/com/amazon/carbonado/raw/KeyEncoder.java
index 44c5af5..5b11586 100644
--- a/src/main/java/com/amazon/carbonado/raw/KeyEncoder.java
+++ b/src/main/java/com/amazon/carbonado/raw/KeyEncoder.java
@@ -708,12 +708,12 @@ public class KeyEncoder extends DataEncoder {
int prefixPadding, int suffixPadding) {
if (prefixPadding <= 0 && suffixPadding <= 0) {
if (value == null) {
- return NULL_BYTE_ARRAY_LOW;
+ return new byte[] {NULL_BYTE_LOW};
}
int length = value.length;
if (length == 0) {
- return NOT_NULL_BYTE_ARRAY_LOW;
+ return new byte[] {NOT_NULL_BYTE_LOW};
}
byte[] dst = new byte[1 + length];