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

Constants java uses mutable collection

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 2.0.0
    • 2.1.0
    • Sentry

    Description

      Constants.java has the following code:

        public static final Map<String, String> requestTypeToOperationMap = new HashMap<String, String>();
        public static final Map<String, String> requestTypeToObjectTypeMap = new HashMap<String, String>();
      
        static {
          // for hive audit log
          requestTypeToOperationMap.put(TCreateSentryRoleRequest.class.getName(),
              Constants.OPERATION_CREATE_ROLE);
          requestTypeToOperationMap.put(
              TAlterSentryRoleGrantPrivilegeRequest.class.getName(),
              Constants.OPERATION_GRANT_PRIVILEGE);
      ...
      

      Instead it should create immutable maps for these.

      Attachments

        1. SENTRY-1662.002.patch
          13 kB
          Steve Moist
        2. SENTRY-1662.001.patch
          9 kB
          Steve Moist

        Activity

          People

            moist Steve Moist
            akolb Alex Kolbasov
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: