XMLWordPrintable

    • Icon: Sub-task Sub-task
    • Resolution: Fixed
    • Icon: P3 P3
    • 15
    • None
    • hotspot
    • None
    • b19

      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
      ...

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

              Created:
              Updated:
              Resolved: