svn commit: r1784577 - in /openjpa/trunk: ./ openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/OracleDictionary.java

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r1784577 - in /openjpa/trunk: ./ openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/OracleDictionary.java

struberg
Author: struberg
Date: Mon Feb 27 15:00:22 2017
New Revision: 1784577

URL: http://svn.apache.org/viewvc?rev=1784577&view=rev
Log:
OPENJPA-2689 prevent IllegalArgumentException with package scoped OraclePreparedStatementWrapper classes

Modified:
    openjpa/trunk/   (props changed)
    openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/OracleDictionary.java

Propchange: openjpa/trunk/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon Feb 27 15:00:22 2017
@@ -4,4 +4,5 @@
 /openjpa/branches/2.2.1.x:1415367,1415413,1415425,1504719,1508186,1530347,1533222,1539193,1651808,1686910
 /openjpa/branches/2.2.x:1384400,1415459-1415460,1415469,1485013,1530364,1533223,1580898,1580939,1591681,1631786,1641906,1642555,1666312,1686911,1700884,1702143,1728038,1756046,1756538,1757893
 /openjpa/branches/2.3.x:1533462,1535560,1536912,1540277,1564121
+/openjpa/branches/2.4.x:1784568
 /openjpa/branches/openjpa_jpa-2.1:1683942,1683972

Modified: openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/OracleDictionary.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/OracleDictionary.java?rev=1784577&r1=1784576&r2=1784577&view=diff
==============================================================================
--- openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/OracleDictionary.java (original)
+++ openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/OracleDictionary.java Mon Feb 27 15:00:22 2017
@@ -602,9 +602,13 @@ public class OracleDictionary
                     getInnermostDelegate();
             if (isOraclePreparedStatement(inner)) {
                 try {
-                    inner.getClass().getMethod("setFixedCHAR",
-                        new Class[]{ int.class, String.class }).
-                        invoke(inner, new Object[]{ new Integer(idx), val });
+                    Method setFixedCharMethod = inner.getClass().getMethod("setFixedCHAR",
+                                                         new Class[]{int.class, String.class});
+                    if (!setFixedCharMethod.isAccessible()) {
+                        setFixedCharMethod.setAccessible(true);
+                    }
+
+                    setFixedCharMethod.invoke(inner, new Object[]{ new Integer(idx), val });
                     return;
                 } catch (Exception e) {
                     log.warn(e);