summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpshi2011-11-14 02:27:27 (EST)
committer mwu2011-11-14 02:27:27 (EST)
commit6afe189efab6232be333babac3d7935abf9c58f8 (patch)
tree4c99edd3ccf8f8c5ec78e0841f0ae7ff7ba217e5
parent160d391314a504f51260820cdd8fdb30f434e79f (diff)
downloadorg.eclipse.birt-6afe189efab6232be333babac3d7935abf9c58f8.zip
org.eclipse.birt-6afe189efab6232be333babac3d7935abf9c58f8.tar.gz
org.eclipse.birt-6afe189efab6232be333babac3d7935abf9c58f8.tar.bz2
fix a null pointer bug when use two time functions, one use fixed date,
another use last date
-rw-r--r--data/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/olap/data/impl/aggregation/TimeFunctionCalculator.java12
1 files changed, 12 insertions, 0 deletions
diff --git a/data/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/olap/data/impl/aggregation/TimeFunctionCalculator.java b/data/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/olap/data/impl/aggregation/TimeFunctionCalculator.java
index ea2829d..9f482d6 100644
--- a/data/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/olap/data/impl/aggregation/TimeFunctionCalculator.java
+++ b/data/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/olap/data/impl/aggregation/TimeFunctionCalculator.java
@@ -660,6 +660,8 @@ public class TimeFunctionCalculator
int result = 0;
for( int i = 0; i < r.getLevelMembers().length; i++ )
{
+ if( m.member[i] == null )
+ continue;
result = r.getLevelMembers()[i].compareTo(m.member[i] );
if( result != 0 )
return result;
@@ -684,6 +686,12 @@ public class TimeFunctionCalculator
int result = 0;
for( int i = 0; i < m1.member.length; i++ )
{
+ if( m1.member[i] == null && m2.member[i] == null )
+ continue;
+ if( m1.member[i] == null )
+ return -1;
+ if( m2.member[i] == null )
+ return 1;
result = m1.member[i].compareTo( m2.member[i] );
if( result != 0 )
return result;
@@ -871,6 +879,8 @@ class MemberCellIndexComparator implements Comparator
|| sortType[i] == IDimensionSortDefn.SORT_UNDEFINED
|| sortType[i] == IDimensionSortDefn.SORT_ASC )
{
+ if( m1.member[i] == null && m2.member[i] == null )
+ continue;
if ( m1.member[i].compareTo( m2.member[i] ) < 0 )
{
return -1;
@@ -882,6 +892,8 @@ class MemberCellIndexComparator implements Comparator
}
else
{
+ if( m1.member[i] == null && m2.member[i] == null )
+ continue;
if ( m1.member[i].compareTo( m2.member[i] ) < 0 )
{
return 1;