Mercurial > dive4elements > river
comparison flys-artifacts/src/main/java/de/intevation/flys/collections/AttributeWriter.java @ 2094:22732713c54d
Made classes to merge Collection Outs more verbose for better debugging.
flys-artifacts/trunk@3640 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Tue, 10 Jan 2012 11:44:46 +0000 |
parents | ca6ccf722c24 |
children | afc7bfb4800b |
comparison
equal
deleted
inserted
replaced
2093:ebc2aa64c1be | 2094:22732713c54d |
---|---|
92 protected CollectionAttribute write() { | 92 protected CollectionAttribute write() { |
93 for (Map.Entry<String, Output> entry: newAttr.entrySet()) { | 93 for (Map.Entry<String, Output> entry: newAttr.entrySet()) { |
94 String outName = entry.getKey(); | 94 String outName = entry.getKey(); |
95 Output a = entry.getValue(); | 95 Output a = entry.getValue(); |
96 | 96 |
97 | |
97 Output exists = attribute.getOutput(outName); | 98 Output exists = attribute.getOutput(outName); |
98 if (exists == null) { | 99 if (exists == null) { |
99 attribute.addOutput(outName, a); | 100 attribute.addOutput(outName, a); |
100 } | 101 } |
101 | 102 |
102 attribute.clearFacets(outName); | 103 attribute.clearFacets(outName); |
104 | |
105 if (logger.isDebugEnabled()) { | |
106 logger.debug("Merge Output: " + outName); | |
107 logger.debug(" old Facets: " + oldFacets.size()); | |
108 logger.debug(" new Facets: " + newFacets.size()); | |
109 } | |
110 | |
103 writeOutput(a.getName(), newFacets, oldFacets); | 111 writeOutput(a.getName(), newFacets, oldFacets); |
104 } | 112 } |
105 | 113 |
106 // THIS CALL IS ABSOLUTELY NECESSARY! | 114 // THIS CALL IS ABSOLUTELY NECESSARY! |
107 attribute.cleanEmptyOutputs(); | 115 attribute.cleanEmptyOutputs(); |
119 String outputName, | 127 String outputName, |
120 List<Facet> newOutFacets, | 128 List<Facet> newOutFacets, |
121 List<Facet> oldOutFacets | 129 List<Facet> oldOutFacets |
122 ) { | 130 ) { |
123 List<String> compatFacets = this.compatibilities.get(outputName); | 131 List<String> compatFacets = this.compatibilities.get(outputName); |
132 | |
133 if (logger.isDebugEnabled() && compatFacets != null) { | |
134 logger.debug("Compabitle Facets:"); | |
135 for (String compatible: compatFacets) { | |
136 logger.debug( "- " + compatible); | |
137 } | |
138 } | |
139 | |
124 try { | 140 try { |
125 writeFacets(outputName, newOutFacets, oldOutFacets, compatFacets); | 141 writeFacets(outputName, newOutFacets, oldOutFacets, compatFacets); |
126 } | 142 } |
127 catch (ArtifactDatabaseException ade) { | 143 catch (ArtifactDatabaseException ade) { |
128 logger.error(ade, ade); | 144 logger.error(ade, ade); |
155 List<ManagedFacet> currentFacets = new ArrayList<ManagedFacet>(); | 171 List<ManagedFacet> currentFacets = new ArrayList<ManagedFacet>(); |
156 List<ManagedFacet> genuinelyNewFacets = new ArrayList<ManagedFacet>(); | 172 List<ManagedFacet> genuinelyNewFacets = new ArrayList<ManagedFacet>(); |
157 | 173 |
158 for (int i = 0; i < num; i++) { | 174 for (int i = 0; i < num; i++) { |
159 ManagedFacet facet = (ManagedFacet) newFacets.get(i); | 175 ManagedFacet facet = (ManagedFacet) newFacets.get(i); |
176 | |
177 logger.debug("Try to add Facet: " + facet.getName()); | |
178 | |
160 if (!compatibleFacets.contains(facet.getName())) { | 179 if (!compatibleFacets.contains(facet.getName())) { |
161 //logger.debug("Have incompatible facet, skip: " + facet.getName()); | 180 //logger.debug("Have incompatible facet, skip: " + facet.getName()); |
162 continue; | 181 continue; |
163 } | 182 } |
164 //else logger.debug("Have compatible facet: " + facet.getName()); | 183 //else logger.debug("Have compatible facet: " + facet.getName()); |