diff --git a/pom.xml b/pom.xml index f636797831f1f08e35de8e568f5bdf2e29e619f5..e3d518926960cd5270d7a6fbe1716ea54bba193c 100644 --- a/pom.xml +++ b/pom.xml @@ -1,6 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> -<project - xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" +<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <modelVersion>4.0.0</modelVersion> @@ -72,6 +71,10 @@ <groupId>fr.soleil.lib</groupId> <artifactId>snapArchivingApi</artifactId> </dependency> + <dependency> + <groupId>fr.soleil.gui</groupId> + <artifactId>commonArchivingGUI</artifactId> + </dependency> <dependency> <groupId>org.swinglabs</groupId> <artifactId>swingx</artifactId> @@ -112,10 +115,6 @@ <groupId>fr.soleil.lib</groupId> <artifactId>ApplicationUtilities</artifactId> </dependency> - <dependency> - <groupId>fr.soleil.gui</groupId> - <artifactId>commonArchivingGUI</artifactId> - </dependency> <dependency> <groupId>net.sf.transmorph</groupId> <artifactId>transmorph</artifactId> diff --git a/src/main/java/fr/soleil/bensikin/models/AttributesTreeModel.java b/src/main/java/fr/soleil/bensikin/models/AttributesTreeModel.java index 6fc09bc5bf3aa880e5eb4367c6f6f781c33ce684..aed7d04495492abdae1eb1f8787329eb84825007 100644 --- a/src/main/java/fr/soleil/bensikin/models/AttributesTreeModel.java +++ b/src/main/java/fr/soleil/bensikin/models/AttributesTreeModel.java @@ -35,7 +35,6 @@ package fr.soleil.bensikin.models; import java.text.Collator; -import java.util.ArrayList; import java.util.Collection; import java.util.Collections; import java.util.List; @@ -122,8 +121,7 @@ public class AttributesTreeModel extends DefaultTreeModel { ((DefaultMutableTreeNode) getRoot()).add(domainNode); - final List<Family> familiesToSort = new ArrayList<Family>(); - familiesToSort.addAll(domain.getFamilies().values()); + final List<Family> familiesToSort = domain.getFamilies(); Collections.sort(familiesToSort, new EntitiesComparator()); for (Family family : familiesToSort) { @@ -131,8 +129,7 @@ public class AttributesTreeModel extends DefaultTreeModel { final DefaultMutableTreeNode familyNode = new DefaultMutableTreeNode(family.getName()); domainNode.add(familyNode); - final List<Member> membersToSort = new ArrayList<Member>(); - membersToSort.addAll(family.getMembers().values()); + final List<Member> membersToSort = family.getMembers(); Collections.sort(membersToSort, new EntitiesComparator()); for (Member member : membersToSort) { @@ -140,9 +137,7 @@ public class AttributesTreeModel extends DefaultTreeModel { final DefaultMutableTreeNode memberNode = new DefaultMutableTreeNode(member.getName()); familyNode.add(memberNode); - final Collection<Attribute> coll = member.getAttributes().values(); - final List<Attribute> attributesToSort = new ArrayList<Attribute>(); - attributesToSort.addAll(coll); + final List<Attribute> attributesToSort = member.getAttributes(); Collections.sort(attributesToSort, new EntitiesComparator()); for (Attribute attribute : attributesToSort) { @@ -164,10 +159,13 @@ public class AttributesTreeModel extends DefaultTreeModel { } // END CURRENT ATTRIBUTE } + attributesToSort.clear(); // END CURRENT MEMBER } + membersToSort.clear(); // END CURRENT FAMILY } + familiesToSort.clear(); // END CURRENT DOMAIN } }