From 42cc311f008592f9879cc58af69eb26b80032e34 Mon Sep 17 00:00:00 2001 From: Hasunie Date: Thu, 16 Mar 2017 12:45:46 +0530 Subject: [PATCH] Fixing NPE in AndroidAPIUtils resolved #616 --- .../mobile/windows/api/services/ConfigurationMgtService.java | 4 ++-- .../api/services/impl/ConfigurationMgtServiceImpl.java | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.api/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/api/services/ConfigurationMgtService.java b/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.api/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/api/services/ConfigurationMgtService.java index 827dec630..4872e8ba4 100644 --- a/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.api/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/api/services/ConfigurationMgtService.java +++ b/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.api/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/api/services/ConfigurationMgtService.java @@ -209,9 +209,9 @@ public interface ConfigurationMgtService { @GET @Path("license") - @Produces(MediaType.APPLICATION_JSON) + @Produces(MediaType.TEXT_PLAIN) @ApiOperation( - produces = MediaType.APPLICATION_JSON, + produces = MediaType.TEXT_PLAIN, httpMethod = "GET", value = "Getting the License Agreement to Register a Windows Device", notes = "Use this REST API to retrieve the license agreement that is used for the Windows device " + diff --git a/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.api/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/api/services/impl/ConfigurationMgtServiceImpl.java b/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.api/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/api/services/impl/ConfigurationMgtServiceImpl.java index 2230dc362..f4829183e 100644 --- a/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.api/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/api/services/impl/ConfigurationMgtServiceImpl.java +++ b/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.api/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/api/services/impl/ConfigurationMgtServiceImpl.java @@ -98,9 +98,10 @@ public class ConfigurationMgtServiceImpl implements ConfigurationMgtService { * @throws WindowsConfigurationException */ @PUT - public Response updateConfiguration(PlatformConfiguration configuration) throws WindowsConfigurationException { + public Response updateConfiguration(PlatformConfiguration windowsPlatformConfiguration) throws WindowsConfigurationException { String message; ConfigurationEntry licenseEntry = null; + PlatformConfiguration configuration = new PlatformConfiguration(); try { configuration.setType(DeviceManagementConstants.MobileDeviceTypes.MOBILE_DEVICE_TYPE_WINDOWS); List configs = configuration.getConfiguration();