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

(-)doc/REL_NOTES (+1 lines)
Line 124 Link Here
124
        - Added jacorb.interop.lax_null_string_encoding to allow handling of strings of size 0
(-)doc/ProgrammingGuide/Configuration/configuration.tex (+4 lines)
Line 714 Link Here
714
\verb"jacorb.interop.lax_"
715
\verb"null_string_encoding" & Allow reading of 0 size strings. 
716
This can be useful for ORBs such as VisiBroker. & boolean & off \\
717
\hline
(-)etc/jacorb_properties.template (+5 lines)
Line 382 Link Here
382
# Some ORBs (e.g. Visibroker) do not correctly encode empty strings
383
# saving one byte on the paload.
384
# Turns this on if you run into strings with size 0
385
jacorb.interop.lax_null_string_encoding=off
386
(-)src/org/jacorb/orb/CDRInputStream.java (+8 lines)
Line 103 Link Here
103
    private boolean laxNullStringEncoding;
Line 279 Link Here
280
        laxNullStringEncoding =
281
            configuration.getAttributeAsBoolean("jacorb.interop.lax_null_string_encoding", false);
Line 1256 Link Here
1259
            if (laxNullStringEncoding && size == 0)
1260
            {
1261
                // Some ORBs wrongly encode empty string with a size 0
1262
                return "";
1263
            }
(-)test/regression/src/org/jacorb/test/orb/CDRInputStreamTest.java (+16 lines)
Line 25 Link Here
25
import org.omg.CORBA.MARSHAL;
26
Line 179 Link Here
181
    public void testFailOnNullEncodedString() throws Exception
182
    {
183
        byte[] codedText = {0,0,0,0};
184
        CDRInputStream stream = new CDRInputStream( orb, codedText );
185
        try {
186
            stream.read_string();
187
            fail("Null encoded string should have failed with an exception");
188
        } catch (MARSHAL e) {
189
            assertNotNull(e.getMessage());
190
            assertTrue("Not a MARSHALL exception: " + e.getMessage(), e.getMessage().matches("^.*invalid string size: 0.*$"));
191
        }
192
    }
193
194

Return to bug 904