Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bugfix: support jdk9+ compile code #4410

Merged
merged 10 commits into from
Nov 27, 2023
Merged

Conversation

funky-eyes
Copy link
Contributor

@funky-eyes funky-eyes commented Feb 26, 2022

  • I have registered the PR changes.

Ⅰ. Describe what this PR did

使用jdk9及以上版本编译seata源码后在jdk8中进行引入,再默认序列化下,会出现
java.lang.NoSuchMethodError: java.nio.ByteBuffer.flip()Ljava/nio/ByteBuffer)
需要将ByteBuffer转换为Buffer再调用相关函数

Ⅱ. Does this pull request fix one issue?

fixes #1410 #2223

Ⅲ. Why don't you add test cases (unit test/integration test)?

Ⅳ. Describe how to verify it

Ⅴ. Special notes for reviews

@funky-eyes funky-eyes added this to the 1.5.0 milestone Feb 26, 2022
@funky-eyes funky-eyes added type: bug Category issues or prs related to bug. module/integration integration module module/rm-datasource rm-datasource module module/serializer serializer module module/server server module labels Feb 26, 2022
@funky-eyes funky-eyes removed this from the 1.5.0 milestone Feb 26, 2022
@codecov-commenter
Copy link

codecov-commenter commented Feb 26, 2022

Codecov Report

Merging #4410 (aa46535) into develop (c0c8725) will decrease coverage by 0.03%.
The diff coverage is 42.30%.

Additional details and impacted files

Impacted file tree graph

@@              Coverage Diff              @@
##             develop    #4410      +/-   ##
=============================================
- Coverage      48.86%   48.84%   -0.03%     
- Complexity      4182     4183       +1     
=============================================
  Files            793      794       +1     
  Lines          28039    28054      +15     
  Branches        3426     3426              
=============================================
+ Hits           13701    13702       +1     
- Misses         12901    12911      +10     
- Partials        1437     1441       +4     
Files Coverage Δ
...atasource/undo/parser/ProtostuffUndoLogParser.java 55.71% <100.00%> (ø)
...ava/io/seata/serializer/seata/SeataSerializer.java 80.00% <100.00%> (ø)
...in/java/io/seata/server/session/BranchSession.java 78.57% <100.00%> (ø)
...in/java/io/seata/server/session/GlobalSession.java 83.01% <100.00%> (ø)
...torage/file/store/FileTransactionStoreManager.java 55.62% <100.00%> (-0.65%) ⬇️
.../seata/serializer/protobuf/ProtobufSerializer.java 0.00% <0.00%> (ø)
...rc/main/java/io/seata/common/util/BufferUtils.java 0.00% <0.00%> (ø)

... and 2 files with indirect coverage changes

Copy link
Member

@slievrly slievrly left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No problem on implementation function, but why not consider using instance classes to wrap it.

@funky-eyes
Copy link
Contributor Author

No problem on implementation function, but why not consider using instance classes to wrap it.

包装类改动的代码范围会比较广,工具类相对比较通用
wrapper class changes the scope of the code will be broader, tool class is relatively general

@funky-eyes funky-eyes added this to the 2.0.0 milestone Mar 12, 2022
@CLAassistant
Copy link

CLAassistant commented Dec 12, 2022

CLA assistant check
All committers have signed the CLA.

@funky-eyes funky-eyes modified the milestones: 2.0.0, 1.7.0 Mar 30, 2023
@funky-eyes
Copy link
Contributor Author

@slievrly @wangliang181230 PTAL

@funky-eyes funky-eyes requested a review from slievrly March 31, 2023 16:07
@slievrly slievrly removed this from the 1.7.0 milestone Jun 28, 2023
@funky-eyes funky-eyes modified the milestone: 2.0.0 Nov 3, 2023
Copy link
Contributor

@lightClouds917 lightClouds917 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@wangliang181230 wangliang181230 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

* @param buffer byteBuffer
*/
public static void flip(Buffer buffer) {
buffer.flip();
Copy link
Contributor

@wangliang181230 wangliang181230 Nov 27, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

返回类型,是不是应该return一下?没准其他哪里会用到。
下面的方法也看一下吧。

@funky-eyes funky-eyes added this to the 1.8.1 milestone Nov 27, 2023
@funky-eyes funky-eyes merged commit 0710c64 into apache:develop Nov 27, 2023
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
module/integration integration module module/rm-datasource rm-datasource module module/serializer serializer module module/server server module type: bug Category issues or prs related to bug.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Seata Support jdk > 1.8
6 participants