You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by iv...@apache.org on 2015/02/11 14:29:28 UTC
svn commit: r1658954 [1/22] - in /subversion/branches/reuse-ra-session: ./
build/generator/ build/generator/templates/
subversion/bindings/javahl/native/
subversion/bindings/javahl/native/jniwrapper/ subversion/bindings/swig/
subversion/include/ subver...
Author: ivan
Date: Wed Feb 11 13:29:26 2015
New Revision: 1658954
URL: http://svn.apache.org/r1658954
Log:
On the reuse-ra-session branch: Sync with trunk up to r1658952.
Added:
subversion/branches/reuse-ra-session/TODO
- copied unchanged from r1658952, subversion/trunk/TODO
subversion/branches/reuse-ra-session/subversion/bindings/javahl/native/jniwrapper/jni_iterator.cpp
- copied unchanged from r1658952, subversion/trunk/subversion/bindings/javahl/native/jniwrapper/jni_iterator.cpp
subversion/branches/reuse-ra-session/subversion/bindings/javahl/native/jniwrapper/jni_iterator.hpp
- copied unchanged from r1658952, subversion/trunk/subversion/bindings/javahl/native/jniwrapper/jni_iterator.hpp
subversion/branches/reuse-ra-session/subversion/tests/libsvn_wc/wc-test-queries.sql
- copied unchanged from r1658952, subversion/trunk/subversion/tests/libsvn_wc/wc-test-queries.sql
Modified:
subversion/branches/reuse-ra-session/ (props changed)
subversion/branches/reuse-ra-session/CHANGES
subversion/branches/reuse-ra-session/Makefile.in
subversion/branches/reuse-ra-session/build.conf
subversion/branches/reuse-ra-session/build/generator/gen_make.py
subversion/branches/reuse-ra-session/build/generator/templates/build-outputs.mk.ezt
subversion/branches/reuse-ra-session/subversion/bindings/javahl/native/AuthnCallback.cpp
subversion/branches/reuse-ra-session/subversion/bindings/javahl/native/Utility.cpp
subversion/branches/reuse-ra-session/subversion/bindings/javahl/native/jniwrapper/jni_base.cpp
subversion/branches/reuse-ra-session/subversion/bindings/javahl/native/jniwrapper/jni_class_cache.cpp
subversion/branches/reuse-ra-session/subversion/bindings/javahl/native/jniwrapper/jni_exception.hpp
subversion/branches/reuse-ra-session/subversion/bindings/javahl/native/jniwrapper/jni_list.cpp
subversion/branches/reuse-ra-session/subversion/bindings/javahl/native/jniwrapper/jni_list.hpp
subversion/branches/reuse-ra-session/subversion/bindings/javahl/native/jniwrapper/jni_object.hpp
subversion/branches/reuse-ra-session/subversion/bindings/javahl/native/jniwrapper/jni_string_map.cpp
subversion/branches/reuse-ra-session/subversion/bindings/javahl/native/jniwrapper/jni_string_map.hpp
subversion/branches/reuse-ra-session/subversion/bindings/javahl/native/org_apache_subversion_javahl_util_ConfigLib.cpp
subversion/branches/reuse-ra-session/subversion/bindings/javahl/native/org_apache_subversion_javahl_util_PropLib.cpp
subversion/branches/reuse-ra-session/subversion/bindings/javahl/native/org_apache_subversion_javahl_util_SubstLib.cpp
subversion/branches/reuse-ra-session/subversion/bindings/swig/svn_delta.i
subversion/branches/reuse-ra-session/subversion/include/private/svn_auth_private.h
subversion/branches/reuse-ra-session/subversion/include/svn_x509.h
subversion/branches/reuse-ra-session/subversion/libsvn_client/repos_diff.c
subversion/branches/reuse-ra-session/subversion/libsvn_delta/compat.c
subversion/branches/reuse-ra-session/subversion/libsvn_fs_fs/cached_data.c
subversion/branches/reuse-ra-session/subversion/libsvn_fs_fs/index.c
subversion/branches/reuse-ra-session/subversion/libsvn_fs_fs/index.h
subversion/branches/reuse-ra-session/subversion/libsvn_fs_fs/lock.c
subversion/branches/reuse-ra-session/subversion/libsvn_fs_x/ (props changed)
subversion/branches/reuse-ra-session/subversion/libsvn_fs_x/hotcopy.c
subversion/branches/reuse-ra-session/subversion/libsvn_fs_x/lock.c
subversion/branches/reuse-ra-session/subversion/libsvn_ra/ra_loader.c
subversion/branches/reuse-ra-session/subversion/libsvn_ra_svn/editorp.c
subversion/branches/reuse-ra-session/subversion/libsvn_ra_svn/marshal.c
subversion/branches/reuse-ra-session/subversion/libsvn_repos/log.c
subversion/branches/reuse-ra-session/subversion/libsvn_repos/repos.c
subversion/branches/reuse-ra-session/subversion/libsvn_subr/auth.c
subversion/branches/reuse-ra-session/subversion/libsvn_subr/x509.h
subversion/branches/reuse-ra-session/subversion/libsvn_subr/x509info.c
subversion/branches/reuse-ra-session/subversion/libsvn_subr/x509parse.c
subversion/branches/reuse-ra-session/subversion/libsvn_wc/adm_crawler.c
subversion/branches/reuse-ra-session/subversion/libsvn_wc/conflicts.c
subversion/branches/reuse-ra-session/subversion/libsvn_wc/status.c
subversion/branches/reuse-ra-session/subversion/libsvn_wc/token-map.h
subversion/branches/reuse-ra-session/subversion/libsvn_wc/update_editor.c
subversion/branches/reuse-ra-session/subversion/libsvn_wc/wc-queries.sql
subversion/branches/reuse-ra-session/subversion/libsvn_wc/wc_db.c
subversion/branches/reuse-ra-session/subversion/libsvn_wc/wc_db.h
subversion/branches/reuse-ra-session/subversion/libsvn_wc/wc_db_private.h
subversion/branches/reuse-ra-session/subversion/libsvn_wc/wc_db_update_move.c
subversion/branches/reuse-ra-session/subversion/mod_dav_svn/deadprops.c
subversion/branches/reuse-ra-session/subversion/mod_dav_svn/util.c
subversion/branches/reuse-ra-session/subversion/svn/resolve-cmd.c
subversion/branches/reuse-ra-session/subversion/tests/cmdline/authz_tests.py
subversion/branches/reuse-ra-session/subversion/tests/cmdline/autoprop_tests.py
subversion/branches/reuse-ra-session/subversion/tests/cmdline/basic_tests.py
subversion/branches/reuse-ra-session/subversion/tests/cmdline/blame_tests.py
subversion/branches/reuse-ra-session/subversion/tests/cmdline/cat_tests.py
subversion/branches/reuse-ra-session/subversion/tests/cmdline/changelist_tests.py
subversion/branches/reuse-ra-session/subversion/tests/cmdline/checkout_tests.py
subversion/branches/reuse-ra-session/subversion/tests/cmdline/commit_tests.py
subversion/branches/reuse-ra-session/subversion/tests/cmdline/copy_tests.py
subversion/branches/reuse-ra-session/subversion/tests/cmdline/depth_tests.py
subversion/branches/reuse-ra-session/subversion/tests/cmdline/diff_tests.py
subversion/branches/reuse-ra-session/subversion/tests/cmdline/entries_tests.py
subversion/branches/reuse-ra-session/subversion/tests/cmdline/export_tests.py
subversion/branches/reuse-ra-session/subversion/tests/cmdline/externals_tests.py
subversion/branches/reuse-ra-session/subversion/tests/cmdline/history_tests.py
subversion/branches/reuse-ra-session/subversion/tests/cmdline/import_tests.py
subversion/branches/reuse-ra-session/subversion/tests/cmdline/info_tests.py
subversion/branches/reuse-ra-session/subversion/tests/cmdline/input_validation_tests.py
subversion/branches/reuse-ra-session/subversion/tests/cmdline/iprop_authz_tests.py
subversion/branches/reuse-ra-session/subversion/tests/cmdline/iprop_tests.py
subversion/branches/reuse-ra-session/subversion/tests/cmdline/lock_tests.py
subversion/branches/reuse-ra-session/subversion/tests/cmdline/log_tests.py
subversion/branches/reuse-ra-session/subversion/tests/cmdline/merge_authz_tests.py
subversion/branches/reuse-ra-session/subversion/tests/cmdline/merge_automatic_tests.py
subversion/branches/reuse-ra-session/subversion/tests/cmdline/merge_reintegrate_tests.py
subversion/branches/reuse-ra-session/subversion/tests/cmdline/merge_tests.py
subversion/branches/reuse-ra-session/subversion/tests/cmdline/merge_tree_conflict_tests.py
subversion/branches/reuse-ra-session/subversion/tests/cmdline/mergeinfo_tests.py
subversion/branches/reuse-ra-session/subversion/tests/cmdline/move_tests.py
subversion/branches/reuse-ra-session/subversion/tests/cmdline/patch_tests.py
subversion/branches/reuse-ra-session/subversion/tests/cmdline/prop_tests.py
subversion/branches/reuse-ra-session/subversion/tests/cmdline/redirect_tests.py
subversion/branches/reuse-ra-session/subversion/tests/cmdline/relocate_tests.py
subversion/branches/reuse-ra-session/subversion/tests/cmdline/resolve_tests.py
subversion/branches/reuse-ra-session/subversion/tests/cmdline/revert_tests.py
subversion/branches/reuse-ra-session/subversion/tests/cmdline/schedule_tests.py
subversion/branches/reuse-ra-session/subversion/tests/cmdline/special_tests.py
subversion/branches/reuse-ra-session/subversion/tests/cmdline/stat_tests.py
subversion/branches/reuse-ra-session/subversion/tests/cmdline/svnadmin_tests.py
subversion/branches/reuse-ra-session/subversion/tests/cmdline/svnauthz_tests.py
subversion/branches/reuse-ra-session/subversion/tests/cmdline/svndumpfilter_tests.py
subversion/branches/reuse-ra-session/subversion/tests/cmdline/svnlook_tests.py
subversion/branches/reuse-ra-session/subversion/tests/cmdline/svnmucc_tests.py
subversion/branches/reuse-ra-session/subversion/tests/cmdline/svnrdump_tests.py
subversion/branches/reuse-ra-session/subversion/tests/cmdline/svnsync_authz_tests.py
subversion/branches/reuse-ra-session/subversion/tests/cmdline/svnsync_tests.py
subversion/branches/reuse-ra-session/subversion/tests/cmdline/svntest/actions.py
subversion/branches/reuse-ra-session/subversion/tests/cmdline/svntest/deeptrees.py
subversion/branches/reuse-ra-session/subversion/tests/cmdline/svntest/factory.py
subversion/branches/reuse-ra-session/subversion/tests/cmdline/svntest/mergetrees.py
subversion/branches/reuse-ra-session/subversion/tests/cmdline/svntest/objects.py
subversion/branches/reuse-ra-session/subversion/tests/cmdline/svntest/sandbox.py
subversion/branches/reuse-ra-session/subversion/tests/cmdline/svnversion_tests.py
subversion/branches/reuse-ra-session/subversion/tests/cmdline/switch_tests.py
subversion/branches/reuse-ra-session/subversion/tests/cmdline/trans_tests.py
subversion/branches/reuse-ra-session/subversion/tests/cmdline/tree_conflict_tests.py
subversion/branches/reuse-ra-session/subversion/tests/cmdline/update_tests.py
subversion/branches/reuse-ra-session/subversion/tests/cmdline/upgrade_tests.py
subversion/branches/reuse-ra-session/subversion/tests/cmdline/wc_tests.py
subversion/branches/reuse-ra-session/subversion/tests/libsvn_fs/locks-test.c
subversion/branches/reuse-ra-session/subversion/tests/libsvn_subr/x509-test.c
subversion/branches/reuse-ra-session/subversion/tests/libsvn_wc/ (props changed)
subversion/branches/reuse-ra-session/subversion/tests/libsvn_wc/conflict-data-test.c
subversion/branches/reuse-ra-session/subversion/tests/libsvn_wc/db-test.c
subversion/branches/reuse-ra-session/subversion/tests/libsvn_wc/op-depth-test.c
subversion/branches/reuse-ra-session/subversion/tests/libsvn_wc/utils.c
subversion/branches/reuse-ra-session/subversion/tests/libsvn_wc/utils.h
subversion/branches/reuse-ra-session/subversion/tests/svn_test_main.c
Propchange: subversion/branches/reuse-ra-session/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Feb 11 13:29:26 2015
@@ -87,4 +87,4 @@
/subversion/branches/verify-at-commit:1462039-1462408
/subversion/branches/verify-keep-going:1439280-1546110
/subversion/branches/wc-collate-path:1402685-1480384
-/subversion/trunk:1501802-1657945
+/subversion/trunk:1501802-1658952
Modified: subversion/branches/reuse-ra-session/CHANGES
URL: http://svn.apache.org/viewvc/subversion/branches/reuse-ra-session/CHANGES?rev=1658954&r1=1658953&r2=1658954&view=diff
==============================================================================
--- subversion/branches/reuse-ra-session/CHANGES (original)
+++ subversion/branches/reuse-ra-session/CHANGES Wed Feb 11 13:29:26 2015
@@ -299,6 +299,8 @@ http://svn.apache.org/repos/asf/subversi
PARALLEL=1 means to use the default (r1573320)
* pkg-config support for libsvn_* libraries (issue #4435)
* binaries built on Mac OS X 10.6+ will not run on older versions (r1651549)
+ * fix random failure of Makefile-based parallel builds on Unix
+ when the amalgamated SQLite is being used (r1658357)
- API changes:
* New RA callbacks for managing ra_svn tunnels:
Modified: subversion/branches/reuse-ra-session/Makefile.in
URL: http://svn.apache.org/viewvc/subversion/branches/reuse-ra-session/Makefile.in?rev=1658954&r1=1658953&r2=1658954&view=diff
==============================================================================
--- subversion/branches/reuse-ra-session/Makefile.in (original)
+++ subversion/branches/reuse-ra-session/Makefile.in Wed Feb 11 13:29:26 2015
@@ -837,7 +837,7 @@ $(SWIG_PL_DIR)/native/Makefile.PL: $(SWI
./config.status subversion/bindings/swig/perl/native/Makefile.PL
$(SWIG_PL_DIR)/native/Makefile: $(SWIG_PL_DIR)/native/Makefile.PL
- cd $(SWIG_PL_DIR)/native; $(PERL) Makefile.PL
+ cd $(SWIG_PL_DIR)/native; $(PERL) Makefile.PL PREFIX=$(prefix)
# There is a "readlink -f" command on some systems for the same purpose,
# but it's not as portable (e.g. Mac OS X doesn't have it). These should
Modified: subversion/branches/reuse-ra-session/build.conf
URL: http://svn.apache.org/viewvc/subversion/branches/reuse-ra-session/build.conf?rev=1658954&r1=1658953&r2=1658954&view=diff
==============================================================================
--- subversion/branches/reuse-ra-session/build.conf (original)
+++ subversion/branches/reuse-ra-session/build.conf Wed Feb 11 13:29:26 2015
@@ -56,6 +56,7 @@ private-built-includes =
subversion/libsvn_wc/wc-queries.h
subversion/libsvn_wc/wc-checks.h
subversion/libsvn_subr/internal_statements.h
+ subversion/tests/libsvn_wc/wc-test-queries.h
subversion/bindings/swig/proxy/swig_python_external_runtime.swg
subversion/bindings/swig/proxy/swig_perl_external_runtime.swg
subversion/bindings/swig/proxy/swig_ruby_external_runtime.swg
@@ -380,7 +381,7 @@ msvc-export =
private\svn_utf_private.h private\svn_eol_private.h
private\svn_token.h private\svn_adler32.h
private\svn_temp_serializer.h private\svn_io_private.h
- private\svn_sorts_private.h
+ private\svn_sorts_private.h private\svn_auth_private.h
private\svn_string_private.h private\svn_magic.h
private\svn_subr_private.h private\svn_mutex.h
private\svn_packed_data.h private\svn_object_pool.h private\svn_cert.h
@@ -461,6 +462,12 @@ type = sql-header
path = subversion/libsvn_subr
sources = internal_statements.sql
+[wc_test_queries]
+description = Queries using working copy tests
+type = sql-header
+path = subversion/tests/libsvn_wc
+sources = wc-test-queries.sql
+
# ----------------------------------------------------------------------------
#
# TARGETS FOR I18N SUPPORT
Modified: subversion/branches/reuse-ra-session/build/generator/gen_make.py
URL: http://svn.apache.org/viewvc/subversion/branches/reuse-ra-session/build/generator/gen_make.py?rev=1658954&r1=1658953&r2=1658954&view=diff
==============================================================================
--- subversion/branches/reuse-ra-session/build/generator/gen_make.py (original)
+++ subversion/branches/reuse-ra-session/build/generator/gen_make.py Wed Feb 11 13:29:26 2015
@@ -53,6 +53,12 @@ from gen_base import build_path_join, bu
build_path_basename, build_path_dirname, build_path_retreat, unique
+def _normstr(x):
+ if os.sep == '/':
+ return os.path.normpath(str(x))
+ else:
+ return os.path.normpath(str(x).replace('/', os.sep)).replace(os.sep, '/')
+
class Generator(gen_base.GeneratorBase):
_extension_map = {
@@ -232,6 +238,7 @@ class Generator(gen_base.GeneratorBase):
# get the source items (.o and .la) for the link unit
objects = [ ]
+ objdeps = [ ]
object_srcs = [ ]
headers = [ ]
header_classes = [ ]
@@ -263,6 +270,7 @@ class Generator(gen_base.GeneratorBase):
elif isinstance(link_dep, gen_base.ObjectFile):
# link in the object file
objects.append(link_dep.filename)
+ objdeps.append(_normstr(link_dep.filename))
for dep in self.graph.get_sources(gen_base.DT_OBJECT, link_dep, gen_base.SourceFile):
object_srcs.append(
build_path_join('$(abs_srcdir)', dep.filename))
@@ -291,6 +299,7 @@ class Generator(gen_base.GeneratorBase):
install=None,
add_deps=add_deps,
objects=objects,
+ objdeps=objdeps,
deps=deps,
when=target_ob.when,
)
@@ -467,11 +476,11 @@ class Generator(gen_base.GeneratorBase):
key=lambda t: t[0].filename)
for objname, sources in obj_deps:
- dep = _eztdata(name=str(objname),
+ dep = _eztdata(name=_normstr(objname),
when=objname.when,
- deps=list(map(str, sources)),
+ deps=list(map(_normstr, sources)),
cmd=objname.compile_cmd,
- source=str(sources[0]))
+ source=_normstr(sources[0]))
data.deps.append(dep)
dep.generated = ezt.boolean(getattr(objname, 'source_generated', 0))
Modified: subversion/branches/reuse-ra-session/build/generator/templates/build-outputs.mk.ezt
URL: http://svn.apache.org/viewvc/subversion/branches/reuse-ra-session/build/generator/templates/build-outputs.mk.ezt?rev=1658954&r1=1658953&r2=1658954&view=diff
==============================================================================
--- subversion/branches/reuse-ra-session/build/generator/templates/build-outputs.mk.ezt (original)
+++ subversion/branches/reuse-ra-session/build/generator/templates/build-outputs.mk.ezt Wed Feb 11 13:29:26 2015
@@ -112,7 +112,7 @@ $([target.varname]_OBJECTS): $([target.v
$(JAR) cf [target.jar_path] -C [target.classes][for target.packages] [target.packages][end][end][end]
[else][is target.type "i18n"][target.varname]_DEPS =[for target.add_deps] [target.add_deps][end][for target.objects] [target.objects][end][for target.deps] [target.deps][end]
[target.name]: $([target.varname]_DEPS)
-[else][target.varname]_DEPS =[for target.add_deps] [target.add_deps][end][for target.objects] [target.objects][end][for target.deps] [target.deps][end]
+[else][target.varname]_DEPS =[for target.add_deps] [target.add_deps][end][for target.objdeps] [target.objdeps][end][for target.deps] [target.deps][end]
[target.varname]_OBJECTS =[for target.objnames] [target.objnames][end]
[target.filename]: $([target.varname]_DEPS)
[if-any target.when]if $([target.when]) ; then [else][end]cd [target.path] && [target.link_cmd] $([target.varname]_LDFLAGS) -o [target.basename] [target.undefined_flag] $([target.varname]_OBJECTS)[for target.libs] [target.libs][end] $(LIBS)[if-any target.when] ; else echo "fake" > [target.filename] ; fi[else][end]
Modified: subversion/branches/reuse-ra-session/subversion/bindings/javahl/native/AuthnCallback.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/reuse-ra-session/subversion/bindings/javahl/native/AuthnCallback.cpp?rev=1658954&r1=1658953&r2=1658954&view=diff
==============================================================================
--- subversion/branches/reuse-ra-session/subversion/bindings/javahl/native/AuthnCallback.cpp (original)
+++ subversion/branches/reuse-ra-session/subversion/bindings/javahl/native/AuthnCallback.cpp Wed Feb 11 13:29:26 2015
@@ -242,7 +242,7 @@ AuthnCallback::SSLServerCertInfo::SSLSer
svn_x509_certinfo_get_hostnames(certinfo);
if (hostnames)
{
- ::Java::MutableList< ::Java::String> hn(env, hostnames->nelts);
+ ::Java::List< ::Java::String> hn(env, hostnames->nelts);
for (int i = 0; i < hostnames->nelts; ++i)
hn.add(::Java::String(env, APR_ARRAY_IDX(hostnames, i, const char*)));
jhostnames = hn.get();
Modified: subversion/branches/reuse-ra-session/subversion/bindings/javahl/native/Utility.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/reuse-ra-session/subversion/bindings/javahl/native/Utility.cpp?rev=1658954&r1=1658953&r2=1658954&view=diff
==============================================================================
--- subversion/branches/reuse-ra-session/subversion/bindings/javahl/native/Utility.cpp (original)
+++ subversion/branches/reuse-ra-session/subversion/bindings/javahl/native/Utility.cpp Wed Feb 11 13:29:26 2015
@@ -52,7 +52,10 @@ public:
const char* const safe_key =
apr_pstrmemdup(m_pool, key.c_str(), key.size() + 1);
if (!value.get())
- apr_hash_set(m_hash, safe_key, key.size(), m_default);
+ {
+ if (m_default != NULL)
+ apr_hash_set(m_hash, safe_key, key.size(), m_default);
+ }
else
{
Java::ByteArray::Contents val(value);
@@ -70,20 +73,22 @@ private:
apr_hash_t* const m_hash;
const svn_string_t* const m_default;
};
+
+typedef ::Java::ImmutableMap< ::Java::ByteArray, jbyteArray> ImmutableByteArrayMap;
} // anonymous namespace
apr_hash_t*
make_keyword_hash(::Java::Env env, jobject jkeywords, apr_pool_t* pool)
{
const svn_string_t* const empty = svn_string_create_empty(pool);
- const ::Java::Map< ::Java::ByteArray, jbyteArray> keywords(env, jkeywords);
+ const ImmutableByteArrayMap keywords(env, jkeywords);
return keywords.for_each(MapToHashIteration(empty, pool)).get();
}
apr_hash_t*
make_property_hash(::Java::Env env, jobject jproperties, apr_pool_t* pool)
{
- const ::Java::Map< ::Java::ByteArray, jbyteArray> props(env, jproperties);
+ const ImmutableByteArrayMap props(env, jproperties);
return props.for_each(MapToHashIteration(NULL, pool)).get();
}
Modified: subversion/branches/reuse-ra-session/subversion/bindings/javahl/native/jniwrapper/jni_base.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/reuse-ra-session/subversion/bindings/javahl/native/jniwrapper/jni_base.cpp?rev=1658954&r1=1658953&r2=1658954&view=diff
==============================================================================
--- subversion/branches/reuse-ra-session/subversion/bindings/javahl/native/jniwrapper/jni_base.cpp (original)
+++ subversion/branches/reuse-ra-session/subversion/bindings/javahl/native/jniwrapper/jni_base.cpp Wed Feb 11 13:29:26 2015
@@ -325,6 +325,7 @@ const char* const OutOfMemoryError::m_cl
const char* const IndexOutOfBoundsException::m_class_name =
"java/lang/IndexOutOfBoundsException";
+IndexOutOfBoundsException::ClassImpl::~ClassImpl() {}
const char* const IOException::m_class_name =
"java/io/IOException";
@@ -332,6 +333,10 @@ const char* const IOException::m_class_n
const char* const IllegalArgumentException::m_class_name =
"java/lang/IllegalArgumentException";
+const char *const NoSuchElementException::m_class_name =
+ "java/util/NoSuchElementException";
+NoSuchElementException::ClassImpl::~ClassImpl() {}
+
// Implementation of jni_stack.hpp
void handle_svn_error(Env env, ::svn_error_t* err)
Modified: subversion/branches/reuse-ra-session/subversion/bindings/javahl/native/jniwrapper/jni_class_cache.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/reuse-ra-session/subversion/bindings/javahl/native/jniwrapper/jni_class_cache.cpp?rev=1658954&r1=1658953&r2=1658954&view=diff
==============================================================================
--- subversion/branches/reuse-ra-session/subversion/bindings/javahl/native/jniwrapper/jni_class_cache.cpp (original)
+++ subversion/branches/reuse-ra-session/subversion/bindings/javahl/native/jniwrapper/jni_class_cache.cpp Wed Feb 11 13:29:26 2015
@@ -163,14 +163,20 @@ class ClassCacheImpl
return pimpl; \
}
- JNIWRAPPER_DEFINE_CACHED_CLASS(list, BaseList);
- JNIWRAPPER_DEFINE_CACHED_CLASS(array_list, BaseMutableList);
-
- JNIWRAPPER_DEFINE_CACHED_CLASS(map, BaseMap);
- JNIWRAPPER_DEFINE_CACHED_CLASS(set, BaseMap::Set);
- JNIWRAPPER_DEFINE_CACHED_CLASS(iterator, BaseMap::Iterator);
- JNIWRAPPER_DEFINE_CACHED_CLASS(map_entry, BaseMap::Entry);
- JNIWRAPPER_DEFINE_CACHED_CLASS(hash_map, BaseMutableMap);
+ JNIWRAPPER_DEFINE_CACHED_CLASS(exc_index_out_of_bounds,
+ IndexOutOfBoundsException);
+ JNIWRAPPER_DEFINE_CACHED_CLASS(exc_no_such_element,
+ NoSuchElementException);
+
+ JNIWRAPPER_DEFINE_CACHED_CLASS(iterator, BaseIterator);
+
+ JNIWRAPPER_DEFINE_CACHED_CLASS(list, BaseImmutableList);
+ JNIWRAPPER_DEFINE_CACHED_CLASS(array_list, BaseList);
+
+ JNIWRAPPER_DEFINE_CACHED_CLASS(map, BaseImmutableMap);
+ JNIWRAPPER_DEFINE_CACHED_CLASS(set, BaseImmutableMap::Set);
+ JNIWRAPPER_DEFINE_CACHED_CLASS(map_entry, BaseImmutableMap::Entry);
+ JNIWRAPPER_DEFINE_CACHED_CLASS(hash_map, BaseMap);
JNIWRAPPER_DEFINE_CACHED_CLASS(input_stream, InputStream);
JNIWRAPPER_DEFINE_CACHED_CLASS(output_stream, OutputStream);
@@ -279,6 +285,9 @@ JNIWRAPPER_IMPL_CLASS_CACHE_ACCESSOR(cla
JNIWRAPPER_IMPL_CLASS_CACHE_ACCESSOR(throwable);
JNIWRAPPER_IMPL_CLASS_CACHE_ACCESSOR(string);
+JNIWRAPPER_IMPL_CLASS_CACHE_ACCESSOR(exc_index_out_of_bounds);
+JNIWRAPPER_IMPL_CLASS_CACHE_ACCESSOR(exc_no_such_element);
+
JNIWRAPPER_IMPL_CLASS_CACHE_ACCESSOR(list);
JNIWRAPPER_IMPL_CLASS_CACHE_ACCESSOR(array_list);
Modified: subversion/branches/reuse-ra-session/subversion/bindings/javahl/native/jniwrapper/jni_exception.hpp
URL: http://svn.apache.org/viewvc/subversion/branches/reuse-ra-session/subversion/bindings/javahl/native/jniwrapper/jni_exception.hpp?rev=1658954&r1=1658953&r2=1658954&view=diff
==============================================================================
--- subversion/branches/reuse-ra-session/subversion/bindings/javahl/native/jniwrapper/jni_exception.hpp (original)
+++ subversion/branches/reuse-ra-session/subversion/bindings/javahl/native/jniwrapper/jni_exception.hpp Wed Feb 11 13:29:26 2015
@@ -264,6 +264,23 @@ public:
{}
private:
+ /**
+ * This object's implementation details.
+ */
+ class ClassImpl : public Object::ClassImpl
+ {
+ friend class ClassCacheImpl;
+
+ protected:
+ explicit ClassImpl(Env env, jclass cls)
+ : Object::ClassImpl(env, cls)
+ {}
+
+ public:
+ virtual ~ClassImpl();
+ };
+
+ friend class ClassCacheImpl;
static const char* const m_class_name;
};
@@ -305,6 +322,43 @@ private:
static const char* const m_class_name;
};
+/**
+ * Generator class for exceptions of type
+ * @c java.util.NoSuchElementException.
+ *
+ * @since New in 1.9.
+ */
+class NoSuchElementException : public Exception
+{
+public:
+ /**
+ * Constructs an exception generator object.
+ */
+ explicit NoSuchElementException(Env env)
+ : Exception(env, m_class_name)
+ {}
+
+private:
+ /**
+ * This object's implementation details.
+ */
+ class ClassImpl : public Object::ClassImpl
+ {
+ friend class ClassCacheImpl;
+
+ protected:
+ explicit ClassImpl(Env env, jclass cls)
+ : Object::ClassImpl(env, cls)
+ {}
+
+ public:
+ virtual ~ClassImpl();
+ };
+
+ friend class ClassCacheImpl;
+ static const char* const m_class_name;
+};
+
} // namespace Java
-#endif // SVN_JAVAHL_JNIWRAPPER_ENV_HPP
+#endif // SVN_JAVAHL_JNIWRAPPER_EXCEPTION_HPP
Modified: subversion/branches/reuse-ra-session/subversion/bindings/javahl/native/jniwrapper/jni_list.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/reuse-ra-session/subversion/bindings/javahl/native/jniwrapper/jni_list.cpp?rev=1658954&r1=1658953&r2=1658954&view=diff
==============================================================================
--- subversion/branches/reuse-ra-session/subversion/bindings/javahl/native/jniwrapper/jni_list.cpp (original)
+++ subversion/branches/reuse-ra-session/subversion/bindings/javahl/native/jniwrapper/jni_list.cpp Wed Feb 11 13:29:26 2015
@@ -21,54 +21,65 @@
* @endcopyright
*/
+#include <stdexcept>
+#include <string>
+
#include "jni_list.hpp"
+#include "svn_private_config.h"
+
namespace Java {
-// Class Java::BaseList
+// Class Java::BaseImmutableList
-const char* const BaseList::m_class_name = "java/util/List";
+const char* const BaseImmutableList::m_class_name = "java/util/List";
-BaseList::ClassImpl::ClassImpl(Env env, jclass cls)
+BaseImmutableList::ClassImpl::ClassImpl(Env env, jclass cls)
: Object::ClassImpl(env, cls),
m_mid_size(env.GetMethodID(cls, "size", "()I")),
- m_mid_get(env.GetMethodID(cls, "get", "(I)Ljava/lang/Object;"))
+ m_mid_get(env.GetMethodID(cls, "get", "(I)Ljava/lang/Object;")),
+ m_mid_add(env.GetMethodID(cls, "add", "(Ljava/lang/Object;)Z")),
+ m_mid_clear(env.GetMethodID(cls, "clear", "()V")),
+ m_mid_iter(env.GetMethodID(cls, "listIterator", "()Ljava/util/ListIterator;"))
{}
-BaseList::ClassImpl::~ClassImpl() {}
+BaseImmutableList::ClassImpl::~ClassImpl() {}
-BaseList::ovector
-BaseList::convert_to_vector(Env env, jobject jlist)
+jobject BaseImmutableList::operator[](jint index) const
{
- const ClassImpl* pimpl =
- dynamic_cast<const ClassImpl*>(ClassCache::get_list(env));
- const jint length = env.CallIntMethod(jlist, pimpl->m_mid_size);
-
- if (!length)
- return ovector();
-
- ovector contents(length);
- ovector::iterator it;
- jint i;
- for (i = 0, it = contents.begin(); it != contents.end(); ++it, ++i)
- *it = env.CallObjectMethod(jlist, pimpl->m_mid_get, i);
- return contents;
+ try
+ {
+ return m_env.CallObjectMethod(m_jthis, impl().m_mid_get, index);
+ }
+ catch (const SignalExceptionThrown&)
+ {
+ // Just rethrow if it's not an IndexOutOfBoundsException.
+ if (!m_env.IsInstanceOf(
+ m_env.ExceptionOccurred(),
+ ClassCache::get_exc_index_out_of_bounds(m_env)->get_class()))
+ throw;
+
+ m_env.ExceptionClear();
+ std::string msg(_("List index out of bounds: "));
+ msg += index;
+ throw std::out_of_range(msg.c_str());
+ }
}
+BaseImmutableList::Iterator BaseImmutableList::get_iterator() const
+{
+ return Iterator(m_env, m_env.CallObjectMethod(m_jthis, impl().m_mid_iter));
+}
-// Class Java::BaseMutableList
+// Class Java::BaseList
-const char* const BaseMutableList::m_class_name = "java/util/ArrayList";
+const char* const BaseList::m_class_name = "java/util/ArrayList";
-BaseMutableList::ClassImpl::ClassImpl(Env env, jclass cls)
- : Object::ClassImpl(env, cls),
- m_mid_ctor(env.GetMethodID(cls, "<init>", "(I)V")),
- m_mid_add(env.GetMethodID(cls, "add", "(Ljava/lang/Object;)Z")),
- m_mid_clear(env.GetMethodID(cls, "clear", "()V")),
- m_mid_get(env.GetMethodID(cls, "get", "(I)Ljava/lang/Object;")),
- m_mid_size(env.GetMethodID(cls, "size", "()I"))
+BaseList::ClassImpl::ClassImpl(Env env, jclass cls)
+ : BaseImmutableList::ClassImpl(env, cls),
+ m_mid_ctor(env.GetMethodID(cls, "<init>", "(I)V"))
{}
-BaseMutableList::ClassImpl::~ClassImpl() {}
+BaseList::ClassImpl::~ClassImpl() {}
} // namespace Java
Modified: subversion/branches/reuse-ra-session/subversion/bindings/javahl/native/jniwrapper/jni_list.hpp
URL: http://svn.apache.org/viewvc/subversion/branches/reuse-ra-session/subversion/bindings/javahl/native/jniwrapper/jni_list.hpp?rev=1658954&r1=1658953&r2=1658954&view=diff
==============================================================================
--- subversion/branches/reuse-ra-session/subversion/bindings/javahl/native/jniwrapper/jni_list.hpp (original)
+++ subversion/branches/reuse-ra-session/subversion/bindings/javahl/native/jniwrapper/jni_list.hpp Wed Feb 11 13:29:26 2015
@@ -24,56 +24,89 @@
#ifndef SVN_JAVAHL_JNIWRAPPER_LIST_HPP
#define SVN_JAVAHL_JNIWRAPPER_LIST_HPP
-#include <algorithm>
-#include <vector>
-
#include "jni_env.hpp"
#include "jni_object.hpp"
+#include "jni_iterator.hpp"
namespace Java {
/**
* Non-template base for an immutable type-safe Java list.
*
- * Converts the list to a @c std::vector of @c jobject references.
- *
* @since New in 1.9.
*/
-class BaseList : public Object
+class BaseImmutableList : public Object
{
- typedef std::vector<jobject> ovector;
-
public:
/**
* Returns the number of elements in the list.
*/
jint length() const
{
- return jint(m_contents.size());
+ return m_env.CallIntMethod(m_jthis, impl().m_mid_size);
+ }
+
+ /**
+ * Checks if the list is empty.
+ */
+ bool is_empty() const
+ {
+ return (length() == 0);
}
protected:
/**
- * Constructs the list wrapper, converting the contents to an
- * @c std::vector.
+ * Constructs the list wrapper
*/
- explicit BaseList(Env env, jobject jlist)
- : Object(env, ClassCache::get_list(env), jlist),
- m_contents(convert_to_vector(env, m_jthis))
+ explicit BaseImmutableList(Env env, jobject jlist)
+ : Object(env, ClassCache::get_list(env), jlist)
{}
/**
- * Returns the object reference at @a index.
- * @throw std::out_of_range if the index value is not valid.
+ * Constructor used by BaseList
*/
- jobject operator[](jint index) const
+ explicit BaseImmutableList(Env env, const Object::ClassImpl* pimpl)
+ : Object(env, pimpl)
+ {}
+
+ /**
+ * Clears the contents of the list.
+ */
+ void clear()
{
- return m_contents[ovector::size_type(index)];
+ m_env.CallVoidMethod(m_jthis, impl().m_mid_clear);
}
- const ovector m_contents;
+ /**
+ * Appends @a obj to the end of the list.
+ */
+ void add(jobject obj)
+ {
+ m_env.CallVoidMethod(m_jthis, impl().m_mid_add, obj);
+ }
+
+ /**
+ * Returns the object reference at @a index.
+ * @throw std::out_of_range if the index value is not valid.
+ */
+ jobject operator[](jint index) const;
+
+ /**
+ * Iterator used by subclasses.
+ */
+ class Iterator : public BaseIterator
+ {
+ friend class BaseImmutableList;
+ explicit Iterator(Env env, jobject jiterator)
+ : BaseIterator(env, jiterator)
+ {}
+ };
+
+ /**
+ * Returns an iterator instance.
+ */
+ Iterator get_iterator() const;
-private:
/**
* This object's implementation details.
*/
@@ -89,11 +122,15 @@ private:
const MethodID m_mid_size;
const MethodID m_mid_get;
+ const MethodID m_mid_add;
+ const MethodID m_mid_clear;
+ const MethodID m_mid_iter;
};
+private:
+ friend class Iterator;
friend class ClassCacheImpl;
static const char* const m_class_name;
- static ovector convert_to_vector(Env env, jobject jlist);
const ClassImpl& impl() const
{
@@ -107,15 +144,14 @@ private:
* @since New in 1.9.
*/
template <typename T, typename NativeT=jobject>
-class List : public BaseList
+class ImmutableList : public BaseImmutableList
{
public:
/**
- * Constructs the list wrapper, converting the contents to an
- * @c std::vector.
+ * Constructs the list wrapper.
*/
- explicit List(Env env, jobject jlist)
- : BaseList(env, jlist)
+ explicit ImmutableList(Env env, jobject jlist)
+ : BaseImmutableList(env, jlist)
{}
/**
@@ -124,7 +160,7 @@ public:
*/
T operator[](jint index) const
{
- return T(m_env, NativeT(BaseList::operator[](index)));
+ return T(m_env, NativeT(BaseImmutableList::operator[](index)));
}
/**
@@ -135,29 +171,11 @@ public:
template<typename F>
F for_each(F function) const
{
- const FunctorAdapter<F> adapter(m_env, function);
- std::for_each(m_contents.begin(), m_contents.end(), adapter);
+ Iterator iter(get_iterator());
+ while (iter.has_next())
+ function(T(m_env, NativeT(iter.next())));
return function;
}
-
-private:
- template<typename F>
- struct FunctorAdapter
- {
- explicit FunctorAdapter(const Env& env, F& function)
- : m_env(env),
- m_function(function)
- {}
-
- void operator()(const jobject& obj) const
- {
- const T item(m_env, NativeT(obj));
- m_function(item);
- }
-
- const Env& m_env;
- F& m_function;
- };
};
/**
@@ -165,7 +183,7 @@ private:
*
* @since New in 1.9.
*/
-class BaseMutableList : public Object
+class BaseList : public BaseImmutableList
{
public:
/**
@@ -173,66 +191,40 @@ public:
*/
void clear()
{
- m_env.CallVoidMethod(m_jthis, impl().m_mid_clear);
- }
-
- /**
- * Returns the number of elements in the list.
- */
- jint length() const
- {
- return m_env.CallIntMethod(m_jthis, impl().m_mid_size);
- }
-
- /**
- * Checks if the list is empty.
- */
- bool is_empty() const
- {
- return (length() == 0);
+ BaseImmutableList::clear();
}
protected:
/**
- * Constructs the list wrapper, deriving the class from @a jlist.
+ * Constructs the list wrapper, treating @a jlist as a @c java.util.List.
*/
- explicit BaseMutableList(Env env, jobject jlist)
- : Object(env, ClassCache::get_array_list(env), jlist)
+ explicit BaseList(Env env, jobject jlist)
+ : BaseImmutableList(env, jlist)
{}
/**
* Constructs and wraps an empty list of type @c java.util.ArrayList
* with initial allocation size @a length.
*/
- explicit BaseMutableList(Env env, jint length)
- : Object(env, ClassCache::get_array_list(env))
+ explicit BaseList(Env env, jint length)
+ : BaseImmutableList(env, ClassCache::get_array_list(env))
{
set_this(env.NewObject(get_class(), impl().m_mid_ctor, length));
}
-
/**
* Appends @a obj to the end of the list.
*/
void add(jobject obj)
{
- m_env.CallBooleanMethod(m_jthis, impl().m_mid_add, obj);
- }
-
- /**
- * Returns the object reference at @a index.
- * @note Throws a Java exception if the index value is not valid.
- */
- jobject operator[](jint index) const
- {
- return m_env.CallObjectMethod(m_jthis, impl().m_mid_get, index);
+ BaseImmutableList::add(obj);
}
private:
/**
* This object's implementation details.
*/
- class ClassImpl : public Object::ClassImpl
+ class ClassImpl : public BaseImmutableList::ClassImpl
{
friend class ClassCacheImpl;
@@ -243,10 +235,6 @@ private:
virtual ~ClassImpl();
const MethodID m_mid_ctor;
- const MethodID m_mid_add;
- const MethodID m_mid_clear;
- const MethodID m_mid_get;
- const MethodID m_mid_size;
};
friend class ClassCacheImpl;
@@ -264,39 +252,53 @@ private:
* @since New in 1.9.
*/
template <typename T, typename NativeT=jobject>
-class MutableList : public BaseMutableList
+class List : public BaseList
{
public:
/**
* Constructs the list wrapper, deriving the class from @a jlist.
*/
- explicit MutableList(Env env, jobject jlist)
- : BaseMutableList(env, jlist)
+ explicit List(Env env, jobject jlist)
+ : BaseList(env, jlist)
{}
/**
* Constructs and wraps an empty list of type @c java.util.ArrayList
* with initial allocation size @a length.
*/
- explicit MutableList(Env env, jint length_ = 0)
- : BaseMutableList(env, length_)
+ explicit List(Env env, jint length_ = 0)
+ : BaseList(env, length_)
{}
/**
+ * Returns a wrapper object for the object reference at @a index.
+ * @throw std::out_of_range if the index value is not valid.
+ */
+ T operator[](jint index) const
+ {
+ return T(m_env, NativeT(BaseList::operator[](index)));
+ }
+
+ /**
* Appends @a obj to the end of the list.
*/
void add(const T& obj)
{
- BaseMutableList::add(obj.get());
+ BaseList::add(obj.get());
}
/**
- * Returns a wrapper object for the object reference at @a index.
- * @note Throws a Java exception if the index value is not valid.
+ * Iterates over the items in the list, calling @a function for
+ * each item.
+ * @see std::for_each
*/
- T operator[](jint index) const
+ template<typename F>
+ F for_each(F function) const
{
- return T(m_env, NativeT(BaseMutableList::operator[](index)));
+ Iterator iter(get_iterator());
+ while (iter.has_next())
+ function(T(m_env, NativeT(iter.next())));
+ return function;
}
};
Modified: subversion/branches/reuse-ra-session/subversion/bindings/javahl/native/jniwrapper/jni_object.hpp
URL: http://svn.apache.org/viewvc/subversion/branches/reuse-ra-session/subversion/bindings/javahl/native/jniwrapper/jni_object.hpp?rev=1658954&r1=1658953&r2=1658954&view=diff
==============================================================================
--- subversion/branches/reuse-ra-session/subversion/bindings/javahl/native/jniwrapper/jni_object.hpp (original)
+++ subversion/branches/reuse-ra-session/subversion/bindings/javahl/native/jniwrapper/jni_object.hpp Wed Feb 11 13:29:26 2015
@@ -171,6 +171,9 @@ public:
JNIWRAPPER_DECLARE_CACHED_CLASS_ACCESSOR(throwable);
JNIWRAPPER_DECLARE_CACHED_CLASS_ACCESSOR(string);
+ JNIWRAPPER_DECLARE_CACHED_CLASS_ACCESSOR(exc_index_out_of_bounds);
+ JNIWRAPPER_DECLARE_CACHED_CLASS_ACCESSOR(exc_no_such_element);
+
JNIWRAPPER_DECLARE_CACHED_CLASS_ACCESSOR(list);
JNIWRAPPER_DECLARE_CACHED_CLASS_ACCESSOR(array_list);
Modified: subversion/branches/reuse-ra-session/subversion/bindings/javahl/native/jniwrapper/jni_string_map.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/reuse-ra-session/subversion/bindings/javahl/native/jniwrapper/jni_string_map.cpp?rev=1658954&r1=1658953&r2=1658954&view=diff
==============================================================================
--- subversion/branches/reuse-ra-session/subversion/bindings/javahl/native/jniwrapper/jni_string_map.cpp (original)
+++ subversion/branches/reuse-ra-session/subversion/bindings/javahl/native/jniwrapper/jni_string_map.cpp Wed Feb 11 13:29:26 2015
@@ -30,123 +30,81 @@
namespace Java {
-// Class Java::BaseMap
+// Class Java::BaseImmutableMap
-const char* const BaseMap::m_class_name = "java/util/Map";
+const char* const BaseImmutableMap::m_class_name = "java/util/Map";
-BaseMap::ClassImpl::ClassImpl(Env env, jclass cls)
+BaseImmutableMap::ClassImpl::ClassImpl(Env env, jclass cls)
: Object::ClassImpl(env, cls),
+ m_mid_put(env.GetMethodID(cls, "put",
+ "(Ljava/lang/Object;Ljava/lang/Object;)"
+ "Ljava/lang/Object;")),
+ m_mid_clear(env.GetMethodID(cls, "clear", "()V")),
+ m_mid_has_key(env.GetMethodID(cls, "containsKey",
+ "(Ljava/lang/Object;)Z")),
+ m_mid_get(env.GetMethodID(cls, "get",
+ "(Ljava/lang/Object;)Ljava/lang/Object;")),
m_mid_size(env.GetMethodID(cls, "size", "()I")),
m_mid_entry_set(env.GetMethodID(cls, "entrySet", "()Ljava/util/Set;"))
{}
-BaseMap::ClassImpl::~ClassImpl() {}
-
-const char* const BaseMap::Set::m_class_name = "java/util/Set";
-
-BaseMap::Set::ClassImpl::ClassImpl(Env env, jclass cls)
- : Object::ClassImpl(env, cls),
- m_mid_iterator(env.GetMethodID(cls, "iterator",
- "()Ljava/util/Iterator;"))
-{}
-
-BaseMap::Set::ClassImpl::~ClassImpl() {}
+BaseImmutableMap::ClassImpl::~ClassImpl() {}
-const char* const BaseMap::Iterator::m_class_name = "java/util/Iterator";
+jobject BaseImmutableMap::operator[](const std::string& index) const
+{
+ const String key(m_env, index);
+ if (!m_env.CallBooleanMethod(m_jthis, impl().m_mid_has_key, key.get()))
+ {
+ std::string msg(_("Map does not contain key: "));
+ msg += index;
+ throw std::out_of_range(msg.c_str());
+ }
+ return m_env.CallObjectMethod(m_jthis, impl().m_mid_get, key.get());
+}
-BaseMap::Iterator::ClassImpl::ClassImpl(Env env, jclass cls)
- : Object::ClassImpl(env, cls),
- m_mid_has_next(env.GetMethodID(cls, "hasNext", "()Z")),
- m_mid_next(env.GetMethodID(cls, "next", "()Ljava/lang/Object;"))
-{}
+BaseImmutableMap::Iterator BaseImmutableMap::get_iterator() const
+{
+ const jobject jentry_set =
+ m_env.CallObjectMethod(m_jthis, impl().m_mid_entry_set);
+ const jobject jiterator =
+ m_env.CallObjectMethod(jentry_set, Set::impl(m_env).m_mid_iterator);
+ return Iterator(m_env, jiterator);
+}
-BaseMap::Iterator::ClassImpl::~ClassImpl() {}
+// Class Java::BaseImmutableMap::Entry
-const char* const BaseMap::Entry::m_class_name = "java/util/Map$Entry";
+const char* const BaseImmutableMap::Entry::m_class_name = "java/util/Map$Entry";
-BaseMap::Entry::ClassImpl::ClassImpl(Env env, jclass cls)
+BaseImmutableMap::Entry::ClassImpl::ClassImpl(Env env, jclass cls)
: Object::ClassImpl(env, cls),
m_mid_get_key(env.GetMethodID(cls, "getKey", "()Ljava/lang/Object;")),
m_mid_get_value(env.GetMethodID(cls, "getValue", "()Ljava/lang/Object;"))
{}
-BaseMap::Entry::ClassImpl::~ClassImpl() {}
+BaseImmutableMap::Entry::ClassImpl::~ClassImpl() {}
+// Class Java::BaseImmutableMap::Set
-jobject BaseMap::operator[](const std::string& index) const
-{
- somap::const_iterator it = m_contents.find(index);
- if (it == m_contents.end())
- {
- std::string msg(_("Map does not contain key: "));
- msg += index;
- throw std::out_of_range(msg.c_str());
- }
- return it->second;
-}
+const char* const BaseImmutableMap::Set::m_class_name = "java/util/Set";
-BaseMap::somap BaseMap::convert_to_map(Env env, jobject jmap)
-{
- const ClassImpl* pimpl =
- dynamic_cast<const ClassImpl*>(ClassCache::get_map(env));
+BaseImmutableMap::Set::ClassImpl::ClassImpl(Env env, jclass cls)
+ : Object::ClassImpl(env, cls),
+ m_mid_iterator(env.GetMethodID(cls, "iterator",
+ "()Ljava/util/Iterator;"))
+{}
- if (!env.CallIntMethod(jmap, pimpl->m_mid_size))
- return somap();
+BaseImmutableMap::Set::ClassImpl::~ClassImpl() {}
- // Get an iterator over the map's entry set
- const jobject entries = env.CallObjectMethod(jmap, pimpl->m_mid_entry_set);
- const jobject iterator = env.CallObjectMethod(entries,
- Set::impl(env).m_mid_iterator);
-
- const Iterator::ClassImpl& iterimpl = Iterator::impl(env);
- const Entry::ClassImpl& entimpl = Entry::impl(env);
-
- // Yterate over the map, filling the native map
- somap contents;
- while (env.CallBooleanMethod(iterator, iterimpl.m_mid_has_next))
- {
- const jobject entry =
- env.CallObjectMethod(iterator, iterimpl.m_mid_next);
- const String keystr(
- env, jstring(env.CallObjectMethod(entry, entimpl.m_mid_get_key)));
- const jobject value(
- env.CallObjectMethod(entry, entimpl.m_mid_get_value));
- const String::Contents key(keystr);
- contents.insert(somap::value_type(key.c_str(), value));
- }
- return contents;
-}
-// Class Java::BaseMutableMap
+// Class Java::BaseMap
-const char* const BaseMutableMap::m_class_name = "java/util/HashMap";
+const char* const BaseMap::m_class_name = "java/util/HashMap";
-BaseMutableMap::ClassImpl::ClassImpl(Env env, jclass cls)
- : Object::ClassImpl(env, cls),
- m_mid_ctor(env.GetMethodID(cls, "<init>", "(I)V")),
- m_mid_put(env.GetMethodID(cls, "put",
- "(Ljava/lang/Object;Ljava/lang/Object;)"
- "Ljava/lang/Object;")),
- m_mid_clear(env.GetMethodID(cls, "clear", "()V")),
- m_mid_has_key(env.GetMethodID(cls, "containsKey",
- "(Ljava/lang/Object;)Z")),
- m_mid_get(env.GetMethodID(cls, "get",
- "(Ljava/lang/Object;)Ljava/lang/Object;")),
- m_mid_size(env.GetMethodID(cls, "size", "()I"))
+BaseMap::ClassImpl::ClassImpl(Env env, jclass cls)
+ : BaseImmutableMap::ClassImpl(env, cls),
+ m_mid_ctor(env.GetMethodID(cls, "<init>", "(I)V"))
{}
-BaseMutableMap::ClassImpl::~ClassImpl() {}
-
-jobject BaseMutableMap::operator[](const std::string& index) const
-{
- const String key(m_env, index);
- if (!m_env.CallBooleanMethod(m_jthis, impl().m_mid_has_key, key.get()))
- {
- std::string msg(_("Map does not contain key: "));
- msg += index;
- throw std::out_of_range(msg.c_str());
- }
- return m_env.CallObjectMethod(m_jthis, impl().m_mid_get, key.get());
-}
+BaseMap::ClassImpl::~ClassImpl() {}
} // namespace Java
Modified: subversion/branches/reuse-ra-session/subversion/bindings/javahl/native/jniwrapper/jni_string_map.hpp
URL: http://svn.apache.org/viewvc/subversion/branches/reuse-ra-session/subversion/bindings/javahl/native/jniwrapper/jni_string_map.hpp?rev=1658954&r1=1658953&r2=1658954&view=diff
==============================================================================
--- subversion/branches/reuse-ra-session/subversion/bindings/javahl/native/jniwrapper/jni_string_map.hpp (original)
+++ subversion/branches/reuse-ra-session/subversion/bindings/javahl/native/jniwrapper/jni_string_map.hpp Wed Feb 11 13:29:26 2015
@@ -24,54 +24,76 @@
#ifndef SVN_JAVAHL_JNIWRAPPER_STRING_MAP_HPP
#define SVN_JAVAHL_JNIWRAPPER_STRING_MAP_HPP
-#include <map>
#include <string>
-#include <algorithm>
#include "jni_env.hpp"
#include "jni_object.hpp"
+#include "jni_iterator.hpp"
namespace Java {
/**
* Non-template base for an immutable type-safe Java map with String keys.
*
- * Converts the map to a @c std::map containing @c jobject references.
- *
* @since New in 1.9.
*/
-class BaseMap : public Object
+class BaseImmutableMap : public Object
{
- typedef std::map<std::string, jobject> somap;
-
public:
/**
* Returns the number of elements in the map.
*/
jint length() const
{
- return jint(m_contents.size());
+ return m_env.CallIntMethod(m_jthis, impl().m_mid_size);
+ }
+
+ /**
+ * Checks if the map is empty.
+ */
+ bool is_empty() const
+ {
+ return (length() == 0);
}
protected:
/**
- * Constructs the map wrapper, converting the contents to an
- * @c std::map.
+ * Constructs the map wrapper.
*/
- explicit BaseMap(Env env, jobject jmap)
- : Object(env, ClassCache::get_map(env), jmap),
- m_contents(convert_to_map(env, m_jthis))
+ explicit BaseImmutableMap(Env env, jobject jmap)
+ : Object(env, ClassCache::get_map(env), jmap)
{}
/**
+ * Constructor used by BaseMap.
+ */
+ explicit BaseImmutableMap(Env env, const Object::ClassImpl* pimpl)
+ : Object(env, pimpl)
+ {}
+
+ /**
+ * Clears the contents of the map.
+ */
+ void clear()
+ {
+ m_env.CallVoidMethod(m_jthis, impl().m_mid_clear);
+ }
+
+ /**
+ * Inserts @a obj identified by @a key into the map.
+ */
+ void put(const std::string& key, jobject obj)
+ {
+ m_env.CallObjectMethod(m_jthis, impl().m_mid_put,
+ String(m_env, key).get(), obj);
+ }
+
+ /**
* Returns the object reference identified by @a index.
* @throw std::out_of_range if there is no such element.
*/
jobject operator[](const std::string& index) const;
- const somap m_contents;
-
-private:
/**
* This object's implementation details.
*/
@@ -85,6 +107,10 @@ private:
public:
virtual ~ClassImpl();
+ const MethodID m_mid_put;
+ const MethodID m_mid_clear;
+ const MethodID m_mid_has_key;
+ const MethodID m_mid_get;
const MethodID m_mid_size;
const MethodID m_mid_entry_set;
};
@@ -96,35 +122,38 @@ private:
friend class ClassCacheImpl;
static const char* const m_class_name;
- static somap convert_to_map(Env env, jobject jmap);
- struct Set
+ class Iterator : public BaseIterator
{
- /**
- * This object's implementation details.
- */
- class ClassImpl : public Object::ClassImpl
- {
- friend class ClassCacheImpl;
+ friend class BaseImmutableMap;
+ explicit Iterator(Env env, jobject jiterator)
+ : BaseIterator(env, jiterator)
+ {}
+ };
- protected:
- explicit ClassImpl(Env env, jclass cls);
+ Iterator get_iterator() const;
- public:
- virtual ~ClassImpl();
+ class Entry : public Object
+ {
+ public:
+ explicit Entry(Env env, jobject jentry)
+ : Object(env, ClassCache::get_map_entry(env), jentry)
+ {}
- const MethodID m_mid_iterator;
- };
+ const std::string key() const
+ {
+ const jstring jkey =
+ jstring(m_env.CallObjectMethod(m_jthis, impl().m_mid_get_key));
+ const String::Contents key(String(m_env, jkey));
+ return std::string(key.c_str());
+ }
- static const char* const m_class_name;
- static const ClassImpl& impl(Env env)
+ jobject value() const
{
- return *dynamic_cast<const ClassImpl*>(ClassCache::get_set(env));
+ return m_env.CallObjectMethod(m_jthis, impl().m_mid_get_value);
}
- };
- struct Iterator
- {
+ private:
/**
* This object's implementation details.
*/
@@ -138,18 +167,20 @@ private:
public:
virtual ~ClassImpl();
- const MethodID m_mid_has_next;
- const MethodID m_mid_next;
+ const MethodID m_mid_get_key;
+ const MethodID m_mid_get_value;
};
+ friend class ClassCacheImpl;
static const char* const m_class_name;
- static const ClassImpl& impl(Env env)
+ const ClassImpl& impl() const
{
- return *dynamic_cast<const ClassImpl*>(ClassCache::get_iterator(env));
+ return *dynamic_cast<const ClassImpl*>(m_impl);
}
};
- struct Entry
+private:
+ struct Set
{
/**
* This object's implementation details.
@@ -164,14 +195,13 @@ private:
public:
virtual ~ClassImpl();
- const MethodID m_mid_get_key;
- const MethodID m_mid_get_value;
+ const MethodID m_mid_iterator;
};
static const char* const m_class_name;
static const ClassImpl& impl(Env env)
{
- return *dynamic_cast<const ClassImpl*>(ClassCache::get_map_entry(env));
+ return *dynamic_cast<const ClassImpl*>(ClassCache::get_set(env));
}
};
};
@@ -182,15 +212,15 @@ private:
* @since New in 1.9.
*/
template <typename T, typename NativeT=jobject>
-class Map : public BaseMap
+class ImmutableMap : public BaseImmutableMap
{
public:
/**
* Constructs the map wrapper, converting the contents to an
* @c std::map.
*/
- explicit Map(Env env, jobject jmap)
- : BaseMap(env, jmap)
+ explicit ImmutableMap(Env env, jobject jmap)
+ : BaseImmutableMap(env, jmap)
{}
/**
@@ -199,7 +229,7 @@ public:
*/
T operator[](const std::string& index) const
{
- return T(m_env, NativeT(BaseMap::operator[](index)));
+ return T(m_env, NativeT(BaseImmutableMap::operator[](index)));
}
/**
@@ -207,37 +237,22 @@ public:
* each item.
* @see std::for_each
* @note Unlike std::for_each, which invokes the functor with a
- * single @c value_type argument, this iterator adapts it to cal
- * @a function with separate @c const references to the key and
- * value.
+ * single @c value_type argument, this iterator calls
+ * @a function with separate @c const references to the key
+ * and value.
*/
template<typename F>
F for_each(F function) const
{
- const FunctorAdapter<F> adapter(m_env, function);
- std::for_each(m_contents.begin(), m_contents.end(), adapter);
+ Iterator iter(get_iterator());
+ while (iter.has_next())
+ {
+ Entry entry(m_env, iter.next());
+ const std::string& key(entry.key());
+ function(key, T(m_env, NativeT(entry.value())));
+ }
return function;
}
-
-private:
- template<typename F>
- struct FunctorAdapter
- {
- explicit FunctorAdapter(const Env& env, F& function)
- : m_env(env),
- m_function(function)
- {}
-
- void operator()(const std::pair<std::string, jobject>& item) const
- {
- const std::string& key(item.first);
- const T value(m_env, NativeT(item.second));
- m_function(key, value);
- }
-
- const Env& m_env;
- F& m_function;
- };
};
/**
@@ -245,7 +260,7 @@ private:
*
* @since New in 1.9.
*/
-class BaseMutableMap : public Object
+class BaseMap : public BaseImmutableMap
{
public:
/**
@@ -253,64 +268,32 @@ public:
*/
void clear()
{
- m_env.CallVoidMethod(m_jthis, impl().m_mid_clear);
- }
-
- /**
- * Returns the number of elements in the map.
- */
- jint length() const
- {
- return m_env.CallIntMethod(m_jthis, impl().m_mid_size);
- }
-
- /**
- * Checks if the map is empty.
- */
- bool is_empty() const
- {
- return (length() == 0);
+ BaseImmutableMap::clear();
}
protected:
/**
- * Constructs the map wrapper, deriving the class from @a jmap.
+ * Constructs the map wrapper, treating @a jmap as a @c java.util.Map.
*/
- explicit BaseMutableMap(Env env, jobject jmap)
- : Object(env, ClassCache::get_hash_map(env), jmap)
+ explicit BaseMap(Env env, jobject jmap)
+ : BaseImmutableMap(env, jmap)
{}
/**
* Constructs and wraps an empty map of type @c java.util.HashMap
* with initial allocation size @a length.
*/
- explicit BaseMutableMap(Env env, jint length)
- : Object(env, ClassCache::get_hash_map(env))
+ explicit BaseMap(Env env, jint length)
+ : BaseImmutableMap(env, ClassCache::get_hash_map(env))
{
set_this(env.NewObject(get_class(), impl().m_mid_ctor, length));
}
-
- /**
- * Inserts @a obj identified by @a key into the map.
- */
- void put(const std::string& key, jobject obj)
- {
- m_env.CallObjectMethod(m_jthis, impl().m_mid_put,
- String(m_env, key).get(), obj);
- }
-
- /**
- * Returns the object reference identified by @a index.
- * @throw std::out_of_range if there is no such element.
- */
- jobject operator[](const std::string& index) const;
-
private:
/**
* This object's implementation details.
*/
- class ClassImpl : public Object::ClassImpl
+ class ClassImpl : public BaseImmutableMap::ClassImpl
{
friend class ClassCacheImpl;
@@ -321,11 +304,6 @@ private:
virtual ~ClassImpl();
const MethodID m_mid_ctor;
- const MethodID m_mid_put;
- const MethodID m_mid_clear;
- const MethodID m_mid_has_key;
- const MethodID m_mid_get;
- const MethodID m_mid_size;
};
const ClassImpl& impl() const
@@ -343,22 +321,22 @@ private:
* @since New in 1.9.
*/
template <typename T, typename NativeT=jobject>
-class MutableMap : public BaseMutableMap
+class Map : public BaseMap
{
public:
/**
* Constructs the map wrapper, deriving the class from @a jmap.
*/
- explicit MutableMap(Env env, jobject jmap)
- : BaseMutableMap(env, jmap)
+ explicit Map(Env env, jobject jmap)
+ : BaseMap(env, jmap)
{}
/**
* Constructs and wraps an empty map of type @c java.util.HashMap
* with initial allocation size @a length.
*/
- explicit MutableMap(Env env, jint length = 0)
- : BaseMutableMap(env, length)
+ explicit Map(Env env, jint length = 0)
+ : BaseMap(env, length)
{}
/**
@@ -366,7 +344,7 @@ public:
*/
void put(const std::string& key, const T& obj)
{
- BaseMutableMap::put(key, obj.get());
+ BaseMap::put(key, obj.get());
}
/**
@@ -375,7 +353,29 @@ public:
*/
T operator[](const std::string& index) const
{
- return T(m_env, NativeT(BaseMutableMap::operator[](index)));
+ return T(m_env, NativeT(BaseMap::operator[](index)));
+ }
+
+ /**
+ * Iterates over the items in the map, calling @a function for
+ * each item.
+ * @see std::for_each
+ * @note Unlike std::for_each, which invokes the functor with a
+ * single @c value_type argument, this iterator calls
+ * @a function with separate @c const references to the key
+ * and value.
+ */
+ template<typename F>
+ F for_each(F function) const
+ {
+ Iterator iter(get_iterator());
+ while (iter.has_next())
+ {
+ Entry entry(m_env, iter.next());
+ const std::string& key(entry.key());
+ function(key, T(m_env, NativeT(entry.value())));
+ }
+ return function;
}
};
Modified: subversion/branches/reuse-ra-session/subversion/bindings/javahl/native/org_apache_subversion_javahl_util_ConfigLib.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/reuse-ra-session/subversion/bindings/javahl/native/org_apache_subversion_javahl_util_ConfigLib.cpp?rev=1658954&r1=1658953&r2=1658954&view=diff
==============================================================================
--- subversion/branches/reuse-ra-session/subversion/bindings/javahl/native/org_apache_subversion_javahl_util_ConfigLib.cpp (original)
+++ subversion/branches/reuse-ra-session/subversion/bindings/javahl/native/org_apache_subversion_javahl_util_ConfigLib.cpp Wed Feb 11 13:29:26 2015
@@ -343,7 +343,7 @@ Java_org_apache_subversion_javahl_util_C
const char* const m_text_pattern;
const ::Java::Env m_env;
- ::Java::MutableList<JavaHL::Credential> m_credentials;
+ ::Java::List<JavaHL::Credential> m_credentials;
bool match_array(const char* pattern,
const apr_array_header_t* hostnames)
Modified: subversion/branches/reuse-ra-session/subversion/bindings/javahl/native/org_apache_subversion_javahl_util_PropLib.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/reuse-ra-session/subversion/bindings/javahl/native/org_apache_subversion_javahl_util_PropLib.cpp?rev=1658954&r1=1658953&r2=1658954&view=diff
==============================================================================
--- subversion/branches/reuse-ra-session/subversion/bindings/javahl/native/org_apache_subversion_javahl_util_PropLib.cpp (original)
+++ subversion/branches/reuse-ra-session/subversion/bindings/javahl/native/org_apache_subversion_javahl_util_PropLib.cpp Wed Feb 11 13:29:26 2015
@@ -291,7 +291,7 @@ Java_org_apache_subversion_javahl_util_P
pool.getPool()));
}
- Java::MutableList<JavaHL::ExternalItem> items(env, externals->nelts);
+ Java::List<JavaHL::ExternalItem> items(env, externals->nelts);
for (jint i = 0; i < externals->nelts; ++i)
{
// References to the newly created external items are stored
@@ -323,7 +323,7 @@ Java_org_apache_subversion_javahl_util_P
{
const Java::Env env(jenv);
- const Java::List<JavaHL::ExternalItem> items(env, jitems);
+ const Java::ImmutableList<JavaHL::ExternalItem> items(env, jitems);
const Java::String parent_dir(env, jparent_dir);
// Using a "global" iteration pool since we don't keep a context
Modified: subversion/branches/reuse-ra-session/subversion/bindings/javahl/native/org_apache_subversion_javahl_util_SubstLib.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/reuse-ra-session/subversion/bindings/javahl/native/org_apache_subversion_javahl_util_SubstLib.cpp?rev=1658954&r1=1658953&r2=1658954&view=diff
==============================================================================
--- subversion/branches/reuse-ra-session/subversion/bindings/javahl/native/org_apache_subversion_javahl_util_SubstLib.cpp (original)
+++ subversion/branches/reuse-ra-session/subversion/bindings/javahl/native/org_apache_subversion_javahl_util_SubstLib.cpp Wed Feb 11 13:29:26 2015
@@ -118,6 +118,8 @@ Java_org_apache_subversion_javahl_util_S
jstring jurl, jstring jrepos_root_url,
jobject jdate, jstring jauthor)
{
+ typedef Java::Map<Java::ByteArray, jbyteArray> ByteArrayMap;
+
SVN_JAVAHL_JNI_TRY(SubstLib, buildKeywords)
{
const Java::Env env(jenv);
@@ -130,8 +132,7 @@ Java_org_apache_subversion_javahl_util_S
env, pool, jkeywords_value, jrevision,
jurl, jrepos_root_url, jdate, jauthor);
- Java::MutableMap<Java::ByteArray, jbyteArray>
- keywords(env, jint(apr_hash_count(kw)));
+ ByteArrayMap keywords(env, jint(apr_hash_count(kw)));
for (apr_hash_index_t* hi = apr_hash_first(pool.getPool(), kw);
hi; hi = apr_hash_next(hi))
{
Modified: subversion/branches/reuse-ra-session/subversion/bindings/swig/svn_delta.i
URL: http://svn.apache.org/viewvc/subversion/branches/reuse-ra-session/subversion/bindings/swig/svn_delta.i?rev=1658954&r1=1658953&r2=1658954&view=diff
==============================================================================
--- subversion/branches/reuse-ra-session/subversion/bindings/swig/svn_delta.i (original)
+++ subversion/branches/reuse-ra-session/subversion/bindings/swig/svn_delta.i Wed Feb 11 13:29:26 2015
@@ -205,11 +205,11 @@ void _ops_get(int *num_ops, const svn_tx
%include svn_delta_h.swg
#ifdef SWIGPYTHON
-%pythoncode {
+%pythoncode %{
# This function is for backwards compatibility only.
# Use svn_txdelta_window_t.ops instead.
svn_txdelta_window_t_ops_get = svn_txdelta_window_t._ops_get
-}
+%}
#endif
#ifdef SWIGRUBY
Modified: subversion/branches/reuse-ra-session/subversion/include/private/svn_auth_private.h
URL: http://svn.apache.org/viewvc/subversion/branches/reuse-ra-session/subversion/include/private/svn_auth_private.h?rev=1658954&r1=1658953&r2=1658954&view=diff
==============================================================================
--- subversion/branches/reuse-ra-session/subversion/include/private/svn_auth_private.h (original)
+++ subversion/branches/reuse-ra-session/subversion/include/private/svn_auth_private.h Wed Feb 11 13:29:26 2015
@@ -231,6 +231,14 @@ svn_auth__ssl_client_cert_pw_set(svn_boo
svn_boolean_t non_interactive,
apr_pool_t *pool);
+/* Apply the specified configuration for connecting with SERVER_NAME
+ to the auth baton */
+svn_error_t *
+svn_auth__apply_config_for_server(svn_auth_baton_t *ab,
+ apr_hash_t *config,
+ const char *server_name,
+ apr_pool_t *scratch_pool);
+
#if (defined(WIN32) && !defined(__MINGW32__)) || defined(DOXYGEN)
/**
* Set @a *provider to an authentication provider that implements
Modified: subversion/branches/reuse-ra-session/subversion/include/svn_x509.h
URL: http://svn.apache.org/viewvc/subversion/branches/reuse-ra-session/subversion/include/svn_x509.h?rev=1658954&r1=1658953&r2=1658954&view=diff
==============================================================================
--- subversion/branches/reuse-ra-session/subversion/include/svn_x509.h (original)
+++ subversion/branches/reuse-ra-session/subversion/include/svn_x509.h Wed Feb 11 13:29:26 2015
@@ -38,13 +38,13 @@
extern "C" {
#endif
-#define SVN_X509_OID_COMMON_NAME "2.5.4.3"
-#define SVN_X509_OID_COUNTRY "2.5.4.6"
-#define SVN_X509_OID_LOCALITY "2.5.4.7"
-#define SVN_X509_OID_STATE "2.5.4.8"
-#define SVN_X509_OID_ORGANIZATION "2.5.4.10"
-#define SVN_X509_OID_ORG_UNIT "2.5.4.11"
-#define SVN_X509_OID_EMAIL "1.2.840.113549.1.9.1"
+#define SVN_X509_OID_COMMON_NAME "\x55\x04\x03"
+#define SVN_X509_OID_COUNTRY "\x55\x04\x06"
+#define SVN_X509_OID_LOCALITY "\x55\x04\x07"
+#define SVN_X509_OID_STATE "\x55\x04\x08"
+#define SVN_X509_OID_ORGANIZATION "\x55\x04\x0A"
+#define SVN_X509_OID_ORG_UNIT "\x55\x04\x0B"
+#define SVN_X509_OID_EMAIL "\x2A\x86\x48\x86\xF7\x0D\x01\x09\x01"
/**
* Representation of parsed certificate info.
@@ -54,6 +54,13 @@ extern "C" {
typedef struct svn_x509_certinfo_t svn_x509_certinfo_t;
/**
+ * Representation of an atttribute in an X.509 name (e.g. Subject or Issuer)
+ *
+ * @since New in 1.9.
+ */
+typedef struct svn_x509_name_attr_t svn_x509_name_attr_t;
+
+/**
* Parse x509 @a der certificate data from @a buf with length @a
* buflen and return certificate information in @a *certinfo,
* allocated in @a result_pool.
@@ -77,6 +84,32 @@ svn_x509_parse_cert(svn_x509_certinfo_t
apr_pool_t *scratch_pool);
/**
+ * Returns a deep copy of the @a attr, allocated in @a result_pool.
+ * May use @a scratch_pool for temporary allocations.
+ * @since New in 1.9.
+ */
+svn_x509_name_attr_t *
+svn_x509_name_attr_dup(const svn_x509_name_attr_t *attr,
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool);
+
+/**
+ * Returns the OID of @a attr as encoded in the certificate. The
+ * length of the OID will be set in @a len.
+ * @since New in 1.9.
+ */
+const unsigned char *
+svn_x509_name_attr_get_oid(const svn_x509_name_attr_t *attr, apr_size_t *len);
+
+/**
+ * Returns the value of @a attr as a UTF-8 C string.
+ * @since New in 1.9.
+ */
+const char *
+svn_x509_name_attr_get_value(const svn_x509_name_attr_t *attr);
+
+
+/**
* Returns a deep copy of @a certinfo, allocated in @a result_pool.
* May use @a scratch_pool for temporary allocations.
* @since New in 1.9.
@@ -95,25 +128,13 @@ svn_x509_certinfo_get_subject(const svn_
apr_pool_t *result_pool);
/**
- * Returns a list of the the object IDs of the attributes available
- * for the subject in the @a certinfo. The oids in the list are C
- * strings with dot separated integers.
+ * Returns a list of the attributes for the subject in the @a certinfo.
+ * Each member of the list is of type svn_x509_name_attr_t.
*
* @since New in 1.9.
*/
const apr_array_header_t *
-svn_x509_certinfo_get_subject_oids(const svn_x509_certinfo_t *certinfo);
-
-/**
- * Returns the value of the attribute with the object ID specified in
- * @a oid of the subject from @a certinfo. @a oid is a string of dot
- * separated integers.
- *
- * @since New in 1.9.
- */
-const char *
-svn_x509_certinfo_get_subject_attr(const svn_x509_certinfo_t *certinfo,
- const char *oid);
+svn_x509_certinfo_get_subject_attrs(const svn_x509_certinfo_t *certinfo);
/**
* Returns the cerficiate issuer DN from @a certinfo.
@@ -124,25 +145,13 @@ svn_x509_certinfo_get_issuer(const svn_x
apr_pool_t *result_pool);
/**
- * Returns a list of the the object IDs of the attributes available
- * for the issuer in the @a certinfo. The oids in the list are C
- * strings with dot separated integers.
+ * Returns a list of the attributes for the issuer in the @a certinfo.
+ * Each member of the list is of type svn_x509_name_attr_t.
*
* @since New in 1.9.
*/
const apr_array_header_t *
-svn_x509_certinfo_get_issuer_oids(const svn_x509_certinfo_t *certinfo);
-
-/**
- * Returns the value of the attribute with the object ID specified in
- * @a oid of the issuer from @a certinfo. @a oid is a string of dot
- * separated integers.
- *
- * @since New in 1.9.
- */
-const char *
-svn_x509_certinfo_get_issuer_attr(const svn_x509_certinfo_t *certinfo,
- const char *oid);
+svn_x509_certinfo_get_issuer_attrs(const svn_x509_certinfo_t *certinfo);
/**
* Returns the start of the certificate validity period from @a certinfo.
@@ -175,6 +184,17 @@ svn_x509_certinfo_get_digest(const svn_x
const apr_array_header_t *
svn_x509_certinfo_get_hostnames(const svn_x509_certinfo_t *certinfo);
+/**
+ * Given an @a oid return a null-terminated C string representation.
+ * For example an OID with the bytes "\x2A\x86\x48\x86\xF7\x0D\x01\x09\x01"
+ * would be converted to the string "1.2.840.113549.1.9.1". Returns
+ * NULL if the @oid can't be represented as a string.
+ *
+ * @since New in 1.9. */
+const char *
+svn_x509_oid_to_string(const unsigned char *oid, apr_size_t oid_len,
+ apr_pool_t *scratch_pool, apr_pool_t *result_pool);
+
#ifdef __cplusplus
}
#endif
Modified: subversion/branches/reuse-ra-session/subversion/libsvn_client/repos_diff.c
URL: http://svn.apache.org/viewvc/subversion/branches/reuse-ra-session/subversion/libsvn_client/repos_diff.c?rev=1658954&r1=1658953&r2=1658954&view=diff
==============================================================================
--- subversion/branches/reuse-ra-session/subversion/libsvn_client/repos_diff.c (original)
+++ subversion/branches/reuse-ra-session/subversion/libsvn_client/repos_diff.c Wed Feb 11 13:29:26 2015
@@ -389,6 +389,10 @@ remove_non_prop_changes(apr_hash_t *pris
{
int i;
+ /* For added nodes, there is nothing to filter. */
+ if (apr_hash_count(pristine_props) == 0)
+ return;
+
for (i = 0; i < changes->nelts; i++)
{
svn_prop_t *change = &APR_ARRAY_IDX(changes, i, svn_prop_t);
Modified: subversion/branches/reuse-ra-session/subversion/libsvn_delta/compat.c
URL: http://svn.apache.org/viewvc/subversion/branches/reuse-ra-session/subversion/libsvn_delta/compat.c?rev=1658954&r1=1658953&r2=1658954&view=diff
==============================================================================
--- subversion/branches/reuse-ra-session/subversion/libsvn_delta/compat.c (original)
+++ subversion/branches/reuse-ra-session/subversion/libsvn_delta/compat.c Wed Feb 11 13:29:26 2015
@@ -1233,12 +1233,12 @@ alter_file_cb(void *baton,
if (contents)
{
/* We may need to re-checksum these contents */
- if (!(checksum && checksum->kind == svn_checksum_md5))
+ if (checksum && checksum->kind == svn_checksum_md5)
+ md5_checksum = (svn_checksum_t *)checksum;
+ else
contents = svn_stream_checksummed2(contents, &md5_checksum, NULL,
svn_checksum_md5, TRUE,
scratch_pool);
- else
- md5_checksum = (svn_checksum_t *)checksum;
/* Spool the contents to a tempfile, and provide that to the driver. */
SVN_ERR(svn_stream_open_unique(&tmp_stream, &tmp_filename, NULL,
Modified: subversion/branches/reuse-ra-session/subversion/libsvn_fs_fs/cached_data.c
URL: http://svn.apache.org/viewvc/subversion/branches/reuse-ra-session/subversion/libsvn_fs_fs/cached_data.c?rev=1658954&r1=1658953&r2=1658954&view=diff
==============================================================================
--- subversion/branches/reuse-ra-session/subversion/libsvn_fs_fs/cached_data.c (original)
+++ subversion/branches/reuse-ra-session/subversion/libsvn_fs_fs/cached_data.c Wed Feb 11 13:29:26 2015
@@ -2460,7 +2460,7 @@ get_dir_contents(apr_array_header_t **en
changes we've made in this transaction. */
SVN_ERR(svn_stream_open_readonly(&contents, filename, scratch_pool,
scratch_pool));
- SVN_ERR(read_dir_entries(*entries, contents, TRUE, noderev->id,
+ SVN_ERR(read_dir_entries(*entries, contents, TRUE, noderev->id,
result_pool, scratch_pool));
SVN_ERR(svn_stream_close(contents));
}
@@ -2524,7 +2524,7 @@ locate_dir_cache(svn_fs_t *fs,
A NULL key causes a cache miss. */
*key = NULL;
}
-
+
return ffd->dir_cache;
}
}
Modified: subversion/branches/reuse-ra-session/subversion/libsvn_fs_fs/index.c
URL: http://svn.apache.org/viewvc/subversion/branches/reuse-ra-session/subversion/libsvn_fs_fs/index.c?rev=1658954&r1=1658953&r2=1658954&view=diff
==============================================================================
--- subversion/branches/reuse-ra-session/subversion/libsvn_fs_fs/index.c (original)
+++ subversion/branches/reuse-ra-session/subversion/libsvn_fs_fs/index.c Wed Feb 11 13:29:26 2015
@@ -1833,7 +1833,7 @@ svn_fs_fs__p2l_proto_index_open(apr_file
svn_error_t *
svn_fs_fs__p2l_proto_index_add_entry(apr_file_t *proto_index,
- svn_fs_fs__p2l_entry_t *entry,
+ const svn_fs_fs__p2l_entry_t *entry,
apr_pool_t *scratch_pool)
{
apr_uint64_t revision;
Modified: subversion/branches/reuse-ra-session/subversion/libsvn_fs_fs/index.h
URL: http://svn.apache.org/viewvc/subversion/branches/reuse-ra-session/subversion/libsvn_fs_fs/index.h?rev=1658954&r1=1658953&r2=1658954&view=diff
==============================================================================
--- subversion/branches/reuse-ra-session/subversion/libsvn_fs_fs/index.h (original)
+++ subversion/branches/reuse-ra-session/subversion/libsvn_fs_fs/index.h Wed Feb 11 13:29:26 2015
@@ -113,7 +113,7 @@ svn_fs_fs__p2l_proto_index_open(apr_file
*/
svn_error_t *
svn_fs_fs__p2l_proto_index_add_entry(apr_file_t *proto_index,
- svn_fs_fs__p2l_entry_t *entry,
+ const svn_fs_fs__p2l_entry_t *entry,
apr_pool_t *scratch_pool);
/* Set *NEXT_OFFSET to the first offset behind the last entry in the
Modified: subversion/branches/reuse-ra-session/subversion/libsvn_fs_fs/lock.c
URL: http://svn.apache.org/viewvc/subversion/branches/reuse-ra-session/subversion/libsvn_fs_fs/lock.c?rev=1658954&r1=1658953&r2=1658954&view=diff
==============================================================================
--- subversion/branches/reuse-ra-session/subversion/libsvn_fs_fs/lock.c (original)
+++ subversion/branches/reuse-ra-session/subversion/libsvn_fs_fs/lock.c Wed Feb 11 13:29:26 2015
@@ -539,7 +539,6 @@ static svn_error_t *
locks_walker(void *baton,
const char *fs_path,
const char *digest_path,
- apr_hash_t *children,
svn_lock_t *lock,
svn_boolean_t have_write_lock,
apr_pool_t *pool)
@@ -569,17 +568,16 @@ locks_walker(void *baton,
/* Callback type for walk_digest_files().
*
- * CHILDREN and LOCK come from a read_digest_file(digest_path) call.
+ * LOCK come from a read_digest_file(digest_path) call.
*/
typedef svn_error_t *(*walk_digests_callback_t)(void *baton,
const char *fs_path,
const char *digest_path,
- apr_hash_t *children,
svn_lock_t *lock,
svn_boolean_t have_write_lock,
apr_pool_t *pool);
-/* A recursive function that calls WALK_DIGESTS_FUNC/WALK_DIGESTS_BATON for
+/* A function that calls WALK_DIGESTS_FUNC/WALK_DIGESTS_BATON for
all lock digest files in and under PATH in FS.
HAVE_WRITE_LOCK should be true if the caller (directly or indirectly)
has the FS write lock. */
@@ -599,11 +597,10 @@ walk_digest_files(const char *fs_path,
/* First, send up any locks in the current digest file. */
SVN_ERR(read_digest_file(&children, &lock, fs_path, digest_path, pool));
- SVN_ERR(walk_digests_func(walk_digests_baton, fs_path, digest_path,
- children, lock,
+ SVN_ERR(walk_digests_func(walk_digests_baton, fs_path, digest_path, lock,
have_write_lock, pool));
- /* Now, recurse on this thing's child entries (if any; bail otherwise). */
+ /* Now, report all the child entries (if any; bail otherwise). */
if (! apr_hash_count(children))
return SVN_NO_ERROR;
subpool = svn_pool_create(pool);
@@ -611,15 +608,19 @@ walk_digest_files(const char *fs_path,
{
const char *digest = apr_hash_this_key(hi);
svn_pool_clear(subpool);
- SVN_ERR(walk_digest_files
- (fs_path, digest_path_from_digest(fs_path, digest, subpool),
- walk_digests_func, walk_digests_baton, have_write_lock, subpool));
+
+ SVN_ERR(read_digest_file
+ (NULL, &lock, fs_path,
+ digest_path_from_digest(fs_path, digest, subpool), subpool));
+
+ SVN_ERR(walk_digests_func(walk_digests_baton, fs_path, digest_path, lock,
+ have_write_lock, subpool));
}
svn_pool_destroy(subpool);
return SVN_NO_ERROR;
}
-/* A recursive function that calls GET_LOCKS_FUNC/GET_LOCKS_BATON for
+/* A function that calls GET_LOCKS_FUNC/GET_LOCKS_BATON for
all locks in and under PATH in FS.
HAVE_WRITE_LOCK should be true if the caller (directly or indirectly)
has the FS write lock. */
Propchange: subversion/branches/reuse-ra-session/subversion/libsvn_fs_x/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Feb 11 13:29:26 2015
@@ -88,5 +88,5 @@
/subversion/branches/verify-at-commit/subversion/libsvn_fs_x:1462039-1462408
/subversion/branches/verify-keep-going/subversion/libsvn_fs_x:1439280-1492639,1546002-1546110
/subversion/branches/wc-collate-path/subversion/libsvn_fs_x:1402685-1480384
-/subversion/trunk/subversion/libsvn_fs_fs:1415133-1596500,1596567,1597414,1597989,1598273,1599140,1600872,1601633,1603485-1603487,1603499,1603605,1604128,1604188,1604413-1604414,1604416-1604417,1604421,1604442,1604700,1604717,1604720,1604726,1604755,1604794,1604802,1604824,1604836,1604844,1604902-1604903,1604911,1604925,1604933,1604947,1605059-1605060,1605064-1605065,1605068,1605071-1605073,1605075,1605123,1605188-1605189,1605191,1605197,1605444,1605633,1606132,1606142,1606144,1606514,1606526,1606528,1606551,1606554,1606564,1606598-1606599,1606656,1606658,1606662,1606744,1606840,1607085,1607572,1612407,1612810,1613339,1613872,1614611,1615348,1615351-1615352,1615356,1616338-1616339,1616613,1617586,1617688,1618138,1618151,1618153,1618226,1618641,1618653,1618662,1619068,1619358,1619413,1619769,1619774,1620602,1620909,1620912,1620928,1620930,1621275,1621635,1622931,1622937,1622942,1622946,1622959-1622960,1622963,1622987,1623007,1623368,1623373,1623377,1623379,1623381,1623398,1623402,162
4011,1624265,1624512,1626246,1626871,1626873,1626886,1627497-1627498,1627502,1627947-1627949,1627966,1628083,1628093,1628158-1628159,1628161,1628392-1628393,1628415,1628427,1628676,1628738,1628762,1628764,1629854-1629855,1629857,1629865,1629873,1629875,1629879,1630067,1630070,1631049-1631051,1631075,1631115,1631171,1631180,1631185-1631186,1631196-1631197,1631239-1631240,1631548,1631550,1631563,1631567,1631588,1631598,1632646,1632776,1632849,1632851-1632853,1632856-1632857,1632868,1632908,1632926,1633232,1633617-1633618,1634872,1634875,1634879-1634880,1634920,1636478,1636483,1636629,1636644,1637184,1637186,1637330,1637358,1637363,1637393,1639319,1639322,1639335,1639348,1639352,1639355,1639358,1639414,1639419,1639426,1639430,1639436,1639440,1639549,1640061-1640062,1640197,1640915,1640966,1641013,1643139,1643233,1645567,1646021,1646712,1646716,1647537,1647540-1647541,1647820,1647905,1648230,1648238,1648241-1648243,1648253,1648272,1648532,1648537-1648539,1648542,1648591,1648612,1653608
-/subversion/trunk/subversion/libsvn_fs_x:1414756-1657945
+/subversion/trunk/subversion/libsvn_fs_fs:1415133-1596500,1596567,1597414,1597989,1598273,1599140,1600872,1601633,1603485-1603487,1603499,1603605,1604128,1604188,1604413-1604414,1604416-1604417,1604421,1604442,1604700,1604717,1604720,1604726,1604755,1604794,1604802,1604824,1604836,1604844,1604902-1604903,1604911,1604925,1604933,1604947,1605059-1605060,1605064-1605065,1605068,1605071-1605073,1605075,1605123,1605188-1605189,1605191,1605197,1605444,1605633,1606132,1606142,1606144,1606514,1606526,1606528,1606551,1606554,1606564,1606598-1606599,1606656,1606658,1606662,1606744,1606840,1607085,1607572,1612407,1612810,1613339,1613872,1614611,1615348,1615351-1615352,1615356,1616338-1616339,1616613,1617586,1617688,1618138,1618151,1618153,1618226,1618641,1618653,1618662,1619068,1619358,1619413,1619769,1619774,1620602,1620909,1620912,1620928,1620930,1621275,1621635,1622931,1622937,1622942,1622946,1622959-1622960,1622963,1622987,1623007,1623368,1623373,1623377,1623379,1623381,1623398,1623402,162
4011,1624265,1624512,1626246,1626871,1626873,1626886,1627497-1627498,1627502,1627947-1627949,1627966,1628083,1628093,1628158-1628159,1628161,1628392-1628393,1628415,1628427,1628676,1628738,1628762,1628764,1629854-1629855,1629857,1629865,1629873,1629875,1629879,1630067,1630070,1631049-1631051,1631075,1631115,1631171,1631180,1631185-1631186,1631196-1631197,1631239-1631240,1631548,1631550,1631563,1631567,1631588,1631598,1632646,1632776,1632849,1632851-1632853,1632856-1632857,1632868,1632908,1632926,1633232,1633617-1633618,1634872,1634875,1634879-1634880,1634920,1636478,1636483,1636629,1636644,1637184,1637186,1637330,1637358,1637363,1637393,1639319,1639322,1639335,1639348,1639352,1639355,1639358,1639414,1639419,1639426,1639430,1639436,1639440,1639549,1640061-1640062,1640197,1640915,1640966,1641013,1643139,1643233,1645567,1646021,1646712,1646716,1647537,1647540-1647541,1647820,1647905,1648230,1648238,1648241-1648243,1648253,1648272,1648532,1648537-1648539,1648542,1648591,1648612,1653608,
1658482
+/subversion/trunk/subversion/libsvn_fs_x:1414756-1658952
Modified: subversion/branches/reuse-ra-session/subversion/libsvn_fs_x/hotcopy.c
URL: http://svn.apache.org/viewvc/subversion/branches/reuse-ra-session/subversion/libsvn_fs_x/hotcopy.c?rev=1658954&r1=1658953&r2=1658954&view=diff
==============================================================================
--- subversion/branches/reuse-ra-session/subversion/libsvn_fs_x/hotcopy.c (original)
+++ subversion/branches/reuse-ra-session/subversion/libsvn_fs_x/hotcopy.c Wed Feb 11 13:29:26 2015
@@ -99,15 +99,15 @@ static svn_error_t *
entry_name_to_utf8(const char **name_p,
const char *name,
const char *parent,
- apr_pool_t *pool)
+ apr_pool_t *result_pool)
{
- svn_error_t *err = svn_path_cstring_to_utf8(name_p, name, pool);
+ svn_error_t *err = svn_path_cstring_to_utf8(name_p, name, result_pool);
if (err && err->apr_err == APR_EINVAL)
{
return svn_error_createf(err->apr_err, err,
_("Error converting entry "
"in directory '%s' to UTF-8"),
- svn_dirent_local_style(parent, pool));
+ svn_dirent_local_style(parent, result_pool));
}
return err;
}
Modified: subversion/branches/reuse-ra-session/subversion/libsvn_fs_x/lock.c
URL: http://svn.apache.org/viewvc/subversion/branches/reuse-ra-session/subversion/libsvn_fs_x/lock.c?rev=1658954&r1=1658953&r2=1658954&view=diff
==============================================================================
--- subversion/branches/reuse-ra-session/subversion/libsvn_fs_x/lock.c (original)
+++ subversion/branches/reuse-ra-session/subversion/libsvn_fs_x/lock.c Wed Feb 11 13:29:26 2015
@@ -559,7 +559,6 @@ static svn_error_t *
locks_walker(void *baton,
const char *fs_path,
const char *digest_path,
- apr_hash_t *children,
svn_lock_t *lock,
svn_boolean_t have_write_lock,
apr_pool_t *pool)
@@ -589,17 +588,16 @@ locks_walker(void *baton,
/* Callback type for walk_digest_files().
*
- * CHILDREN and LOCK come from a read_digest_file(digest_path) call.
+ * LOCK come from a read_digest_file(digest_path) call.
*/
typedef svn_error_t *(*walk_digests_callback_t)(void *baton,
const char *fs_path,
const char *digest_path,
- apr_hash_t *children,
svn_lock_t *lock,
svn_boolean_t have_write_lock,
apr_pool_t *pool);
-/* A recursive function that calls WALK_DIGESTS_FUNC/WALK_DIGESTS_BATON for
+/* A function that calls WALK_DIGESTS_FUNC/WALK_DIGESTS_BATON for
all lock digest files in and under PATH in FS.
HAVE_WRITE_LOCK should be true if the caller (directly or indirectly)
has the FS write lock. */
@@ -619,11 +617,10 @@ walk_digest_files(const char *fs_path,
/* First, send up any locks in the current digest file. */
SVN_ERR(read_digest_file(&children, &lock, fs_path, digest_path, pool));
- SVN_ERR(walk_digests_func(walk_digests_baton, fs_path, digest_path,
- children, lock,
+ SVN_ERR(walk_digests_func(walk_digests_baton, fs_path, digest_path, lock,
have_write_lock, pool));
- /* Now, recurse on this thing's child entries (if any; bail otherwise). */
+ /* Now, report all the child entries (if any; bail otherwise). */
if (! apr_hash_count(children))
return SVN_NO_ERROR;
subpool = svn_pool_create(pool);
@@ -631,15 +628,19 @@ walk_digest_files(const char *fs_path,
{
const char *digest = apr_hash_this_key(hi);
svn_pool_clear(subpool);
- SVN_ERR(walk_digest_files
- (fs_path, digest_path_from_digest(fs_path, digest, subpool),
- walk_digests_func, walk_digests_baton, have_write_lock, subpool));
+
+ SVN_ERR(read_digest_file
+ (NULL, &lock, fs_path,
+ digest_path_from_digest(fs_path, digest, subpool), subpool));
+
+ SVN_ERR(walk_digests_func(walk_digests_baton, fs_path, digest_path, lock,
+ have_write_lock, subpool));
}
svn_pool_destroy(subpool);
return SVN_NO_ERROR;
}
-/* A recursive function that calls GET_LOCKS_FUNC/GET_LOCKS_BATON for
+/* A function that calls GET_LOCKS_FUNC/GET_LOCKS_BATON for
all locks in and under PATH in FS.
HAVE_WRITE_LOCK should be true if the caller (directly or indirectly)
has the FS write lock. */