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

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

Closed
dmmiller612 opened this issue Sep 17, 2015 · 6 comments
Closed
Labels
bug

Comments

@dmmiller612
Copy link
Contributor

@dmmiller612 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
Copy link
Contributor Author

@dmmiller612 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
Copy link
Contributor

@bgalek bgalek commented Sep 17, 2015

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

@bartoszwalacik
Copy link
Member

@bartoszwalacik bartoszwalacik commented Sep 17, 2015

Will check it , pretty sure that works for lists

@bartoszwalacik bartoszwalacik added the bug label Sep 17, 2015
@bartoszwalacik
Copy link
Member

@bartoszwalacik 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
Copy link
Contributor Author

@dmmiller612 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
…ing exceptions when comparing two arrays
bartoszwalacik added a commit that referenced this issue Sep 20, 2015
…ctory

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

@bartoszwalacik 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
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants