From 8567a5e5c20b8e987b3612ef75c6011e51221d83 Mon Sep 17 00:00:00 2001 From: Mark Struberg Date: Mon, 27 Feb 2017 15:00:22 +0000 Subject: [PATCH] OPENJPA-2689 prevent IllegalArgumentException with package scoped OraclePreparedStatementWrapper classes git-svn-id: https://svn.apache.org/repos/asf/openjpa/trunk@1784577 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/openjpa/jdbc/sql/OracleDictionary.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/OracleDictionary.java b/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/OracleDictionary.java index 4833f8b8f..5d59baaa7 100644 --- a/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/OracleDictionary.java +++ b/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/OracleDictionary.java @@ -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);