You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Alexei Fedotov (JIRA)" <ji...@apache.org> on 2008/02/15 12:14:07 UTC

[jira] Created: (HARMONY-5517) [classlib][archive] simplifying archive code by fixing manifest encoding to UTF-8

[classlib][archive] simplifying archive code by fixing manifest encoding to UTF-8
---------------------------------------------------------------------------------

                 Key: HARMONY-5517
                 URL: https://issues.apache.org/jira/browse/HARMONY-5517
             Project: Harmony
          Issue Type: Improvement
          Components: Classlib
            Reporter: Alexei Fedotov


By specification [1] manifests are encoded in UTF-8. There is no need to make code more complex than that, so legacy of HARMONY-14 may be removed. Testing the patch.


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


[jira] Updated: (HARMONY-5517) [classlib][archive] simplifying archive code by fixing manifest encoding to UTF-8

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

Alexei Fedotov updated HARMONY-5517:
------------------------------------

    Attachment: remove_manifest_encoding_3.patch

It seems few lines more lines are to be removed from the patch. 

> [classlib][archive] simplifying archive code by fixing manifest encoding to UTF-8
> ---------------------------------------------------------------------------------
>
>                 Key: HARMONY-5517
>                 URL: https://issues.apache.org/jira/browse/HARMONY-5517
>             Project: Harmony
>          Issue Type: Improvement
>          Components: Classlib
>            Reporter: Alexei Fedotov
>            Assignee: Tim Ellison
>         Attachments: remove_manifest_encoding.patch, remove_manifest_encoding_2.patch, remove_manifest_encoding_3.patch
>
>
> By specification [1] manifests are encoded in UTF-8. There is no need to make code more complex than that, so legacy of HARMONY-14 may be removed. Testing the patch.
> [1] http://java.sun.com/javase/6/docs/technotes/guides/jar/jar.html

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


[jira] Updated: (HARMONY-5517) [classlib][archive] simplifying archive code by fixing manifest encoding to UTF-8

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

Alexei Fedotov updated HARMONY-5517:
------------------------------------

    Description: 
By specification [1] manifests are encoded in UTF-8. There is no need to make code more complex than that, so legacy of HARMONY-14 may be removed. Testing the patch.

[1] http://java.sun.com/javase/6/docs/technotes/guides/jar/jar.html

  was:
By specification [1] manifests are encoded in UTF-8. There is no need to make code more complex than that, so legacy of HARMONY-14 may be removed. Testing the patch.



> [classlib][archive] simplifying archive code by fixing manifest encoding to UTF-8
> ---------------------------------------------------------------------------------
>
>                 Key: HARMONY-5517
>                 URL: https://issues.apache.org/jira/browse/HARMONY-5517
>             Project: Harmony
>          Issue Type: Improvement
>          Components: Classlib
>            Reporter: Alexei Fedotov
>            Assignee: Tim Ellison
>         Attachments: remove_manifest_encoding.patch
>
>
> By specification [1] manifests are encoded in UTF-8. There is no need to make code more complex than that, so legacy of HARMONY-14 may be removed. Testing the patch.
> [1] http://java.sun.com/javase/6/docs/technotes/guides/jar/jar.html

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


[jira] Commented: (HARMONY-5517) [classlib][archive] simplifying archive code by fixing manifest encoding to UTF-8

Posted by "Tim Ellison (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-5517?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12569265#action_12569265 ] 

Tim Ellison commented on HARMONY-5517:
--------------------------------------

Thanks Alexei -- I'm going to keep this one until after M5...

> [classlib][archive] simplifying archive code by fixing manifest encoding to UTF-8
> ---------------------------------------------------------------------------------
>
>                 Key: HARMONY-5517
>                 URL: https://issues.apache.org/jira/browse/HARMONY-5517
>             Project: Harmony
>          Issue Type: Improvement
>          Components: Classlib
>            Reporter: Alexei Fedotov
>            Assignee: Tim Ellison
>         Attachments: remove_manifest_encoding.patch
>
>
> By specification [1] manifests are encoded in UTF-8. There is no need to make code more complex than that, so legacy of HARMONY-14 may be removed. Testing the patch.

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


[jira] Closed: (HARMONY-5517) [classlib][archive] simplifying archive code by fixing manifest encoding to UTF-8

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

Alexei Fedotov closed HARMONY-5517.
-----------------------------------


Tim, thanks for explanations. 

> [classlib][archive] simplifying archive code by fixing manifest encoding to UTF-8
> ---------------------------------------------------------------------------------
>
>                 Key: HARMONY-5517
>                 URL: https://issues.apache.org/jira/browse/HARMONY-5517
>             Project: Harmony
>          Issue Type: Improvement
>          Components: Classlib
>            Reporter: Alexei Fedotov
>            Assignee: Tim Ellison
>             Fix For: 5.0M6
>
>         Attachments: remove_manifest_encoding.patch, remove_manifest_encoding_2.patch, remove_manifest_encoding_3.patch
>
>
> By specification [1] manifests are encoded in UTF-8. There is no need to make code more complex than that, so legacy of HARMONY-14 may be removed. Testing the patch.
> [1] http://java.sun.com/javase/6/docs/technotes/guides/jar/jar.html

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


[jira] Commented: (HARMONY-5517) [classlib][archive] simplifying archive code by fixing manifest encoding to UTF-8

Posted by "Alexei Fedotov (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-5517?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12578312#action_12578312 ] 

Alexei Fedotov commented on HARMONY-5517:
-----------------------------------------

Tim, I'm sorry. I'm new to the class library conventions, and asking questions to understand these conventions better.

You changed 
  -        byte[] out = (name.toString() + ": ").getBytes("ISO8859_1"); //$NON-NLS-1$ //$NON-NLS-2$
to
  +        byte[] out = (name.toString() + ": ").getBytes("UTF-8"); //$NON-NLS-1$ //$NON-NLS-2$

instead of  using my

  +        byte[] out = (name.toString() + ": ").getBytes(ENCODING); //$NON-NLS-1$

What is the reason behind using "UTF-8" string instead of a final variable? 
    static final String ENCODING = "UTF-8"; //$NON-NLS-1$

I though using constants is a sort of cleaner.


> [classlib][archive] simplifying archive code by fixing manifest encoding to UTF-8
> ---------------------------------------------------------------------------------
>
>                 Key: HARMONY-5517
>                 URL: https://issues.apache.org/jira/browse/HARMONY-5517
>             Project: Harmony
>          Issue Type: Improvement
>          Components: Classlib
>            Reporter: Alexei Fedotov
>            Assignee: Tim Ellison
>             Fix For: 5.0M6
>
>         Attachments: remove_manifest_encoding.patch, remove_manifest_encoding_2.patch, remove_manifest_encoding_3.patch
>
>
> By specification [1] manifests are encoded in UTF-8. There is no need to make code more complex than that, so legacy of HARMONY-14 may be removed. Testing the patch.
> [1] http://java.sun.com/javase/6/docs/technotes/guides/jar/jar.html

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


[jira] Commented: (HARMONY-5517) [classlib][archive] simplifying archive code by fixing manifest encoding to UTF-8

Posted by "Tim Ellison (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-5517?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12578321#action_12578321 ] 

Tim Ellison commented on HARMONY-5517:
--------------------------------------

It's only a minor style change.  In this case there is only one user of this variable, and the name ENCODING is less descriptive than the constant value it contains, so I felt it is better to use the value directly.

I would have used a final variable if the value had been used in a number of places (and therefore you wanted to show it is required to be the same everywhere it is used), or if the value was 'magic' so the variable was descriptive (e.g. BYTE_ORDER_MARK = "EF BB BF").

Regards,
Tim


> [classlib][archive] simplifying archive code by fixing manifest encoding to UTF-8
> ---------------------------------------------------------------------------------
>
>                 Key: HARMONY-5517
>                 URL: https://issues.apache.org/jira/browse/HARMONY-5517
>             Project: Harmony
>          Issue Type: Improvement
>          Components: Classlib
>            Reporter: Alexei Fedotov
>            Assignee: Tim Ellison
>             Fix For: 5.0M6
>
>         Attachments: remove_manifest_encoding.patch, remove_manifest_encoding_2.patch, remove_manifest_encoding_3.patch
>
>
> By specification [1] manifests are encoded in UTF-8. There is no need to make code more complex than that, so legacy of HARMONY-14 may be removed. Testing the patch.
> [1] http://java.sun.com/javase/6/docs/technotes/guides/jar/jar.html

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


[jira] Commented: (HARMONY-5517) [classlib][archive] simplifying archive code by fixing manifest encoding to UTF-8

Posted by "Tim Ellison (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-5517?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12578300#action_12578300 ] 

Tim Ellison commented on HARMONY-5517:
--------------------------------------

My concern was that failing quietly means that you would get data that does not match the original JAR file, and that could cause even greater confusion down stream -- so I was trying to ensure that the failure happens early.

How about we agree that if we find a case of a JAR file with bogus data that would be safe to ignore then we remove the IOException ?! <g>


> [classlib][archive] simplifying archive code by fixing manifest encoding to UTF-8
> ---------------------------------------------------------------------------------
>
>                 Key: HARMONY-5517
>                 URL: https://issues.apache.org/jira/browse/HARMONY-5517
>             Project: Harmony
>          Issue Type: Improvement
>          Components: Classlib
>            Reporter: Alexei Fedotov
>            Assignee: Tim Ellison
>             Fix For: 5.0M6
>
>         Attachments: remove_manifest_encoding.patch, remove_manifest_encoding_2.patch, remove_manifest_encoding_3.patch
>
>
> By specification [1] manifests are encoded in UTF-8. There is no need to make code more complex than that, so legacy of HARMONY-14 may be removed. Testing the patch.
> [1] http://java.sun.com/javase/6/docs/technotes/guides/jar/jar.html

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


[jira] Commented: (HARMONY-5517) [classlib][archive] simplifying archive code by fixing manifest encoding to UTF-8

Posted by "Alexei Fedotov (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-5517?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12578286#action_12578286 ] 

Alexei Fedotov commented on HARMONY-5517:
-----------------------------------------

Tim, thank you for committing the patch.

I have noticed that you added throw new IOException(e.getLocalizedMessage()) for unrecognized UTF characters. Personally I want all errors to be reported. From the other side a former code tried to to its best to recognize the code and my understanding of the specification suggested ignoring non-recognizable attributes.

Please check http://java.sun.com/j2se/1.5.0/docs/guide/jar/jar.html, Notes on Manifest and Signature Files, Attributes. Probably they just meant  attribute names here, not a corrupted UTF -8 characters.


> [classlib][archive] simplifying archive code by fixing manifest encoding to UTF-8
> ---------------------------------------------------------------------------------
>
>                 Key: HARMONY-5517
>                 URL: https://issues.apache.org/jira/browse/HARMONY-5517
>             Project: Harmony
>          Issue Type: Improvement
>          Components: Classlib
>            Reporter: Alexei Fedotov
>            Assignee: Tim Ellison
>             Fix For: 5.0M6
>
>         Attachments: remove_manifest_encoding.patch, remove_manifest_encoding_2.patch, remove_manifest_encoding_3.patch
>
>
> By specification [1] manifests are encoded in UTF-8. There is no need to make code more complex than that, so legacy of HARMONY-14 may be removed. Testing the patch.
> [1] http://java.sun.com/javase/6/docs/technotes/guides/jar/jar.html

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


[jira] Assigned: (HARMONY-5517) [classlib][archive] simplifying archive code by fixing manifest encoding to UTF-8

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

Tim Ellison reassigned HARMONY-5517:
------------------------------------

    Assignee: Tim Ellison

> [classlib][archive] simplifying archive code by fixing manifest encoding to UTF-8
> ---------------------------------------------------------------------------------
>
>                 Key: HARMONY-5517
>                 URL: https://issues.apache.org/jira/browse/HARMONY-5517
>             Project: Harmony
>          Issue Type: Improvement
>          Components: Classlib
>            Reporter: Alexei Fedotov
>            Assignee: Tim Ellison
>         Attachments: remove_manifest_encoding.patch
>
>
> By specification [1] manifests are encoded in UTF-8. There is no need to make code more complex than that, so legacy of HARMONY-14 may be removed. Testing the patch.

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


[jira] Commented: (HARMONY-5517) [classlib][archive] simplifying archive code by fixing manifest encoding to UTF-8

Posted by "Alexei Fedotov (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-5517?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12578303#action_12578303 ] 

Alexei Fedotov commented on HARMONY-5517:
-----------------------------------------

I'm fine with it, thanks. I will close the issue after tests pass.

> [classlib][archive] simplifying archive code by fixing manifest encoding to UTF-8
> ---------------------------------------------------------------------------------
>
>                 Key: HARMONY-5517
>                 URL: https://issues.apache.org/jira/browse/HARMONY-5517
>             Project: Harmony
>          Issue Type: Improvement
>          Components: Classlib
>            Reporter: Alexei Fedotov
>            Assignee: Tim Ellison
>             Fix For: 5.0M6
>
>         Attachments: remove_manifest_encoding.patch, remove_manifest_encoding_2.patch, remove_manifest_encoding_3.patch
>
>
> By specification [1] manifests are encoded in UTF-8. There is no need to make code more complex than that, so legacy of HARMONY-14 may be removed. Testing the patch.
> [1] http://java.sun.com/javase/6/docs/technotes/guides/jar/jar.html

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


[jira] Resolved: (HARMONY-5517) [classlib][archive] simplifying archive code by fixing manifest encoding to UTF-8

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

Tim Ellison resolved HARMONY-5517.
----------------------------------

       Resolution: Fixed
    Fix Version/s: 5.0M6

Thanks for being patient Alexei.

A slightly modified version of the patch was applied to the ARCHIVE module at repo revision r636757.

Please check it was applied as you expected.


> [classlib][archive] simplifying archive code by fixing manifest encoding to UTF-8
> ---------------------------------------------------------------------------------
>
>                 Key: HARMONY-5517
>                 URL: https://issues.apache.org/jira/browse/HARMONY-5517
>             Project: Harmony
>          Issue Type: Improvement
>          Components: Classlib
>            Reporter: Alexei Fedotov
>            Assignee: Tim Ellison
>             Fix For: 5.0M6
>
>         Attachments: remove_manifest_encoding.patch, remove_manifest_encoding_2.patch, remove_manifest_encoding_3.patch
>
>
> By specification [1] manifests are encoded in UTF-8. There is no need to make code more complex than that, so legacy of HARMONY-14 may be removed. Testing the patch.
> [1] http://java.sun.com/javase/6/docs/technotes/guides/jar/jar.html

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


[jira] Updated: (HARMONY-5517) [classlib][archive] simplifying archive code by fixing manifest encoding to UTF-8

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

Alexei Fedotov updated HARMONY-5517:
------------------------------------

    Attachment: remove_manifest_encoding.patch

Tests passed.

> [classlib][archive] simplifying archive code by fixing manifest encoding to UTF-8
> ---------------------------------------------------------------------------------
>
>                 Key: HARMONY-5517
>                 URL: https://issues.apache.org/jira/browse/HARMONY-5517
>             Project: Harmony
>          Issue Type: Improvement
>          Components: Classlib
>            Reporter: Alexei Fedotov
>         Attachments: remove_manifest_encoding.patch
>
>
> By specification [1] manifests are encoded in UTF-8. There is no need to make code more complex than that, so legacy of HARMONY-14 may be removed. Testing the patch.

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


[jira] Updated: (HARMONY-5517) [classlib][archive] simplifying archive code by fixing manifest encoding to UTF-8

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

Alexei Fedotov updated HARMONY-5517:
------------------------------------

    Attachment: remove_manifest_encoding_2.patch

Updated the patch with respect to r628014. This time performed testing correctly.

> [classlib][archive] simplifying archive code by fixing manifest encoding to UTF-8
> ---------------------------------------------------------------------------------
>
>                 Key: HARMONY-5517
>                 URL: https://issues.apache.org/jira/browse/HARMONY-5517
>             Project: Harmony
>          Issue Type: Improvement
>          Components: Classlib
>            Reporter: Alexei Fedotov
>            Assignee: Tim Ellison
>         Attachments: remove_manifest_encoding.patch, remove_manifest_encoding_2.patch
>
>
> By specification [1] manifests are encoded in UTF-8. There is no need to make code more complex than that, so legacy of HARMONY-14 may be removed. Testing the patch.
> [1] http://java.sun.com/javase/6/docs/technotes/guides/jar/jar.html

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