[asterisk-scf-commits] asterisk-scf/integration/ice.git branch "object-slice-preservation-obsolete" created.

Commits to the Asterisk SCF project code repositories asterisk-scf-commits at lists.digium.com
Fri Feb 18 12:50:24 CST 2011


branch "object-slice-preservation-obsolete" has been created
        at  c74f0a05b6db8ce03d2260028d982fc21c3214c9 (commit)

- Log -----------------------------------------------------------------
commit c74f0a05b6db8ce03d2260028d982fc21c3214c9
Author: David M. Lee <dlee at digium.com>
Date:   Tue Oct 12 09:57:44 2010 -0500

    Fixed build error on Win64: size_t must explicitly be cast to Int

diff --git a/cpp/src/Ice/BasicStream.cpp b/cpp/src/Ice/BasicStream.cpp
index 124ec2d..0c3f904 100644
--- a/cpp/src/Ice/BasicStream.cpp
+++ b/cpp/src/Ice/BasicStream.cpp
@@ -275,7 +275,8 @@ IceInternal::BasicStream::getWriteSliceOffset()
     {
 	throw MarshalException(__FILE__, __LINE__, "slice offsets are only valid within slices");
     }
-    return b.size() - _writeSlice + sizeof(Int);
+    // XXX Should this really return a size_t?
+    return (Int)(b.size() - _writeSlice + sizeof(Int));
 }
 
 void

commit 97dedcaef113fe74b972ae376be73035f5d27056
Author: Kevin P. Fleming <kpfleming at digium.com>
Date:   Fri Jun 18 14:44:44 2010 -0500

    finish import of preserve-graphs

diff --git a/cs/src/Ice/.depend b/cs/src/Ice/.depend
index 941c0f5..08a5ef3 100644
--- a/cs/src/Ice/.depend
+++ b/cs/src/Ice/.depend
@@ -2,6 +2,7 @@ generated/BuiltinSequences.cs: $(slicedir)/Ice/BuiltinSequences.ice $(SLICE2CS)
 generated/Communicator.cs: $(slicedir)/Ice/Communicator.ice $(slicedir)/Ice/LoggerF.ice $(slicedir)/Ice/StatsF.ice $(slicedir)/Ice/ObjectAdapterF.ice $(slicedir)/Ice/ObjectFactoryF.ice $(slicedir)/Ice/RouterF.ice $(slicedir)/Ice/LocatorF.ice $(slicedir)/Ice/PluginF.ice $(slicedir)/Ice/ImplicitContextF.ice $(slicedir)/Ice/Current.ice $(slicedir)/Ice/ConnectionF.ice $(slicedir)/Ice/Identity.ice $(slicedir)/Ice/Properties.ice $(slicedir)/Ice/BuiltinSequences.ice $(SLICE2CS) $(SLICEPARSERLIB)
 generated/Connection.cs: $(slicedir)/Ice/Connection.ice $(slicedir)/Ice/ObjectAdapterF.ice $(slicedir)/Ice/Identity.ice $(slicedir)/Ice/Endpoint.ice $(slicedir)/Ice/BuiltinSequences.ice $(slicedir)/Ice/EndpointF.ice $(SLICE2CS) $(SLICEPARSERLIB)
 generated/Current.cs: $(slicedir)/Ice/Current.ice $(slicedir)/Ice/ObjectAdapterF.ice $(slicedir)/Ice/ConnectionF.ice $(slicedir)/Ice/Identity.ice $(SLICE2CS) $(SLICEPARSERLIB)
+generated/Preserve.cs: $(slicedir)/Ice/Preserve.ice $(slicedir)/Ice/BuiltinSequences.ice $(SLICE2CS) $(SLICEPARSERLIB)
 generated/Endpoint.cs: $(slicedir)/Ice/Endpoint.ice $(slicedir)/Ice/BuiltinSequences.ice $(slicedir)/Ice/EndpointF.ice $(SLICE2CS) $(SLICEPARSERLIB)
 generated/EndpointTypes.cs: $(slicedir)/Ice/EndpointTypes.ice $(SLICE2CS) $(SLICEPARSERLIB)
 generated/FacetMap.cs: $(slicedir)/Ice/FacetMap.ice $(SLICE2CS) $(SLICEPARSERLIB)
@@ -13,6 +14,7 @@ generated/Logger.cs: $(slicedir)/Ice/Logger.ice $(SLICE2CS) $(SLICEPARSERLIB)
 generated/ObjectAdapter.cs: $(slicedir)/Ice/ObjectAdapter.ice $(slicedir)/Ice/CommunicatorF.ice $(slicedir)/Ice/ServantLocatorF.ice $(slicedir)/Ice/LocatorF.ice $(slicedir)/Ice/Identity.ice $(slicedir)/Ice/FacetMap.ice $(slicedir)/Ice/Endpoint.ice $(slicedir)/Ice/BuiltinSequences.ice $(slicedir)/Ice/EndpointF.ice $(SLICE2CS) $(SLICEPARSERLIB)
 generated/ObjectFactory.cs: $(slicedir)/Ice/ObjectFactory.ice $(SLICE2CS) $(SLICEPARSERLIB)
 generated/Plugin.cs: $(slicedir)/Ice/Plugin.ice $(slicedir)/Ice/LoggerF.ice $(slicedir)/Ice/BuiltinSequences.ice $(SLICE2CS) $(SLICEPARSERLIB)
+generated/Preserve.cs: $(slicedir)/Ice/Preserve.ice $(slicedir)/Ice/BuiltinSequences.ice $(SLICE2CS) $(SLICEPARSERLIB)
 generated/Process.cs: $(slicedir)/Ice/Process.ice $(SLICE2CS) $(SLICEPARSERLIB)
 generated/Properties.cs: $(slicedir)/Ice/Properties.ice $(slicedir)/Ice/BuiltinSequences.ice $(SLICE2CS) $(SLICEPARSERLIB)
 generated/Router.cs: $(slicedir)/Ice/Router.ice $(slicedir)/Ice/BuiltinSequences.ice $(SLICE2CS) $(SLICEPARSERLIB)
diff --git a/cs/src/Ice/.depend.mak b/cs/src/Ice/.depend.mak
index 5fd4585..e82f99d 100644
--- a/cs/src/Ice/.depend.mak
+++ b/cs/src/Ice/.depend.mak
@@ -2,6 +2,7 @@ generated/BuiltinSequences.cs: "$(slicedir)/Ice/BuiltinSequences.ice" "$(SLICE2C
 generated/Communicator.cs: "$(slicedir)/Ice/Communicator.ice" "$(slicedir)/Ice/LoggerF.ice" "$(slicedir)/Ice/StatsF.ice" "$(slicedir)/Ice/ObjectAdapterF.ice" "$(slicedir)/Ice/ObjectFactoryF.ice" "$(slicedir)/Ice/RouterF.ice" "$(slicedir)/Ice/LocatorF.ice" "$(slicedir)/Ice/PluginF.ice" "$(slicedir)/Ice/ImplicitContextF.ice" "$(slicedir)/Ice/Current.ice" "$(slicedir)/Ice/ConnectionF.ice" "$(slicedir)/Ice/Identity.ice" "$(slicedir)/Ice/Properties.ice" "$(slicedir)/Ice/BuiltinSequences.ice" "$(SLICE2CS)" "$(SLICEPARSERLIB)"
 generated/Connection.cs: "$(slicedir)/Ice/Connection.ice" "$(slicedir)/Ice/ObjectAdapterF.ice" "$(slicedir)/Ice/Identity.ice" "$(slicedir)/Ice/Endpoint.ice" "$(slicedir)/Ice/BuiltinSequences.ice" "$(slicedir)/Ice/EndpointF.ice" "$(SLICE2CS)" "$(SLICEPARSERLIB)"
 generated/Current.cs: "$(slicedir)/Ice/Current.ice" "$(slicedir)/Ice/ObjectAdapterF.ice" "$(slicedir)/Ice/ConnectionF.ice" "$(slicedir)/Ice/Identity.ice" "$(SLICE2CS)" "$(SLICEPARSERLIB)"
+generated/Preserve.cs: "$(slicedir)/Ice/Preserve.ice" "$(slicedir)/Ice/BuiltinSequences.ice" "$(SLICE2CS)" "$(SLICEPARSERLIB)"
 generated/Endpoint.cs: "$(slicedir)/Ice/Endpoint.ice" "$(slicedir)/Ice/BuiltinSequences.ice" "$(slicedir)/Ice/EndpointF.ice" "$(SLICE2CS)" "$(SLICEPARSERLIB)"
 generated/EndpointTypes.cs: "$(slicedir)/Ice/EndpointTypes.ice" "$(SLICE2CS)" "$(SLICEPARSERLIB)"
 generated/FacetMap.cs: "$(slicedir)/Ice/FacetMap.ice" "$(SLICE2CS)" "$(SLICEPARSERLIB)"
@@ -13,6 +14,7 @@ generated/Logger.cs: "$(slicedir)/Ice/Logger.ice" "$(SLICE2CS)" "$(SLICEPARSERLI
 generated/ObjectAdapter.cs: "$(slicedir)/Ice/ObjectAdapter.ice" "$(slicedir)/Ice/CommunicatorF.ice" "$(slicedir)/Ice/ServantLocatorF.ice" "$(slicedir)/Ice/LocatorF.ice" "$(slicedir)/Ice/Identity.ice" "$(slicedir)/Ice/FacetMap.ice" "$(slicedir)/Ice/Endpoint.ice" "$(slicedir)/Ice/BuiltinSequences.ice" "$(slicedir)/Ice/EndpointF.ice" "$(SLICE2CS)" "$(SLICEPARSERLIB)"
 generated/ObjectFactory.cs: "$(slicedir)/Ice/ObjectFactory.ice" "$(SLICE2CS)" "$(SLICEPARSERLIB)"
 generated/Plugin.cs: "$(slicedir)/Ice/Plugin.ice" "$(slicedir)/Ice/LoggerF.ice" "$(slicedir)/Ice/BuiltinSequences.ice" "$(SLICE2CS)" "$(SLICEPARSERLIB)"
+generated/Preserve.cs: "$(slicedir)/Ice/Preserve.ice" "$(slicedir)/Ice/BuiltinSequences.ice" "$(SLICE2CS)" "$(SLICEPARSERLIB)"
 generated/Process.cs: "$(slicedir)/Ice/Process.ice" "$(SLICE2CS)" "$(SLICEPARSERLIB)"
 generated/Properties.cs: "$(slicedir)/Ice/Properties.ice" "$(slicedir)/Ice/BuiltinSequences.ice" "$(SLICE2CS)" "$(SLICEPARSERLIB)"
 generated/Router.cs: "$(slicedir)/Ice/Router.ice" "$(slicedir)/Ice/BuiltinSequences.ice" "$(SLICE2CS)" "$(SLICEPARSERLIB)"
diff --git a/cs/src/Ice/BasicStream.cs b/cs/src/Ice/BasicStream.cs
index 703c362..b4d85b6 100644
--- a/cs/src/Ice/BasicStream.cs
+++ b/cs/src/Ice/BasicStream.cs
@@ -464,6 +464,15 @@ namespace IceInternal
             _buf.b.putInt(_writeSlice - 4, sz);
         }
 
+	public virtual int getWriteSliceOffset()
+	{
+	    if(_buf.size() < _writeSlice)
+	    {
+		throw new Ice.MarshalException("slice offsets are only valid within slices"); 
+	    }
+	    return _buf.size() - _writeSlice + 4;
+	}
+
         public virtual void startReadSlice()
         {
             int sz = readInt();
@@ -495,6 +504,21 @@ namespace IceInternal
             }
         }
 
+	public virtual void skipSlice(string typeId)
+	{
+	   Ice.SkippedSlice newSlice = new Ice.SkippedSlice { typeId = typeId };
+	   skipSlice();
+	   if(_currentObjectStart < _buf.b.position())
+	   {
+	       newSlice.slice = _buf.b.toArray(_currentObjectStart, _buf.b.position() - _currentObjectStart);
+	   }
+	   if(_skippedSlices == null)
+	   {
+	       _skippedSlices = new List<Ice.SkippedSlice>();
+	   }
+	   _skippedSlices.Add(newSlice);
+	}
+
         public int readAndCheckSeqSize(int minSize)
         {
             int sz = readSize();
@@ -648,6 +672,11 @@ namespace IceInternal
             _buf.b.put(v);
         }
 
+	public virtual List<Ice.SkippedSlice> getSkippedSlices()
+	{
+	    return new List<Ice.SkippedSlice>(_skippedSlices);
+	}
+
         public virtual void readBlob(byte[] v)
         {
             try
@@ -2022,7 +2051,7 @@ namespace IceInternal
             return instance_.proxyFactory().streamToProxy(this);
         }
 
-        public virtual void writeObject(Ice.Object v)
+        public virtual int writeObject(Ice.Object v)
         {
             if(_writeEncapsStack == null) // Lazy initialization
             {
@@ -2068,11 +2097,13 @@ namespace IceInternal
                     p = q;
                 }
                 writeInt(-((int)p));
+		return (int)p;
             }
             else
             {
                 writeInt(0); // Write null reference
             }
+	    return 0;
         }
 
         public virtual void readObject(IPatcher patcher)
@@ -2139,6 +2170,8 @@ namespace IceInternal
             }
 
             string mostDerivedId = readTypeId();
+	    _skippedSlices.Clear();
+	    _currentObjectStart = _buf.b.position();
             string id = mostDerivedId;
 
             while(true)
@@ -2209,8 +2242,9 @@ namespace IceInternal
                         {
                             TraceUtil.traceSlicing("class", id, _slicingCat, instance_.initializationData().logger);
                         }
-                        skipSlice(); // Slice off this derived part -- we don't understand it.
+                        skipSlice(id); // Slice off this derived part -- we don't understand it.
                         id = readTypeId(); // Read next id for next iteration.
+			_currentObjectStart = _buf.b.position();
                         continue;
                     }
                     else
@@ -2256,7 +2290,9 @@ namespace IceInternal
             bool usesClasses = readBool();
 
             string id = readString();
+	    _currentObjectStart = _buf.b.position();
             string origId = id;
+	    _skippedSlices.Clear();
 
             for(;;)
             {
@@ -2279,7 +2315,7 @@ namespace IceInternal
                     catch(Ice.UserException ex)
                     {
                         ex.read__(this, false);
-                        if(usesClasses)
+                        if(usesClasses || ex.usesClasses__())
                         {
                             readPendingObjects();
                         }
@@ -2302,11 +2338,12 @@ namespace IceInternal
                         TraceUtil.traceSlicing("exception", id, _slicingCat, instance_.initializationData().logger);
                     }
 
-                    skipSlice(); // Slice off what we don't understand.
+                    skipSlice(id); // Slice off what we don't understand.
 
                     try
                     {
                         id = readString(); // Read type id for next slice.
+			_currentObjectStart = _buf.b.position();
                     }
                     catch(Ice.UnmarshalOutOfBoundsException ex)
                     {
@@ -2418,6 +2455,105 @@ namespace IceInternal
             _sliceObjects = b;
         }
 
+	public void addPreservedPatcher(IPatcher patcher, int index)
+	{
+            if(_readEncapsStack == null) // Lazy initialization
+            {
+                _readEncapsStack = _readEncapsCache;
+                if(_readEncapsStack != null)
+                {
+                    _readEncapsCache = _readEncapsCache.next;
+                }
+                else
+                {
+                    _readEncapsStack = new ReadEncaps();
+                }
+            }
+
+            if(_readEncapsStack.patchMap == null) // Lazy initialization
+            {
+                _readEncapsStack.patchMap = new Hashtable();
+                _readEncapsStack.unmarshaledMap = new Hashtable();
+                _readEncapsStack.typeIdMap = new Hashtable();
+            }
+
+	    if(index == 0)
+	    {
+		patcher.patch(null);
+		return;
+	    }
+
+	    IceUtilInternal.LinkedList patchlist = (IceUtilInternal.LinkedList)_readEncapsStack.patchMap[index];
+	    if(patchlist == null)
+	    {
+		//
+		// We have no outstanding instances to be patched
+		// for this index, so make a new entry in the
+		// patch map.
+		//
+		patchlist = new IceUtilInternal.LinkedList();
+		_readEncapsStack.patchMap[index] = patchlist;
+	    }
+	    //
+	    // Append a patcher for this instance and see if we
+	    // can patch the instance. (The instance may have been
+	    // unmarshaled previously.)
+	    //
+	    patchlist.Add(patcher);
+	    patchReferences(null, index); 
+	    return;
+	}
+
+	public int addPendingObject(Ice.Object v)
+	{
+            if(_writeEncapsStack == null) // Lazy initialization
+            {
+                _writeEncapsStack = _writeEncapsCache;
+                if(_writeEncapsStack != null)
+                {
+                    _writeEncapsCache = _writeEncapsCache.next;
+                }
+                else
+                {
+                    _writeEncapsStack = new WriteEncaps();
+                }
+            }
+
+            if(_writeEncapsStack.toBeMarshaledMap == null) // Lazy initialization
+            {
+                _writeEncapsStack.toBeMarshaledMap = new Hashtable();
+                _writeEncapsStack.marshaledMap = new Hashtable();
+                _writeEncapsStack.typeIdMap = new Hashtable();
+            }
+            if(v != null)
+            {
+                //
+                // Look for this instance in the to-be-marshaled map.
+                //
+                object p = _writeEncapsStack.toBeMarshaledMap[v];
+                if(p == null)
+                {
+                    //
+                    // Didn't find it, try the marshaled map next.
+                    //
+                    object q = _writeEncapsStack.marshaledMap[v];
+                    if(q == null)
+                    {
+                        //
+                        // We haven't seen this instance previously,
+                        // create a new index, and insert it into the
+                        // to-be-marshaled map.
+                        //
+                        q = ++_writeEncapsStack.writeIndex;
+                        _writeEncapsStack.toBeMarshaledMap[v] = q;
+                    }
+                    p = q;
+                }
+		return (int)p;
+            }
+	    return 0;
+	}
+
         internal virtual void writeInstance(Ice.Object v, int index)
         {
             writeInt(index);
@@ -2925,6 +3061,8 @@ namespace IceInternal
         private int _readSlice;
         private int _writeSlice;
 
+	private int _currentObjectStart;
+
         private int _traceSlicing;
         private string _slicingCat;
 
@@ -2936,6 +3074,7 @@ namespace IceInternal
         int _startSeq;
         int _minSeqSize;
 
+	private List<Ice.SkippedSlice> _skippedSlices = new List<Ice.SkippedSlice>();
         private ArrayList _objectList;
 
         private static Hashtable _exceptionFactories = new Hashtable(); // <type name, factory> pairs.
diff --git a/cs/src/Ice/Makefile b/cs/src/Ice/Makefile
index 574a8c3..62859e3 100644
--- a/cs/src/Ice/Makefile
+++ b/cs/src/Ice/Makefile
@@ -60,6 +60,7 @@ SRCS		= Acceptor.cs \
 		  ObjectAdapterI.cs \
 		  Object.cs \
 		  ObjectFactoryManager.cs \
+		  ObjectPatcher.cs \
 		  OpaqueEndpointI.cs \
 		  Options.cs \
 		  OutgoingAsync.cs \
@@ -84,6 +85,7 @@ SRCS		= Acceptor.cs \
 		  RetryQueue.cs \
 		  RouterInfo.cs \
 		  ServantManager.cs \
+		  SkippedSlice.cs \
 		  SliceChecksums.cs \
 		  SocketOperation.cs \
 		  Stream.cs \
@@ -115,6 +117,7 @@ SLICE_SRCS	= $(SDIR)/BuiltinSequences.ice \
 		  $(SDIR)/Communicator.ice \
 		  $(SDIR)/Connection.ice \
 		  $(SDIR)/Current.ice \
+		  $(SDIR)/Preserve.ice \
 		  $(SDIR)/Endpoint.ice \
 		  $(SDIR)/EndpointTypes.ice \
 		  $(SDIR)/FacetMap.ice \
@@ -126,6 +129,7 @@ SLICE_SRCS	= $(SDIR)/BuiltinSequences.ice \
 		  $(SDIR)/ObjectAdapter.ice \
 		  $(SDIR)/ObjectFactory.ice \
 		  $(SDIR)/Plugin.ice \
+		  $(SDIR)/Preserve.ice \
 		  $(SDIR)/Process.ice \
 		  $(SDIR)/Properties.ice \
 		  $(SDIR)/Router.ice \
diff --git a/cs/src/Ice/Makefile.mak b/cs/src/Ice/Makefile.mak
index 07e52c1..7e0f671 100644
--- a/cs/src/Ice/Makefile.mak
+++ b/cs/src/Ice/Makefile.mak
@@ -60,7 +60,8 @@ SRCS		= Acceptor.cs \
 		  ObjectAdapterI.cs \
 		  Object.cs \
 		  ObjectFactoryManager.cs \
-		  OPaqueEndpointI.cs \
+		  ObjectPatcher.cs \
+		  OpaqueEndpointI.cs \
 		  Options.cs \
 		  OutgoingAsync.cs \
 		  Outgoing.cs \
@@ -85,6 +86,7 @@ SRCS		= Acceptor.cs \
 		  RouterInfo.cs \
 		  ServantManager.cs \
 		  SocketOperation.cs \
+		  SkippedSlice.cs \
 		  SliceChecksums.cs \
 		  Stream.cs \
 		  StreamI.cs \
@@ -126,6 +128,7 @@ GEN_SRCS	= $(GDIR)\BuiltinSequences.cs \
 		  $(GDIR)\ObjectAdapter.cs \
 		  $(GDIR)\ObjectFactory.cs \
 		  $(GDIR)\Plugin.cs \
+		  $(GDIR)\Preserve.cs \
 		  $(GDIR)\Process.cs \
 		  $(GDIR)\Properties.cs \
 		  $(GDIR)\Router.cs \
diff --git a/cs/test/Ice/slicing/exceptions/AllTests.cs b/cs/test/Ice/slicing/exceptions/AllTests.cs
index 6b42dc0..602f094 100644
--- a/cs/test/Ice/slicing/exceptions/AllTests.cs
+++ b/cs/test/Ice/slicing/exceptions/AllTests.cs
@@ -315,6 +315,46 @@ public class AllTests
         
         private Callback callback = new Callback();
     }
+
+    class ClientI : ClientIntfDisp_
+    {
+        public ClientI()
+        {
+        }
+
+        public override void baseAsBase(Ice.Current current)
+        {
+            Base ex = new Base();
+            ex.b = "Base";
+            throw ex;
+        }
+
+        public override void unknownDerivedAsBase(Ice.Current current)
+        {
+            TestClient.ClientUnknownDerived ex = new TestClient.ClientUnknownDerived();
+            ex.ud = "UnknownDerived";
+            ex.b = "Base";
+            throw ex;
+        }
+
+        public override void unsliceableDerivedAsBase(Ice.Current current)
+        {
+            TestClient.ClientUnsliceableDerived ex = new TestClient.ClientUnsliceableDerived();
+            ex.ud = "UnsliceableDerived";
+            ex.b = "Base";
+            throw ex;
+        }
+
+        public override void unsliceableWithInnerClass(Ice.Current current)
+        {
+            TestClient.ClientUnsliceableWithClass ex = new TestClient.ClientUnsliceableWithClass();
+            ex.b = "WithInnerClass";
+            ex.myObj = new TestClient.InnerClassDerived();
+            ex.myObj.ic = "InnerClass";
+            ex.myObj.id = "InnerClassDerived";
+            throw ex;
+        }
+    }
     
     public static TestIntfPrx allTests(Ice.Communicator communicator, bool collocated)
     {
@@ -324,6 +364,7 @@ public class AllTests
         Ice.ObjectPrx @base = communicator.stringToProxy(@ref);
         test(@base != null);
         Console.Out.WriteLine("ok");
+
         
         Console.Out.Write("testing checked cast... ");
         Console.Out.Flush();
@@ -331,6 +372,11 @@ public class AllTests
         test(testPrx != null);
         test(testPrx.Equals(@base));
         Console.Out.WriteLine("ok");
+
+        communicator.getProperties().setProperty("ClientAdapter.Endpoints", "default -p 12020 -t 2000");
+        Ice.ObjectAdapter adapter = communicator.createObjectAdapter("ClientAdapter");
+        ClientIntfPrx clientPrx = ClientIntfPrxHelper.uncheckedCast(adapter.addWithUUID(new ClientI()));
+        adapter.activate();
         
         Console.Out.Write("base... ");
         Console.Out.Flush();
@@ -730,6 +776,160 @@ public class AllTests
             cb.check();
         }
         Console.Out.WriteLine("ok");
+
+        Console.Out.Write("base pass through server... ");
+        Console.Out.Flush();
+        {
+            try
+            {
+                testPrx.clientBaseAsBasePass(clientPrx);
+                test(false);
+            }
+            catch(Base b)
+            {
+                test(b.b.Equals("Base"));
+                test(b.ice_name().Equals("Test::Base"));
+            }
+            catch(Exception ex)
+            {
+                Console.Out.WriteLine(ex);
+                test(false);
+            }
+        }
+        Console.Out.WriteLine("ok");
+
+        Console.Out.Write("base rethrown by server... ");
+        Console.Out.Flush();
+        {
+            try
+            {
+                testPrx.clientBaseAsBaseRethrow(clientPrx);
+                test(false);
+            }
+            catch(Base b)
+            {
+                test(b.b.Equals("Base"));
+                test(b.ice_name().Equals("Test::Base"));
+            }
+            catch(Exception)
+            {
+                test(false);
+            }
+        }
+        Console.Out.WriteLine("ok");
+
+        Console.Out.Write("unknown derived pass through server... ");
+        Console.Out.Flush();
+        {
+            try
+            {
+                testPrx.clientUnknownDerivedAsBasePass(clientPrx);
+                test(false);
+            }
+            catch(Base b)
+            {
+                test(b.b.Equals("Base"));
+                test(b.ice_name().Equals("Test::Base"));
+            }
+            catch(Exception)
+            {
+                test(false);
+            }
+        }
+        Console.Out.WriteLine("ok");
+
+        Console.Out.Write("unknown derived pass rethrown by server... ");
+        Console.Out.Flush();
+        {
+            try
+            {
+                testPrx.clientUnknownDerivedAsBaseRethrow(clientPrx);
+                test(false);
+            }
+            catch(Base b)
+            {
+                test(b.b.Equals("Base"));
+                test(b.ice_name().Equals("Test::Base"));
+            }
+            catch(Exception)
+            {
+                test(false);
+            }
+        }
+        Console.Out.WriteLine("ok");
+
+        Console.Out.Write("unsliceable derived pass through server... ");
+        Console.Out.Flush();
+        {
+            try
+            {
+                testPrx.clientUnsliceableDerivedAsBasePass(clientPrx);
+                test(false);
+            }
+            catch(Base b)
+            {
+                test(b.b.Equals("Base"));
+                test(b.ice_name().Equals("TestClient::ClientUnsliceableDerived"));
+            }
+            catch(Exception ex)
+            {
+                Console.Out.WriteLine(ex);
+                test(false);
+            }
+        }
+        Console.Out.WriteLine("ok");
+
+        Console.Out.Write("unsliceable derived rethrown by server... ");
+        Console.Out.Flush();
+        {
+            try
+            {
+                testPrx.clientUnsliceableDerivedAsBaseRethrow(clientPrx);
+                test(false);
+            }
+            catch(Base b)
+            {
+                test(b.b.Equals("Base"));
+                test(b.ice_name().Equals("TestClient::ClientUnsliceableDerived"));
+            }
+            catch(Exception)
+            {
+                test(false);
+            }
+        }
+        Console.Out.WriteLine("ok");
+
+        Console.Out.Write("unsliceable derived rethrown by server with inner class... ");
+        Console.Out.Flush();
+        {
+            try
+            {
+                testPrx.clientUnsliceableInnerClassRethrow(clientPrx);
+                test(false);
+            }
+            catch(Base b)
+            {
+                test(b.ice_name().Equals("TestClient::ClientUnsliceableWithClass"));
+                try
+                {
+                    TestClient.ClientUnsliceableWithClass ex = (TestClient.ClientUnsliceableWithClass)b;
+                    test(ex.myObj != null);
+                    test(ex.myObj.ice_id().Equals("::TestClient::InnerClassDerived"));
+                    test(ex.myObj.ic.Equals("InnerClass"));
+                    test(ex.myObj.id.Equals("InnerClassDerived"));
+                }
+                catch(InvalidCastException)
+                {
+                    test(false);
+                }
+            }
+            catch(Exception)
+            {
+                test(false);
+            }
+        }
+        Console.Out.WriteLine("ok");
+
         
         return testPrx;
     }
diff --git a/cs/test/Ice/slicing/exceptions/Makefile b/cs/test/Ice/slicing/exceptions/Makefile
index f10ed2e..f236a86 100644
--- a/cs/test/Ice/slicing/exceptions/Makefile
+++ b/cs/test/Ice/slicing/exceptions/Makefile
@@ -15,11 +15,14 @@ C_SRCS		= AllTests.cs Client.cs
 S_SRCS		= Server.cs TestI.cs
 SAMD_SRCS	= Server.cs TestAMDI.cs
 
-SLICE_SRCS	= $(SDIR)/Test.ice
+SLICE_SRCS	= $(SDIR)/Test.ice 
+
 SLICE_S_SRCS	= $(SDIR)/ServerPrivate.ice
 SLICE_AMD_SRCS	= $(SDIR)/TestAMD.ice
 SLICE_SAMD_SRCS	= $(SDIR)/ServerPrivateAMD.ice
 
+SLICE_C_SRCS    = $(SDIR)/ClientPrivate.ice
+
 SDIR		= .
 
 GDIR		= generated
@@ -30,7 +33,7 @@ MCSFLAGS	:= $(MCSFLAGS) -target:exe
 
 SLICE2CSFLAGS	:= $(SLICE2CSFLAGS) -I.
 
-client.exe: $(C_SRCS) $(GEN_SRCS)
+client.exe: $(C_SRCS) $(GEN_SRCS) $(CGEN_SRCS)
 	$(MCS) $(MCSFLAGS) -out:$@ $(call ref,Ice) $(subst /,$(DSEP),$^)
 
 server.exe: $(S_SRCS) $(GEN_SRCS) $(SGEN_SRCS)
diff --git a/cs/test/Ice/slicing/exceptions/Makefile.mak b/cs/test/Ice/slicing/exceptions/Makefile.mak
index 9ec9d9e..614a253 100644
--- a/cs/test/Ice/slicing/exceptions/Makefile.mak
+++ b/cs/test/Ice/slicing/exceptions/Makefile.mak
@@ -16,6 +16,7 @@ S_SRCS		= Server.cs TestI.cs
 SAMD_SRCS	= Server.cs TestAMDI.cs
 
 GEN_SRCS	= $(GDIR)\Test.cs
+CGEN_SRCS       = $(GDIR)\ClientPrivate.cs
 SGEN_SRCS	= $(GDIR)\ServerPrivate.cs
 GEN_AMD_SRCS	= $(GDIR)\TestAMD.cs
 SAMD_GEN_SRCS	= $(GDIR)\ServerPrivateAMD.cs
@@ -30,8 +31,8 @@ MCSFLAGS	= $(MCSFLAGS) -target:exe
 
 SLICE2CSFLAGS	= $(SLICE2CSFLAGS) -I.
 
-client.exe: $(C_SRCS) $(GEN_SRCS)
-	$(MCS) $(MCSFLAGS) -out:$@ -r:"$(refdir)\Ice.dll" $(C_SRCS) $(GEN_SRCS)
+client.exe: $(C_SRCS) $(GEN_SRCS) $(CGEN_SRCS)
+	$(MCS) $(MCSFLAGS) -out:$@ -r:"$(refdir)\Ice.dll" $(C_SRCS) $(GEN_SRCS) $(CGEN_SRCS)
 
 server.exe: $(S_SRCS) $(GEN_SRCS) $(SGEN_SRCS)
 	$(MCS) $(MCSFLAGS) -out:$@ -r:"$(refdir)\Ice.dll" $(S_SRCS) $(GEN_SRCS) $(SGEN_SRCS)
diff --git a/cs/test/Ice/slicing/exceptions/Test.ice b/cs/test/Ice/slicing/exceptions/Test.ice
index 9248cdc..5644135 100644
--- a/cs/test/Ice/slicing/exceptions/Test.ice
+++ b/cs/test/Ice/slicing/exceptions/Test.ice
@@ -33,6 +33,25 @@ exception KnownMostDerived extends KnownIntermediate
     string kmd;
 };
 
+["preserve"]
+exception BaseUnsliceable extends Base
+{
+};
+
+["preserve"]
+class InnerClass
+{
+    string ic;
+};
+
+interface ClientIntf
+{
+    void baseAsBase() throws Base;
+    void unknownDerivedAsBase() throws Base;
+    void unsliceableDerivedAsBase() throws Base;
+    void unsliceableWithInnerClass() throws Base;
+};
+
 interface TestIntf
 {
     void baseAsBase() throws Base;
@@ -51,6 +70,14 @@ interface TestIntf
     void unknownMostDerived1AsKnownIntermediate() throws KnownIntermediate;
     void unknownMostDerived2AsBase() throws Base;
 
+    void clientBaseAsBasePass(ClientIntf* client) throws Base;
+    void clientUnknownDerivedAsBasePass(ClientIntf* client) throws Base;
+    void clientUnsliceableDerivedAsBasePass(ClientIntf* client) throws Base;
+    void clientBaseAsBaseRethrow(ClientIntf* client) throws Base;
+    void clientUnknownDerivedAsBaseRethrow(ClientIntf* client) throws Base;
+    void clientUnsliceableDerivedAsBaseRethrow(ClientIntf* client) throws Base;
+    void clientUnsliceableInnerClassRethrow(ClientIntf* client) throws Base;
+
     void shutdown();
 };
 
diff --git a/cs/test/Ice/slicing/exceptions/TestAMD.ice b/cs/test/Ice/slicing/exceptions/TestAMD.ice
index 3de14d1..4020ef4 100644
--- a/cs/test/Ice/slicing/exceptions/TestAMD.ice
+++ b/cs/test/Ice/slicing/exceptions/TestAMD.ice
@@ -33,6 +33,25 @@ exception KnownMostDerived extends KnownIntermediate
     string kmd;
 };
 
+["preserve"]
+exception BaseUnsliceable extends Base
+{
+};
+
+["preserve"]
+class InnerClass
+{
+    string ic;
+};
+
+interface ClientIntf
+{
+    void baseAsBase() throws Base;
+    void unknownDerivedAsBase() throws Base;
+    void unsliceableDerivedAsBase() throws Base;
+    void unsliceableWithInnerClass() throws Base;
+};
+
 ["amd"] interface TestIntf
 {
     void baseAsBase() throws Base;
@@ -51,6 +70,14 @@ exception KnownMostDerived extends KnownIntermediate
     void unknownMostDerived1AsKnownIntermediate() throws KnownIntermediate;
     void unknownMostDerived2AsBase() throws Base;
 
+    void clientBaseAsBasePass(ClientIntf* client) throws Base;
+    void clientUnknownDerivedAsBasePass(ClientIntf* client) throws Base;
+    void clientUnsliceableDerivedAsBasePass(ClientIntf* client) throws Base;
+    void clientBaseAsBaseRethrow(ClientIntf* client) throws Base;
+    void clientUnknownDerivedAsBaseRethrow(ClientIntf* client) throws Base;
+    void clientUnsliceableDerivedAsBaseRethrow(ClientIntf* client) throws Base;
+    void clientUnsliceableInnerClassRethrow(ClientIntf* client) throws Base;
+
     void shutdown();
 };
 
diff --git a/cs/test/Ice/slicing/exceptions/TestAMDI.cs b/cs/test/Ice/slicing/exceptions/TestAMDI.cs
index 60d7014..cf33884 100644
--- a/cs/test/Ice/slicing/exceptions/TestAMDI.cs
+++ b/cs/test/Ice/slicing/exceptions/TestAMDI.cs
@@ -135,4 +135,95 @@ public sealed class TestI : TestIntfDisp_
         umd2.umd2 = "UnknownMostDerived2.umd2";
         cb.ice_exception(umd2);
     }
+    
+    public override void
+    clientBaseAsBasePass_async(AMD_TestIntf_clientBaseAsBasePass cb, ClientIntfPrx client, Ice.Current current)
+    {
+        try
+        {
+            client.baseAsBase();
+        }
+        catch(Base b)
+        {
+            cb.ice_exception(b);
+        }
+    }
+
+    public override void
+    clientUnknownDerivedAsBasePass_async(AMD_TestIntf_clientUnknownDerivedAsBasePass cb, ClientIntfPrx client, Ice.Current current)
+    {
+        try
+        {
+            client.unknownDerivedAsBase();
+        }
+        catch(Base b)
+        {
+            cb.ice_exception(b);
+        }
+    }
+
+    public override void
+    clientUnsliceableDerivedAsBasePass_async(AMD_TestIntf_clientUnsliceableDerivedAsBasePass cb, ClientIntfPrx client, Ice.Current current)
+    {
+        try
+        {
+            client.unsliceableDerivedAsBase();
+        }
+        catch(Base b)
+        {
+            cb.ice_exception(b);
+        }
+    }
+
+    public override void
+    clientBaseAsBaseRethrow_async(AMD_TestIntf_clientBaseAsBaseRethrow cb, ClientIntfPrx client, Ice.Current current)
+    {
+        try
+        {
+            client.baseAsBase();
+        }
+        catch(Base ex)
+        {
+            cb.ice_exception(ex);
+        }
+    }
+
+    public override void 
+    clientUnknownDerivedAsBaseRethrow_async(AMD_TestIntf_clientUnknownDerivedAsBaseRethrow cb, ClientIntfPrx client, Ice.Current current)
+    {
+        try
+        {
+            client.unknownDerivedAsBase();
+        }
+        catch(Base ex)
+        {
+            cb.ice_exception(ex);
+        }
+    }
+
+    public override void
+    clientUnsliceableDerivedAsBaseRethrow_async(AMD_TestIntf_clientUnsliceableDerivedAsBaseRethrow cb, ClientIntfPrx client, Ice.Current current)
+    {
+        try
+        {
+            client.unsliceableDerivedAsBase();
+        }
+        catch(Base ex)
+        {
+            cb.ice_exception(ex);
+        }
+    }
+
+    public override void
+    clientUnsliceableInnerClassRethrow_async(AMD_TestIntf_clientUnsliceableInnerClassRethrow cb, ClientIntfPrx client, Ice.Current current)
+    {
+        try
+        {
+            client.unsliceableWithInnerClass();
+        }
+        catch(Base ex)
+        {
+            cb.ice_exception(ex);
+        }
+    }
 }
diff --git a/cs/test/Ice/slicing/exceptions/TestI.cs b/cs/test/Ice/slicing/exceptions/TestI.cs
index f3c1ed9..8f205b9 100644
--- a/cs/test/Ice/slicing/exceptions/TestI.cs
+++ b/cs/test/Ice/slicing/exceptions/TestI.cs
@@ -128,4 +128,74 @@ public sealed class TestI : TestIntfDisp_
         umd2.umd2 = "UnknownMostDerived2.umd2";
         throw umd2;
     }
+
+    public override void
+    clientBaseAsBasePass(ClientIntfPrx client, Ice.Current current)
+    {
+        client.baseAsBase();
+    }
+
+    public override void
+    clientUnknownDerivedAsBasePass(ClientIntfPrx client, Ice.Current current)
+    {
+        client.unknownDerivedAsBase();
+    }
+
+    public override void
+    clientUnsliceableDerivedAsBasePass(ClientIntfPrx client, Ice.Current current)
+    {
+        client.unsliceableDerivedAsBase();
+    }
+
+    public override void
+    clientBaseAsBaseRethrow(ClientIntfPrx client, Ice.Current current)
+    {
+        try
+        {
+            client.baseAsBase();
+        }
+        catch(Ice.Exception ex)
+        {
+            throw ex;
+        }
+    }
+
+    public override void 
+    clientUnknownDerivedAsBaseRethrow(ClientIntfPrx client, Ice.Current current)
+    {
+        try
+        {
+            client.unknownDerivedAsBase();
+        }
+        catch(Ice.Exception ex)
+        {
+            throw ex;
+        }
+    }
+
+    public override void
+    clientUnsliceableDerivedAsBaseRethrow(ClientIntfPrx client, Ice.Current current)
+    {
+        try
+        {
+            client.unsliceableDerivedAsBase();
+        }
+        catch(Ice.Exception ex)
+        {
+            throw ex;
+        }
+    }
+
+    public override void
+    clientUnsliceableInnerClassRethrow(ClientIntfPrx client, Ice.Current current)
+    {
+        try
+        {
+            client.unsliceableWithInnerClass();
+        }
+        catch(Ice.Exception ex)
+        {
+            throw ex;
+        }
+    }
 }
diff --git a/cs/test/Ice/slicing/objects/AllTests.cs b/cs/test/Ice/slicing/objects/AllTests.cs
index b152e7c..3f4a49f 100644
--- a/cs/test/Ice/slicing/objects/AllTests.cs
+++ b/cs/test/Ice/slicing/objects/AllTests.cs
@@ -1094,6 +1094,225 @@ public class AllTests
             test(b2 != d3);
         }
         Console.Out.WriteLine("ok");
+
+        Console.Out.Write("return value unsliced for input params known first... ");
+        Console.Out.Flush();
+        {
+            try
+            {
+                D1 d1 = new D1();
+                d1.sb = "D1.sb";
+                d1.sd1 = "D1.sd1";
+                D5 d5 = new D5();
+                d5.pb = d1;
+                d5.sb = "D5.sb";
+                d5.sd5 = "D5.sd5";
+                d5.pd5 = d1;
+                d1.pb = d5;
+                d1.pd1 = d5;
+                
+                B b1 = testPrx.returnTest3(d1, d5);
+                
+                test(b1 != null);
+                test(b1.sb.Equals("D1.sb"));
+                test(b1.ice_id().Equals("::Test::D1")); // Sliced by server
+                
+                try
+                {
+                    D1 p1 = (D1) b1;
+		    test(p1 != null);
+                }
+                catch(InvalidCastException)
+                {
+		    test(false);
+                }
+                
+                B b2 = b1.pb;
+                test(b2 != null);
+                test(b2.sb.Equals("D5.sb"));
+                test(b2.ice_id().Equals("::Test::D5"));
+                test(b2.pb == b1);
+		try
+		{
+		    D5 p5 = (D5) b2;
+		    test(p5 != null);
+		}
+		catch(InvalidCastException)
+		{
+		    test(false);
+		}
+            }
+            catch(Exception)
+            {
+                test(false);
+            }
+        }
+        Console.Out.WriteLine("ok");
+
+        Console.Out.Write("return value unsliced for input params known first (AMI)... ");
+        Console.Out.Flush();
+        {
+            try
+            {
+                D1 d1 = new D1();
+                d1.sb = "D1.sb";
+                d1.sd1 = "D1.sd1";
+                D5 d5 = new D5();
+                d5.pb = d1;
+                d5.sb = "D5.sb";
+                d5.sd5 = "D5.sd5";
+                d5.pd5 = d1;
+                d1.pb = d5;
+                d1.pd1 = d5;
+                
+                AsyncCallback cb = new AsyncCallback();
+                testPrx.begin_returnTest3(d1, d5).whenCompleted(cb.response_returnTest3, cb.exception);
+                cb.check();
+                B b1 = cb.rb;
+                
+                test(b1 != null);
+                test(b1.sb.Equals("D1.sb"));
+                test(b1.ice_id().Equals("::Test::D1")); // Sliced by server
+                
+                try
+                {
+                    D1 p1 = (D1) b1;
+		    test(p1 != null);
+                }
+                catch(InvalidCastException)
+                {
+		    test(false);
+                }
+                
+                B b2 = b1.pb;
+                test(b2 != null);
+                test(b2.sb.Equals("D5.sb"));
+                test(b2.ice_id().Equals("::Test::D5"));
+                test(b2.pb == b1);
+		try
+		{
+		    D5 p5 = (D5) b2;
+		    test(p5 != null);
+		}
+		catch(InvalidCastException)
+		{
+		    test(false);
+		}
+            }
+            catch(Exception)
+            {
+                test(false);
+            }
+        }
+        Console.Out.WriteLine("ok");
+
+        Console.Out.Write("return value unsliced for input params unknown first... ");
+        Console.Out.Flush();
+        {
+            try
+            {
+                D1 d1 = new D1();
+                d1.sb = "D1.sb";
+                d1.sd1 = "D1.sd1";
+                D5 d5 = new D5();
+                d5.pb = d1;
+                d5.sb = "D5.sb";
+                d5.sd5 = "D5.sd5";
+                d5.pd5 = d1;
+                d1.pb = d5;
+                d1.pd1 = d5;
+                
+                B b1 = testPrx.returnTest3(d5, d1);
+                
+                test(b1 != null);
+                test(b1.ice_id().Equals("::Test::D5"));
+                test(b1.sb.Equals("D5.sb"));
+		try
+		{
+		    D5 p5 = (D5) b1;
+		    test(p5 != null);
+		}
+		catch(InvalidCastException)
+		{
+		    test(false);
+		}
+
+                B b2 = b1.pb;
+                test(b2 != null);
+                test(b2.sb.Equals("D1.sb"));
+                test(b2.ice_id().Equals("::Test::D1"));
+		try
+		{
+		    D1 p1 = (D1) b2;
+		    test(p1 != null);
+		}
+		catch(InvalidCastException)
+		{
+		    test(false);
+		}
+            }
+            catch(Exception)
+            {
+                test(false);
+            }
+        }
+        Console.Out.WriteLine("ok");
+
+        Console.Out.Write("return value unsliced for input params unknown first (AMI)... ");
+        Console.Out.Flush();
+        {
+            try
+            {
+                D1 d1 = new D1();
+                d1.sb = "D1.sb";
+                d1.sd1 = "D1.sd1";
+                D5 d5 = new D5();
+                d5.pb = d1;
+                d5.sb = "D5.sb";
+                d5.sd5 = "D5.sd5";
+                d5.pd5 = d1;
+                d1.pb = d5;
+                d1.pd1 = d5;
+                
+                AsyncCallback cb = new AsyncCallback();
+                testPrx.begin_returnTest3(d5, d1).whenCompleted(cb.response_returnTest3, cb.exception);
+                cb.check();
+                B b1 = cb.rb;
+
+                test(b1 != null);
+                test(b1.ice_id().Equals("::Test::D5"));
+                test(b1.sb.Equals("D5.sb"));
+		try
+		{
+		    D5 p5 = (D5) b1;
+		    test(p5 != null);
+		}
+		catch(InvalidCastException)
+		{
+		    test(false);
+		}
+
+                B b2 = b1.pb;
+                test(b2 != null);
+                test(b2.sb.Equals("D1.sb"));
+                test(b2.ice_id().Equals("::Test::D1"));
+		try
+		{
+		    D1 p1 = (D1) b2;
+		    test(p1 != null);
+		}
+		catch(InvalidCastException)
+		{
+		    test(false);
+		}
+            }
+            catch(Exception ex)
+            {
+                Console.Out.WriteLine(ex);
+                test(false);
+            }
+        }
+        Console.Out.WriteLine("ok");
         
         Console.Out.Write("remainder unmarshaling (3 instances)... ");
         Console.Out.Flush();
@@ -1168,6 +1387,140 @@ public class AllTests
             cb.check();
         }
         Console.Out.WriteLine("ok");
+
+        Console.Out.Write("sequence of slice-preserved objects... ");
+        Console.Out.Flush();
+        {
+            BSeq seq = new BSeq();
+            D5 current = new D5();
+            current.sd5 = "0";
+            seq.Add(current);
+            current = new D5();
+            current.sd5 = "1";
+            seq.Add(current);
+            current = new D5();
+            current.sd5 = "2";
+            seq.Add(current);
+            current = new D5();
+            current.sd5 = "3";
+            seq.Add(current);
+
+            BSeq outV;
+            BSeq ret = testPrx.echoSeq(seq, out outV);
+
+            test(seq.Count == ret.Count);
+            test(seq.Count == outV.Count);
+            for(int i = 0; i < seq.Count; ++i)
+            {
+                D5 r5 = null;
+                D5 o5 = null;
+
+                test(ret[i].ice_id().Equals("::Test::D5"));
+                test(outV[i].ice_id().Equals("::Test::D5"));
+
+                try
+                {
+                    r5 = (D5)ret[i];
+                }
+                catch(InvalidCastException)
+                {
+                    test(false);
+                }
+                try
+                {
+                    o5 = (D5)outV[i];
+                }
+                catch(InvalidCastException)
+                {
+                    test(false);
+                }
+                test(((D5)seq[i]).sd5.Equals(r5.sd5));
+                test(((D5)seq[i]).sd5.Equals(o5.sd5));
+            }
+        }
+        Console.Out.WriteLine("ok");
+
+        Console.Out.Write("slice preserved object, unsliceable inner class... ");
+        Console.Out.Flush();
+        {
+            D7 b1 = new D7();
+            b1.sd7 = "D7.sd7";
+            b1.innerD7 = new D7();
+            b1.innerD7.sd7 = "D7.innerD7.sd7";
+            B b2 = new B();
+            b2.sb = "B.sb";
+            b2.pb = new B();
+            b2.pb.sb = "B.B.sb";
+            B result = testPrx.returnTest3(b1, b2);
+            test(result != null);
+            test(result.ice_id().Equals("::Test::D7"));
+            try
+            {
+                D7 t = (D7)result;
+                test(t.sd7.Equals("D7.sd7"));
+                test(t.innerD7 != null);
+                test(t.innerD7.sd7.Equals("D7.innerD7.sd7"));
+            }
+            catch(InvalidCastException)
+            {
+                test(false);
+            }
+        }
+        Console.Out.WriteLine("ok");
+
+        Console.Out.Write("object graphs of unsliceable objects... ");
+        Console.Out.Flush();
+        {
+            GraphBase graph = new GraphBase();
+            D6 d6 = new D6();
+            d6.sd6 = "d6.1";
+            d6.innerD5 = new D5();
+            d6.innerD5.sd5 = "d6.1.sd5";
+            d6.innerD5.pd5 = new B();
+            d6.innerD5.pd5.sb = "d6.1.d5.sb";
+            d6.innerD5.pd5.pb = new B();
+            d6.innerD5.pd5.pb.sb = "d6.1.d5.sb.sb";
+            graph.left = d6;
+
+            D7 d7 = new D7();
+            d7.sd7 = "d7";
+            d7.innerD7 = new D7();
+            d7.innerD7.sd7 = "d7.d7";
+            d7.innerD7.innerD7 = new D7();
+            d7.innerD7.innerD7.sd7 = "d7.d7.d7";
+            graph.right = d7;
+
+            B result = testPrx.returnTest3(graph, d7);
+            test(result != null);
+            test(result.ice_id().Equals("::Test::GraphBase"));
+            try
+            {
+                GraphBase t = (GraphBase)result;
+                test(t.left.ice_id().Equals("::Test::D6"));
+                test(t.right.ice_id().Equals("::Test::D7"));
+                D6 t6 = (D6)t.left;
+                test(t6.sd6.Equals("d6.1"));
+                test(t6.innerD5 != null);
+                test(t6.innerD5.sd5.Equals("d6.1.sd5"));
+                test(t6.innerD5.pd5 != null);
+                test(t6.innerD5.pd5.sb.Equals("d6.1.d5.sb"));
+                test(t6.innerD5.pd5.pb != null);
+                test(t6.innerD5.pd5.pb.sb.Equals("d6.1.d5.sb.sb"));
+
+                D7 t7 = (D7)t.right;
+                test(t7.sd7.Equals("d7"));
+                test(t7.innerD7 != null);
+                test(t7.innerD7.sd7.Equals("d7.d7"));
+                test(t7.innerD7.innerD7 != null);
+                test(t7.innerD7.innerD7.sd7.Equals("d7.d7.d7"));
+            }
+            catch(InvalidCastException)
+            {
+                test(false);
+            }
+        }
+        Console.Out.WriteLine("ok");
+
         
         Console.Out.Write("param ptr slicing, instance marshaled in unknown derived as base... ");
         Console.Out.Flush();
diff --git a/cs/test/Ice/slicing/objects/ClientPrivate.ice b/cs/test/Ice/slicing/objects/ClientPrivate.ice
index 25a4b74..6de12e0 100644
--- a/cs/test/Ice/slicing/objects/ClientPrivate.ice
+++ b/cs/test/Ice/slicing/objects/ClientPrivate.ice
@@ -21,6 +21,30 @@ class D3 extends B
     B pd3;
 };
 
+class D5 extends BU
+{
+    string sd5;
+    B pd5;
+};
+
+class GraphBase extends BU
+{
+    BU left;
+    BU right;
+};
+
+class D6 extends BU
+{
+    string sd6;
+    D5 innerD5;
+};
+
+class D7 extends BU
+{
+    string sd7;
+    D7 innerD7;
+};
+    
 };
 
 #endif
diff --git a/cs/test/Ice/slicing/objects/Server.cs b/cs/test/Ice/slicing/objects/Server.cs
index a74f0b2..d84d801 100644
--- a/cs/test/Ice/slicing/objects/Server.cs
+++ b/cs/test/Ice/slicing/objects/Server.cs
@@ -15,7 +15,8 @@ public class Server
     {
         Ice.Properties properties = communicator.getProperties();
         properties.setProperty("Ice.Warn.Dispatch", "0");
-        properties.setProperty("TestAdapter.Endpoints", "default -p 12010 -t 2000");
+        // XXX properties.setProperty("TestAdapter.Endpoints", "default -p 12010 -t 2000");
+        properties.setProperty("TestAdapter.Endpoints", "default -p 12010");
         Ice.ObjectAdapter adapter = communicator.createObjectAdapter("TestAdapter");
         Ice.Object obj = new TestI();
         adapter.add(obj, communicator.stringToIdentity("Test"));
diff --git a/cs/test/Ice/slicing/objects/Test.ice b/cs/test/Ice/slicing/objects/Test.ice
index 12c46cd..ec6ed5c 100644
--- a/cs/test/Ice/slicing/objects/Test.ice
+++ b/cs/test/Ice/slicing/objects/Test.ice
@@ -29,6 +29,11 @@ class B
     B pb;
 };
 
+["preserve"]
+class BU extends B
+{
+};
+
 class D1 extends B
 {
     string sd1;
@@ -94,6 +99,8 @@ interface TestIntf
     B returnTest1(out B p1, out B p2);
     B returnTest2(out B p2, out B p1);
     B returnTest3(B p1, B p2);
+    
+    BSeq echoSeq(BSeq p1, out BSeq p2);
 
     SS sequenceTest(SS1 p1, SS2 p2);
 
diff --git a/cs/test/Ice/slicing/objects/TestAMD.ice b/cs/test/Ice/slicing/objects/TestAMD.ice
index ef9d687..b8bcfec 100644
--- a/cs/test/Ice/slicing/objects/TestAMD.ice
+++ b/cs/test/Ice/slicing/objects/TestAMD.ice
@@ -29,6 +29,11 @@ class B
     B pb;
 };
 
+["preserve"]
+class BU extends B
+{
+};
+
 class D1 extends B
 {
     string sd1;
@@ -95,6 +100,8 @@ class Forward;          /* Forward-declared class defined in another compilation
     B returnTest2(out B p2, out B p1);
     B returnTest3(B p1, B p2);
 
+    BSeq echoSeq(BSeq p1, out BSeq p2);
+
     SS sequenceTest(SS1 p1, SS2 p2);
 
     BDict dictionaryTest(BDict bin, out BDict bout);
diff --git a/cs/test/Ice/slicing/objects/TestAMDI.cs b/cs/test/Ice/slicing/objects/TestAMDI.cs
index 07c351a..5adb14b 100644
--- a/cs/test/Ice/slicing/objects/TestAMDI.cs
+++ b/cs/test/Ice/slicing/objects/TestAMDI.cs
@@ -236,6 +236,11 @@ public sealed class TestI : TestIntfDisp_
     {
         cb.ice_response(p1);
     }
+
+    public override void echoSeq_async(AMD_TestIntf_echoSeq cb, BSeq p1, Ice.Current current)
+    {
+        cb.ice_response(p1, p1);
+    }
     
     public override void sequenceTest_async(AMD_TestIntf_sequenceTest cb, SS1 p1, SS2 p2, Ice.Current current)
     {
diff --git a/cs/test/Ice/slicing/objects/TestI.cs b/cs/test/Ice/slicing/objects/TestI.cs
index 5bed483..0686448 100644
--- a/cs/test/Ice/slicing/objects/TestI.cs
+++ b/cs/test/Ice/slicing/objects/TestI.cs
@@ -212,6 +212,12 @@ public sealed class TestI : TestIntfDisp_
     {
         return p1;
     }
+
+    public override BSeq echoSeq(BSeq p1, out BSeq p2, Ice.Current current)
+    {
+        p2 = p1;
+        return p1;
+    }
     
     public override SS sequenceTest(SS1 p1, SS2 p2, Ice.Current current)
     {
diff --git a/java/build.xml b/java/build.xml
index 62a5702..737ff43 100644
--- a/java/build.xml
+++ b/java/build.xml
@@ -69,6 +69,7 @@
                 <include name="ObjectAdapter.ice" />
                 <include name="ObjectFactory.ice" />
                 <include name="Plugin.ice" />
+		<include name="Preserve.ice" />
                 <include name="Process.ice" />
                 <include name="Properties.ice" />
                 <include name="Router.ice" />
@@ -322,9 +323,9 @@
                 <include name="Test.ice" />
             </fileset>
             <fileset dir="test/Ice/slicing/exceptions">
-                <include name="Test.ice" />
                 <include name="ServerPrivate.ice" />
                 <include name="ServerPrivateAMD.ice" />
+                <include name="ClientPrivate.ice" />
             </fileset>
             <fileset dir="test/Ice/slicing/objects">
                 <include name="ServerPrivate.ice" />
diff --git a/java/src/IceInternal/BasicStream.java b/java/src/IceInternal/BasicStream.java
index e07585b..5076131 100644
--- a/java/src/IceInternal/BasicStream.java
+++ b/java/src/IceInternal/BasicStream.java
@@ -413,6 +413,16 @@ public class BasicStream
         _buf.b.putInt(_writeSlice - 4, sz);
     }
 
+    public int
+    getWriteSliceOffset()
+    {
+	if(_buf.size() < _writeSlice)
+	{
+	    throw new Ice.MarshalException("slice offsets are only valid within slices");
+	}
+	return _buf.size() - _writeSlice + 4;
+    }
+
     public void startReadSlice()
     {
         int sz = readInt();
@@ -444,6 +454,41 @@ public class BasicStream
         }
     }
 
+    public void skipSlice(String typeId)
+    {
+	Ice.SkippedSlice newSlice = new Ice.SkippedSlice();
+	newSlice.typeId = typeId;
+	skipSlice();
+	if(_currentObjectStart < _buf.b.position())
+	{
+	    int returnTo = _buf.b.position();
+	    try
+	    {
+		try
+		{
+                    byte[] b = new byte[returnTo - _currentObjectStart];
+		    _buf.b.position(_currentObjectStart);
+                    _buf.b.get(b);
+                    newSlice.slice = b;
+		}
+		catch(Exception ex)
+		{
+		    ex.printStackTrace();
+                    throw new Ice.MarshalException("error in skipSlice");
+		}
+	    }
+	    finally
+	    {
+		_buf.b.position(returnTo);
+	    }
+	}
+	if(_skippedSlices == null)
+	{
+	    _skippedSlices = new java.util.ArrayList<Ice.SkippedSlice>();
+	}
+	_skippedSlices.add(newSlice);
+    }
+
     public int
     readAndCheckSeqSize(int minSize)
     {
@@ -616,6 +661,12 @@ public class BasicStream
         _buf.b.put(v, off, len);
     }
 
+    public java.util.ArrayList<Ice.SkippedSlice>
+    getSkippedSlices()
+    {
+	return new java.util.ArrayList<Ice.SkippedSlice>(_skippedSlices);
+    }
+
     public byte[]
     readBlob(int sz)
     {
@@ -1313,7 +1364,7 @@ public class BasicStream
         return _instance.proxyFactory().streamToProxy(this);
     }
 
-    public void
+    public int
     writeObject(Ice.Object v)
     {
         if(_writeEncapsStack == null) // Lazy initialization
@@ -1360,11 +1411,13 @@ public class BasicStream
                 p = q;
             }
             writeInt(-p.intValue());
+	    return p.intValue();
         }
         else
         {
             writeInt(0); // Write null reference
         }
+	return 0;
     }
 
     public void
@@ -1431,6 +1484,8 @@ public class BasicStream
         }
 
         String mostDerivedId = readTypeId();
+	_currentObjectStart = _buf.b.position();
+	_skippedSlices.clear();
         String id = mostDerivedId;
 
         while(true)
@@ -1497,8 +1552,9 @@ public class BasicStream
                     {
                         TraceUtil.traceSlicing("class", id, _slicingCat, _instance.initializationData().logger);
                     }
-                    skipSlice(); // Slice off this derived part -- we don't understand it.
+                    skipSlice(id); // Slice off this derived part -- we don't understand it.
                     id = readTypeId(); // Read next id for next iteration.
+		    _currentObjectStart = _buf.b.position();
                     continue;
                 }
                 else
@@ -1545,8 +1601,10 @@ public class BasicStream
         throws Ice.UserException
     {
         boolean usesClasses = readBool();
+	_skippedSlices.clear();
 
         String id = readString();
+	_currentObjectStart = _buf.b.position();
         final String origId = id;
 
         for(;;)
@@ -1570,7 +1628,7 @@ public class BasicStream
                 catch(Ice.UserException ex)
                 {
                     ex.__read(this, false);
-                    if(usesClasses)
+                    if(usesClasses || ex.__usesClasses())
                     {
                         readPendingObjects();
                     }
@@ -1593,11 +1651,12 @@ public class BasicStream
                     TraceUtil.traceSlicing("exception", id, _slicingCat, _instance.initializationData().logger);
                 }
 
-                skipSlice(); // Slice off what we don't understand.
+                skipSlice(id); // Slice off what we don't understand.
 
                 try
                 {
                     id = readString(); // Read type id for next slice.
+		    _currentObjectStart = _buf.b.position();
                 }
                 catch(Ice.UnmarshalOutOfBoundsException ex)
                 {
@@ -1712,6 +1771,105 @@ public class BasicStream
         _sliceObjects = b;
     }
 
+    public void
+    addPreservedPatcher(Patcher patcher, int index)
+    {
+        if(_readEncapsStack == null) // Lazy initialization
+        {
+            _readEncapsStack = _readEncapsCache;
+            if(_readEncapsStack != null)
+            {
+                _readEncapsCache = _readEncapsCache.next;
+            }
+            else
+            {
+                _readEncapsStack = new ReadEncaps();
+            }
+        }
+
+        if(_readEncapsStack.patchMap == null) // Lazy initialization
+        {
+            _readEncapsStack.patchMap = new java.util.TreeMap<Integer, java.util.LinkedList<Patcher> >();
+            _readEncapsStack.unmarshaledMap = new java.util.TreeMap<Integer, Ice.Object>();
+            _readEncapsStack.typeIdMap = new java.util.TreeMap<Integer, String>();
+        }
+
+	if(index == 0)
+	{
+	    patcher.patch(null);
+	    return;
+	}
+
+	java.util.LinkedList<Patcher> patchlist = _readEncapsStack.patchMap.get(index);
+	if(patchlist == null)
+	{
+	    //
+	    // We have no outstanding instances to be patched for
+	    // this index, so make a new entry in the patch map.
+	    //
+	    patchlist = new java.util.LinkedList<Patcher>();
+	    _readEncapsStack.patchMap.put(index, patchlist);
+	}
+	//
+	// Append a patcher for this instance and see if we can
+	// patch the instance. (The instance may have been
+	// unmarshaled previously.)
+	//
+	patchlist.add(patcher);
+	patchReferences(null, index);
+	return;
+    }
+
+    public int addPendingObject(Ice.Object v)
+    {
+        if(_writeEncapsStack == null) // Lazy initialization
+        {
+            _writeEncapsStack = _writeEncapsCache;
+            if(_writeEncapsStack != null)
+            {
+                _writeEncapsCache = _writeEncapsCache.next;
+            }
+            else
+            {
+                _writeEncapsStack = new WriteEncaps();
+            }
+        }
+
+        if(_writeEncapsStack.toBeMarshaledMap == null)  // Lazy initialization
+        {
+            _writeEncapsStack.toBeMarshaledMap = new java.util.IdentityHashMap<Ice.Object, Integer>();
+            _writeEncapsStack.marshaledMap = new java.util.IdentityHashMap<Ice.Object, Integer>();
+            _writeEncapsStack.typeIdMap = new java.util.TreeMap<String, Integer>();
+        }
+        if(v != null)
+        {
+            //
+            // Look for this instance in the to-be-marshaled map.
+            //
+            Integer p = _writeEncapsStack.toBeMarshaledMap.get(v);
+            if(p == null)
+            {
+                //
+                // Didn't find it, try the marshaled map next.
+                //
+                Integer q = _writeEncapsStack.marshaledMap.get(v);
+                if(q == null)
+                {
+                    //
+                    // We haven't seen this instance previously,
+                    // create a new index, and insert it into the
+                    // to-be-marshaled map.
+                    //
+                    q = Integer.valueOf(++_writeEncapsStack.writeIndex);
+                    _writeEncapsStack.toBeMarshaledMap.put(v, q);
+                }
+                p = q;
+            }
+	    return p.intValue();
+        }
+	return 0;
+    }
+
     void
     writeInstance(Ice.Object v, Integer index)
     {
@@ -2414,6 +2572,8 @@ public class BasicStream
     private int _readSlice;
     private int _writeSlice;
 
+    private int _currentObjectStart;
+
     private int _traceSlicing;
     private String _slicingCat;
 
@@ -2425,6 +2585,7 @@ public class BasicStream
     private int _startSeq;
     private int _minSeqSize;
 
+    private java.util.ArrayList<Ice.SkippedSlice> _skippedSlices = new java.util.ArrayList<Ice.SkippedSlice>();
     private java.util.ArrayList<Ice.Object> _objectList;
 
     private static java.util.HashMap<String, UserExceptionFactory> _exceptionFactories =
diff --git a/java/test/Ice/slicing/exceptions/AMDTestI.java b/java/test/Ice/slicing/exceptions/AMDTestI.java
index cb281b6..e194008 100644
--- a/java/test/Ice/slicing/exceptions/AMDTestI.java
+++ b/java/test/Ice/slicing/exceptions/AMDTestI.java
@@ -23,6 +23,13 @@ import test.Ice.slicing.exceptions.serverAMD.Test.AMD_TestIntf_unknownIntermedia
 import test.Ice.slicing.exceptions.serverAMD.Test.AMD_TestIntf_unknownMostDerived1AsBase;
 import test.Ice.slicing.exceptions.serverAMD.Test.AMD_TestIntf_unknownMostDerived1AsKnownIntermediate;
 import test.Ice.slicing.exceptions.serverAMD.Test.AMD_TestIntf_unknownMostDerived2AsBase;
+import test.Ice.slicing.exceptions.serverAMD.Test.AMD_TestIntf_clientBaseAsBasePass;
+import test.Ice.slicing.exceptions.serverAMD.Test.AMD_TestIntf_clientUnknownDerivedAsBasePass;
+import test.Ice.slicing.exceptions.serverAMD.Test.AMD_TestIntf_clientUnsliceableDerivedAsBasePass;
+import test.Ice.slicing.exceptions.serverAMD.Test.AMD_TestIntf_clientBaseAsBaseRethrow;
+import test.Ice.slicing.exceptions.serverAMD.Test.AMD_TestIntf_clientUnknownDerivedAsBaseRethrow;
+import test.Ice.slicing.exceptions.serverAMD.Test.AMD_TestIntf_clientUnsliceableDerivedAsBaseRethrow;
+import test.Ice.slicing.exceptions.serverAMD.Test.AMD_TestIntf_clientUnsliceableInnerClassRethrow;
 import test.Ice.slicing.exceptions.serverAMD.Test.Base;
 import test.Ice.slicing.exceptions.serverAMD.Test.KnownDerived;
 import test.Ice.slicing.exceptions.serverAMD.Test.KnownIntermediate;
@@ -31,6 +38,8 @@ import test.Ice.slicing.exceptions.serverAMD.Test.UnknownDerived;
 import test.Ice.slicing.exceptions.serverAMD.Test.UnknownIntermediate;
 import test.Ice.slicing.exceptions.serverAMD.Test.UnknownMostDerived1;
 import test.Ice.slicing.exceptions.serverAMD.Test.UnknownMostDerived2;
+import test.Ice.slicing.exceptions.serverAMD.Test.ClientIntfPrx;
+import test.Ice.slicing.exceptions.serverAMD.Test.ClientIntfPrxHelper;
 import test.Ice.slicing.exceptions.serverAMD.Test._TestIntfDisp;
 
 public final class AMDTestI extends _TestIntfDisp
@@ -185,4 +194,102 @@ public final class AMDTestI extends _TestIntfDisp
         umd2.umd2 = "UnknownMostDerived2.umd2";
         cb.ice_exception(umd2);
     }
+
+    public void
+    clientBaseAsBasePass_async(AMD_TestIntf_clientBaseAsBasePass cb, ClientIntfPrx client, Ice.Current current)
+        throws Base
+    {
+        try
+        {
+            client.baseAsBase();
+        }
+        catch(Base b)
+        {
+            cb.ice_exception(b);
+        }
+    }
+
+    public void
+    clientUnknownDerivedAsBasePass_async(AMD_TestIntf_clientUnknownDerivedAsBasePass cb, ClientIntfPrx client, Ice.Current current)
+        throws Base
+    {
+        try
+        {
+            client.unknownDerivedAsBase();
+        }
+        catch(Base b)
+        {
+            cb.ice_exception(b);
+        }
+    }
+
+    public void
+    clientUnsliceableDerivedAsBasePass_async(AMD_TestIntf_clientUnsliceableDerivedAsBasePass cb, ClientIntfPrx client, Ice.Current current)
+        throws Base
+    {
+        try
+        {
+            client.unsliceableDerivedAsBase();
+        }
+        catch(Base b)
+        {
+            cb.ice_exception(b);
+        }
+    }
+
+    public void
+    clientBaseAsBaseRethrow_async(AMD_TestIntf_clientBaseAsBaseRethrow cb, ClientIntfPrx client, Ice.Current current)
+        throws Base
+    {
+        try
+        {
+            client.baseAsBase();
+        }
+        catch(Base ex)
+        {
+            cb.ice_exception(ex);
+        }
+    }
+
+    public void 
+    clientUnknownDerivedAsBaseRethrow_async(AMD_TestIntf_clientUnknownDerivedAsBaseRethrow cb, ClientIntfPrx client, Ice.Current current)
+        throws Base
+    {
+        try
+        {
+            client.unknownDerivedAsBase();
+        }
+        catch(Base ex)
+        {
+            cb.ice_exception(ex);
+        }
+    }
+
+    public void
+    clientUnsliceableDerivedAsBaseRethrow_async(AMD_TestIntf_clientUnsliceableDerivedAsBaseRethrow cb, ClientIntfPrx client, Ice.Current current)
+        throws Base
+    {
+        try
+        {
+            client.unsliceableDerivedAsBase();
+        }
+        catch(Base ex)
+        {
+            cb.ice_exception(ex);
+        }
+    }
+
+    public void
+    clientUnsliceableInnerClassRethrow_async(AMD_TestIntf_clientUnsliceableInnerClassRethrow cb, ClientIntfPrx client, Ice.Current current)
+        throws Base
+    {
+        try
+        {
+            client.unsliceableWithInnerClass();
+        }
+        catch(Base ex)
+        {
+            cb.ice_exception(ex);
+        }
+    }
 }
diff --git a/java/test/Ice/slicing/exceptions/AllTests.java b/java/test/Ice/slicing/exceptions/AllTests.java
index 38e7c91..fab2fcf 100644
--- a/java/test/Ice/slicing/exceptions/AllTests.java
+++ b/java/test/Ice/slicing/exceptions/AllTests.java
@@ -9,25 +9,33 @@
 
 package test.Ice.slicing.exceptions;
 
-import test.Ice.slicing.exceptions.Test.Callback_TestIntf_baseAsBase;
-import test.Ice.slicing.exceptions.Test.Callback_TestIntf_knownDerivedAsBase;
-import test.Ice.slicing.exceptions.Test.Callback_TestIntf_knownDerivedAsKnownDerived;
-import test.Ice.slicing.exceptions.Test.Callback_TestIntf_knownIntermediateAsBase;
-import test.Ice.slicing.exceptions.Test.Callback_TestIntf_knownIntermediateAsKnownIntermediate;
-import test.Ice.slicing.exceptions.Test.Callback_TestIntf_knownMostDerivedAsBase;
-import test.Ice.slicing.exceptions.Test.Callback_TestIntf_knownMostDerivedAsKnownIntermediate;
-import test.Ice.slicing.exceptions.Test.Callback_TestIntf_knownMostDerivedAsKnownMostDerived;
-import test.Ice.slicing.exceptions.Test.Callback_TestIntf_unknownDerivedAsBase;
-import test.Ice.slicing.exceptions.Test.Callback_TestIntf_unknownIntermediateAsBase;
-import test.Ice.slicing.exceptions.Test.Callback_TestIntf_unknownMostDerived1AsBase;
-import test.Ice.slicing.exceptions.Test.Callback_TestIntf_unknownMostDerived1AsKnownIntermediate;
-import test.Ice.slicing.exceptions.Test.Callback_TestIntf_unknownMostDerived2AsBase;
-import test.Ice.slicing.exceptions.Test.Base;
-import test.Ice.slicing.exceptions.Test.KnownDerived;
-import test.Ice.slicing.exceptions.Test.KnownIntermediate;
-import test.Ice.slicing.exceptions.Test.KnownMostDerived;
-import test.Ice.slicing.exceptions.Test.TestIntfPrx;
-import test.Ice.slicing.exceptions.Test.TestIntfPrxHelper;
+import test.Ice.slicing.exceptions.client.Test.Callback_TestIntf_baseAsBase;
+import test.Ice.slicing.exceptions.client.Test.Callback_TestIntf_knownDerivedAsBase;
+import test.Ice.slicing.exceptions.client.Test.Callback_TestIntf_knownDerivedAsKnownDerived;
+import test.Ice.slicing.exceptions.client.Test.Callback_TestIntf_knownIntermediateAsBase;
+import test.Ice.slicing.exceptions.client.Test.Callback_TestIntf_knownIntermediateAsKnownIntermediate;
+import test.Ice.slicing.exceptions.client.Test.Callback_TestIntf_knownMostDerivedAsBase;
+import test.Ice.slicing.exceptions.client.Test.Callback_TestIntf_knownMostDerivedAsKnownIntermediate;
+import test.Ice.slicing.exceptions.client.Test.Callback_TestIntf_knownMostDerivedAsKnownMostDerived;
+import test.Ice.slicing.exceptions.client.Test.Callback_TestIntf_unknownDerivedAsBase;
+import test.Ice.slicing.exceptions.client.Test.Callback_TestIntf_unknownIntermediateAsBase;
+import test.Ice.slicing.exceptions.client.Test.Callback_TestIntf_unknownMostDerived1AsBase;
+import test.Ice.slicing.exceptions.client.Test.Callback_TestIntf_unknownMostDerived1AsKnownIntermediate;
+import test.Ice.slicing.exceptions.client.Test.Callback_TestIntf_unknownMostDerived2AsBase;
+import test.Ice.slicing.exceptions.client.Test.Base;
+import test.Ice.slicing.exceptions.client.Test.KnownDerived;
+import test.Ice.slicing.exceptions.client.Test.KnownIntermediate;
+import test.Ice.slicing.exceptions.client.Test.KnownMostDerived;
+import test.Ice.slicing.exceptions.client.Test.TestIntfPrx;
+import test.Ice.slicing.exceptions.client.Test.TestIntfPrxHelper;
+import test.Ice.slicing.exceptions.client.Test._ClientIntfDisp;
+import test.Ice.slicing.exceptions.client.Test.ClientIntfPrx;
+import test.Ice.slicing.exceptions.client.Test.ClientIntfPrxHelper;
+import test.Ice.slicing.exceptions.client.Test.ClientUnknownDerived;
+import test.Ice.slicing.exceptions.client.Test.ClientUnsliceableDerived;
+import test.Ice.slicing.exceptions.client.Test.ClientUnsliceableWithClass;
+import test.Ice.slicing.exceptions.client.Test.InnerClass;
+import test.Ice.slicing.exceptions.client.Test.InnerClassDerived;
 
 public class AllTests
 {
@@ -641,10 +649,59 @@ public class AllTests
         private Callback callback = new Callback();
     }
 
+    static class ClientI extends _ClientIntfDisp
+    {
+        public 
+        ClientI()
+        {
+        }
+        
+        public void 
+        baseAsBase(Ice.Current current)
+        throws Base
+        {
+            Base ex = new Base();
+            ex.b = "Base";
+            throw ex;
+        }
+
+        public void 
+        unknownDerivedAsBase(Ice.Current current)
+        throws Base
+        {
+            ClientUnknownDerived ex = new ClientUnknownDerived();
+            ex.ud = "UnknownDerived";
+            ex.b = "Base";
+            throw ex;
+        }
+
+        public void 
+        unsliceableDerivedAsBase(Ice.Current current)
+        throws Base
+        {
+            ClientUnsliceableDerived ex = new ClientUnsliceableDerived();
+            ex.ud = "UnsliceableDerived";
+            ex.b = "Base";
+            throw ex;
+        }
+
+        public void 
+        unsliceableWithInnerClass(Ice.Current current)
+        throws Base
+        {
+            ClientUnsliceableWithClass ex = new ClientUnsliceableWithClass();
+            ex.b = "WithInnerClass";
+            ex.myObj = new InnerClassDerived();
+            ex.myObj.ic = "InnerClass";
+            ex.myObj.id = "InnerClassDerived";
+            throw ex;
+        }
+    }
+
     public static TestIntfPrx
     allTests(Ice.Communicator communicator, boolean collocated, java.io.PrintWriter out)
     {
-		out.print("testing stringToProxy... ");
+        out.print("testing stringToProxy... ");
         out.flush();
         String ref = "Test:default -p 12010 -t 10000";
         Ice.ObjectPrx base = communicator.stringToProxy(ref);
@@ -658,6 +715,11 @@ public class AllTests
         test(test.equals(base));
         out.println("ok");
 
+        communicator.getProperties().setProperty("ClientAdapter.Endpoints", "default -p 12020 -t 2000");
+        Ice.ObjectAdapter adapter = communicator.createObjectAdapter("ClientAdapter");
+        ClientIntfPrx clientPrx = ClientIntfPrxHelper.uncheckedCast(adapter.addWithUUID(new ClientI()));
+        adapter.activate();
... 10093 lines suppressed ...


-- 
asterisk-scf/integration/ice.git



More information about the asterisk-scf-commits mailing list