Skip to content

Commit

Permalink
Fix an exception thrown out "legal boolean value: null" to run
Browse files Browse the repository at this point in the history
rptdesing (T52882)
For invalid boolean expression in highlight and visibility, only log
warning message, do not add exception into context
  • Loading branch information
gliu committed Sep 5, 2012
1 parent 26f3056 commit c4997ff
Showing 1 changed file with 5 additions and 7 deletions.
Expand Up @@ -16,6 +16,7 @@
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.logging.Level;
import java.util.logging.Logger;

import org.eclipse.birt.core.data.DataTypeUtil;
Expand All @@ -25,7 +26,6 @@
import org.eclipse.birt.data.engine.api.IQueryDefinition;
import org.eclipse.birt.report.engine.api.DataID;
import org.eclipse.birt.report.engine.api.DataSetID;
import org.eclipse.birt.report.engine.api.EngineException;
import org.eclipse.birt.report.engine.api.InstanceID;
import org.eclipse.birt.report.engine.content.IContent;
import org.eclipse.birt.report.engine.content.IGroupContent;
Expand Down Expand Up @@ -327,7 +327,10 @@ protected Boolean evaluateBoolean( Expression expr )
}
catch ( BirtException ex )
{
context.addException( ex );
getLogger( ).log(
Level.WARNING,
"Invalid boolean expression:"
+ ( expr == null ? "null" : expr.toString( ) ) );
}
return null;
}
Expand Down Expand Up @@ -528,9 +531,6 @@ protected void processVisibility( ReportItemDesign design, IContent content )
Boolean result = evaluateBoolean( expr );
if ( result == null )
{
context.addException( new EngineException(
MessageConstants.EXPRESSION_EVALUATION_ERROR, rule
.getExpression( ) ) );
continue;
}
boolean isHidden = result.booleanValue( );
Expand Down Expand Up @@ -573,8 +573,6 @@ protected void processColumnVisibility( ColumnDesign design, Column column )
Boolean result = evaluateBoolean( expr );
if ( result == null )
{
context.addException( new EngineException( MessageConstants.EXPRESSION_EVALUATION_ERROR, //$NON-NLS-1$
rule.getExpression( ) ) );
continue;
}
boolean isHidden = ( (Boolean) result ).booleanValue( );
Expand Down

0 comments on commit c4997ff

Please sign in to comment.