File tree Expand file tree Collapse file tree 13 files changed +43
-18
lines changed
src/main/java/com/dingtalk/open/app/api
app-stream-network-rsocket Expand file tree Collapse file tree 13 files changed +43
-18
lines changed Original file line number Diff line number Diff line change 55 <parent >
66 <artifactId >open-app-stream-client</artifactId >
77 <groupId >com.dingtalk.open</groupId >
8- <version >1.3.0 </version >
8+ <version >1.3.1 </version >
99 <relativePath >../pom.xml</relativePath >
1010 </parent >
1111 <modelVersion >4.0.0</modelVersion >
Original file line number Diff line number Diff line change 22
33import com .dingtalk .open .app .api .DingTalkAppError ;
44import com .dingtalk .open .app .api .OpenDingTalkAppException ;
5+ import com .dingtalk .open .app .api .util .JavaVersionUtil ;
56
67import java .lang .invoke .SerializedLambda ;
78import java .lang .reflect .Method ;
1819 * @date 2023/3/19
1920 */
2021public class LambdaUtils {
21- private static final Pattern LAMBDA_PATTERN = Pattern .compile (".*\\ $\\ $Lambda\\ $[0-9]+/.*" );
22+ private static final Pattern LAMBDA_PATTERN_JDK8_20 = Pattern .compile (".*\\ $\\ $Lambda\\ $[0-9]+/.*" );
23+
24+ private static final Pattern LAMBDA_PATTERN_JDK_21 = Pattern .compile (".*\\ $\\ $Lambda/.*" );
2225
2326 private static final Pattern PARAMETER_TYPE_PATTERN = Pattern .compile ("\\ ((.*)\\ ).*" );
2427
@@ -28,9 +31,12 @@ public static boolean isLambda(Object obj) {
2831 if (obj == null ) {
2932 return false ;
3033 }
31-
32- if (obj .getClass ().isSynthetic () && LAMBDA_PATTERN .matcher (obj .getClass ().getSimpleName ()).matches ()) {
33- return true ;
34+ if (obj .getClass ().isSynthetic ()) {
35+ if (JavaVersionUtil .getMainVersion () < 21 ) {
36+ return LAMBDA_PATTERN_JDK8_20 .matcher (obj .getClass ().getSimpleName ()).matches ();
37+ } else {
38+ return LAMBDA_PATTERN_JDK_21 .matcher (obj .getClass ().getSimpleName ()).matches ();
39+ }
3440 }
3541 return false ;
3642 }
Original file line number Diff line number Diff line change 1+ package com .dingtalk .open .app .api .util ;
2+
3+ /**
4+ * @author feiyin
5+ * @date 2024/3/15
6+ */
7+ public class JavaVersionUtil {
8+
9+
10+ public static Integer getMainVersion () {
11+ String getVersion = System .getProperty ("java.version" );
12+ String [] version = getVersion .split ("\\ ." );
13+ if (version [0 ].equalsIgnoreCase ("1" )) {
14+ return Integer .parseInt (version [1 ]);
15+ } else {
16+ return Integer .parseInt (version [0 ]);
17+ }
18+ }
19+ }
Original file line number Diff line number Diff line change 44 <parent >
55 <groupId >com.dingtalk.open</groupId >
66 <artifactId >open-app-stream-client</artifactId >
7- <version >1.3.0 </version >
7+ <version >1.3.1 </version >
88 <relativePath >../pom.xml</relativePath >
99 </parent >
1010
1111 <artifactId >app-stream-client</artifactId >
1212 <packaging >jar</packaging >
13- <version >1.3.0 </version >
13+ <version >1.3.1 </version >
1414 <name >app-stream-client</name >
1515
1616 <dependencies >
Original file line number Diff line number Diff line change 44 <parent >
55 <groupId >com.dingtalk.open</groupId >
66 <artifactId >app-stream-network</artifactId >
7- <version >1.3.0 </version >
7+ <version >1.3.1 </version >
88 <relativePath >../pom.xml</relativePath >
99 </parent >
1010
1111 <artifactId >app-stream-network-api</artifactId >
12- <version >1.3.0 </version >
12+ <version >1.3.1 </version >
1313 <packaging >jar</packaging >
1414
1515 <name >app-stream-network-api</name >
Original file line number Diff line number Diff line change 44 <parent >
55 <groupId >com.dingtalk.open</groupId >
66 <artifactId >app-stream-network</artifactId >
7- <version >1.3.0 </version >
7+ <version >1.3.1 </version >
88 <relativePath >../pom.xml</relativePath >
99 </parent >
1010
Original file line number Diff line number Diff line change 44 <parent >
55 <groupId >com.dingtalk.open</groupId >
66 <artifactId >app-stream-network</artifactId >
7- <version >1.3.0 </version >
7+ <version >1.3.1 </version >
88 <relativePath >../pom.xml</relativePath >
99 </parent >
1010
Original file line number Diff line number Diff line change 44 <parent >
55 <groupId >com.dingtalk.open</groupId >
66 <artifactId >app-stream-network</artifactId >
7- <version >1.3.0 </version >
7+ <version >1.3.1 </version >
88 <relativePath >../pom.xml</relativePath >
99 </parent >
1010
Original file line number Diff line number Diff line change 55 <parent >
66 <artifactId >open-app-stream-client</artifactId >
77 <groupId >com.dingtalk.open</groupId >
8- <version >1.3.0 </version >
8+ <version >1.3.1 </version >
99 <relativePath >../pom.xml</relativePath >
1010 </parent >
1111 <packaging >pom</packaging >
Original file line number Diff line number Diff line change 66 <parent >
77 <groupId >com.dingtalk.open</groupId >
88 <artifactId >open-app-stream-client</artifactId >
9- <version >1.3.0 </version >
9+ <version >1.3.1 </version >
1010 </parent >
1111
1212 <artifactId >app-stream-protocol</artifactId >
You can’t perform that action at this time.
0 commit comments