This is an automated email from the ASF dual-hosted git repository.

jimin pushed a commit to branch 2.x
in repository https://gitbox.apache.org/repos/asf/incubator-seata.git


The following commit(s) were added to refs/heads/2.x by this push:
     new a676d6c91c reactor: refactor the code that does not comply with 
license requirements (#7145)
a676d6c91c is described below

commit a676d6c91c0748d6c4f6790e1515b46d69f9aa52
Author: jimin <sliev...@163.com>
AuthorDate: Tue Mar 18 12:04:52 2025 +0800

    reactor: refactor the code that does not comply with license requirements 
(#7145)
---
 LICENSE                                            | 10 +++++++-
 NOTICE                                             | 10 ++++++++
 changes/en-us/2.x.md                               |  4 ++-
 changes/zh-cn/2.x.md                               |  2 +-
 .../src/render/PathMap.js                          | 30 ++++++++++++----------
 ...a => ExtendedArrowThrowableProxyConverter.java} | 17 ++++++++----
 server/src/main/resources/logback-spring.xml       |  2 +-
 7 files changed, 52 insertions(+), 23 deletions(-)

diff --git a/LICENSE b/LICENSE
index 74bd0cb486..329c856703 100644
--- a/LICENSE
+++ b/LICENSE
@@ -208,6 +208,9 @@
    subcomponents is subject to the terms and conditions of the following
    licenses.
 
+   ========================================================================
+    MIT licenses
+   ========================================================================
    For the org.apache.seata.sqlparser.antlr.mysql.antlr.MySqlLexer.g4 and
    org.apache.seata.sqlparser.antlr.mysql.antlr.MySqlParser.g4:
 
@@ -235,4 +238,9 @@
       AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
       LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 
FROM,
       OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-      THE SOFTWARE.
\ No newline at end of file
+      THE SOFTWARE.
+
+   ========================================================================
+    Apache 2.0 licenses
+   ========================================================================
+   For the mvnw and mvnw.cmd files, they are copied from 
https://github.com/apache/maven-wrapper. The code is licensed under an Apache 
2.0 License.
\ No newline at end of file
diff --git a/NOTICE b/NOTICE
index f06b711f2d..2dabb9df61 100644
--- a/NOTICE
+++ b/NOTICE
@@ -3,3 +3,13 @@ Copyright 2023-2024 The Apache Software Foundation
 
 This product includes software developed at
 The Apache Software Foundation (http://www.apache.org/).
+-----------------------------------------------------------------------
+Apache Maven Wrapper
+Copyright 2013-2022 The Apache Software Foundation
+
+This product includes software developed at
+The Apache Software Foundation (http://www.apache.org/).
+
+The original idea and initial implementation of the maven-wrapper module is 
derived
+from the Gradle Wrapper which was written originally by Hans Dockter and Adam 
Murdoch.
+Copyright 2007 the original author or authors.
\ No newline at end of file
diff --git a/changes/en-us/2.x.md b/changes/en-us/2.x.md
index f8cde14720..9f35dbc965 100644
--- a/changes/en-us/2.x.md
+++ b/changes/en-us/2.x.md
@@ -57,6 +57,8 @@ Add changes here for all PR submitted to the 2.x branch.
 - [[#7222](https://github.com/apache/incubator-seata/pull/7222)] in raft mode 
add the vgroup field to global lock
 
 
+
+
 ### security:
 - [[#6069](https://github.com/apache/incubator-seata/pull/6069)] Upgrade Guava 
dependencies to fix security vulnerabilities
 - [[#6145](https://github.com/apache/incubator-seata/pull/6145)] upgrade 
jettison to 1.5.4
@@ -81,7 +83,7 @@ Add changes here for all PR submitted to the 2.x branch.
 
 ### refactor:
 
-- [[#PR_NO](https://github.com/apache/incubator-seata/pull/PR_NO)] refactor XXX
+- [[#7145](https://github.com/apache/incubator-seata/pull/7145)] refactor the 
code that does not comply with license requirements
 
 
 ### doc:
diff --git a/changes/zh-cn/2.x.md b/changes/zh-cn/2.x.md
index bdfb2c0e67..69bdd24f8b 100644
--- a/changes/zh-cn/2.x.md
+++ b/changes/zh-cn/2.x.md
@@ -82,7 +82,7 @@
 
 ### refactor:
 
-- [[#PR_NO](https://github.com/apache/incubator-seata/pull/PR_NO)] 重构XXX
+- [[#7145](https://github.com/apache/incubator-seata/pull/7145)] 重构不满足 license 
要求的代码
 
 非常感谢以下 contributors 的代码贡献。若有无意遗漏,请报告。
 
diff --git a/saga/seata-saga-statemachine-designer/src/render/PathMap.js 
b/saga/seata-saga-statemachine-designer/src/render/PathMap.js
index 36ab8a13c2..b5ba96ca9c 100644
--- a/saga/seata-saga-statemachine-designer/src/render/PathMap.js
+++ b/saga/seata-saga-statemachine-designer/src/render/PathMap.js
@@ -19,26 +19,28 @@
 
 // helpers //////////////////////
 
-// copied and adjusted from 
https://github.com/adobe-webplatform/Snap.svg/blob/master/src/svg.js
+// Regular expression to match tokens in the format {tokenName}
 const tokenRegex = /\{([^{}]+)\}/g;
-const objNotationRegex = 
/(?:(?:^|\.)(.+?)(?=\[|\.|$|\()|\[('|")(.+?)\2\])(\(\))?/g; // matches .xxxxx 
or ["xxxxx"] to run over object properties
+// Regular expression to match object property access using dot notation or 
bracket notation
+// It captures properties accessed either directly (e.g., `obj.prop`)
+// or indirectly (e.g., `obj['prop']` or `obj[prop]`), as well as function 
calls (e.g., `obj.method()`)
+const objNotationRegex = 
/(?:(?:^|\.)(.+?)(?=\[|\.|$|\()|\[('|")(.+?)\2\])(\(\))?/g;
 
 function replacer(all, key, obj) {
-  let res = obj;
-  key.replace(objNotationRegex, (_, name, quote, quotedName, isFunc) => {
-    name = name || quotedName;
-    if (res) {
-      if (name in res) {
-        res = res[name];
-      }
-      if (typeof res === 'function' && isFunc) {
-        res = res();
+  let result = obj;
+  key.replace(objNotationRegex, (_, name, quote, quotedName, isFunction) => {
+    const propertyName = name || quotedName;
+    if (result && propertyName in result) {
+      result = result[propertyName];
+
+      // If the result is a function and is marked as a function, call it to 
get a "real" value
+      if (typeof result === 'function' && isFunction) {
+        result = result();
       }
     }
   });
-  res = `${res == null || res === obj ? all : res}`;
-
-  return res;
+  //Return the final alternative result, or all if result has not changed
+  return `${result == null || result === obj ? all : result}`;
 }
 
 function format(str, obj) {
diff --git 
a/server/src/main/java/org/apache/seata/server/logging/logback/ExtendedWhitespaceThrowableProxyConverter.java
 
b/server/src/main/java/org/apache/seata/server/logging/logback/ExtendedArrowThrowableProxyConverter.java
similarity index 67%
rename from 
server/src/main/java/org/apache/seata/server/logging/logback/ExtendedWhitespaceThrowableProxyConverter.java
rename to 
server/src/main/java/org/apache/seata/server/logging/logback/ExtendedArrowThrowableProxyConverter.java
index 5ea214e8b5..d6cbf70db9 100644
--- 
a/server/src/main/java/org/apache/seata/server/logging/logback/ExtendedWhitespaceThrowableProxyConverter.java
+++ 
b/server/src/main/java/org/apache/seata/server/logging/logback/ExtendedArrowThrowableProxyConverter.java
@@ -18,18 +18,25 @@ package org.apache.seata.server.logging.logback;
 
 import ch.qos.logback.classic.pattern.ExtendedThrowableProxyConverter;
 import ch.qos.logback.classic.spi.IThrowableProxy;
-import ch.qos.logback.core.CoreConstants;
 
 /**
  * {@link ExtendedThrowableProxyConverter} that adds some additional 
whitespace around the
  * stack trace.
- * Copied from spring-boot-xxx.jar by wang.liang
  */
-public class ExtendedWhitespaceThrowableProxyConverter extends 
ExtendedThrowableProxyConverter {
+public class ExtendedArrowThrowableProxyConverter extends 
ExtendedThrowableProxyConverter {
 
+    public static final String SEPARATOR = 
System.getProperty("line.separator");
+    public static final String START_ARROW = "==> ";
+    public static final String END_ARROW = " <==";
     @Override
     protected String throwableProxyToString(IThrowableProxy tp) {
-        return "==>" + CoreConstants.LINE_SEPARATOR + 
super.throwableProxyToString(tp)
-                + "<==" + CoreConstants.LINE_SEPARATOR + 
CoreConstants.LINE_SEPARATOR;
+        StringBuilder throwBuilder = new StringBuilder();
+        throwBuilder.append(START_ARROW)
+            .append(SEPARATOR)
+            .append(super.throwableProxyToString(tp))
+            .append(END_ARROW)
+            .append(SEPARATOR);
+        return throwBuilder.toString();
     }
+
 }
diff --git a/server/src/main/resources/logback-spring.xml 
b/server/src/main/resources/logback-spring.xml
index 9650c0b56e..07b344f845 100644
--- a/server/src/main/resources/logback-spring.xml
+++ b/server/src/main/resources/logback-spring.xml
@@ -26,7 +26,7 @@
     <conversionRule conversionWord="wex" 
converterClass="org.springframework.boot.logging.logback.WhitespaceThrowableProxyConverter"
 />
     <conversionRule conversionWord="wEx" 
converterClass="org.springframework.boot.logging.logback.ExtendedWhitespaceThrowableProxyConverter"
 />
     <!-- The custom conversion rules -->
-    <conversionRule conversionWord="wEx2" 
converterClass="org.apache.seata.server.logging.logback.ExtendedWhitespaceThrowableProxyConverter"/>
+    <conversionRule conversionWord="wEx2" 
converterClass="org.apache.seata.server.logging.logback.ExtendedArrowThrowableProxyConverter"/>
 
     <!-- common properties -->
     <springProperty name="PORT" source="server.port" defaultValue="7091"/>


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscr...@seata.apache.org
For additional commands, e-mail: notifications-h...@seata.apache.org

Reply via email to