Harmony
  1. Harmony
  2. HARMONY-1127

[classlib][net] compatibility: Harmony constructor URI(String * 5) throws URISyntaxExceptionwhile RI does not

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Won't Fix
    • Affects Version/s: None
    • Fix Version/s: None
    • Labels:
      None

      Description

      The Harmony method java.net.URI(String scheme, String authority, String path, String query, String fragment) throws URISyntaxException for incorrect ipv6 address while RI silently skip it.
      Note, the URI unit test for this constructor failed on RI and passed on Harmony.

      ====================== test.java =======================
      import java.net.*;

      public class test {
      public static void main (String[] args) throws Exception

      { System.out.println("res = " + new URI("ftp", "[www.abc.com]", "/dir", "query", "frag")); }


      }
      ====================================================

      Output:
      C:\tmp\tmp17>C:\jdk1.5.0_06\bin\java.exe -cp . -showversion test
      java version "1.5.0_06"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_06-b05)
      Java HotSpot(TM) Client VM (build 1.5.0_06-b05, mixed mode)

      res = ftp:///dir?query#frag

      C:\tmp\tmp17>C:\harmony\classlib1.5\deploy\jdk\jre\bin\java.exe -cp . -showversion test
      java version 1.5 (subset)

      (c) Copyright 1991, 2006 The Apache Software Foundation or its licensors, as applicable.
      Exception in thread "main" java.net.URISyntaxException: Malformed ipv6 address: [www.abc.com]
      at java.net.URI$Helper.isValidHost(URI.java:467)
      at java.net.URI$Helper.parseAuthority(URI.java:431)
      at java.net.URI$Helper.parseURI(URI.java:31)
      at java.net.URI$Helper.access$100(URI.java:22)
      at java.net.URI.<init>(URI.java:199)
      at test.main(test.java:5)

        Activity

        Vladimir Ivanov created issue -
        Hide
        Alexey Petrenko added a comment -

        But Harmony seems correct here.

        Show
        Alexey Petrenko added a comment - But Harmony seems correct here.
        Tim Ellison made changes -
        Field Original Value New Value
        Assignee Tim Ellison [ tellison ]
        Hide
        Mikhail Markov added a comment -

        I agree with Alexey: RI just swallows the host information silently and does not store it internally (as could be seen by RI's output) which is incorrect anyway, imho.

        I suggest moving this bug to "Non-bug differences from RI" category and close it.

        Show
        Mikhail Markov added a comment - I agree with Alexey: RI just swallows the host information silently and does not store it internally (as could be seen by RI's output) which is incorrect anyway, imho. I suggest moving this bug to "Non-bug differences from RI" category and close it.
        Tim Ellison made changes -
        Component/s Non-bug differences from RI [ 12310780 ]
        Component/s Classlib [ 12310560 ]
        Tim Ellison made changes -
        Resolution Fixed [ 1 ]
        Status Open [ 1 ] Closed [ 6 ]
        Tim Ellison made changes -
        Resolution Fixed [ 1 ]
        Status Closed [ 6 ] Reopened [ 4 ]
        Hide
        Tim Ellison added a comment -

        Changing resolution.

        Show
        Tim Ellison added a comment - Changing resolution.
        Tim Ellison made changes -
        Status Reopened [ 4 ] Closed [ 6 ]
        Resolution Won't Fix [ 2 ]
        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open Closed Closed
        139d 6h 12m 1 Tim Ellison 27/Dec/06 10:34
        Closed Closed Reopened Reopened
        24s 1 Tim Ellison 27/Dec/06 10:35
        Reopened Reopened Closed Closed
        21s 1 Tim Ellison 27/Dec/06 10:35

          People

          • Assignee:
            Tim Ellison
            Reporter:
            Vladimir Ivanov
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development