Skip to content

Instantly share code, notes, and snippets.

@ludochane
Created March 13, 2013 15:39
Show Gist options
  • Save ludochane/5153343 to your computer and use it in GitHub Desktop.
Save ludochane/5153343 to your computer and use it in GitHub Desktop.
mkarneim/pojobuilder issue: StackOverflowError when 2 classes reference each other
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;
}
}
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;
}
}
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);
}
}
@mtedone
Copy link

mtedone commented May 17, 2013

I created https://agileguru.atlassian.net/browse/PDM-4 for this. Would you like to fix it?

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