harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrew Cornwall (JIRA)" <j...@apache.org>
Subject [jira] Updated: (HARMONY-5986) [classlib][beans] XMLEncoder should check for null stat in recordStatement
Date Tue, 28 Oct 2008 22:04:46 GMT

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

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

    Attachment: patch5986-output.patch

I agree that writing something is better than doing nothing. Having said that, I'm not exactly
sure what the right thing to write is, or where to write it - but the attached code which
writes the "expected" output to stderr seems reasonable.

> [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
>            Assignee: Sian January
>            Priority: Minor
>         Attachments: patch5986-output.patch, 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.


Mime
View raw message