Allon Mureinik has uploaded a new change for review. Change subject: core: Remove api's StrigUtils ......................................................................
core: Remove api's StrigUtils This patch removes the class org.ovirt.engine.api.common.util.StringUtils. It only had one method (isNullOrEmpty(String)), which was only used in two places. This method's body is completely identical to org.apache.commons.lang.StringUtils.isEmpty(String), so it could easily be replaced. Change-Id: Ia6f116f861975db24b710db457b40491908ff1d1 Signed-off-by: Allon Mureinik <[email protected]> --- M backend/manager/modules/restapi/interface/common/jaxrs/src/main/java/org/ovirt/engine/api/common/util/StatusUtils.java D backend/manager/modules/restapi/interface/common/jaxrs/src/main/java/org/ovirt/engine/api/common/util/StringUtils.java M backend/manager/modules/restapi/types/src/main/java/org/ovirt/engine/api/restapi/types/DataCenterMapper.java 3 files changed, 5 insertions(+), 29 deletions(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/83/13483/1 diff --git a/backend/manager/modules/restapi/interface/common/jaxrs/src/main/java/org/ovirt/engine/api/common/util/StatusUtils.java b/backend/manager/modules/restapi/interface/common/jaxrs/src/main/java/org/ovirt/engine/api/common/util/StatusUtils.java index 03f1401..3dea7f5 100644 --- a/backend/manager/modules/restapi/interface/common/jaxrs/src/main/java/org/ovirt/engine/api/common/util/StatusUtils.java +++ b/backend/manager/modules/restapi/interface/common/jaxrs/src/main/java/org/ovirt/engine/api/common/util/StatusUtils.java @@ -16,13 +16,14 @@ package org.ovirt.engine.api.common.util; +import org.apache.commons.lang.StringUtils; import org.ovirt.engine.api.model.CreationStatus; import org.ovirt.engine.api.model.Status; public class StatusUtils { public static Status create(String statusStr) { - if (StringUtils.isNullOrEmpty(statusStr)) { + if (StringUtils.isEmpty(statusStr)) { return null; } else { Status status = new Status(); diff --git a/backend/manager/modules/restapi/interface/common/jaxrs/src/main/java/org/ovirt/engine/api/common/util/StringUtils.java b/backend/manager/modules/restapi/interface/common/jaxrs/src/main/java/org/ovirt/engine/api/common/util/StringUtils.java deleted file mode 100644 index fb46124..0000000 --- a/backend/manager/modules/restapi/interface/common/jaxrs/src/main/java/org/ovirt/engine/api/common/util/StringUtils.java +++ /dev/null @@ -1,25 +0,0 @@ -/* -* Copyright (c) 2010 Red Hat, Inc. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -package org.ovirt.engine.api.common.util; - -public class StringUtils { - - public static boolean isNullOrEmpty(String string) { - return string == null || string.isEmpty(); - } - -} diff --git a/backend/manager/modules/restapi/types/src/main/java/org/ovirt/engine/api/restapi/types/DataCenterMapper.java b/backend/manager/modules/restapi/types/src/main/java/org/ovirt/engine/api/restapi/types/DataCenterMapper.java index 2b88552..f952035 100644 --- a/backend/manager/modules/restapi/types/src/main/java/org/ovirt/engine/api/restapi/types/DataCenterMapper.java +++ b/backend/manager/modules/restapi/types/src/main/java/org/ovirt/engine/api/restapi/types/DataCenterMapper.java @@ -1,12 +1,12 @@ package org.ovirt.engine.api.restapi.types; +import org.apache.commons.lang.StringUtils; import org.ovirt.engine.api.common.util.StatusUtils; -import org.ovirt.engine.api.common.util.StringUtils; import org.ovirt.engine.api.model.DataCenter; import org.ovirt.engine.api.model.DataCenterStatus; -import org.ovirt.engine.api.restapi.model.StorageFormat; import org.ovirt.engine.api.model.StorageType; import org.ovirt.engine.api.model.Version; +import org.ovirt.engine.api.restapi.model.StorageFormat; import org.ovirt.engine.api.restapi.utils.GuidUtils; import org.ovirt.engine.core.common.businessentities.StoragePoolStatus; import org.ovirt.engine.core.common.businessentities.storage_pool; @@ -49,7 +49,7 @@ DataCenter model = template != null ? template : new DataCenter(); model.setId(entity.getId().toString()); model.setName(entity.getname()); - if (!StringUtils.isNullOrEmpty(entity.getdescription())) { + if (!StringUtils.isEmpty(entity.getdescription())) { model.setDescription(entity.getdescription()); } model.setStorageType(StorageDomainMapper.map(entity.getstorage_pool_type(), null)); -- To view, visit http://gerrit.ovirt.org/13483 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ia6f116f861975db24b710db457b40491908ff1d1 Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Allon Mureinik <[email protected]> _______________________________________________ Engine-patches mailing list [email protected] http://lists.ovirt.org/mailman/listinfo/engine-patches
