Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4334984

JDI: ClassPrepareRequest.addClassFilter(String) fails to restrict events

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P4 P4
    • None
    • 1.3.0
    • core-svc
    • x86
    • windows_98



      Name: rlT66838 Date: 05/02/2000


      java version "1.3.0rc2"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.0rc2-Y)
      Java HotSpot(TM) Client VM (build 1.3.0rc2-Y, mixed mode)


      The API docs for ClassPrepareRequest.addClassFilter(String pattern) indicate
      that events are to be restricted to classnames matching this pattern or
      matching the name exactly if no '*' wildcard characters are used. We have found
      that in certain cases when we want restrict events to a specific class using an
      exact match pattern (ie. no wildcard characters are used), events are generated
      for the restricted class as well as for any classes/interfaces that are part of
      this class's class/interface hierarchy whose names start with the restricted
      class name. For example:

      class Test extends TestBase implements TestInterface {
         public static class main(String[] args) {}
      }

      class TestBase {}
      interface TestInterface {}
      interface TestNotUsed {}

      ClassPrepareRequest req = eventRequestManager.createClassPrepareRequest()
      req.addClassFilter("Test");
      req.enable()

      ClassPrepareEvents will be generated for Test as well as TestBase and
      TestInterface but not TestNotUsed. It is as if we did addClassFilter("Test*")
      except that only those classes/interfaces that are part of Test's
      class/interface hierarchy have events generated for them.
      (Review ID: 104330)
      ======================================================================

            rfield Robert Field (Inactive)
            rlewis Roger Lewis (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: