This is the place which I am going to remove my item,
myhieararchy hierarchyforDisplay = null;
try {
hierarchyforDisplay = (myhieararchy)hieararchybefore.clone();
} catch (CloneNotSupportedException e) {
e.printStackTrace();
}
for (Project project : projectList) {
for (Program program : hierarchyforDisplay.getPrograms()) {
for (Project rootproject : program.getProject()) {
if(project.getId() != rootproject.getProjectId()){
program.getProject().remove(rootproject);
}
}
}
}
return hierarchyforDisplay;
But I am getting this
org.springframework.web.util.NestedServletException: Request processing failed; nested exception is java.util.ConcurrentModificationException
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:656)
org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:549)
javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
I can not imagine what is the reson because this is my first time I get this.. :(