PDA

View Full Version : [Mondrian] Assert not conforming documentation



Pappyn Bart
04-26-2007, 06:10 AM
I would like to return SetType(null) in a user defined function. The
documentation says it is ok to pass null in case the type is not known.

But the following code :

public class SetType implements Type {

private final Type elementType;

/**
* Creates a type representing a set of elements of a given type.
*
* @param elementType The type of the elements in the set, or null
if not
* known
*/
public SetType(Type elementType) {
assert elementType instanceof MemberType ||
elementType instanceof TupleType;
this.elementType = elementType;
}

-> In case null is passed, then this will raise an assertion failure.

Kind regards,
Bart


_______________________________________________
Mondrian mailing list
Mondrian (AT) pentaho (DOT) org
http://lists.pentaho.org/mailman/listinfo/mondrian

Julian Hyde
05-01-2007, 01:10 PM
Bart,

You are correct. Feel free to change that assert.

Julian


_____

From: mondrian-bounces (AT) pentaho (DOT) org [mailto:mondrian-bounces (AT) pentaho (DOT) org]
On Behalf Of Pappyn Bart
Sent: Thursday, April 26, 2007 3:07 AM
To: Mondrian developer mailing list
Subject: [Mondrian] Assert not conforming documentation


I would like to return SetType(null) in a user defined function. The
documentation says it is ok to pass null in case the type is not known.

But the following code :

public class SetType implements Type {

private final Type elementType;

/**
* Creates a type representing a set of elements of a given type.
*
* @param elementType The type of the elements in the set, or null
if not
* known
*/
public SetType(Type elementType) {
assert elementType instanceof MemberType ||
elementType instanceof TupleType;
this.elementType = elementType;
}

-> In case null is passed, then this will raise an assertion failure.

Kind regards,
Bart



_______________________________________________
Mondrian mailing list
Mondrian (AT) pentaho (DOT) org
http://lists.pentaho.org/mailman/listinfo/mondrian