Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 351900 - NPE in UpdateContent#getInitializationId()
Summary: NPE in UpdateContent#getInitializationId()
Status: VERIFIED INVALID
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: BIRT (show other bugs)
Version: 2.6.2   Edit
Hardware: PC All
: P3 normal (vote)
Target Milestone: 4.4.1   Edit
Assignee: Yulin Wang CLA
QA Contact: Morris Kleiman CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-07-12 16:44 EDT by Brian de Alwis CLA
Modified: 2014-09-17 13:33 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Brian de Alwis CLA 2011-07-12 16:44:03 EDT
I normally have a breakpoint on NullPointerException, and have to add an exception for 
org.eclipse.birt.report.soapengine.api.UpdateContent#getInitializationId(int):

   public org.eclipse.birt.report.soapengine.api.ReportId getInitializationId(int i) {
        return this.initializationId[i];
    }

The field "initializationId" is null.  The parameter "i" is 0.

In my case, I'm rendering a report through the viewer servlet given a .rptdesign file.

Putting a write breakpoint on initializationId, execution is stopped in BirtChangeParameterActionHandler#doRenderPage() at line 90 calls setInitializationId():

		UpdateContent content = new UpdateContent( );
		content.setContent( DataUtil.toUTF8( page.toByteArray( ) ) );
		content.setTarget( operation.getTarget( ).getId( ) );
		content.setInitializationId( parseReportId( activeIds ) );     // line 90

The "activeIds" is an empty array.  #parseReportId() returns null.

The NPE seems to be eaten in org.apache.axis.encoding.ser.BeanSerializer, but I don't have the source code to trace through it.
Comment 1 Yulin Wang CLA 2014-09-04 18:02:30 EDT
This is expected behavior.
Looking into Apache Axis class "BeanSerializer" code, it requires Exception to break the while loop, otherwise endless loop will cause out of memory error.
Notice this NPE is just used internally, and won't cause any defects, so this behavior is not a bug.

Axis code for reference:

              int j = 0;
              while (j >= 0)
              {
                Object propValue = null;
                try
                {
                  propValue = this.propertyDescriptor[i].get(value, j);
                  
                  j++;
                }
                catch (Exception e)
                {
                  j = -1;
                }
                if (j >= 0) {
                  context.serialize(qname, null, propValue, xmlType, this.propertyDescriptor[i].getType());
                }
              }
Comment 2 Morris Kleiman CLA 2014-09-17 13:33:05 EDT
Based on Yulin's comment #1, this is being moved to Verified.

If there's something additional to add from the submitter, please update and reopen.