Skip to content

Commit

Permalink
reactor: refactor the code that does not comply with license requirem…
Browse files Browse the repository at this point in the history
…ents (#7155)
  • Loading branch information
slievrly authored Feb 11, 2025
1 parent 70dd0e7 commit d2f3554
Show file tree
Hide file tree
Showing 7 changed files with 59 additions and 21 deletions.
10 changes: 9 additions & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down Expand Up @@ -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.
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.
10 changes: 10 additions & 0 deletions NOTICE
Original file line number Diff line number Diff line change
Expand Up @@ -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.
5 changes: 5 additions & 0 deletions changes/en-us/2.3.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,15 @@ The version is updated as follows:
- [[#7051](https://github.com/apache/incubator-seata/pull/7051)] add namingserver jib
- [[#7054](https://github.com/apache/incubator-seata/pull/7054)] In file mode when the lock cannot be acquired output
the holder's xid
- [[#7154](https://github.com/apache/incubator-seata/pull/7154)] remove unused dependencies
- [[#7153](https://github.com/apache/incubator-seata/pull/7153)] upgrade tomcat-embed to 9.0.98
- [[#7152](https://github.com/apache/incubator-seata/pull/7152)] remove org.eclipse.jetty dependency
- [[#7151](https://github.com/apache/incubator-seata/pull/7151)] upgrade xstream to 1.4.21

### refactor:

- [[#7017](https://github.com/apache/incubator-seata/pull/7017)] remove dependency on seata-server module
- [[#7155](https://github.com/apache/incubator-seata/pull/7155)] refactor the code that does not comply with license requirements

### test:

Expand Down
6 changes: 6 additions & 0 deletions changes/zh-cn/2.3.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,15 @@ Apache Seata(incubating) 是一款开源的分布式事务解决方案,提供
- [[#7043](https://github.com/apache/incubator-seata/pull/7043)] 在获取不到mq的sendResult时,直接完成回滚
- [[#7051](https://github.com/apache/incubator-seata/pull/7051)] 为namingserver模块添加Jib支持以构建Docker镜像
- [[#7054](https://github.com/apache/incubator-seata/pull/7054)] file模式中竞争不到锁时输出持有者的xid
- [[#7154](https://github.com/apache/incubator-seata/pull/7154)] 移除未使用的依赖
- [[#7153](https://github.com/apache/incubator-seata/pull/7153)] 升级 tomcat-embed 版本至 9.0.98
- [[#7152](https://github.com/apache/incubator-seata/pull/7152)] 移除 org.eclipse.jetty 依赖
- [[#7151](https://github.com/apache/incubator-seata/pull/7151)] 升级 xstream 版本至 1.4.21

### refactor:

- [[#7017](https://github.com/apache/incubator-seata/pull/7017)] 移除 seata-server 模块的依赖
- [[#7155](https://github.com/apache/incubator-seata/pull/7155)] 重构不满足 license 要求的代码

### test:

Expand Down Expand Up @@ -117,5 +122,6 @@ Apache Seata(incubating) 是一款开源的分布式事务解决方案,提供
- [Muluo-cyan](https://github.com/Muluo-cyan)
- [yixia](https://github.com/wt-better)
- [ChinaJeckXu](https://github.com/ChinaJeckXu)
- [YongGoose](https://github.com/YongGoose)

同时,我们收到了社区反馈的很多有价值的issue和建议,非常感谢大家。
30 changes: 16 additions & 14 deletions saga/seata-saga-statemachine-designer/src/render/PathMap.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,25 @@

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();
}

}
2 changes: 1 addition & 1 deletion server/src/main/resources/logback-spring.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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"/>
Expand Down

0 comments on commit d2f3554

Please sign in to comment.