-
-
Notifications
You must be signed in to change notification settings - Fork 358
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
Issue #199 added Object array to LiveGraphFactory to stop throwing ex… #200
Issue #199 added Object array to LiveGraphFactory to stop throwing ex… #200
Conversation
…ing exceptions when comparing two arrays
thnx, will take a look at it tomorrow |
could you give mie write access to https://github.com/dmmiller612/javers? I'd like to put some small changes in this PR |
You should have write access, now. |
@@ -44,6 +45,10 @@ private Object wrapTopLevelContainer(Object handle){ | |||
if (handle instanceof Set){ | |||
return new SetWrapper((Set)handle); | |||
} | |||
if (handle.getClass().isArray()){ | |||
//return new ArrayWrapper(convertToObjectArray(handle)); | |||
return new ArrayWrapper((Object[])handle); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dmmiller612, I've removed this conversion and the tests are still passing, not sure what is it for ...
If this version is ok for you, I can merge
The rason I added the conversion is because you can't directly cast Object[] to a primitive[] at least in Java. I don't know much about groovy, and if it boxes the integer to an object. If you are fine just using objects, which is a valid design choice, I am okay with it. |
you are right, seems copying is needed as there is no obvious way to do casting. So I've restored it. |
…ctory Issue #199 added Object array to LiveGraphFactory to stop throwing ex…
There are some design choices I made that could easily be changed. One for example, if you look at convertToObjectArray, I added the private function to handle primitive and Object arrays, which you may only want Object arrays.