Fixes issue 16126: Cycle in identifier columns result in stack overflow
authorMartin Taal <martin.taal@openbravo.com>
Sat, 05 Mar 2011 16:02:08 +0100
changeset 11034 35bfeb2da755
parent 11033 94907954324a
child 11035 d677420bb5d0
Fixes issue 16126: Cycle in identifier columns result in stack overflow
src/org/openbravo/dal/security/EntityAccessChecker.java
--- a/src/org/openbravo/dal/security/EntityAccessChecker.java	Sat Mar 05 15:49:59 2011 +0100
+++ b/src/org/openbravo/dal/security/EntityAccessChecker.java	Sat Mar 05 16:02:08 2011 +0100
@@ -258,7 +258,8 @@
   private void addDerivedReadableIdentifierProperties(Entity entity) {
     for (final Property p : entity.getProperties()) {
       if (p.isIdentifier() && p.getTargetEntity() != null
-          && !readableEntities.contains(p.getTargetEntity())) {
+          && !readableEntities.contains(p.getTargetEntity())
+          && !derivedReadableEntities.contains(p.getTargetEntity())) {
         derivedReadableEntities.add(p.getTargetEntity());
         addDerivedReadableIdentifierProperties(p.getTargetEntity());
       }