Kaydet (Commit) f6ee43f7 authored tarafından Stephan Bergmann's avatar Stephan Bergmann Kaydeden (comit) Andras Timar

Work around change in JNI func sigs between Java 6 and 7

(same as dfba7454)

Change-Id: I3c79b406c2bf661717880def94989614860f9cb6
üst d74fd920
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment