You are viewing a plain text version of this content. The canonical link for it is here.
Posted to slide-dev@jakarta.apache.org by ju...@apache.org on 2002/08/06 07:18:51 UTC
cvs commit: jakarta-slide/src/share/org/apache/slide/search/basic ComparableResourceImpl.java
juergen 2002/08/05 22:18:51
Modified: src/share/org/apache/slide/search/basic
ComparableResourceImpl.java
Log:
Fix in getAllProperties() and getAllPropertiesNames():
Use sets to collect all properties (-names) since some properties are found in the regular and in the computed properties (this is the case where the computed properties shadow the value of the regular ones), otherwise these properties would appear twice,
(ralf)
Revision Changes Path
1.3 +12 -12 jakarta-slide/src/share/org/apache/slide/search/basic/ComparableResourceImpl.java
Index: ComparableResourceImpl.java
===================================================================
RCS file: /home/cvs/jakarta-slide/src/share/org/apache/slide/search/basic/ComparableResourceImpl.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- ComparableResourceImpl.java 4 Jul 2002 15:19:29 -0000 1.2
+++ ComparableResourceImpl.java 6 Aug 2002 05:18:51 -0000 1.3
@@ -398,23 +398,23 @@
*/
public Iterator getAllPropertiesNames() throws SlideException {
- List propertyNamesList = new ArrayList();
+ Set propertyNamesSet = new HashSet();
Enumeration enum = revisionDescriptor.enumerateProperties();
NodeProperty property = null;
if (enum != null) {
while (enum.hasMoreElements()) {
property = (NodeProperty)enum.nextElement();
- propertyNamesList.add(new PropertyName(property.getName(),
+ propertyNamesSet.add(new PropertyName(property.getName(),
property.getNamespace()));
}
}
Iterator iterator = propertyProvider.getSupportedPropertiesNames(getUri());
while (iterator.hasNext()) {
- propertyNamesList.add(iterator.next());
+ propertyNamesSet.add(iterator.next());
}
- return propertyNamesList.iterator();
+ return propertyNamesSet.iterator();
}
/**
@@ -426,22 +426,22 @@
*/
public Iterator getAllProperties() throws SlideException {
- List propertyList = new ArrayList();
+ Set propertySet = new HashSet();
Enumeration enum = revisionDescriptor.enumerateProperties();
if (enum != null) {
while (enum.hasMoreElements()) {
- propertyList.add(enum.nextElement());
+ propertySet.add(enum.nextElement());
}
}
if (propertyProvider != null) {
Iterator iterator = propertyProvider.getSupportedProperties(getUri());
while (iterator.hasNext()) {
- propertyList.add(iterator.next());
+ propertySet.add(iterator.next());
}
}
- return propertyList.iterator();
+ return propertySet.iterator();
}
// brauchen wir die???
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>