Skip to content

Commit

Permalink
MONDRIAN
Browse files Browse the repository at this point in the history
       A bug was introduced in changelist 7218 which this checkin
       fixes. Basically, I mis-assumed that the TreeOp restriction
       value was stored as an Integer where in fact it is 
       stored as a String.

[git-p4: depot-paths = "//open/mondrian/": change = 7242]
  • Loading branch information
Richard Emberson committed Jul 24, 2006
1 parent 4fce584 commit e754190
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion src/main/mondrian/xmla/Rowset.java
Expand Up @@ -400,7 +400,21 @@ String getRestrictionValueAsString(RowsetDefinition.Column column) {
*/
int getRestrictionValueAsInt(RowsetDefinition.Column column) {
Object rval = getRestrictionValue(column);
return (rval instanceof Integer) ? ((Integer) rval).intValue() : -1;
if (rval instanceof String) {
try {
return Integer.parseInt((String)rval);
} catch (NumberFormatException ex) {
LOGGER.info("Rowset.getRestrictionValue: "+
"bad integer restriction \""+
rval+
"\"");
return -1;
}
} else if (rval instanceof Integer) {
return ((Integer) rval).intValue();
} else {
return -1;
}
}


Expand Down

0 comments on commit e754190

Please sign in to comment.