You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by da...@apache.org on 2010/03/30 22:58:01 UTC
svn commit: r929279 [2/20] - in /subversion/branches/svn-patch-improvements:
./ build/ac-macros/ build/generator/ build/generator/templates/
contrib/client-side/emacs/ notes/feedback/ notes/meetings/ notes/wc-ng/
subversion/ subversion/bindings/javahl/...
Modified: subversion/branches/svn-patch-improvements/subversion/bindings/javahl/native/CopySources.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/svn-patch-improvements/subversion/bindings/javahl/native/CopySources.cpp?rev=929279&r1=929278&r2=929279&view=diff
==============================================================================
--- subversion/branches/svn-patch-improvements/subversion/bindings/javahl/native/CopySources.cpp (original)
+++ subversion/branches/svn-patch-improvements/subversion/bindings/javahl/native/CopySources.cpp Tue Mar 30 20:57:53 2010
@@ -33,16 +33,13 @@
#include "Revision.h"
#include "CopySources.h"
-CopySources::CopySources(jobjectArray jcopySources)
+CopySources::CopySources(Array ©Sources)
+ : m_copySources(copySources)
{
- m_copySources = jcopySources;
}
CopySources::~CopySources()
{
- // m_copySources does not need to be destroyed, because it is a
- // parameter to the Java SVNClient.copy() method, and thus not
- // explicitly managed.
}
jobject
@@ -50,17 +47,22 @@ CopySources::makeJCopySource(const char
{
JNIEnv *env = JNIUtil::getEnv();
- jobject jpath = JNIUtil::makeJString(path);
+ // Create a local frame for our references
+ env->PushLocalFrame(LOCAL_FRAME_SIZE);
if (JNIUtil::isJavaExceptionThrown())
return NULL;
+ jobject jpath = JNIUtil::makeJString(path);
+ if (JNIUtil::isJavaExceptionThrown())
+ POP_AND_RETURN_NULL;
+
jobject jrevision = Revision::makeJRevision(rev);
if (JNIUtil::isJavaExceptionThrown())
- return NULL;
+ POP_AND_RETURN_NULL;
jclass clazz = env->FindClass(JAVA_PACKAGE "/CopySource");
if (JNIUtil::isJavaExceptionThrown())
- return NULL;
+ POP_AND_RETURN_NULL;
static jmethodID ctor = 0;
if (ctor == 0)
@@ -70,129 +72,107 @@ CopySources::makeJCopySource(const char
"L" JAVA_PACKAGE "/Revision;"
"L" JAVA_PACKAGE "/Revision;)V");
if (JNIUtil::isExceptionThrown())
- return NULL;
+ POP_AND_RETURN_NULL;
}
jobject jcopySource = env->NewObject(clazz, ctor, jpath, jrevision, NULL);
if (JNIUtil::isJavaExceptionThrown())
- return NULL;
-
- env->DeleteLocalRef(jpath);
- if (JNIUtil::isJavaExceptionThrown())
- return NULL;
+ POP_AND_RETURN_NULL;
- env->DeleteLocalRef(jrevision);
- if (JNIUtil::isJavaExceptionThrown())
- return NULL;
-
- return jcopySource;
+ return env->PopLocalFrame(jcopySource);
}
apr_array_header_t *
CopySources::array(SVN::Pool &pool)
{
apr_pool_t *p = pool.pool();
- if (m_copySources == NULL)
- return apr_array_make(p, 0, sizeof(svn_client_copy_source_t *));
JNIEnv *env = JNIUtil::getEnv();
- jint nbrSources = env->GetArrayLength(m_copySources);
- if (JNIUtil::isJavaExceptionThrown())
- return NULL;
-
jclass clazz = env->FindClass(JAVA_PACKAGE "/CopySource");
if (JNIUtil::isJavaExceptionThrown())
return NULL;
+ std::vector<jobject> sources = m_copySources.vector();
+
apr_array_header_t *copySources =
- apr_array_make(p, nbrSources, sizeof(svn_client_copy_source_t *));
- for (int i = 0; i < nbrSources; ++i)
+ apr_array_make(p, sources.size(), sizeof(svn_client_copy_source_t *));
+ for (std::vector<jobject>::const_iterator it = sources.begin();
+ it < sources.end(); ++it)
{
- jobject copySource = env->GetObjectArrayElement(m_copySources, i);
- if (JNIUtil::isJavaExceptionThrown())
- return NULL;
+ svn_client_copy_source_t *src =
+ (svn_client_copy_source_t *) apr_palloc(p, sizeof(*src));
- if (env->IsInstanceOf(copySource, clazz))
+ // Extract the path or URL from the copy source.
+ static jmethodID getPath = 0;
+ if (getPath == 0)
{
- svn_client_copy_source_t *src =
- (svn_client_copy_source_t *) apr_palloc(p, sizeof(*src));
-
- // Extract the path or URL from the copy source.
- static jmethodID getPath = 0;
- if (getPath == 0)
- {
- getPath = env->GetMethodID(clazz, "getPath",
- "()Ljava/lang/String;");
- if (JNIUtil::isJavaExceptionThrown() || getPath == 0)
- return NULL;
- }
- jstring jpath = (jstring)
- env->CallObjectMethod(copySource, getPath);
- if (JNIUtil::isJavaExceptionThrown())
- return NULL;
-
- JNIStringHolder path(jpath);
- if (JNIUtil::isJavaExceptionThrown())
+ getPath = env->GetMethodID(clazz, "getPath",
+ "()Ljava/lang/String;");
+ if (JNIUtil::isJavaExceptionThrown() || getPath == 0)
return NULL;
+ }
+ jstring jpath = (jstring)
+ env->CallObjectMethod(*it, getPath);
+ if (JNIUtil::isJavaExceptionThrown())
+ return NULL;
- src->path = apr_pstrdup(p, (const char *) path);
- SVN_JNI_ERR(JNIUtil::preprocessPath(src->path, pool.pool()),
- NULL);
- env->DeleteLocalRef(jpath);
- if (JNIUtil::isJavaExceptionThrown())
- return NULL;
+ JNIStringHolder path(jpath);
+ if (JNIUtil::isJavaExceptionThrown())
+ return NULL;
- // Extract source revision from the copy source.
- static jmethodID getRevision = 0;
- if (getRevision == 0)
- {
- getRevision = env->GetMethodID(clazz, "getRevision",
- "()L"JAVA_PACKAGE"/Revision;");
- if (JNIUtil::isJavaExceptionThrown() || getRevision == 0)
- return NULL;
- }
- jobject jrev = env->CallObjectMethod(copySource, getRevision);
- if (JNIUtil::isJavaExceptionThrown())
- return NULL;
+ src->path = apr_pstrdup(p, (const char *) path);
+ SVN_JNI_ERR(JNIUtil::preprocessPath(src->path, pool.pool()),
+ NULL);
+ env->DeleteLocalRef(jpath);
+ if (JNIUtil::isJavaExceptionThrown())
+ return NULL;
- // TODO: Default this to svn_opt_revision_undefined (or HEAD)
- Revision rev(jrev);
- src->revision = (const svn_opt_revision_t *)
- apr_palloc(p, sizeof(*src->revision));
- memcpy((void *) src->revision, rev.revision(),
- sizeof(*src->revision));
- env->DeleteLocalRef(jrev);
- if (JNIUtil::isJavaExceptionThrown())
+ // Extract source revision from the copy source.
+ static jmethodID getRevision = 0;
+ if (getRevision == 0)
+ {
+ getRevision = env->GetMethodID(clazz, "getRevision",
+ "()L"JAVA_PACKAGE"/Revision;");
+ if (JNIUtil::isJavaExceptionThrown() || getRevision == 0)
return NULL;
+ }
+ jobject jrev = env->CallObjectMethod(*it, getRevision);
+ if (JNIUtil::isJavaExceptionThrown())
+ return NULL;
- // Extract pegRevision from the copy source.
- static jmethodID getPegRevision = 0;
- if (getPegRevision == 0)
- {
- getPegRevision = env->GetMethodID(clazz, "getPegRevision",
- "()L"JAVA_PACKAGE"/Revision;");
- if (JNIUtil::isJavaExceptionThrown() || getPegRevision == 0)
- return NULL;
- }
- jobject jPegRev = env->CallObjectMethod(copySource,
- getPegRevision);
- if (JNIUtil::isJavaExceptionThrown())
- return NULL;
+ // TODO: Default this to svn_opt_revision_undefined (or HEAD)
+ Revision rev(jrev);
+ src->revision = (const svn_opt_revision_t *)
+ apr_palloc(p, sizeof(*src->revision));
+ memcpy((void *) src->revision, rev.revision(),
+ sizeof(*src->revision));
+ env->DeleteLocalRef(jrev);
+ if (JNIUtil::isJavaExceptionThrown())
+ return NULL;
- Revision pegRev(jPegRev, true);
- src->peg_revision = (const svn_opt_revision_t *)
- apr_palloc(p, sizeof(*src->peg_revision));
- memcpy((void *) src->peg_revision, pegRev.revision(),
- sizeof(*src->peg_revision));
- env->DeleteLocalRef(jPegRev);
- if (JNIUtil::isJavaExceptionThrown())
+ // Extract pegRevision from the copy source.
+ static jmethodID getPegRevision = 0;
+ if (getPegRevision == 0)
+ {
+ getPegRevision = env->GetMethodID(clazz, "getPegRevision",
+ "()L"JAVA_PACKAGE"/Revision;");
+ if (JNIUtil::isJavaExceptionThrown() || getPegRevision == 0)
return NULL;
-
- APR_ARRAY_PUSH(copySources, svn_client_copy_source_t *) = src;
}
- env->DeleteLocalRef(copySource);
+ jobject jPegRev = env->CallObjectMethod(*it, getPegRevision);
if (JNIUtil::isJavaExceptionThrown())
return NULL;
+
+ Revision pegRev(jPegRev, true);
+ src->peg_revision = (const svn_opt_revision_t *)
+ apr_palloc(p, sizeof(*src->peg_revision));
+ memcpy((void *) src->peg_revision, pegRev.revision(),
+ sizeof(*src->peg_revision));
+ env->DeleteLocalRef(jPegRev);
+ if (JNIUtil::isJavaExceptionThrown())
+ return NULL;
+
+ APR_ARRAY_PUSH(copySources, svn_client_copy_source_t *) = src;
}
env->DeleteLocalRef(clazz);
Modified: subversion/branches/svn-patch-improvements/subversion/bindings/javahl/native/CopySources.h
URL: http://svn.apache.org/viewvc/subversion/branches/svn-patch-improvements/subversion/bindings/javahl/native/CopySources.h?rev=929279&r1=929278&r2=929279&view=diff
==============================================================================
--- subversion/branches/svn-patch-improvements/subversion/bindings/javahl/native/CopySources.h (original)
+++ subversion/branches/svn-patch-improvements/subversion/bindings/javahl/native/CopySources.h Tue Mar 30 20:57:53 2010
@@ -30,7 +30,8 @@
#include <jni.h>
#include <apr_tables.h>
-class SVN::Pool;
+#include "Pool.h"
+#include "Array.h"
/**
* A container for our copy sources, which can convert them into an
@@ -43,7 +44,7 @@ class CopySources
* Create a CopySources object.
* @param jobjectArray An array of CopySource Java objects.
*/
- CopySources(jobjectArray copySources);
+ CopySources(Array ©Sources);
/**
* Destroy a CopySources object
@@ -69,7 +70,7 @@ class CopySources
/**
* A local reference to the Java CopySources peer.
*/
- jobjectArray m_copySources;
+ Array &m_copySources;
};
#endif /* COPY_SOURCES_H */
Modified: subversion/branches/svn-patch-improvements/subversion/bindings/javahl/native/CreateJ.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/svn-patch-improvements/subversion/bindings/javahl/native/CreateJ.cpp?rev=929279&r1=929278&r2=929279&view=diff
==============================================================================
--- subversion/branches/svn-patch-improvements/subversion/bindings/javahl/native/CreateJ.cpp (original)
+++ subversion/branches/svn-patch-improvements/subversion/bindings/javahl/native/CreateJ.cpp Tue Mar 30 20:57:53 2010
@@ -31,6 +31,7 @@
#include "EnumMapper.h"
#include "RevisionRange.h"
#include "CreateJ.h"
+#include "../include/org_apache_subversion_javahl_Revision.h"
jobject
CreateJ::ConflictDescriptor(const svn_wc_conflict_description_t *desc)
@@ -40,335 +41,684 @@ CreateJ::ConflictDescriptor(const svn_wc
if (desc == NULL)
return NULL;
+ // Create a local frame for our references
+ env->PushLocalFrame(LOCAL_FRAME_SIZE);
+ if (JNIUtil::isJavaExceptionThrown())
+ return NULL;
+
// Create an instance of the conflict descriptor.
- static jmethodID ctor = 0;
jclass clazz = env->FindClass(JAVA_PACKAGE "/ConflictDescriptor");
if (JNIUtil::isJavaExceptionThrown())
- return NULL;
+ POP_AND_RETURN_NULL;
+ static jmethodID ctor = 0;
if (ctor == 0)
{
- ctor = env->GetMethodID(clazz, "<init>", "(Ljava/lang/String;II"
- "Ljava/lang/String;ZLjava/lang/String;III"
+ ctor = env->GetMethodID(clazz, "<init>", "(Ljava/lang/String;"
+ "L"JAVA_PACKAGE"/ConflictDescriptor$Kind;"
+ "L"JAVA_PACKAGE"/NodeKind;"
+ "Ljava/lang/String;ZLjava/lang/String;"
+ "L"JAVA_PACKAGE"/ConflictDescriptor$Action;"
+ "L"JAVA_PACKAGE"/ConflictDescriptor$Reason;"
+ "L"JAVA_PACKAGE"/ConflictDescriptor$Operation;"
"Ljava/lang/String;Ljava/lang/String;"
"Ljava/lang/String;Ljava/lang/String;"
"L"JAVA_PACKAGE"/ConflictVersion;"
"L"JAVA_PACKAGE"/ConflictVersion;)V");
if (JNIUtil::isJavaExceptionThrown() || ctor == 0)
- return NULL;
+ POP_AND_RETURN_NULL;
}
jstring jpath = JNIUtil::makeJString(desc->path);
if (JNIUtil::isJavaExceptionThrown())
- return NULL;
+ POP_AND_RETURN_NULL;
jstring jpropertyName = JNIUtil::makeJString(desc->property_name);
if (JNIUtil::isJavaExceptionThrown())
- return NULL;
+ POP_AND_RETURN_NULL;
jstring jmimeType = JNIUtil::makeJString(desc->mime_type);
if (JNIUtil::isJavaExceptionThrown())
- return NULL;
+ POP_AND_RETURN_NULL;
jstring jbasePath = JNIUtil::makeJString(desc->base_file);
if (JNIUtil::isJavaExceptionThrown())
- return NULL;
+ POP_AND_RETURN_NULL;
jstring jreposPath = JNIUtil::makeJString(desc->their_file);
if (JNIUtil::isJavaExceptionThrown())
- return NULL;
+ POP_AND_RETURN_NULL;
jstring juserPath = JNIUtil::makeJString(desc->my_file);
if (JNIUtil::isJavaExceptionThrown())
- return NULL;
+ POP_AND_RETURN_NULL;
jstring jmergedPath = JNIUtil::makeJString(desc->merged_file);
if (JNIUtil::isJavaExceptionThrown())
- return NULL;
+ POP_AND_RETURN_NULL;
jobject jsrcLeft = CreateJ::ConflictVersion(desc->src_left_version);
if (JNIUtil::isJavaExceptionThrown())
- return NULL;
+ POP_AND_RETURN_NULL;
jobject jsrcRight = ConflictVersion(desc->src_right_version);
if (JNIUtil::isJavaExceptionThrown())
- return NULL;
+ POP_AND_RETURN_NULL;
+ jobject jnodeKind = EnumMapper::mapNodeKind(desc->node_kind);
+ if (JNIUtil::isJavaExceptionThrown())
+ POP_AND_RETURN_NULL;
+ jobject jconflictKind = EnumMapper::mapConflictKind(desc->kind);
+ if (JNIUtil::isJavaExceptionThrown())
+ POP_AND_RETURN_NULL;
+ jobject jconflictAction = EnumMapper::mapConflictAction(desc->action);
+ if (JNIUtil::isJavaExceptionThrown())
+ POP_AND_RETURN_NULL;
+ jobject jconflictReason = EnumMapper::mapConflictReason(desc->reason);
+ if (JNIUtil::isJavaExceptionThrown())
+ POP_AND_RETURN_NULL;
+ jobject joperation = EnumMapper::mapOperation(desc->operation);
+ if (JNIUtil::isJavaExceptionThrown())
+ POP_AND_RETURN_NULL;
// Instantiate the conflict descriptor.
- jobject jdesc = env->NewObject(clazz, ctor, jpath,
- EnumMapper::mapConflictKind(desc->kind),
- EnumMapper::mapNodeKind(desc->node_kind),
- jpropertyName,
+ jobject jdesc = env->NewObject(clazz, ctor, jpath, jconflictKind,
+ jnodeKind, jpropertyName,
(jboolean) desc->is_binary, jmimeType,
- EnumMapper::mapConflictAction(desc->action),
- EnumMapper::mapConflictReason(desc->reason),
- EnumMapper::mapOperation(desc->operation),
+ jconflictAction, jconflictReason, joperation,
jbasePath, jreposPath, juserPath,
jmergedPath, jsrcLeft, jsrcRight);
if (JNIUtil::isJavaExceptionThrown())
+ POP_AND_RETURN_NULL;
+
+ return env->PopLocalFrame(jdesc);
+}
+
+jobject
+CreateJ::ConflictVersion(const svn_wc_conflict_version_t *version)
+{
+ JNIEnv *env = JNIUtil::getEnv();
+
+ if (version == NULL)
return NULL;
- env->DeleteLocalRef(clazz);
+ // Create a local frame for our references
+ env->PushLocalFrame(LOCAL_FRAME_SIZE);
if (JNIUtil::isJavaExceptionThrown())
return NULL;
- env->DeleteLocalRef(jpath);
+ // Create an instance of the conflict version.
+ jclass clazz = env->FindClass(JAVA_PACKAGE "/ConflictVersion");
if (JNIUtil::isJavaExceptionThrown())
- return NULL;
- env->DeleteLocalRef(jpropertyName);
+ POP_AND_RETURN_NULL;
+
+ static jmethodID ctor = 0;
+ if (ctor == 0)
+ {
+ ctor = env->GetMethodID(clazz, "<init>", "(Ljava/lang/String;J"
+ "Ljava/lang/String;"
+ "L"JAVA_PACKAGE"/NodeKind;)V");
+ if (JNIUtil::isJavaExceptionThrown() || ctor == 0)
+ POP_AND_RETURN_NULL;
+ }
+
+ jstring jreposURL = JNIUtil::makeJString(version->repos_url);
if (JNIUtil::isJavaExceptionThrown())
- return NULL;
- env->DeleteLocalRef(jmimeType);
+ POP_AND_RETURN_NULL;
+ jstring jpathInRepos = JNIUtil::makeJString(version->path_in_repos);
if (JNIUtil::isJavaExceptionThrown())
- return NULL;
- env->DeleteLocalRef(jbasePath);
+ POP_AND_RETURN_NULL;
+ jobject jnodeKind = EnumMapper::mapNodeKind(version->node_kind);
if (JNIUtil::isJavaExceptionThrown())
- return NULL;
- env->DeleteLocalRef(jreposPath);
+ POP_AND_RETURN_NULL;
+
+ jobject jversion = env->NewObject(clazz, ctor, jreposURL,
+ (jlong)version->peg_rev, jpathInRepos,
+ jnodeKind);
if (JNIUtil::isJavaExceptionThrown())
+ POP_AND_RETURN_NULL;
+
+ return env->PopLocalFrame(jversion);
+}
+
+jobject
+CreateJ::Info(const svn_wc_entry_t *entry)
+{
+ if (entry == NULL)
return NULL;
- env->DeleteLocalRef(juserPath);
+
+ JNIEnv *env = JNIUtil::getEnv();
+
+ // Create a local frame for our references
+ env->PushLocalFrame(LOCAL_FRAME_SIZE);
if (JNIUtil::isJavaExceptionThrown())
return NULL;
- env->DeleteLocalRef(jmergedPath);
+
+ jclass clazz = env->FindClass(JAVA_PACKAGE"/Info");
if (JNIUtil::isJavaExceptionThrown())
- return NULL;
- env->DeleteLocalRef(jsrcRight);
+ POP_AND_RETURN_NULL;
+
+ static jmethodID mid = 0;
+ if (mid == 0)
+ {
+ mid = env->GetMethodID(clazz, "<init>",
+ "(Ljava/lang/String;Ljava/lang/String;"
+ "Ljava/lang/String;Ljava/lang/String;"
+ "L"JAVA_PACKAGE"/Info2$ScheduleKind;"
+ "L"JAVA_PACKAGE"/NodeKind;"
+ "Ljava/lang/String;JJLjava/util/Date;"
+ "Ljava/util/Date;Ljava/util/Date;"
+ "ZZZZJLjava/lang/String;)V");
+ if (JNIUtil::isJavaExceptionThrown())
+ POP_AND_RETURN_NULL;
+ }
+
+ jstring jName = JNIUtil::makeJString(entry->name);
if (JNIUtil::isJavaExceptionThrown())
- return NULL;
- env->DeleteLocalRef(jsrcLeft);
+ POP_AND_RETURN_NULL;
+ jstring jUrl = JNIUtil::makeJString(entry->url);
if (JNIUtil::isJavaExceptionThrown())
- return NULL;
+ POP_AND_RETURN_NULL;
+ jstring jUuid = JNIUtil::makeJString(entry->uuid);
+ if (JNIUtil::isJavaExceptionThrown())
+ POP_AND_RETURN_NULL;
+ jstring jRepository = JNIUtil::makeJString(entry->repos);
+ if (JNIUtil::isJavaExceptionThrown())
+ POP_AND_RETURN_NULL;
+ jobject jSchedule = EnumMapper::mapScheduleKind(entry->schedule);
+ if (JNIUtil::isJavaExceptionThrown())
+ POP_AND_RETURN_NULL;
+ jobject jNodeKind = EnumMapper::mapNodeKind(entry->kind);
+ if (JNIUtil::isJavaExceptionThrown())
+ POP_AND_RETURN_NULL;
+ jstring jAuthor = JNIUtil::makeJString(entry->cmt_author);
+ if (JNIUtil::isJavaExceptionThrown())
+ POP_AND_RETURN_NULL;
+ jlong jRevision = entry->revision;
+ jlong jLastChangedRevision = entry->cmt_rev;
+ jobject jLastChangedDate = JNIUtil::createDate(entry->cmt_date);
+ if (JNIUtil::isJavaExceptionThrown())
+ POP_AND_RETURN_NULL;
+ jobject jLastDateTextUpdate = JNIUtil::createDate(entry->text_time);
+ if (JNIUtil::isJavaExceptionThrown())
+ POP_AND_RETURN_NULL;
+ jobject jLastDatePropsUpdate = JNIUtil::createDate(entry->prop_time);
+ if (JNIUtil::isJavaExceptionThrown())
+ POP_AND_RETURN_NULL;
+ jboolean jCopied = entry->copied ? JNI_TRUE : JNI_FALSE;
+ jboolean jDeleted = entry->deleted ? JNI_TRUE : JNI_FALSE;
+ jboolean jAbsent = entry->absent ? JNI_TRUE : JNI_FALSE;
+ jboolean jIncomplete = entry->incomplete ? JNI_TRUE : JNI_FALSE;
+ jlong jCopyRev = entry->copyfrom_rev;
+ jstring jCopyUrl = JNIUtil::makeJString(entry->copyfrom_url);
+ if (JNIUtil::isJavaExceptionThrown())
+ POP_AND_RETURN_NULL;
- return jdesc;
+ jobject jinfo = env->NewObject(clazz, mid, jName, jUrl, jUuid, jRepository,
+ jSchedule, jNodeKind, jAuthor, jRevision,
+ jLastChangedRevision, jLastChangedDate,
+ jLastDateTextUpdate, jLastDatePropsUpdate,
+ jCopied, jDeleted, jAbsent, jIncomplete,
+ jCopyRev, jCopyUrl);
+ if (JNIUtil::isJavaExceptionThrown())
+ POP_AND_RETURN_NULL;
+
+ return env->PopLocalFrame(jinfo);
}
jobject
-CreateJ::ConflictVersion(const svn_wc_conflict_version_t *version)
+CreateJ::Info2(const char *path, const svn_info_t *info)
{
JNIEnv *env = JNIUtil::getEnv();
- if (version == NULL)
+ // Create a local frame for our references
+ env->PushLocalFrame(LOCAL_FRAME_SIZE);
+ if (JNIUtil::isJavaExceptionThrown())
return NULL;
- // Create an instance of the conflict version.
- static jmethodID ctor = 0;
- jclass clazz = env->FindClass(JAVA_PACKAGE "/ConflictVersion");
+ jclass clazz = env->FindClass(JAVA_PACKAGE "/Info2");
if (JNIUtil::isJavaExceptionThrown())
- return NULL;
+ POP_AND_RETURN_NULL;
- if (ctor == 0)
+ static jmethodID mid = 0;
+ if (mid == 0)
{
- ctor = env->GetMethodID(clazz, "<init>", "(Ljava/lang/String;J"
- "Ljava/lang/String;I)V");
- if (JNIUtil::isJavaExceptionThrown() || ctor == 0)
- return NULL;
+ mid = env->GetMethodID(clazz, "<init>",
+ "(Ljava/lang/String;Ljava/lang/String;J"
+ "L"JAVA_PACKAGE"/NodeKind;"
+ "Ljava/lang/String;Ljava/lang/String;"
+ "JJLjava/lang/String;"
+ "L"JAVA_PACKAGE"/Lock;Z"
+ "L"JAVA_PACKAGE"/Info2$ScheduleKind;"
+ "Ljava/lang/String;JJJ"
+ "Ljava/lang/String;Ljava/lang/String;"
+ "Ljava/lang/String;Ljava/lang/String;"
+ "Ljava/lang/String;Ljava/lang/String;JJ"
+ "L"JAVA_PACKAGE"/Depth;"
+ "L"JAVA_PACKAGE"/ConflictDescriptor;)V");
+ if (mid == 0 || JNIUtil::isJavaExceptionThrown())
+ POP_AND_RETURN_NULL;
}
- jstring jreposURL = JNIUtil::makeJString(version->repos_url);
+ jstring jpath = JNIUtil::makeJString(path);
if (JNIUtil::isJavaExceptionThrown())
- return NULL;
- jstring jpathInRepos = JNIUtil::makeJString(version->path_in_repos);
+ POP_AND_RETURN_NULL;
+
+ jstring jurl = JNIUtil::makeJString(info->URL);
if (JNIUtil::isJavaExceptionThrown())
- return NULL;
+ POP_AND_RETURN_NULL;
- jobject jversion = env->NewObject(clazz, ctor, jreposURL,
- (jlong)version->peg_rev, jpathInRepos,
- EnumMapper::mapNodeKind(version->node_kind));
+ jstring jreposRootUrl = JNIUtil::makeJString(info->repos_root_URL);
if (JNIUtil::isJavaExceptionThrown())
- return NULL;
+ POP_AND_RETURN_NULL;
- env->DeleteLocalRef(clazz);
+ jstring jreportUUID = JNIUtil::makeJString(info->repos_UUID);
if (JNIUtil::isJavaExceptionThrown())
- return NULL;
+ POP_AND_RETURN_NULL;
- env->DeleteLocalRef(jreposURL);
+ jstring jlastChangedAuthor =
+ JNIUtil::makeJString(info->last_changed_author);
if (JNIUtil::isJavaExceptionThrown())
- return NULL;
- env->DeleteLocalRef(jpathInRepos);
+ POP_AND_RETURN_NULL;
+
+ jobject jlock = CreateJ::Lock(info->lock);
if (JNIUtil::isJavaExceptionThrown())
- return NULL;
+ POP_AND_RETURN_NULL;
+
+ jstring jcopyFromUrl = JNIUtil::makeJString(info->copyfrom_url);
+ if (JNIUtil::isJavaExceptionThrown())
+ POP_AND_RETURN_NULL;
+
+ jstring jchecksum = JNIUtil::makeJString(info->checksum);
+ if (JNIUtil::isJavaExceptionThrown())
+ POP_AND_RETURN_NULL;
+
+ jstring jconflictOld = JNIUtil::makeJString(info->conflict_old);
+ if (JNIUtil::isJavaExceptionThrown())
+ POP_AND_RETURN_NULL;
+
+ jstring jconflictNew = JNIUtil::makeJString(info->conflict_new);
+ if (JNIUtil::isJavaExceptionThrown())
+ POP_AND_RETURN_NULL;
+
+ jstring jconflictWrk = JNIUtil::makeJString(info->conflict_wrk);
+ if (JNIUtil::isJavaExceptionThrown())
+ POP_AND_RETURN_NULL;
+
+ jstring jprejfile = JNIUtil::makeJString(info->prejfile);
+ if (JNIUtil::isJavaExceptionThrown())
+ POP_AND_RETURN_NULL;
+
+ jstring jchangelist = JNIUtil::makeJString(info->changelist);
+ if (JNIUtil::isJavaExceptionThrown())
+ POP_AND_RETURN_NULL;
- return jversion;
+ jobject jdesc = CreateJ::ConflictDescriptor(info->tree_conflict);
+ if (JNIUtil::isJavaExceptionThrown())
+ POP_AND_RETURN_NULL;
+
+ jobject jnodeKind = EnumMapper::mapNodeKind(info->kind);
+ if (JNIUtil::isJavaExceptionThrown())
+ POP_AND_RETURN_NULL;
+
+ jobject jscheduleKind = EnumMapper::mapScheduleKind(info->schedule);
+ if (JNIUtil::isJavaExceptionThrown())
+ POP_AND_RETURN_NULL;
+
+ jlong jworkingSize = info->working_size == SVN_INFO_SIZE_UNKNOWN
+ ? -1 : (jlong) info->working_size;
+ jlong jreposSize = info->size == SVN_INFO_SIZE_UNKNOWN
+ ? -1 : (jlong) info->size;
+
+ jobject jinfo2 = env->NewObject(clazz, mid, jpath, jurl, (jlong) info->rev,
+ jnodeKind, jreposRootUrl, jreportUUID,
+ (jlong) info->last_changed_rev,
+ (jlong) info->last_changed_date,
+ jlastChangedAuthor, jlock,
+ info->has_wc_info ? JNI_TRUE : JNI_FALSE,
+ jscheduleKind, jcopyFromUrl,
+ (jlong) info->copyfrom_rev,
+ (jlong) info->text_time,
+ (jlong) info->prop_time, jchecksum,
+ jconflictOld, jconflictNew, jconflictWrk,
+ jprejfile, jchangelist,
+ jworkingSize, jreposSize,
+ EnumMapper::mapDepth(info->depth), jdesc);
+
+ return env->PopLocalFrame(jinfo2);
}
jobject
-CreateJ::Info(const svn_wc_entry_t *entry)
+CreateJ::Lock(const svn_lock_t *lock)
{
- if (entry == NULL)
- return NULL;
+ if (lock == NULL)
+ return NULL;
- JNIEnv *env = JNIUtil::getEnv();
+ JNIEnv *env = JNIUtil::getEnv();
- jclass clazz = env->FindClass(JAVA_PACKAGE"/Info");
- if (JNIUtil::isJavaExceptionThrown())
- return NULL;
+ // Create a local frame for our references
+ env->PushLocalFrame(LOCAL_FRAME_SIZE);
+ if (JNIUtil::isJavaExceptionThrown())
+ return NULL;
- static jmethodID mid = 0;
- if (mid == 0)
+ jclass clazz = env->FindClass(JAVA_PACKAGE"/Lock");
+ if (JNIUtil::isJavaExceptionThrown())
+ POP_AND_RETURN_NULL;
+
+ static jmethodID mid = 0;
+ if (mid == 0)
{
- mid = env->GetMethodID(clazz, "<init>",
- "(Ljava/lang/String;Ljava/lang/String;"
- "Ljava/lang/String;Ljava/lang/String;"
- "IILjava/lang/String;JJLjava/util/Date;"
- "Ljava/util/Date;Ljava/util/Date;"
- "ZZZZJLjava/lang/String;)V");
- if (JNIUtil::isJavaExceptionThrown())
- return NULL;
+ mid = env->GetMethodID(clazz, "<init>",
+ "(Ljava/lang/String;Ljava/lang/String;"
+ "Ljava/lang/String;"
+ "Ljava/lang/String;JJ)V");
+ if (JNIUtil::isJavaExceptionThrown())
+ POP_AND_RETURN_NULL;
}
- jstring jName = JNIUtil::makeJString(entry->name);
- if (JNIUtil::isJavaExceptionThrown())
- return NULL;
- jstring jUrl = JNIUtil::makeJString(entry->url);
- if (JNIUtil::isJavaExceptionThrown())
- return NULL;
- jstring jUuid = JNIUtil::makeJString(entry->uuid);
- if (JNIUtil::isJavaExceptionThrown())
- return NULL;
- jstring jRepository = JNIUtil::makeJString(entry->repos);
- if (JNIUtil::isJavaExceptionThrown())
- return NULL;
- jint jSchedule = EnumMapper::mapScheduleKind(entry->schedule);
- jint jNodeKind = EnumMapper::mapNodeKind(entry->kind);
- jstring jAuthor = JNIUtil::makeJString(entry->cmt_author);
- if (JNIUtil::isJavaExceptionThrown())
- return NULL;
- jlong jRevision = entry->revision;
- jlong jLastChangedRevision = entry->cmt_rev;
- jobject jLastChangedDate = JNIUtil::createDate(entry->cmt_date);
- if (JNIUtil::isJavaExceptionThrown())
- return NULL;
- jobject jLastDateTextUpdate = JNIUtil::createDate(entry->text_time);
- if (JNIUtil::isJavaExceptionThrown())
- return NULL;
- jobject jLastDatePropsUpdate = JNIUtil::createDate(entry->prop_time);
- if (JNIUtil::isJavaExceptionThrown())
- return NULL;
- jboolean jCopied = entry->copied ? JNI_TRUE : JNI_FALSE;
- jboolean jDeleted = entry->deleted ? JNI_TRUE : JNI_FALSE;
- jboolean jAbsent = entry->absent ? JNI_TRUE : JNI_FALSE;
- jboolean jIncomplete = entry->incomplete ? JNI_TRUE : JNI_FALSE;
- jlong jCopyRev = entry->copyfrom_rev;
- jstring jCopyUrl = JNIUtil::makeJString(entry->copyfrom_url);
- if (JNIUtil::isJavaExceptionThrown())
- return NULL;
+ jstring jOwner = JNIUtil::makeJString(lock->owner);
+ if (JNIUtil::isJavaExceptionThrown())
+ POP_AND_RETURN_NULL;
+ jstring jPath = JNIUtil::makeJString(lock->path);
+ if (JNIUtil::isJavaExceptionThrown())
+ POP_AND_RETURN_NULL;
+ jstring jToken = JNIUtil::makeJString(lock->token);
+ if (JNIUtil::isJavaExceptionThrown())
+ POP_AND_RETURN_NULL;
+ jstring jComment = JNIUtil::makeJString(lock->comment);
+ if (JNIUtil::isJavaExceptionThrown())
+ POP_AND_RETURN_NULL;
- jobject jinfo = env->NewObject(clazz, mid, jName, jUrl, jUuid, jRepository,
- jSchedule, jNodeKind, jAuthor, jRevision,
- jLastChangedRevision, jLastChangedDate,
- jLastDateTextUpdate, jLastDatePropsUpdate,
- jCopied, jDeleted, jAbsent, jIncomplete,
- jCopyRev, jCopyUrl);
- if (JNIUtil::isJavaExceptionThrown())
- return NULL;
+ jlong jCreationDate = lock->creation_date;
+ jlong jExpirationDate = lock->expiration_date;
+ jobject jlock = env->NewObject(clazz, mid, jOwner, jPath, jToken, jComment,
+ jCreationDate, jExpirationDate);
+ if (JNIUtil::isJavaExceptionThrown())
+ POP_AND_RETURN_NULL;
- env->DeleteLocalRef(clazz);
- if (JNIUtil::isJavaExceptionThrown())
- return NULL;
+ return env->PopLocalFrame(jlock);
+}
- env->DeleteLocalRef(jName);
- if (JNIUtil::isJavaExceptionThrown())
- return NULL;
- env->DeleteLocalRef(jUrl);
- if (JNIUtil::isJavaExceptionThrown())
- return NULL;
- env->DeleteLocalRef(jUuid);
- if (JNIUtil::isJavaExceptionThrown())
- return NULL;
- env->DeleteLocalRef(jRepository);
- if (JNIUtil::isJavaExceptionThrown())
- return NULL;
- env->DeleteLocalRef(jAuthor);
- if (JNIUtil::isJavaExceptionThrown())
- return NULL;
- env->DeleteLocalRef(jLastChangedDate);
- if (JNIUtil::isJavaExceptionThrown())
- return NULL;
- env->DeleteLocalRef(jLastDateTextUpdate);
- if (JNIUtil::isJavaExceptionThrown())
- return NULL;
- env->DeleteLocalRef(jLastDatePropsUpdate);
- if (JNIUtil::isJavaExceptionThrown())
- return NULL;
- env->DeleteLocalRef(jCopyUrl);
- if (JNIUtil::isJavaExceptionThrown())
- return NULL;
+jobject
+CreateJ::Status(const char *local_abspath, const svn_wc_status2_t *status)
+{
+ JNIEnv *env = JNIUtil::getEnv();
- return jinfo;
-}
+ // Create a local frame for our references
+ env->PushLocalFrame(LOCAL_FRAME_SIZE);
+ if (JNIUtil::isJavaExceptionThrown())
+ return NULL;
+
+ jclass clazz = env->FindClass(JAVA_PACKAGE"/Status");
+ if (JNIUtil::isJavaExceptionThrown())
+ POP_AND_RETURN_NULL;
+ static jmethodID mid = 0;
+ if (mid == 0)
+ {
+ mid = env->GetMethodID(clazz, "<init>",
+ "(Ljava/lang/String;Ljava/lang/String;"
+ "L"JAVA_PACKAGE"/NodeKind;"
+ "JJJLjava/lang/String;"
+ "L"JAVA_PACKAGE"/Status$Kind;"
+ "L"JAVA_PACKAGE"/Status$Kind;"
+ "L"JAVA_PACKAGE"/Status$Kind;"
+ "L"JAVA_PACKAGE"/Status$Kind;"
+ "ZZZL"JAVA_PACKAGE"/ConflictDescriptor;"
+ "Ljava/lang/String;Ljava/lang/String;"
+ "Ljava/lang/String;Ljava/lang/String;"
+ "JZZLjava/lang/String;Ljava/lang/String;"
+ "Ljava/lang/String;"
+ "JL"JAVA_PACKAGE"/Lock;"
+ "JJL"JAVA_PACKAGE"/NodeKind;"
+ "Ljava/lang/String;Ljava/lang/String;)V");
+ if (JNIUtil::isJavaExceptionThrown())
+ POP_AND_RETURN_NULL;
+ }
+ jstring jPath = JNIUtil::makeJString(local_abspath);
+ if (JNIUtil::isJavaExceptionThrown())
+ POP_AND_RETURN_NULL;
+
+ jstring jUrl = NULL;
+ jobject jNodeKind = NULL;
+ jlong jRevision = org_apache_subversion_javahl_Revision_SVN_INVALID_REVNUM;
+ jlong jLastChangedRevision =
+ org_apache_subversion_javahl_Revision_SVN_INVALID_REVNUM;
+ jlong jLastChangedDate = 0;
+ jstring jLastCommitAuthor = NULL;
+ jobject jTextType = NULL;
+ jobject jPropType = NULL;
+ jobject jRepositoryTextType = NULL;
+ jobject jRepositoryPropType = NULL;
+ jboolean jIsLocked = JNI_FALSE;
+ jboolean jIsCopied = JNI_FALSE;
+ jboolean jIsSwitched = JNI_FALSE;
+ jboolean jIsFileExternal = JNI_FALSE;
+ jboolean jIsTreeConflicted = JNI_FALSE;
+ jobject jConflictDescription = NULL;
+ jstring jConflictOld = NULL;
+ jstring jConflictNew = NULL;
+ jstring jConflictWorking = NULL;
+ jstring jURLCopiedFrom = NULL;
+ jlong jRevisionCopiedFrom =
+ org_apache_subversion_javahl_Revision_SVN_INVALID_REVNUM;
+ jstring jLockToken = NULL;
+ jstring jLockComment = NULL;
+ jstring jLockOwner = NULL;
+ jlong jLockCreationDate = 0;
+ jobject jLock = NULL;
+ jlong jOODLastCmtRevision =
+ org_apache_subversion_javahl_Revision_SVN_INVALID_REVNUM;
+ jlong jOODLastCmtDate = 0;
+ jobject jOODKind = NULL;
+ jstring jOODLastCmtAuthor = NULL;
+ jstring jChangelist = NULL;
+ if (status != NULL)
+ {
+ jTextType = EnumMapper::mapStatusKind(status->text_status);
+ jPropType = EnumMapper::mapStatusKind(status->prop_status);
+ jRepositoryTextType = EnumMapper::mapStatusKind(
+ status->repos_text_status);
+ jRepositoryPropType = EnumMapper::mapStatusKind(
+ status->repos_prop_status);
+ jIsCopied = (status->copied == 1) ? JNI_TRUE: JNI_FALSE;
+ jIsLocked = (status->locked == 1) ? JNI_TRUE: JNI_FALSE;
+ jIsSwitched = (status->switched == 1) ? JNI_TRUE: JNI_FALSE;
+ jIsFileExternal = (status->file_external == 1) ? JNI_TRUE: JNI_FALSE;
+ jConflictDescription = CreateJ::ConflictDescriptor(status->tree_conflict);
+ if (JNIUtil::isJavaExceptionThrown())
+ POP_AND_RETURN_NULL;
+
+ jIsTreeConflicted = (status->tree_conflict != NULL)
+ ? JNI_TRUE: JNI_FALSE;
+ jLock = CreateJ::Lock(status->repos_lock);
+ if (JNIUtil::isJavaExceptionThrown())
+ POP_AND_RETURN_NULL;
+
+ jUrl = JNIUtil::makeJString(status->url);
+ if (JNIUtil::isJavaExceptionThrown())
+ POP_AND_RETURN_NULL;
+
+ jOODLastCmtRevision = status->ood_last_cmt_rev;
+ jOODLastCmtDate = status->ood_last_cmt_date;
+ jOODKind = EnumMapper::mapNodeKind(status->ood_kind);
+ jOODLastCmtAuthor = JNIUtil::makeJString(status->ood_last_cmt_author);
+ if (JNIUtil::isJavaExceptionThrown())
+ POP_AND_RETURN_NULL;
+
+ const svn_wc_entry_t *entry = status->entry;
+ if (entry != NULL)
+ {
+ jNodeKind = EnumMapper::mapNodeKind(entry->kind);
+ jRevision = entry->revision;
+ jLastChangedRevision = entry->cmt_rev;
+ jLastChangedDate = entry->cmt_date;
+ jLastCommitAuthor = JNIUtil::makeJString(entry->cmt_author);
+ if (JNIUtil::isJavaExceptionThrown())
+ POP_AND_RETURN_NULL;
+
+ jConflictNew = JNIUtil::makeJString(entry->conflict_new);
+ if (JNIUtil::isJavaExceptionThrown())
+ POP_AND_RETURN_NULL;
+
+ jConflictOld = JNIUtil::makeJString(entry->conflict_old);
+ if (JNIUtil::isJavaExceptionThrown())
+ POP_AND_RETURN_NULL;
+
+ jConflictWorking= JNIUtil::makeJString(entry->conflict_wrk);
+ if (JNIUtil::isJavaExceptionThrown())
+ POP_AND_RETURN_NULL;
+
+ jURLCopiedFrom = JNIUtil::makeJString(entry->copyfrom_url);
+ if (JNIUtil::isJavaExceptionThrown())
+ POP_AND_RETURN_NULL;
+
+ jRevisionCopiedFrom = entry->copyfrom_rev;
+ jLockToken = JNIUtil::makeJString(entry->lock_token);
+ if (JNIUtil::isJavaExceptionThrown())
+ POP_AND_RETURN_NULL;
+
+ jLockComment = JNIUtil::makeJString(entry->lock_comment);
+ if (JNIUtil::isJavaExceptionThrown())
+ POP_AND_RETURN_NULL;
+
+ jLockOwner = JNIUtil::makeJString(entry->lock_owner);
+ if (JNIUtil::isJavaExceptionThrown())
+ POP_AND_RETURN_NULL;
+
+ jLockCreationDate = entry->lock_creation_date;
+
+ jChangelist = JNIUtil::makeJString(entry->changelist);
+ if (JNIUtil::isJavaExceptionThrown())
+ POP_AND_RETURN_NULL;
+ }
+ }
+
+ jobject ret = env->NewObject(clazz, mid, jPath, jUrl, jNodeKind, jRevision,
+ jLastChangedRevision, jLastChangedDate,
+ jLastCommitAuthor, jTextType, jPropType,
+ jRepositoryTextType, jRepositoryPropType,
+ jIsLocked, jIsCopied, jIsTreeConflicted,
+ jConflictDescription, jConflictOld, jConflictNew,
+ jConflictWorking, jURLCopiedFrom,
+ jRevisionCopiedFrom, jIsSwitched, jIsFileExternal,
+ jLockToken, jLockOwner,
+ jLockComment, jLockCreationDate, jLock,
+ jOODLastCmtRevision, jOODLastCmtDate,
+ jOODKind, jOODLastCmtAuthor, jChangelist);
+
+ return env->PopLocalFrame(ret);
+}
jobject
-CreateJ::Lock(const svn_lock_t *lock)
+CreateJ::NotifyInformation(const svn_wc_notify_t *wcNotify)
{
- if (lock == NULL)
- return NULL;
- JNIEnv *env = JNIUtil::getEnv();
+ JNIEnv *env = JNIUtil::getEnv();
- jclass clazz = env->FindClass(JAVA_PACKAGE"/Lock");
- if (JNIUtil::isJavaExceptionThrown())
- return NULL;
+ // Create a local frame for our references
+ env->PushLocalFrame(LOCAL_FRAME_SIZE);
+ if (JNIUtil::isJavaExceptionThrown())
+ return NULL;
- static jmethodID mid = 0;
- if (mid == 0)
+ static jmethodID midCT = 0;
+ jclass clazz = env->FindClass(JAVA_PACKAGE"/NotifyInformation");
+ if (JNIUtil::isJavaExceptionThrown())
+ POP_AND_RETURN_NULL;
+
+ if (midCT == 0)
{
- mid = env->GetMethodID(clazz, "<init>",
- "(Ljava/lang/String;Ljava/lang/String;"
+ midCT = env->GetMethodID(clazz, "<init>",
+ "(Ljava/lang/String;"
+ "L"JAVA_PACKAGE"/NotifyInformation$Action;"
+ "L"JAVA_PACKAGE"/NodeKind;Ljava/lang/String;"
+ "L"JAVA_PACKAGE"/Lock;"
"Ljava/lang/String;"
- "Ljava/lang/String;JJ)V");
- if (JNIUtil::isJavaExceptionThrown())
- return NULL;
+ "L"JAVA_PACKAGE"/NotifyInformation$Status;"
+ "L"JAVA_PACKAGE"/NotifyInformation$Status;"
+ "L"JAVA_PACKAGE"/NotifyInformation$LockStatus;"
+ "JLjava/lang/String;"
+ "L"JAVA_PACKAGE"/RevisionRange;"
+ "Ljava/lang/String;)V");
+ if (JNIUtil::isJavaExceptionThrown() || midCT == 0)
+ POP_AND_RETURN_NULL;
}
- jstring jOwner = JNIUtil::makeJString(lock->owner);
- if (JNIUtil::isJavaExceptionThrown())
- return NULL;
- jstring jPath = JNIUtil::makeJString(lock->path);
- if (JNIUtil::isJavaExceptionThrown())
- return NULL;
- jstring jToken = JNIUtil::makeJString(lock->token);
- if (JNIUtil::isJavaExceptionThrown())
- return NULL;
- jstring jComment = JNIUtil::makeJString(lock->comment);
- if (JNIUtil::isJavaExceptionThrown())
- return NULL;
+ // convert the parameter to their Java relatives
+ jstring jPath = JNIUtil::makeJString(wcNotify->path);
+ if (JNIUtil::isJavaExceptionThrown())
+ POP_AND_RETURN_NULL;
- jlong jCreationDate = lock->creation_date;
- jlong jExpirationDate = lock->expiration_date;
- jobject jlock = env->NewObject(clazz, mid, jOwner, jPath, jToken, jComment,
- jCreationDate, jExpirationDate);
- if (JNIUtil::isJavaExceptionThrown())
- return NULL;
+ jobject jAction = EnumMapper::mapNotifyAction(wcNotify->action);
+ if (JNIUtil::isJavaExceptionThrown())
+ POP_AND_RETURN_NULL;
- env->DeleteLocalRef(clazz);
- if (JNIUtil::isJavaExceptionThrown())
- return NULL;
+ jobject jKind = EnumMapper::mapNodeKind(wcNotify->kind);
+ if (JNIUtil::isJavaExceptionThrown())
+ POP_AND_RETURN_NULL;
- env->DeleteLocalRef(jOwner);
- if (JNIUtil::isJavaExceptionThrown())
- return NULL;
- env->DeleteLocalRef(jPath);
- if (JNIUtil::isJavaExceptionThrown())
- return NULL;
- env->DeleteLocalRef(jToken);
- if (JNIUtil::isJavaExceptionThrown())
- return NULL;
- env->DeleteLocalRef(jComment);
- if (JNIUtil::isJavaExceptionThrown())
- return NULL;
+ jstring jMimeType = JNIUtil::makeJString(wcNotify->mime_type);
+ if (JNIUtil::isJavaExceptionThrown())
+ POP_AND_RETURN_NULL;
- return jlock;
-}
+ jobject jLock = CreateJ::Lock(wcNotify->lock);
+ if (JNIUtil::isJavaExceptionThrown())
+ POP_AND_RETURN_NULL;
+
+ jstring jErr = JNIUtil::makeSVNErrorMessage(wcNotify->err);
+ if (JNIUtil::isJavaExceptionThrown())
+ POP_AND_RETURN_NULL;
+
+ jobject jContentState = EnumMapper::mapNotifyState(wcNotify->content_state);
+ if (JNIUtil::isJavaExceptionThrown())
+ POP_AND_RETURN_NULL;
+ jobject jPropState = EnumMapper::mapNotifyState(wcNotify->prop_state);
+ if (JNIUtil::isJavaExceptionThrown())
+ POP_AND_RETURN_NULL;
+
+ jobject jLockState = EnumMapper::mapNotifyLockState(wcNotify->lock_state);
+ if (JNIUtil::isJavaExceptionThrown())
+ POP_AND_RETURN_NULL;
+
+ jstring jChangelistName = JNIUtil::makeJString(wcNotify->changelist_name);
+ if (JNIUtil::isJavaExceptionThrown())
+ POP_AND_RETURN_NULL;
+
+ jobject jMergeRange = NULL;
+ if (wcNotify->merge_range)
+ {
+ jMergeRange = RevisionRange::makeJRevisionRange(wcNotify->merge_range);
+ if (jMergeRange == NULL)
+ POP_AND_RETURN_NULL;
+ }
+
+ jstring jpathPrefix = JNIUtil::makeJString(wcNotify->path_prefix);
+ if (JNIUtil::isJavaExceptionThrown())
+ POP_AND_RETURN_NULL;
+
+ // call the Java method
+ jobject jInfo = env->NewObject(clazz, midCT, jPath, jAction,
+ jKind, jMimeType, jLock, jErr,
+ jContentState, jPropState, jLockState,
+ (jlong) wcNotify->revision, jChangelistName,
+ jMergeRange, jpathPrefix);
+ if (JNIUtil::isJavaExceptionThrown())
+ POP_AND_RETURN_NULL;
+
+ return env->PopLocalFrame(jInfo);
+}
jobject
CreateJ::RevisionRangeList(apr_array_header_t *ranges)
{
JNIEnv *env = JNIUtil::getEnv();
- jclass clazz = env->FindClass("java/util/ArrayList");
+ // Create a local frame for our references
+ env->PushLocalFrame(LOCAL_FRAME_SIZE);
if (JNIUtil::isJavaExceptionThrown())
return NULL;
+ jclass clazz = env->FindClass("java/util/ArrayList");
+ if (JNIUtil::isJavaExceptionThrown())
+ POP_AND_RETURN_NULL;
+
static jmethodID init_mid = 0;
if (init_mid == 0)
{
init_mid = env->GetMethodID(clazz, "<init>", "()V");
if (JNIUtil::isJavaExceptionThrown())
- return NULL;
+ POP_AND_RETURN_NULL;
}
static jmethodID add_mid = 0;
@@ -376,7 +726,7 @@ CreateJ::RevisionRangeList(apr_array_hea
{
add_mid = env->GetMethodID(clazz, "add", "(Ljava/lang/Object;)Z");
if (JNIUtil::isJavaExceptionThrown())
- return NULL;
+ POP_AND_RETURN_NULL;
}
jobject jranges = env->NewObject(clazz, init_mid);
@@ -388,23 +738,19 @@ CreateJ::RevisionRangeList(apr_array_hea
APR_ARRAY_IDX(ranges, i, svn_merge_range_t *);
jobject jrange = RevisionRange::makeJRevisionRange(range);
- if (jrange == NULL)
- return NULL;
+ if (JNIUtil::isJavaExceptionThrown())
+ POP_AND_RETURN_NULL;
env->CallObjectMethod(jranges, add_mid, jrange);
if (JNIUtil::isJavaExceptionThrown())
- return NULL;
+ POP_AND_RETURN_NULL;
env->DeleteLocalRef(jrange);
if (JNIUtil::isJavaExceptionThrown())
- return NULL;
+ POP_AND_RETURN_NULL;
}
- env->DeleteLocalRef(clazz);
- if (JNIUtil::isJavaExceptionThrown())
- return NULL;
-
- return jranges;
+ return env->PopLocalFrame(jranges);
}
jobject
@@ -419,7 +765,7 @@ CreateJ::StringSet(apr_array_header_t *s
jstring jstr = JNIUtil::makeJString(str);
if (JNIUtil::isJavaExceptionThrown())
return NULL;
-
+
jstrs.push_back(jstr);
}
@@ -429,16 +775,22 @@ CreateJ::StringSet(apr_array_header_t *s
jobject CreateJ::PropertyMap(apr_hash_t *prop_hash, apr_pool_t *pool)
{
JNIEnv *env = JNIUtil::getEnv();
- jclass clazz = env->FindClass("java/util/HashMap");
+
+ // Create a local frame for our references
+ env->PushLocalFrame(LOCAL_FRAME_SIZE);
if (JNIUtil::isJavaExceptionThrown())
return NULL;
+ jclass clazz = env->FindClass("java/util/HashMap");
+ if (JNIUtil::isJavaExceptionThrown())
+ POP_AND_RETURN_NULL;
+
static jmethodID init_mid = 0;
if (init_mid == 0)
{
init_mid = env->GetMethodID(clazz, "<init>", "()V");
if (JNIUtil::isJavaExceptionThrown())
- return NULL;
+ POP_AND_RETURN_NULL;
}
static jmethodID put_mid = 0;
@@ -448,12 +800,12 @@ jobject CreateJ::PropertyMap(apr_hash_t
"(Ljava/lang/Object;Ljava/lang/Object;)"
"Ljava/lang/Object;");
if (JNIUtil::isJavaExceptionThrown())
- return NULL;
+ POP_AND_RETURN_NULL;
}
jobject map = env->NewObject(clazz, init_mid);
if (JNIUtil::isJavaExceptionThrown())
- return NULL;
+ POP_AND_RETURN_NULL;
apr_hash_index_t *hi;
int i = 0;
@@ -466,46 +818,48 @@ jobject CreateJ::PropertyMap(apr_hash_t
jstring jpropName = JNIUtil::makeJString(key);
if (JNIUtil::isJavaExceptionThrown())
- return NULL;
+ POP_AND_RETURN_NULL;
jbyteArray jpropVal = JNIUtil::makeJByteArray(
(const signed char *)val->data, val->len);
if (JNIUtil::isJavaExceptionThrown())
- return NULL;
+ POP_AND_RETURN_NULL;
env->CallObjectMethod(map, put_mid, jpropName, jpropVal);
if (JNIUtil::isJavaExceptionThrown())
- return NULL;
+ POP_AND_RETURN_NULL;
env->DeleteLocalRef(jpropName);
if (JNIUtil::isJavaExceptionThrown())
- return NULL;
+ POP_AND_RETURN_NULL;
env->DeleteLocalRef(jpropVal);
if (JNIUtil::isJavaExceptionThrown())
- return NULL;
+ POP_AND_RETURN_NULL;
}
- env->DeleteLocalRef(clazz);
- if (JNIUtil::isJavaExceptionThrown())
- return NULL;
-
- return map;
+ return env->PopLocalFrame(map);
}
jobject CreateJ::Set(std::vector<jobject> &objects)
{
JNIEnv *env = JNIUtil::getEnv();
- jclass clazz = env->FindClass("java/util/HashSet");
+
+ // Create a local frame for our references
+ env->PushLocalFrame(LOCAL_FRAME_SIZE);
if (JNIUtil::isJavaExceptionThrown())
return NULL;
+ jclass clazz = env->FindClass("java/util/HashSet");
+ if (JNIUtil::isJavaExceptionThrown())
+ POP_AND_RETURN_NULL;
+
static jmethodID init_mid = 0;
if (init_mid == 0)
{
init_mid = env->GetMethodID(clazz, "<init>", "()V");
if (JNIUtil::isJavaExceptionThrown())
- return NULL;
+ POP_AND_RETURN_NULL;
}
static jmethodID add_mid = 0;
@@ -513,12 +867,12 @@ jobject CreateJ::Set(std::vector<jobject
{
add_mid = env->GetMethodID(clazz, "add", "(Ljava/lang/Object;)Z");
if (JNIUtil::isJavaExceptionThrown())
- return NULL;
+ POP_AND_RETURN_NULL;
}
jobject set = env->NewObject(clazz, init_mid);
if (JNIUtil::isJavaExceptionThrown())
- return NULL;
+ POP_AND_RETURN_NULL;
std::vector<jobject>::const_iterator it;
for (it = objects.begin(); it < objects.end(); ++it)
@@ -527,16 +881,12 @@ jobject CreateJ::Set(std::vector<jobject
env->CallObjectMethod(set, add_mid, jthing);
if (JNIUtil::isJavaExceptionThrown())
- return NULL;
+ POP_AND_RETURN_NULL;
env->DeleteLocalRef(jthing);
if (JNIUtil::isJavaExceptionThrown())
- return NULL;
+ POP_AND_RETURN_NULL;
}
- env->DeleteLocalRef(clazz);
- if (JNIUtil::isJavaExceptionThrown())
- return NULL;
-
- return set;
+ return env->PopLocalFrame(set);
}
Modified: subversion/branches/svn-patch-improvements/subversion/bindings/javahl/native/CreateJ.h
URL: http://svn.apache.org/viewvc/subversion/branches/svn-patch-improvements/subversion/bindings/javahl/native/CreateJ.h?rev=929279&r1=929278&r2=929279&view=diff
==============================================================================
--- subversion/branches/svn-patch-improvements/subversion/bindings/javahl/native/CreateJ.h (original)
+++ subversion/branches/svn-patch-improvements/subversion/bindings/javahl/native/CreateJ.h Tue Mar 30 20:57:53 2010
@@ -29,6 +29,7 @@
#include <jni.h>
#include "svn_wc.h"
+#include "svn_client.h"
#include <vector>
@@ -47,9 +48,18 @@ class CreateJ
Info(const svn_wc_entry_t *entry);
static jobject
+ Info2(const char *path, const svn_info_t *info);
+
+ static jobject
Lock(const svn_lock_t *lock);
static jobject
+ Status(const char *local_abspath, const svn_wc_status2_t *status);
+
+ static jobject
+ NotifyInformation(const svn_wc_notify_t *notify);
+
+ static jobject
RevisionRangeList(apr_array_header_t *ranges);
static jobject
Modified: subversion/branches/svn-patch-improvements/subversion/bindings/javahl/native/DiffSummaryReceiver.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/svn-patch-improvements/subversion/bindings/javahl/native/DiffSummaryReceiver.cpp?rev=929279&r1=929278&r2=929279&view=diff
==============================================================================
--- subversion/branches/svn-patch-improvements/subversion/bindings/javahl/native/DiffSummaryReceiver.cpp (original)
+++ subversion/branches/svn-patch-improvements/subversion/bindings/javahl/native/DiffSummaryReceiver.cpp Tue Mar 30 20:57:53 2010
@@ -56,26 +56,27 @@ DiffSummaryReceiver::onSummary(const svn
apr_pool_t *pool)
{
JNIEnv *env = JNIUtil::getEnv();
- jclass clazz;
+
+ // Create a local frame for our references
+ env->PushLocalFrame(LOCAL_FRAME_SIZE);
+ if (JNIUtil::isJavaExceptionThrown())
+ return SVN_NO_ERROR;
// As Java method IDs will not change during the time this library
// is loaded, they can be cached.
static jmethodID callback = 0;
+ jclass clazz;
if (callback == 0)
{
// Initialize the method ID.
clazz = env->FindClass(JAVA_PACKAGE "/callback/DiffSummaryCallback");
if (JNIUtil::isJavaExceptionThrown())
- return SVN_NO_ERROR;
+ POP_AND_RETURN(SVN_NO_ERROR);
callback = env->GetMethodID(clazz, "onSummary",
"(L"JAVA_PACKAGE"/DiffSummary;)V");
if (JNIUtil::isJavaExceptionThrown() || callback == 0)
- return SVN_NO_ERROR;
-
- env->DeleteLocalRef(clazz);
- if (JNIUtil::isJavaExceptionThrown())
- return SVN_NO_ERROR;
+ POP_AND_RETURN(SVN_NO_ERROR);
}
// Do some prep work for tranforming the DIFF parameter into a
@@ -83,44 +84,41 @@ DiffSummaryReceiver::onSummary(const svn
static jmethodID ctor = 0;
clazz = env->FindClass(JAVA_PACKAGE "/DiffSummary");
if (JNIUtil::isJavaExceptionThrown())
- return SVN_NO_ERROR;
+ POP_AND_RETURN(SVN_NO_ERROR);
if (ctor == 0)
{
ctor = env->GetMethodID(clazz, "<init>",
- "(Ljava/lang/String;IZI)V");
+ "(Ljava/lang/String;"
+ "L"JAVA_PACKAGE"/DiffSummary$DiffKind;Z"
+ "L"JAVA_PACKAGE"/NodeKind;)V");
if (JNIUtil::isJavaExceptionThrown() || ctor == 0)
- return SVN_NO_ERROR;
+ POP_AND_RETURN(SVN_NO_ERROR);
}
// Convert the arguments into their Java equivalent,
jstring jPath = JNIUtil::makeJString(diff->path);
if (JNIUtil::isJavaExceptionThrown())
- return SVN_NO_ERROR;
+ POP_AND_RETURN(SVN_NO_ERROR);
+
+ jobject jNodeKind = EnumMapper::mapNodeKind(diff->node_kind);
+ if (JNIUtil::isJavaExceptionThrown())
+ POP_AND_RETURN(SVN_NO_ERROR);
+
+ jobject jSummarizeKind = EnumMapper::mapSummarizeKind(diff->summarize_kind);
+ if (JNIUtil::isJavaExceptionThrown())
+ POP_AND_RETURN(SVN_NO_ERROR);
- jint jNodeKind = EnumMapper::mapNodeKind(diff->node_kind);
// Actually tranform the DIFF parameter into a Java equivalent.
- jobject jDiffSummary = env->NewObject(clazz, ctor, jPath,
- (jint) diff->summarize_kind,
+ jobject jDiffSummary = env->NewObject(clazz, ctor, jPath, jSummarizeKind,
(jboolean) diff->prop_changed,
jNodeKind);
if (JNIUtil::isJavaExceptionThrown() || jDiffSummary == NULL)
- return SVN_NO_ERROR;
-
- env->DeleteLocalRef(jPath);
- if (JNIUtil::isJavaExceptionThrown())
- return SVN_NO_ERROR;
-
- env->DeleteLocalRef(clazz);
- if (JNIUtil::isJavaExceptionThrown())
- return SVN_NO_ERROR;
+ POP_AND_RETURN(SVN_NO_ERROR);
// Invoke the Java DiffSummaryReceiver callback.
env->CallVoidMethod(m_receiver, callback, jDiffSummary);
- if (JNIUtil::isJavaExceptionThrown())
- return SVN_NO_ERROR;
-
- env->DeleteLocalRef(jDiffSummary);
// We return whether an exception was thrown or not.
+ env->PopLocalFrame(NULL);
return SVN_NO_ERROR;
}
Modified: subversion/branches/svn-patch-improvements/subversion/bindings/javahl/native/EnumMapper.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/svn-patch-improvements/subversion/bindings/javahl/native/EnumMapper.cpp?rev=929279&r1=929278&r2=929279&view=diff
==============================================================================
--- subversion/branches/svn-patch-improvements/subversion/bindings/javahl/native/EnumMapper.cpp (original)
+++ subversion/branches/svn-patch-improvements/subversion/bindings/javahl/native/EnumMapper.cpp Tue Mar 30 20:57:53 2010
@@ -28,19 +28,9 @@
#include "svn_wc.h"
#include "svn_client.h"
#include "EnumMapper.h"
+#include "JNIUtil.h"
+#include "JNIStringHolder.h"
#include "../include/org_apache_subversion_javahl_CommitItemStateFlags.h"
-#include "../include/org_apache_subversion_javahl_NotifyAction.h"
-#include "../include/org_apache_subversion_javahl_NotifyStatus.h"
-#include "../include/org_apache_subversion_javahl_NodeKind.h"
-#include "../include/org_apache_subversion_javahl_Operation.h"
-#include "../include/org_apache_subversion_javahl_LockStatus.h"
-#include "../include/org_apache_subversion_javahl_StatusKind.h"
-#include "../include/org_apache_subversion_javahl_Revision.h"
-#include "../include/org_apache_subversion_javahl_ScheduleKind.h"
-#include "../include/org_apache_subversion_javahl_ConflictDescriptor_Kind.h"
-#include "../include/org_apache_subversion_javahl_ConflictDescriptor_Action.h"
-#include "../include/org_apache_subversion_javahl_ConflictDescriptor_Reason.h"
-#include "../include/org_apache_subversion_javahl_Depth.h"
/**
* Map a C commit state flag constant to the Java constant.
@@ -70,445 +60,187 @@ jint EnumMapper::mapCommitMessageStateFl
/**
* Map a C notify state constant to the Java constant.
- * @param state the C notify state constant
- * @returns the Java constant
*/
-jint EnumMapper::mapNotifyState(svn_wc_notify_state_t state)
+jobject EnumMapper::mapNotifyState(svn_wc_notify_state_t state)
{
- switch(state)
- {
- default:
- case svn_wc_notify_state_inapplicable:
- return org_apache_subversion_javahl_NotifyStatus_inapplicable;
-
- case svn_wc_notify_state_unknown:
- return org_apache_subversion_javahl_NotifyStatus_unknown;
-
- case svn_wc_notify_state_unchanged:
- return org_apache_subversion_javahl_NotifyStatus_unchanged;
-
- case svn_wc_notify_state_missing:
- return org_apache_subversion_javahl_NotifyStatus_missing;
-
- case svn_wc_notify_state_obstructed:
- return org_apache_subversion_javahl_NotifyStatus_obstructed;
-
- case svn_wc_notify_state_changed:
- return org_apache_subversion_javahl_NotifyStatus_changed;
-
- case svn_wc_notify_state_merged:
- return org_apache_subversion_javahl_NotifyStatus_merged;
-
- case svn_wc_notify_state_conflicted:
- return org_apache_subversion_javahl_NotifyStatus_conflicted;
- }
-
+ // We're assuming a valid value for the C enum above
+ return mapEnum(JAVA_PACKAGE"/NotifyInformation$Status", (int) state);
}
/**
* Map a C notify action constant to the Java constant.
- * @param state the C notify action constant
- * @returns the Java constant
*/
-jint EnumMapper::mapNotifyAction(svn_wc_notify_action_t action)
+jobject EnumMapper::mapNotifyAction(svn_wc_notify_action_t action)
{
- // This is a switch to make the Java constants independent from
- // the C constants.
- switch(action)
- {
- case svn_wc_notify_add:
- /* Adding a path to revision control. */
- return org_apache_subversion_javahl_NotifyAction_add;
-
- case svn_wc_notify_copy:
- /* Copying a versioned path. */
- return org_apache_subversion_javahl_NotifyAction_copy;
-
- case svn_wc_notify_delete:
- /* Deleting a versioned path. */
- return org_apache_subversion_javahl_NotifyAction_delete;
-
- case svn_wc_notify_restore:
- /* Restoring a missing path from the pristine text-base. */
- return org_apache_subversion_javahl_NotifyAction_restore;
-
- case svn_wc_notify_revert:
- /* Reverting a modified path. */
- return org_apache_subversion_javahl_NotifyAction_revert;
-
- case svn_wc_notify_failed_revert:
- /* A revert operation has failed. */
- return org_apache_subversion_javahl_NotifyAction_failed_revert;
-
- case svn_wc_notify_resolved:
- /* Resolving a conflict. */
- return org_apache_subversion_javahl_NotifyAction_resolved;
-
- case svn_wc_notify_status_completed:
- /* The last notification in a status (including status on
- * externals). */
- return org_apache_subversion_javahl_NotifyAction_status_completed;
-
- case svn_wc_notify_status_external:
- /* Running status on an external module. */
- return org_apache_subversion_javahl_NotifyAction_status_external;
-
- case svn_wc_notify_skip:
- /* Skipping a path. */
- return org_apache_subversion_javahl_NotifyAction_skip;
-
- case svn_wc_notify_update_delete:
- /* Got a delete in an update. */
- return org_apache_subversion_javahl_NotifyAction_update_delete;
-
- case svn_wc_notify_update_add:
- /* Got an add in an update. */
- return org_apache_subversion_javahl_NotifyAction_update_add;
-
- case svn_wc_notify_update_replace:
- /* Got a replaced in an update. */
- return org_apache_subversion_javahl_NotifyAction_update_replaced;
-
- case svn_wc_notify_update_update:
- /* Got any other action in an update. */
- return org_apache_subversion_javahl_NotifyAction_update_update;
-
- case svn_wc_notify_update_completed:
- /* The last notification in an update (including updates of
- * externals). */
- return org_apache_subversion_javahl_NotifyAction_update_completed;
-
- case svn_wc_notify_update_external:
- /* Updating an external module. */
- return org_apache_subversion_javahl_NotifyAction_update_external;
-
- case svn_wc_notify_commit_modified:
- /* Committing a modification. */
- return org_apache_subversion_javahl_NotifyAction_commit_modified;
-
- case svn_wc_notify_commit_added:
- /* Committing an addition. */
- return org_apache_subversion_javahl_NotifyAction_commit_added;
-
- case svn_wc_notify_commit_deleted:
- /* Committing a deletion. */
- return org_apache_subversion_javahl_NotifyAction_commit_deleted;
-
- case svn_wc_notify_commit_replaced:
- /* Committing a replacement. */
- return org_apache_subversion_javahl_NotifyAction_commit_replaced;
-
- case svn_wc_notify_commit_postfix_txdelta:
- /* Transmitting post-fix text-delta data for a file. */
- return org_apache_subversion_javahl_NotifyAction_commit_postfix_txdelta;
-
- case svn_wc_notify_blame_revision:
- /* Processed a single revision's blame. */
- return org_apache_subversion_javahl_NotifyAction_blame_revision;
-
- case svn_wc_notify_locked:
- /* Lock a path */
- return org_apache_subversion_javahl_NotifyAction_locked;
-
- case svn_wc_notify_unlocked:
- /* Unlock a path */
- return org_apache_subversion_javahl_NotifyAction_unlocked;
-
- case svn_wc_notify_failed_lock:
- /* Lock failed */
- return org_apache_subversion_javahl_NotifyAction_failed_lock;
-
- case svn_wc_notify_failed_unlock:
- /* Unlock failed */
- return org_apache_subversion_javahl_NotifyAction_failed_unlock;
-
- case svn_wc_notify_exists:
- /* Tried adding a path that already exists. */
- return org_apache_subversion_javahl_NotifyAction_exists;
-
- case svn_wc_notify_changelist_set:
- /* Changelist name set. */
- return org_apache_subversion_javahl_NotifyAction_changelist_set;
-
- case svn_wc_notify_changelist_clear:
- /* Changelist name cleared. */
- return org_apache_subversion_javahl_NotifyAction_changelist_clear;
-
- case svn_wc_notify_merge_begin:
- /* A merge operation has begun. */
- return org_apache_subversion_javahl_NotifyAction_merge_begin;
-
- case svn_wc_notify_foreign_merge_begin:
- /* A merge operation from a foreign repository has begun. */
- return org_apache_subversion_javahl_NotifyAction_foreign_merge_begin;
-
- case svn_wc_notify_property_added:
- /* Property added */
- return org_apache_subversion_javahl_NotifyAction_property_added;
-
- case svn_wc_notify_property_modified:
- /* Property modified */
- return org_apache_subversion_javahl_NotifyAction_property_modified;
-
- case svn_wc_notify_property_deleted:
- /* Property deleted */
- return org_apache_subversion_javahl_NotifyAction_property_deleted;
-
- case svn_wc_notify_property_deleted_nonexistent:
- /* Property deleted nonexistent */
- return org_apache_subversion_javahl_NotifyAction_property_deleted_nonexistent;
-
- case svn_wc_notify_revprop_set:
- /* Revision property set */
- return org_apache_subversion_javahl_NotifyAction_revprop_set;
-
- case svn_wc_notify_revprop_deleted:
- /* Revision property deleted */
- return org_apache_subversion_javahl_NotifyAction_revprop_deleted;
-
- case svn_wc_notify_merge_completed:
- /* Final notification in a merge */
- return org_apache_subversion_javahl_NotifyAction_merge_completed;
-
- case svn_wc_notify_tree_conflict:
- /* The path is a tree-conflict victim of the intended action */
- return org_apache_subversion_javahl_NotifyAction_tree_conflict;
-
- default:
- return -1;
- }
+ // We're assuming a valid value for the C enum above
+ return mapEnum(JAVA_PACKAGE"/NotifyInformation$Action", (int) action);
}
/**
* Map a C node kind constant to the Java constant.
- * @param state the C node kind constant
- * @returns the Java constant
*/
-jint EnumMapper::mapNodeKind(svn_node_kind_t nodeKind)
+jobject EnumMapper::mapNodeKind(svn_node_kind_t nodeKind)
{
- switch(nodeKind)
- {
- case svn_node_none:
- return org_apache_subversion_javahl_NodeKind_none;
-
- case svn_node_file:
- return org_apache_subversion_javahl_NodeKind_file;
-
- case svn_node_dir:
- return org_apache_subversion_javahl_NodeKind_dir;
-
- case svn_node_unknown:
- return org_apache_subversion_javahl_NodeKind_unknown;
-
- default:
- return org_apache_subversion_javahl_NodeKind_unknown;
- }
+ // We're assuming a valid value for the C enum above
+ return mapEnum(JAVA_PACKAGE"/NodeKind", (int) nodeKind);
}
/**
* Map a C notify lock state constant to the Java constant.
- * @param state the C notify lock state constant
- * @returns the Java constant
*/
-jint EnumMapper::mapNotifyLockState(svn_wc_notify_lock_state_t state)
+jobject EnumMapper::mapNotifyLockState(svn_wc_notify_lock_state_t state)
{
- switch(state)
- {
- case svn_wc_notify_lock_state_inapplicable:
- return org_apache_subversion_javahl_LockStatus_inapplicable;
-
- case svn_wc_notify_lock_state_unknown:
- return org_apache_subversion_javahl_LockStatus_unknown;
-
- case svn_wc_notify_lock_state_unchanged:
- return org_apache_subversion_javahl_LockStatus_unchanged;
-
- case svn_wc_notify_lock_state_locked:
- return org_apache_subversion_javahl_LockStatus_locked;
-
- case svn_wc_notify_lock_state_unlocked:
- return org_apache_subversion_javahl_LockStatus_unlocked;
-
- default:
- return org_apache_subversion_javahl_LockStatus_inapplicable;
- }
+ // We're assuming a valid value for the C enum above
+ return mapEnum(JAVA_PACKAGE"/NotifyInformation$LockStatus", (int) state);
}
/**
* Map a C wc schedule constant to the Java constant.
- * @param state the C wc schedule constant
- * @returns the Java constant
*/
-jint EnumMapper::mapScheduleKind(svn_wc_schedule_t schedule)
+jobject EnumMapper::mapScheduleKind(svn_wc_schedule_t schedule)
{
- switch(schedule)
- {
- /** Nothing special here */
- case svn_wc_schedule_normal:
- return org_apache_subversion_javahl_ScheduleKind_normal;
-
- /** Slated for addition */
- case svn_wc_schedule_add:
- return org_apache_subversion_javahl_ScheduleKind_add;
-
- /** Slated for deletion */
- case svn_wc_schedule_delete:
- return org_apache_subversion_javahl_ScheduleKind_delete;
-
- /** Slated for replacement (delete + add) */
- case svn_wc_schedule_replace:
- return org_apache_subversion_javahl_ScheduleKind_replace;
-
- default:
- return org_apache_subversion_javahl_ScheduleKind_normal;
- }
+ // We're assuming a valid value for the C enum above
+ return mapEnum(JAVA_PACKAGE"/Info2$ScheduleKind", (int) schedule);
}
/**
* Map a C wc state constant to the Java constant.
- * @param state the C wc state constant
- * @returns the Java constant
*/
-jint EnumMapper::mapStatusKind(svn_wc_status_kind svnKind)
+jobject EnumMapper::mapStatusKind(svn_wc_status_kind svnKind)
{
- switch(svnKind)
- {
- case svn_wc_status_none:
- default:
- return org_apache_subversion_javahl_StatusKind_none;
-
- case svn_wc_status_unversioned:
- return org_apache_subversion_javahl_StatusKind_unversioned;
-
- case svn_wc_status_normal:
- return org_apache_subversion_javahl_StatusKind_normal;
-
- case svn_wc_status_added:
- return org_apache_subversion_javahl_StatusKind_added;
+ // We're assuming a valid value for the C enum above
+ // The offset here is +1
+ return mapEnum(JAVA_PACKAGE"/Status$Kind", ((int) svnKind) - 1);
+}
- case svn_wc_status_missing:
- return org_apache_subversion_javahl_StatusKind_missing;
+jobject EnumMapper::mapConflictKind(svn_wc_conflict_kind_t kind)
+{
+ // We're assuming a valid value for the C enum above
+ return mapEnum(JAVA_PACKAGE"/ConflictDescriptor$Kind", (int) kind);
+}
- case svn_wc_status_deleted:
- return org_apache_subversion_javahl_StatusKind_deleted;
+jobject EnumMapper::mapConflictAction(svn_wc_conflict_action_t action)
+{
+ // We're assuming a valid value for the C enum above
+ return mapEnum(JAVA_PACKAGE"/ConflictDescriptor$Action", (int) action);
+}
- case svn_wc_status_replaced:
- return org_apache_subversion_javahl_StatusKind_replaced;
+jobject EnumMapper::mapConflictReason(svn_wc_conflict_reason_t reason)
+{
+ // We're assuming a valid value for the C enum above
+ return mapEnum(JAVA_PACKAGE"/ConflictDescriptor$Reason", (int) reason);
+}
- case svn_wc_status_modified:
- return org_apache_subversion_javahl_StatusKind_modified;
+int EnumMapper::toMergeinfoLogKind(jobject jLogKind)
+{
+ return getOrdinal(JAVA_PACKAGE"/MergeinfoLogKind", jLogKind);
+}
- case svn_wc_status_merged:
- return org_apache_subversion_javahl_StatusKind_merged;
+int EnumMapper::toLogLevel(jobject jLogLevel)
+{
+ return getOrdinal(JAVA_PACKAGE"/SVNClient$ClientLogLevel", jLogLevel);
+}
- case svn_wc_status_conflicted:
- return org_apache_subversion_javahl_StatusKind_conflicted;
+svn_depth_t EnumMapper::toDepth(jobject jdepth)
+{
+ // The offset for depths is -2
+ return (svn_depth_t) (getOrdinal(JAVA_PACKAGE"/Depth", jdepth) - 2);
+}
- case svn_wc_status_ignored:
- return org_apache_subversion_javahl_StatusKind_ignored;
+jobject EnumMapper::mapDepth(svn_depth_t depth)
+{
+ // We're assuming a valid value for the C enum above
+ // The offset for depths is -2
+ return mapEnum(JAVA_PACKAGE"/Depth", ((int) depth) + 2);
+}
- case svn_wc_status_obstructed:
- return org_apache_subversion_javahl_StatusKind_obstructed;
+jobject EnumMapper::mapOperation(svn_wc_operation_t operation)
+{
+ // We're assuming a valid value for the C enum above
+ return mapEnum(JAVA_PACKAGE"/ConflictDescriptor$Operation", (int) operation);
+}
- case svn_wc_status_external:
- return org_apache_subversion_javahl_StatusKind_external;
+jobject EnumMapper::mapTristate(svn_tristate_t tristate)
+{
+ // We're assuming a valid value for the C enum above
+ return mapEnum(JAVA_PACKAGE"/Tristate", (int) tristate);
+}
- case svn_wc_status_incomplete:
- return org_apache_subversion_javahl_StatusKind_incomplete;
- }
+svn_wc_conflict_choice_t EnumMapper::toConflictChoice(jobject jchoice)
+{
+ return (svn_wc_conflict_choice_t) getOrdinal(
+ JAVA_PACKAGE"/ConflictResult$Choice", jchoice);
}
-jint EnumMapper::mapConflictKind(svn_wc_conflict_kind_t kind)
+svn_opt_revision_kind EnumMapper::toRevisionKind(jobject jkind)
{
- switch (kind)
- {
- case svn_wc_conflict_kind_text:
- default:
- return org_apache_subversion_javahl_ConflictDescriptor_Kind_text;
+ return (svn_opt_revision_kind) getOrdinal(JAVA_PACKAGE"/Revision$Kind",
+ jkind);
+}
- case svn_wc_conflict_kind_property:
- return org_apache_subversion_javahl_ConflictDescriptor_Kind_property;
- }
+jobject EnumMapper::mapSummarizeKind(svn_client_diff_summarize_kind_t sKind)
+{
+ // We're assuming a valid value for the C enum above
+ return mapEnum(JAVA_PACKAGE"/DiffSummary$DiffKind", (int) sKind);
}
-jint EnumMapper::mapConflictAction(svn_wc_conflict_action_t action)
+jobject EnumMapper::mapEnum(const char *clazzName, int index)
{
- switch (action)
- {
- case svn_wc_conflict_action_edit:
- default:
- return org_apache_subversion_javahl_ConflictDescriptor_Action_edit;
+ // The fact that we can even do this depends upon a couple of assumptions,
+ // mainly some knowledge about the orderin of the various constants in
+ // both the C and Java enums. Should those values ever change,
+ // the World Will End.
- case svn_wc_conflict_action_add:
- return org_apache_subversion_javahl_ConflictDescriptor_Action_add;
+ std::string methodSig("()[L");
+ methodSig.append(clazzName);
+ methodSig.append(";");
- case svn_wc_conflict_action_delete:
- return org_apache_subversion_javahl_ConflictDescriptor_Action_delete;
- }
-}
+ JNIEnv *env = JNIUtil::getEnv();
-jint EnumMapper::mapConflictReason(svn_wc_conflict_reason_t reason)
-{
- switch (reason)
- {
- case svn_wc_conflict_reason_edited:
- default:
- return org_apache_subversion_javahl_ConflictDescriptor_Reason_edited;
+ // Create a local frame for our references
+ env->PushLocalFrame(LOCAL_FRAME_SIZE);
+ if (JNIUtil::isJavaExceptionThrown())
+ return NULL;
- case svn_wc_conflict_reason_obstructed:
- return org_apache_subversion_javahl_ConflictDescriptor_Reason_obstructed;
+ jclass clazz = env->FindClass(clazzName);
+ if (JNIUtil::isJavaExceptionThrown())
+ POP_AND_RETURN_NULL;
- case svn_wc_conflict_reason_deleted:
- return org_apache_subversion_javahl_ConflictDescriptor_Reason_deleted;
+ jmethodID mid = env->GetStaticMethodID(clazz, "values", methodSig.c_str());
+ if (JNIUtil::isJavaExceptionThrown())
+ POP_AND_RETURN_NULL;
- case svn_wc_conflict_reason_missing:
- return org_apache_subversion_javahl_ConflictDescriptor_Reason_missing;
+ jobjectArray jvalues = (jobjectArray) env->CallStaticObjectMethod(clazz, mid);
+ if (JNIUtil::isJavaExceptionThrown())
+ POP_AND_RETURN_NULL;
- case svn_wc_conflict_reason_unversioned:
- return org_apache_subversion_javahl_ConflictDescriptor_Reason_unversioned;
+ jobject jthing = env->GetObjectArrayElement(jvalues, index);
+ if (JNIUtil::isJavaExceptionThrown())
+ POP_AND_RETURN_NULL;
- case svn_wc_conflict_reason_added:
- return org_apache_subversion_javahl_ConflictDescriptor_Reason_added;
- }
+ return env->PopLocalFrame(jthing);
}
-jint EnumMapper::mapDepth(svn_depth_t depth)
+int EnumMapper::getOrdinal(const char *clazzName, jobject jenum)
{
- switch (depth)
- {
- case svn_depth_unknown:
- default:
- return org_apache_subversion_javahl_Depth_unknown;
+ JNIEnv *env = JNIUtil::getEnv();
- case svn_depth_exclude:
- return org_apache_subversion_javahl_Depth_exclude;
+ // Create a local frame for our references
+ env->PushLocalFrame(LOCAL_FRAME_SIZE);
+ if (JNIUtil::isJavaExceptionThrown())
+ return -1;
- case svn_depth_empty:
- return org_apache_subversion_javahl_Depth_empty;
+ jclass clazz = env->FindClass(clazzName);
+ if (JNIUtil::isJavaExceptionThrown())
+ POP_AND_RETURN(-1);
- case svn_depth_files:
- return org_apache_subversion_javahl_Depth_files;
+ jmethodID mid = env->GetMethodID(clazz, "ordinal", "()I");
+ if (JNIUtil::isJavaExceptionThrown())
+ POP_AND_RETURN(-1);
- case svn_depth_immediates:
- return org_apache_subversion_javahl_Depth_immediates;
+ jint jorder = env->CallIntMethod(jenum, mid);
+ if (JNIUtil::isJavaExceptionThrown())
+ POP_AND_RETURN(-1);
- case svn_depth_infinity:
- return org_apache_subversion_javahl_Depth_infinity;
- }
-}
-
-jint EnumMapper::mapOperation(svn_wc_operation_t operation)
-{
- switch (operation)
- {
- case svn_wc_operation_none:
- default:
- return org_apache_subversion_javahl_Operation_none;
- case svn_wc_operation_update:
- return org_apache_subversion_javahl_Operation_update;
- case svn_wc_operation_switch:
- return org_apache_subversion_javahl_Operation_switched;
- case svn_wc_operation_merge:
- return org_apache_subversion_javahl_Operation_merge;
- }
+ return (int) jorder;
}
Modified: subversion/branches/svn-patch-improvements/subversion/bindings/javahl/native/EnumMapper.h
URL: http://svn.apache.org/viewvc/subversion/branches/svn-patch-improvements/subversion/bindings/javahl/native/EnumMapper.h?rev=929279&r1=929278&r2=929279&view=diff
==============================================================================
--- subversion/branches/svn-patch-improvements/subversion/bindings/javahl/native/EnumMapper.h (original)
+++ subversion/branches/svn-patch-improvements/subversion/bindings/javahl/native/EnumMapper.h Tue Mar 30 20:57:53 2010
@@ -32,25 +32,40 @@
#include "svn_wc.h"
#include "svn_types.h"
+class JNIStringHolder;
+
/**
* This class contains all the mappers between the C enum's and the
- * matching Java int's.
+ * matching Java enums's.
*/
class EnumMapper
{
public:
+ /* Converting to C enum's */
+ static svn_depth_t toDepth(jobject jdepth);
+ static svn_opt_revision_kind toRevisionKind(jobject jkind);
+ static svn_wc_conflict_choice_t toConflictChoice(jobject jchoice);
+ static int toMergeinfoLogKind(jobject jLogKind);
+ static int toLogLevel(jobject jLogLevel);
+
+ /* Converting from C enum's */
static jint mapCommitMessageStateFlags(apr_byte_t flags);
- static jint mapNotifyState(svn_wc_notify_state_t state);
- static jint mapNotifyAction(svn_wc_notify_action_t action);
- static jint mapNodeKind(svn_node_kind_t nodeKind);
- static jint mapNotifyLockState(svn_wc_notify_lock_state_t state);
- static jint mapStatusKind(svn_wc_status_kind svnKind);
- static jint mapScheduleKind(svn_wc_schedule_t schedule);
- static jint mapConflictKind(svn_wc_conflict_kind_t kind);
- static jint mapConflictAction(svn_wc_conflict_action_t action);
- static jint mapConflictReason(svn_wc_conflict_reason_t reason);
- static jint mapDepth(svn_depth_t depth);
- static jint mapOperation(svn_wc_operation_t);
+ static jobject mapNotifyState(svn_wc_notify_state_t state);
+ static jobject mapNotifyAction(svn_wc_notify_action_t action);
+ static jobject mapNodeKind(svn_node_kind_t nodeKind);
+ static jobject mapNotifyLockState(svn_wc_notify_lock_state_t state);
+ static jobject mapStatusKind(svn_wc_status_kind svnKind);
+ static jobject mapScheduleKind(svn_wc_schedule_t schedule);
+ static jobject mapConflictKind(svn_wc_conflict_kind_t kind);
+ static jobject mapConflictAction(svn_wc_conflict_action_t action);
+ static jobject mapConflictReason(svn_wc_conflict_reason_t reason);
+ static jobject mapDepth(svn_depth_t depth);
+ static jobject mapOperation(svn_wc_operation_t);
+ static jobject mapTristate(svn_tristate_t);
+ static jobject mapSummarizeKind(svn_client_diff_summarize_kind_t);
+ private:
+ static jobject mapEnum(const char *clazzName, int offset);
+ static int getOrdinal(const char *clazzName, jobject jenum);
};
#endif // ENUM_MAPPER_H
Modified: subversion/branches/svn-patch-improvements/subversion/bindings/javahl/native/InfoCallback.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/svn-patch-improvements/subversion/bindings/javahl/native/InfoCallback.cpp?rev=929279&r1=929278&r2=929279&view=diff
==============================================================================
--- subversion/branches/svn-patch-improvements/subversion/bindings/javahl/native/InfoCallback.cpp (original)
+++ subversion/branches/svn-patch-improvements/subversion/bindings/javahl/native/InfoCallback.cpp Tue Mar 30 20:57:53 2010
@@ -70,6 +70,11 @@ InfoCallback::singleInfo(const char *pat
{
JNIEnv *env = JNIUtil::getEnv();
+ // Create a local frame for our references
+ env->PushLocalFrame(LOCAL_FRAME_SIZE);
+ if (JNIUtil::isJavaExceptionThrown())
+ return SVN_NO_ERROR;
+
// The method id will not change during the time this library is
// loaded, so it can be cached.
static jmethodID mid = 0;
@@ -77,193 +82,21 @@ InfoCallback::singleInfo(const char *pat
{
jclass clazz = env->FindClass(JAVA_PACKAGE"/callback/InfoCallback");
if (JNIUtil::isJavaExceptionThrown())
- return SVN_NO_ERROR;
+ POP_AND_RETURN(SVN_NO_ERROR);
mid = env->GetMethodID(clazz, "singleInfo",
"(L"JAVA_PACKAGE"/Info2;)V");
if (JNIUtil::isJavaExceptionThrown() || mid == 0)
- return SVN_NO_ERROR;
-
- env->DeleteLocalRef(clazz);
- if (JNIUtil::isJavaExceptionThrown())
- return SVN_NO_ERROR;
+ POP_AND_RETURN(SVN_NO_ERROR);
}
- jobject jinfo2 = createJavaInfo2(path, info, pool);
+ jobject jinfo2 = CreateJ::Info2(path, info);
if (jinfo2 == NULL || JNIUtil::isJavaExceptionThrown())
- return SVN_NO_ERROR;
+ POP_AND_RETURN(SVN_NO_ERROR);
env->CallVoidMethod(m_callback, mid, jinfo2);
- if (JNIUtil::isJavaExceptionThrown())
- return SVN_NO_ERROR;
-
- env->DeleteLocalRef(jinfo2);
// Return SVN_NO_ERROR here regardless of an exception or not.
+ env->PopLocalFrame(NULL);
return SVN_NO_ERROR;
}
-
-jobject
-InfoCallback::createJavaInfo2(const char *path, const svn_info_t *info,
- apr_pool_t *pool)
-{
- JNIEnv *env = JNIUtil::getEnv();
- jclass clazz = env->FindClass(JAVA_PACKAGE "/Info2");
- if (JNIUtil::isJavaExceptionThrown())
- return NULL;
-
- static jmethodID mid = 0;
- if (mid == 0)
- {
- mid = env->GetMethodID(clazz, "<init>",
- "(Ljava/lang/String;Ljava/lang/String;"
- "JILjava/lang/String;Ljava/lang/String;"
- "JJLjava/lang/String;"
- "L"JAVA_PACKAGE"/Lock;"
- "ZILjava/lang/String;JJJ"
- "Ljava/lang/String;Ljava/lang/String;"
- "Ljava/lang/String;Ljava/lang/String;"
- "Ljava/lang/String;Ljava/lang/String;JJI"
- "L"JAVA_PACKAGE"/ConflictDescriptor;)V");
- if (mid == 0 || JNIUtil::isJavaExceptionThrown())
- return NULL;
- }
-
- jstring jpath = JNIUtil::makeJString(path);
- if (JNIUtil::isJavaExceptionThrown())
- return NULL;
-
- jstring jurl = JNIUtil::makeJString(info->URL);
- if (JNIUtil::isJavaExceptionThrown())
- return NULL;
-
- jstring jreposRootUrl = JNIUtil::makeJString(info->repos_root_URL);
- if (JNIUtil::isJavaExceptionThrown())
- return NULL;
-
- jstring jreportUUID = JNIUtil::makeJString(info->repos_UUID);
- if (JNIUtil::isJavaExceptionThrown())
- return NULL;
-
- jstring jlastChangedAuthor =
- JNIUtil::makeJString(info->last_changed_author);
- if (JNIUtil::isJavaExceptionThrown())
- return NULL;
-
- jobject jlock = CreateJ::Lock(info->lock);
- if (JNIUtil::isJavaExceptionThrown())
- return NULL;
-
- jstring jcopyFromUrl = JNIUtil::makeJString(info->copyfrom_url);
- if (JNIUtil::isJavaExceptionThrown())
- return NULL;
-
- jstring jchecksum = JNIUtil::makeJString(info->checksum);
- if (JNIUtil::isJavaExceptionThrown())
- return NULL;
-
- jstring jconflictOld = JNIUtil::makeJString(info->conflict_old);
- if (JNIUtil::isJavaExceptionThrown())
- return NULL;
-
- jstring jconflictNew = JNIUtil::makeJString(info->conflict_new);
- if (JNIUtil::isJavaExceptionThrown())
- return NULL;
-
- jstring jconflictWrk = JNIUtil::makeJString(info->conflict_wrk);
- if (JNIUtil::isJavaExceptionThrown())
- return NULL;
-
- jstring jprejfile = JNIUtil::makeJString(info->prejfile);
- if (JNIUtil::isJavaExceptionThrown())
- return NULL;
-
- jstring jchangelist = JNIUtil::makeJString(info->changelist);
- if (JNIUtil::isJavaExceptionThrown())
- return NULL;
-
- jobject jdesc = CreateJ::ConflictDescriptor(info->tree_conflict);
- if (JNIUtil::isJavaExceptionThrown())
- return NULL;
-
- jlong jworkingSize = info->working_size == SVN_INFO_SIZE_UNKNOWN
- ? -1 : (jlong) info->working_size;
- jlong jreposSize = info->size == SVN_INFO_SIZE_UNKNOWN
- ? -1 : (jlong) info->size;
-
- jobject jinfo2 = env->NewObject(clazz, mid, jpath, jurl, (jlong) info->rev,
- EnumMapper::mapNodeKind(info->kind),
- jreposRootUrl, jreportUUID,
- (jlong) info->last_changed_rev,
- (jlong) info->last_changed_date,
- jlastChangedAuthor, jlock,
- info->has_wc_info ? JNI_TRUE : JNI_FALSE,
- EnumMapper::mapScheduleKind(info->schedule),
- jcopyFromUrl, (jlong) info->copyfrom_rev,
- (jlong) info->text_time,
- (jlong) info->prop_time, jchecksum,
- jconflictOld, jconflictNew, jconflictWrk,
- jprejfile, jchangelist,
- jworkingSize, jreposSize,
- EnumMapper::mapDepth(info->depth), jdesc);
- if (JNIUtil::isJavaExceptionThrown())
- return NULL;
-
- env->DeleteLocalRef(clazz);
- if (JNIUtil::isJavaExceptionThrown())
- return NULL;
-
- env->DeleteLocalRef(jpath);
- if (JNIUtil::isJavaExceptionThrown())
- return NULL;
-
- env->DeleteLocalRef(jurl);
- if (JNIUtil::isJavaExceptionThrown())
- return NULL;
-
- env->DeleteLocalRef(jreposRootUrl);
- if (JNIUtil::isJavaExceptionThrown())
- return NULL;
-
- env->DeleteLocalRef(jlastChangedAuthor);
- if (JNIUtil::isJavaExceptionThrown())
- return NULL;
-
- env->DeleteLocalRef(jlock);
- if (JNIUtil::isJavaExceptionThrown())
- return NULL;
-
- env->DeleteLocalRef(jcopyFromUrl);
- if (JNIUtil::isJavaExceptionThrown())
- return NULL;
-
- env->DeleteLocalRef(jchecksum);
- if (JNIUtil::isJavaExceptionThrown())
- return NULL;
-
- env->DeleteLocalRef(jconflictOld);
- if (JNIUtil::isJavaExceptionThrown())
- return NULL;
-
- env->DeleteLocalRef(jconflictNew);
- if (JNIUtil::isJavaExceptionThrown())
- return NULL;
-
- env->DeleteLocalRef(jconflictWrk);
- if (JNIUtil::isJavaExceptionThrown())
- return NULL;
-
- env->DeleteLocalRef(jprejfile);
- if (JNIUtil::isJavaExceptionThrown())
- return NULL;
-
- env->DeleteLocalRef(jchangelist);
- if (JNIUtil::isJavaExceptionThrown())
- return NULL;
-
- env->DeleteLocalRef(jdesc);
- if (JNIUtil::isJavaExceptionThrown())
- return NULL;
-
- return jinfo2;
-}
Modified: subversion/branches/svn-patch-improvements/subversion/bindings/javahl/native/InfoCallback.h
URL: http://svn.apache.org/viewvc/subversion/branches/svn-patch-improvements/subversion/bindings/javahl/native/InfoCallback.h?rev=929279&r1=929278&r2=929279&view=diff
==============================================================================
--- subversion/branches/svn-patch-improvements/subversion/bindings/javahl/native/InfoCallback.h (original)
+++ subversion/branches/svn-patch-improvements/subversion/bindings/javahl/native/InfoCallback.h Tue Mar 30 20:57:53 2010
@@ -57,10 +57,6 @@ class InfoCallback
* A local reference to the corresponding Java object.
*/
jobject m_callback;
-
- jobject createJavaInfo2(const char *path,
- const svn_info_t *info,
- apr_pool_t *pool);
};
#endif // INFOCALLBACK_H