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

requestAssociation with empty file extension string {""} throws StringIndexOutOfBoundsException

    XMLWordPrintable

Details

    • generic
    • generic

    Description

      requestAssociation with empty file extension string {""} throws StringIndexOutOfBoundsException
      java.lang.StringIndexOutOfBoundsException: String index out of range: 0
      at java.lang.String.charAt(Unknown Source)
      at com.sun.deploy.association.utility.AppUtility.addDotToFileExtension(Unknown Source)
      at com.sun.deploy.association.Association.addFileExtension(Unknown Source)
      at com.sun.jnlp.IntegrationServiceImpl.hasAssociation(Unknown Source)

      Here again we may need throw either IllegalArgumentException or should not create any association with file extension should not throw this Runtime Exception.
                      IntegrationService is = (IntegrationService)
                              ServiceManager.lookup("javax.jnlp.IntegrationService");
                      String mime = "abc/xyz";
                      String [] exts = {""};
                      boolean result = is.requestAssociation(mime,exts);

      Attachments

        Issue Links

          Activity

            People

              rkennke Roman Kennke
              rnairsunw Raghu Nair
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: