diff options
author | Bernard Normier <bernard@zeroc.com> | 2012-10-13 16:50:07 -0400 |
---|---|---|
committer | Bernard Normier <bernard@zeroc.com> | 2012-10-13 16:50:07 -0400 |
commit | 210d46ee60f8f9821ec21d99fe2a6a87ec9e7de5 (patch) | |
tree | 11d66335012d44932004877760271f95305be186 /java/src/Ice/UserException.java | |
parent | .NET CF fixes (diff) | |
download | ice-210d46ee60f8f9821ec21d99fe2a6a87ec9e7de5.tar.bz2 ice-210d46ee60f8f9821ec21d99fe2a6a87ec9e7de5.tar.xz ice-210d46ee60f8f9821ec21d99fe2a6a87ec9e7de5.zip |
Better generated __read and __write for classes and exceptions (C++, Java and C#)
Diffstat (limited to 'java/src/Ice/UserException.java')
-rw-r--r-- | java/src/Ice/UserException.java | 54 |
1 files changed, 40 insertions, 14 deletions
diff --git a/java/src/Ice/UserException.java b/java/src/Ice/UserException.java index 6beea1ed671..b7d46c40903 100644 --- a/java/src/Ice/UserException.java +++ b/java/src/Ice/UserException.java @@ -69,27 +69,53 @@ public abstract class UserException extends Exception implements Cloneable return sw.toString(); } - public abstract void - __write(IceInternal.BasicStream __os); - - public abstract void - __writeImpl(IceInternal.BasicStream __os); - - public abstract void - __read(IceInternal.BasicStream __is); + public void + __write(IceInternal.BasicStream os) + { + os.startWriteException(null); + __writeImpl(os); + os.endWriteException(); + } - public abstract void - __readImpl(IceInternal.BasicStream __is); + public void + __read(IceInternal.BasicStream is) + { + is.startReadException(); + __readImpl(is); + is.endReadException(false); + } public void - __write(Ice.OutputStream __outS) + __write(Ice.OutputStream os) { - assert(false); + os.startException(null); + __writeImpl(os); + os.endException(); } public void - __read(Ice.InputStream __inS) + __read(Ice.InputStream is) + { + is.startException(); + __readImpl(is); + is.endException(false); + } + + protected abstract void + __writeImpl(IceInternal.BasicStream os); + + protected abstract void + __readImpl(IceInternal.BasicStream is); + + protected void + __writeImpl(OutputStream os) + { + throw new MarshalException("exception was not generated with stream support"); + } + + protected void + __readImpl(InputStream is) { - assert(false); + throw new MarshalException("exception was not generated with stream support"); } } |