From 9ca07c08df7c6c835e72aa71006a80785bf76c4f Mon Sep 17 00:00:00 2001 From: samskivert Date: Wed, 19 Nov 2008 23:32:59 +0000 Subject: [PATCH] Fixed some StringBuilder wonkiness. git-svn-id: https://samskivert.googlecode.com/svn/trunk@2488 6335cc39-0255-0410-8fd6-9bcaacd3b74c --- .../samskivert/jdbc/PostgreSQLLiaison.java | 22 ++++++++++++------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/src/java/com/samskivert/jdbc/PostgreSQLLiaison.java b/src/java/com/samskivert/jdbc/PostgreSQLLiaison.java index 344cd749..f271aef9 100644 --- a/src/java/com/samskivert/jdbc/PostgreSQLLiaison.java +++ b/src/java/com/samskivert/jdbc/PostgreSQLLiaison.java @@ -103,26 +103,32 @@ public class PostgreSQLLiaison extends BaseLiaison executeQuery( conn, "ALTER TABLE " + tableSQL(table) + " ALTER COLUMN " + columnSQL(column) + " TYPE " + type); - lbuf.append("type=" + type); + lbuf.append("type=").append(type); } if (nullable != null) { executeQuery( conn, "ALTER TABLE " + tableSQL(table) + " ALTER COLUMN " + columnSQL(column) + - " " + (nullable.booleanValue() ? "SET NOT NULL" : "DROP NOT NULL")); - if (lbuf.length() > 0) lbuf.append(", "); - lbuf.append("nullable=" + nullable); + " " + (nullable ? "SET NOT NULL" : "DROP NOT NULL")); + if (lbuf.length() > 0) { + lbuf.append(", "); + } + lbuf.append("nullable=").append(nullable); } if (unique != null) { // TODO: I think this requires ALTER TABLE DROP CONSTRAINT and so on - if (lbuf.length() > 0) lbuf.append(", "); - lbuf.append("unique=" + unique + " (not implemented yet)"); + if (lbuf.length() > 0) { + lbuf.append(", "); + } + lbuf.append("unique=").append(unique).append(" (not implemented yet)"); } if (defaultValue != null) { executeQuery( conn, "ALTER TABLE " + tableSQL(table) + " ALTER COLUMN " + columnSQL(column) + " " + (defaultValue.length() > 0 ? "SET DEFAULT " + defaultValue : "DROP DEFAULT")); - if (lbuf.length() > 0) lbuf.append(", "); - lbuf.append("defaultValue=" + defaultValue); + if (lbuf.length() > 0) { + lbuf.append(", "); + } + lbuf.append("defaultValue=").append(defaultValue); } log.info("Database column '" + column + "' of table '" + table + "' modified to have " + "definition [" + lbuf + "].");