Revert "Field IDs on Dalvik are more unique than in JVMs"

This reverts commit b5ca34fa40.

829a9b9c10 "In Java, css.uno.RuntimeException is
not derived from css.uno.Exception" is a better fix.
This commit is contained in:
Stephan Bergmann
2012-03-26 17:48:45 +02:00
parent 829a9b9c10
commit 40193672b1
3 changed files with 1 additions and 27 deletions

View File

@@ -1968,26 +1968,7 @@ void Bridge::map_to_java(
comp_td)->pParameterizedTypes != 0;
for ( sal_Int32 nPos = comp_td->nMembers; nPos--; )
{
jfieldID field_id;
// Handle com.sun.star.uno.RuntimeException::Context as a
// special case. In (C++) UNO css::uno::RuntimeException
// is simply a subclass of css::uno::Exception, which
// contains the Context field. In the Java UNO mapping
// css.uno.RuntimeException is a subclass of
// java.lang.RuntimeException, and has a Context field of
// its own, separate from that of css.uno.Exception.
// In Dalvik the field IDs of these Context fields
// differ. (In Java VMs they seem to be the same.)
if (type_equals( comp_info->m_td.get()->pWeakRef,
m_jni_info->m_RuntimeException_type.getTypeLibType() )
&& nPos == 1)
field_id = m_jni_info->m_field_css_uno_RuntimeException_m_Context;
else
field_id = linfo->m_fields[ nPos ];
jfieldID field_id = linfo->m_fields[ nPos ];
if (0 != field_id)
{
void const * p =

View File

@@ -766,11 +766,6 @@ JNI_info::JNI_info(
jni.ensure_no_exception();
OSL_ASSERT( 0 != m_field_JNI_proxy_m_oid );
m_field_css_uno_RuntimeException_m_Context = jni->GetFieldID(
(jclass) jo_RuntimeException.get(), "Context", "Ljava/lang/Object;" );
jni.ensure_no_exception();
OSL_ASSERT( 0 != m_field_css_uno_RuntimeException_m_Context );
// get java env
OUString java_env_type_name( RTL_CONSTASCII_USTRINGPARAM(UNO_LB_JAVA) );
JLocalAutoRef jo_java(

View File

@@ -204,8 +204,6 @@ public:
jfieldID m_field_JNI_proxy_m_type;
jfieldID m_field_JNI_proxy_m_oid;
jfieldID m_field_css_uno_RuntimeException_m_Context;
//
::com::sun::star::uno::TypeDescription m_XInterface_queryInterface_td;
::com::sun::star::uno::Type const & m_Exception_type;