RFR: 8298447: Unnecessary Vector usage in DocPrintJob implementations

SWinxy duke at openjdk.org
Fri Dec 9 06:50:40 UTC 2022


On Mon, 5 Dec 2022 08:23:58 GMT, Andrey Turbanov <aturbanov at openjdk.org> wrote:

> There are 3 implementations of javax.print.DocPrintJob in the JDK (It seems they were copy-pasted from each other):
> 1. PSStreamPrintJob
> 2. UnixPrintJob
> 3. Win32PrintJob
> 
> They have Vector fields 'jobListeners', 'attrListeners', 'listenedAttributeSets', but they are always accessed only under synchronized(this) blocks. It means we can safely replace them with ArrayList.
> 
> BTW. 'attrListeners' and 'listenedAttributeSets' seems unused.

I would prefer if that the fields were of type `List` instead of `ArrayList`.

-------------

Changes requested by SWinxy at github.com (no known OpenJDK username).

PR: https://git.openjdk.org/jdk/pull/11504



More information about the client-libs-dev mailing list