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

Comments

@dmmiller612
Copy link
Contributor

    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

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 commented Sep 17, 2015

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

@bartoszwalacik
Copy link
Member

Will check it , pretty sure that works for lists

@bartoszwalacik
Copy link
Member

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

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

released in v 1.3.8

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

No branches or pull requests

3 participants