Derby
  1. Derby
  2. DERBY-5830

Make DoubleProperties.propertyNames() thread-safe

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 10.9.1.0
    • Fix Version/s: 10.8.3.0, 10.9.2.2, 10.10.1.1
    • Component/s: Services
    • Labels:
      None

      Description

      As discussed in DERBY-4269, DoubleProperties.propertyNames() may throw a NullPointerException if properties are removed by another thread while the method is executing. Since DoubleProperties is a sub-class of, and used as a drop-in replacement for, java.util.Properties, it should be thread-safe just like the propertyNames() method in the parent class.

      1. keys-only-v2.diff
        2 kB
        Knut Anders Hatlen

        Issue Links

          Activity

          Hide
          Knut Anders Hatlen added a comment -

          Attaching keys-only-v2.diff, based on keys-only.diff attached to DERBY-4269. The patch removes the unnecessary calls to Properties.getProperty(). Unlike the original keys-only.diff, it uses a HashSet to store the set of property names so that duplicate names are removed automatically.

          Both suites.All and derbyall ran cleanly with the patch.

          Show
          Knut Anders Hatlen added a comment - Attaching keys-only-v2.diff, based on keys-only.diff attached to DERBY-4269 . The patch removes the unnecessary calls to Properties.getProperty(). Unlike the original keys-only.diff, it uses a HashSet to store the set of property names so that duplicate names are removed automatically. Both suites.All and derbyall ran cleanly with the patch.
          Hide
          Dag H. Wanvik added a comment -

          Looks like a good improvement in its own right. +1

          Show
          Dag H. Wanvik added a comment - Looks like a good improvement in its own right. +1
          Hide
          Knut Anders Hatlen added a comment -

          Thanks, Dag. Committed revision 1353852.

          I'm also planning to backport this fix to 10.9, and possibly 10.8.

          Show
          Knut Anders Hatlen added a comment - Thanks, Dag. Committed revision 1353852. I'm also planning to backport this fix to 10.9, and possibly 10.8.
          Hide
          Knut Anders Hatlen added a comment -

          Backported to 10.9 (revision 1359064) and 10.8 (revision 1359065). Closing the issue.

          Show
          Knut Anders Hatlen added a comment - Backported to 10.9 (revision 1359064) and 10.8 (revision 1359065). Closing the issue.

            People

            • Assignee:
              Knut Anders Hatlen
              Reporter:
              Knut Anders Hatlen
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development