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

TypeMapper fails into infinite loop for certain Type cycles in user classes #341

bartoszwalacik opened this Issue Feb 20, 2016 · 0 comments


None yet
1 participant

bartoszwalacik commented Feb 20, 2016


package org.javers.core.cases

import org.javers.core.JaversBuilder
import org.javers.core.metamodel.annotation.Id
import org.javers.repository.jql.QueryBuilder
import spock.lang.Specification

class Employee {
    int id
    Person person

class Person {
    String name
    Employee employee

 * @author bartosz.walacik
class OrganizationStructureLoopCase extends Specification{

    def "should manage Employee to Person cycle"(){
        def person = new Person(name:"kaz")
        def emp = new Employee(id:1, person:person)
        person.employee = emp

        def javers = JaversBuilder.javers().build()

        def snapshots = javers.findSnapshots(QueryBuilder.byInstanceId("kaz", Employee).build())

        snapshots.size() == 1

@bartoszwalacik bartoszwalacik added the bug label Feb 20, 2016

bartoszwalacik added a commit that referenced this issue Feb 22, 2016

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