Commit 47aca923 authored by Committed by Uze Choi
[IOT-1880] Adding Fixes for issues generated from static analyzer tool in...
[IOT-1880] Adding Fixes for issues generated from static analyzer tool in Notification service c++ , JNI layer 1) In JNINotificationConsumer.cpp, Getting native Provider object is common code for all the native methods. Added a separate method ' getNativeProvider' to do this, so that method size and complexity will be reduced. 2) JNiNotificationConsumer.cpp Line 1379, and NSTopicslist.cpp Line 59 has changes to fix the issue of Unreachable code. 3) Copy constructor and copy assignment operator are added in class 'NSAcceptedProviders' & 'NSAcceptedConsumers' which has dynamically allocated data members 4) In NSAcceptedProviders class, getProviders() method is changed to const since it is being used by the copy constructors and hence modified the member variable 'm_mutex' to be mutable. 5) In NSAcceptedConsumers class, getConsumers() method is changed to const since it is being used by the copy constructors and hence modified the member variable 'm_mutex' to be mutable. 6) In NotiListener.java, the NULL check for mProviderSample is moved above the first instance where mProviderSample is beig used. Change-Id: Ic18c3d9797a02a73f5397192b21e7dda5926119e Signed-off-by: Poovizhi <firstname.lastname@example.org> Reviewed-on: https://gerrit.iotivity.org/gerrit/17653Reviewed-by: Uze Choi <email@example.com> Tested-by: Uze Choi <firstname.lastname@example.org>
Showing with 106 additions and 129 deletions
service/notification/android/notification-service/src/main/jni/consumer/JniNotificationConsumer.cpp 100755 → 100644