From 26ac11d95a68975451ce004ae034d6bbb0a2d212 Mon Sep 17 00:00:00 2001 From: "spurthi.segu" Date: Tue, 6 Oct 2015 16:46:21 +0530 Subject: [PATCH] Fix for setAllowedValuesInteger API of SimulatorResourceServer is throwing InvalidArgsException (IOT-779) Change-Id: Id74ebb5af1f68a459acf247d49de08593c8060b5 Signed-off-by: spurthi.segu Reviewed-on: https://gerrit.iotivity.org/gerrit/3613 Tested-by: jenkins-iotivity Reviewed-by: Uze Choi --- service/simulator/java/jni/simulator_resource_server_jni.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/service/simulator/java/jni/simulator_resource_server_jni.cpp b/service/simulator/java/jni/simulator_resource_server_jni.cpp index f8910b6..b9cadf2 100644 --- a/service/simulator/java/jni/simulator_resource_server_jni.cpp +++ b/service/simulator/java/jni/simulator_resource_server_jni.cpp @@ -400,7 +400,7 @@ JNIEXPORT void JNICALL Java_org_oic_simulator_serviceprovider_SimulatorResourceServer_setAllowedValuesInteger (JNIEnv *env, jobject object, jstring jKey, jobject jAllowedValues) { - if (!jKey || jAllowedValues) + if (!jKey || !jAllowedValues) { throwInvalidArgsException(env, SIMULATOR_INVALID_PARAM, "Invalid parameter!"); return; @@ -428,7 +428,7 @@ JNIEXPORT void JNICALL Java_org_oic_simulator_serviceprovider_SimulatorResourceServer_setAllowedValuesDouble (JNIEnv *env, jobject object, jstring jKey, jobject jAllowedValues) { - if (!jKey || jAllowedValues) + if (!jKey || !jAllowedValues) { throwInvalidArgsException(env, SIMULATOR_INVALID_PARAM, "Invalid parameter!"); return; @@ -456,7 +456,7 @@ JNIEXPORT void JNICALL Java_org_oic_simulator_serviceprovider_SimulatorResourceServer_setAllowedValuesString (JNIEnv *env, jobject object, jstring jKey, jobject jAllowedValues) { - if (!jKey || jAllowedValues) + if (!jKey || !jAllowedValues) { throwInvalidArgsException(env, SIMULATOR_INVALID_PARAM, "Invalid parameter!"); return; -- 2.7.4