You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by rh...@apache.org on 2015/11/30 11:24:23 UTC
svn commit: r1717223 [6/50] - in /subversion/branches/ra-git: ./ build/
build/ac-macros/ build/generator/ build/generator/templates/
contrib/hook-scripts/ notes/ notes/api-errata/1.9/ notes/move-tracking/
subversion/ subversion/bindings/ctypes-python/c...
Modified: subversion/branches/ra-git/subversion/bindings/javahl/native/NativeStream.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/ra-git/subversion/bindings/javahl/native/NativeStream.cpp?rev=1717223&r1=1717222&r2=1717223&view=diff
==============================================================================
--- subversion/branches/ra-git/subversion/bindings/javahl/native/NativeStream.cpp (original)
+++ subversion/branches/ra-git/subversion/bindings/javahl/native/NativeStream.cpp Mon Nov 30 10:24:16 2015
@@ -33,7 +33,7 @@ namespace JavaHL {
// Class JavaHL::NativeInputStream
const char* const NativeInputStream::m_class_name =
- JAVA_PACKAGE "/types/NativeInputStream";
+ JAVAHL_CLASS("/types/NativeInputStream");
NativeInputStream::~NativeInputStream() {}
@@ -45,16 +45,23 @@ void NativeInputStream::set_stream(svn_s
}
NativeInputStream*
-NativeInputStream::get_self(::Java::Env env, jobject jthis)
+NativeInputStream::get_self_unsafe(::Java::Env env, jobject jthis)
{
jfieldID fid_cppaddr = NULL;
const jlong cppaddr =
findCppAddrForJObject(jthis, &fid_cppaddr, m_class_name);
- if (!cppaddr)
- ::Java::NullPointerException(env).raise(_("this [C++]"));
return reinterpret_cast<NativeInputStream*>(cppaddr);
}
+NativeInputStream*
+NativeInputStream::get_self(::Java::Env env, jobject jthis)
+{
+ NativeInputStream* self = get_self_unsafe(env, jthis);
+ if (!self)
+ ::Java::NullPointerException(env).raise(_("this [C++]"));
+ return self;
+}
+
void NativeInputStream::close(::Java::Env env, jobject jthis)
{
SVN_JAVAHL_CHECK(env, svn_stream_close(m_stream));
@@ -137,7 +144,7 @@ void NativeInputStream::dispose(jobject
// Class JavaHL::NativeOutputStream
const char* const NativeOutputStream::m_class_name =
- JAVA_PACKAGE "/types/NativeOutputStream";
+ JAVAHL_CLASS("/types/NativeOutputStream");
NativeOutputStream::~NativeOutputStream() {}
@@ -149,16 +156,23 @@ void NativeOutputStream::set_stream(svn_
}
NativeOutputStream*
-NativeOutputStream::get_self(::Java::Env env, jobject jthis)
+NativeOutputStream::get_self_unsafe(::Java::Env env, jobject jthis)
{
jfieldID fid_cppaddr = NULL;
const jlong cppaddr =
findCppAddrForJObject(jthis, &fid_cppaddr, m_class_name);
- if (!cppaddr)
- ::Java::NullPointerException(env).raise(_("this [C++]"));
return reinterpret_cast<NativeOutputStream*>(cppaddr);
}
+NativeOutputStream*
+NativeOutputStream::get_self(::Java::Env env, jobject jthis)
+{
+ NativeOutputStream* self = get_self_unsafe(env, jthis);
+ if (!self)
+ ::Java::NullPointerException(env).raise(_("this [C++]"));
+ return self;
+}
+
void NativeOutputStream::close(::Java::Env env, jobject jthis)
{
SVN_JAVAHL_CHECK(env, svn_stream_close(m_stream));
@@ -294,6 +308,20 @@ Java_org_apache_subversion_javahl_types_
return 0;
}
+JNIEXPORT void JNICALL
+Java_org_apache_subversion_javahl_types_NativeInputStream_finalize(
+ JNIEnv* jenv, jobject jthis)
+{
+ SVN_JAVAHL_JNI_TRY(NativeInputStream, finalize)
+ {
+ JavaHL::NativeInputStream* native =
+ JavaHL::NativeInputStream::get_self_unsafe(Java::Env(jenv), jthis);
+ if (native != NULL)
+ native->finalize();
+ }
+ SVN_JAVAHL_JNI_CATCH;
+}
+
// Class JavaHL::NativeOutputStream native method implementation
#include "../include/org_apache_subversion_javahl_types_NativeOutputStream.h"
@@ -337,3 +365,17 @@ Java_org_apache_subversion_javahl_types_
}
SVN_JAVAHL_JNI_CATCH_TO_EXCEPTION(Java::IOException);
}
+
+JNIEXPORT void JNICALL
+Java_org_apache_subversion_javahl_types_NativeOutputStream_finalize(
+ JNIEnv* jenv, jobject jthis)
+{
+ SVN_JAVAHL_JNI_TRY(NativeOutputStream, finalize)
+ {
+ JavaHL::NativeOutputStream* native =
+ JavaHL::NativeOutputStream::get_self_unsafe(Java::Env(jenv), jthis);
+ if (native != NULL)
+ native->finalize();
+ }
+ SVN_JAVAHL_JNI_CATCH;
+}
Modified: subversion/branches/ra-git/subversion/bindings/javahl/native/NativeStream.hpp
URL: http://svn.apache.org/viewvc/subversion/branches/ra-git/subversion/bindings/javahl/native/NativeStream.hpp?rev=1717223&r1=1717222&r2=1717223&view=diff
==============================================================================
--- subversion/branches/ra-git/subversion/bindings/javahl/native/NativeStream.hpp (original)
+++ subversion/branches/ra-git/subversion/bindings/javahl/native/NativeStream.hpp Mon Nov 30 10:24:16 2015
@@ -81,6 +81,8 @@ public:
*/
static NativeInputStream* get_self(::Java::Env env, jobject jthis);
+ static NativeInputStream* get_self_unsafe(::Java::Env env, jobject jthis);
+
public:
/**
* Implements @c InputStream.close().
@@ -176,6 +178,8 @@ public:
*/
static NativeOutputStream* get_self(::Java::Env env, jobject jthis);
+ static NativeOutputStream* get_self_unsafe(::Java::Env env, jobject jthis);
+
public:
/**
* Implements @c OutputStream.close().
Modified: subversion/branches/ra-git/subversion/bindings/javahl/native/OperationContext.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/ra-git/subversion/bindings/javahl/native/OperationContext.cpp?rev=1717223&r1=1717222&r2=1717223&view=diff
==============================================================================
--- subversion/branches/ra-git/subversion/bindings/javahl/native/OperationContext.cpp (original)
+++ subversion/branches/ra-git/subversion/bindings/javahl/native/OperationContext.cpp Mon Nov 30 10:24:16 2015
@@ -358,6 +358,9 @@ OperationContext::checkCancel(void *canc
OperationContext *that = static_cast<OperationContext *>(cancelBaton);
if (that->isCancelledOperation())
return svn_error_create(SVN_ERR_CANCELLED, NULL, _("Operation cancelled"));
+ else if (JNIUtil::isJavaExceptionThrown())
+ return svn_error_create(SVN_ERR_CANCELLED, JNIUtil::wrapJavaException(),
+ _("Operation cancelled"));
else
return SVN_NO_ERROR;
}
@@ -385,13 +388,13 @@ OperationContext::progress(apr_off_t pro
POP_AND_RETURN_NOTHING();
mid = env->GetMethodID(clazz, "onProgress",
- "(L"JAVA_PACKAGE"/ProgressEvent;)V");
+ "(" JAVAHL_ARG("/ProgressEvent;") ")V");
if (JNIUtil::isJavaExceptionThrown() || mid == 0)
POP_AND_RETURN_NOTHING();
}
static jmethodID midCT = 0;
- jclass clazz = env->FindClass(JAVA_PACKAGE"/ProgressEvent");
+ jclass clazz = env->FindClass(JAVAHL_CLASS("/ProgressEvent"));
if (JNIUtil::isJavaExceptionThrown())
POP_AND_RETURN_NOTHING();
@@ -440,16 +443,16 @@ OperationContext::notifyConfigLoad()
static jmethodID onload_mid = 0;
if (0 == onload_mid)
{
- jclass cls = env->FindClass(JAVA_PACKAGE"/callback/ConfigEvent");
+ jclass cls = env->FindClass(JAVAHL_CLASS("/callback/ConfigEvent"));
if (JNIUtil::isJavaExceptionThrown())
return;
onload_mid = env->GetMethodID(cls, "onLoad",
- "(L"JAVA_PACKAGE"/ISVNConfig;)V");
+ "(" JAVAHL_ARG("/ISVNConfig;") ")V");
if (JNIUtil::isJavaExceptionThrown())
return;
}
- jclass cfg_cls = env->FindClass(JAVA_PACKAGE"/util/ConfigImpl");
+ jclass cfg_cls = env->FindClass(JAVAHL_CLASS("/util/ConfigImpl"));
if (JNIUtil::isJavaExceptionThrown())
return;
@@ -525,11 +528,11 @@ jobject create_Channel(const char *class
jobject create_RequestChannel(JNIEnv *env, apr_file_t *fd)
{
- return create_Channel(JAVA_PACKAGE"/util/RequestChannel", env, fd);
+ return create_Channel(JAVAHL_CLASS("/util/RequestChannel"), env, fd);
}
jobject create_ResponseChannel(JNIEnv *env, apr_file_t *fd)
{
- return create_Channel(JAVA_PACKAGE"/util/ResponseChannel", env, fd);
+ return create_Channel(JAVAHL_CLASS("/util/ResponseChannel"), env, fd);
}
} // anonymous namespace
@@ -545,7 +548,7 @@ OperationContext::checkTunnel(void *tunn
static jmethodID mid = 0;
if (0 == mid)
{
- jclass cls = env->FindClass(JAVA_PACKAGE"/callback/TunnelAgent");
+ jclass cls = env->FindClass(JAVAHL_CLASS("/callback/TunnelAgent"));
if (JNIUtil::isJavaExceptionThrown())
return false;
mid = env->GetMethodID(cls, "checkTunnel",
@@ -605,7 +608,7 @@ OperationContext::openTunnel(svn_stream_
static jmethodID mid = 0;
if (0 == mid)
{
- jclass cls = env->FindClass(JAVA_PACKAGE"/callback/TunnelAgent");
+ jclass cls = env->FindClass(JAVAHL_CLASS("/callback/TunnelAgent"));
SVN_JNI_CATCH(, SVN_ERR_BASE);
SVN_JNI_CATCH(
mid = env->GetMethodID(
@@ -615,7 +618,7 @@ OperationContext::openTunnel(svn_stream_
"Ljava/lang/String;"
"Ljava/lang/String;"
"Ljava/lang/String;I)"
- "L"JAVA_PACKAGE"/callback/TunnelAgent$CloseTunnelCallback;"),
+ JAVAHL_ARG("/callback/TunnelAgent$CloseTunnelCallback;")),
SVN_ERR_BASE);
}
@@ -647,7 +650,7 @@ OperationContext::closeTunnel(void *tunn
jclass cls;
SVN_JNI_CATCH_VOID(
cls= env->FindClass(
- JAVA_PACKAGE"/callback/TunnelAgent$CloseTunnelCallback"));
+ JAVAHL_CLASS("/callback/TunnelAgent$CloseTunnelCallback")));
SVN_JNI_CATCH_VOID(mid = env->GetMethodID(cls, "closeTunnel", "()V"));
}
SVN_JNI_CATCH_VOID(env->CallVoidMethod(jclosecb, mid));
Modified: subversion/branches/ra-git/subversion/bindings/javahl/native/PatchCallback.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/ra-git/subversion/bindings/javahl/native/PatchCallback.cpp?rev=1717223&r1=1717222&r2=1717223&view=diff
==============================================================================
--- subversion/branches/ra-git/subversion/bindings/javahl/native/PatchCallback.cpp (original)
+++ subversion/branches/ra-git/subversion/bindings/javahl/native/PatchCallback.cpp Mon Nov 30 10:24:16 2015
@@ -80,7 +80,7 @@ PatchCallback::singlePatch(svn_boolean_t
static jmethodID mid = 0;
if (mid == 0)
{
- jclass clazz = env->FindClass(JAVA_PACKAGE"/callback/PatchCallback");
+ jclass clazz = env->FindClass(JAVAHL_CLASS("/callback/PatchCallback"));
if (JNIUtil::isJavaExceptionThrown())
POP_AND_RETURN(SVN_NO_ERROR);
@@ -106,7 +106,7 @@ PatchCallback::singlePatch(svn_boolean_t
jboolean jfiltered = env->CallBooleanMethod(m_callback, mid, jcanonPath,
jpatchAbsPath, jrejectAbsPath);
if (JNIUtil::isJavaExceptionThrown())
- POP_AND_RETURN(SVN_NO_ERROR);
+ POP_AND_RETURN_EXCEPTION_AS_SVNERROR();
*filtered = (jfiltered ? TRUE : FALSE);
Modified: subversion/branches/ra-git/subversion/bindings/javahl/native/PropertyTable.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/ra-git/subversion/bindings/javahl/native/PropertyTable.cpp?rev=1717223&r1=1717222&r2=1717223&view=diff
==============================================================================
--- subversion/branches/ra-git/subversion/bindings/javahl/native/PropertyTable.cpp (original)
+++ subversion/branches/ra-git/subversion/bindings/javahl/native/PropertyTable.cpp Mon Nov 30 10:24:16 2015
@@ -58,7 +58,7 @@ apr_hash_t *PropertyTable::hash(const SV
const char *msg = apr_psprintf(pool.getPool(),
"Invalid property name: '%s'",
propname);
- JNIUtil::throwNativeException(JAVA_PACKAGE "/ClientException", msg,
+ JNIUtil::throwNativeException(JAVAHL_CLASS("/ClientException"), msg,
NULL, SVN_ERR_CLIENT_PROPERTY_NAME);
return NULL;
}
Modified: subversion/branches/ra-git/subversion/bindings/javahl/native/ProplistCallback.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/ra-git/subversion/bindings/javahl/native/ProplistCallback.cpp?rev=1717223&r1=1717222&r2=1717223&view=diff
==============================================================================
--- subversion/branches/ra-git/subversion/bindings/javahl/native/ProplistCallback.cpp (original)
+++ subversion/branches/ra-git/subversion/bindings/javahl/native/ProplistCallback.cpp Mon Nov 30 10:24:16 2015
@@ -89,7 +89,7 @@ svn_error_t *ProplistCallback::singlePat
static volatile jmethodID mid = 0;
if (mid == 0)
{
- jclass clazz = env->FindClass(JAVA_PACKAGE"/callback/ProplistCallback");
+ jclass clazz = env->FindClass(JAVAHL_CLASS("/callback/ProplistCallback"));
if (JNIUtil::isJavaExceptionThrown())
return SVN_NO_ERROR;
@@ -112,9 +112,7 @@ svn_error_t *ProplistCallback::singlePat
env->CallVoidMethod(m_callback, mid, jpath, jmap);
// We return whether an exception was thrown or not.
- env->PopLocalFrame(NULL);
-
- return SVN_NO_ERROR;
+ POP_AND_RETURN_EXCEPTION_AS_SVNERROR();
}
@@ -144,7 +142,7 @@ svn_error_t *ProplistCallback::singlePat
static jmethodID mid = 0;
if (mid == 0)
{
- jclass clazz = env->FindClass(JAVA_PACKAGE"/callback/InheritedProplistCallback");
+ jclass clazz = env->FindClass(JAVAHL_CLASS("/callback/InheritedProplistCallback"));
if (JNIUtil::isJavaExceptionThrown())
return SVN_NO_ERROR;
Modified: subversion/branches/ra-git/subversion/bindings/javahl/native/RemoteSession.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/ra-git/subversion/bindings/javahl/native/RemoteSession.cpp?rev=1717223&r1=1717222&r2=1717223&view=diff
==============================================================================
--- subversion/branches/ra-git/subversion/bindings/javahl/native/RemoteSession.cpp (original)
+++ subversion/branches/ra-git/subversion/bindings/javahl/native/RemoteSession.cpp Mon Nov 30 10:24:16 2015
@@ -52,7 +52,7 @@
#include <apr_strings.h>
#include "svn_private_config.h"
-#define JAVA_CLASS_REMOTE_SESSION JAVA_PACKAGE "/remote/RemoteSession"
+#define JAVA_CLASS_REMOTE_SESSION JAVAHL_CLASS("/remote/RemoteSession")
RemoteSession *
RemoteSession::getCppObject(jobject jthis)
@@ -214,6 +214,8 @@ RemoteSession::RemoteSession(int retryAt
cycle_detected = true;
break;
}
+ /* ### Shouldn't url be updated for the next attempt?
+ ### There is no real cycle if we just do the same thing twice? */
}
if (cycle_detected)
@@ -226,7 +228,7 @@ RemoteSession::RemoteSession(int retryAt
corrected_url));
jclass excls = env->FindClass(
- JAVA_PACKAGE "/SubversionException");
+ JAVAHL_CLASS("/SubversionException"));
if (JNIUtil::isJavaExceptionThrown())
return;
@@ -256,7 +258,7 @@ RemoteSession::RemoteSession(int retryAt
return;
jclass excls = env->FindClass(
- JAVA_PACKAGE "/remote/RetryOpenSession");
+ JAVAHL_CLASS("/remote/RetryOpenSession"));
if (JNIUtil::isJavaExceptionThrown())
return;
@@ -542,7 +544,7 @@ void fill_dirents(const char* base_url,
static jfieldID path_fid = 0;
if (path_fid == 0)
{
- jclass clazz = env->FindClass(JAVA_PACKAGE "/types/DirEntry");
+ jclass clazz = env->FindClass(JAVAHL_CLASS("/types/DirEntry"));
if (JNIUtil::isJavaExceptionThrown())
POP_AND_RETURN_NOTHING();
@@ -833,7 +835,7 @@ RemoteSession::status(jobject jthis, jst
proxy_callbacks.m_extra_baton.baton = &rp->m_target_revision;
apr_pool_t* report_pool = rp->get_report_pool();
- std::auto_ptr<EditorProxy> editor(
+ EditorProxy::UniquePtr editor(
new EditorProxy(jstatus_editor, report_pool,
repos_root_url, base_relpath,
m_context->checkCancel, m_context,
@@ -851,7 +853,7 @@ RemoteSession::status(jobject jthis, jst
editor->delta_editor(),
editor->delta_baton(),
report_pool),);
- rp->set_reporter_data(raw_reporter, report_baton, editor.release());
+ rp->set_reporter_data(raw_reporter, report_baton, editor);
}
// TODO: diff
@@ -877,8 +879,10 @@ RemoteSession::getLog(jobject jpaths,
true, subPool);
if (JNIUtil::isJavaExceptionThrown())
return;
- const apr_array_header_t* revprops = build_string_array(revpropiter,
- false, subPool);
+ const apr_array_header_t* revprops = (jrevprops != NULL)
+ ? build_string_array(revpropiter,
+ false, subPool)
+ : NULL;
if (JNIUtil::isJavaExceptionThrown())
return;
@@ -1087,7 +1091,7 @@ public:
return;
m_call_mid = env->GetMethodID(
- cls, "doSegment", "(L"JAVA_PACKAGE"/ISVNRemote$LocationSegment;)V");
+ cls, "doSegment", "(" JAVAHL_ARG("/ISVNRemote$LocationSegment;") ")V");
if (JNIUtil::isJavaExceptionThrown())
return;
}
@@ -1096,7 +1100,7 @@ private:
void call(svn_location_segment_t* segment)
{
JNIEnv* env = JNIUtil::getEnv();
- jclass cls = env->FindClass(JAVA_PACKAGE"/ISVNRemote$LocationSegment");
+ jclass cls = env->FindClass(JAVAHL_CLASS("/ISVNRemote$LocationSegment"));
if (JNIUtil::isJavaExceptionThrown())
return;
@@ -1191,7 +1195,7 @@ public:
return;
m_call_mid = env->GetMethodID(
- cls, "doRevision", "(L"JAVA_PACKAGE"/ISVNRemote$FileRevision;)V");
+ cls, "doRevision", "(" JAVAHL_ARG("/ISVNRemote$FileRevision;") ")V");
if (JNIUtil::isJavaExceptionThrown())
return;
}
@@ -1205,7 +1209,7 @@ private:
apr_pool_t* scratch_pool)
{
JNIEnv* env = JNIUtil::getEnv();
- jclass cls = env->FindClass(JAVA_PACKAGE"/ISVNRemote$FileRevision");
+ jclass cls = env->FindClass(JAVAHL_CLASS("/ISVNRemote$FileRevision"));
if (JNIUtil::isJavaExceptionThrown())
return;
Modified: subversion/branches/ra-git/subversion/bindings/javahl/native/RemoteSession.h
URL: http://svn.apache.org/viewvc/subversion/branches/ra-git/subversion/bindings/javahl/native/RemoteSession.h?rev=1717223&r1=1717222&r2=1717223&view=diff
==============================================================================
--- subversion/branches/ra-git/subversion/bindings/javahl/native/RemoteSession.h (original)
+++ subversion/branches/ra-git/subversion/bindings/javahl/native/RemoteSession.h Mon Nov 30 10:24:16 2015
@@ -56,7 +56,7 @@ class RemoteSession : public SVNBase
const char* username, const char* password,
Prompter::UniquePtr prompter, jobject jprogress,
jobject jcfgcb, jobject jtunnelcb);
- ~RemoteSession();
+ virtual ~RemoteSession();
void cancelOperation() const { m_context->cancelOperation(); }
@@ -102,7 +102,6 @@ class RemoteSession : public SVNBase
jlong jstart_revision, jlong jend_revision,
jboolean jinclude_merged_revisions,
jobject jcallback);
- // TODO: getFileRevisions
// TODO: lock
// TODO: unlock
// TODO: getLock
Modified: subversion/branches/ra-git/subversion/bindings/javahl/native/RemoteSessionContext.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/ra-git/subversion/bindings/javahl/native/RemoteSessionContext.cpp?rev=1717223&r1=1717222&r2=1717223&view=diff
==============================================================================
--- subversion/branches/ra-git/subversion/bindings/javahl/native/RemoteSessionContext.cpp (original)
+++ subversion/branches/ra-git/subversion/bindings/javahl/native/RemoteSessionContext.cpp Mon Nov 30 10:24:16 2015
@@ -90,7 +90,7 @@ void RemoteSessionContext::activate(jobj
*/
static jfieldID ctxFieldID = 0;
attachJavaObject(jremoteSession,
- "L"JAVA_PACKAGE"/remote/RemoteSession$RemoteSessionContext;",
+ JAVAHL_ARG("/remote/RemoteSession$RemoteSessionContext;"),
"sessionContext", &ctxFieldID);
/*
@@ -104,7 +104,7 @@ void RemoteSessionContext::activate(jobj
jmethodID mid = env->GetMethodID(
clazz, "setProgressCallback",
- "(L"JAVA_PACKAGE"/callback/ProgressCallback;)V");
+ "(" JAVAHL_ARG("/callback/ProgressCallback;") ")V");
if (JNIUtil::isJavaExceptionThrown() || mid == 0)
return;
Modified: subversion/branches/ra-git/subversion/bindings/javahl/native/ReposFreezeAction.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/ra-git/subversion/bindings/javahl/native/ReposFreezeAction.cpp?rev=1717223&r1=1717222&r2=1717223&view=diff
==============================================================================
--- subversion/branches/ra-git/subversion/bindings/javahl/native/ReposFreezeAction.cpp (original)
+++ subversion/branches/ra-git/subversion/bindings/javahl/native/ReposFreezeAction.cpp Mon Nov 30 10:24:16 2015
@@ -39,7 +39,7 @@ svn_error_t* ReposFreezeAction::invoke()
static volatile jmethodID mid = 0;
if (!mid)
{
- jclass cls = env->FindClass(JAVA_PACKAGE"/callback/ReposFreezeAction");
+ jclass cls = env->FindClass(JAVAHL_CLASS("/callback/ReposFreezeAction"));
if (!JNIUtil::isJavaExceptionThrown())
mid = env->GetMethodID(cls, "invoke", "()V");
}
Modified: subversion/branches/ra-git/subversion/bindings/javahl/native/ReposNotifyCallback.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/ra-git/subversion/bindings/javahl/native/ReposNotifyCallback.cpp?rev=1717223&r1=1717222&r2=1717223&view=diff
==============================================================================
--- subversion/branches/ra-git/subversion/bindings/javahl/native/ReposNotifyCallback.cpp (original)
+++ subversion/branches/ra-git/subversion/bindings/javahl/native/ReposNotifyCallback.cpp Mon Nov 30 10:24:16 2015
@@ -69,12 +69,12 @@ ReposNotifyCallback::onNotify(const svn_
static jmethodID mid = 0;
if (mid == 0)
{
- jclass clazz = env->FindClass(JAVA_PACKAGE"/callback/ReposNotifyCallback");
+ jclass clazz = env->FindClass(JAVAHL_CLASS("/callback/ReposNotifyCallback"));
if (JNIUtil::isJavaExceptionThrown())
return;
mid = env->GetMethodID(clazz, "onNotify",
- "(L"JAVA_PACKAGE"/ReposNotifyInformation;)V");
+ "(" JAVAHL_ARG("/ReposNotifyInformation;") ")V");
if (JNIUtil::isJavaExceptionThrown() || mid == 0)
return;
Modified: subversion/branches/ra-git/subversion/bindings/javahl/native/Revision.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/ra-git/subversion/bindings/javahl/native/Revision.cpp?rev=1717223&r1=1717222&r2=1717223&view=diff
==============================================================================
--- subversion/branches/ra-git/subversion/bindings/javahl/native/Revision.cpp (original)
+++ subversion/branches/ra-git/subversion/bindings/javahl/native/Revision.cpp Mon Nov 30 10:24:16 2015
@@ -57,12 +57,12 @@ Revision::Revision(jobject jthis, bool h
static jfieldID fid = 0;
if (fid == 0)
{
- jclass clazz = env->FindClass(JAVA_PACKAGE"/types/Revision");
+ jclass clazz = env->FindClass(JAVAHL_CLASS("/types/Revision"));
if (JNIUtil::isJavaExceptionThrown())
POP_AND_RETURN_NOTHING();
fid = env->GetFieldID(clazz, "revKind",
- "L"JAVA_PACKAGE"/types/Revision$Kind;");
+ JAVAHL_ARG("/types/Revision$Kind;"));
if (JNIUtil::isJavaExceptionThrown())
POP_AND_RETURN_NOTHING();
}
@@ -81,7 +81,7 @@ Revision::Revision(jobject jthis, bool h
if (fidNum == 0)
{
jclass clazz =
- env->FindClass(JAVA_PACKAGE"/types/Revision$Number");
+ env->FindClass(JAVAHL_CLASS("/types/Revision$Number"));
if (JNIUtil::isJavaExceptionThrown())
POP_AND_RETURN_NOTHING();
@@ -99,7 +99,7 @@ Revision::Revision(jobject jthis, bool h
if (fidDate == 0)
{
jclass clazz =
- env->FindClass(JAVA_PACKAGE"/types/Revision$DateSpec");
+ env->FindClass(JAVAHL_CLASS("/types/Revision$DateSpec"));
if (JNIUtil::isJavaExceptionThrown())
POP_AND_RETURN_NOTHING();
@@ -158,7 +158,7 @@ jobject
Revision::makeJRevision(svn_revnum_t rev)
{
JNIEnv *env = JNIUtil::getEnv();
- jclass clazz = env->FindClass(JAVA_PACKAGE "/types/Revision");
+ jclass clazz = env->FindClass(JAVAHL_CLASS("/types/Revision"));
if (JNIUtil::isJavaExceptionThrown())
return NULL;
@@ -166,7 +166,7 @@ Revision::makeJRevision(svn_revnum_t rev
if (getInstance == 0)
{
getInstance = env->GetStaticMethodID(clazz, "getInstance",
- "(J)L" JAVA_PACKAGE "/types/Revision;");
+ "(J)" JAVAHL_ARG("/types/Revision;"));
if (JNIUtil::isExceptionThrown())
return NULL;
}
Modified: subversion/branches/ra-git/subversion/bindings/javahl/native/RevisionRange.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/ra-git/subversion/bindings/javahl/native/RevisionRange.cpp?rev=1717223&r1=1717222&r2=1717223&view=diff
==============================================================================
--- subversion/branches/ra-git/subversion/bindings/javahl/native/RevisionRange.cpp (original)
+++ subversion/branches/ra-git/subversion/bindings/javahl/native/RevisionRange.cpp Mon Nov 30 10:24:16 2015
@@ -52,7 +52,7 @@ void get_range_info(jobject jrange,
{
JNIEnv *env = JNIUtil::getEnv();
- jclass clazz = env->FindClass(JAVA_PACKAGE"/types/RevisionRange");
+ jclass clazz = env->FindClass(JAVAHL_CLASS("/types/RevisionRange"));
if (JNIUtil::isExceptionThrown())
return;
@@ -63,7 +63,7 @@ void get_range_info(jobject jrange,
if (fmid == 0)
{
fmid = env->GetMethodID(clazz, "getFromRevision",
- "()L"JAVA_PACKAGE"/types/Revision;");
+ "()" JAVAHL_ARG("/types/Revision;"));
if (JNIUtil::isJavaExceptionThrown())
return;
}
@@ -87,7 +87,7 @@ void get_range_info(jobject jrange,
if (tmid == 0)
{
tmid = env->GetMethodID(clazz, "getToRevision",
- "()L"JAVA_PACKAGE"/types/Revision;");
+ "()" JAVAHL_ARG("/types/Revision;"));
if (JNIUtil::isJavaExceptionThrown())
return;
}
@@ -163,7 +163,7 @@ RevisionRange::makeJRevisionRange(svn_me
{
JNIEnv *env = JNIUtil::getEnv();
- jclass rangeClazz = env->FindClass(JAVA_PACKAGE "/types/RevisionRange");
+ jclass rangeClazz = env->FindClass(JAVAHL_CLASS("/types/RevisionRange"));
if (JNIUtil::isJavaExceptionThrown())
return NULL;
static jmethodID rangeCtor = 0;
Modified: subversion/branches/ra-git/subversion/bindings/javahl/native/RevisionRangeList.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/ra-git/subversion/bindings/javahl/native/RevisionRangeList.cpp?rev=1717223&r1=1717222&r2=1717223&view=diff
==============================================================================
--- subversion/branches/ra-git/subversion/bindings/javahl/native/RevisionRangeList.cpp (original)
+++ subversion/branches/ra-git/subversion/bindings/javahl/native/RevisionRangeList.cpp Mon Nov 30 10:24:16 2015
@@ -60,7 +60,7 @@ RevisionRangeList RevisionRangeList::cre
jmethodID mid = 0;
if (mid == 0)
{
- jclass cls = env->FindClass(JAVA_PACKAGE"/types/RevisionRangeList");
+ jclass cls = env->FindClass(JAVAHL_CLASS("/types/RevisionRangeList"));
if (JNIUtil::isJavaExceptionThrown())
return RevisionRangeList(NULL, pool);
Modified: subversion/branches/ra-git/subversion/bindings/javahl/native/SVNClient.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/ra-git/subversion/bindings/javahl/native/SVNClient.cpp?rev=1717223&r1=1717222&r2=1717223&view=diff
==============================================================================
--- subversion/branches/ra-git/subversion/bindings/javahl/native/SVNClient.cpp (original)
+++ subversion/branches/ra-git/subversion/bindings/javahl/native/SVNClient.cpp Mon Nov 30 10:24:16 2015
@@ -96,21 +96,21 @@ SVNClient *SVNClient::getCppObject(jobje
{
static jfieldID fid = 0;
jlong cppAddr = SVNBase::findCppAddrForJObject(jthis, &fid,
- JAVA_PACKAGE"/SVNClient");
+ JAVAHL_CLASS("/SVNClient"));
return (cppAddr == 0 ? NULL : reinterpret_cast<SVNClient *>(cppAddr));
}
void SVNClient::dispose(jobject jthis)
{
static jfieldID fid = 0;
- SVNBase::dispose(jthis, &fid, JAVA_PACKAGE"/SVNClient");
+ SVNBase::dispose(jthis, &fid, JAVAHL_CLASS("/SVNClient"));
}
jobject SVNClient::getVersionExtended(bool verbose)
{
JNIEnv *const env = JNIUtil::getEnv();
- jclass clazz = env->FindClass(JAVA_PACKAGE"/types/VersionExtended");
+ jclass clazz = env->FindClass(JAVAHL_CLASS("/types/VersionExtended"));
if (JNIUtil::isJavaExceptionThrown())
return NULL;
@@ -1564,7 +1564,10 @@ void SVNClient::vacuum(const char *path,
if (ctx == NULL)
return;
- SVN_JNI_ERR(svn_client_vacuum(path,
+ Path checkedPath(path, subPool);
+ SVN_JNI_ERR(checkedPath.error_occurred(),);
+
+ SVN_JNI_ERR(svn_client_vacuum(checkedPath.c_str(),
remove_unversioned_items,
remove_ignored_items,
fix_recorded_timestamps,
Modified: subversion/branches/ra-git/subversion/bindings/javahl/native/SVNRepos.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/ra-git/subversion/bindings/javahl/native/SVNRepos.cpp?rev=1717223&r1=1717222&r2=1717223&view=diff
==============================================================================
--- subversion/branches/ra-git/subversion/bindings/javahl/native/SVNRepos.cpp (original)
+++ subversion/branches/ra-git/subversion/bindings/javahl/native/SVNRepos.cpp Mon Nov 30 10:24:16 2015
@@ -26,7 +26,6 @@
#include "SVNRepos.h"
#include "CreateJ.h"
-#include "ReposNotifyCallback.h"
#include "JNIUtil.h"
#include "svn_error_codes.h"
#include "svn_repos.h"
@@ -50,14 +49,14 @@ SVNRepos *SVNRepos::getCppObject(jobject
{
static jfieldID fid = 0;
jlong cppAddr = SVNBase::findCppAddrForJObject(jthis, &fid,
- JAVA_PACKAGE"/SVNRepos");
+ JAVAHL_CLASS("/SVNRepos"));
return (cppAddr == 0 ? NULL : reinterpret_cast<SVNRepos *>(cppAddr));
}
void SVNRepos::dispose(jobject jthis)
{
static jfieldID fid = 0;
- SVNBase::dispose(jthis, &fid, JAVA_PACKAGE"/SVNRepos");
+ SVNBase::dispose(jthis, &fid, JAVAHL_CLASS("/SVNRepos"));
}
void SVNRepos::cancelOperation()
@@ -241,8 +240,9 @@ void SVNRepos::dump(File &path, OutputSt
" (%ld)"), youngest), );
}
- SVN_JNI_ERR(svn_repos_dump_fs3(repos, dataOut.getStream(requestPool),
+ SVN_JNI_ERR(svn_repos_dump_fs4(repos, dataOut.getStream(requestPool),
lower, upper, incremental, useDeltas,
+ true, true,
notifyCallback != NULL
? ReposNotifyCallback::notify
: NULL,
@@ -594,8 +594,9 @@ SVNRepos::getRevnum(svn_revnum_t *revnum
void
SVNRepos::verify(File &path, Revision &revisionStart, Revision &revisionEnd,
- bool keepGoing, bool checkNormalization, bool metadataOnly,
- ReposNotifyCallback *notifyCallback)
+ bool checkNormalization, bool metadataOnly,
+ ReposNotifyCallback *notifyCallback,
+ ReposVerifyCallback *verifyCallback)
{
SVN::Pool requestPool;
svn_repos_t *repos;
@@ -639,13 +640,14 @@ SVNRepos::verify(File &path, Revision &r
_("Start revision cannot be higher than end revision")), );
SVN_JNI_ERR(svn_repos_verify_fs3(repos, lower, upper,
- keepGoing,
checkNormalization,
metadataOnly,
- notifyCallback != NULL
- ? ReposNotifyCallback::notify
- : NULL,
+ (!notifyCallback ? NULL
+ : ReposNotifyCallback::notify),
notifyCallback,
+ (!verifyCallback ? NULL
+ : ReposVerifyCallback::callback),
+ verifyCallback,
checkCancel, this /* cancel callback/baton */,
requestPool.getPool()), );
}
@@ -716,7 +718,7 @@ jobject SVNRepos::lslocks(File &path, sv
NULL);
JNIEnv *env = JNIUtil::getEnv();
- jclass clazz = env->FindClass(JAVA_PACKAGE"/types/Lock");
+ jclass clazz = env->FindClass(JAVAHL_CLASS("/types/Lock"));
if (JNIUtil::isJavaExceptionThrown())
return NULL;
Modified: subversion/branches/ra-git/subversion/bindings/javahl/native/SVNRepos.h
URL: http://svn.apache.org/viewvc/subversion/branches/ra-git/subversion/bindings/javahl/native/SVNRepos.h?rev=1717223&r1=1717222&r2=1717223&view=diff
==============================================================================
--- subversion/branches/ra-git/subversion/bindings/javahl/native/SVNRepos.h (original)
+++ subversion/branches/ra-git/subversion/bindings/javahl/native/SVNRepos.h Mon Nov 30 10:24:16 2015
@@ -35,6 +35,7 @@
#include "InputStream.h"
#include "MessageReceiver.h"
#include "ReposNotifyCallback.h"
+#include "ReposVerifyCallback.h"
#include "ReposFreezeAction.h"
#include "StringArray.h"
#include "File.h"
@@ -45,8 +46,9 @@ class SVNRepos : public SVNBase
void rmlocks(File &path, StringArray &locks);
jobject lslocks(File &path, svn_depth_t depth);
void verify(File &path, Revision &revisionStart, Revision &revisionEnd,
- bool keepGoing, bool checkNormalization, bool metadataOnly,
- ReposNotifyCallback *notifyCallback);
+ bool checkNormalization, bool metadataOnly,
+ ReposNotifyCallback *notifyCallback,
+ ReposVerifyCallback *verifyCallback);
void setRevProp(File &path, Revision &revision,
const char *propName, const char *propValue,
bool usePreRevPropChangeHook,
Modified: subversion/branches/ra-git/subversion/bindings/javahl/native/StateReporter.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/ra-git/subversion/bindings/javahl/native/StateReporter.cpp?rev=1717223&r1=1717222&r2=1717223&view=diff
==============================================================================
--- subversion/branches/ra-git/subversion/bindings/javahl/native/StateReporter.cpp (original)
+++ subversion/branches/ra-git/subversion/bindings/javahl/native/StateReporter.cpp Mon Nov 30 10:24:16 2015
@@ -43,16 +43,14 @@ StateReporter::StateReporter()
{}
StateReporter::~StateReporter()
-{
- delete m_editor;
-}
+{}
StateReporter*
StateReporter::getCppObject(jobject jthis)
{
static jfieldID fid = 0;
jlong cppAddr = SVNBase::findCppAddrForJObject(jthis, &fid,
- JAVA_PACKAGE"/remote/StateReporter");
+ JAVAHL_CLASS("/remote/StateReporter"));
return (cppAddr == 0 ? NULL : reinterpret_cast<StateReporter*>(cppAddr));
}
@@ -65,7 +63,7 @@ StateReporter::dispose(jobject jthis)
abortReport();
static jfieldID fid = 0;
- SVNBase::dispose(jthis, &fid, JAVA_PACKAGE"/remote/StateReporter");
+ SVNBase::dispose(jthis, &fid, JAVAHL_CLASS("/remote/StateReporter"));
}
namespace {
@@ -179,8 +177,8 @@ StateReporter::abortReport()
void
StateReporter::set_reporter_data(const svn_ra_reporter3_t* raw_reporter,
- void* report_baton,
- EditorProxy* editor)
+ void* report_baton,
+ EditorProxy::UniquePtr editor)
{
//DEBUG:fprintf(stderr, " (n) StateReporter::set_reporter_data()\n");
Modified: subversion/branches/ra-git/subversion/bindings/javahl/native/StateReporter.h
URL: http://svn.apache.org/viewvc/subversion/branches/ra-git/subversion/bindings/javahl/native/StateReporter.h?rev=1717223&r1=1717222&r2=1717223&view=diff
==============================================================================
--- subversion/branches/ra-git/subversion/bindings/javahl/native/StateReporter.h (original)
+++ subversion/branches/ra-git/subversion/bindings/javahl/native/StateReporter.h Mon Nov 30 10:24:16 2015
@@ -61,13 +61,13 @@ private:
bool m_valid;
const svn_ra_reporter3_t* m_raw_reporter;
void* m_report_baton;
- EditorProxy* m_editor;
+ EditorProxy::UniquePtr m_editor;
friend class RemoteSession;
apr_pool_t* get_report_pool() const { return pool.getPool(); }
void set_reporter_data(const svn_ra_reporter3_t* raw_reporter,
void* report_baton,
- EditorProxy* editor);
+ EditorProxy::UniquePtr editor);
svn_revnum_t m_target_revision;
};
Modified: subversion/branches/ra-git/subversion/bindings/javahl/native/StatusCallback.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/ra-git/subversion/bindings/javahl/native/StatusCallback.cpp?rev=1717223&r1=1717222&r2=1717223&view=diff
==============================================================================
--- subversion/branches/ra-git/subversion/bindings/javahl/native/StatusCallback.cpp (original)
+++ subversion/branches/ra-git/subversion/bindings/javahl/native/StatusCallback.cpp Mon Nov 30 10:24:16 2015
@@ -81,13 +81,13 @@ StatusCallback::doStatus(const char *loc
// it can be cached.
if (mid == 0)
{
- jclass clazz = env->FindClass(JAVA_PACKAGE"/callback/StatusCallback");
+ jclass clazz = env->FindClass(JAVAHL_CLASS("/callback/StatusCallback"));
if (JNIUtil::isJavaExceptionThrown())
POP_AND_RETURN(SVN_NO_ERROR);
mid = env->GetMethodID(clazz, "doStatus",
"(Ljava/lang/String;"
- "L"JAVA_PACKAGE"/types/Status;)V");
+ JAVAHL_ARG("/types/Status;") ")V");
if (JNIUtil::isJavaExceptionThrown() || mid == 0)
POP_AND_RETURN(SVN_NO_ERROR);
}
@@ -101,11 +101,8 @@ StatusCallback::doStatus(const char *loc
POP_AND_RETURN(SVN_NO_ERROR);
env->CallVoidMethod(m_callback, mid, jPath, jStatus);
- // We return here regardless of whether an exception is thrown or not,
- // so we do not need to explicitly check for one.
- env->PopLocalFrame(NULL);
- return SVN_NO_ERROR;
+ POP_AND_RETURN_EXCEPTION_AS_SVNERROR();
}
void
Modified: subversion/branches/ra-git/subversion/bindings/javahl/native/SubversionException.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/ra-git/subversion/bindings/javahl/native/SubversionException.cpp?rev=1717223&r1=1717222&r2=1717223&view=diff
==============================================================================
--- subversion/branches/ra-git/subversion/bindings/javahl/native/SubversionException.cpp (original)
+++ subversion/branches/ra-git/subversion/bindings/javahl/native/SubversionException.cpp Mon Nov 30 10:24:16 2015
@@ -27,6 +27,6 @@
namespace JavaHL {
const char* const SubversionException::m_class_name =
- JAVA_PACKAGE"/SubversionException";
+ JAVAHL_CLASS("/SubversionException");
} // namespace JavaHL
Modified: subversion/branches/ra-git/subversion/bindings/javahl/native/VersionExtended.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/ra-git/subversion/bindings/javahl/native/VersionExtended.cpp?rev=1717223&r1=1717222&r2=1717223&view=diff
==============================================================================
--- subversion/branches/ra-git/subversion/bindings/javahl/native/VersionExtended.cpp (original)
+++ subversion/branches/ra-git/subversion/bindings/javahl/native/VersionExtended.cpp Mon Nov 30 10:24:16 2015
@@ -27,7 +27,7 @@
#include "JNIUtil.h"
#include "VersionExtended.h"
-const VersionExtended *
+VersionExtended *
VersionExtended::getCppObject(jobject jthis)
{
if (!jthis)
@@ -35,7 +35,7 @@ VersionExtended::getCppObject(jobject jt
static jfieldID fid = 0;
jlong cppAddr = SVNBase::findCppAddrForJObject(
- jthis, &fid, JAVA_PACKAGE"/types/VersionExtended");
+ jthis, &fid, JAVAHL_CLASS("/types/VersionExtended"));
return (cppAddr == 0 ? NULL : reinterpret_cast<VersionExtended *>(cppAddr));
}
@@ -46,7 +46,7 @@ static jobject getWrapperAddress(jobject
if (!*fid)
{
*fid = env->GetFieldID(env->GetObjectClass(jthat), "wrapper",
- "L"JAVA_PACKAGE"/types/VersionExtended;");
+ JAVAHL_ARG("/types/VersionExtended;"));
if (JNIUtil::isJavaExceptionThrown())
{
*fid = 0;
@@ -94,5 +94,5 @@ VersionExtended::~VersionExtended() {}
void VersionExtended::dispose(jobject jthis)
{
static jfieldID fid = 0;
- SVNBase::dispose(jthis, &fid, JAVA_PACKAGE"/types/VersionExtended");
+ SVNBase::dispose(jthis, &fid, JAVAHL_CLASS("/types/VersionExtended"));
}
Modified: subversion/branches/ra-git/subversion/bindings/javahl/native/VersionExtended.h
URL: http://svn.apache.org/viewvc/subversion/branches/ra-git/subversion/bindings/javahl/native/VersionExtended.h?rev=1717223&r1=1717222&r2=1717223&view=diff
==============================================================================
--- subversion/branches/ra-git/subversion/bindings/javahl/native/VersionExtended.h (original)
+++ subversion/branches/ra-git/subversion/bindings/javahl/native/VersionExtended.h Mon Nov 30 10:24:16 2015
@@ -33,7 +33,7 @@
class VersionExtended : public SVNBase
{
public:
- static const VersionExtended *getCppObject(jobject jthis);
+ static VersionExtended *getCppObject(jobject jthis);
static const VersionExtended *getCppObjectFromLinkedLib(jobject jthat);
static const VersionExtended *getCppObjectFromLoadedLib(jobject jthat);
static const VersionExtended *getCppObjectFromLinkedLibIterator(jobject jthat);
Modified: subversion/branches/ra-git/subversion/bindings/javahl/native/jniwrapper/jni_base.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/ra-git/subversion/bindings/javahl/native/jniwrapper/jni_base.cpp?rev=1717223&r1=1717222&r2=1717223&view=diff
==============================================================================
--- subversion/branches/ra-git/subversion/bindings/javahl/native/jniwrapper/jni_base.cpp (original)
+++ subversion/branches/ra-git/subversion/bindings/javahl/native/jniwrapper/jni_base.cpp Mon Nov 30 10:24:16 2015
@@ -179,30 +179,6 @@ void Env::throw_java_out_of_memory(const
const jint LocalFrame::DEFAULT_CAPACITY = 16;
-// class Java::GlobalObject
-
-GlobalObject& GlobalObject::operator=(jobject that)
-{
- this->~GlobalObject();
- return *new(this) GlobalObject(Env(), that);
-}
-
-GlobalObject::~GlobalObject()
-{
- if (m_obj)
- Env().DeleteGlobalRef(m_obj);
-}
-
-
-// class Java::GlobalClass
-
-GlobalClass& GlobalClass::operator=(jclass that)
-{
- this->~GlobalClass();
- return *new(this) GlobalClass(Env(), that);
-}
-
-
// Class Java::Object
const char* const Object::m_class_name = "java/lang/Object";
@@ -375,7 +351,8 @@ const char* unknown_cxx_exception_messag
svn_error_t* caught_java_exception_error(apr_status_t status) throw()
{
- return svn_error_create(status, NULL, _("Java exception"));
+ return svn_error_create(status, JNIUtil::wrapJavaException(),
+ _("Java exception"));
}
} // namespace Java
Propchange: subversion/branches/ra-git/subversion/bindings/javahl/native/jniwrapper/jni_channel.hpp
------------------------------------------------------------------------------
svn:eol-style = native
Modified: subversion/branches/ra-git/subversion/bindings/javahl/native/jniwrapper/jni_globalref.hpp
URL: http://svn.apache.org/viewvc/subversion/branches/ra-git/subversion/bindings/javahl/native/jniwrapper/jni_globalref.hpp?rev=1717223&r1=1717222&r2=1717223&view=diff
==============================================================================
--- subversion/branches/ra-git/subversion/bindings/javahl/native/jniwrapper/jni_globalref.hpp (original)
+++ subversion/branches/ra-git/subversion/bindings/javahl/native/jniwrapper/jni_globalref.hpp Mon Nov 30 10:24:16 2015
@@ -24,6 +24,8 @@
#ifndef SVN_JAVAHL_JNIWRAPPER_GLOBALREF_HPP
#define SVN_JAVAHL_JNIWRAPPER_GLOBALREF_HPP
+#include <memory>
+
#include <jni.h>
#include "jni_env.hpp"
@@ -43,11 +45,19 @@ public:
: m_obj(obj ? env.NewGlobalRef(obj) : NULL)
{}
- ~GlobalObject();
+ ~GlobalObject() throw()
+ {
+ if (m_obj)
+ Env().DeleteGlobalRef(m_obj);
+ }
- GlobalObject& operator=(jobject that);
+ GlobalObject& operator=(jobject that)
+ {
+ this->~GlobalObject();
+ return *new(this) GlobalObject(Env(), that);
+ }
- jobject get() const
+ jobject get() const throw()
{
return m_obj;
}
@@ -73,9 +83,13 @@ public:
: GlobalObject(env, cls)
{}
- GlobalClass& operator=(jclass that);
+ GlobalClass& operator=(jclass that)
+ {
+ GlobalObject::operator=(that);
+ return *this;
+ }
- jclass get() const
+ jclass get() const throw()
{
return jclass(GlobalObject::get());
}
Modified: subversion/branches/ra-git/subversion/bindings/javahl/native/org_apache_subversion_javahl_SVNClient.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/ra-git/subversion/bindings/javahl/native/org_apache_subversion_javahl_SVNClient.cpp?rev=1717223&r1=1717222&r2=1717223&view=diff
==============================================================================
--- subversion/branches/ra-git/subversion/bindings/javahl/native/org_apache_subversion_javahl_SVNClient.cpp (original)
+++ subversion/branches/ra-git/subversion/bindings/javahl/native/org_apache_subversion_javahl_SVNClient.cpp Mon Nov 30 10:24:16 2015
@@ -298,7 +298,7 @@ JNIEXPORT void JNICALL
Java_org_apache_subversion_javahl_SVNClient_setTunnelAgent
(JNIEnv *env, jobject jthis, jobject jtunnelcb)
{
- JNIEntry(SVNClient, setPrompt);
+ JNIEntry(SVNClient, setTunnelAgent);
SVNClient *cl = SVNClient::getCppObject(jthis);
if (cl == NULL)
{
@@ -1045,7 +1045,7 @@ Java_org_apache_subversion_javahl_SVNCli
jbyteArray jval, jobject jmessage, jboolean jforce, jobject jrevpropTable,
jobject jcallback)
{
- JNIEntry(SVNClient, propertySet);
+ JNIEntry(SVNClient, propertySetRemote);
SVNClient *cl = SVNClient::getCppObject(jthis);
if (cl == NULL)
{
@@ -1083,7 +1083,7 @@ Java_org_apache_subversion_javahl_SVNCli
(JNIEnv *env, jobject jthis, jobject jtargets, jstring jname,
jbyteArray jval, jobject jdepth, jobject jchangelists, jboolean jforce)
{
- JNIEntry(SVNClient, propertySet);
+ JNIEntry(SVNClient, propertySetLocal);
SVNClient *cl = SVNClient::getCppObject(jthis);
if (cl == NULL)
{
@@ -1968,7 +1968,7 @@ Java_org_apache_subversion_javahl_SVNCli
jboolean jfixRecordedTimestamps, jboolean jremoveUnusedPristines,
jboolean jincludeExternals)
{
- JNIEntry(SVNClient, patch);
+ JNIEntry(SVNClient, vacuum);
SVNClient *cl = SVNClient::getCppObject(jthis);
if (cl == NULL)
{
@@ -1987,7 +1987,7 @@ JNIEXPORT jobject JNICALL
Java_org_apache_subversion_javahl_SVNClient_nativeOpenRemoteSession
(JNIEnv *env, jobject jthis, jstring jpath, jint jretryAttempts)
{
- JNIEntry(SVNClient, openRemoteSession);
+ JNIEntry(SVNClient, nativeOpenRemoteSession);
SVNClient *cl = SVNClient::getCppObject(jthis);
if (cl == NULL)
{
Modified: subversion/branches/ra-git/subversion/bindings/javahl/native/org_apache_subversion_javahl_SVNRepos.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/ra-git/subversion/bindings/javahl/native/org_apache_subversion_javahl_SVNRepos.cpp?rev=1717223&r1=1717222&r2=1717223&view=diff
==============================================================================
--- subversion/branches/ra-git/subversion/bindings/javahl/native/org_apache_subversion_javahl_SVNRepos.cpp (original)
+++ subversion/branches/ra-git/subversion/bindings/javahl/native/org_apache_subversion_javahl_SVNRepos.cpp Mon Nov 30 10:24:16 2015
@@ -419,8 +419,8 @@ JNIEXPORT void JNICALL
Java_org_apache_subversion_javahl_SVNRepos_verify(
JNIEnv *env, jobject jthis, jobject jpath,
jobject jrevisionStart, jobject jrevisionEnd,
- jboolean jkeepGoing, jboolean jcheckNormalization, jboolean jmetadataOnly,
- jobject jcallback)
+ jboolean jcheckNormalization, jboolean jmetadataOnly,
+ jobject jnotifyCallback, jobject jverifyCallback)
{
JNIEntry(SVNRepos, verify);
SVNRepos *cl = SVNRepos::getCppObject(jthis);
@@ -442,13 +442,18 @@ Java_org_apache_subversion_javahl_SVNRep
if (JNIUtil::isExceptionThrown())
return;
- ReposNotifyCallback callback(jcallback);
+ ReposNotifyCallback notify_cb(jnotifyCallback);
+ if (JNIUtil::isExceptionThrown())
+ return;
+
+ ReposVerifyCallback verify_cb(jverifyCallback);
if (JNIUtil::isExceptionThrown())
return;
cl->verify(path, revisionStart, revisionEnd,
- jkeepGoing, jcheckNormalization, jmetadataOnly,
- jcallback != NULL ? &callback : NULL);
+ jcheckNormalization, jmetadataOnly,
+ jnotifyCallback != NULL ? ¬ify_cb : NULL,
+ jverifyCallback != NULL ? &verify_cb : NULL);
}
JNIEXPORT jobject JNICALL
Modified: subversion/branches/ra-git/subversion/bindings/javahl/native/org_apache_subversion_javahl_remote_RemoteSession.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/ra-git/subversion/bindings/javahl/native/org_apache_subversion_javahl_remote_RemoteSession.cpp?rev=1717223&r1=1717222&r2=1717223&view=diff
==============================================================================
--- subversion/branches/ra-git/subversion/bindings/javahl/native/org_apache_subversion_javahl_remote_RemoteSession.cpp (original)
+++ subversion/branches/ra-git/subversion/bindings/javahl/native/org_apache_subversion_javahl_remote_RemoteSession.cpp Mon Nov 30 10:24:16 2015
@@ -70,7 +70,7 @@ JNIEXPORT void JNICALL
Java_org_apache_subversion_javahl_remote_RemoteSession_reparent(
JNIEnv *env, jobject jthis, jstring jurl)
{
- JNIEntry(RemoteSession, getSessionUrl);
+ JNIEntry(RemoteSession, reparent);
RemoteSession *ras = RemoteSession::getCppObject(jthis);
CPPADDR_NULL_PTR(ras, );
@@ -81,7 +81,7 @@ JNIEXPORT jstring JNICALL
Java_org_apache_subversion_javahl_remote_RemoteSession_getSessionRelativePath(
JNIEnv *env, jobject jthis, jstring jurl)
{
- JNIEntry(RemoteSession, getSessionUrl);
+ JNIEntry(RemoteSession, getSessionRelativePath);
RemoteSession *ras = RemoteSession::getCppObject(jthis);
CPPADDR_NULL_PTR(ras, NULL);
@@ -92,7 +92,7 @@ JNIEXPORT jstring JNICALL
Java_org_apache_subversion_javahl_remote_RemoteSession_getReposRelativePath(
JNIEnv *env, jobject jthis, jstring jurl)
{
- JNIEntry(RemoteSession, getSessionUrl);
+ JNIEntry(RemoteSession, getReposRelativePath);
RemoteSession *ras = RemoteSession::getCppObject(jthis);
CPPADDR_NULL_PTR(ras, NULL);
@@ -114,7 +114,7 @@ JNIEXPORT jstring JNICALL
Java_org_apache_subversion_javahl_remote_RemoteSession_getReposUUID(
JNIEnv *env, jobject jthis)
{
- JNIEntry(RemoteSession, geRepostUUID);
+ JNIEntry(RemoteSession, getReposUUID);
RemoteSession *ras = RemoteSession::getCppObject(jthis);
CPPADDR_NULL_PTR(ras, NULL);
@@ -125,7 +125,7 @@ JNIEXPORT jstring JNICALL
Java_org_apache_subversion_javahl_remote_RemoteSession_getReposRootUrl(
JNIEnv *env, jobject jthis)
{
- JNIEntry(RemoteSession, geRepostUUID);
+ JNIEntry(RemoteSession, getReposRootUrl);
RemoteSession *ras = RemoteSession::getCppObject(jthis);
CPPADDR_NULL_PTR(ras, NULL);
@@ -147,7 +147,7 @@ JNIEXPORT jlong JNICALL
Java_org_apache_subversion_javahl_remote_RemoteSession_getRevisionByTimestamp(
JNIEnv *env, jobject jthis, jlong timestamp)
{
- JNIEntry(RemoteSession, getDatedRevision);
+ JNIEntry(RemoteSession, getRevisionByTimestamp);
RemoteSession *ras = RemoteSession::getCppObject(jthis);
CPPADDR_NULL_PTR(ras, SVN_INVALID_REVNUM);
Modified: subversion/branches/ra-git/subversion/bindings/javahl/native/org_apache_subversion_javahl_remote_StateReporter.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/ra-git/subversion/bindings/javahl/native/org_apache_subversion_javahl_remote_StateReporter.cpp?rev=1717223&r1=1717222&r2=1717223&view=diff
==============================================================================
--- subversion/branches/ra-git/subversion/bindings/javahl/native/org_apache_subversion_javahl_remote_StateReporter.cpp (original)
+++ subversion/branches/ra-git/subversion/bindings/javahl/native/org_apache_subversion_javahl_remote_StateReporter.cpp Mon Nov 30 10:24:16 2015
@@ -47,7 +47,7 @@ JNIEXPORT void JNICALL
Java_org_apache_subversion_javahl_remote_StateReporter_nativeDispose(
JNIEnv* env, jobject jthis)
{
- JNIEntry(StateReporter, nativeCreateInstance);
+ JNIEntry(StateReporter, nativeDispose);
StateReporter* reporter = StateReporter::getCppObject(jthis);
CPPADDR_NULL_PTR(reporter,);
reporter->dispose(jthis);
Modified: subversion/branches/ra-git/subversion/bindings/javahl/native/org_apache_subversion_javahl_types_VersionExtended.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/ra-git/subversion/bindings/javahl/native/org_apache_subversion_javahl_types_VersionExtended.cpp?rev=1717223&r1=1717222&r2=1717223&view=diff
==============================================================================
--- subversion/branches/ra-git/subversion/bindings/javahl/native/org_apache_subversion_javahl_types_VersionExtended.cpp (original)
+++ subversion/branches/ra-git/subversion/bindings/javahl/native/org_apache_subversion_javahl_types_VersionExtended.cpp Mon Nov 30 10:24:16 2015
@@ -33,8 +33,24 @@
#include "JNIStackElement.h"
#include <string>
+#include "svn_private_config.h"
+
// VersionExtended native methods
+JNIEXPORT void JNICALL
+Java_org_apache_subversion_javahl_types_VersionExtended_dispose(
+ JNIEnv *env, jobject jthis)
+{
+ JNIEntry(VersionExtended, dispose);
+ VersionExtended *const vx = VersionExtended::getCppObject(jthis);
+ if (vx == NULL)
+ {
+ JNIUtil::throwError(_("bad C++ this"));
+ return;
+ }
+ vx->dispose(jthis);
+}
+
JNIEXPORT jstring JNICALL
Java_org_apache_subversion_javahl_types_VersionExtended_getBuildDate(
JNIEnv *env, jobject jthis)
Modified: subversion/branches/ra-git/subversion/bindings/javahl/native/org_apache_subversion_javahl_util_ConfigImpl_Category.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/ra-git/subversion/bindings/javahl/native/org_apache_subversion_javahl_util_ConfigImpl_Category.cpp?rev=1717223&r1=1717222&r2=1717223&view=diff
==============================================================================
--- subversion/branches/ra-git/subversion/bindings/javahl/native/org_apache_subversion_javahl_util_ConfigImpl_Category.cpp (original)
+++ subversion/branches/ra-git/subversion/bindings/javahl/native/org_apache_subversion_javahl_util_ConfigImpl_Category.cpp Mon Nov 30 10:24:16 2015
@@ -260,7 +260,7 @@ Java_org_apache_subversion_javahl_util_C
JNIEnv* env, jobject jthis, jstring jcategory, jlong jcontext,
jstring jsection, jobject jhandler)
{
- JNIEntry(ConfigImpl$Category, sections);
+ JNIEntry(ConfigImpl$Category, enumerate);
const ImplContext ctx(env, jthis, jcategory, jcontext, jsection, NULL);
struct enumerator_t
@@ -270,12 +270,12 @@ Java_org_apache_subversion_javahl_util_C
{
enumerator_t* enmr = static_cast<enumerator_t*>(baton);
JNIEnv* const e = enmr->m_env;
- const jobject jh = enmr->m_jhandler;;
+ const jobject jh = enmr->m_jhandler;
static jmethodID mid = 0;
if (0 == mid)
{
- jclass cls = e->FindClass(JAVA_PACKAGE"/ISVNConfig$Enumerator");
+ jclass cls = e->FindClass(JAVAHL_CLASS("/ISVNConfig$Enumerator"));
if (JNIUtil::isJavaExceptionThrown())
return false;
mid = e->GetMethodID(cls, "option",
Modified: subversion/branches/ra-git/subversion/bindings/javahl/native/org_apache_subversion_javahl_util_SubstLib.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/ra-git/subversion/bindings/javahl/native/org_apache_subversion_javahl_util_SubstLib.cpp?rev=1717223&r1=1717222&r2=1717223&view=diff
==============================================================================
--- subversion/branches/ra-git/subversion/bindings/javahl/native/org_apache_subversion_javahl_util_SubstLib.cpp (original)
+++ subversion/branches/ra-git/subversion/bindings/javahl/native/org_apache_subversion_javahl_util_SubstLib.cpp Mon Nov 30 10:24:16 2015
@@ -61,7 +61,7 @@ build_keywords_common(Java::Env env, con
svn_string_t* keywords_string = keywords_contents.get_string(pool);
const char* revision = (jrevision < 0 ? NULL
: apr_psprintf(pool.getPool(),
- "%"APR_UINT64_T_FMT,
+ "%" APR_UINT64_T_FMT,
apr_uint64_t(jrevision)));
const Java::String::Contents url_contents(url);
const Java::String::Contents root_url_contents(repos_root_url);
Modified: subversion/branches/ra-git/subversion/bindings/javahl/src/org/apache/subversion/javahl/ISVNClient.java
URL: http://svn.apache.org/viewvc/subversion/branches/ra-git/subversion/bindings/javahl/src/org/apache/subversion/javahl/ISVNClient.java?rev=1717223&r1=1717222&r2=1717223&view=diff
==============================================================================
--- subversion/branches/ra-git/subversion/bindings/javahl/src/org/apache/subversion/javahl/ISVNClient.java (original)
+++ subversion/branches/ra-git/subversion/bindings/javahl/src/org/apache/subversion/javahl/ISVNClient.java Mon Nov 30 10:24:16 2015
@@ -502,9 +502,9 @@ public interface ISVNClient
* Recursively cleans up a local directory, finishing any
* incomplete operations, removing lockfiles, etc.
* <p>
- * Behaves like the 1.9 version with <code>breakLocks</code> and
- * <code>includeExternals</code> set to <code>false<code>, and the
- * other flags to <code>true</code>.
+ * Behaves like the 1.9 version with <code>includeExternals</code>
+ * set to <code>false<code>, and the other flags to
+ * <code>true</code>.
* @param path a local directory.
* @throws ClientException
*/
Modified: subversion/branches/ra-git/subversion/bindings/javahl/src/org/apache/subversion/javahl/ISVNEditor.java
URL: http://svn.apache.org/viewvc/subversion/branches/ra-git/subversion/bindings/javahl/src/org/apache/subversion/javahl/ISVNEditor.java?rev=1717223&r1=1717222&r2=1717223&view=diff
==============================================================================
--- subversion/branches/ra-git/subversion/bindings/javahl/src/org/apache/subversion/javahl/ISVNEditor.java (original)
+++ subversion/branches/ra-git/subversion/bindings/javahl/src/org/apache/subversion/javahl/ISVNEditor.java Mon Nov 30 10:24:16 2015
@@ -94,7 +94,9 @@ public interface ISVNEditor
* <code>replacesRevision</code> set accordingly <em>must</em> be used.
* <p>
* <b>Note:</b> The <code>contents</code> stream's lifetime must not
- * extend beyond the scope of this function.
+ * extend beyond the scope of this function. An
+ * implementation <b>must</b> close the stream after
+ * consuming its contents.
*
* @throws ClientException
*/
@@ -193,7 +195,9 @@ public interface ISVNEditor
* #addFile().
* <p>
* <b>Note:</b> The <code>contents</code> stream's lifetime must not
- * extend beyond the scope of this function.
+ * extend beyond the scope of this function. An
+ * implementation <b>must</b> close the stream after
+ * consuming its contents.
*
* @throws ClientException
*/
Modified: subversion/branches/ra-git/subversion/bindings/javahl/src/org/apache/subversion/javahl/ISVNRepos.java
URL: http://svn.apache.org/viewvc/subversion/branches/ra-git/subversion/bindings/javahl/src/org/apache/subversion/javahl/ISVNRepos.java?rev=1717223&r1=1717222&r2=1717223&view=diff
==============================================================================
--- subversion/branches/ra-git/subversion/bindings/javahl/src/org/apache/subversion/javahl/ISVNRepos.java (original)
+++ subversion/branches/ra-git/subversion/bindings/javahl/src/org/apache/subversion/javahl/ISVNRepos.java Mon Nov 30 10:24:16 2015
@@ -29,6 +29,7 @@ import java.io.InputStream;
import java.io.File;
import org.apache.subversion.javahl.callback.ReposNotifyCallback;
+import org.apache.subversion.javahl.callback.ReposVerifyCallback;
import org.apache.subversion.javahl.callback.ReposFreezeAction;
import org.apache.subversion.javahl.types.*;
@@ -295,32 +296,44 @@ public interface ISVNRepos {
/**
* Verify the repository at <code>path</code> between revisions
* <code>start</code> and <code>end</code>.
+ *<p>
+ * If <code>verifyCallback</code> is <code>null</code>, verification
+ * will stop at the first encountered error. Otherwise, the verification
+ * process may continue, depending on the value returned from the
+ * invocation of <code>verifyCallback</code>.
*
* @param path the path to the repository
* @param start the first revision
* @param end the last revision
- * @param keepGoing continue verification even if a revision is bad
- * @param checkNormalization report directory entry and mergeinfo name collisions
- * caused by denormalized Unicode representations
- * @param metadataOnly check only metadata, not file contents
- * @param callback the callback to receive notifications
+ * @param checkNormalization report directory entry and mergeinfo name collisions
+ * caused by denormalized Unicode representations
+ * @param metadataOnly check only metadata, not file contents
+ * @param notifyCallback the callback to receive notifications
+ * @param verifyCallback the callback to receive verification status
* @throws ClientException If an error occurred.
- * @since 1.9
+ * @since 1.9
*/
public abstract void verify(File path, Revision start, Revision end,
- boolean keepGoing, boolean checkNormalization,
+ boolean checkNormalization,
boolean metadataOnly,
- ReposNotifyCallback callback)
+ ReposNotifyCallback notifyCallback,
+ ReposVerifyCallback verifyCallback)
throws ClientException;
/**
* Verify the repository at <code>path</code> between revisions
* <code>start</code> and <code>end</code>.
+ *<p>
+ *<b>Note:</b> Behaves like the 1.9 version with
+ * <code>checkNormailzation</code> and
+ * <code>metadataOnly</code> set to <code>false</code>
+ * and <code>verifyCallback</code> set to
+ * <code>null</code>.
*
* @param path the path to the repository
* @param start the first revision
* @param end the last revision
- * @param callback the callback to receive notifications
+ * @param callback the callback to receive notifications
* @throws ClientException If an error occurred.
*/
public abstract void verify(File path, Revision start, Revision end,
Modified: subversion/branches/ra-git/subversion/bindings/javahl/src/org/apache/subversion/javahl/NativeResources.java
URL: http://svn.apache.org/viewvc/subversion/branches/ra-git/subversion/bindings/javahl/src/org/apache/subversion/javahl/NativeResources.java?rev=1717223&r1=1717222&r2=1717223&view=diff
==============================================================================
--- subversion/branches/ra-git/subversion/bindings/javahl/src/org/apache/subversion/javahl/NativeResources.java (original)
+++ subversion/branches/ra-git/subversion/bindings/javahl/src/org/apache/subversion/javahl/NativeResources.java Mon Nov 30 10:24:16 2015
@@ -141,6 +141,7 @@ public class NativeResources
*/
private static final void init()
{
+ initNativeLibrary();
version = new Version();
if (!version.isAtLeast(1, 10, 0))
{
@@ -158,4 +159,11 @@ public class NativeResources
" but the run-time version is " + runtimeVersion);
}
}
+
+ /**
+ * Initialize the native library layer.
+ * @note This is a no-op in 1.9+, but we need it for ABI
+ * compatibility with older versions of the native library.
+ */
+ private static native void initNativeLibrary();
}
Modified: subversion/branches/ra-git/subversion/bindings/javahl/src/org/apache/subversion/javahl/ReposNotifyInformation.java
URL: http://svn.apache.org/viewvc/subversion/branches/ra-git/subversion/bindings/javahl/src/org/apache/subversion/javahl/ReposNotifyInformation.java?rev=1717223&r1=1717222&r2=1717223&view=diff
==============================================================================
--- subversion/branches/ra-git/subversion/bindings/javahl/src/org/apache/subversion/javahl/ReposNotifyInformation.java (original)
+++ subversion/branches/ra-git/subversion/bindings/javahl/src/org/apache/subversion/javahl/ReposNotifyInformation.java Mon Nov 30 10:24:16 2015
@@ -35,7 +35,7 @@ public class ReposNotifyInformation exte
// Update the serialVersionUID when there is a incompatible change made to
// this class. See the java documentation for when a change is incompatible.
// http://java.sun.com/javase/7/docs/platform/serialization/spec/version.html#6678
- private static final long serialVersionUID = 1L;
+ private static final long serialVersionUID = 2L;
/**
* The {@link Action} which triggered this event.
@@ -199,12 +199,6 @@ public class ReposNotifyInformation exte
verify_rev_structure,
/**
- * A revision is found with corruption/errors.
- * @since 1.9
- */
- failure,
-
- /**
* A revprop shard got packed. @
* @since 1.9
*/
Modified: subversion/branches/ra-git/subversion/bindings/javahl/src/org/apache/subversion/javahl/SVNClient.java
URL: http://svn.apache.org/viewvc/subversion/branches/ra-git/subversion/bindings/javahl/src/org/apache/subversion/javahl/SVNClient.java?rev=1717223&r1=1717222&r2=1717223&view=diff
==============================================================================
--- subversion/branches/ra-git/subversion/bindings/javahl/src/org/apache/subversion/javahl/SVNClient.java (original)
+++ subversion/branches/ra-git/subversion/bindings/javahl/src/org/apache/subversion/javahl/SVNClient.java Mon Nov 30 10:24:16 2015
@@ -294,7 +294,7 @@ public class SVNClient implements ISVNCl
public void cleanup(String path) throws ClientException
{
- cleanup(path, false, true, true, true, false);
+ cleanup(path, true, true, true, true, false);
}
public native void resolve(String path, Depth depth,
Modified: subversion/branches/ra-git/subversion/bindings/javahl/src/org/apache/subversion/javahl/SVNRepos.java
URL: http://svn.apache.org/viewvc/subversion/branches/ra-git/subversion/bindings/javahl/src/org/apache/subversion/javahl/SVNRepos.java?rev=1717223&r1=1717222&r2=1717223&view=diff
==============================================================================
--- subversion/branches/ra-git/subversion/bindings/javahl/src/org/apache/subversion/javahl/SVNRepos.java (original)
+++ subversion/branches/ra-git/subversion/bindings/javahl/src/org/apache/subversion/javahl/SVNRepos.java Mon Nov 30 10:24:16 2015
@@ -29,6 +29,7 @@ import java.io.InputStream;
import java.io.File;
import org.apache.subversion.javahl.callback.ReposNotifyCallback;
+import org.apache.subversion.javahl.callback.ReposVerifyCallback;
import org.apache.subversion.javahl.callback.ReposFreezeAction;
import org.apache.subversion.javahl.types.*;
@@ -238,13 +239,14 @@ public class SVNRepos implements ISVNRep
ReposNotifyCallback callback)
throws ClientException
{
- verify(path, start, end, false, false, false, callback);
+ verify(path, start, end, false, false, callback, null);
}
public native void verify(File path, Revision start, Revision end,
- boolean keepGoing, boolean checkNormalization,
- boolean metadataOnly,
- ReposNotifyCallback callback)
+ boolean checkNormalization,
+ boolean metadataOnly,
+ ReposNotifyCallback notifyCallback,
+ ReposVerifyCallback verifyCallback)
throws ClientException;
/**
Modified: subversion/branches/ra-git/subversion/bindings/javahl/src/org/apache/subversion/javahl/remote/StatusEditor.java
URL: http://svn.apache.org/viewvc/subversion/branches/ra-git/subversion/bindings/javahl/src/org/apache/subversion/javahl/remote/StatusEditor.java?rev=1717223&r1=1717222&r2=1717223&view=diff
==============================================================================
--- subversion/branches/ra-git/subversion/bindings/javahl/src/org/apache/subversion/javahl/remote/StatusEditor.java (original)
+++ subversion/branches/ra-git/subversion/bindings/javahl/src/org/apache/subversion/javahl/remote/StatusEditor.java Mon Nov 30 10:24:16 2015
@@ -33,6 +33,7 @@ import java.util.GregorianCalendar;
import java.util.Locale;
import java.util.SimpleTimeZone;
import java.io.InputStream;
+import java.io.IOException;
import java.nio.charset.Charset;
/**
@@ -78,6 +79,14 @@ class StatusEditor implements ISVNEditor
long replacesRevision)
{
//DEBUG:System.err.println(" [J] StatusEditor.addFile");
+ if (contents != null) {
+ try {
+ contents.close();
+ } catch (IOException ex) {
+ throw new RuntimeException(ex);
+ }
+ }
+
checkState();
receiver.addedFile(relativePath);
}
@@ -120,6 +129,14 @@ class StatusEditor implements ISVNEditor
Map<String, byte[]> properties)
{
//DEBUG:System.err.println(" [J] StatusEditor.alterFile");
+ if (contents != null) {
+ try {
+ contents.close();
+ } catch (IOException ex) {
+ throw new RuntimeException(ex);
+ }
+ }
+
checkState();
receiver.modifiedFile(relativePath,
(checksum != null && contents != null),
Modified: subversion/branches/ra-git/subversion/bindings/javahl/src/org/apache/subversion/javahl/types/VersionExtended.java
URL: http://svn.apache.org/viewvc/subversion/branches/ra-git/subversion/bindings/javahl/src/org/apache/subversion/javahl/types/VersionExtended.java?rev=1717223&r1=1717222&r2=1717223&view=diff
==============================================================================
--- subversion/branches/ra-git/subversion/bindings/javahl/src/org/apache/subversion/javahl/types/VersionExtended.java (original)
+++ subversion/branches/ra-git/subversion/bindings/javahl/src/org/apache/subversion/javahl/types/VersionExtended.java Mon Nov 30 10:24:16 2015
@@ -41,6 +41,21 @@ public class VersionExtended
}
/**
+ * Release the native peer. This method must be called to release
+ * the native resources held by this object.
+ * <p>
+ * Once this method is called, all object references obtained from
+ * the iterators returned by {@link #getLinkedLibs()} and
+ * {@link #getLoadedLibs()} become invalid and should no longer be used.
+ */
+ public native void dispose();
+
+ /**
+ * release the native peer (should use dispose instead)
+ */
+ public native void finalize();
+
+ /**
* @return The date when the libsvn_subr library was compiled, in
* the format defined by the C standard macro #__DATE__.
*/
Modified: subversion/branches/ra-git/subversion/bindings/javahl/tests/org/apache/subversion/javahl/BasicTests.java
URL: http://svn.apache.org/viewvc/subversion/branches/ra-git/subversion/bindings/javahl/tests/org/apache/subversion/javahl/BasicTests.java?rev=1717223&r1=1717222&r2=1717223&view=diff
==============================================================================
--- subversion/branches/ra-git/subversion/bindings/javahl/tests/org/apache/subversion/javahl/BasicTests.java (original)
+++ subversion/branches/ra-git/subversion/bindings/javahl/tests/org/apache/subversion/javahl/BasicTests.java Mon Nov 30 10:24:16 2015
@@ -139,9 +139,10 @@ public class BasicTests extends SVNTests
*/
public void testVersionExtendedQuiet() throws Throwable
{
+ VersionExtended vx = null;
try
{
- VersionExtended vx = client.getVersionExtended(false);
+ vx = client.getVersionExtended(false);
String result = vx.getBuildDate();
if (result == null || result.trim().length() == 0)
throw new Exception("Build date empty");
@@ -160,6 +161,11 @@ public class BasicTests extends SVNTests
fail("VersionExtended should always be available unless the " +
"native libraries failed to initialize: " + e);
}
+ finally
+ {
+ if (vx != null)
+ vx.dispose();
+ }
}
/**
@@ -168,9 +174,10 @@ public class BasicTests extends SVNTests
*/
public void testVersionExtendedVerbose() throws Throwable
{
+ VersionExtended vx = null;
try
{
- VersionExtended vx = client.getVersionExtended(true);
+ vx = client.getVersionExtended(true);
String result = vx.getRuntimeHost();
if (result == null || result.trim().length() == 0)
throw new Exception("Runtime host empty");
@@ -216,6 +223,11 @@ public class BasicTests extends SVNTests
fail("VersionExtended should always be available unless the " +
"native libraries failed to initialize: " + e);
}
+ finally
+ {
+ if (vx != null)
+ vx.dispose();
+ }
}
/**
@@ -1091,6 +1103,7 @@ public class BasicTests extends SVNTests
private void setupPinExternalsTest(OneTest thisTest) throws Throwable
{
byte[] extref = ("^/A/D/H ADHext\n" +
+ "^/A/D/H ADHext2\n" +
"^/A/D/H@1 peggedADHext\n" +
"-r1 ^/A/D/H revvedADHext\n").getBytes();
Set<String> paths = new HashSet<String>();
@@ -1130,6 +1143,7 @@ public class BasicTests extends SVNTests
// Verification
String expected = ("^/A/D/H@2 ADHext\n" +
+ "^/A/D/H@2 ADHext2\n" +
"^/A/D/H@1 peggedADHext\n" +
"-r1 ^/A/D/H@2 revvedADHext\n");
String actual =
@@ -1158,6 +1172,7 @@ public class BasicTests extends SVNTests
// Verification
String expected = ("^/A/D/H@2 ADHext\n" +
+ "^/A/D/H@2 ADHext2\n" +
"^/A/D/H@1 peggedADHext\n" +
"-r1 ^/A/D/H@2 revvedADHext\n");
String actual =
@@ -1186,6 +1201,7 @@ public class BasicTests extends SVNTests
// Verification
String expected = ("^/A/D/H@2 ADHext\n" +
+ "^/A/D/H@2 ADHext2\n" +
"^/A/D/H@1 peggedADHext\n" +
"-r1 ^/A/D/H@2 revvedADHext\n");
String actual =
@@ -1214,6 +1230,7 @@ public class BasicTests extends SVNTests
// Verification
String expected = ("^/A/D/H@2 ADHext\n" +
+ "^/A/D/H@2 ADHext2\n" +
"^/A/D/H@1 peggedADHext\n" +
"-r1 ^/A/D/H@2 revvedADHext\n");
String actual =
@@ -1249,6 +1266,44 @@ public class BasicTests extends SVNTests
// Verification
String expected = ("^/A/D/H@2 ADHext\n" +
+ "^/A/D/H ADHext2\n" +
+ "^/A/D/H@1 peggedADHext\n" +
+ "-r1 ^/A/D/H revvedADHext\n");
+ String actual =
+ new String(client.propertyGet(target, "svn:externals", null, null));
+
+ assertEquals(expected, actual);
+ }
+
+ /**
+ * Test REPO-to-REPO copy with explicit pinned externals that
+ * don't correspond to actual externals
+ * @throws Throwable
+ */
+ public void testCopyPinExternals_repo2repo_corkscrew() throws Throwable
+ {
+ // build the test setup
+ OneTest thisTest = new OneTest();
+ setupPinExternalsTest(thisTest);
+
+ String sourceUrl = thisTest.getUrl() + "/A/B";
+ Map<String, List<ExternalItem>> externalsToPin =
+ new HashMap<String, List<ExternalItem>>();
+ List<ExternalItem> items = new ArrayList<ExternalItem>(1);
+ items.add(new ExternalItem("ADHext", "^/A/D/H", null, null));
+ externalsToPin.put(sourceUrl + "/A", items);
+
+ List<CopySource> sources = new ArrayList<CopySource>(1);
+ sources.add(new CopySource(sourceUrl, null, null));
+ String target = thisTest.getUrl() + "/A/Bcopy";
+ client.copy(sources, target, true, false, false, false,
+ true, // pinExternals
+ externalsToPin,
+ null, new ConstMsg("Copy WC to REPO"), null);
+
+ // Verification
+ String expected = ("^/A/D/H ADHext\n" +
+ "^/A/D/H ADHext2\n" +
"^/A/D/H@1 peggedADHext\n" +
"-r1 ^/A/D/H revvedADHext\n");
String actual =
Modified: subversion/branches/ra-git/subversion/bindings/javahl/tests/org/apache/subversion/javahl/RunTests.java
URL: http://svn.apache.org/viewvc/subversion/branches/ra-git/subversion/bindings/javahl/tests/org/apache/subversion/javahl/RunTests.java?rev=1717223&r1=1717222&r2=1717223&view=diff
==============================================================================
--- subversion/branches/ra-git/subversion/bindings/javahl/tests/org/apache/subversion/javahl/RunTests.java (original)
+++ subversion/branches/ra-git/subversion/bindings/javahl/tests/org/apache/subversion/javahl/RunTests.java Mon Nov 30 10:24:16 2015
@@ -95,6 +95,7 @@ public class RunTests
suite.addTestSuite(UtilTests.class);
suite.addTestSuite(SVNRemoteTests.class);
suite.addTestSuite(SVNReposTests.class);
+ suite.addTestSuite(ExceptionTests.class);
}
else
{
Modified: subversion/branches/ra-git/subversion/bindings/javahl/tests/org/apache/subversion/javahl/SVNRemoteTests.java
URL: http://svn.apache.org/viewvc/subversion/branches/ra-git/subversion/bindings/javahl/tests/org/apache/subversion/javahl/SVNRemoteTests.java?rev=1717223&r1=1717222&r2=1717223&view=diff
==============================================================================
--- subversion/branches/ra-git/subversion/bindings/javahl/tests/org/apache/subversion/javahl/SVNRemoteTests.java (original)
+++ subversion/branches/ra-git/subversion/bindings/javahl/tests/org/apache/subversion/javahl/SVNRemoteTests.java Mon Nov 30 10:24:16 2015
@@ -53,15 +53,35 @@ import java.security.NoSuchAlgorithmExce
*/
public class SVNRemoteTests extends SVNTests
{
+ /**
+ * Base name of all our tests.
+ */
+ public final static String testName = "remote_test";
+
protected OneTest thisTest;
public SVNRemoteTests()
{
+ init();
}
public SVNRemoteTests(String name)
{
super(name);
+ init();
+ }
+
+ /**
+ * Initialize the testBaseName and the testCounter, if this is the
+ * first test of this class.
+ */
+ private void init()
+ {
+ if (!testName.equals(testBaseName))
+ {
+ testCounter = 0;
+ testBaseName = testName;
+ }
}
protected void setUp() throws Exception
@@ -937,6 +957,7 @@ public class SVNRemoteTests extends SVNT
0, false, false, false, null,
receiver);
assertEquals(1, receiver.logs.size());
+ assertTrue(receiver.logs.get(0).revprops.size() > 0);
receiver.logs.clear();
session.reparent(getTestRepoUrl() + "/A");
@@ -945,6 +966,7 @@ public class SVNRemoteTests extends SVNT
0, 0, false, false, false, null,
receiver);
assertEquals(2, receiver.logs.size());
+ assertTrue(receiver.logs.get(0).revprops.size() > 0);
}
public void testGetLogMissing() throws Exception
Modified: subversion/branches/ra-git/subversion/bindings/javahl/tests/org/apache/subversion/javahl/SVNReposTests.java
URL: http://svn.apache.org/viewvc/subversion/branches/ra-git/subversion/bindings/javahl/tests/org/apache/subversion/javahl/SVNReposTests.java?rev=1717223&r1=1717222&r2=1717223&view=diff
==============================================================================
--- subversion/branches/ra-git/subversion/bindings/javahl/tests/org/apache/subversion/javahl/SVNReposTests.java (original)
+++ subversion/branches/ra-git/subversion/bindings/javahl/tests/org/apache/subversion/javahl/SVNReposTests.java Mon Nov 30 10:24:16 2015
@@ -26,6 +26,7 @@ import org.apache.subversion.javahl.call
import org.apache.subversion.javahl.types.*;
import java.io.File;
+import java.io.FileWriter;
import java.io.FileInputStream;
import java.io.OutputStream;
import java.io.InputStream;
@@ -40,13 +41,33 @@ import java.util.Map;
*/
public class SVNReposTests extends SVNTests
{
+ /**
+ * Base name of all our tests.
+ */
+ public final static String testName = "repos_test";
+
public SVNReposTests()
{
+ init();
}
public SVNReposTests(String name)
{
super(name);
+ init();
+ }
+
+ /**
+ * Initialize the testBaseName and the testCounter, if this is the
+ * first test of this class.
+ */
+ private void init()
+ {
+ if (!testName.equals(testBaseName))
+ {
+ testCounter = 0;
+ testBaseName = testName;
+ }
}
/**
@@ -79,12 +100,107 @@ public class SVNReposTests extends SVNTe
public void testVerify()
throws SubversionException, IOException
{
- OneTest thisTest = new OneTest(false);
+ OneTest thisTest = new OneTest(false, true);
admin.verify(thisTest.getRepository(), Revision.getInstance(0),
Revision.HEAD, null);
}
- /* This test only tests the call down to the C++ layer. */
+ private class VerifyCallback implements ReposVerifyCallback
+ {
+ public int mderr = 0;
+ public int reverr = 0;
+ public boolean keepGoing = false;
+
+ public void onVerifyError(long revision, ClientException verifyError)
+ throws ClientException
+ {
+ if (revision == Revision.SVN_INVALID_REVNUM) {
+ ++mderr;
+ }
+ else {
+ ++reverr;
+ }
+ if (keepGoing) {
+ return;
+ }
+ else {
+ throw verifyError;
+ }
+ }
+
+ }
+
+ private boolean tryToBreakRepo(OneTest test) throws IOException
+ {
+ File repo = test.getRepository();
+
+ // Check for a sharded repo first
+ File rev1 = new File(repo, "db/revs/0/1");
+ if (!rev1.exists() || !rev1.setWritable(true))
+ {
+ // Try non-sharded
+ rev1 = new File(repo, "db/revs/1");
+ }
+ if (!rev1.exists() || !rev1.setWritable(true))
+ return false;
+
+ FileWriter fd = new FileWriter(rev1);
+ fd.write("inserting junk to corrupt the rev");
+ fd.close();
+ return true;
+ }
+
+ public void testVerifyBrokenRepo() throws Throwable
+ {
+ OneTest thisTest = new OneTest(false, true);
+
+ if (!tryToBreakRepo(thisTest)) {
+ // We don't support the repos format
+ System.err.print("Cannot break repository for verify test.");
+ return;
+ }
+
+ VerifyCallback cb = new VerifyCallback();
+ cb.keepGoing = false;
+
+ try {
+ admin.verify(thisTest.getRepository(),
+ Revision.getInstance(0),
+ Revision.HEAD,
+ false, false, null, cb);
+ }
+ catch(ClientException ex) {
+ assertEquals(cb.mderr, 1);
+ assertEquals(cb.reverr, 0);
+ return;
+ }
+
+ assert("Verify did not catch repository corruption." == "");
+ }
+
+ public void testVerifyBrokenRepo_KeepGoing() throws Throwable
+ {
+ OneTest thisTest = new OneTest(false, true);
+
+ if (!tryToBreakRepo(thisTest)) {
+ // We don't support the repos format
+ System.err.print("Cannot break repository for verify test.");
+ return;
+ }
+
+ VerifyCallback cb = new VerifyCallback();
+ cb.keepGoing = true;
+
+ admin.verify(thisTest.getRepository(),
+ Revision.getInstance(0),
+ Revision.HEAD,
+ false, false, null, cb);
+
+ assertEquals(cb.mderr, 1);
+ assertEquals(cb.reverr, 1);
+ }
+
+ /* this test only tests the call down to the C++ layer. */
public void testUpgrade()
throws SubversionException, IOException
{