SUMMARY: Remove unnecessary new String() calls in JDBC driver. SUBMITTED BY: William Webber SUBMISSION DATE: Fri Sep 8 17:20:48 AEST 2000. VERSION PATCHED: Postgresql version 7.0.2. PATCH APPLICATION: From the directory postgresql-7.0.2/src/interfaces/jdbc, run: POSIXLY_CORRECT=true patch -p0 < new-string-jdbc.patch (POSIXLY_CORRECT is necessary with GNU patch.) DESCRIPTION OF PATCH: In Java, String objects are immutable. Because of this, it is never necessary to create a new String that is a copy of an existing one; it is always sufficient to return a reference to the existing String. (The only exception is if you do not want the '==' operator to return true for the original string and its copy, but this is not the case here.) Creating new Strings in these situations is stylistically peculiar, wastes time allocating the new object, wastes memory while the redundant object exists, and wastes garbage collection time when the object is garbage-collected. This patch removes a large number of such redundant String allocations from the JDBC source. COMPATIBILITY: This patch affects neither the interface nor the behaviour of the implementation of the JDBC driver.