Index: doc/REL_NOTES =================================================================== RCS file: /cvs/JacORB/doc/REL_NOTES,v retrieving revision 1.204 diff -r1.204 REL_NOTES 123a124 > - Added jacorb.interop.lax_null_string_encoding to allow handling of strings of size 0 Index: doc/ProgrammingGuide/Configuration/configuration.tex =================================================================== RCS file: /cvs/JacORB/doc/ProgrammingGuide/Configuration/configuration.tex,v retrieving revision 1.62 diff -r1.62 configuration.tex 713a714,717 > \verb"jacorb.interop.lax_" > \verb"null_string_encoding" & Allow reading of 0 size strings. > This can be useful for ORBs such as VisiBroker. & boolean & off \\ > \hline Index: etc/jacorb_properties.template =================================================================== RCS file: /cvs/JacORB/etc/jacorb_properties.template,v retrieving revision 1.78 diff -r1.78 jacorb_properties.template 381a382,386 > # Some ORBs (e.g. Visibroker) do not correctly encode empty strings > # saving one byte on the paload. > # Turns this on if you run into strings with size 0 > jacorb.interop.lax_null_string_encoding=off > Index: src/org/jacorb/orb/CDRInputStream.java =================================================================== RCS file: /cvs/JacORB/src/org/jacorb/orb/CDRInputStream.java,v retrieving revision 1.134 diff -r1.134 CDRInputStream.java 102a103 > private boolean laxNullStringEncoding; 278a280,281 > laxNullStringEncoding = > configuration.getAttributeAsBoolean("jacorb.interop.lax_null_string_encoding", false); 1255a1259,1263 > if (laxNullStringEncoding && size == 0) > { > // Some ORBs wrongly encode empty string with a size 0 > return ""; > } Index: test/regression/src/org/jacorb/test/orb/CDRInputStreamTest.java =================================================================== RCS file: /cvs/JacORB/test/regression/src/org/jacorb/test/orb/CDRInputStreamTest.java,v retrieving revision 1.2 diff -r1.2 CDRInputStreamTest.java 24a25,26 > import org.omg.CORBA.MARSHAL; > 178a181,194 > public void testFailOnNullEncodedString() throws Exception > { > byte[] codedText = {0,0,0,0}; > CDRInputStream stream = new CDRInputStream( orb, codedText ); > try { > stream.read_string(); > fail("Null encoded string should have failed with an exception"); > } catch (MARSHAL e) { > assertNotNull(e.getMessage()); > assertTrue("Not a MARSHALL exception: " + e.getMessage(), e.getMessage().matches("^.*invalid string size: 0.*$")); > } > } > >