[Libreoffice-commits] core.git: javaunohelper/com
Noel Grandin
noel at peralex.com
Thu Oct 15 00:26:46 PDT 2015
javaunohelper/com/sun/star/lib/uno/adapter/InputStreamToXInputStreamAdapter.java | 15 +---------
1 file changed, 2 insertions(+), 13 deletions(-)
New commits:
commit bc492df7132d25d221fb44a24409a393ae6aa6ff
Author: Noel Grandin <noel at peralex.com>
Date: Thu Oct 15 09:25:48 2015 +0200
cid#1326115 Unchecked return value
and drop some truly bizarre and unnecessary code
Change-Id: I105ba8784b6c4179a3cd7ad5bf9a250fd680d64a
diff --git a/javaunohelper/com/sun/star/lib/uno/adapter/InputStreamToXInputStreamAdapter.java b/javaunohelper/com/sun/star/lib/uno/adapter/InputStreamToXInputStreamAdapter.java
index 0053c4d..3d60e5a 100644
--- a/javaunohelper/com/sun/star/lib/uno/adapter/InputStreamToXInputStreamAdapter.java
+++ b/javaunohelper/com/sun/star/lib/uno/adapter/InputStreamToXInputStreamAdapter.java
@@ -127,9 +127,6 @@ public final class InputStreamToXInputStreamAdapter implements XInputStream {
public void skipBytes(int n) throws
com.sun.star.io.IOException
{
- int tmpLongVal = n;
- int tmpIntVal;
-
try {
iIn.available();
} catch (IOException e) {
@@ -137,20 +134,12 @@ public final class InputStreamToXInputStreamAdapter implements XInputStream {
}
do {
- if (tmpLongVal >= Integer.MAX_VALUE) {
- tmpIntVal = Integer.MAX_VALUE;
- } else {
- // Casting is safe here.
- tmpIntVal = tmpLongVal;
- }
- tmpLongVal -= tmpIntVal;
-
try {
- iIn.skip(tmpIntVal);
+ n -= iIn.skip(n);
} catch (IOException e) {
throw new com.sun.star.io.IOException(e);
}
- } while (tmpLongVal > 0);
+ } while (n > 0);
}
}
More information about the Libreoffice-commits
mailing list