Uploaded image for project: 'Spatial Information Systems'
  1. Spatial Information Systems
  2. SIS-90

Metadata objects should use EnumSet and CodeListSet when appropriate

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • None
    • 0.3
    • Metadata
    • None

    Description

      ModifiableMetadata selects the appropriate collection type for a given element type by invoking the protected collectionType(Class) method. Current implementation returns only List.class or Set.class. Consequently HashSet is used for all Enum and CodeList collections.

      The EnumSet and CodeListSet are more efficient (more compact and presumed faster) implementations of Set for enumerations and code lists, so they should be used. Note that since EnumSet is mutable, we will need to clone it before to return such set from a unmodifiable metadata.

      We could also move collectionType(Class) method from ModifiableMetadata to StandardMetadata instead, in order to control the collection type policy in a single place instead than for each metadata object.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              desruisseaux Martin Desruisseaux
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: