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

PrivateCredentialPermission throw StringIndexOutOfBoundsException

XMLWordPrintable

    • Fix Understood
    • generic
    • generic

      A DESCRIPTION OF THE PROBLEM :
      new PrivateCredentialPermission("x y \" leading\"", "read");
      If name does not conform to the correct syntax, this API should throw IllegalArgumentException, but for leading blank char, it throws StringIndexOutOfBoundsException
      Exception in thread "main" java.lang.StringIndexOutOfBoundsException: Range [1, 0) out of bounds for length 1


      ---------- BEGIN SOURCE ----------
      import javax.security.auth.*;

      public class Test {

          public static void main(String[] args) {
              new PrivateCredentialPermission("x y \" leading\"", "read");
          }
      }
      ---------- END SOURCE ----------

            semery Shawn Emery
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: