summaryrefslogtreecommitdiff
path: root/connectivity
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2015-06-22 11:03:45 +0200
committerAndras Timar <andras.timar@collabora.com>2015-08-06 12:52:39 +0200
commitf6ee43f7c7af23e287485900e9c46f9563936ba7 (patch)
tree5e9bd08866dcea484b49c3f0b6d9d8688fd1cd84 /connectivity
parentd74fd920b00501b58b7fd3908dead52b699450b6 (diff)
Work around change in JNI func sigs between Java 6 and 7
(same as dfba745437324b8e1a352ab5280c665c543fc37f) Change-Id: I3c79b406c2bf661717880def94989614860f9cb6
Diffstat (limited to 'connectivity')
-rw-r--r--connectivity/source/drivers/jdbc/Blob.cxx10
1 files changed, 9 insertions, 1 deletions
diff --git a/connectivity/source/drivers/jdbc/Blob.cxx b/connectivity/source/drivers/jdbc/Blob.cxx
index c8bc79163141..43db9c1f3eb1 100644
--- a/connectivity/source/drivers/jdbc/Blob.cxx
+++ b/connectivity/source/drivers/jdbc/Blob.cxx
@@ -114,7 +114,15 @@ sal_Int64 SAL_CALL java_sql_Blob::position( const ::com::sun::star::uno::Sequenc
obtainMethodId_throwSQL(t.pEnv, cMethodName,cSignature, mID);
// convert Parameter
jbyteArray pByteArray = t.pEnv->NewByteArray(pattern.getLength());
- t.pEnv->SetByteArrayRegion(pByteArray,0,pattern.getLength(),pattern.getConstArray());
+ jbyte * patternData = reinterpret_cast<jbyte *>(
+ const_cast<sal_Int8 *>(pattern.getConstArray()));
+ // 4th param of Set*ArrayRegion changed from pointer to non-const to
+ // pointer to const between <http://docs.oracle.com/javase/6/docs/
+ // technotes/guides/jni/spec/functions.html#wp22933> and
+ // <http://docs.oracle.com/javase/7/docs/technotes/guides/jni/spec/
+ // functions.html#wp22933>; work around that difference in a way
+ // that doesn't trigger loplugin:redundantcast
+ t.pEnv->SetByteArrayRegion(pByteArray,0,pattern.getLength(),patternData);
out = t.pEnv->CallLongMethod( object, mID, pByteArray,start );
t.pEnv->DeleteLocalRef(pByteArray);
ThrowSQLException(t.pEnv,*this);