HPInc / jipp

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

Collection changes don't stick #96

Closed GladeDiviney closed 4 years ago

GladeDiviney commented 4 years ago

Given:

MediaCol col = new MediaCol();
col.setMediaType(Types.mediaType.of("envelope"))
System.out.println(col)
col.setMediaType(Types.mediaType.of("label"))
System.out.println(col)

Expected:

MediaCol(media-type=envelope)
MediaCol(media-type=label)

Received:

MediaCol(media-type=envelope)
MediaCol(media-type=envelope)

Why:

The first println causes access to a lazy constructed list which freezes the internal values. Shouldn't do this.

GladeDiviney commented 4 years ago

Dup of #97