jersey
  1. jersey
  2. JERSEY-1698

UriBuilder#uri(String) throws Schema specific part is opaque

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Blocker Blocker
    • Resolution: Fixed
    • Affects Version/s: 2.0-m12
    • Fix Version/s: 2.0-rc1, 2.0
    • Component/s: core
    • Labels:
      None

      Description

      String first = "news:comp.lang.java";
      String second = "http://comp.lang.java";
      UriBuilder.fromUri(new URI(first)).uri(second); //throws Schema specific part is opaque.
      

      However,

      UriBuilder.fromUri(new URI(first)).uri(new URI(second)); //does not throw anything
      

        Issue Links

          Activity

          Hide
          jan.supol added a comment -

          Interestingly enough, when

          String second = "///|||\\\\///::  ///";
          UriBuilder.fromUri(new URI(first)).uri(second);
          

          No exception is thrown.
          More interstingly, in the following:

          String second = "::///|||\\\\///::  ///";
          UriBuilder.fromUri(new URI(first)).uri(second);
          

          No exception is thrown, either,
          only when

          String second = "::///|||\\\\///::  ///";
          UriBuilder.fromUri(new URI(first)).uri(second).build();
          

          Then finally URISyntaxException is thrown.
          When

          String second = "";
          UriBuilder.fromUri(new URI(first)).uri(second);
          

          java.util.NoSuchElementException is thrown

          Show
          jan.supol added a comment - Interestingly enough, when String second = " ///|||\\\\///:: ///" ; UriBuilder.fromUri( new URI(first)).uri(second); No exception is thrown. More interstingly, in the following: String second = ":: ///|||\\\\///:: ///" ; UriBuilder.fromUri( new URI(first)).uri(second); No exception is thrown, either, only when String second = ":: ///|||\\\\///:: ///" ; UriBuilder.fromUri( new URI(first)).uri(second).build(); Then finally URISyntaxException is thrown. When String second = ""; UriBuilder.fromUri( new URI(first)).uri(second); java.util.NoSuchElementException is thrown

            People

            • Assignee:
              Miroslav Fuksa
              Reporter:
              jan.supol
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - 3 hours
                3h
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 1 hour, 30 minutes Time Not Required
                1h 30m