Read only archive ; use https://github.com/JacORB/JacORB/issues for new issues
View | Details | Raw Unified | Return to bug 1021
Collapse All | Expand All

(-)a/core/src/main/java/org/jacorb/orb/CDROutputStream.java (-4 / +4 lines)
Lines 1875-1881 public class CDROutputStream Link Here
1875
        }
1875
        }
1876
1876
1877
        Integer index = getValueMap().get (value);
1877
        Integer index = getValueMap().get (value);
1878
        if (index != null)
1878
        if (index != null && isIndirectionEnabled())
1879
        {
1879
        {
1880
            // value has already been written -- make an indirection
1880
            // value has already been written -- make an indirection
1881
            write_long (0xffffffff);
1881
            write_long (0xffffffff);
Lines 1891-1897 public class CDROutputStream Link Here
1891
    private void write_repository_id(final String repository_id)
1891
    private void write_repository_id(final String repository_id)
1892
    {
1892
    {
1893
        Integer _index = getRepIdMap().get (repository_id);
1893
        Integer _index = getRepIdMap().get (repository_id);
1894
        if ( _index == null)
1894
        if ( _index == null || !isIndirectionEnabled() )
1895
        {
1895
        {
1896
            // a new repository id -- write it
1896
            // a new repository id -- write it
1897
1897
Lines 1929-1935 public class CDROutputStream Link Here
1929
        {
1929
        {
1930
            _index = getCodebaseMap().get (codebase);
1930
            _index = getCodebaseMap().get (codebase);
1931
        }
1931
        }
1932
        if ( _index == null)
1932
        if ( _index == null && !isIndirectionEnabled())
1933
        {
1933
        {
1934
            // a new codebase -- write it#
1934
            // a new codebase -- write it#
1935
1935
Lines 2180-2186 public class CDROutputStream Link Here
2180
                    {
2180
                    {
2181
                        // look at the new value
2181
                        // look at the new value
2182
                        Integer index = getValueMap().get(newValue);
2182
                        Integer index = getValueMap().get(newValue);
2183
                        if (index != null)
2183
                        if (index != null && isIndirectionEnabled())
2184
                        {
2184
                        {
2185
                            // previously marshaled value -- make an indirection
2185
                            // previously marshaled value -- make an indirection
2186
                            write_long (0xffffffff);
2186
                            write_long (0xffffffff);
(-)a/core/src/main/java/org/jacorb/orb/typecode/ComplexTypeCodeWriter.java (-28 / +10 lines)
Lines 34-59 public abstract class ComplexTypeCodeWriter implements TypeCodeWriter Link Here
34
    public void writeTypeCode(TypeCode typeCode, CDROutputStream out,
34
    public void writeTypeCode(TypeCode typeCode, CDROutputStream out,
35
            Map recursiveTCMap, Map repeatedTCMap)
35
            Map recursiveTCMap, Map repeatedTCMap)
36
    {
36
    {
37
        if (out.isIndirectionEnabled() && repeatedTCMap.containsKey(typeCode))
37
        try
38
        {
38
        {
39
            writeIndirectionMarker(out, typeCode, repeatedTCMap);
39
            tryWriteTypeCode(typeCode, out, recursiveTCMap, repeatedTCMap);
40
        }
40
        }
41
        else
41
        catch (BadKind e)
42
        {
42
        {
43
            try
43
            assert false;
44
            {
44
            throw new RuntimeException(e);
45
                tryWriteTypeCode(typeCode, out, recursiveTCMap, repeatedTCMap);
45
        }
46
            }
46
        catch (Bounds e)
47
            catch (BadKind e)
47
        {
48
            {
48
            assert false;
49
                assert false;
49
            throw new RuntimeException(e);
50
                throw new RuntimeException(e);
51
            }
52
            catch (Bounds e)
53
            {
54
                assert false;
55
                throw new RuntimeException(e);
56
            }
57
        }
50
        }
58
    }
51
    }
59
52
Lines 82-96 public abstract class ComplexTypeCodeWriter implements TypeCodeWriter Link Here
82
    }
75
    }
83
76
84
    protected abstract void doWriteTypeCodeParameters(TypeCode typeCode, CDROutputStream out, Map recursiveTCMap, Map repeatedTCMap) throws BadKind, Bounds;
77
    protected abstract void doWriteTypeCodeParameters(TypeCode typeCode, CDROutputStream out, Map recursiveTCMap, Map repeatedTCMap) throws BadKind, Bounds;
85
86
    private final void writeIndirectionMarker(final CDROutputStream out,
87
                                              final Object key,
88
                                              final Map indirectionTCMap)
89
    {
90
        out.write_long( -1 ); // recursion marker
91
        int negative_offset =
92
            ((Integer) indirectionTCMap.get(key)).intValue() - out.get_pos() - 4;
93
94
        out.write_long( negative_offset );
95
    }
96
}
78
}
(-)a/core/src/main/java/org/jacorb/orb/typecode/DelegatingTypeCodeWriter.java (-1 / +1 lines)
Lines 68-74 public class DelegatingTypeCodeWriter Link Here
68
    {
68
    {
69
        try
69
        try
70
        {
70
        {
71
            if(TypeCode.isRecursive(typeCode) && recursiveTCMap.containsKey(typeCode.id()))
71
            if(out.isIndirectionEnabled() && TypeCode.isRecursive(typeCode) && recursiveTCMap.containsKey(typeCode.id()))
72
            {
72
            {
73
                writeIndirectionMarker(out, typeCode.id(), recursiveTCMap);
73
                writeIndirectionMarker(out, typeCode.id(), recursiveTCMap);
74
            }
74
            }

Return to bug 1021