xmerge/source/xmerge/java/org/openoffice/xmerge/converter/palm/PdbDecoder.java | 22 +++------- xmerge/source/xmerge/java/org/openoffice/xmerge/converter/palm/PdbUtil.java | 7 --- 2 files changed, 10 insertions(+), 19 deletions(-)
New commits: commit 94a5c8766d81c10084f69be6f576791a36ab2bc9 Author: rbuj <robert....@gmail.com> Date: Sun Jul 27 12:11:51 2014 +0200 xmerge: The assigned value is never used Change-Id: I56ee6583e0e5d82db018b40882a64b0dc00ec90f Reviewed-on: https://gerrit.libreoffice.org/10575 Reviewed-by: Michael Stahl <mst...@redhat.com> Tested-by: Michael Stahl <mst...@redhat.com> diff --git a/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/palm/PdbDecoder.java b/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/palm/PdbDecoder.java index 9bc3d65..d631562 100644 --- a/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/palm/PdbDecoder.java +++ b/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/palm/PdbDecoder.java @@ -101,24 +101,21 @@ public final class PdbDecoder { // read the records - int len = 0; - byte[] bytes = null; - int lastIndex = header.numRecords - 1; for (int i = 0; i < lastIndex; i++) { file.seek(recOffset[i]); - len = recOffset[i+1] - recOffset[i]; - bytes = new byte[len]; + int len = recOffset[i+1] - recOffset[i]; + byte[] bytes = new byte[len]; file.readFully(bytes); recArray[i] = new Record(bytes, recAttrs[i]); } // last record file.seek(recOffset[lastIndex]); - len = (int) file.length() - recOffset[lastIndex]; - bytes = new byte[len]; + int len = (int) file.length() - recOffset[lastIndex]; + byte[] bytes = new byte[len]; file.readFully(bytes); recArray[lastIndex] = new Record(bytes, recAttrs[lastIndex]); @@ -181,9 +178,6 @@ public final class PdbDecoder { // read the records - int len = 0; - byte[] bytes = null; - int lastIndex = header.numRecords - 1; for (int i = 0; i < lastIndex; i++) { @@ -191,8 +185,8 @@ public final class PdbDecoder { //dis.seek(recOffset[i]); dis.reset(); dis.skip(recOffset[i]); - len = recOffset[i+1] - recOffset[i]; - bytes = new byte[len]; + int len = recOffset[i+1] - recOffset[i]; + byte[] bytes = new byte[len]; dis.readFully(bytes); recArray[i] = new Record(bytes, recAttrs[i]); } @@ -200,9 +194,9 @@ public final class PdbDecoder { // last record dis.reset(); - len = dis.available() - recOffset[lastIndex]; + int len = dis.available() - recOffset[lastIndex]; dis.skip(recOffset[lastIndex]); - bytes = new byte[len]; + byte[] bytes = new byte[len]; dis.readFully(bytes); recArray[lastIndex] = new Record(bytes, recAttrs[lastIndex]); } diff --git a/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/palm/PdbUtil.java b/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/palm/PdbUtil.java index d30b242..a2ddbb1 100644 --- a/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/palm/PdbUtil.java +++ b/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/palm/PdbUtil.java @@ -49,13 +49,10 @@ public final class PdbUtil { */ public static int intID(String s) { - int id = -1; - int temp = 0; - // grab the first char and put it in the high bits // note that we only want 8 lower bits of it. - temp = s.charAt(0); - id = temp << 24; + int temp = s.charAt(0); + int id = temp << 24; // grab the second char and add it in. temp = s.charAt(1) & 0x00ff; _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits