Ticket #2121 (closed defect: fixed)

Opened 7 months ago

Last modified 7 months ago

SWIG exception in mapping an invalid C++ enum value to Java

Reported by: nanang Owned by: bennylp
Priority: normal Milestone: release-2.8
Component: pjsua2 Version: trunk
Keywords: Cc:
Backport to 1.x milestone: Backported: no


Sample exception message:

Swig::DirectorException: No enum class org.pjsip.pjsua2.pjsip_tsx_state_e
                         with value 377750600

SWIG requires C++ enum data to have a valid value so it can be correctly mapped to Java enum object. Unfortunately some PJSUA2 C++ objects do not initialize basic type data member (including enum) in its constructor and such uninitialized data member may have an invalid value, so when SWIG needs to map an invalid C++ enum value to Java, exception occurs.

Kazuhiko Yoneda for the report and the patch.

Change History

comment:1 Changed 7 months ago by nanang

  • Status changed from new to closed
  • Resolution set to fixed

In 5807:

Fix #2121: Initialize basic type data member of PJSUA2/C++ objects in its constructor.

Note: See TracTickets for help on using tickets.