HPInc / jipp

A Java-compatible implementation of IPP
MIT License
153 stars 42 forks source link

Cannot modify collection in-place #98

Closed GladeDiviney closed 4 years ago

GladeDiviney commented 4 years ago

This fails:

MutableAttributeGroup group = mutableGroupOf(operationAttributes, Types.finishingsCol.of(new FinishingsCol()));
group.get(Types.finishingsCol).get(0).setImpositionTemplate(new KeywordOrName(ImpositionTemplate.signature));
assertEquals(ImpositionTemplate.signature, group.get(Types.finishingsCol).get(0).getImpositionTemplate().getKeyword());

because the collection is coerced and recreated each time on exit each time due to the fix for #91. But it really doesn't need to be coerced and if the user wishes to modify it in place, this should be allowed.

(It would of course be better NOT to allow modification of collection types to prevent this sort of ambiguity, but Java doesn't support the copy-constructor.)