You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Andrew Cornwall (JIRA)" <ji...@apache.org> on 2008/10/09 19:50:44 UTC

[jira] Updated: (HARMONY-5986) [classlib][beans] XMLEncoder should check for null stat in recordStatement

     [ https://issues.apache.org/jira/browse/HARMONY-5986?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andrew Cornwall updated HARMONY-5986:
-------------------------------------

    Attachment: xmlencoder.patch2

It's possible for writeStatement() to be passed a null statement argument. This will fail when the superclass is asked to writeStatement(). This patch prevents this from happening (as well as keeping the test in recordStatement() just to be safe).

> [classlib][beans] XMLEncoder should check for null stat in recordStatement
> --------------------------------------------------------------------------
>
>                 Key: HARMONY-5986
>                 URL: https://issues.apache.org/jira/browse/HARMONY-5986
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>    Affects Versions: 5.0M6
>         Environment: HEAD - all platforms
>            Reporter: Andrew Cornwall
>            Priority: Minor
>         Attachments: xmlencoder.patch2
>
>
> In XMLEncoder.recordStatement(Statement), it's possible to pass in a null stat. This means there will be a NullPointerException on this code:
> 	private void recordStatement(Statement stat) {
> 		// deal with 'owner' property
> 		if (stat.getTarget() == owner && owner != null) {
> 			needOwner = true;
> 		}
> A workaround is to test for the null pointer explicitly:
> 	    if(null==stat) return;

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