Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4354713

from_any not throwing InvalidValue exception

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P4 P4
    • None
    • 1.4.0
    • other-libs
    • None
    • sparc
    • solaris_7

      As per sec 9.2.3.3 (formal/99-10-07), from_any should throw an InvalidValue exception if the passed Any does not contain a legal value (such as a null string). I'm here by giving a small piece of code which shows that the intended behaviour is not happening:

          string_tc = orb.get_primitive_tc(TCKind.tk_string);
          factory = (DynAnyFactory)orb.resolve_initial_references("DynAnyFactory");

              Any string_any_1 = orb.create_any();
              string_any_1.type(string_tc);
              string_any_1.insert_string(some_string);

              Any string_any_2 = orb.create_any();
              string_any_2.type(string_tc);
              string_any_2.insert_string(null);

              DynAny string_dynany = factory.create_dyn_any(string_any_1);
              string_dynany.from_any(string_any_1);
              string_dynany.from_any(string_any_2);

      The first call to from_any will work fine. However the second call should throw InvalidValue exception. It is not happening that way.

            sbauersunw Stefan Bauer (Inactive)
            arungup Arun Gupta (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: