From b276cd5049de5e98d297e43aaf6be3bb40df5558 Mon Sep 17 00:00:00 2001 From: brianjlowe Date: Wed, 6 Nov 2013 11:02:33 -0500 Subject: [PATCH] VIVO-499 fixes bug in deduping applicable properties --- .../individual/GroupedPropertyList.java | 31 +++++++++++-------- 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/webapp/src/edu/cornell/mannlib/vitro/webapp/web/templatemodels/individual/GroupedPropertyList.java b/webapp/src/edu/cornell/mannlib/vitro/webapp/web/templatemodels/individual/GroupedPropertyList.java index a009847c9..3c61f3b0b 100644 --- a/webapp/src/edu/cornell/mannlib/vitro/webapp/web/templatemodels/individual/GroupedPropertyList.java +++ b/webapp/src/edu/cornell/mannlib/vitro/webapp/web/templatemodels/individual/GroupedPropertyList.java @@ -300,21 +300,26 @@ public class GroupedPropertyList extends BaseTemplateModel { return false; } for (ObjectProperty op : opList) { - if (op.getURI() != null && op.getURI().equals(pi.getPropertyURI())) { - if(op.getDomainVClassURI() == null) { - if(pi.getDomainClassURI() == null) { - return true; - } - } else if (op.getDomainVClassURI().equals(pi.getDomainClassURI())) { - return true; + boolean uriMatches = (op.getURI() != null + && op.getURI().equals(pi.getPropertyURI())); + boolean domainMatches = false; + boolean rangeMatches = false; + if(op.getDomainVClassURI() == null) { + if(pi.getDomainClassURI() == null) { + domainMatches = true; } - if(op.getRangeVClassURI() == null) { - if (pi.getDomainClassURI() == null) { - return true; - } - } else if (op.getRangeVClassURI().equals(pi.getRangeClassURI())) { - return true; + } else if (op.getDomainVClassURI().equals(pi.getDomainClassURI())) { + domainMatches = true; + } + if(op.getRangeVClassURI() == null) { + if (pi.getDomainClassURI() == null) { + rangeMatches = true; } + } else if (op.getRangeVClassURI().equals(pi.getRangeClassURI())) { + rangeMatches = true; + } + if (uriMatches && domainMatches && rangeMatches) { + return true; } } return false;