public <T> T copyShallow (T object, Serializer serializer) {
if (object == null) return null;
copyDepth++;
copyShallow = true;
try {
if (originalToCopy == null) originalToCopy = new IdentityMap();
Object existingCopy = originalToCopy.get(object);
if (existingCopy != null) return (T)existingCopy;
needsCopyReference = object;
Object copy;