[Libreoffice-commits] core.git: Branch 'aoo/trunk' - 3 commits - connectivity/java javaunohelper/com

Damjan Jovanovic damjan at apache.org
Sun Sep 17 02:09:52 UTC 2017


 connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/PostgresqlCatalog.java                                     |   19 --
 connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/PostgresqlConnection.java                                  |   43 +----
 connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/PostgresqlDriver.java                                      |   22 --
 connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/PostgresqlPreparedStatement.java                           |   57 ------
 connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/PostgresqlResultSet.java                                   |   86 ----------
 connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/PostgresqlStatement.java                                   |   28 ---
 connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/PostgresqlTable.java                                       |   20 --
 connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/PostgresqlTables.java                                      |    7 
 connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/comphelper/PropertySet.java                                |   78 +++------
 connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/comphelper/PropertySetAdapter.java                         |    7 
 connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/OCatalog.java                                        |   74 +++-----
 connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/OColumn.java                                         |   44 -----
 connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/OColumnContainer.java                                |    4 
 connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/ODescriptor.java                                     |    9 -
 connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/OIndex.java                                          |   14 -
 connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/OIndexColumn.java                                    |   28 ---
 connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/OIndexColumnContainer.java                           |    4 
 connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/OIndexContainer.java                                 |    4 
 connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/OKey.java                                            |   35 +---
 connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/OKeyColumn.java                                      |   32 ---
 connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/OKeyColumnContainer.java                             |    6 
 connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/OKeyContainer.java                                   |   16 -
 connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/OTable.java                                          |   42 +---
 connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/SqlTableHelper.java                                  |   13 -
 connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/descriptors/SdbcxColumnDescriptor.java               |    9 -
 connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/descriptors/SdbcxColumnDescriptorContainer.java      |    2 
 connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/descriptors/SdbcxIndexColumnDescriptor.java          |    9 -
 connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/descriptors/SdbcxIndexColumnDescriptorContainer.java |    2 
 connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/descriptors/SdbcxIndexDescriptor.java                |   11 -
 connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/descriptors/SdbcxIndexDescriptorContainer.java       |    2 
 connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/descriptors/SdbcxKeyColumnDescriptor.java            |    9 -
 connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/descriptors/SdbcxKeyColumnDescriptorContainer.java   |    2 
 connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/descriptors/SdbcxKeyDescriptor.java                  |   11 -
 connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/descriptors/SdbcxKeyDescriptorContainer.java         |    2 
 connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/descriptors/SdbcxTableDescriptor.java                |   13 -
 connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/util/DatabaseMetaDataResultSet.java                        |   64 +++----
 connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/util/DbTools.java                                          |   15 -
 javaunohelper/com/sun/star/lib/uno/helper/ComponentBase.java                                                                        |   15 +
 38 files changed, 242 insertions(+), 616 deletions(-)

New commits:
commit ce466910b4cf6766b261b4ad1b7f0ded75c0d81c
Author: Damjan Jovanovic <damjan at apache.org>
Date:   Sun Sep 17 01:03:04 2017 +0000

    There is no need to use Any.VOID when Java's null gets translated to it
    
    automatically.
    
    Patch by: me

diff --git a/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/PostgresqlCatalog.java b/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/PostgresqlCatalog.java
index ad66cf6de697..80039c7255c9 100644
--- a/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/PostgresqlCatalog.java
+++ b/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/PostgresqlCatalog.java
@@ -31,7 +31,6 @@ import com.sun.star.sdbc.XRow;
 import com.sun.star.sdbcx.comp.postgresql.comphelper.CompHelper;
 import com.sun.star.sdbcx.comp.postgresql.sdbcx.OCatalog;
 import com.sun.star.sdbcx.comp.postgresql.sdbcx.OContainer;
-import com.sun.star.uno.Any;
 import com.sun.star.uno.UnoRuntime;
 
 public class PostgresqlCatalog extends OCatalog {
@@ -44,7 +43,7 @@ public class PostgresqlCatalog extends OCatalog {
         XResultSet results = null;
         try {
             // Using { "VIEW", "TABLE", "%" } shows INFORMATION_SCHEMA and others, but it also shows indexes :-(
-            results = metadata.getTables(Any.VOID, "%", "%", new String[] { "VIEW", "TABLE" });
+            results = metadata.getTables(null, "%", "%", new String[] { "VIEW", "TABLE" });
             XRow row = UnoRuntime.queryInterface(XRow.class, results);
             List<String> names = new ArrayList<>();
             while (results.next()) {
@@ -64,7 +63,7 @@ public class PostgresqlCatalog extends OCatalog {
     public OContainer refreshViews() {
         XResultSet results = null;
         try {
-            results = metadata.getTables(Any.VOID, "%", "%", new String[] { "VIEW" });
+            results = metadata.getTables(null, "%", "%", new String[] { "VIEW" });
             XRow row = UnoRuntime.queryInterface(XRow.class, results);
             List<String> names = new ArrayList<>();
             while (results.next()) {
diff --git a/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/PostgresqlTables.java b/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/PostgresqlTables.java
index 0da3d66ac64d..ed0f97d3cdf6 100644
--- a/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/PostgresqlTables.java
+++ b/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/PostgresqlTables.java
@@ -41,7 +41,6 @@ import com.sun.star.sdbcx.comp.postgresql.util.DbTools;
 import com.sun.star.sdbcx.comp.postgresql.util.DbTools.NameComponents;
 import com.sun.star.sdbcx.comp.postgresql.util.PropertyIds;
 import com.sun.star.sdbcx.comp.postgresql.util.StandardSQLState;
-import com.sun.star.uno.Any;
 import com.sun.star.uno.AnyConverter;
 import com.sun.star.uno.UnoRuntime;
 
@@ -58,7 +57,7 @@ public class PostgresqlTables extends OContainer {
     @Override
     public XPropertySet createObject(String name) throws SQLException {
         NameComponents nameComponents = DbTools.qualifiedNameComponents(metadata, name, ComposeRule.InDataManipulation);
-        Object queryCatalog = nameComponents.getCatalog().isEmpty() ? Any.VOID : nameComponents.getCatalog();
+        Object queryCatalog = nameComponents.getCatalog().isEmpty() ? null : nameComponents.getCatalog();
         XPropertySet ret = null;
         XResultSet results = null;
         try {
diff --git a/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/SqlTableHelper.java b/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/SqlTableHelper.java
index 15da0af32b51..03e1459599aa 100644
--- a/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/SqlTableHelper.java
+++ b/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/SqlTableHelper.java
@@ -39,7 +39,6 @@ import com.sun.star.sdbcx.comp.postgresql.util.ComposeRule;
 import com.sun.star.sdbcx.comp.postgresql.util.DbTools;
 import com.sun.star.sdbcx.comp.postgresql.util.Osl;
 import com.sun.star.sdbcx.comp.postgresql.util.StandardSQLState;
-import com.sun.star.uno.Any;
 import com.sun.star.uno.UnoRuntime;
 
 public class SqlTableHelper {
@@ -143,7 +142,7 @@ public class SqlTableHelper {
 
     private OKey readPrimaryKey(XDatabaseMetaData metadata,
             String catalogName, String schemaName, String tableName, boolean isCaseSensitive, OTable table) throws SQLException {
-        Object catalog = Any.VOID;
+        Object catalog = null;
         if (!catalogName.isEmpty()) {
             catalog = catalogName;
         }
@@ -176,7 +175,7 @@ public class SqlTableHelper {
 
     private void readForeignKeys(XDatabaseMetaData metadata,
             String catalogName, String schemaName, String tableName, boolean isCaseSensitive, Map<String, OKey> keys, OTable table) throws SQLException {
-        Object catalog = Any.VOID;
+        Object catalog = null;
         if (!catalogName.isEmpty()) {
             catalog = catalogName;
         }
@@ -233,7 +232,7 @@ public class SqlTableHelper {
     }
 
     public ArrayList<String> readIndexes(XDatabaseMetaData metadata, String catalogName, String schemaName, String tableName, OTable table) throws SQLException {
-        Object catalog = Any.VOID;
+        Object catalog = null;
         if (!catalogName.isEmpty()) {
             catalog = catalogName;
         }
diff --git a/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/util/DbTools.java b/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/util/DbTools.java
index f4ebf8a7d74f..36dc672752ae 100644
--- a/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/util/DbTools.java
+++ b/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/util/DbTools.java
@@ -55,7 +55,6 @@ import com.sun.star.sdbcx.XColumnsSupplier;
 import com.sun.star.sdbcx.XKeysSupplier;
 import com.sun.star.sdbcx.comp.postgresql.comphelper.CompHelper;
 import com.sun.star.sdbcx.comp.postgresql.sdbcx.OColumnContainer.ExtraColumnInfo;
-import com.sun.star.uno.Any;
 import com.sun.star.uno.AnyConverter;
 import com.sun.star.uno.UnoRuntime;
 
@@ -302,7 +301,7 @@ public class DbTools {
             }
             return nameComponents;
         } catch (IllegalArgumentException | WrappedTargetException | UnknownPropertyException exception) {
-            throw new SQLException("Error", Any.VOID, StandardSQLState.SQL_GENERAL_ERROR.text(), 0, exception);
+            throw new SQLException("Error", null, StandardSQLState.SQL_GENERAL_ERROR.text(), 0, exception);
         }
     }
 
@@ -444,7 +443,7 @@ public class DbTools {
 
             return String.format("CREATE TABLE %s (%s", composedName, columnText.toString());
         } catch (IllegalArgumentException | WrappedTargetException | UnknownPropertyException | IndexOutOfBoundsException exception) {
-            throw new SQLException("Error", Any.VOID, StandardSQLState.SQL_GENERAL_ERROR.text(), 0, exception);
+            throw new SQLException("Error", null, StandardSQLState.SQL_GENERAL_ERROR.text(), 0, exception);
         }
     }
 
@@ -567,7 +566,7 @@ public class DbTools {
 
             return sql.toString();
         } catch (IllegalArgumentException | WrappedTargetException | UnknownPropertyException exception) {
-            throw new SQLException("Error", Any.VOID, StandardSQLState.SQL_GENERAL_ERROR.text(), 0, exception);
+            throw new SQLException("Error", null, StandardSQLState.SQL_GENERAL_ERROR.text(), 0, exception);
         }
     }
 
@@ -646,7 +645,7 @@ public class DbTools {
             }
             return sql.toString();
         } catch (IllegalArgumentException | WrappedTargetException | UnknownPropertyException | IndexOutOfBoundsException exception) {
-            throw new SQLException("Error", Any.VOID, StandardSQLState.SQL_GENERAL_ERROR.text(), 0, exception);
+            throw new SQLException("Error", null, StandardSQLState.SQL_GENERAL_ERROR.text(), 0, exception);
         }
     }
 
@@ -706,7 +705,7 @@ public class DbTools {
             }
             return columns;
         } catch (IllegalArgumentException | WrappedTargetException | UnknownPropertyException | PropertyVetoException exception) {
-            throw new SQLException("Error", Any.VOID, StandardSQLState.SQL_GENERAL_ERROR.text(), 0, exception);
+            throw new SQLException("Error", null, StandardSQLState.SQL_GENERAL_ERROR.text(), 0, exception);
         } finally {
             CompHelper.disposeComponent(statement);
         }
@@ -738,7 +737,7 @@ public class DbTools {
             }
             return keyColumns;
         } catch (IndexOutOfBoundsException | IllegalArgumentException | WrappedTargetException | UnknownPropertyException exception) {
-            throw new SQLException("Error", Any.VOID, StandardSQLState.SQL_GENERAL_ERROR.text(), 0, exception);
+            throw new SQLException("Error", null, StandardSQLState.SQL_GENERAL_ERROR.text(), 0, exception);
         }
     }
 
@@ -755,7 +754,7 @@ public class DbTools {
                 XPropertySet columnProperties = AnyConverter.toObject(XPropertySet.class, sourceColumns.getByIndex(i));
                 destinationAppend.appendByDescriptor(columnProperties);
             } catch (WrappedTargetException | IndexOutOfBoundsException | IllegalArgumentException | ElementExistException exception) {
-                throw new SQLException("Error", Any.VOID, StandardSQLState.SQL_GENERAL_ERROR.text(), 0, exception);
+                throw new SQLException("Error", null, StandardSQLState.SQL_GENERAL_ERROR.text(), 0, exception);
             }
         }
     }
commit ac01b859aecfbfef30928b280e7c5b3406d5c87e
Author: Damjan Jovanovic <damjan at apache.org>
Date:   Sat Sep 16 09:15:21 2017 +0000

    Now that locking has been simplified, we can also delete the special
    
    factory create() methods on objects, and use constructors instead
    to simplify creation further.
    
    Patch by: me

diff --git a/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/PostgresqlTable.java b/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/PostgresqlTable.java
index 1f23aaf8810f..c82f0600e19b 100644
--- a/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/PostgresqlTable.java
+++ b/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/PostgresqlTable.java
@@ -42,7 +42,7 @@ import com.sun.star.sdbcx.comp.postgresql.sdbcx.SqlTableHelper.ColumnDescription
 import com.sun.star.sdbcx.comp.postgresql.sdbcx.descriptors.SdbcxTableDescriptor;
 
 public class PostgresqlTable extends OTable {
-    private PostgresqlTable(XConnection connection, OContainer tables, String name,
+    public PostgresqlTable(XConnection connection, OContainer tables, String name,
             String catalogName, String schemaName, String description, String type) {
         super(name, true, connection, tables);
         super.catalogName = catalogName;
@@ -51,14 +51,9 @@ public class PostgresqlTable extends OTable {
         super.type = type;
     }
 
-    public static PostgresqlTable create(XConnection connection, OContainer tables, String name,
-            String catalogName, String schemaName, String description, String type) {
-        return new PostgresqlTable(connection, tables, name, catalogName, schemaName, description, type);
-    }
-
     @Override
     public XPropertySet createDataDescriptor() {
-        SdbcxTableDescriptor descriptor = SdbcxTableDescriptor.create(true);
+        SdbcxTableDescriptor descriptor = new SdbcxTableDescriptor(true);
         synchronized (this) {
             CompHelper.copyProperties(this, descriptor);
         }
@@ -118,7 +113,7 @@ public class PostgresqlTable extends OTable {
         try {
             Map<String, OKey> keys = new SqlTableHelper().readKeys(
                     getConnection().getMetaData(), catalogName, schemaName, getName(), isCaseSensitive(), this);
-            return OKeyContainer.create(isCaseSensitive(), keys, this);
+            return new OKeyContainer(this, isCaseSensitive(), keys, this);
         } catch (ElementExistException elementExistException) {
             return null;
         } catch (SQLException sqlException) {
diff --git a/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/PostgresqlTables.java b/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/PostgresqlTables.java
index 2126de7eaa41..0da3d66ac64d 100644
--- a/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/PostgresqlTables.java
+++ b/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/PostgresqlTables.java
@@ -69,7 +69,7 @@ public class PostgresqlTables extends OContainer {
                 if (results.next()) {
                     String type = row.getString(4);
                     String remarks = row.getString(5);
-                    ret = PostgresqlTable.create(metadata.getConnection(), this, nameComponents.getTable(),
+                    ret = new PostgresqlTable(metadata.getConnection(), this, nameComponents.getTable(),
                             nameComponents.getCatalog(), nameComponents.getSchema(), remarks, type);
                 }
             }
@@ -117,7 +117,7 @@ public class PostgresqlTables extends OContainer {
 
     @Override
     public XPropertySet createDescriptor() {
-        return SdbcxTableDescriptor.create(true);
+        return new SdbcxTableDescriptor(true);
     }
 
     @Override
diff --git a/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/OColumn.java b/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/OColumn.java
index 604c0351eb59..c0f969c69266 100644
--- a/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/OColumn.java
+++ b/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/OColumn.java
@@ -45,7 +45,7 @@ public class OColumn extends ODescriptor implements XNamed, XDataDescriptorFacto
     private boolean isRowVersion;
     private boolean isCurrency;
 
-    protected OColumn(final boolean isCaseSensitive) {
+    public OColumn(final boolean isCaseSensitive) {
         super("", isCaseSensitive);
         this.isNullable = ColumnValue.NULLABLE;
         this.precision = 0;
@@ -57,11 +57,7 @@ public class OColumn extends ODescriptor implements XNamed, XDataDescriptorFacto
         registerProperties();
     }
 
-    public static OColumn create(final boolean isCaseSensitive) {
-        return new OColumn(isCaseSensitive);
-    }
-
-    protected OColumn(
+    public OColumn(
             final String name,
             final String typeName,
             final String defaultValue,
@@ -88,24 +84,6 @@ public class OColumn extends ODescriptor implements XNamed, XDataDescriptorFacto
         registerProperties();
     }
 
-    public static OColumn create(
-            final String name,
-            final String typeName,
-            final String defaultValue,
-            final String description,
-            final int isNullable,
-            final int precision,
-            final int scale,
-            final int type,
-            final boolean isAutoIncrement,
-            final boolean isRowVersion,
-            final boolean isCurrency,
-            final boolean isCaseSensitive) {
-        return new OColumn(name, typeName, defaultValue, description,
-                isNullable, precision, scale, type, isAutoIncrement, isRowVersion,
-                isCurrency, isCaseSensitive);
-    }
-
     private void registerProperties() {
         registerProperty(PropertyIds.TYPENAME.name, PropertyIds.TYPENAME.id, Type.STRING, PropertyAttribute.READONLY,
                 new PropertyGetter() {
@@ -260,7 +238,7 @@ public class OColumn extends ODescriptor implements XNamed, XDataDescriptorFacto
 
     @Override
     public XPropertySet createDataDescriptor() {
-        SdbcxColumnDescriptor descriptor = SdbcxColumnDescriptor.create(isCaseSensitive());
+        SdbcxColumnDescriptor descriptor = new SdbcxColumnDescriptor(isCaseSensitive());
         synchronized (this) {
             CompHelper.copyProperties(this, descriptor);
         }
diff --git a/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/OColumnContainer.java b/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/OColumnContainer.java
index 9cf2b012b6db..f37f68d3da7c 100644
--- a/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/OColumnContainer.java
+++ b/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/OColumnContainer.java
@@ -94,7 +94,7 @@ public class OColumnContainer extends OContainer {
             if (nullable != ColumnValue.NO_NULLS && primaryKeyColumns != null && primaryKeyColumns.hasByName(name)) {
                 nullable = ColumnValue.NO_NULLS;
             }
-            return OColumn.create(name, columnDescription.typeName, columnDescription.defaultValue, columnDescription.remarks,
+            return new OColumn(name, columnDescription.typeName, columnDescription.defaultValue, columnDescription.remarks,
                     nullable, columnDescription.columnSize, columnDescription.decimalDigits, columnDescription.type,
                     isAutoIncrement, false, isCurrency, isCaseSensitive());
         } else {
@@ -105,7 +105,7 @@ public class OColumnContainer extends OContainer {
 
     @Override
     protected XPropertySet createDescriptor() {
-        return SdbcxColumnDescriptor.create(isCaseSensitive());
+        return new SdbcxColumnDescriptor(isCaseSensitive());
     }
 
     @Override
diff --git a/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/OIndex.java b/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/OIndex.java
index 2b9118d198e1..3e318aeaceb7 100644
--- a/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/OIndex.java
+++ b/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/OIndex.java
@@ -45,7 +45,7 @@ public class OIndex extends ODescriptor implements XColumnsSupplier, XDataDescri
     private OTable table;
     private OContainer columns;
 
-    protected OIndex(String name, boolean isCaseSensitive, String catalogName,
+    public OIndex(String name, boolean isCaseSensitive, String catalogName,
             boolean isUnique, boolean isPrimaryKeyIndex, boolean isClustered, List<String> columnNames, OTable table) throws ElementExistException {
         super(name, isCaseSensitive);
         this.catalogName = catalogName;
@@ -57,11 +57,6 @@ public class OIndex extends ODescriptor implements XColumnsSupplier, XDataDescri
         registerProperties();
     }
 
-    public static OIndex create(String name, boolean isCaseSensitive, String catalogName,
-            boolean isUnique, boolean isPrimaryKeyIndex, boolean isClustered, List<String> columnNames, OTable table) throws ElementExistException {
-        return new OIndex(name, isCaseSensitive, catalogName, isUnique, isPrimaryKeyIndex, isClustered, columnNames, table);
-    }
-
     private void registerProperties() {
         registerProperty(PropertyIds.CATALOG.name, PropertyIds.CATALOG.id, Type.STRING, (short)PropertyAttribute.READONLY,
                 new PropertyGetter() {
@@ -95,7 +90,7 @@ public class OIndex extends ODescriptor implements XColumnsSupplier, XDataDescri
 
     @Override
     public XPropertySet createDataDescriptor() {
-        SdbcxIndexDescriptor descriptor = SdbcxIndexDescriptor.create(isCaseSensitive());
+        SdbcxIndexDescriptor descriptor = new SdbcxIndexDescriptor(isCaseSensitive());
         CompHelper.copyProperties(this, descriptor);
         try {
             DbTools.cloneDescriptorColumns(this, descriptor);
diff --git a/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/OIndexColumn.java b/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/OIndexColumn.java
index b33054d6ed71..5a7b7767e28a 100644
--- a/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/OIndexColumn.java
+++ b/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/OIndexColumn.java
@@ -32,7 +32,7 @@ import com.sun.star.uno.Type;
 public class OIndexColumn extends OColumn {
     protected boolean isAscending;
 
-    protected OIndexColumn(
+    public OIndexColumn(
             final boolean isAscending,
             final String name,
             final String typeName,
@@ -52,24 +52,6 @@ public class OIndexColumn extends OColumn {
         registerProperties();
     }
 
-    public static OIndexColumn create(
-            final boolean isAscending,
-            final String name,
-            final String typeName,
-            final String defaultValue,
-            final int isNullable,
-            final int precision,
-            final int scale,
-            final int type,
-            final boolean isAutoIncrement,
-            final boolean isRowVersion,
-            final boolean isCurrency,
-            final boolean isCaseSensitive) {
-        return new OIndexColumn(isAscending, name, typeName,
-                defaultValue, "", isNullable, precision, scale,
-                type, isAutoIncrement, isRowVersion, isCurrency, isCaseSensitive);
-    }
-
     private void registerProperties() {
         registerProperty(PropertyIds.ISASCENDING.name, PropertyIds.ISASCENDING.id, Type.BOOLEAN, PropertyAttribute.READONLY,
                 new PropertyGetter() {
@@ -85,7 +67,7 @@ public class OIndexColumn extends OColumn {
 
     @Override
     public XPropertySet createDataDescriptor() {
-        SdbcxIndexColumnDescriptor descriptor = SdbcxIndexColumnDescriptor.create(isCaseSensitive());
+        SdbcxIndexColumnDescriptor descriptor = new SdbcxIndexColumnDescriptor(isCaseSensitive());
         synchronized (this) {
             CompHelper.copyProperties(this, descriptor);
         }
diff --git a/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/OIndexColumnContainer.java b/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/OIndexColumnContainer.java
index a107751d3fe5..b9c8dde19a6d 100644
--- a/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/OIndexColumnContainer.java
+++ b/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/OIndexColumnContainer.java
@@ -48,7 +48,7 @@ public class OIndexColumnContainer extends OContainer {
 
     @Override
     protected XPropertySet createDescriptor() {
-        return SdbcxIndexColumnDescriptor.create(isCaseSensitive());
+        return new SdbcxIndexColumnDescriptor(isCaseSensitive());
     }
 
     @Override
@@ -89,7 +89,7 @@ public class OIndexColumnContainer extends OContainer {
                             int nul = row.getInt(11);
                             String columnDef = row.getString(13);
 
-                            ret = OIndexColumn.create(isAscending, name, typeName, columnDef,
+                            ret = new OIndexColumn(isAscending, name, typeName, columnDef, "",
                                     nul, size, dec, dataType, false, false, false, isCaseSensitive());
                             break;
                         }
diff --git a/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/OIndexContainer.java b/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/OIndexContainer.java
index b6ad94bdfb16..249a543a810e 100644
--- a/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/OIndexContainer.java
+++ b/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/OIndexContainer.java
@@ -58,7 +58,7 @@ public class OIndexContainer extends OContainer {
 
     @Override
     protected XPropertySet createDescriptor() {
-        return SdbcxIndexDescriptor.create(isCaseSensitive());
+        return new SdbcxIndexDescriptor(isCaseSensitive());
     }
 
     @Override
@@ -106,7 +106,7 @@ public class OIndexContainer extends OContainer {
                         }
                     }
                     if (found) {
-                        ret = OIndex.create(subname, isCaseSensitive(), qualifier, isUnique, isPrimaryKeyIndex, clustered == IndexType.CLUSTERED,
+                        ret = new OIndex(subname, isCaseSensitive(), qualifier, isUnique, isPrimaryKeyIndex, clustered == IndexType.CLUSTERED,
                                 columnNames, table);
                     }
                 }
diff --git a/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/OKey.java b/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/OKey.java
index 6fd564762e90..ffec0fe23178 100644
--- a/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/OKey.java
+++ b/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/OKey.java
@@ -53,7 +53,7 @@ public class OKey extends ODescriptor
         registerProperties();
     }
 
-    protected OKey(String name, boolean isCaseSensitive, String referencedTable, int type,
+    public OKey(String name, boolean isCaseSensitive, String referencedTable, int type,
             int updateRule, int deleteRule, List<String> columnNames, OTable table) throws ElementExistException {
         super(name, isCaseSensitive);
         this.referencedTable = referencedTable;
@@ -65,11 +65,6 @@ public class OKey extends ODescriptor
         columns = new OKeyColumnContainer(this, this, columnNames);
     }
 
-    public static OKey create(String name, boolean isCaseSensitive, String referencedTable, int type,
-            int updateRule, int deleteRule, List<String> columnNames, OTable table) throws ElementExistException {
-        return new OKey(name, isCaseSensitive, referencedTable, type, updateRule, deleteRule, columnNames, table);
-    }
-
     private void registerProperties() {
         registerProperty(PropertyIds.REFERENCEDTABLE.name, PropertyIds.REFERENCEDTABLE.id, Type.STRING, (short)PropertyAttribute.READONLY,
                 new PropertyGetter() {
@@ -116,7 +111,7 @@ public class OKey extends ODescriptor
     // XDataDescriptionFactory
 
     public XPropertySet createDataDescriptor() {
-        SdbcxKeyDescriptor descriptor = SdbcxKeyDescriptor.create(isCaseSensitive());
+        SdbcxKeyDescriptor descriptor = new SdbcxKeyDescriptor(isCaseSensitive());
         CompHelper.copyProperties(this, descriptor);
         try {
             DbTools.cloneDescriptorColumns(this, descriptor);
diff --git a/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/OKeyColumn.java b/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/OKeyColumn.java
index 1bcf411736bf..0d78e0add049 100644
--- a/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/OKeyColumn.java
+++ b/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/OKeyColumn.java
@@ -37,7 +37,7 @@ public class OKeyColumn extends OColumn {
         registerProperties();
     }
 
-    protected OKeyColumn(
+    public OKeyColumn(
             final String referencedColumn,
             final String name,
             final String typeName,
@@ -57,24 +57,6 @@ public class OKeyColumn extends OColumn {
         registerProperties();
     }
 
-    public static OKeyColumn create(
-            final String referencedColumn,
-            final String name,
-            final String typeName,
-            final String defaultValue,
-            final int isNullable,
-            final int precision,
-            final int scale,
-            final int type,
-            final boolean isAutoIncrement,
-            final boolean isRowVersion,
-            final boolean isCurrency,
-            final boolean isCaseSensitive) {
-        return new OKeyColumn(referencedColumn, name, typeName,
-                defaultValue, "", isNullable, precision, scale,
-                type, isAutoIncrement, isRowVersion, isCurrency, isCaseSensitive);
-    }
-
     private void registerProperties() {
         registerProperty(PropertyIds.RELATEDCOLUMN.name, PropertyIds.RELATEDCOLUMN.id, Type.STRING, PropertyAttribute.READONLY,
                 new PropertyGetter() {
@@ -90,7 +72,7 @@ public class OKeyColumn extends OColumn {
 
     @Override
     public XPropertySet createDataDescriptor() {
-        SdbcxKeyColumnDescriptor descriptor = SdbcxKeyColumnDescriptor.create(isCaseSensitive());
+        SdbcxKeyColumnDescriptor descriptor = new SdbcxKeyColumnDescriptor(isCaseSensitive());
         synchronized (this) {
             CompHelper.copyProperties(this, descriptor);
         }
diff --git a/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/OKeyColumnContainer.java b/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/OKeyColumnContainer.java
index 06dadde82fab..ef278cdfa3e5 100644
--- a/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/OKeyColumnContainer.java
+++ b/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/OKeyColumnContainer.java
@@ -47,7 +47,7 @@ public class OKeyColumnContainer extends OContainer {
 
     @Override
     protected XPropertySet createDescriptor() {
-        return SdbcxKeyColumnDescriptor.create(isCaseSensitive());
+        return new SdbcxKeyColumnDescriptor(isCaseSensitive());
     }
 
     @Override
@@ -88,8 +88,8 @@ public class OKeyColumnContainer extends OContainer {
                         } catch (SQLException sqlException) {
                             // sometimes we get an error when asking for this param
                         }
-                        ret = OKeyColumn.create(refColumnName, name, typeName,
-                                columnDef, nul, size, dec, dataType, false, false, false, isCaseSensitive());
+                        ret = new OKeyColumn(refColumnName, name, typeName,
+                                "", columnDef, nul, size, dec, dataType, false, false, false, isCaseSensitive());
 
                     }
                 }
diff --git a/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/OKeyContainer.java b/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/OKeyContainer.java
index 78369a7c1aec..c220ed7f6413 100644
--- a/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/OKeyContainer.java
+++ b/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/OKeyContainer.java
@@ -23,7 +23,6 @@ package com.sun.star.sdbcx.comp.postgresql.sdbcx;
 
 import java.util.ArrayList;
 import java.util.Arrays;
-import java.util.List;
 import java.util.Map;
 
 import com.sun.star.beans.PropertyVetoException;
@@ -55,8 +54,8 @@ public class OKeyContainer extends OContainer {
     private OTable table;
     private Map<String,OKey> keys;
 
-    protected OKeyContainer(Object lock, boolean isCaseSensitive, List<String> names, Map<String,OKey> keys, OTable table) throws ElementExistException {
-        super(lock, isCaseSensitive, names);
+    public OKeyContainer(Object lock, boolean isCaseSensitive, Map<String,OKey> keys, OTable table) throws ElementExistException {
+        super(lock, isCaseSensitive, Arrays.asList(keys.keySet().toArray(new String[keys.size()])));
         System.out.println("Keys.size()=" + keys.size());
         for (Map.Entry<String,OKey> entry : keys.entrySet()) {
             System.out.println(entry.getKey() + " => " + entry.getValue().referencedTable);
@@ -78,16 +77,9 @@ public class OKeyContainer extends OContainer {
         this.table = table;
     }
 
-    public static OKeyContainer create(boolean isCaseSensitive, Map<String,OKey> keys, OTable table) throws ElementExistException {
-        final Object lock = new Object();
-        String[] names = new String[keys.size()];
-        keys.keySet().toArray(names);
-        return new OKeyContainer(lock, isCaseSensitive, Arrays.asList(names), keys, table);
-    }
-
     @Override
     protected XPropertySet createDescriptor() {
-        return SdbcxKeyDescriptor.create(isCaseSensitive());
+        return new SdbcxKeyDescriptor(isCaseSensitive());
     }
 
     @Override
@@ -205,7 +197,7 @@ public class OKeyContainer extends OContainer {
                 }
             } catch (SQLException sqlException) {
             }
-            keys.put(newName, OKey.create(newName, isCaseSensitive(), referencedName, keyType, updateRule, deleteRule, new ArrayList<String>(), table));
+            keys.put(newName, new OKey(newName, isCaseSensitive(), referencedName, keyType, updateRule, deleteRule, new ArrayList<String>(), table));
             return createObject(newName);
         } catch (WrappedTargetException wrappedTargetException) {
         } catch (UnknownPropertyException unknownPropertyException) {
diff --git a/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/SqlTableHelper.java b/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/SqlTableHelper.java
index 7307391317dd..15da0af32b51 100644
--- a/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/SqlTableHelper.java
+++ b/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/SqlTableHelper.java
@@ -164,7 +164,7 @@ public class SqlTableHelper {
                         pkName = row.getString(6);
                     }
                 }
-                key = OKey.create(pkName, isCaseSensitive, "", KeyType.PRIMARY, 0, 0, columns, table);
+                key = new OKey(pkName, isCaseSensitive, "", KeyType.PRIMARY, 0, 0, columns, table);
             }
             return key;
         } catch (ElementExistException elementExistException) {
@@ -203,7 +203,7 @@ public class SqlTableHelper {
                     if (!row.wasNull() && !fkName.isEmpty()) {
                         if (!oldFkName.equals(fkName)) {
                             if (keyProperties != null) {
-                                OKey key = OKey.create(oldFkName, isCaseSensitive, keyProperties.referencedTable, keyProperties.type,
+                                OKey key = new OKey(oldFkName, isCaseSensitive, keyProperties.referencedTable, keyProperties.type,
                                         keyProperties.updateRule, keyProperties.deleteRule, keyProperties.columnNames, table);
                                 keys.put(oldFkName, key);
                             }
@@ -220,7 +220,7 @@ public class SqlTableHelper {
                     }
                 }
                 if (keyProperties != null) {
-                    OKey key = OKey.create(oldFkName, isCaseSensitive, keyProperties.referencedTable, keyProperties.type,
+                    OKey key = new OKey(oldFkName, isCaseSensitive, keyProperties.referencedTable, keyProperties.type,
                             keyProperties.updateRule, keyProperties.deleteRule, keyProperties.columnNames, table);
                     keys.put(oldFkName, key);
                 }
diff --git a/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/descriptors/SdbcxColumnDescriptor.java b/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/descriptors/SdbcxColumnDescriptor.java
index 14a6b48e7090..c7696be6a2a4 100644
--- a/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/descriptors/SdbcxColumnDescriptor.java
+++ b/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/descriptors/SdbcxColumnDescriptor.java
@@ -39,15 +39,11 @@ public class SdbcxColumnDescriptor extends ODescriptor {
     protected String defaultValue;
     protected boolean isCurrency;
 
-    protected SdbcxColumnDescriptor(boolean isCaseSensitive) {
+    public SdbcxColumnDescriptor(boolean isCaseSensitive) {
         super("", isCaseSensitive, false);
         registerProperties();
     }
 
-    public static SdbcxColumnDescriptor create(boolean isCaseSensitive) {
-        return new SdbcxColumnDescriptor(isCaseSensitive);
-    }
-
     private void registerProperties() {
         registerProperty(PropertyIds.TYPE.name, PropertyIds.TYPE.id, Type.LONG, (short)0,
                 new PropertyGetter() {
diff --git a/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/descriptors/SdbcxColumnDescriptorContainer.java b/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/descriptors/SdbcxColumnDescriptorContainer.java
index 5b9b945e5f10..05c4927790a3 100644
--- a/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/descriptors/SdbcxColumnDescriptorContainer.java
+++ b/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/descriptors/SdbcxColumnDescriptorContainer.java
@@ -31,6 +31,6 @@ public class SdbcxColumnDescriptorContainer extends SdbcxDescriptorContainer {
 
     @Override
     protected XPropertySet createDescriptor() {
-        return SdbcxColumnDescriptor.create(isCaseSensitive());
+        return new SdbcxColumnDescriptor(isCaseSensitive());
     }
 }
diff --git a/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/descriptors/SdbcxIndexColumnDescriptor.java b/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/descriptors/SdbcxIndexColumnDescriptor.java
index 312fa7ac4b69..c8e9800a6987 100644
--- a/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/descriptors/SdbcxIndexColumnDescriptor.java
+++ b/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/descriptors/SdbcxIndexColumnDescriptor.java
@@ -29,15 +29,11 @@ import com.sun.star.uno.Type;
 public class SdbcxIndexColumnDescriptor extends SdbcxColumnDescriptor {
     protected boolean isAscending;
 
-    protected SdbcxIndexColumnDescriptor(boolean isCaseSensitive) {
+    public SdbcxIndexColumnDescriptor(boolean isCaseSensitive) {
         super(isCaseSensitive);
         registerProperties();
     }
 
-    public static SdbcxIndexColumnDescriptor create(boolean isCaseSensitive) {
-        return new SdbcxIndexColumnDescriptor(isCaseSensitive);
-    }
-
     private void registerProperties() {
         registerProperty(PropertyIds.ISASCENDING.name, PropertyIds.ISASCENDING.id, Type.BOOLEAN, (short)0,
                 new PropertyGetter() {
diff --git a/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/descriptors/SdbcxIndexColumnDescriptorContainer.java b/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/descriptors/SdbcxIndexColumnDescriptorContainer.java
index 528f252ad054..0aa7012f168e 100644
--- a/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/descriptors/SdbcxIndexColumnDescriptorContainer.java
+++ b/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/descriptors/SdbcxIndexColumnDescriptorContainer.java
@@ -30,6 +30,6 @@ public class SdbcxIndexColumnDescriptorContainer extends SdbcxDescriptorContaine
 
     @Override
     protected XPropertySet createDescriptor() {
-        return SdbcxIndexColumnDescriptor.create(isCaseSensitive());
+        return new SdbcxIndexColumnDescriptor(isCaseSensitive());
     }
 }
diff --git a/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/descriptors/SdbcxIndexDescriptor.java b/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/descriptors/SdbcxIndexDescriptor.java
index 8af047f7722e..cf5a120a9e53 100644
--- a/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/descriptors/SdbcxIndexDescriptor.java
+++ b/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/descriptors/SdbcxIndexDescriptor.java
@@ -35,16 +35,12 @@ public class SdbcxIndexDescriptor extends ODescriptor implements XColumnsSupplie
 
     private SdbcxIndexColumnDescriptorContainer columns;
 
-    protected SdbcxIndexDescriptor(boolean isCaseSensitive) {
+    public SdbcxIndexDescriptor(boolean isCaseSensitive) {
         super("", isCaseSensitive, false);
         columns = new SdbcxIndexColumnDescriptorContainer(this, isCaseSensitive());
         registerProperties();
     }
 
-    public static SdbcxIndexDescriptor create(boolean isCaseSensitive) {
-        return new SdbcxIndexDescriptor(isCaseSensitive);
-    }
-
     private void registerProperties() {
         registerProperty(PropertyIds.CATALOG.name, PropertyIds.CATALOG.id, Type.STRING, (short)0,
                 new PropertyGetter() {
diff --git a/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/descriptors/SdbcxIndexDescriptorContainer.java b/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/descriptors/SdbcxIndexDescriptorContainer.java
index d40c735b0089..5f9fadc08c64 100644
--- a/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/descriptors/SdbcxIndexDescriptorContainer.java
+++ b/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/descriptors/SdbcxIndexDescriptorContainer.java
@@ -32,7 +32,7 @@ public class SdbcxIndexDescriptorContainer extends SdbcxDescriptorContainer {
 
     @Override
     protected XPropertySet createDescriptor() {
-        return SdbcxIndexDescriptor.create(isCaseSensitive());
+        return new SdbcxIndexDescriptor(isCaseSensitive());
     }
 
     @Override
diff --git a/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/descriptors/SdbcxKeyColumnDescriptor.java b/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/descriptors/SdbcxKeyColumnDescriptor.java
index c0049a11e91a..f4b161283ca2 100644
--- a/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/descriptors/SdbcxKeyColumnDescriptor.java
+++ b/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/descriptors/SdbcxKeyColumnDescriptor.java
@@ -29,15 +29,11 @@ import com.sun.star.uno.Type;
 public class SdbcxKeyColumnDescriptor extends SdbcxColumnDescriptor {
     protected String relatedColumn;
 
-    protected SdbcxKeyColumnDescriptor(boolean isCaseSensitive) {
+    public SdbcxKeyColumnDescriptor(boolean isCaseSensitive) {
         super(isCaseSensitive);
         registerProperties();
     }
 
-    public static SdbcxKeyColumnDescriptor create(boolean isCaseSensitive) {
-        return new SdbcxKeyColumnDescriptor(isCaseSensitive);
-    }
-
     private void registerProperties() {
         registerProperty(PropertyIds.RELATEDCOLUMN.name, PropertyIds.RELATEDCOLUMN.id, Type.STRING, (short)0,
                 new PropertyGetter() {
diff --git a/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/descriptors/SdbcxKeyColumnDescriptorContainer.java b/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/descriptors/SdbcxKeyColumnDescriptorContainer.java
index 4b5824489f3c..229846589e94 100644
--- a/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/descriptors/SdbcxKeyColumnDescriptorContainer.java
+++ b/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/descriptors/SdbcxKeyColumnDescriptorContainer.java
@@ -30,6 +30,6 @@ public class SdbcxKeyColumnDescriptorContainer extends SdbcxDescriptorContainer
 
     @Override
     protected XPropertySet createDescriptor() {
-        return SdbcxKeyColumnDescriptor.create(isCaseSensitive());
+        return new SdbcxKeyColumnDescriptor(isCaseSensitive());
     }
 }
diff --git a/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/descriptors/SdbcxKeyDescriptor.java b/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/descriptors/SdbcxKeyDescriptor.java
index 309cb696dd46..5050849bcb13 100644
--- a/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/descriptors/SdbcxKeyDescriptor.java
+++ b/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/descriptors/SdbcxKeyDescriptor.java
@@ -37,16 +37,12 @@ public class SdbcxKeyDescriptor extends ODescriptor implements XColumnsSupplier
 
     private SdbcxKeyColumnDescriptorContainer columns;
 
-    protected SdbcxKeyDescriptor(boolean isCaseSensitive) {
+    public SdbcxKeyDescriptor(boolean isCaseSensitive) {
         super("", isCaseSensitive, false);
         registerProperties();
         columns = new SdbcxKeyColumnDescriptorContainer(this, isCaseSensitive());
     }
 
-    public static SdbcxKeyDescriptor create(boolean isCaseSensitive) {
-        return new SdbcxKeyDescriptor(isCaseSensitive);
-    }
-
     private void registerProperties() {
         registerProperty(PropertyIds.TYPE.name, PropertyIds.TYPE.id, Type.LONG, (short)0,
                 new PropertyGetter() {
diff --git a/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/descriptors/SdbcxKeyDescriptorContainer.java b/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/descriptors/SdbcxKeyDescriptorContainer.java
index b1fc537ca5b8..f6c4689f928b 100644
--- a/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/descriptors/SdbcxKeyDescriptorContainer.java
+++ b/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/descriptors/SdbcxKeyDescriptorContainer.java
@@ -32,7 +32,7 @@ public class SdbcxKeyDescriptorContainer extends SdbcxDescriptorContainer {
 
     @Override
     protected XPropertySet createDescriptor() {
-        return SdbcxKeyDescriptor.create(isCaseSensitive());
+        return new SdbcxKeyDescriptor(isCaseSensitive());
     }
 
     @Override
diff --git a/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/descriptors/SdbcxTableDescriptor.java b/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/descriptors/SdbcxTableDescriptor.java
index 4d51698add1c..a5fedfac14e1 100644
--- a/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/descriptors/SdbcxTableDescriptor.java
+++ b/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/descriptors/SdbcxTableDescriptor.java
@@ -40,17 +40,13 @@ public class SdbcxTableDescriptor extends ODescriptor implements XColumnsSupplie
     private OContainer columns;
     private OContainer keys;
 
-    protected SdbcxTableDescriptor(boolean isCaseSensitive) {
+    public SdbcxTableDescriptor(boolean isCaseSensitive) {
         super("", isCaseSensitive, false);
         columns = new SdbcxColumnDescriptorContainer(this, isCaseSensitive());
         keys = new SdbcxKeyDescriptorContainer(this, isCaseSensitive());
         registerProperties();
     }
 
-    public static SdbcxTableDescriptor create(boolean isCaseSensitive) {
-        return new SdbcxTableDescriptor(isCaseSensitive);
-    }
-
     private void registerProperties() {
         registerProperty(PropertyIds.CATALOGNAME.name, PropertyIds.CATALOGNAME.id, Type.STRING, (short)0,
                 new PropertyGetter() {
commit 808f028e28ce679a34a3868249927d2e52b5ed5a
Author: Damjan Jovanovic <damjan at apache.org>
Date:   Sat Sep 16 08:27:31 2017 +0000

    Locking and disposal cleanup.
    
    Firstly, add isDisposed() and checkDisposed() methods to
    main/javaunohelper's com.sun.star.lib.uno.helper.ComponentBase, so that
    Java components can easily test and assert their disposal state. Comment
    these for a clearer understanding of how disposal works, namely that
    locking against disposal must cover all access of that component, so that
    the component can't be disposed half-way through being used. These methods
    are stricter than before, where only bDisposed was checked, which allowed
    the component to be used during disposal (as postDisposing() runs before
    bDisposed is set)!!
    
    Fix and simplify locking in the PostgreSQL driver, first by using the new
    methods in ComponentBase instead of tracking disposal separately with our
    own variable, then expand locking to entire methods so components can't be
    disposed during a method's execution, and finally eliminate disposal
    tracking in components that purely wrap another component and modify
    data in transit, as all disposal management is done by the wrapped
    component and we don't have to worry as long as our postDispose() has
    nothing special to do and just delegates to the wrapped component.
    
    Also eliminate internal locks in objects, and use "this" as the lock for
    the non-container objects like Table / Column / Key, while using the
    parent's "this" as the lock for contain objects like Tables, Columns, Keys
    etc., as this further simplifies locking, allow using method-level locking
    instead of "synchronized (this)", reduces the number of fields, simplifies
    locking in subclasses, and theoretically allows callers to hold the lock
    across multiple method invocations.
    
    Other minor fixes, some exception cleanup, use of AtomicInteger to generate
    numbers in PropertySetAdapter, etc.
    
    Patch by: me

diff --git a/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/PostgresqlCatalog.java b/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/PostgresqlCatalog.java
index d9f400192494..ad66cf6de697 100644
--- a/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/PostgresqlCatalog.java
+++ b/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/PostgresqlCatalog.java
@@ -52,13 +52,12 @@ public class PostgresqlCatalog extends OCatalog {
                 System.out.println("Table " + name);
                 names.add(name);
             }
-            return new PostgresqlTables(lock, metadata, this, names);
-        } catch (ElementExistException elementExistException) {
-        } catch (SQLException sqlException) {
+            return new PostgresqlTables(this, metadata, this, names);
+        } catch (ElementExistException | SQLException exception) {
+            throw new com.sun.star.uno.RuntimeException("Error", exception);
         } finally {
             CompHelper.disposeComponent(results);
         }
-        return null;
     }
 
     @Override
@@ -72,13 +71,12 @@ public class PostgresqlCatalog extends OCatalog {
                 String name = buildName(row);
                 names.add(name);
             }
-            return new PostgresqlTables(lock, metadata, this, names);
-        } catch (ElementExistException elementExistException) {
-        } catch (SQLException sqlException) {
+            return new PostgresqlTables(this, metadata, this, names);
+        } catch (ElementExistException | SQLException exception) {
+            throw new com.sun.star.uno.RuntimeException("Error", exception);
         } finally {
             CompHelper.disposeComponent(results);
         }
-        return null;
     }
 
     @Override
diff --git a/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/PostgresqlConnection.java b/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/PostgresqlConnection.java
index 8e1d554d7805..25de30f9fc68 100644
--- a/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/PostgresqlConnection.java
+++ b/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/PostgresqlConnection.java
@@ -22,7 +22,6 @@
 package com.sun.star.sdbcx.comp.postgresql;
 
 import java.util.HashSet;
-import java.util.concurrent.atomic.AtomicBoolean;
 
 import com.sun.star.container.XNameAccess;
 import com.sun.star.lang.DisposedException;
@@ -43,7 +42,6 @@ public class PostgresqlConnection extends ComponentBase implements XConnection,
     private XComponent implComponent;
     private XWarningsSupplier implWarningsSupplier;
     private String url;
-    private AtomicBoolean isDisposed = new AtomicBoolean(false);
     private HashSet<XComponent> statements = new HashSet<>();
 
     public PostgresqlConnection(XConnection impl, String url) {
@@ -57,7 +55,6 @@ public class PostgresqlConnection extends ComponentBase implements XConnection,
 
     @Override
     protected synchronized void postDisposing() {
-        isDisposed.set(true);
         implComponent.dispose();
         for (XComponent pgStatement : statements) {
             try {
@@ -67,12 +64,6 @@ public class PostgresqlConnection extends ComponentBase implements XConnection,
         }
     };
 
-    private void checkDisposed() throws DisposedException {
-        if (isDisposed.get()) {
-            throw new DisposedException();
-        }
-    }
-
     // XEventListener:
 
     public synchronized void disposing(EventObject source) {
@@ -81,12 +72,12 @@ public class PostgresqlConnection extends ComponentBase implements XConnection,
 
     // XWarningsSupplier:
 
-    public void clearWarnings() throws SQLException {
+    public synchronized void clearWarnings() throws SQLException {
         checkDisposed();
         implWarningsSupplier.clearWarnings();
     }
 
-    public Object getWarnings() throws SQLException {
+    public synchronized Object getWarnings() throws SQLException {
         checkDisposed();
         return implWarningsSupplier.getWarnings();
     }
@@ -97,7 +88,7 @@ public class PostgresqlConnection extends ComponentBase implements XConnection,
         dispose();
     }
 
-    public void commit() throws SQLException {
+    public synchronized void commit() throws SQLException {
         checkDisposed();
         impl.commit();
     }
@@ -110,42 +101,42 @@ public class PostgresqlConnection extends ComponentBase implements XConnection,
         return pgStatement;
     }
 
-    public boolean getAutoCommit() throws SQLException {
+    public synchronized boolean getAutoCommit() throws SQLException {
         checkDisposed();
         return impl.getAutoCommit();
     }
 
-    public String getCatalog() throws SQLException {
+    public synchronized String getCatalog() throws SQLException {
         checkDisposed();
         return impl.getCatalog();
     }
 
-    public XDatabaseMetaData getMetaData() throws SQLException {
+    public synchronized XDatabaseMetaData getMetaData() throws SQLException {
         checkDisposed();
         return new PostgresqlDatabaseMetadata(impl.getMetaData(), this, url);
     }
 
-    public int getTransactionIsolation() throws SQLException {
+    public synchronized int getTransactionIsolation() throws SQLException {
         checkDisposed();
         return impl.getTransactionIsolation();
     }
 
-    public XNameAccess getTypeMap() throws SQLException {
+    public synchronized XNameAccess getTypeMap() throws SQLException {
         checkDisposed();
         return impl.getTypeMap();
     }
 
-    public boolean isClosed() throws SQLException {
+    public synchronized boolean isClosed() throws SQLException {
         checkDisposed();
         return impl.isClosed();
     }
 
-    public boolean isReadOnly() throws SQLException {
+    public synchronized boolean isReadOnly() throws SQLException {
         checkDisposed();
         return impl.isReadOnly();
     }
 
-    public String nativeSQL(String arg0) throws SQLException {
+    public synchronized String nativeSQL(String arg0) throws SQLException {
         checkDisposed();
         return impl.nativeSQL(arg0);
     }
@@ -166,32 +157,32 @@ public class PostgresqlConnection extends ComponentBase implements XConnection,
         return pgStatement;
     }
 
-    public void rollback() throws SQLException {
+    public synchronized void rollback() throws SQLException {
         checkDisposed();
         impl.rollback();
     }
 
-    public void setAutoCommit(boolean arg0) throws SQLException {
+    public synchronized void setAutoCommit(boolean arg0) throws SQLException {
         checkDisposed();
         impl.setAutoCommit(arg0);
     }
 
-    public void setCatalog(String arg0) throws SQLException {
+    public synchronized void setCatalog(String arg0) throws SQLException {
         checkDisposed();
         impl.setCatalog(arg0);
     }
 
-    public void setReadOnly(boolean arg0) throws SQLException {
+    public synchronized void setReadOnly(boolean arg0) throws SQLException {
         checkDisposed();
         impl.setReadOnly(arg0);
     }
 
-    public void setTransactionIsolation(int arg0) throws SQLException {
+    public synchronized void setTransactionIsolation(int arg0) throws SQLException {
         checkDisposed();
         impl.setTransactionIsolation(arg0);
     }
 
-    public void setTypeMap(XNameAccess arg0) throws SQLException {
+    public synchronized void setTypeMap(XNameAccess arg0) throws SQLException {
         checkDisposed();
         impl.setTypeMap(arg0);
     }
diff --git a/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/PostgresqlDriver.java b/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/PostgresqlDriver.java
index 1ca0b54f5a47..2a57edd9b67a 100644
--- a/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/PostgresqlDriver.java
+++ b/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/PostgresqlDriver.java
@@ -22,10 +22,8 @@
 package com.sun.star.sdbcx.comp.postgresql;
 
 import java.util.ArrayList;
-import java.util.concurrent.atomic.AtomicBoolean;
 
 import com.sun.star.beans.PropertyValue;
-import com.sun.star.lang.DisposedException;
 import com.sun.star.lang.XServiceInfo;
 import com.sun.star.lang.XSingleComponentFactory;
 import com.sun.star.lib.uno.helper.ComponentBase;
@@ -37,6 +35,7 @@ import com.sun.star.sdbc.XDriver;
 import com.sun.star.sdbc.XDriverManager;
 import com.sun.star.sdbcx.XDataDefinitionSupplier;
 import com.sun.star.sdbcx.XTablesSupplier;
+import com.sun.star.sdbcx.comp.postgresql.util.Resources;
 import com.sun.star.sdbcx.comp.postgresql.util.SharedResources;
 import com.sun.star.sdbcx.comp.postgresql.util.StandardSQLState;
 import com.sun.star.uno.Exception;
@@ -49,7 +48,6 @@ public class PostgresqlDriver extends ComponentBase implements XServiceInfo, XDr
             "com.sun.star.sdbcx.Driver"
     };
     private XComponentContext componentContext;
-    private AtomicBoolean isDisposed = new AtomicBoolean(false);
 
     public static XSingleComponentFactory __getComponentFactory(String implName) {
         XSingleComponentFactory xSingleComponentFactory = null;
@@ -72,18 +70,11 @@ public class PostgresqlDriver extends ComponentBase implements XServiceInfo, XDr
     // XComponent:
 
     @Override
-    protected void postDisposing() {
-        isDisposed.set(true);
+    protected synchronized void postDisposing() {
         componentContext = null;
         SharedResources.revokeClient();
     }
 
-    private void checkDisposed() throws DisposedException {
-        if (isDisposed.get()) {
-            throw new DisposedException();
-        }
-    }
-
     // XServiceInfo:
 
     @Override
@@ -114,7 +105,7 @@ public class PostgresqlDriver extends ComponentBase implements XServiceInfo, XDr
     }
 
     @Override
-    public XConnection connect(String url, PropertyValue[] info) throws SQLException {
+    public synchronized XConnection connect(String url, PropertyValue[] info) throws SQLException {
         checkDisposed();
         XConnection connection = null;
         if (acceptsURL(url)) {
@@ -184,15 +175,16 @@ public class PostgresqlDriver extends ComponentBase implements XServiceInfo, XDr
 
     // XDataDefinitionSupplier:
 
-    public XTablesSupplier getDataDefinitionByConnection(XConnection connection) throws SQLException {
+    public synchronized XTablesSupplier getDataDefinitionByConnection(XConnection connection) throws SQLException {
         checkDisposed();
         return new PostgresqlCatalog((PostgresqlConnection)connection);
     }
 
-    public XTablesSupplier getDataDefinitionByURL(String url, PropertyValue[] info) throws SQLException {
+    public synchronized XTablesSupplier getDataDefinitionByURL(String url, PropertyValue[] info) throws SQLException {
         checkDisposed();
         if (!acceptsURL(url)) {
-            throw new SQLException(); // FIXME
+            String error = SharedResources.getInstance().getResourceString(Resources.STR_URI_SYNTAX_ERROR);
+            throw new SQLException(error, this, StandardSQLState.SQL_UNABLE_TO_CONNECT.text(), 0, null);
         }
         return getDataDefinitionByConnection(connect(url, info));
     }
diff --git a/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/PostgresqlPreparedStatement.java b/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/PostgresqlPreparedStatement.java
index ff4b99684a5a..409ee5fba68a 100644
--- a/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/PostgresqlPreparedStatement.java
+++ b/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/PostgresqlPreparedStatement.java
@@ -21,8 +21,6 @@
 
 package com.sun.star.sdbcx.comp.postgresql;
 
-import java.util.concurrent.atomic.AtomicBoolean;
-
 import com.sun.star.beans.PropertyVetoException;
 import com.sun.star.beans.UnknownPropertyException;
 import com.sun.star.beans.XPropertyChangeListener;
@@ -30,7 +28,6 @@ import com.sun.star.beans.XPropertySet;
 import com.sun.star.beans.XPropertySetInfo;
 import com.sun.star.beans.XVetoableChangeListener;
 import com.sun.star.io.XInputStream;
-import com.sun.star.lang.DisposedException;
 import com.sun.star.lang.IllegalArgumentException;
 import com.sun.star.lang.WrappedTargetException;
 import com.sun.star.lib.uno.helper.ComponentBase;
@@ -69,7 +66,6 @@ public class PostgresqlPreparedStatement extends ComponentBase
     private XWarningsSupplier implWarningsSupplier;
     private XMultipleResults implMultipleResults;
     private XConnection connection;
-    private AtomicBoolean isDisposed = new AtomicBoolean(false);
 
     public PostgresqlPreparedStatement(XPreparedStatement impl, XConnection connection) {
         this.impl = impl;
@@ -88,38 +84,27 @@ public class PostgresqlPreparedStatement extends ComponentBase
 
     @Override
     protected void postDisposing() {
-        isDisposed.set(true);
         try {
             implCloseable.close();
         } catch (SQLException sqlException) {
         }
     }
 
-    private void checkDisposed() {
-        if (isDisposed.get()) {
-            throw new DisposedException();
-        }
-    }
-
     // XPreparedStatement:
 
     public boolean execute() throws SQLException {
-        checkDisposed();
         return impl.execute();
     }
 
     public XResultSet executeQuery() throws SQLException {
-        checkDisposed();
         return new PostgresqlResultSet(impl.executeQuery(), this);
     }
 
     public int executeUpdate() throws SQLException {
-        checkDisposed();
         return impl.executeUpdate();
     }
 
     public XConnection getConnection() throws SQLException {
-        checkDisposed();
         return connection;
     }
 
@@ -132,217 +117,175 @@ public class PostgresqlPreparedStatement extends ComponentBase
     // XPropertySet:
 
     public void addPropertyChangeListener(String arg0, XPropertyChangeListener arg1) throws UnknownPropertyException, WrappedTargetException {
-        checkDisposed();
         implPropertySet.addPropertyChangeListener(arg0, arg1);
     }
 
     public void addVetoableChangeListener(String arg0, XVetoableChangeListener arg1) throws UnknownPropertyException, WrappedTargetException {
-        checkDisposed();
         implPropertySet.addVetoableChangeListener(arg0, arg1);
     }
 
     public XPropertySetInfo getPropertySetInfo() {
-        checkDisposed();
         return implPropertySet.getPropertySetInfo();
     }
 
     public Object getPropertyValue(String arg0) throws UnknownPropertyException, WrappedTargetException {
-        checkDisposed();
         return implPropertySet.getPropertyValue(arg0);
     }
 
     public void removePropertyChangeListener(String arg0, XPropertyChangeListener arg1) throws UnknownPropertyException, WrappedTargetException {
-        checkDisposed();
         implPropertySet.removePropertyChangeListener(arg0, arg1);
     }
 
     public void removeVetoableChangeListener(String arg0, XVetoableChangeListener arg1) throws UnknownPropertyException, WrappedTargetException {
-        checkDisposed();
         implPropertySet.removeVetoableChangeListener(arg0, arg1);
     }
 
     public void setPropertyValue(String arg0, Object arg1)
             throws UnknownPropertyException, PropertyVetoException, IllegalArgumentException, WrappedTargetException {
-        checkDisposed();
         implPropertySet.setPropertyValue(arg0, arg1);
     }
 
     // XCancellable:
 
     public void cancel() {
-        checkDisposed();
         implCancellable.cancel();
     }
 
     // XResultSetMetaDataSupplier:
 
     public XResultSetMetaData getMetaData() throws SQLException {
-        checkDisposed();
         return new PostgresqlResultSetMetaData(implResultSetMetaDataSupplier.getMetaData());
     }
 
     // XParameters:
 
     public void clearParameters() throws SQLException {
-        checkDisposed();
         implParameters.clearParameters();
     }
 
     public void setArray(int arg0, XArray arg1) throws SQLException {
-        checkDisposed();
         implParameters.setArray(arg0, arg1);
     }
 
     public void setBinaryStream(int arg0, XInputStream arg1, int arg2) throws SQLException {
-        checkDisposed();
         implParameters.setBinaryStream(arg0, arg1, arg2);
     }
 
     public void setBlob(int arg0, XBlob arg1) throws SQLException {
-        checkDisposed();
         implParameters.setBlob(arg0, arg1);
     }
 
     public void setBoolean(int arg0, boolean arg1) throws SQLException {
-        checkDisposed();
         implParameters.setBoolean(arg0, arg1);
     }
 
     public void setByte(int arg0, byte arg1) throws SQLException {
-        checkDisposed();
         implParameters.setByte(arg0, arg1);
     }
 
     public void setBytes(int arg0, byte[] arg1) throws SQLException {
-        checkDisposed();
         implParameters.setBytes(arg0, arg1);
     }
 
     public void setCharacterStream(int arg0, XInputStream arg1, int arg2) throws SQLException {
-        checkDisposed();
         implParameters.setCharacterStream(arg0, arg1, arg2);
     }
 
     public void setClob(int arg0, XClob arg1) throws SQLException {
-        checkDisposed();
         implParameters.setClob(arg0, arg1);
     }
 
     public void setDate(int arg0, Date arg1) throws SQLException {
-        checkDisposed();
         implParameters.setDate(arg0, arg1);
     }
 
     public void setDouble(int arg0, double arg1) throws SQLException {
-        checkDisposed();
         implParameters.setDouble(arg0, arg1);
     }
 
     public void setFloat(int arg0, float arg1) throws SQLException {
-        checkDisposed();
         implParameters.setFloat(arg0, arg1);
     }
 
     public void setInt(int arg0, int arg1) throws SQLException {
-        checkDisposed();
         implParameters.setInt(arg0, arg1);
     }
 
     public void setLong(int arg0, long arg1) throws SQLException {
-        checkDisposed();
         implParameters.setLong(arg0, arg1);
     }
 
     public void setNull(int arg0, int arg1) throws SQLException {
-        checkDisposed();
         implParameters.setNull(arg0, arg1);
     }
 
     public void setObject(int arg0, Object arg1) throws SQLException {
-        checkDisposed();
         implParameters.setObject(arg0, arg1);
     }
 
     public void setObjectNull(int arg0, int arg1, String arg2) throws SQLException {
-        checkDisposed();
         implParameters.setObjectNull(arg0, arg1, arg2);
     }
 
     public void setObjectWithInfo(int arg0, Object arg1, int arg2, int arg3) throws SQLException {
-        checkDisposed();
         implParameters.setObjectWithInfo(arg0, arg1, arg2, arg3);
     }
 
     public void setRef(int arg0, XRef arg1) throws SQLException {
-        checkDisposed();
         implParameters.setRef(arg0, arg1);
     }
 
     public void setShort(int arg0, short arg1) throws SQLException {
-        checkDisposed();
         implParameters.setShort(arg0, arg1);
     }
 
     public void setString(int arg0, String arg1) throws SQLException {
-        checkDisposed();
         implParameters.setString(arg0, arg1);
     }
 
     public void setTime(int arg0, Time arg1) throws SQLException {
-        checkDisposed();
         implParameters.setTime(arg0, arg1);
     }
 
     public void setTimestamp(int arg0, DateTime arg1) throws SQLException {
-        checkDisposed();
         implParameters.setTimestamp(arg0, arg1);
     }
 
     // XPreparedBatchExecution:
 
     public void addBatch() throws SQLException {
-        checkDisposed();
         implPreparedBatchExecution.addBatch();
     }
 
     public void clearBatch() throws SQLException {
-        checkDisposed();
         implPreparedBatchExecution.clearBatch();
     }
 
     public int[] executeBatch() throws SQLException {
-        checkDisposed();
         return implPreparedBatchExecution.executeBatch();
     }
 
     // XWarningsSupplier:
 
     public void clearWarnings() throws SQLException {
-        checkDisposed();
         implWarningsSupplier.clearWarnings();
     }
 
     public Object getWarnings() throws SQLException {
-        checkDisposed();
         return implWarningsSupplier.getWarnings();
     }
 
     // XMultipleResults:
 
     public boolean getMoreResults() throws SQLException {
-        checkDisposed();
         return implMultipleResults.getMoreResults();
     }
 
     public XResultSet getResultSet() throws SQLException {
-        checkDisposed();
         return new PostgresqlResultSet(implMultipleResults.getResultSet(), this);
     }
 
     public int getUpdateCount() throws SQLException {
-        checkDisposed();
         return implMultipleResults.getUpdateCount();
     }
-
-
 }
diff --git a/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/PostgresqlResultSet.java b/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/PostgresqlResultSet.java
index 1ba5d62cbedb..a6ab54429cb4 100644
--- a/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/PostgresqlResultSet.java
+++ b/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/PostgresqlResultSet.java
@@ -21,8 +21,6 @@
 
 package com.sun.star.sdbcx.comp.postgresql;
 
-import java.util.concurrent.atomic.AtomicBoolean;
-
 import com.sun.star.beans.PropertyVetoException;
 import com.sun.star.beans.UnknownPropertyException;
 import com.sun.star.beans.XPropertyChangeListener;
@@ -31,7 +29,6 @@ import com.sun.star.beans.XPropertySetInfo;
 import com.sun.star.beans.XVetoableChangeListener;
 import com.sun.star.container.XNameAccess;
 import com.sun.star.io.XInputStream;
-import com.sun.star.lang.DisposedException;
 import com.sun.star.lang.IllegalArgumentException;
 import com.sun.star.lang.WrappedTargetException;
 import com.sun.star.lib.uno.helper.ComponentBase;
@@ -70,7 +67,6 @@ public class PostgresqlResultSet extends ComponentBase
     private XColumnLocate implColumnLocate;
     private XPropertySet implPropertySet;
     private Object statement;
-    private AtomicBoolean isDisposed = new AtomicBoolean(false);
 
     public PostgresqlResultSet(XResultSet impl, Object statement) {
         this.impl = impl;
@@ -89,20 +85,13 @@ public class PostgresqlResultSet extends ComponentBase
     // XComponent:
 
     @Override
-    protected synchronized void postDisposing() {
-        isDisposed.set(true);
+    protected void postDisposing() {
         try {
             implCloseable.close();
         } catch (SQLException sqlException) {
         }
     };
 
-    private void checkDisposed() throws DisposedException {
-        if (isDisposed.get()) {
-            throw new DisposedException();
-        }
-    }
-
     // XCloseable:
 
     public void close() throws SQLException {
@@ -112,384 +101,311 @@ public class PostgresqlResultSet extends ComponentBase
     // XResultSet:
 
     public boolean absolute(int arg0) throws SQLException {
-        checkDisposed();
         return impl.absolute(arg0);
     }
 
     public void afterLast() throws SQLException {
-        checkDisposed();
         impl.afterLast();
     }
 
     public void beforeFirst() throws SQLException {
-        checkDisposed();
         impl.beforeFirst();
     }
 
     public boolean first() throws SQLException {
-        checkDisposed();
         return impl.first();
     }
 
     public int getRow() throws SQLException {
-        checkDisposed();
         return impl.getRow();
     }
 
     public Object getStatement() throws SQLException {
-        checkDisposed();
         return statement;
     }
 
     public boolean isAfterLast() throws SQLException {
-        checkDisposed();
         return impl.isAfterLast();
     }
 
     public boolean isBeforeFirst() throws SQLException {
-        checkDisposed();
         return impl.isBeforeFirst();
     }
 
     public boolean isFirst() throws SQLException {
-        checkDisposed();
         return impl.isFirst();
     }
 
     public boolean isLast() throws SQLException {
-        checkDisposed();
         return impl.isLast();
     }
 
     public boolean last() throws SQLException {
-        checkDisposed();
         return impl.last();
     }
 
     public boolean next() throws SQLException {
-        checkDisposed();
         return impl.next();
     }
 
     public boolean previous() throws SQLException {
-        checkDisposed();
         return impl.previous();
     }
 
     public void refreshRow() throws SQLException {
-        checkDisposed();
         impl.refreshRow();
     }
 
     public boolean relative(int arg0) throws SQLException {
-        checkDisposed();
         return impl.relative(arg0);
     }
 
     public boolean rowDeleted() throws SQLException {
-        checkDisposed();
         return impl.rowDeleted();
     }
 
     public boolean rowInserted() throws SQLException {
-        checkDisposed();
         return impl.rowInserted();
     }
 
     public boolean rowUpdated() throws SQLException {
-        checkDisposed();
         return impl.rowUpdated();
     }
 
     // XRow:
 
     public XArray getArray(int arg0) throws SQLException {
-        checkDisposed();
         return implRow.getArray(arg0);
     }
 
     public XInputStream getBinaryStream(int arg0) throws SQLException {
-        checkDisposed();
         return implRow.getBinaryStream(arg0);
     }
 
     public XBlob getBlob(int arg0) throws SQLException {
-        checkDisposed();
         return implRow.getBlob(arg0);
     }
 
     public boolean getBoolean(int arg0) throws SQLException {
-        checkDisposed();
         return implRow.getBoolean(arg0);
     }
 
     public byte getByte(int arg0) throws SQLException {
-        checkDisposed();
         return implRow.getByte(arg0);
     }
 
     public byte[] getBytes(int arg0) throws SQLException {
-        checkDisposed();
         return implRow.getBytes(arg0);
     }
 
     public XInputStream getCharacterStream(int arg0) throws SQLException {
-        checkDisposed();
         return implRow.getCharacterStream(arg0);
     }
 
     public XClob getClob(int arg0) throws SQLException {
-        checkDisposed();
         return implRow.getClob(arg0);
     }
 
     public Date getDate(int arg0) throws SQLException {
-        checkDisposed();
         return implRow.getDate(arg0);
     }
 
     public double getDouble(int arg0) throws SQLException {
-        checkDisposed();
         return implRow.getDouble(arg0);
     }
 
     public float getFloat(int arg0) throws SQLException {
-        checkDisposed();
         return implRow.getFloat(arg0);
     }
 
     public int getInt(int arg0) throws SQLException {
-        checkDisposed();
         return implRow.getInt(arg0);
     }
 
     public long getLong(int arg0) throws SQLException {
-        checkDisposed();
         return implRow.getLong(arg0);
     }
 
     public Object getObject(int arg0, XNameAccess arg1) throws SQLException {
-        checkDisposed();
         return implRow.getObject(arg0, arg1);
     }
 
     public XRef getRef(int arg0) throws SQLException {
-        checkDisposed();
         return implRow.getRef(arg0);
     }
 
     public short getShort(int arg0) throws SQLException {
-        checkDisposed();
         return implRow.getShort(arg0);
     }
 
     public String getString(int arg0) throws SQLException {
-        checkDisposed();
         return implRow.getString(arg0);
     }
 
     public Time getTime(int arg0) throws SQLException {
-        checkDisposed();
         return implRow.getTime(arg0);
     }
 
     public DateTime getTimestamp(int arg0) throws SQLException {
-        checkDisposed();
         return implRow.getTimestamp(arg0);
     }
 
     public boolean wasNull() throws SQLException {
-        checkDisposed();
         return implRow.wasNull();
     }
 
     // XResultSetMetaDataSupplier:
 
     public XResultSetMetaData getMetaData() throws SQLException {
-        checkDisposed();
         return new PostgresqlResultSetMetaData(implResultSetMetaDataSupplier.getMetaData());
     }
 
     // XCancellable:
 
     public void cancel() {
-        checkDisposed();
         implCancellable.cancel();
     }
 
     // XWarningsSupplier:
 
     public void clearWarnings() throws SQLException {
-        checkDisposed();
         implWarningsSupplier.clearWarnings();
     }
 
     public Object getWarnings() throws SQLException {
-        checkDisposed();
         return implWarningsSupplier.getWarnings();
     }
 
     // XResultSetUpdate:
 
     public void cancelRowUpdates() throws SQLException {
-        checkDisposed();
         implResultSetUpdate.cancelRowUpdates();
     }
 
     public void deleteRow() throws SQLException {
-        checkDisposed();
         implResultSetUpdate.deleteRow();
     }
 
     public void insertRow() throws SQLException {
-        checkDisposed();
         implResultSetUpdate.insertRow();
     }
 
     public void moveToCurrentRow() throws SQLException {
-        checkDisposed();
         implResultSetUpdate.moveToCurrentRow();
     }
 
     public void moveToInsertRow() throws SQLException {
-        checkDisposed();
         implResultSetUpdate.moveToInsertRow();
     }
 
     public void updateRow() throws SQLException {
-        checkDisposed();
         implResultSetUpdate.updateRow();
     }
 
     // XRowUpdate:
 
     public void updateBinaryStream(int arg0, XInputStream arg1, int arg2) throws SQLException {
-        checkDisposed();
         implRowUpdate.updateBinaryStream(arg0, arg1, arg2);
     }
 
     public void updateBoolean(int arg0, boolean arg1) throws SQLException {
-        checkDisposed();
         implRowUpdate.updateBoolean(arg0, arg1);
     }
 
     public void updateByte(int arg0, byte arg1) throws SQLException {
-        checkDisposed();
         implRowUpdate.updateByte(arg0, arg1);
     }
 
     public void updateBytes(int arg0, byte[] arg1) throws SQLException {
-        checkDisposed();
         implRowUpdate.updateBytes(arg0, arg1);
     }
 
     public void updateCharacterStream(int arg0, XInputStream arg1, int arg2) throws SQLException {
-        checkDisposed();
         implRowUpdate.updateCharacterStream(arg0, arg1, arg2);
     }
 
     public void updateDate(int arg0, Date arg1) throws SQLException {
-        checkDisposed();
         implRowUpdate.updateDate(arg0, arg1);
     }
 
     public void updateDouble(int arg0, double arg1) throws SQLException {
-        checkDisposed();
         implRowUpdate.updateDouble(arg0, arg1);
     }
 
     public void updateFloat(int arg0, float arg1) throws SQLException {
-        checkDisposed();
         implRowUpdate.updateFloat(arg0, arg1);
     }
 
     public void updateInt(int arg0, int arg1) throws SQLException {
-        checkDisposed();
         implRowUpdate.updateInt(arg0, arg1);
     }
 
     public void updateLong(int arg0, long arg1) throws SQLException {
-        checkDisposed();
         implRowUpdate.updateLong(arg0, arg1);
     }
 
     public void updateNull(int arg0) throws SQLException {
-        checkDisposed();
         implRowUpdate.updateNull(arg0);
     }
 
     public void updateNumericObject(int arg0, Object arg1, int arg2) throws SQLException {
-        checkDisposed();
         implRowUpdate.updateNumericObject(arg0, arg1, arg2);
     }
 
     public void updateObject(int arg0, Object arg1) throws SQLException {
-        checkDisposed();
         implRowUpdate.updateObject(arg0, arg1);
     }
 
     public void updateShort(int arg0, short arg1) throws SQLException {
-        checkDisposed();
         implRowUpdate.updateShort(arg0, arg1);
     }
 
     public void updateString(int arg0, String arg1) throws SQLException {
-        checkDisposed();
         implRowUpdate.updateString(arg0, arg1);
     }
 
     public void updateTime(int arg0, Time arg1) throws SQLException {
-        checkDisposed();
         implRowUpdate.updateTime(arg0, arg1);
     }
 
     public void updateTimestamp(int arg0, DateTime arg1) throws SQLException {
-        checkDisposed();
         implRowUpdate.updateTimestamp(arg0, arg1);
     }
 
     // XColumnLocate:
 
     public int findColumn(String arg0) throws SQLException {
-        checkDisposed();
         return implColumnLocate.findColumn(arg0);
     }
 
     // XPropertySet:
 
     public void addPropertyChangeListener(String arg0, XPropertyChangeListener arg1) throws UnknownPropertyException, WrappedTargetException {
-        checkDisposed();
         implPropertySet.addPropertyChangeListener(arg0, arg1);
     }
 
     public void addVetoableChangeListener(String arg0, XVetoableChangeListener arg1) throws UnknownPropertyException, WrappedTargetException {
-        checkDisposed();
         implPropertySet.addVetoableChangeListener(arg0, arg1);
     }
 
     public XPropertySetInfo getPropertySetInfo() {
-        checkDisposed();
         return implPropertySet.getPropertySetInfo();
     }
 
     public Object getPropertyValue(String arg0) throws UnknownPropertyException, WrappedTargetException {
-        checkDisposed();
         return implPropertySet.getPropertyValue(arg0);
     }
 
     public void removePropertyChangeListener(String arg0, XPropertyChangeListener arg1) throws UnknownPropertyException, WrappedTargetException {
-        checkDisposed();
         implPropertySet.removePropertyChangeListener(arg0, arg1);
     }
 
     public void removeVetoableChangeListener(String arg0, XVetoableChangeListener arg1) throws UnknownPropertyException, WrappedTargetException {
-        checkDisposed();
         implPropertySet.removeVetoableChangeListener(arg0, arg1);
     }
 
     public void setPropertyValue(String arg0, Object arg1)
             throws UnknownPropertyException, PropertyVetoException, IllegalArgumentException, WrappedTargetException {
-        checkDisposed();
         implPropertySet.setPropertyValue(arg0, arg1);
     }
 }
diff --git a/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/PostgresqlStatement.java b/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/PostgresqlStatement.java
index 462e10f23399..f72f0012ef85 100644
--- a/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/PostgresqlStatement.java
+++ b/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/PostgresqlStatement.java
@@ -21,15 +21,12 @@
 
 package com.sun.star.sdbcx.comp.postgresql;
 
-import java.util.concurrent.atomic.AtomicBoolean;
-
 import com.sun.star.beans.PropertyVetoException;
 import com.sun.star.beans.UnknownPropertyException;
 import com.sun.star.beans.XPropertyChangeListener;
 import com.sun.star.beans.XPropertySet;
 import com.sun.star.beans.XPropertySetInfo;
 import com.sun.star.beans.XVetoableChangeListener;
-import com.sun.star.lang.DisposedException;
 import com.sun.star.lang.IllegalArgumentException;
 import com.sun.star.lang.WrappedTargetException;
 import com.sun.star.lib.uno.helper.ComponentBase;
@@ -53,7 +50,6 @@ public class PostgresqlStatement extends ComponentBase
     private XWarningsSupplier implWarningsSupplier;
     private XMultipleResults implMultipleResults;
     private XConnection connection;
-    private AtomicBoolean isDisposed = new AtomicBoolean(false);
 
     public PostgresqlStatement(XStatement impl, XConnection connection) {
         this.impl = impl;
@@ -69,40 +65,29 @@ public class PostgresqlStatement extends ComponentBase
 
     @Override
     protected void postDisposing() {
-        isDisposed.set(true);
         try {
             implCloseable.close();
         } catch (SQLException sqlException) {
         }
     }
 
-    private void checkDisposed() throws DisposedException {
-        if (isDisposed.get()) {
-            throw new DisposedException();
-        }
-    }
-
     // XStatement:
 
     public boolean execute(String arg0) throws SQLException {
-        checkDisposed();
         System.out.println(arg0);
         return impl.execute(arg0);
     }
 
     public XResultSet executeQuery(String arg0) throws SQLException {
-        checkDisposed();
         XResultSet results = impl.executeQuery(arg0);
         return new PostgresqlResultSet(results, this);
     }
 
     public int executeUpdate(String arg0) throws SQLException {
-        checkDisposed();
         return impl.executeUpdate(arg0);
     }
 
     public XConnection getConnection() throws SQLException {
-        checkDisposed();
         return connection;
     }
 
@@ -115,74 +100,61 @@ public class PostgresqlStatement extends ComponentBase
     // XPropertySet:
 
     public void addPropertyChangeListener(String arg0, XPropertyChangeListener arg1) throws UnknownPropertyException, WrappedTargetException {
-        checkDisposed();
         implPropertySet.addPropertyChangeListener(arg0, arg1);
     }
 
     public void addVetoableChangeListener(String arg0, XVetoableChangeListener arg1) throws UnknownPropertyException, WrappedTargetException {
-        checkDisposed();
         implPropertySet.addVetoableChangeListener(arg0, arg1);
     }
 
     public XPropertySetInfo getPropertySetInfo() {
-        checkDisposed();
         return implPropertySet.getPropertySetInfo();
     }
 
     public Object getPropertyValue(String arg0) throws UnknownPropertyException, WrappedTargetException {
-        checkDisposed();
         return implPropertySet.getPropertyValue(arg0);
     }
 
     public void removePropertyChangeListener(String arg0, XPropertyChangeListener arg1) throws UnknownPropertyException, WrappedTargetException {
-        checkDisposed();
         implPropertySet.removePropertyChangeListener(arg0, arg1);
     }
 
     public void removeVetoableChangeListener(String arg0, XVetoableChangeListener arg1) throws UnknownPropertyException, WrappedTargetException {
-        checkDisposed();
         implPropertySet.removeVetoableChangeListener(arg0, arg1);
     }
 
     public void setPropertyValue(String arg0, Object arg1)
             throws UnknownPropertyException, PropertyVetoException, IllegalArgumentException, WrappedTargetException {
-        checkDisposed();
         implPropertySet.setPropertyValue(arg0, arg1);
     }
 
     // XCancellable:
 
     public void cancel() {
-        checkDisposed();
         implCancellable.cancel();
     }
 
     // XWarningsSupplier:
 
     public void clearWarnings() throws SQLException {
-        checkDisposed();
         implWarningsSupplier.clearWarnings();
     }
 
     public Object getWarnings() throws SQLException {
-        checkDisposed();
         return implWarningsSupplier.getWarnings();
     }
 
     // XMultipleResults:
 
     public boolean getMoreResults() throws SQLException {
-        checkDisposed();
         return implMultipleResults.getMoreResults();
     }
 
     public XResultSet getResultSet() throws SQLException {
-        checkDisposed();
         return new PostgresqlResultSet(implMultipleResults.getResultSet(), this);
     }
 
     public int getUpdateCount() throws SQLException {
-        checkDisposed();
         return implMultipleResults.getUpdateCount();
     }
 }
diff --git a/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/PostgresqlTable.java b/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/PostgresqlTable.java
index c5a285c7514e..1f23aaf8810f 100644
--- a/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/PostgresqlTable.java
+++ b/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/PostgresqlTable.java
@@ -42,9 +42,9 @@ import com.sun.star.sdbcx.comp.postgresql.sdbcx.SqlTableHelper.ColumnDescription
 import com.sun.star.sdbcx.comp.postgresql.sdbcx.descriptors.SdbcxTableDescriptor;
 
 public class PostgresqlTable extends OTable {
-    private PostgresqlTable(Object lock, XConnection connection, OContainer tables, String name,
+    private PostgresqlTable(XConnection connection, OContainer tables, String name,
             String catalogName, String schemaName, String description, String type) {
-        super(lock, name, true, connection, tables);
+        super(name, true, connection, tables);
         super.catalogName = catalogName;
         super.schemaName = schemaName;
         super.description = description;
@@ -53,14 +53,13 @@ public class PostgresqlTable extends OTable {
 
     public static PostgresqlTable create(XConnection connection, OContainer tables, String name,
             String catalogName, String schemaName, String description, String type) {
-        Object lock = new Object();
-        return new PostgresqlTable(lock, connection, tables, name, catalogName, schemaName, description, type);
+        return new PostgresqlTable(connection, tables, name, catalogName, schemaName, description, type);
     }
 
     @Override
     public XPropertySet createDataDescriptor() {
         SdbcxTableDescriptor descriptor = SdbcxTableDescriptor.create(true);
-        synchronized (lock) {
+        synchronized (this) {
             CompHelper.copyProperties(this, descriptor);
         }
         return descriptor;
@@ -94,7 +93,7 @@ public class PostgresqlTable extends OTable {
     protected OContainer refreshColumns() {
         try {
             List<ColumnDescription> columns = new SqlTableHelper().readColumns(getConnection().getMetaData(), catalogName, schemaName, getName());
-            return new OColumnContainer(lock, isCaseSensitive(), columns, this, getConnection().getMetaData());
+            return new OColumnContainer(this, isCaseSensitive(), columns, this, getConnection().getMetaData());
         } catch (ElementExistException elementExistException) {
             return null;
         } catch (SQLException sqlException) {
@@ -106,7 +105,7 @@ public class PostgresqlTable extends OTable {
     protected OContainer refreshIndexes() {
         try {
             List<String> indexes = new SqlTableHelper().readIndexes(getConnection().getMetaData(), catalogName, schemaName, getName(), this);
-            return new OIndexContainer(lock, indexes, isCaseSensitive(), this);
+            return new OIndexContainer(this, indexes, isCaseSensitive(), this);
         } catch (ElementExistException elementExistException) {
             return null;
         } catch (SQLException sqlException) {
diff --git a/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/comphelper/PropertySet.java b/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/comphelper/PropertySet.java
index a49a2dd6b4e5..2d99e0e27524 100644
--- a/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/comphelper/PropertySet.java
+++ b/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/comphelper/PropertySet.java
@@ -30,7 +30,6 @@ import com.sun.star.beans.XPropertyChangeListener;
 import com.sun.star.beans.XPropertySet;
 import com.sun.star.beans.XPropertySetInfo;
 import com.sun.star.beans.XVetoableChangeListener;
-import com.sun.star.lang.DisposedException;
 import com.sun.star.lang.IllegalArgumentException;
 import com.sun.star.lang.WrappedTargetException;
 import com.sun.star.lib.uno.helper.ComponentBase;
@@ -41,8 +40,8 @@ import com.sun.star.uno.Type;
 public class PropertySet extends ComponentBase implements XPropertySet, XFastPropertySet, XMultiPropertySet {
     private final PropertySetAdapter impl;
 
-    protected PropertySet(Object lock) {
-        impl = new PropertySetAdapter(lock, this);
+    protected PropertySet() {
+        impl = new PropertySetAdapter(this, this);
     }
 
     @Override
@@ -58,23 +57,25 @@ public class PropertySet extends ComponentBase implements XPropertySet, XFastPro
         impl.registerProperty(propertyName, type, attributes, getter, setter);
     }
 
-    public void addPropertyChangeListener(String propertyName, XPropertyChangeListener listener) throws UnknownPropertyException, WrappedTargetException {
+    public synchronized void addPropertyChangeListener(String propertyName, XPropertyChangeListener listener)
+            throws UnknownPropertyException, WrappedTargetException {
         // only add listeners if you are not disposed
-        if (!bInDispose && !bDisposed) {
+        if (!isDisposed()) {
             impl.addPropertyChangeListener(propertyName, listener);
         }
     }
 
-    public void addVetoableChangeListener(String propertyName, XVetoableChangeListener listener) throws UnknownPropertyException, WrappedTargetException {
+    public synchronized void addVetoableChangeListener(String propertyName, XVetoableChangeListener listener)
+            throws UnknownPropertyException, WrappedTargetException {
         // only add listeners if you are not disposed
-        if (!bInDispose && !bDisposed) {
+        if (!isDisposed()) {
             impl.addVetoableChangeListener(propertyName, listener);
         }
     }
 
-    public void addPropertiesChangeListener(String[] propertyNames, XPropertiesChangeListener listener) {
+    public synchronized void addPropertiesChangeListener(String[] propertyNames, XPropertiesChangeListener listener) {
         // only add listeners if you are not disposed
-        if (!bInDispose && !bDisposed) {
+        if (!isDisposed()) {
             impl.addPropertiesChangeListener(propertyNames, listener);
         }
     }
@@ -83,78 +84,65 @@ public class PropertySet extends ComponentBase implements XPropertySet, XFastPro
         return impl.getPropertySetInfo();
     }
 
-    public Object getPropertyValue(String propertyName) throws UnknownPropertyException, WrappedTargetException {
-        if (bInDispose || bDisposed) {
-            throw new DisposedException("Component is already disposed");
-        }
+    public synchronized Object getPropertyValue(String propertyName) throws UnknownPropertyException, WrappedTargetException {
+        checkDisposed();
         return impl.getPropertyValue(propertyName);
     }
 
     @Override
-    public Object getFastPropertyValue(int handle) throws UnknownPropertyException, WrappedTargetException {
-        if (bInDispose || bDisposed) {
-            throw new DisposedException("Component is already disposed");
-        }
+    public synchronized Object getFastPropertyValue(int handle) throws UnknownPropertyException, WrappedTargetException {
+        checkDisposed();
         return impl.getFastPropertyValue(handle);
     }
 
-    public Object[] getPropertyValues(String[] propertyNames) {
-        if (bInDispose || bDisposed) {
-            throw new DisposedException("Component is already disposed");
-        }
+    public synchronized Object[] getPropertyValues(String[] propertyNames) {
+        checkDisposed();
         return impl.getPropertyValues(propertyNames);
     }
 
-    public void removePropertyChangeListener(String propertyName, XPropertyChangeListener listener) throws UnknownPropertyException, WrappedTargetException {
+    public synchronized void removePropertyChangeListener(String propertyName, XPropertyChangeListener listener)
+            throws UnknownPropertyException, WrappedTargetException {
         // all listeners are automatically released in a dispose call
-        if (!bInDispose && !bDisposed) {
+        if (!isDisposed()) {
             impl.removePropertyChangeListener(propertyName, listener);
         }
     }
 
-    public void removeVetoableChangeListener(String propertyName, XVetoableChangeListener listener) throws UnknownPropertyException, WrappedTargetException {
+    public synchronized void removeVetoableChangeListener(String propertyName, XVetoableChangeListener listener)
+            throws UnknownPropertyException, WrappedTargetException {
         // all listeners are automatically released in a dispose call
-        if (!bInDispose && !bDisposed) {
+        if (!isDisposed()) {
             impl.removeVetoableChangeListener(propertyName, listener);
         }
     }
 
-    public void removePropertiesChangeListener(XPropertiesChangeListener listener) {
+    public synchronized void removePropertiesChangeListener(XPropertiesChangeListener listener) {
         // all listeners are automatically released in a dispose call
-        if (!bInDispose && !bDisposed) {
+        if (!isDisposed()) {
             impl.removePropertiesChangeListener(listener);
         }
     }
 
-    public void setPropertyValue(String propertyName, Object value)
+    public synchronized void setPropertyValue(String propertyName, Object value)
             throws UnknownPropertyException, PropertyVetoException, IllegalArgumentException, WrappedTargetException {
-        if (bInDispose || bDisposed) {
-            throw new DisposedException("Component is already disposed");
-        }
+        checkDisposed();
         impl.setPropertyValue(propertyName, value);
     }
 
-    public void setFastPropertyValue(int handle, Object value)
+    public synchronized void setFastPropertyValue(int handle, Object value)
             throws UnknownPropertyException, PropertyVetoException, IllegalArgumentException, WrappedTargetException {
-        if (bInDispose || bDisposed) {
-            throw new DisposedException("Component is already disposed");
-        }
+        checkDisposed();
         impl.setFastPropertyValue(handle, value);
     }
 
-    public void setPropertyValues(String[] propertyNames, Object[] values) throws PropertyVetoException, IllegalArgumentException, WrappedTargetException {
-        if (bInDispose || bDisposed) {
-            throw new DisposedException("Component is already disposed");
-        }
+    public synchronized void setPropertyValues(String[] propertyNames, Object[] values)
+            throws PropertyVetoException, IllegalArgumentException, WrappedTargetException {
+        checkDisposed();
         impl.setPropertyValues(propertyNames, values);
     }
 
-    public void firePropertiesChangeEvent(String[] propertyNames, XPropertiesChangeListener listener) {
-        if (bInDispose || bDisposed) {

... etc. - the rest is truncated


More information about the Libreoffice-commits mailing list