From: dmp <danap@ttc-cmc.net>
To: pgsql-jdbc@postgresql.org
Subject: Re: Cleanup patch: Change from Vector/Hashtable to ArrayList/HashMap
Date: Sun, 06 May 2012 12:03:50 -0600
Message-ID: <4FA6BD06.4060308@ttc-cmc.net> (raw)
Mikko Tiihonen wrote:
> Hi,
>
> Here are two small cleanup patches.
>
> First one replaces all Vector references with List (usage) and ArrayList
> (creation).
> Second replaces all Hashtable references with Map (usage) and HashMap
> (creation).
>
> Reasons:
> * Theoretically faster since the ArrayList/HashMap are not synchronized
> * Using interfaces makes changing of List/Map implementations easier at
> later time
> * Vector/Hashtable were deprecated already in Java 1.2
My JDK 6 documentation gives no indication that either Vector or Hashtable
as being deprecated. Rather them being retrofitted into the Collectionss
Framework at 1.2. The main difference being that as you said they are
synchronized, which a developer may wish to have for that type of data
structure.
danap.
>
> -Mikko
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-jdbc@postgresql.org
Cc: danap@ttc-cmc.net
Subject: Re: Cleanup patch: Change from Vector/Hashtable to ArrayList/HashMap
In-Reply-To: <4FA6BD06.4060308@ttc-cmc.net>
References: <4FA6BD06.4060308@ttc-cmc.net>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox