Uploaded image for project: 'Sentry (Retired)'
  1. Sentry (Retired)
  2. SENTRY-1506

Importing JDO or datanucleus properties from config is broken

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Not A Problem
    • 1.7.0, 2.0.0
    • None
    • Sentry
    • None

    Description

      SentryStore.java has a piece of code that takes JDO or datanucleus properties from config file:

          public static final String SENTRY_DB_PROPERTY_PREFIX = "sentry.";
          public static final String SENTRY_JAVAX_JDO_PROPERTY_PREFIX = SENTRY_DB_PROPERTY_PREFIX + "javax.jdo";
          public static final String SENTRY_DATANUCLEUS_PROPERTY_PREFIX = SENTRY_DB_PROPERTY_PREFIX + "datanucleus";
      
          for (Map.Entry<String, String> entry : conf) {
            String key = entry.getKey();
            if (key.startsWith(ServerConfig.SENTRY_JAVAX_JDO_PROPERTY_PREFIX) ||
                key.startsWith(ServerConfig.SENTRY_DATANUCLEUS_PROPERTY_PREFIX)) {
              key = StringUtils.removeStart(key, ServerConfig.SENTRY_DB_PROPERTY_PREFIX);
              prop.setProperty(key, entry.getValue());
            }
          }
      

      The intention apparently was to read properties starting from "sentry." but the code picks up properties which don't start with ".sentry".

      So the code doesn't make much sense, but an important question is whether anyone depends on the existing behavior.

      Attachments

        Issue Links

          Activity

            People

              akolb Alex Kolbasov
              akolb Alex Kolbasov
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: