Prepare JavaHL for writing callbacks with the newstyle jniwrapper.

[in subversion/bindings/javahl]
* native/jniwrapper/jni_stack.hpp:
   Added and enhanced error and exception handling boilerplate.
  (SVN_JAVAHL_JNI_TRY, SVN_JAVAHL_JNI_TRY_STATIC): Update docstring.
  (SVN_JAVAHL_ASSERT_EXCEPTION_THROWN): New; developer-only assertion
   that verifies that a Java exception is being thrown, in the context
   where the boilerplate code requires it.
  (SVN_JAVAHL_GET_BOUND_OBJECT): New; retrieves a pointer to the
   native object wrapped by a Java object.
  (SVN_JAVAHL_JNI_CATCH_TO_EXCEPTION): New.
  (SVN_JAVAHL_JNI_CATCH):
   Reimplement in terms of SVN_JAVAHL_JNI_CATCH_TO_EXCEPTION.
  (SVN_JAVAHL_CHECK): Require a Java::Env parameter, update docstring
   and call out-of-line to handle a returned error.
  (SVN_JAVAHL_CATCH): New; converts a Java exception to a Subversion
   error. Used in callbacks that have to propagate exception state
   through native code.
  (Java::handle_svn_error): New; out-of-line implementation
   for SVN_JAVAHL_CHECK.

* native/jniwrapper/jni_env.hpp
  (SVN_JAVAHL_JNIWRAPPER_LOG): Wrap definition in more #ifdefs so that
   it can be selectively disabled (see: jni_class_cache.cpp).
  (Env::Throw, Env::ThrowNew): Declare as non-throwing.
  (Env::ExceptionCheck, Env::ExceptionClear, Env::IsInstanceOf): New.
* native/jniwrapper/jni_exception.hpp
  (Java::IndexOutOfBoundsException): New.
* native/jniwrapper/jni_javahl_exception.hpp:
   Removed Java::Env forward declaration.
  (JavaHL::JavaException::get_java_exception): Removed.

* native/jniwrapper/jni_base.cpp:
   Reorder some of the exception class implementations.
  (IndexOutOfBoundsException::m_class_name): Initialise.
  (Java::handle_svn_error): Implement.

* jniwrapper/jni_class_cache.cpp:
   Unconditionally define SVN_JAVAHL_JNIWRAPPER_LOG to disable the
   definition in jni_env.hpp.
  (ClassCache::create): Handle exceptions thrown from class cache
   initialisation code, so that the returned errors can be more
   descriptive.

* native/ExternalItem.cpp,
  native/org_apache_subversion_javahl_util_PropLib.cpp,
  org_apache_subversion_javahl_util_SubstLib.cpp:
   Update all uses of SVN_JAVAHL_CHECK.

* native/JNIUtil.h, native/JNIUtil.cpp
  (JNIUtil::handleSVNError, JNIUtil::wrappedHandleSVNError)
   Accept an (optional) throwable object reference to use as
   the exception cause.

* src/org/apache/subversion/javahl/ClientException.java,
  src/org/apache/subversion/javahl/NativeException.java,
  src/org/apache/subversion/javahl/SubversionException.java:
   Add constructors that accept an exception cause.


git-svn-id: https://svn.apache.org/repos/asf/subversion/trunk@1543819 13f79535-47bb-0310-9956-ffa450edef68