public boolean hasHierarchyClashes(ContextualProperty property) { if (fData == null || fData.isEmpty()) { return false; } List<Entry> entryList = fData.get(property.getName()); if (entryList == null) { return false; } for (Entry entry : entryList) { Boolean status = entry.isClashingWith(property); if (Boolean.TRUE.equals(status)) { return true; } } return false; }
private void readHierarchy(Module module) { for (ModuleImport moduleImport : module.getModuleImport()) { Module importedModule = moduleImport.getImportedModule(); if (importedModule != null) { readHierarchy(importedModule); } } for (EStructuralFeature nextFeature : module.getEAllStructuralFeatures()) { if (nextFeature instanceof ContextualProperty) { ContextualProperty ctxProp = (ContextualProperty) nextFeature; if (ctxProp.getContext() == null) { continue; } String name = ctxProp.getName(); List<Entry> entryList = getData().get(name); if (entryList == null) { entryList = new LinkedList<Entry>(); getData().put(name, entryList); } boolean joined = false; for (Entry entry : entryList) { if (entry.addIfApplicable(ctxProp)) { joined = true; break; } } if (!joined) { Entry newEntry = new Entry(); entryList.add(newEntry); newEntry.addIfApplicable(ctxProp); } } } }