svn commit: r1859081 - /ofbiz/ofbiz-framework/trunk/framework/base/src/main/java/org/apache/ofbiz/base/util/UtilCodec.java

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

svn commit: r1859081 - /ofbiz/ofbiz-framework/trunk/framework/base/src/main/java/org/apache/ofbiz/base/util/UtilCodec.java

mthl
Author: mthl
Date: Fri May 10 14:13:34 2019
New Revision: 1859081

URL: http://svn.apache.org/viewvc?rev=1859081&view=rev
Log:
Improved: Remove useless null check
(OFBIZ-10054)

Additionally the noisy ‘final’ modifiers on local variables have been
removed because local variables should be final by default and mutable
by exception.

Modified:
    ofbiz/ofbiz-framework/trunk/framework/base/src/main/java/org/apache/ofbiz/base/util/UtilCodec.java

Modified: ofbiz/ofbiz-framework/trunk/framework/base/src/main/java/org/apache/ofbiz/base/util/UtilCodec.java
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/framework/base/src/main/java/org/apache/ofbiz/base/util/UtilCodec.java?rev=1859081&r1=1859080&r2=1859081&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/framework/base/src/main/java/org/apache/ofbiz/base/util/UtilCodec.java (original)
+++ ofbiz/ofbiz-framework/trunk/framework/base/src/main/java/org/apache/ofbiz/base/util/UtilCodec.java Fri May 10 14:13:34 2019
@@ -396,12 +396,10 @@ public class UtilCodec {
         }
         
         // check for js events
-        final String onEvent = "on" + StringUtils.substringBetween(value, " on", "=");
-        final boolean seekSegmentTime = value.contains("seekSegmentTime");
-        if (null != onEvent || seekSegmentTime) {
-            if (jsEventList.stream().anyMatch(str -> StringUtils.containsIgnoreCase(str, onEvent)) || seekSegmentTime) {
-                errorMessageList.add("In field [" + valueName + "] js events are not allowed.");
-            }
+        String onEvent = "on" + StringUtils.substringBetween(value, " on", "=");
+        boolean seekSegmentTime = value.contains("seekSegmentTime");
+        if (jsEventList.stream().anyMatch(str -> StringUtils.containsIgnoreCase(str, onEvent)) || seekSegmentTime) {
+            errorMessageList.add("In field [" + valueName + "] js events are not allowed.");
         }
 
         // TODO: anything else to check for that can be used to get HTML or JavaScript going without these characters?