diff options
author | Noel Grandin <noel@peralex.com> | 2014-09-29 11:30:07 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2014-09-29 11:31:01 +0200 |
commit | d5cdc7567299f03e655dfbb1d59c371fb3253b88 (patch) | |
tree | 3fc55e49f7335b5f4d63d353e70291aee7f9bd7f /jurt | |
parent | 89ea05d8547b12de1041e9b637690731daa42a62 (diff) |
fix Java1.5 incompatibility
the java.io.IOException(Throwable) constructor was only introduced
in 1.6
Change-Id: Icd40e91cce7a2e89e4a70ad55f31baaa86eebfe2
Diffstat (limited to 'jurt')
-rw-r--r-- | jurt/com/sun/star/lib/uno/bridges/java_remote/XConnectionInputStream_Adapter.java | 10 | ||||
-rw-r--r-- | jurt/com/sun/star/lib/uno/bridges/java_remote/XConnectionOutputStream_Adapter.java | 12 |
2 files changed, 15 insertions, 7 deletions
diff --git a/jurt/com/sun/star/lib/uno/bridges/java_remote/XConnectionInputStream_Adapter.java b/jurt/com/sun/star/lib/uno/bridges/java_remote/XConnectionInputStream_Adapter.java index 48fea08bd216..7f65c3ba9c95 100644 --- a/jurt/com/sun/star/lib/uno/bridges/java_remote/XConnectionInputStream_Adapter.java +++ b/jurt/com/sun/star/lib/uno/bridges/java_remote/XConnectionInputStream_Adapter.java @@ -46,7 +46,9 @@ class XConnectionInputStream_Adapter extends InputStream { try { len = _xConnection.read(_bytes, 1); } catch(com.sun.star.io.IOException ioException) { - throw new IOException(ioException); + IOException ex = new IOException(ioException.getMessage()); + ex.initCause(ioException); + throw ex; } if(DEBUG) System.err.println("#### " + getClass().getName() + " - one byte read:" + _bytes[0][0]); @@ -56,12 +58,12 @@ class XConnectionInputStream_Adapter extends InputStream { @Override public int read(byte[] b, int off, int len) throws IOException { -// byte bytes[][] = new byte[1][]; - try { len = _xConnection.read(_bytes, len - off); } catch(com.sun.star.io.IOException ioException) { - throw new IOException(ioException); + IOException ex = new IOException(ioException.getMessage()); + ex.initCause(ioException); + throw ex; } System.arraycopy(_bytes[0], 0, b, off, len); diff --git a/jurt/com/sun/star/lib/uno/bridges/java_remote/XConnectionOutputStream_Adapter.java b/jurt/com/sun/star/lib/uno/bridges/java_remote/XConnectionOutputStream_Adapter.java index 954afe8df6a0..fe9707492335 100644 --- a/jurt/com/sun/star/lib/uno/bridges/java_remote/XConnectionOutputStream_Adapter.java +++ b/jurt/com/sun/star/lib/uno/bridges/java_remote/XConnectionOutputStream_Adapter.java @@ -44,7 +44,9 @@ class XConnectionOutputStream_Adapter extends OutputStream { try { _xConnection.write(_bytes); } catch(com.sun.star.io.IOException ioException) { - throw new IOException(ioException); + IOException ex = new IOException(ioException.getMessage()); + ex.initCause(ioException); + throw ex; } if(DEBUG) System.err.println("#### " + this.getClass() + " - one byte written:" + _bytes[0]); @@ -65,7 +67,9 @@ class XConnectionOutputStream_Adapter extends OutputStream { try { _xConnection.write(bytes); } catch(com.sun.star.io.IOException ioException) { - throw new IOException(ioException); + IOException ex = new IOException(ioException.getMessage()); + ex.initCause(ioException); + throw ex; } } @@ -74,7 +78,9 @@ class XConnectionOutputStream_Adapter extends OutputStream { try { _xConnection.flush(); } catch(com.sun.star.io.IOException ioException) { - throw new IOException(ioException); + IOException ex = new IOException(ioException.getMessage()); + ex.initCause(ioException); + throw ex; } } } |