Project

General

Profile

Revision 3c6e3303

ID3c6e3303a5ed931efb0112eaa6112b1c892e5840
Parent 602d39cf
Child 0bfb1b18

Added by Patrick Plitzner over 1 year ago

ref #7827 Fix term/distribution content provider

  • Remove accidental merging of "includes" set into "eneralizationOf" set

View differences:

eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/editor/definedterm/TermContentProvider.java
61 61
	 */
62 62
	@Override
63 63
	public Object[] getChildren(Object parentElement) {
64
	    Collection<Object> children = new HashSet<>();
64 65

  
65 66
		if(parentElement instanceof TermVocabulary){
66 67
			return getTopLevelElements((TermVocabulary)parentElement);
67 68
		} else if (parentElement instanceof DefinedTermBase) {
68 69
			Set<Object> includes = ((DefinedTermBase) parentElement).getIncludes();
69 70
			Set<Object> generalizationOfs = ((DefinedTermBase) parentElement).getGeneralizationOf();
70
			generalizationOfs.addAll(includes);
71
            return generalizationOfs.toArray();
71
			children.addAll(includes);
72
			children.addAll(generalizationOfs);
73
            return children.toArray();
72 74
		}
73 75
		return null;
74 76
	}
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/wizard/DistributionContentProvider.java
37 37
            if (wrapper.children == null){
38 38
                DefinedTermBase term = wrapper.getNamedArea();
39 39
                Set<DefinedTermBase> includes = term.getIncludes();
40
                for (DefinedTermBase termBase: includes){
41
                    allChildrenWrapper.add(new NamedAreaWrapper(termBase, false, wrapper));
42
                }
40 43
                Set<DefinedTermBase> generalizationOfs = term.getGeneralizationOf();
41
                generalizationOfs.addAll(includes);
42 44
                for (DefinedTermBase termBase: generalizationOfs){
43 45
                    allChildrenWrapper.add(new NamedAreaWrapper(termBase, false, wrapper));
44 46
                }

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)