diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2015-06-22 11:03:45 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2015-06-22 11:04:59 +0200 |
commit | 9908b6447ebbeec16544bd61eca6f22f1ecefbaa (patch) | |
tree | c0cb48311df72b1fef05af18a119b6c7550ae07d /connectivity | |
parent | b990cdf57d6a85a36de713004a67a90ba2650623 (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.cxx | 10 |
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); |