int32_t isEntryValid(JNIEnv *pEnv, StoreEntry *pEntry, StoreType pType) { if (pEntry == NULL) throwNotExistingKeyException(pEnv); else if (pEntry->mType != pType) throwInvalidTypeException(pEnv); else return 1; return 0; }
int32_t isEntryValid(JNIEnv* pEnv, StoreEntry* pEntry, StoreType type) { if (NULL == pEntry) { throwNotExistingKeyException(pEnv); } else if (pEntry->mType != type) { throwInvalidTypeException(pEnv); } else { return 1; } // We arrive here if an exception is raised (raising an // exception does not stop the flow of code like in Java). return 0; }
int32_t isEntryValid(JNIEnv* env, StoreEntry* rEntry, StoreType rType) { LOGV("isEntryValid is called"); if(rEntry == NULL) { throwNonExistingKeyException(env); LOGV("No key present with that type"); return 0; } else if(rEntry->nType != rType) { throwInvalidTypeException(env); LOGV("EntryType is invalid"); return 0; } LOGV("Entry is valid"); return 1; }