From 5906546dfb5ea5b30a36955bbf89d300bc32ee1c Mon Sep 17 00:00:00 2001 From: Harshan Liyanage Date: Mon, 4 Sep 2017 11:56:56 +0530 Subject: [PATCH] Minor refactoring related to wso2/product-iots#1035 --- .../mgt/jaxrs/service/impl/UserManagementServiceImpl.java | 8 +++----- .../email/sender/core/service/EmailSenderServiceImpl.java | 8 +++----- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/UserManagementServiceImpl.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/UserManagementServiceImpl.java index 8d9480a5cc..ecea266b26 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/UserManagementServiceImpl.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/UserManagementServiceImpl.java @@ -167,9 +167,8 @@ public class UserManagementServiceImpl implements UserManagementService { } userInfoWrapper.setBasicUserInfo(createdUserInfo); userInfoWrapper.setMessage(message); - return Response.created(new URI(API_BASE_PATH + "/" + URIEncoder.encode(userInfo.getUsername(), "UTF-8"))) - .entity( - userInfoWrapper).build(); + return Response.created(new URI(API_BASE_PATH + "/" + URIEncoder.encode(userInfo.getUsername(), + "UTF-8"))).entity(userInfoWrapper).build(); } catch (UserStoreException e) { String msg = "Error occurred while trying to add user '" + userInfo.getUsername() + "' to the " + "underlying user management system"; @@ -189,8 +188,7 @@ public class UserManagementServiceImpl implements UserManagementService { return Response.serverError().entity( new ErrorResponse.ErrorResponseBuilder().setMessage(msg).build()).build(); } catch (DeviceManagementException e) { - String msg = "Error occurred while sending registration email to the user " + - userInfo.getUsername(); + String msg = "Error occurred while sending registration email to the user " + userInfo.getUsername(); log.error(msg, e); return Response.serverError().entity( new ErrorResponse.ErrorResponseBuilder().setMessage(msg).build()).build(); diff --git a/components/email-sender/org.wso2.carbon.email.sender.core/src/main/java/org/wso2/carbon/email/sender/core/service/EmailSenderServiceImpl.java b/components/email-sender/org.wso2.carbon.email.sender.core/src/main/java/org/wso2/carbon/email/sender/core/service/EmailSenderServiceImpl.java index 93b2c2a06a..25ad6a7b45 100644 --- a/components/email-sender/org.wso2.carbon.email.sender.core/src/main/java/org/wso2/carbon/email/sender/core/service/EmailSenderServiceImpl.java +++ b/components/email-sender/org.wso2.carbon.email.sender.core/src/main/java/org/wso2/carbon/email/sender/core/service/EmailSenderServiceImpl.java @@ -62,8 +62,8 @@ public class EmailSenderServiceImpl implements EmailSenderService { } private boolean isMailServerConfigured() { - if(EmailSenderDataHolder.getInstance().getConfigurationContextService() - .getServerConfigContext().getAxisConfiguration().getTransportOut(TRANSPORT_SENDER_NAME) != null) { + if(EmailSenderDataHolder.getInstance().getConfigurationContextService().getServerConfigContext(). + getAxisConfiguration().getTransportOut(TRANSPORT_SENDER_NAME) != null) { return true; } else { return false; @@ -141,7 +141,5 @@ public class EmailSenderServiceImpl implements EmailSenderService { "'", e); } } - } - -} +} \ No newline at end of file