You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Kevin Zhou (JIRA)" <ji...@apache.org> on 2008/06/05 11:07:45 UTC

[jira] Created: (HARMONY-5866) [classlib][beans] java.beans.XMLDecoder(4) always use Thread.currentThread().getContextClassLoader()

[classlib][beans] java.beans.XMLDecoder(4) always use Thread.currentThread().getContextClassLoader()
----------------------------------------------------------------------------------------------------

                 Key: HARMONY-5866
                 URL: https://issues.apache.org/jira/browse/HARMONY-5866
             Project: Harmony
          Issue Type: Bug
          Components: Classlib
    Affects Versions: 5.0M6
            Reporter: Kevin Zhou
             Fix For: 5.0M6


I read java.beans.XMLDecoder code and find that XMLDecoder(4) as follows:

public XMLDecoder(InputStream inputStream, Object owner, ExceptionListener listener, ClassLoader cl) {
        this(inputStream, owner, listener);
        defaultClassLoader = cl;
}

This constructor will first call XMLDecoder(3) which always use Thread.currentThread().getContextClassLoader() regardless of user's ClassLoader.
I think the solution is to set the deafultClassLoader first before use SAXParser to parse xml.


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


Re: [jira] Assigned: (HARMONY-5866) [classlib][beans] java.beans.XMLDecoder(4) always use Thread.currentThread().getContextClassLoader()

Posted by Kevin Zhou <zh...@gmail.com>.
Ok, thanks!

On Fri, Jun 6, 2008 at 5:30 PM, Sean Qiu (JIRA) <ji...@apache.org> wrote:

>
>     [
> https://issues.apache.org/jira/browse/HARMONY-5866?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel]
>
> Sean Qiu reassigned HARMONY-5866:
> ---------------------------------
>
>    Assignee: Sean Qiu
>
> > [classlib][beans] java.beans.XMLDecoder(4) always use
> Thread.currentThread().getContextClassLoader()
> >
> ----------------------------------------------------------------------------------------------------
> >
> >                 Key: HARMONY-5866
> >                 URL: https://issues.apache.org/jira/browse/HARMONY-5866
> >             Project: Harmony
> >          Issue Type: Bug
> >          Components: Classlib
> >    Affects Versions: 5.0M6
> >            Reporter: Kevin Zhou
> >            Assignee: Sean Qiu
> >             Fix For: 5.0M6
> >
> >         Attachments: HARMONY-5866.diff
> >
> >   Original Estimate: 24h
> >  Remaining Estimate: 24h
> >
> > I read java.beans.XMLDecoder code and find that XMLDecoder(4) as follows:
> > public XMLDecoder(InputStream inputStream, Object owner,
> ExceptionListener listener, ClassLoader cl) {
> >         this(inputStream, owner, listener);
> >         defaultClassLoader = cl;
> > }
> > This constructor will first call XMLDecoder(3) which always use
> Thread.currentThread().getContextClassLoader() regardless of user's
> ClassLoader.
> > I think the solution is to set the deafultClassLoader first before use
> SAXParser to parse xml.
>
> --
> This message is automatically generated by JIRA.
> -
> You can reply to this email to add a comment to the issue online.
>
>

[jira] Updated: (HARMONY-5866) [classlib][beans] java.beans.XMLDecoder(4) always use Thread.currentThread().getContextClassLoader()

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

Kevin Zhou updated HARMONY-5866:
--------------------------------

    Attachment: HARMONY-5866.diff

> [classlib][beans] java.beans.XMLDecoder(4) always use Thread.currentThread().getContextClassLoader()
> ----------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-5866
>                 URL: https://issues.apache.org/jira/browse/HARMONY-5866
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>    Affects Versions: 5.0M6
>            Reporter: Kevin Zhou
>             Fix For: 5.0M6
>
>         Attachments: HARMONY-5866.diff
>
>   Original Estimate: 24h
>  Remaining Estimate: 24h
>
> I read java.beans.XMLDecoder code and find that XMLDecoder(4) as follows:
> public XMLDecoder(InputStream inputStream, Object owner, ExceptionListener listener, ClassLoader cl) {
>         this(inputStream, owner, listener);
>         defaultClassLoader = cl;
> }
> This constructor will first call XMLDecoder(3) which always use Thread.currentThread().getContextClassLoader() regardless of user's ClassLoader.
> I think the solution is to set the deafultClassLoader first before use SAXParser to parse xml.

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


[jira] Commented: (HARMONY-5866) [classlib][beans] java.beans.XMLDecoder(4) always use Thread.currentThread().getContextClassLoader()

Posted by "Sean Qiu (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-5866?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12602966#action_12602966 ] 

Sean Qiu commented on HARMONY-5866:
-----------------------------------

Could you please add some testcase for your patch?
Thanks very much.

> [classlib][beans] java.beans.XMLDecoder(4) always use Thread.currentThread().getContextClassLoader()
> ----------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-5866
>                 URL: https://issues.apache.org/jira/browse/HARMONY-5866
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>    Affects Versions: 5.0M6
>            Reporter: Kevin Zhou
>            Assignee: Sean Qiu
>             Fix For: 5.0M6
>
>         Attachments: HARMONY-5866.diff
>
>   Original Estimate: 24h
>  Remaining Estimate: 24h
>
> I read java.beans.XMLDecoder code and find that XMLDecoder(4) as follows:
> public XMLDecoder(InputStream inputStream, Object owner, ExceptionListener listener, ClassLoader cl) {
>         this(inputStream, owner, listener);
>         defaultClassLoader = cl;
> }
> This constructor will first call XMLDecoder(3) which always use Thread.currentThread().getContextClassLoader() regardless of user's ClassLoader.
> I think the solution is to set the deafultClassLoader first before use SAXParser to parse xml.

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


[jira] Assigned: (HARMONY-5866) [classlib][beans] java.beans.XMLDecoder(4) always use Thread.currentThread().getContextClassLoader()

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

Sean Qiu reassigned HARMONY-5866:
---------------------------------

    Assignee: Sean Qiu

> [classlib][beans] java.beans.XMLDecoder(4) always use Thread.currentThread().getContextClassLoader()
> ----------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-5866
>                 URL: https://issues.apache.org/jira/browse/HARMONY-5866
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>    Affects Versions: 5.0M6
>            Reporter: Kevin Zhou
>            Assignee: Sean Qiu
>             Fix For: 5.0M6
>
>         Attachments: HARMONY-5866.diff
>
>   Original Estimate: 24h
>  Remaining Estimate: 24h
>
> I read java.beans.XMLDecoder code and find that XMLDecoder(4) as follows:
> public XMLDecoder(InputStream inputStream, Object owner, ExceptionListener listener, ClassLoader cl) {
>         this(inputStream, owner, listener);
>         defaultClassLoader = cl;
> }
> This constructor will first call XMLDecoder(3) which always use Thread.currentThread().getContextClassLoader() regardless of user's ClassLoader.
> I think the solution is to set the deafultClassLoader first before use SAXParser to parse xml.

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


[jira] Updated: (HARMONY-5866) [classlib][beans] java.beans.XMLDecoder(4) always use Thread.currentThread().getContextClassLoader()

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

Kevin Zhou updated HARMONY-5866:
--------------------------------

    Attachment: HARMONY-5866v2.diff

I have added some test cases. Thanks

> [classlib][beans] java.beans.XMLDecoder(4) always use Thread.currentThread().getContextClassLoader()
> ----------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-5866
>                 URL: https://issues.apache.org/jira/browse/HARMONY-5866
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>    Affects Versions: 5.0M6
>            Reporter: Kevin Zhou
>            Assignee: Sean Qiu
>             Fix For: 5.0M6
>
>         Attachments: HARMONY-5866.diff, HARMONY-5866v2.diff
>
>   Original Estimate: 24h
>  Remaining Estimate: 24h
>
> I read java.beans.XMLDecoder code and find that XMLDecoder(4) as follows:
> public XMLDecoder(InputStream inputStream, Object owner, ExceptionListener listener, ClassLoader cl) {
>         this(inputStream, owner, listener);
>         defaultClassLoader = cl;
> }
> This constructor will first call XMLDecoder(3) which always use Thread.currentThread().getContextClassLoader() regardless of user's ClassLoader.
> I think the solution is to set the deafultClassLoader first before use SAXParser to parse xml.

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


[jira] Updated: (HARMONY-5866) [classlib][beans] java.beans.XMLDecoder(4) always use Thread.currentThread().getContextClassLoader()

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

Kevin Zhou updated HARMONY-5866:
--------------------------------

    Attachment:     (was: HARMONY-5866.diff)

> [classlib][beans] java.beans.XMLDecoder(4) always use Thread.currentThread().getContextClassLoader()
> ----------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-5866
>                 URL: https://issues.apache.org/jira/browse/HARMONY-5866
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>    Affects Versions: 5.0M6
>            Reporter: Kevin Zhou
>             Fix For: 5.0M6
>
>   Original Estimate: 24h
>  Remaining Estimate: 24h
>
> I read java.beans.XMLDecoder code and find that XMLDecoder(4) as follows:
> public XMLDecoder(InputStream inputStream, Object owner, ExceptionListener listener, ClassLoader cl) {
>         this(inputStream, owner, listener);
>         defaultClassLoader = cl;
> }
> This constructor will first call XMLDecoder(3) which always use Thread.currentThread().getContextClassLoader() regardless of user's ClassLoader.
> I think the solution is to set the deafultClassLoader first before use SAXParser to parse xml.

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


[jira] Updated: (HARMONY-5866) [classlib][beans] java.beans.XMLDecoder(4) always use Thread.currentThread().getContextClassLoader()

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

Kevin Zhou updated HARMONY-5866:
--------------------------------

    Attachment: HARMONY-5866.diff

Please help me to try it

> [classlib][beans] java.beans.XMLDecoder(4) always use Thread.currentThread().getContextClassLoader()
> ----------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-5866
>                 URL: https://issues.apache.org/jira/browse/HARMONY-5866
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>    Affects Versions: 5.0M6
>            Reporter: Kevin Zhou
>             Fix For: 5.0M6
>
>         Attachments: HARMONY-5866.diff
>
>   Original Estimate: 24h
>  Remaining Estimate: 24h
>
> I read java.beans.XMLDecoder code and find that XMLDecoder(4) as follows:
> public XMLDecoder(InputStream inputStream, Object owner, ExceptionListener listener, ClassLoader cl) {
>         this(inputStream, owner, listener);
>         defaultClassLoader = cl;
> }
> This constructor will first call XMLDecoder(3) which always use Thread.currentThread().getContextClassLoader() regardless of user's ClassLoader.
> I think the solution is to set the deafultClassLoader first before use SAXParser to parse xml.

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


[jira] Resolved: (HARMONY-5866) [classlib][beans] java.beans.XMLDecoder(4) always use Thread.currentThread().getContextClassLoader()

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

Sean Qiu resolved HARMONY-5866.
-------------------------------

    Resolution: Fixed

Applied at r667023. Please verify if it works as you expected.Thanks.

> [classlib][beans] java.beans.XMLDecoder(4) always use Thread.currentThread().getContextClassLoader()
> ----------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-5866
>                 URL: https://issues.apache.org/jira/browse/HARMONY-5866
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>    Affects Versions: 5.0M6
>            Reporter: Kevin Zhou
>            Assignee: Sean Qiu
>             Fix For: 5.0M6
>
>         Attachments: HARMONY-5866.diff, HARMONY-5866v2.diff
>
>   Original Estimate: 24h
>  Remaining Estimate: 24h
>
> I read java.beans.XMLDecoder code and find that XMLDecoder(4) as follows:
> public XMLDecoder(InputStream inputStream, Object owner, ExceptionListener listener, ClassLoader cl) {
>         this(inputStream, owner, listener);
>         defaultClassLoader = cl;
> }
> This constructor will first call XMLDecoder(3) which always use Thread.currentThread().getContextClassLoader() regardless of user's ClassLoader.
> I think the solution is to set the deafultClassLoader first before use SAXParser to parse xml.

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