Repository: stratos Updated Branches: refs/heads/master ad2e7d531 -> 6e4f6e572
Fixing formatting issues Project: http://git-wip-us.apache.org/repos/asf/stratos/repo Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/b8b1c9c1 Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/b8b1c9c1 Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/b8b1c9c1 Branch: refs/heads/master Commit: b8b1c9c13696d1b8164cb4b20bff806743e599be Parents: 2ac3e68 Author: anuruddhal <[email protected]> Authored: Tue Jul 28 10:35:57 2015 +0530 Committer: anuruddhal <[email protected]> Committed: Tue Jul 28 10:35:57 2015 +0530 ---------------------------------------------------------------------- .../stratos/rest/endpoint/api/StratosApiV41Utils.java | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/stratos/blob/b8b1c9c1/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/api/StratosApiV41Utils.java ---------------------------------------------------------------------- diff --git a/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/api/StratosApiV41Utils.java b/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/api/StratosApiV41Utils.java index 3ce9554..0f84026 100644 --- a/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/api/StratosApiV41Utils.java +++ b/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/api/StratosApiV41Utils.java @@ -148,11 +148,11 @@ public class StratosApiV41Utils { cartridgeBean.getType())); } } catch (CloudControllerServiceCartridgeAlreadyExistsExceptionException e) { - String msg = "Could not add cartridge"; + String msg = "Could not add cartridge. Cartridge already exists."; log.error(msg, e); throw new RestAPIException(msg); } catch (CloudControllerServiceInvalidCartridgeDefinitionExceptionException e) { - String msg = "Could not add cartridge"; + String msg = "Could not add cartridge. Invalid cartridge definition"; log.error(msg, e); throw new RestAPIException(msg); } catch (RemoteException e) { @@ -160,7 +160,7 @@ public class StratosApiV41Utils { log.error(msg, e); throw new RestAPIException(msg); } catch (CloudControllerServiceInvalidIaasProviderExceptionException e) { - String msg = "Could not add cartridge"; + String msg = "Could not add cartridge. Invalid IaaS provider "; log.error(msg, e); throw new RestAPIException(msg); } @@ -1912,7 +1912,7 @@ public class StratosApiV41Utils { ApplicationManager.acquireReadLockForApplication(applicationId); Application application = ApplicationManager.getApplications(). getApplication(applicationId); - if(application != null) { + if (application != null) { if (application.getInstanceContextCount() > 0 || (applicationContext != null && applicationContext.getStatus().equals("Deployed"))) { @@ -2993,6 +2993,7 @@ public class StratosApiV41Utils { try { CommonUtil.validateEmail(tenantInfoBean.getEmail()); } catch (Exception e) { + // validate Email methods throws exception therefore we catch and throw InvalidEmailException throw new InvalidEmailException(e.getMessage()); } @@ -3179,7 +3180,7 @@ public class StratosApiV41Utils { } boolean updatePassword = false; - if (tenantInfoBean.getAdminPassword() != null && !tenantInfoBean.getAdminPassword().equals("")) { + if (tenantInfoBean.getAdminPassword() != null && StringUtils.isNotEmpty(tenantInfoBean.getAdminPassword())) { updatePassword = true; } try { @@ -3197,7 +3198,7 @@ public class StratosApiV41Utils { } } else { //Password should be empty since no password update done - tenantInfoBean.setAdminPassword(""); + tenantInfoBean.setAdminPassword(null); } } catch (UserStoreException e) { String msg = "Error in getting the user store manager is read only " + e.getLocalizedMessage();
