Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app-stream-api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>open-app-stream-client</artifactId>
<groupId>com.dingtalk.open</groupId>
<version>1.3.0</version>
<version>1.3.1</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import com.dingtalk.open.app.api.DingTalkAppError;
import com.dingtalk.open.app.api.OpenDingTalkAppException;
import com.dingtalk.open.app.api.util.JavaVersionUtil;

import java.lang.invoke.SerializedLambda;
import java.lang.reflect.Method;
Expand All @@ -18,7 +19,9 @@
* @date 2023/3/19
*/
public class LambdaUtils {
private static final Pattern LAMBDA_PATTERN = Pattern.compile(".*\\$\\$Lambda\\$[0-9]+/.*");
private static final Pattern LAMBDA_PATTERN_JDK8_20 = Pattern.compile(".*\\$\\$Lambda\\$[0-9]+/.*");

private static final Pattern LAMBDA_PATTERN_JDK_21 = Pattern.compile(".*\\$\\$Lambda/.*");

private static final Pattern PARAMETER_TYPE_PATTERN = Pattern.compile("\\((.*)\\).*");

Expand All @@ -28,9 +31,12 @@ public static boolean isLambda(Object obj) {
if (obj == null) {
return false;
}

if (obj.getClass().isSynthetic() && LAMBDA_PATTERN.matcher(obj.getClass().getSimpleName()).matches()) {
return true;
if (obj.getClass().isSynthetic()) {
if (JavaVersionUtil.getMainVersion() < 21) {
return LAMBDA_PATTERN_JDK8_20.matcher(obj.getClass().getSimpleName()).matches();
} else {
return LAMBDA_PATTERN_JDK_21.matcher(obj.getClass().getSimpleName()).matches();
}
}
return false;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package com.dingtalk.open.app.api.util;

/**
* @author feiyin
* @date 2024/3/15
*/
public class JavaVersionUtil {


public static Integer getMainVersion() {
String getVersion = System.getProperty("java.version");
String[] version = getVersion.split("\\.");
if (version[0].equalsIgnoreCase("1")) {
return Integer.parseInt(version[1]);
} else {
return Integer.parseInt(version[0]);
}
}
}
4 changes: 2 additions & 2 deletions app-stream-client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
<parent>
<groupId>com.dingtalk.open</groupId>
<artifactId>open-app-stream-client</artifactId>
<version>1.3.0</version>
<version>1.3.1</version>
<relativePath>../pom.xml</relativePath>
</parent>

<artifactId>app-stream-client</artifactId>
<packaging>jar</packaging>
<version>1.3.0</version>
<version>1.3.1</version>
<name>app-stream-client</name>

<dependencies>
Expand Down
4 changes: 2 additions & 2 deletions app-stream-network/app-stream-network-api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
<parent>
<groupId>com.dingtalk.open</groupId>
<artifactId>app-stream-network</artifactId>
<version>1.3.0</version>
<version>1.3.1</version>
<relativePath>../pom.xml</relativePath>
</parent>

<artifactId>app-stream-network-api</artifactId>
<version>1.3.0</version>
<version>1.3.1</version>
<packaging>jar</packaging>

<name>app-stream-network-api</name>
Expand Down
2 changes: 1 addition & 1 deletion app-stream-network/app-stream-network-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>com.dingtalk.open</groupId>
<artifactId>app-stream-network</artifactId>
<version>1.3.0</version>
<version>1.3.1</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion app-stream-network/app-stream-network-rsocket/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>com.dingtalk.open</groupId>
<artifactId>app-stream-network</artifactId>
<version>1.3.0</version>
<version>1.3.1</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion app-stream-network/app-stream-network-ws/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>com.dingtalk.open</groupId>
<artifactId>app-stream-network</artifactId>
<version>1.3.0</version>
<version>1.3.1</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion app-stream-network/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>open-app-stream-client</artifactId>
<groupId>com.dingtalk.open</groupId>
<version>1.3.0</version>
<version>1.3.1</version>
<relativePath>../pom.xml</relativePath>
</parent>
<packaging>pom</packaging>
Expand Down
2 changes: 1 addition & 1 deletion app-stream-protocol/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>com.dingtalk.open</groupId>
<artifactId>open-app-stream-client</artifactId>
<version>1.3.0</version>
<version>1.3.1</version>
</parent>

<artifactId>app-stream-protocol</artifactId>
Expand Down
4 changes: 2 additions & 2 deletions dingtalk-stream/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
<parent>
<groupId>com.dingtalk.open</groupId>
<artifactId>open-app-stream-client</artifactId>
<version>1.3.0</version>
<version>1.3.1</version>
<relativePath>../pom.xml</relativePath>
</parent>

<artifactId>dingtalk-stream</artifactId>
<packaging>jar</packaging>
<version>1.3.0</version>
<version>1.3.1</version>
<name>app-stream-client</name>

<dependencies>
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<groupId>com.dingtalk.open</groupId>
<artifactId>open-app-stream-client</artifactId>
<packaging>pom</packaging>
<version>1.3.0</version>
<version>1.3.1</version>
<modules>
<module>app-stream-client</module>
<module>app-stream-api</module>
Expand Down
2 changes: 1 addition & 1 deletion version.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/usr/bin/env bash

mvn versions:set -DnewVersion=1.3.0
mvn versions:set -DnewVersion=1.3.1