(String name, Object value)
| 1608 | // if (value instanceof ConsString) value = value.toString(); //jdk9 module security breaks this |
| 1609 | if (value != null && value.getClass().getName().endsWith("ConsString")) value = "" + value; |
| 1610 | |
| 1611 | Dict.Prop canon = new Dict.Prop(name).toCanon(); |
| 1612 | |
| 1613 | if (canon.getAttributes().isTrue(Dict.readOnly, false)) |
| 1614 | throw new IllegalArgumentException("can't write to property " + name); |
| 1615 | |
| 1616 | if (value instanceof ThreadSync2.TrappedSet) { |
| 1617 | Object firstValue = ((ThreadSync2.TrappedSet) value).next(); |
| 1618 | |
| 1619 | Object r = asMap_set(name, firstValue); |
| 1620 | |
| 1621 | new Drivers().provokeCurrentFibre(System.identityHashCode(this) + "_" + name, new Function1<Object, Object>() { |
| 1622 | |
| 1623 | Object was = null; |
| 1624 | |
| 1625 | @Override |
| 1626 | public Object invoke(Object o) { |
| 1627 | if (o != null && !safeEq(was, o)) { |
| 1628 | was = o; |
| 1629 | modify(); |
| 1630 | asMap_set(name, o); |
| 1631 | } |
| 1632 | return o; |
| 1633 | } |
| 1634 | }, ((ThreadSync2.TrappedSet) value)); |
| 1635 | |
| 1636 | return r; |
| 1637 | } |
| 1638 | |
| 1639 | Function<Object, Object> c = canon.getAttributes().get(Dict.customCaster); |
| 1640 | if (c != null) |
| 1641 | value = c.apply(value); |
| 1642 | Object converted = convert(value, canon.getTypeInformation()); |
| 1643 | |
| 1644 | attributes.put(canon, converted); |
| 1645 | |
| 1646 | |
| 1647 | modify(); |
| 1648 | |
| 1649 | return this; |
| 1650 | } |
| 1651 | |
| 1652 | @Override |
| 1653 | @HiddenInAutocomplete |
| 1654 | public boolean asMap_delete(Object o) { |
| 1655 | modify(); |
| 1656 | return attributes.asMap_delete(o); |
| 1657 | } |
| 1658 | |
| 1659 | @HiddenInAutocomplete |
| 1660 | public Object convert(Object value, List<Class> fit) { |
no test coverage detected