KNIEXPORT KNI_RETURNTYPE_OBJECT KNIDECL(com_sun_midp_chameleon_skins_resources_SkinResourcesImpl_getSharedSkinData) { #if ENABLE_MULTIPLE_ISOLATES KNI_StartHandles(1); KNI_DeclareHandle(obj); if (skinProperties >= 0) { SNI_GetReference(skinProperties, obj); } KNI_EndHandlesAndReturnObject(obj); #else KNI_StartHandles(1); KNI_DeclareHandle(tempHandle); KNI_EndHandlesAndReturnObject(tempHandle); #endif }
/* * Checks refId for validity, gets its handle value, and stores it * into obj. An error message incorporating msg is emitted if refId is * invalid or if the handle returns is null. */ static void getReference(int refId, char *msg, jobject obj) { if (refId == INVALID_REFERENCE_ID) { midp_snprintf(gKNIBuffer, KNI_BUFFER_SIZE, "invalid reference ID in %s", msg); REPORT_CRIT(LC_CORE, gKNIBuffer); KNI_ReleaseHandle(obj); } else { SNI_GetReference(refId, obj); if (KNI_IsNullHandle(obj)) { midp_snprintf(gKNIBuffer, KNI_BUFFER_SIZE, "null reference from SNI_GetReference in %s", msg); REPORT_CRIT(LC_CORE, gKNIBuffer); } } }