svn commit: r1784568 - in /openjpa/branches/2.4.x: openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/OracleDictionary.java openjpa-kernel/src/main/java/org/apache/openjpa/util/BlacklistClassResolver.java

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

svn commit: r1784568 - in /openjpa/branches/2.4.x: openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/OracleDictionary.java openjpa-kernel/src/main/java/org/apache/openjpa/util/BlacklistClassResolver.java

struberg
Author: struberg
Date: Mon Feb 27 14:14:38 2017
New Revision: 1784568

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

Modified:
    openjpa/branches/2.4.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/OracleDictionary.java
    openjpa/branches/2.4.x/openjpa-kernel/src/main/java/org/apache/openjpa/util/BlacklistClassResolver.java

Modified: openjpa/branches/2.4.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/OracleDictionary.java
URL: http://svn.apache.org/viewvc/openjpa/branches/2.4.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/OracleDictionary.java?rev=1784568&r1=1784567&r2=1784568&view=diff
==============================================================================
--- openjpa/branches/2.4.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/OracleDictionary.java (original)
+++ openjpa/branches/2.4.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/OracleDictionary.java Mon Feb 27 14:14:38 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);

Modified: openjpa/branches/2.4.x/openjpa-kernel/src/main/java/org/apache/openjpa/util/BlacklistClassResolver.java
URL: http://svn.apache.org/viewvc/openjpa/branches/2.4.x/openjpa-kernel/src/main/java/org/apache/openjpa/util/BlacklistClassResolver.java?rev=1784568&r1=1784567&r2=1784568&view=diff
==============================================================================
--- openjpa/branches/2.4.x/openjpa-kernel/src/main/java/org/apache/openjpa/util/BlacklistClassResolver.java (original)
+++ openjpa/branches/2.4.x/openjpa-kernel/src/main/java/org/apache/openjpa/util/BlacklistClassResolver.java Mon Feb 27 14:14:38 2017
@@ -59,4 +59,3 @@ public class BlacklistClassResolver {
         return false;
     }
 }
-


Loading...