openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From strub...@apache.org
Subject svn commit: r1758685 - in /openjpa/trunk: openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/ openjpa-lib/src/main/java/org/apache/openjpa/lib/util/
Date Wed, 31 Aug 2016 22:02:14 GMT
Author: struberg
Date: Wed Aug 31 22:02:14 2016
New Revision: 1758685

URL: http://svn.apache.org/viewvc?rev=1758685&view=rev
Log:
PWB-2663 remove factually unused ConcreteClassGenerator

Removed:
    openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/util/ConcreteClassGenerator.java
Modified:
    openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/PostgresDictionary.java
    openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/SybaseDictionary.java

Modified: openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/PostgresDictionary.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/PostgresDictionary.java?rev=1758685&r1=1758684&r2=1758685&view=diff
==============================================================================
--- openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/PostgresDictionary.java
(original)
+++ openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/PostgresDictionary.java
Wed Aug 31 22:02:14 2016
@@ -21,7 +21,6 @@ package org.apache.openjpa.jdbc.sql;
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.OutputStream;
-import java.lang.reflect.Constructor;
 import java.lang.reflect.Field;
 import java.lang.reflect.InvocationTargetException;
 import java.lang.reflect.Method;
@@ -52,7 +51,6 @@ import org.apache.openjpa.kernel.Filters
 import org.apache.openjpa.lib.jdbc.DelegatingConnection;
 import org.apache.openjpa.lib.jdbc.DelegatingPreparedStatement;
 import org.apache.openjpa.lib.jdbc.ReportingSQLException;
-import org.apache.openjpa.lib.util.ConcreteClassGenerator;
 import org.apache.openjpa.lib.util.J2DoPrivHelper;
 import org.apache.openjpa.lib.util.Localizer;
 import org.apache.openjpa.meta.JavaTypes;
@@ -71,29 +69,12 @@ public class PostgresDictionary
     private static final Localizer _loc = Localizer.forPackage
         (PostgresDictionary.class);
 
-    private static Constructor<PostgresConnection> postgresConnectionImpl;
-    private static Constructor<PostgresPreparedStatement> postgresPreparedStatementImpl;
 
     private Method dbcpGetDelegate;
     private Method connectionUnwrap;
     
     protected Set<String> _timestampTypes = new HashSet<String>(); 
 
-    static {
-        try {
-            postgresConnectionImpl = ConcreteClassGenerator.getConcreteConstructor(
-                    PostgresConnection.class,
-                    Connection.class, 
-                    PostgresDictionary.class);
-            postgresPreparedStatementImpl = ConcreteClassGenerator.getConcreteConstructor(
-                    PostgresPreparedStatement.class,
-                    PreparedStatement.class, 
-                    Connection.class, 
-                    PostgresDictionary.class);
-        } catch (Exception e) {
-            throw new ExceptionInInitializerError(e);
-        }
-    }
 
     /**
      * SQL statement to load all sequence schema,name pairs from all schemas.
@@ -396,7 +377,7 @@ public class PostgresDictionary
      * a sequence is owned by the database.  Column types such as bigserial use a 
      * system assigned sequence generator of the format: table_column_seq
      * 
-     * @see http://www.postgresql.org/docs/current/static/functions-info.html
+     * @link http://www.postgresql.org/docs/current/static/functions-info.html
      */
     public boolean isOwnedSequence(DBIdentifier name, DBIdentifier schema, Connection conn)
{
         
@@ -582,7 +563,7 @@ public class PostgresDictionary
 
     public Connection decorate(Connection conn)
         throws SQLException {
-        return ConcreteClassGenerator.newInstance(postgresConnectionImpl, super.decorate(conn),
this);
+        return new PostgresConnection(super.decorate(conn), this);
     }
 
     public InputStream getLOBStream(JDBCStore store, ResultSet rs,
@@ -963,7 +944,7 @@ public class PostgresDictionary
     /**
      * Connection wrapper to work around the postgres empty result set bug.
      */
-    protected abstract static class PostgresConnection
+    protected static class PostgresConnection
         extends DelegatingConnection {
 
         private final PostgresDictionary _dict;
@@ -975,16 +956,13 @@ public class PostgresDictionary
 
         protected PreparedStatement prepareStatement(String sql, boolean wrap)
             throws SQLException {
-           return ConcreteClassGenerator.newInstance(postgresPreparedStatementImpl, 
-                   super.prepareStatement(sql, false), PostgresConnection.this, _dict);
+           return new PostgresPreparedStatement(super.prepareStatement(sql, false), PostgresConnection.this,
_dict);
         }
 
         protected PreparedStatement prepareStatement(String sql, int rsType,
             int rsConcur, boolean wrap)
             throws SQLException {
-            return ConcreteClassGenerator.
-                newInstance(postgresPreparedStatementImpl,
-                    super.prepareStatement(sql, rsType, rsConcur, false),
+            return new PostgresPreparedStatement(super.prepareStatement(sql, rsType, rsConcur,
false),
                     PostgresConnection.this,
                     _dict);
         }
@@ -993,7 +971,7 @@ public class PostgresDictionary
     /**
      * Statement wrapper to work around the postgres empty result set bug.
      */
-    protected abstract static class PostgresPreparedStatement
+    protected static class PostgresPreparedStatement
         extends DelegatingPreparedStatement {
 
         private final PostgresDictionary _dict;

Modified: openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/SybaseDictionary.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/SybaseDictionary.java?rev=1758685&r1=1758684&r2=1758685&view=diff
==============================================================================
--- openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/SybaseDictionary.java
(original)
+++ openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/SybaseDictionary.java
Wed Aug 31 22:02:14 2016
@@ -18,7 +18,6 @@
  */
 package org.apache.openjpa.jdbc.sql;
 
-import java.lang.reflect.Constructor;
 import java.math.BigDecimal;
 import java.math.BigInteger;
 import java.sql.Connection;
@@ -37,7 +36,6 @@ import org.apache.openjpa.jdbc.schema.Pr
 import org.apache.openjpa.jdbc.schema.Table;
 import org.apache.openjpa.jdbc.schema.Unique;
 import org.apache.openjpa.lib.jdbc.DelegatingConnection;
-import org.apache.openjpa.lib.util.ConcreteClassGenerator;
 import org.apache.openjpa.lib.util.Localizer;
 import org.apache.openjpa.meta.JavaTypes;
 import org.apache.openjpa.util.StoreException;
@@ -66,19 +64,8 @@ public class SybaseDictionary
     private static Localizer _loc = Localizer.forPackage
         (SybaseDictionary.class);
 
-    private static Constructor<SybaseConnection> sybaseConnectionImpl;
-    
     public static String RIGHT_TRUNCATION_ON_SQL = "set string_rtruncation on";
     public static String NUMERIC_TRUNCATION_OFF_SQL = "set arithabort numeric_truncation
off";
-    
-    static {
-        try {
-            sybaseConnectionImpl = ConcreteClassGenerator.getConcreteConstructor(SybaseConnection.class,

-                    Connection.class);
-        } catch (Exception e) {
-            throw new ExceptionInInitializerError(e);
-        }
-    }
 
     /**
      * If true, then whenever the <code>schematool</code> creates a
@@ -342,7 +329,7 @@ public class SybaseDictionary
         }
         
         
-        return ConcreteClassGenerator.newInstance(sybaseConnectionImpl, savedConn);
+        return new SybaseConnection(savedConn);
     }
     
     /**
@@ -424,7 +411,7 @@ public class SybaseDictionary
      * which takes a very long time with the Sybase Connection (and
      * which we frequently invoke).
      */
-    protected abstract static class SybaseConnection
+    protected static class SybaseConnection
         extends DelegatingConnection {
 
         private String _catalog = null;



Mime
View raw message