Place an unwrapped value in the external map. BeanShell primitive types are represented by their object wrappers, so it is not possible to differentiate between wrapper types and primitive types via the external Map.
( String name, Object value )
| 269 | types via the external Map. |
| 270 | */ |
| 271 | protected void putExternalMap( String name, Object value ) |
| 272 | { |
| 273 | if ( value instanceof Variable ) |
| 274 | try { |
| 275 | value = unwrapVariable( (Variable)value ); |
| 276 | } catch ( UtilEvalError ute ) { |
| 277 | // There should be no case for this. unwrapVariable throws |
| 278 | // UtilEvalError in some cases where it holds an LHS or array |
| 279 | // index. |
| 280 | throw new InterpreterError("unexpected UtilEvalError"); |
| 281 | } |
| 282 | |
| 283 | if ( value instanceof Primitive ) |
| 284 | value = Primitive.unwrap( (Primitive)value ); |
| 285 | |
| 286 | externalMap.put( name, value ); |
| 287 | } |
| 288 | } |
| 289 |
no test coverage detected