You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Vasily Zakharov (JIRA)" <ji...@apache.org> on 2007/04/16 16:11:15 UTC

[jira] Created: (HARMONY-3665) [classlib][luni][netbeans] JarURLConnection.getContentLength() returns -1 instead of file size

[classlib][luni][netbeans] JarURLConnection.getContentLength() returns -1 instead of file size
----------------------------------------------------------------------------------------------

                 Key: HARMONY-3665
                 URL: https://issues.apache.org/jira/browse/HARMONY-3665
             Project: Harmony
          Issue Type: Bug
          Components: App-Oriented Bug Reports, Classlib
            Reporter: Vasily Zakharov
         Attachments: test.jar

JarURLConnection.getContentLength() returns -1 for files in the .jar archive.

Here's a test to reproduce the problem. Please put the attached test.jar to the current directory before running.

public class Test {
    public static void main(String args[]) throws Exception {
        System.out.println(new java.net.URL("jar:file:test.jar!/a").openConnection().getContentLength());
    }
}

Output on RI:

12

Output on Harmony:

-1

This problem was discovered while trying to run NetBeans on Harmony.


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (HARMONY-3665) [classlib][archive][netbeans] JarURLConnection.getContentLength() returns -1 instead of file size

Posted by "Vasily Zakharov (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-3665?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Vasily Zakharov updated HARMONY-3665:
-------------------------------------

    Summary: [classlib][archive][netbeans] JarURLConnection.getContentLength() returns -1 instead of file size  (was: [classlib][luni][netbeans] JarURLConnection.getContentLength() returns -1 instead of file size)

> [classlib][archive][netbeans] JarURLConnection.getContentLength() returns -1 instead of file size
> -------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-3665
>                 URL: https://issues.apache.org/jira/browse/HARMONY-3665
>             Project: Harmony
>          Issue Type: Bug
>          Components: App-Oriented Bug Reports, Classlib
>            Reporter: Vasily Zakharov
>         Attachments: test.jar
>
>
> JarURLConnection.getContentLength() returns -1 for files in the .jar archive.
> Here's a test to reproduce the problem. Please put the attached test.jar to the current directory before running.
> public class Test {
>     public static void main(String args[]) throws Exception {
>         System.out.println(new java.net.URL("jar:file:test.jar!/a").openConnection().getContentLength());
>     }
> }
> Output on RI:
> 12
> Output on Harmony:
> -1
> This problem was discovered while trying to run NetBeans on Harmony.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (HARMONY-3665) [classlib][archive][netbeans] JarURLConnection.getContentLength() returns -1 instead of file size

Posted by "Alexei Zakharov (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-3665?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Alexei Zakharov resolved HARMONY-3665.
--------------------------------------

    Resolution: Fixed

Thanks Vasily and Mikhail. Slightly modified version of the patch was applied at the revision 531591. Please verify it was applied as expected.

> [classlib][archive][netbeans] JarURLConnection.getContentLength() returns -1 instead of file size
> -------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-3665
>                 URL: https://issues.apache.org/jira/browse/HARMONY-3665
>             Project: Harmony
>          Issue Type: Bug
>          Components: App-Oriented Bug Reports, Classlib
>            Reporter: Vasily Zakharov
>         Assigned To: Alexei Zakharov
>         Attachments: H-3665.patch, test.jar
>
>
> JarURLConnection.getContentLength() returns -1 for files in the .jar archive.
> Here's a test to reproduce the problem. Please put the attached test.jar to the current directory before running.
> public class Test {
>     public static void main(String args[]) throws Exception {
>         System.out.println(new java.net.URL("jar:file:test.jar!/a").openConnection().getContentLength());
>     }
> }
> Output on RI:
> 12
> Output on Harmony:
> -1
> This problem was discovered while trying to run NetBeans on Harmony.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Assigned: (HARMONY-3665) [classlib][archive][netbeans] JarURLConnection.getContentLength() returns -1 instead of file size

Posted by "Alexei Zakharov (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-3665?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Alexei Zakharov reassigned HARMONY-3665:
----------------------------------------

    Assignee: Alexei Zakharov

> [classlib][archive][netbeans] JarURLConnection.getContentLength() returns -1 instead of file size
> -------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-3665
>                 URL: https://issues.apache.org/jira/browse/HARMONY-3665
>             Project: Harmony
>          Issue Type: Bug
>          Components: App-Oriented Bug Reports, Classlib
>            Reporter: Vasily Zakharov
>         Assigned To: Alexei Zakharov
>         Attachments: H-3665.patch, test.jar
>
>
> JarURLConnection.getContentLength() returns -1 for files in the .jar archive.
> Here's a test to reproduce the problem. Please put the attached test.jar to the current directory before running.
> public class Test {
>     public static void main(String args[]) throws Exception {
>         System.out.println(new java.net.URL("jar:file:test.jar!/a").openConnection().getContentLength());
>     }
> }
> Output on RI:
> 12
> Output on Harmony:
> -1
> This problem was discovered while trying to run NetBeans on Harmony.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Closed: (HARMONY-3665) [classlib][archive][netbeans] JarURLConnection.getContentLength() returns -1 instead of file size

Posted by "Vasily Zakharov (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-3665?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Vasily Zakharov closed HARMONY-3665.
------------------------------------


Thanks Mikhail, Alexei. The patch applied fine.


> [classlib][archive][netbeans] JarURLConnection.getContentLength() returns -1 instead of file size
> -------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-3665
>                 URL: https://issues.apache.org/jira/browse/HARMONY-3665
>             Project: Harmony
>          Issue Type: Bug
>          Components: App-Oriented Bug Reports, Classlib
>            Reporter: Vasily Zakharov
>         Assigned To: Alexei Zakharov
>         Attachments: H-3665.patch, test.jar
>
>
> JarURLConnection.getContentLength() returns -1 for files in the .jar archive.
> Here's a test to reproduce the problem. Please put the attached test.jar to the current directory before running.
> public class Test {
>     public static void main(String args[]) throws Exception {
>         System.out.println(new java.net.URL("jar:file:test.jar!/a").openConnection().getContentLength());
>     }
> }
> Output on RI:
> 12
> Output on Harmony:
> -1
> This problem was discovered while trying to run NetBeans on Harmony.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (HARMONY-3665) [classlib][archive][netbeans] JarURLConnection.getContentLength() returns -1 instead of file size

Posted by "Mikhail Markov (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-3665?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mikhail Markov updated HARMONY-3665:
------------------------------------

    Attachment: H-3665.patch

Here is the patch fixing the bug + regression tests.

Fix description:
1) getContentLength() method: added the piece of code getting the size of jar entry if the URL refers to it.
2) getContentType() method: while working with getContentLength() i've identified similar problem with getContentType() method so i've fixed it in the similar way and added regression test there as well.

> [classlib][archive][netbeans] JarURLConnection.getContentLength() returns -1 instead of file size
> -------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-3665
>                 URL: https://issues.apache.org/jira/browse/HARMONY-3665
>             Project: Harmony
>          Issue Type: Bug
>          Components: App-Oriented Bug Reports, Classlib
>            Reporter: Vasily Zakharov
>         Attachments: H-3665.patch, test.jar
>
>
> JarURLConnection.getContentLength() returns -1 for files in the .jar archive.
> Here's a test to reproduce the problem. Please put the attached test.jar to the current directory before running.
> public class Test {
>     public static void main(String args[]) throws Exception {
>         System.out.println(new java.net.URL("jar:file:test.jar!/a").openConnection().getContentLength());
>     }
> }
> Output on RI:
> 12
> Output on Harmony:
> -1
> This problem was discovered while trying to run NetBeans on Harmony.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (HARMONY-3665) [classlib][luni][netbeans] JarURLConnection.getContentLength() returns -1 instead of file size

Posted by "Vasily Zakharov (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-3665?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Vasily Zakharov updated HARMONY-3665:
-------------------------------------

    Attachment: test.jar

> [classlib][luni][netbeans] JarURLConnection.getContentLength() returns -1 instead of file size
> ----------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-3665
>                 URL: https://issues.apache.org/jira/browse/HARMONY-3665
>             Project: Harmony
>          Issue Type: Bug
>          Components: App-Oriented Bug Reports, Classlib
>            Reporter: Vasily Zakharov
>         Attachments: test.jar
>
>
> JarURLConnection.getContentLength() returns -1 for files in the .jar archive.
> Here's a test to reproduce the problem. Please put the attached test.jar to the current directory before running.
> public class Test {
>     public static void main(String args[]) throws Exception {
>         System.out.println(new java.net.URL("jar:file:test.jar!/a").openConnection().getContentLength());
>     }
> }
> Output on RI:
> 12
> Output on Harmony:
> -1
> This problem was discovered while trying to run NetBeans on Harmony.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.