Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » BIRT » Possible Bug in 2.2 when processing extended content in LocalizedContentVisitor
Possible Bug in 2.2 when processing extended content in LocalizedContentVisitor [message #254043] Fri, 31 August 2007 01:06 Go to next message
S. Forbes is currently offline S. ForbesFriend
Messages: 35
Registered: July 2009
Member
Hi,

The problem I'm running into at the moment appears to be a bug at
org.eclipse.birt.report.engine.presentation.LocalizedContent Visitor
protected IContent processExtendedContent(IForeignContent content)

I've written a custom report item and I want it to be able to be used
within a table but also by itself.

And it pretty much works, except for the situation when the item ISN'T
embedded in a table but there IS a table in the report.

It seems that some new code in the LocalizedContentVisitor is trying to
create a SingleRowSet, but the result set it's trying to use is invalid
(and is sometimes even null).

At line 671

rowSets[0] = new SingleRowSet( context,
(IQueryResultSet) rsets[0] );

bombs out with

java.lang.NullPointerException
at
org.eclipse.birt.data.engine.impl.ResultIterator.getResultMe taData(ResultIterator.java:754)
at
org.eclipse.birt.report.engine.data.dte.QueryResultSet.getRe sultMetaData(QueryResultSet.java:367)
at
org.eclipse.birt.report.engine.extension.internal.RowSet.<init >(RowSet.java:57)
at
org.eclipse.birt.report.engine.extension.internal.SingleRowS et. <init>(SingleRowSet.java:23)
at
org.eclipse.birt.report.engine.presentation.LocalizedContent Visitor.processExtendedContent(LocalizedContentVisitor.java: 672)
at
org.eclipse.birt.report.engine.presentation.LocalizedContent Visitor.visitForeign(LocalizedContentVisitor.java:368)
at
org.eclipse.birt.report.engine.content.impl.ForeignContent.a ccept(ForeignContent.java:59)

I'm not sure why it's trying to create a row set at all, since the item
isn't embedded in the row set or associated with it in anyway.

An expansion of my understanding is more that welcome, but this seems like
a bug to me.

Cheers,
Shaun
Re: Possible Bug in 2.2 when processing extended content in LocalizedContentVisitor [message #254983 is a reply to message #254043] Tue, 11 September 2007 08:07 Go to previous messageGo to next message
S. Forbes is currently offline S. ForbesFriend
Messages: 35
Registered: July 2009
Member
Below is the fix that I have implemented, in case anyone is interested.
Sorry it's just a CVS diff from BIRT_2_2_0_Branch, but hopefully that
should be enough, I'm not sure what the correct procedure for submitting
these is.



RCS file: /cvsroot/birt/source/org.eclipse.birt.data/src/org/eclipse/b irt/data/engine/impl/ResultIterator.java,v
retrieving revision 1.86
diff -r1.86 ResultIterator.java
753a754,755
> if ( odiResult != null )
> {
754a757,761
> }
> else
> {
> return null;
> }




RCS file: /cvsroot/birt/source/org.eclipse.birt.report.engine/src/org/ eclipse/birt/report/engine/data/dte/QueryResultSet.java,v
retrieving revision 1.2
diff -r1.2 QueryResultSet.java
366c366,370
< else
---
> else {
> IResultMetaData md = rs.getResultMetaData();
> if ( md == null ) {
> return emptyResultMetaData;
> } else {
367a372,373
> }
> }




RCS file: /cvsroot/birt/source/org.eclipse.birt.report.engine/src/org/ eclipse/birt/report/engine/presentation/LocalizedContentVisi tor.java,v
retrieving revision 1.26.2.1
diff -r1.26.2.1 LocalizedContentVisitor.java
668c668
< if ( rsets != null )
---
> if ( rsets != null && rsets[0] != null )
Re: Possible Bug in 2.2 when processing extended content in LocalizedContentVisitor [message #255122 is a reply to message #254983] Tue, 11 September 2007 23:58 Go to previous messageGo to next message
S. Forbes is currently offline S. ForbesFriend
Messages: 35
Registered: July 2009
Member
Are are the actual updates also

org.eclipse.birt.data.engine.impl.ResultIterator

public IResultMetaData getResultMetaData( ) throws DataException
{
try
{
if ( odiResult != null )
{
return new ResultMetaData( odiResult.getResultClass( ) );
}
else
{
return null;
}
}
finally
{
logger.logp( Level.FINE,
ResultIterator.class.getName( ),
"getResultMetaData",
"Returns the result metadata" );
}
}





org.eclipse.birt.report.engine.data.dte.QueryResultSet

public IResultMetaData getResultMetaData( ) throws BirtException
{
if ( null == rs )
return emptyResultMetaData;
else {
IResultMetaData md = rs.getResultMetaData();
if ( md == null ) {
return emptyResultMetaData;
} else {
return rs.getResultMetaData( );
}
}
}




org.eclipse.birt.report.engine.presentation.LocalizedContent Viewer

if ( queries != null )
{
if ( rsets != null )
{
rowSets = new IRowSet[rsets.length];
for ( int i = 0; i < rowSets.length; i++ )
{
rowSets[i] = new RowSet( context,
(IQueryResultSet) rsets[i] );
}
}
}
else
{
if ( rsets != null && rsets[0] != null )
{
rowSets = new IRowSet[1];
rowSets[0] = new SingleRowSet( context,
(IQueryResultSet) rsets[0] );
}
}
Re: Possible Bug in 2.2 when processing extended content in LocalizedContentVisitor [message #255413 is a reply to message #255122] Fri, 14 September 2007 04:41 Go to previous message
S. Forbes is currently offline S. ForbesFriend
Messages: 35
Registered: July 2009
Member
Got my act together and created a bug report for this, bug #203031, and
it's already fixed! released in 2.2.1, great stuff.
Previous Topic:Property Binding not working on Data Sources from a Library
Next Topic:The AXIS engine could not find a target service to invoke! targetService is null
Goto Forum:
  


Current Time: Sat Nov 02 18:00:26 GMT 2024

Powered by FUDForum. Page generated in 0.03029 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top