[kepler-dev] [Bug 2240] - add support for null values to data passing among ports

bugzilla-daemon@ecoinformatics.org bugzilla-daemon at ecoinformatics.org
Wed Mar 1 07:09:51 PST 2006


http://bugzilla.ecoinformatics.org/show_bug.cgi?id=2240





------- Additional Comments From cxh at eecs.berkeley.edu  2006-03-01 07:09 -------
We did a review of the nil token work yesterday.
Two major issues:
1) Edward suggested:
   Why not make a static public member for nil token instead of nil token
   constructor (the copy constructor)? Advantage: zero overhead in memory
   because don't need boolean to identify whether is boolean.
2) We probably don't want to support nil tokens in DoubleMatrixTokens.
   Edward suggested:
  Should we just not support nil tokens in MatrixToken? Because of efficiency
  reasons. MatrixToken is supposed to support Java base types efficiently. If
  you want an array of tokens where some of them are nil, use ArrayToken. We
  don't want to mess with matrix manipulation algorithms to deal with nil. 

It would be nice to address these issues.  I'll have a little time today, but
more time tomorrow.  Also, I won't be able to make the telcon at 11:30, I
have prior commitments.

Below is the contents of the review.

Identified defects

    * Token
         1. isNil() comment: Should link to protected method be in public method
comment? [eal]
         2. _nil(): Should be renamed. Seems like make nil. [eal]
         3. toString() comment: There is no nil() method. [eal]
         4. _newNilToken(Type): Shifting a type error to runtime? See issue
about static public member. [eal] 
    * DoubleToken
         1. DoubleToken(String): What is the difference between a
DoubleToken("nil") and a StringToken("nil")? What if we actually want a token
that has the string "nil"? Maybe should not parse the string "nil" in any token
class? Push this to expression language parser? [eal, acataldo] 
    * ArrayToken
         1. ArrayToken(Token[]): In code, when looking for first non-nil token
to get the type, is this already in the expression parser? [eal]
         2. ArrayToken(Token[]): This should be able to take a null argument. In
this case, it should then create a nil token of type ArrayToken. (Under current
design). Right now this doesn't support "being a nil", rather than "containing a
nil". [eal]
         3. ArrayToken(Token): This code will give a null pointer exception
(assigns token of length 0, then tries to address the first (zero'th) element).
Delete 3 lines (if statement). [eal] 
    * MatrixToken
         1. method name: description of error [login] 
    * DoubleMatrixToken
         1. method name: description of error [login] 

Related issues

   1. Is a nil token equal to another nil token? What does Java do about NaN?
[actaldo/cxh]
   2. Why not make a static public member for nil token instead of nil token
constructor (the copy constructor)? Advantage: zero overhead in memory because
don't need boolean to identify whether is boolean. [eal]
   3. Do we have sparse array storage in Pt? [sprinkle]
   4. Do we need a nil type to be at the bottom of the type lattice (it would be
convertible to any type.)? Maybe it already does? Need expression language to
support it. [eal]
   5. More static public member suggestions:

      DoubleToken.convert(Token t) {
        if (t.isNil()) {
          return NIL;  //NIL is a const.
        }  
      }

      [eal]
   6. Should we just not support nil tokens in MatrixToken? Because of
efficiency reasons. MatrixToken is supposed to support Java base types
efficiently. If you want an array of tokens where some of them are nil, use
ArrayToken. We don't want to mess with matrix manipulation algorithms to deal
with nil. [eal]


More information about the Kepler-dev mailing list