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

UnresolvedPermission assumes permission constructor with 2 string parameters

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P5 P5
    • 1.4.0
    • 1.3.0
    • security-libs
    • beta
    • generic
    • generic



      Name: skT45625 Date: 07/06/2000


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

      In the method resolve() of class java.security.UnresolvedPermission the code
      assumes the actual permission being created contains a constructor with 2
      paramters eg MyPermission(String name, String action). If the constructor does
      not exist,a NOSuchMethodException will be thrown, however this exception will be
      caught in the following catch block and is "swallowed by the code"

      try {
      Class pc = p.getClass();
      Constructor c = pc.getConstructor(PARAMS);
      return (Permission) c.newInstance(new Object[] { name, actions });
      } catch (Exception e) {
      return null;
      }

      I realise the semantics of UnresolvedPermission is to simply invalidate the
      permission if it cannot be resolved which is why the catch block exists, however
      not knowing why the code fails is a problem (and VERY frustrating). Perhaps the
      exception could be logged via sun.security.util.Debug

      Also nowhere in any of the permission documentation (At least that I have seen)
      does it state that a permission should have a constructor that takes 2 parameter
      s public MyPermission (String name, String action){...}
      (Review ID: 106902)
      ======================================================================

            claisunw Charlie Lai (Inactive)
            skondamasunw Suresh Kondamareddy (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: