This is an automated email from the ASF dual-hosted git repository.
mbrohl pushed a commit to branch trunk in repository https://gitbox.apache.org/repos/asf/ofbiz-framework.git The following commit(s) were added to refs/heads/trunk by this push: new 5a0b0a0 Fixed: Checkstyle Issues in WebToolsDbEvents and UtilXml (OFBIZ-6510) 5a0b0a0 is described below commit 5a0b0a0c0d78467f7d140311846106bd6be6aace Author: Benjamin Jugl <[hidden email]> AuthorDate: Thu Feb 4 12:20:02 2021 +0100 Fixed: Checkstyle Issues in WebToolsDbEvents and UtilXml (OFBIZ-6510) --- .../src/main/java/org/apache/ofbiz/base/util/UtilXml.java | 13 ++++++++----- .../java/org/apache/ofbiz/webtools/WebToolsDbEvents.java | 14 +++++++------- 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/framework/base/src/main/java/org/apache/ofbiz/base/util/UtilXml.java b/framework/base/src/main/java/org/apache/ofbiz/base/util/UtilXml.java index fbeee88..fb00c54 100644 --- a/framework/base/src/main/java/org/apache/ofbiz/base/util/UtilXml.java +++ b/framework/base/src/main/java/org/apache/ofbiz/base/util/UtilXml.java @@ -1218,8 +1218,10 @@ public final class UtilXml { /** * get attribute value ignoring prefix in attribute name + * * @param element - * @return The value of the node, depending on its type; see the table Node class + * @return The value of the node, depending on its type; see the table Node + * class */ public static String getAttributeValueIgnorePrefix(Element element, String attributeName) { if (element == null) { @@ -1240,7 +1242,7 @@ public final class UtilXml { } return ""; } - + public static String convertDocumentToXmlString(Document document) { TransformerFactory tf = TransformerFactory.newInstance(); Transformer transformer; @@ -1259,15 +1261,16 @@ public final class UtilXml { return null; } + /** * Returns an ASF Licence Header as a Comment Element - * + * * @param document * @return */ public static Comment createApacheLicenceComment(Document document) { String lb = "\n"; - + StringBuilder disclaimer = new StringBuilder(); disclaimer.append("Licensed to the Apache Software Foundation (ASF) under one"); disclaimer.append(lb); @@ -1299,7 +1302,7 @@ public final class UtilXml { disclaimer.append(lb); disclaimer.append("under the License."); disclaimer.append(lb); - + return document.createComment(disclaimer.toString()); } } diff --git a/framework/webtools/src/main/java/org/apache/ofbiz/webtools/WebToolsDbEvents.java b/framework/webtools/src/main/java/org/apache/ofbiz/webtools/WebToolsDbEvents.java index 8411100..dcf92d1 100644 --- a/framework/webtools/src/main/java/org/apache/ofbiz/webtools/WebToolsDbEvents.java +++ b/framework/webtools/src/main/java/org/apache/ofbiz/webtools/WebToolsDbEvents.java @@ -40,8 +40,8 @@ import org.w3c.dom.Document; import org.w3c.dom.Element; public class WebToolsDbEvents { - private static final String module = WebToolsDbEvents.class.getName(); - public static final String resource = "WebtoolsUiLabels"; + private static final String MODULE = WebToolsDbEvents.class.getName(); + private static final String RESOURCE = "WebtoolsUiLabels"; private static Document document; private static final String TITLE = "Entities of an Apache Open For Business Project (Apache OFBiz) Component"; private static final String DESCRIPTION = "None"; @@ -54,7 +54,7 @@ public class WebToolsDbEvents { private static final String DEFAULTS = "======================== Defaults ======================="; private static final String HEADER = "======================== Data Model ====================="; private static final String XMLN_NAME = "xmlns:xsi"; - private static final String XMLN_VALUE= "http://www.w3.org/2001/XMLSchema-instance"; + private static final String XMLN_VALUE = "http://www.w3.org/2001/XMLSchema-instance"; private static final String XSI_NAME = "xsi:noNamespaceSchemaLocation"; private static final String XSI_VALUE = "http://ofbiz.apache.org/dtds/entitymodel.xsd"; @@ -75,15 +75,15 @@ public class WebToolsDbEvents { String packageName = (String) params.get("packageName"); if (UtilValidate.isEmpty(induceType)) { - errorMessageList.add(UtilProperties.getMessage(resource, "ModelInduceInduceTypeError", locale)); + errorMessageList.add(UtilProperties.getMessage(RESOURCE, "ModelInduceInduceTypeError", locale)); } if (UtilValidate.isEmpty(datasourceName)) { - errorMessageList.add(UtilProperties.getMessage(resource, "ModelInduceDatasourceNameError", locale)); + errorMessageList.add(UtilProperties.getMessage(RESOURCE, "ModelInduceDatasourceNameError", locale)); } if ("entitygroup".equals(induceType) && UtilValidate.isEmpty(packageName)) { - errorMessageList.add(UtilProperties.getMessage(resource, "ModelInduceEntityGroupError", locale)); + errorMessageList.add(UtilProperties.getMessage(RESOURCE, "ModelInduceEntityGroupError", locale)); } if (UtilValidate.isNotEmpty(errorMessageList)) { @@ -123,7 +123,7 @@ public class WebToolsDbEvents { List<ModelEntity> newEntList = dao.induceModelFromDb(new ArrayList<String>()); if (UtilValidate.isEmpty(newEntList)) { request.setAttribute("errorMessageList", - UtilMisc.toList(UtilProperties.getMessage(resource, "ModelInduceDataStructureError", locale))); + UtilMisc.toList(UtilProperties.getMessage(RESOURCE, "ModelInduceDataStructureError", locale))); return "error"; } |
Free forum by Nabble | Edit this page |