XMLWordPrintable

    Details

    • Type: Sub-task
    • Status: Resolved
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 15
    • Component/s: hotspot
    • Labels:
      None
    • Subcomponent:
    • Resolved In Build:
      b19

      Description

      This one looks to be trival:

          this.sysProps = function() {
            for (var i in jvm.sysProps) {
               writeln(i + ' = ' + jvm.sysProps[i]);
            }
          }
          registerCommand("sysprops", "sysprops", "sysProps");

      jvm.sysProps[] is a cache initialized on the java side by the following:

          private synchronized JSMap getSysProps() {
              if (sysPropsCache == null) {
                  Properties props = vm.getSystemProperties();
                  Map map = new HashMap();
                  if (props != null) {
                      Enumeration e = props.propertyNames();
                      while (e.hasMoreElements()) {
                          String key = (String) e.nextElement();
                          map.put(key, props.getProperty(key));
                      }
                  }
                  sysPropsCache = factory.newJSMap(map);
              }
              return sysPropsCache;
          }

      We don't need to keep a cache, so the implementation can be a similar loop to what is in getSysProps(), but just printing the key+value rather than caching it.

      Output from old javascript sysprops command looks like the following:

      awt.toolkit = sun.awt.X11.XToolkit
      file.encoding.pkg = sun.io
      java.specification.version = 1.8
      ...

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              cjplummer Chris Plummer
              Reporter:
              cjplummer Chris Plummer
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: