Created
March 13, 2013 15:39
-
-
Save ludochane/5153343 to your computer and use it in GitHub Desktop.
mkarneim/pojobuilder issue: StackOverflowError when 2 classes reference each other
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com; | |
public class Child { | |
private String name; | |
private Parent parent; | |
public Parent getParent() { | |
return parent; | |
} | |
public void setParent(Parent parent) { | |
this.parent = parent; | |
} | |
public String getName() { | |
return name; | |
} | |
public void setName(String name) { | |
this.name = name; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com; | |
public class Parent { | |
private String name; | |
private Child child; | |
public Child getChild() { | |
return child; | |
} | |
public void setChild(Child child) { | |
this.child = child; | |
} | |
public String getName() { | |
return name; | |
} | |
public void setName(String name) { | |
this.name = name; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com; | |
import org.junit.Test; | |
import uk.co.jemos.podam.api.PodamFactory; | |
import uk.co.jemos.podam.api.PodamFactoryImpl; | |
import static org.junit.Assert.assertNotNull; | |
public class PodamInterReferenceBugTest { | |
@Test | |
public void manufacturePojoWillStackOverflow() { | |
PodamFactory podamFactory = new PodamFactoryImpl(); | |
Parent parent = podamFactory.manufacturePojo(Parent.class); | |
assertNotNull(parent); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I created https://agileguru.atlassian.net/browse/PDM-4 for this. Would you like to fix it?