Derby
  1. Derby
  2. DERBY-4815

Override mechanism for modules.properties works backwards

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 10.6.1.0
    • Fix Version/s: 10.7.1.1
    • Component/s: Services
    • Labels:
      None

      Description

      It is possible to override the properties in org/apache/derby/modules.properties by putting your own version of it somewhere on the classpath. BaseMonitor.getDefaultModuleProperties() apparently intends to use values from the first modules.properties file that mentions a property:

      String key = (String) newKeys.nextElement();
      if( moduleList.contains( key))
      // RESOLVE how do we localize messages before we have finished initialization?
      report( "Ignored duplicate property " + key + " in " + modulesPropertiesURL.toString());
      else
      moduleList.setProperty( key, otherList.getProperty( key));

      However, moduleList.contains(key) doesn't look for a key in moduleList, it looks for a property value. This code should have used containsKey() instead.

      Beacuse of this, the last modules.properties on the classpath will take precedence over the ones earlier on the classpath. So if you for example have two different versions of derby.jar in the classpath, the engine will use the classes from the first jar and modules.properties from the last jar.

      1. d4815.diff
        0.9 kB
        Knut Anders Hatlen

        Activity

        No work has yet been logged on this issue.

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Development