summaryrefslogtreecommitdiff
path: root/java/src/IceInternal/BasicStream.java
diff options
context:
space:
mode:
authorMichi Henning <michi@zeroc.com>2003-05-22 03:59:29 +0000
committerMichi Henning <michi@zeroc.com>2003-05-22 03:59:29 +0000
commit269ea5954ecbd28ccadc2acbda2cebc849062c29 (patch)
tree08539b8cd51370b5479f5aece59b3022cca0fbb3 /java/src/IceInternal/BasicStream.java
parentMinor fix (diff)
downloadice-269ea5954ecbd28ccadc2acbda2cebc849062c29.tar.bz2
ice-269ea5954ecbd28ccadc2acbda2cebc849062c29.tar.xz
ice-269ea5954ecbd28ccadc2acbda2cebc849062c29.zip
Changed the implementation of patchPointers (C++) and patchReferences
(Java) to bring the two implementations more in line with each other. Added a missing newline to the C++ generated code for AMI. Added an ["ami"] directive to the slicing test for classes to force code generation for AMI. This ensures that the code is actually generated and compiled.
Diffstat (limited to 'java/src/IceInternal/BasicStream.java')
-rw-r--r--java/src/IceInternal/BasicStream.java18
1 files changed, 13 insertions, 5 deletions
diff --git a/java/src/IceInternal/BasicStream.java b/java/src/IceInternal/BasicStream.java
index 29c568e3cda..797016914df 100644
--- a/java/src/IceInternal/BasicStream.java
+++ b/java/src/IceInternal/BasicStream.java
@@ -1271,12 +1271,12 @@ public class BasicStream
patchReferences(Integer instanceIndex, Integer patchIndex)
{
//
- // Called whenever we have unmarshaled a new instance. The instanceIndex is the index of the instance just
- // unmarshaled and patchIndex is the index just unmarshaled. (Either may be null, in which case we search
- // the patch map and/or the unmarshaled map.)
+ // Called whenever we have unmarshaled a new instance or an index.
+ // The instanceIndex is the index of the instance just unmarshaled and patchIndex is the index
+ // just unmarshaled. (Exactly one of the two parameters must be null.)
// Patch any pointers in the patch map with the new address.
//
- assert((patchIndex != null && instanceIndex == null) || (patchIndex == null && instanceIndex != null));
+ assert((instanceIndex != null && patchIndex == null) || (instanceIndex == null && patchIndex != null));
java.util.LinkedList patchlist;
Ice.Object v;
@@ -1296,7 +1296,7 @@ public class BasicStream
else
{
//
- // We have just unmarshaled an index -- check if we have unmarshaled an instance for that index.
+ // We have just unmarshaled an index -- check if we have unmarshaled the instance for that index yet.
//
v = (Ice.Object)_readEncapsStack.unmarshaledMap.get(patchIndex);
if(v == null)
@@ -1308,6 +1308,9 @@ public class BasicStream
assert(patchlist != null && patchlist.size() > 0);
assert(v != null);
+ //
+ // Patch all references that refer to the instance.
+ //
for(java.util.Iterator i = patchlist.iterator(); i.hasNext(); )
{
IceInternal.Patcher p = (IceInternal.Patcher)i.next();
@@ -1320,6 +1323,11 @@ public class BasicStream
throw new Ice.UnmarshalOutOfBoundsException();
}
}
+
+ //
+ // Clear out the patch map for that index -- there is nothing left to patch for that
+ // index for the time being.
+ //
_readEncapsStack.patchMap.remove(patchIndex);
}