Uploaded image for project: 'Code Tools'
  1. Code Tools
  2. CODETOOLS-6519296

Allow system property changes by sameVM tests

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • jtreg3.2.2_02
    • jtreg3.2.2_02
    • tools
    • None
    • fcs
    • generic
    • generic
    • Not verified

      Currently the security manager in regtest, RegressionSecurityManager,
      disallows modifications to system properties
      (including getProperties, which is often just for reading).

      This is so that tests do not interfere with each other.

      It would be very nice to allow system property modifications,
      by simply making a backup copy of the system properties,
      and restoring them before the start of every test (with System.setProperties()).

      This can be optimized in the obvious way by doing the backup/restore
      only if the test actually does any system property manipulation,
      which the security manager will know, since it will be asked for permission.
      So for most tests, which have nothing to do with system properties,
      the overhead of providing this convenience will be just the check of a volatile boolean.
      The RegressionSecurityManager will need to cooperate with the harness to do the
      restore and reset, since it cannot know when the next test is about to start.
      Perhaps the RegressionSecurityManager could have a public method
      prepareForNextTest()

            jjg Jonathan Gibbons
            martin Martin Buchholz
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: