[ofbiz-framework] branch trunk updated: Improved: Checkstyle: Variable name must match pattern (OFBIZ-11926)

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[ofbiz-framework] branch trunk updated: Improved: Checkstyle: Variable name must match pattern (OFBIZ-11926)

jleroux@apache.org
This is an automated email from the ASF dual-hosted git repository.

jleroux 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 0fe413b  Improved: Checkstyle: Variable name must match pattern (OFBIZ-11926)
0fe413b is described below

commit 0fe413b3fb8cd51657c9f4104d258846c8ac4aa4
Author: Jacques Le Roux <[hidden email]>
AuthorDate: Fri Aug 28 17:45:08 2020 +0200

    Improved: Checkstyle: Variable name must match pattern (OFBIZ-11926)
   
    Prevents false warnings like reported at https://s.apache.org/o7tmu
---
 build.gradle                                                       | 2 +-
 .../src/main/java/org/apache/ofbiz/minilang/SimpleMethod.java      | 7 +++++--
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/build.gradle b/build.gradle
index 0a20425..becca23 100644
--- a/build.gradle
+++ b/build.gradle
@@ -288,7 +288,7 @@ checkstyle {
     // the sum of errors found last time it was changed after using the
     // ‘checkstyle’ tool present in the framework and in the official
     // plugins.
-    tasks.checkstyleMain.maxErrors = 3026
+    tasks.checkstyleMain.maxErrors = 3027
     // Currently there are a lot of errors so we need to temporarily
     // hide them to avoid polluting the terminal output.
     showViolations = false
diff --git a/framework/minilang/src/main/java/org/apache/ofbiz/minilang/SimpleMethod.java b/framework/minilang/src/main/java/org/apache/ofbiz/minilang/SimpleMethod.java
index 7547644..8908ac6 100644
--- a/framework/minilang/src/main/java/org/apache/ofbiz/minilang/SimpleMethod.java
+++ b/framework/minilang/src/main/java/org/apache/ofbiz/minilang/SimpleMethod.java
@@ -301,8 +301,11 @@ public final class SimpleMethod extends MiniLangElement {
                 MethodOperation.Factory<MethodOperation> factory = METHOD_OPER_FACTORIES.get(nodeName);
                 if (factory != null) {
                     methodOp = factory.createMethodOperation(curOperElem, simpleMethod);
-                //} else if ("else".equals(nodeName)) {
-                    // don't add anything, but don't complain either, this one is handled in the individual operations
+                } else if ("else".equals(nodeName)) {
+                    // Prevents false warnings like reported at https://s.apache.org/o7tmu, eg:
+                    // MiniLangValidate|W| Invalid element found Method = facilityGenericPermission, File =
+                    // file:/C:/projectsASF/Git/ofbiz-framework/applications/product/minilang/product/inventory/InventoryServices.xml,
+                    // Element = <else>, Line 71
                 } else {
                     MiniLangValidate.handleError("Invalid element found", simpleMethod, curOperElem);
                 }