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

javers compare is throwing exception when comparing two String arrays #199

Closed
dmmiller612 opened this Issue Sep 17, 2015 · 6 comments

Comments

Projects
None yet
3 participants
@dmmiller612
Contributor

dmmiller612 commented Sep 17, 2015

    Javers javers = JaversBuilder.javers().build();
    javers.compare(new String[]{"a", "b"}, new String[]{"a", "b"});

Currently the above code is throwing this exception:
CLASS_NOT_MANAGED JaVers runtime error - given javaClass '[Ljava.lang.String;' is mapped to ArrayType, ManagedType expected .

I am currently using version 1.3.4.

@dmmiller612

This comment has been minimized.

Contributor

dmmiller612 commented Sep 17, 2015

Looks like this may be by design, which is completely fine since you can make a direct equal comparison. I just wanted to make sure.

@bgalek

This comment has been minimized.

Contributor

bgalek commented Sep 17, 2015

I think you should compare entities (managed classes) here, exactly as exception says :)

@bartoszwalacik

This comment has been minimized.

Member

bartoszwalacik commented Sep 17, 2015

Will check it , pretty sure that works for lists

@bartoszwalacik bartoszwalacik added the bug label Sep 17, 2015

@bartoszwalacik

This comment has been minimized.

Member

bartoszwalacik commented Sep 17, 2015

okay, so we have a feature for wrapping top level containers into Entities. It works for collections but not yet for Arrays.

If you would like to contribute a Pull Request, this issue is easy to bo solved in LiveGraphFactory.wrapTopLevelContainer()

@dmmiller612

This comment has been minimized.

Contributor

dmmiller612 commented Sep 17, 2015

sure I'll check it out.

dmmiller612 added a commit to dmmiller612/javers that referenced this issue Sep 17, 2015

Issue javers#199 added Object array to LiveGraphFactory to stop throw…
…ing exceptions when comparing two arrays

bartoszwalacik added a commit that referenced this issue Sep 20, 2015

Merge pull request #200 from dmmiller612/199-Add-Array-To-LiveGraphFa…
…ctory

Issue #199 added Object array to LiveGraphFactory to stop throwing ex…
@bartoszwalacik

This comment has been minimized.

Member

bartoszwalacik commented Sep 21, 2015

released in v 1.3.8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment