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

Update Serialization.kt with auto functionality #88

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Eragoneq
Copy link

@Eragoneq Eragoneq commented Apr 9, 2024

Closes #87
Closes #86

(cherry picked from commit 3e4a42d)

This pull requests fixes the two mentioned issues or design flaws related to Int and UShort transit.
If permitted, I would just change the signature of the original UShort functions and all the usages in the code to explicitly cast the data before sending to (de)serializer.

This also includes functions to automatically select the proper (de)serializer based on the underlying, allowing for more clean code in simple cases.

I was not able to automatically perform deserialization due to issues with typing of static classes and usage of Companion, as such it has been left out for now.

Copy link

github-actions bot commented Apr 9, 2024

File Coverage [78.03%]
Serialization.kt 78.03%
Total Project Coverage 64.76% 🍏

Copy link

codecov bot commented Apr 10, 2024

Codecov Report

Attention: Patch coverage is 88.23529% with 6 lines in your changes are missing coverage. Please review.

Project coverage is 58.73%. Comparing base (476dc36) to head (6ff3d74).

Files Patch % Lines
...in/java/nl/tudelft/ipv8/messaging/Serialization.kt 88.23% 6 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master      #88      +/-   ##
============================================
+ Coverage     58.62%   58.73%   +0.10%     
  Complexity      702      702              
============================================
  Files           107      107              
  Lines          4553     4553              
  Branches        632      632              
============================================
+ Hits           2669     2674       +5     
+ Misses         1552     1549       -3     
+ Partials        332      330       -2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Eragoneq Eragoneq closed this Apr 10, 2024
@Eragoneq Eragoneq deleted the serialization-update branch April 10, 2024 12:35
@Eragoneq Eragoneq restored the serialization-update branch April 11, 2024 11:53
@Eragoneq Eragoneq reopened this Apr 11, 2024
Copy link

File Coverage [78.03%]
Serialization.kt 78.03%
Total Project Coverage 64.73% 🍏

@Eragoneq Eragoneq closed this Apr 14, 2024
@Eragoneq Eragoneq deleted the serialization-update branch April 14, 2024 18:24
@Eragoneq Eragoneq restored the serialization-update branch April 17, 2024 12:46
@Eragoneq Eragoneq reopened this Apr 17, 2024
Copy link

File Coverage [78.03%]
Serialization.kt 78.03%
Total Project Coverage 64.55% 🍏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant