This is an automated email from the git hooks/post-receive script. ebourg-guest pushed a commit to tag REL8_3_607 in repository libpostgresql-jdbc-java.
commit 18cd4ee613d9a85d523defaa10fa451545994a55 Author: Kris Jurka <[email protected]> Date: Tue Aug 10 18:18:47 2010 +0000 Fix a minor concurrency issue during the setup for processing escape functions. Pierre Queinnec --- org/postgresql/jdbc2/EscapedFunctions.java | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/org/postgresql/jdbc2/EscapedFunctions.java b/org/postgresql/jdbc2/EscapedFunctions.java index 2f65630..5644ece 100644 --- a/org/postgresql/jdbc2/EscapedFunctions.java +++ b/org/postgresql/jdbc2/EscapedFunctions.java @@ -3,7 +3,7 @@ * Copyright (c) 2004-2008, PostgreSQL Global Development Group * * IDENTIFICATION -* $PostgreSQL: pgjdbc/org/postgresql/jdbc2/EscapedFunctions.java,v 1.10.2.1 2008/02/19 06:12:33 jurka Exp $ +* $PostgreSQL: pgjdbc/org/postgresql/jdbc2/EscapedFunctions.java,v 1.10.2.2 2008/11/16 12:14:17 jurka Exp $ * *------------------------------------------------------------------------- */ @@ -116,23 +116,25 @@ public class EscapedFunctions { /** storage for functions implementations */ - private static Map functionMap = null; - + private static Map functionMap = createFunctionMap(); + + private static Map createFunctionMap() { + Method[] arrayMeths = EscapedFunctions.class.getDeclaredMethods(); + Map functionMap = new HashMap(arrayMeths.length*2); + for (int i=0;i<arrayMeths.length;i++){ + Method meth = arrayMeths[i]; + if (meth.getName().startsWith("sql")) + functionMap.put(meth.getName().toLowerCase(Locale.US),meth); + } + return functionMap; + } + /** * get Method object implementing the given function * @param functionName name of the searched function * @return a Method object or null if not found */ public static Method getFunction(String functionName){ - if (functionMap==null){ - Method[] arrayMeths = EscapedFunctions.class.getDeclaredMethods(); - functionMap = new HashMap(arrayMeths.length*2); - for (int i=0;i<arrayMeths.length;i++){ - Method meth = arrayMeths[i]; - if (meth.getName().startsWith("sql")) - functionMap.put(meth.getName().toLowerCase(Locale.US),meth); - } - } return (Method) functionMap.get("sql"+functionName.toLowerCase(Locale.US)); } -- Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-java/libpostgresql-jdbc-java.git _______________________________________________ pkg-java-commits mailing list [email protected] http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-java-commits

