[IOT-2745]Static Analysis fixes for Java NS. 17/22817/3
authorabitha.s <abitha.s@samsung.com>
Fri, 13 Oct 2017 09:18:13 +0000 (14:48 +0530)
committerAshok Babu Channa <ashok.channa@samsung.com>
Mon, 16 Oct 2017 18:26:31 +0000 (18:26 +0000)
Change-Id: Ibb2a3e429702a0968a9aacc9ccce2c962a8db36b
Signed-off-by: abitha.s <abitha.s@samsung.com>
service/notification/android/notification-service/src/main/java/org/iotivity/service/ns/consumer/Provider.java
service/notification/examples/android/NotiConsumerExample/app/src/androidTest/java/org/iotivity/service/ns/sample/consumer/ExampleUnitTest.java
service/notification/examples/android/NotiConsumerExample/app/src/main/java/org/iotivity/service/ns/sample/consumer/ConsumerSample.java
service/notification/examples/android/NotiConsumerExample/app/src/main/java/org/iotivity/service/ns/sample/consumer/MainActivity.java
service/notification/examples/android/NotiProviderExample/app/src/androidTest/java/org/iotivity/service/ns/sample/provider/ExampleUnitTest.java
service/notification/examples/android/NotiProviderExample/app/src/main/java/org/iotivity/service/ns/sample/provider/MainActivity.java
service/notification/examples/android/NotiProviderExample/app/src/main/java/org/iotivity/service/ns/sample/provider/ProviderSample.java

index 20706d0..14e2e22 100755 (executable)
@@ -72,8 +72,6 @@ public class Provider {
     protected void finalize() throws Throwable {
         try {
             nativeDispose();
-        } catch (Throwable t) {
-            throw t;
         } finally {
             super.finalize();
         }
index 11ef47a..a4186df 100755 (executable)
@@ -194,8 +194,9 @@ public class ExampleUnitTest extends ApplicationTestCase<Application> {
 
     @BeforeClass
     public static void Initialize() {
+        String ipAddress = "0.0.0.0";
         PlatformConfig platformConfig = new PlatformConfig(mContext,
-                ServiceType.IN_PROC, ModeType.CLIENT_SERVER, "0.0.0.0",
+                ServiceType.IN_PROC, ModeType.CLIENT_SERVER, ipAddress,
                 0, // Uses randomly available port
                 QualityOfService.LOW);
 
index 0217436..2544fa0 100755 (executable)
@@ -70,9 +70,9 @@ public class ConsumerSample
     }
 
     private void configurePlatform() {
-
+        String ipAddress = "0.0.0.0";
         PlatformConfig platformConfig = new PlatformConfig(mContext,
-                ServiceType.IN_PROC, ModeType.CLIENT_SERVER, "0.0.0.0",
+                ServiceType.IN_PROC, ModeType.CLIENT_SERVER, ipAddress,
                 0, // Uses randomly available port
                 QualityOfService.LOW);
 
index 5348d8b..e20883b 100755 (executable)
@@ -540,6 +540,8 @@ public class MainActivity extends Activity
             logMessage("signOut Successful");
         } catch (OcException e) {
             e.printStackTrace();
+        } catch (Exception e) {
+            e.printStackTrace();
         }
     }
 
index 701929b..f359653 100755 (executable)
@@ -111,8 +111,9 @@ public class ExampleUnitTest extends ApplicationTestCase<Application> {
 
     @BeforeClass
     public static void Initialize() {
+        String ipAddress = "0.0.0.0";
         PlatformConfig platformConfig = new PlatformConfig(mContext,
-                ServiceType.IN_PROC, ModeType.CLIENT_SERVER, "0.0.0.0",
+                ServiceType.IN_PROC, ModeType.CLIENT_SERVER, ipAddress,
                 0, // Uses randomly available port
                 QualityOfService.LOW);
 
index 813d429..8ff0492 100755 (executable)
@@ -588,6 +588,8 @@ public class MainActivity extends Activity
             logMessage("signOut Successful");
         } catch (OcException e) {
             e.printStackTrace();
+        } catch (Exception e) {
+            e.printStackTrace();
         }
     }
 
index c84c63c..8a4ae95 100755 (executable)
@@ -74,9 +74,9 @@ public class ProviderSample
     }
 
     private void configurePlatform() {
-
+        String ipAddress = "0.0.0.0";
         PlatformConfig platformConfig = new PlatformConfig(mContext,
-                ServiceType.IN_PROC, ModeType.CLIENT_SERVER, "0.0.0.0",
+                ServiceType.IN_PROC, ModeType.CLIENT_SERVER, ipAddress,
                 0, // Uses randomly available port
                 QualityOfService.LOW);