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

URI getQuery() and getFragment() don't decode properly

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 9
    • 7u10
    • core-libs
    • b08
    • x86_64
    • windows_7

      FULL PRODUCT VERSION :
      1.7.0_03

      ADDITIONAL OS VERSION INFORMATION :
      Microsoft Windows 6.1.7601

      A DESCRIPTION OF THE PROBLEM :
      As per API, getQuery() and getFragment() should return the decoded string. But this seems not to work properly if there are squared brackets around them.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Create a URI in whose path, query, and fragment contain "[a b]".
      Get Path, Query, and Fragment from this URI.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      /[a b]
      [a b]
      [a b]
      ACTUAL -
      /[a b]
      [a%20b]
      [a%20b]

      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      java.net.URI u = new java.net.URI("http","example.org","/[a b]","[a b]","[a b]");
      System.out.println(u.getPath());
      System.out.println(u.getQuery());
      System.out.println(u.getFragment());
      ---------- END SOURCE ----------

            prappo Pavel Rappo (Inactive)
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: