code: public void setValue( Object value, int context )
          throws UtilEvalError
      {
  
          // prevent final variable re-assign
          if (hasModifier("final")) {
              if (this.value != null)
                  throw new UtilEvalError("Cannot re-assign final variable "+name+".");
              if (value == null)
                  return;
          }
  
          // TODO: should add isJavaCastable() test for strictJava
          // (as opposed to isJavaAssignable())
          if ( type != null && type != Object.class && value != null ) {
              this.value = Types.castObject( value, type,
                  context == DECLARATION ? Types.CAST : Types.ASSIGNMENT
              );
              value = this.value;
          }
  
          this.value = value;
  
          if ( this.value == null && context != DECLARATION )
              this.value = Primitive.getDefaultValue( type );
  
          if ( lhs != null )
              this.value = lhs.assign( this.value, false/*strictjava*/ );
  
      }
docs: Set the value of the typed variable.
  @param value should be an object or wrapped bsh Primitive type.
  if value is null the appropriate default value will be set for the
  type: e.g. false for boolean, zero for integer types.