commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Damjan Jovanovic (Commented) (JIRA)" <>
Subject [jira] [Commented] (SANSELAN-42) IPTCConstants: final arrays are not immutable
Date Sun, 05 Feb 2012 19:35:53 GMT


Damjan Jovanovic commented on SANSELAN-42:

formats.png.ScanExpediterInterlaced.Starting_Row etc. - made private in revision 1240779.


How to make immutable arrays? Making getters that return a clone is slow. Collections.unmodifiableList()
of a List of Bytes is a horrible waste. ByteBuffer.asReadOnlyBuffer() might be an idea, but
that needs a bunch of utility methods to compare arrays with those buffers, etc. Affects:
formats.jpeg.JpegConstants.EOI, SOI, MARKERS etc (many in that class)

The entire set of TIFF classes needs a redesign - it's way too complex for what it does, and
yet incomplete for many things:
formats.tiff.constants.TiffFieldTypeConstants.FIELD_TYPE_ANY et.c

> IPTCConstants: final arrays are not immutable
> ---------------------------------------------
>                 Key: SANSELAN-42
>                 URL:
>             Project: Commons Sanselan
>          Issue Type: Bug
>            Reporter: Sebb
> formats.jpeg.iptc.IPTCConstants contains the following public static final arrays:
> Array element are not immutable, even if the array itself is, so the entries could potentially
be corrupted accidentally or deliberately.
> IPTC_PREFIX does not appear to be used, so could perhaps be deleted. If not, it could
be made private and a getter added.
> IPTC_TYPES only appears to be used in IPTCTypeLookup, so could potentially be moved there
and made private.

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:!default.jspa
For more information on JIRA, see:


View raw message