Skip to content

Commit

Permalink
[GEOS-11246] Schemaless plugin performance for WFS
Browse files Browse the repository at this point in the history
  • Loading branch information
Mike7311 committed Jan 9, 2024
1 parent d27abf2 commit 62e8dd4
Showing 1 changed file with 6 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@
/** Concrete implementation of a DynamicComplexType */
public class DynamicComplexTypeImpl extends AttributeTypeImpl implements DynamicComplexType {

private final Collection<PropertyDescriptor> properties;

private final Map<Name, PropertyDescriptor> propertyMap;

public DynamicComplexTypeImpl(
Expand All @@ -48,7 +46,6 @@ public DynamicComplexTypeImpl(
localPropertyMap.put(pd.getName(), pd);
}
}
this.properties = properties;
this.propertyMap = localPropertyMap;
}

Expand All @@ -60,7 +57,7 @@ public Class<Collection<Property>> getBinding() {

@Override
public Collection<PropertyDescriptor> getDescriptors() {
return properties;
return propertyMap.values();
}

@Override
Expand All @@ -85,7 +82,7 @@ public PropertyDescriptor getDescriptor(String name) {
}

private PropertyDescriptor getDescriptorByLocalPart(String localPart) {
for (PropertyDescriptor pd : properties) {
for (PropertyDescriptor pd : propertyMap.values()) {
if (pd.getName().getLocalPart().equals(localPart)) {
return pd;
}
Expand All @@ -111,23 +108,19 @@ public boolean equals(Object o) {
return false;
}
DynamicComplexTypeImpl other = (DynamicComplexTypeImpl) o;
if (!properties.equals(other.properties)) {
return false;
}
return true;
return !propertyMap.equals(other.propertyMap);
}

@Override
public void addPropertyDescriptor(PropertyDescriptor descriptor) {
if (!properties.contains(descriptor)) {
properties.add(descriptor);
if (!propertyMap.containsValue(descriptor)) {
propertyMap.put(descriptor.getName(), descriptor);
}
}

@Override
public void removePropertyDescriptor(PropertyDescriptor descriptor) {
if (properties.contains(descriptor)) {
properties.remove(descriptor);
if (propertyMap.containsValue(descriptor)) {
propertyMap.remove(descriptor.getName());
}
}
Expand Down

0 comments on commit 62e8dd4

Please sign in to comment.