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

#245: cast fix using JVMBridgeBase.Wraps #246

Merged
merged 2 commits into from
Oct 5, 2023
Merged

#245: cast fix using JVMBridgeBase.Wraps #246

merged 2 commits into from
Oct 5, 2023

Conversation

masesdevelopers
Copy link
Contributor

Description

Update cast to Java type with JVMBridgeBase.Wraps

Related Issue

Closed #245

Motivation and Context

How Has This Been Tested?

Local test on returned object from JVM

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@masesdevelopers masesdevelopers added bug Something isn't working KNetSerDes KNetSerDes related issue labels Oct 5, 2023
@masesdevelopers masesdevelopers self-assigned this Oct 5, 2023
@masesdevelopers masesdevelopers changed the title #245: cast fix with JVMBridgeBase.Wraps #245: cast fix using JVMBridgeBase.Wraps Oct 5, 2023
@masesdevelopers masesdevelopers merged commit b8324e5 into masesgroup:master Oct 5, 2023
@masesdevelopers masesdevelopers deleted the 245-the-object-cast-does-not-work-right-without-jvmbridgebasewraps branch October 5, 2023 13:18
@@ -290,7 +290,7 @@ public static float DeserializeFloat(string topic, byte[] data)
/// </summary>
public static int DeserializeInt(string topic, byte[] data)
{
return (int)_IntDeserializer.Deserialize(topic, data);
return JVMBridgeBase.Wraps<Java.Lang.Integer>(_IntDeserializer.Deserialize(topic, data) as IJavaObject);
Copy link
Contributor

Choose a reason for hiding this comment

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

Running the tests related to KNetCompactedReplicator seems the result of Deserialize is not always a Java object. I don't understand why but the result is an int instead of java.lang.Integer even if the Java signature is public Integer deserialize(String topic, byte[] data). Maybe a better implementation needs a check against IJavaObject.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working KNetSerDes KNetSerDes related issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

The object cast does not work right without JVMBridgeBase.Wraps
2 participants