Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8240987 Implement lost clhsdb javascript commands by using java instead
  3. JDK-8242142

convert clhsdb "class" and "classes" commands from javascript to java

    XMLWordPrintable

Details

    • Sub-task
    • Resolution: Fixed
    • P3
    • 15
    • 15
    • hotspot
    • None
    • b18

    Description

      These two are pretty straight forward. Just a few lines of javascript to convert:

          this.jclass = function(name) {
            if (typeof(name) == "string") {
               var clazz = sapkg.utilities.SystemDictionaryHelper.findInstanceKlass(name);
               if (clazz) {
                   writeln(clazz.getName().asString() + " @" + clazz.getAddress().toString());
               } else {
                   writeln("class not found: " + name);
               }
            } else {
               writeln("Usage: class name");
            }
          }
          registerCommand("class", "class name", "jclass");

          this.jclasses = function() {
            forEachKlass(function (clazz) {
              writeln(clazz.getName().asString() + " @" + clazz.getAddress().toString());
            });
          }
          registerCommand("classes", "classes", "jclasses");

      Logic for forEachKlass() already exists in SA and there are plenty of examples to leverage.

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: