summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorlzhang2012-04-08 23:52:36 (EDT)
committer mwu2012-04-08 23:52:36 (EDT)
commit04aa00a48e1f37c231542c40108bc25fb53255bd (patch)
tree6f3750249ee11e2c3bf5b1c81b6c05022c7acb29
parentfd9cc6b84a1b95066573db801786b33dc71d4905 (diff)
downloadorg.eclipse.birt-04aa00a48e1f37c231542c40108bc25fb53255bd.zip
org.eclipse.birt-04aa00a48e1f37c231542c40108bc25fb53255bd.tar.gz
org.eclipse.birt-04aa00a48e1f37c231542c40108bc25fb53255bd.tar.bz2
NPE is thrown out when preview attached reports which contain xtab with
aggregation [48890]
-rw-r--r--data/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/olap/query/view/QueryExecutor.java33
1 files changed, 17 insertions, 16 deletions
diff --git a/data/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/olap/query/view/QueryExecutor.java b/data/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/olap/query/view/QueryExecutor.java
index 3874cf0..2b55839 100644
--- a/data/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/olap/query/view/QueryExecutor.java
+++ b/data/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/olap/query/view/QueryExecutor.java
@@ -295,26 +295,26 @@ public class QueryExecutor
{
IFilterDefinition filter = (IFilterDefinition) finalFilters.get( i );
boolean find = false;
- String bindingName = OlapExpressionCompiler.getReferencedScriptObject(filter.getExpression(), ScriptConstants.DATA_BINDING_SCRIPTABLE );
- if(executor.getCubeQueryDefinition().getCubeOperations().length>0)
+ String bindingName = OlapExpressionCompiler.getReferencedScriptObject( filter.getExpression( ), ScriptConstants.DATA_BINDING_SCRIPTABLE );
+ if( executor.getCubeQueryDefinition( ).getCubeOperations( ).length > 0 )
{
- ICubeOperation[] operations = executor.getCubeQueryDefinition().getCubeOperations();
- for( int j = 0 ; j < operations.length;j++)
+ ICubeOperation[] operations = executor.getCubeQueryDefinition( ).getCubeOperations( );
+ for( int j = 0 ; j < operations.length ; j++ )
{
- if ( operations[j] instanceof AddingNestAggregations )
- {
- AddingNestAggregations aggr = (AddingNestAggregations)operations[i];
- IBinding[] bindings = aggr.getNewBindings();
- for(int k = 0 ; k<bindings.length;k++)
+ if ( operations[j] instanceof AddingNestAggregations )
{
- if(bindings[k].getBindingName().equals(bindingName))
+ AddingNestAggregations aggr = (AddingNestAggregations)operations[i];
+ IBinding[] bindings = aggr.getNewBindings( );
+ for(int k = 0 ; k < bindings.length; k++)
{
- find = true;
- break;
+ if( bindings[k].getBindingName( ).equals( bindingName ) )
+ {
+ find = true;
+ break;
+ }
}
}
}
- }
}
if( find != fromCubeOperation )
@@ -776,7 +776,9 @@ public class QueryExecutor
rs = coe.execute( rs, stopSign );
int rsLenAfter = rs.length;
- if (rsLenBefore != rsLenAfter)
+ List noAggrUpdateFilters = getNoAggrUpdateFilters(executor
+ .getCubeQueryDefinition().getFilters());
+ if (rsLenBefore < rsLenAfter && noAggrUpdateFilters.size() > 0 )
{
IAggregationResultSet[] result = new IAggregationResultSet[rsLenAfter- rsLenBefore];
@@ -785,8 +787,7 @@ public class QueryExecutor
result[i] = rs[rsLenBefore + i];
}
- result = applyNoAggrUpdateFilters(getNoAggrUpdateFilters(executor
- .getCubeQueryDefinition().getFilters()), executor, result,
+ result = applyNoAggrUpdateFilters( noAggrUpdateFilters, executor, result,
view.getCube(), fetcher, true);
for (int i = 0; i < result.length; i++)