subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From br...@apache.org
Subject svn commit: r1849238 - in /subversion/trunk/subversion/bindings/javahl/native: ./ jniwrapper/
Date Tue, 18 Dec 2018 21:19:33 GMT
Author: brane
Date: Tue Dec 18 21:19:32 2018
New Revision: 1849238

URL: http://svn.apache.org/viewvc?rev=1849238&view=rev
Log:
Make JavaHL use std::unique_ptr when compiled as C++11 and later instead
of the deprecated (and removed in C++17) std::auto_ptr.

* subversion/bindings/javahl/native/CxxCompat.hpp: New.
  (JavaHL::cxx::owned_ptr): New; alias for std::unique_ptr or std::auto_ptr.
  (JavaHL::cxx::move): New; aliased or faked std::move.

* subversion/bindings/javahl/native/EditorProxy.cpp,
* subversion/bindings/javahl/native/EditorProxy.h,
* subversion/bindings/javahl/native/OperationContext.cpp,
* subversion/bindings/javahl/native/OperationContext.h,
* subversion/bindings/javahl/native/Prompter.cpp,
* subversion/bindings/javahl/native/Prompter.h,
* subversion/bindings/javahl/native/RemoteSession.cpp,
* subversion/bindings/javahl/native/RemoteSessionContext.cpp,
* subversion/bindings/javahl/native/RemoteSessionContext.h,
* subversion/bindings/javahl/native/StateReporter.cpp,
* subversion/bindings/javahl/native/org_apache_subversion_javahl_SVNClient.cpp,
* subversion/bindings/javahl/native/org_apache_subversion_javahl_util_SubstLib.cpp,
* subversion/bindings/javahl/native/jniwrapper/jni_class_cache.cpp,
* subversion/bindings/javahl/native/jniwrapper/jni_io_stream.cpp:
   Replace std::auto_ptr with JavaHL::cxx:owned_ptr, using JavaHL::cxx::move()
   where nedessary to make stuff work when we're actually using std::unique_ptr.

Added:
    subversion/trunk/subversion/bindings/javahl/native/CxxCompat.hpp   (with props)
Modified:
    subversion/trunk/subversion/bindings/javahl/native/EditorProxy.cpp
    subversion/trunk/subversion/bindings/javahl/native/EditorProxy.h
    subversion/trunk/subversion/bindings/javahl/native/OperationContext.cpp
    subversion/trunk/subversion/bindings/javahl/native/OperationContext.h
    subversion/trunk/subversion/bindings/javahl/native/Prompter.cpp
    subversion/trunk/subversion/bindings/javahl/native/Prompter.h
    subversion/trunk/subversion/bindings/javahl/native/RemoteSession.cpp
    subversion/trunk/subversion/bindings/javahl/native/RemoteSessionContext.cpp
    subversion/trunk/subversion/bindings/javahl/native/RemoteSessionContext.h
    subversion/trunk/subversion/bindings/javahl/native/StateReporter.cpp
    subversion/trunk/subversion/bindings/javahl/native/jniwrapper/jni_class_cache.cpp
    subversion/trunk/subversion/bindings/javahl/native/jniwrapper/jni_io_stream.cpp
    subversion/trunk/subversion/bindings/javahl/native/org_apache_subversion_javahl_SVNClient.cpp
    subversion/trunk/subversion/bindings/javahl/native/org_apache_subversion_javahl_util_SubstLib.cpp

Added: subversion/trunk/subversion/bindings/javahl/native/CxxCompat.hpp
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/bindings/javahl/native/CxxCompat.hpp?rev=1849238&view=auto
==============================================================================
--- subversion/trunk/subversion/bindings/javahl/native/CxxCompat.hpp (added)
+++ subversion/trunk/subversion/bindings/javahl/native/CxxCompat.hpp Tue Dec 18 21:19:32 2018
@@ -0,0 +1,97 @@
+/**
+ * @copyright
+ * ====================================================================
+ *    Licensed to the Apache Software Foundation (ASF) under one
+ *    or more contributor license agreements.  See the NOTICE file
+ *    distributed with this work for additional information
+ *    regarding copyright ownership.  The ASF licenses this file
+ *    to you under the Apache License, Version 2.0 (the
+ *    "License"); you may not use this file except in compliance
+ *    with the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing,
+ *    software distributed under the License is distributed on an
+ *    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *    KIND, either express or implied.  See the License for the
+ *    specific language governing permissions and limitations
+ *    under the License.
+ * ====================================================================
+ * @endcopyright
+ */
+
+#ifndef SVN_JAVAHL_CXX_COMPAT_HPP
+#define SVN_JAVAHL_CXX_COMPAT_HPP
+
+#include <memory>
+
+namespace JavaHL {
+namespace cxx {
+
+#if defined(__cplusplus) && __cplusplus >= 201103L
+/*
+ * C++11 and later
+ */
+
+// Use std::unique_ptr for exclusive ownership.
+template<
+  typename T,
+  typename D = ::std::default_delete<T>
+  >
+using owned_ptr = ::std::unique_ptr<T, D>;
+
+// Use std::move for transfering ownership of owned pointers.
+using ::std::move;
+
+#else
+/*
+ * C++03 and earlier
+ */
+
+// Use a dumbed-down std::auto_ptr for exclusive ownership.
+template<class T>
+class owned_ptr : public ::std::auto_ptr<T>
+{
+  typedef ::std::auto_ptr<T> auto_ptr;
+  typedef ::std::auto_ptr_ref<T> auto_ptr_ref;
+
+public:
+  explicit owned_ptr(T *p = 0) throw()
+    : auto_ptr(p)
+    {}
+
+  owned_ptr(owned_ptr& r) throw()
+    : auto_ptr(r)
+    {}
+
+  owned_ptr(auto_ptr_ref r) throw()
+    : auto_ptr(r)
+    {}
+
+  owned_ptr& operator=(owned_ptr& r) throw()
+    {
+      static_cast<auto_ptr&>(*this) = r;
+      return *this;
+    }
+
+  owned_ptr& operator=(auto_ptr_ref r) throw()
+    {
+      static_cast<auto_ptr&>(*this) = r;
+      return *this;
+    }
+};
+
+// Fake std::move since there are no rvalue references.
+template<class T>
+T& move(T& t)
+{
+  return t;
+}
+
+#endif
+
+} // namespace cxx
+} // namespace JavaHL
+
+#endif // SVN_JAVAHL_CXX_COMPAT_HPP

Propchange: subversion/trunk/subversion/bindings/javahl/native/CxxCompat.hpp
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: subversion/trunk/subversion/bindings/javahl/native/EditorProxy.cpp
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/bindings/javahl/native/EditorProxy.cpp?rev=1849238&r1=1849237&r2=1849238&view=diff
==============================================================================
--- subversion/trunk/subversion/bindings/javahl/native/EditorProxy.cpp (original)
+++ subversion/trunk/subversion/bindings/javahl/native/EditorProxy.cpp Tue Dec 18 21:19:32
2018
@@ -132,7 +132,7 @@ get_editor_method(jmethodID& mid, const
 
 jobject wrap_input_stream(svn_stream_t* stream)
 {
-  std::auto_ptr<JavaHL::NativeInputStream>
+  JavaHL::cxx::owned_ptr<JavaHL::NativeInputStream>
     wrapped(new JavaHL::NativeInputStream());
   apr_pool_t* const wrapped_pool = wrapped->get_pool().getPool();
   wrapped->set_stream(svn_stream_disown(stream, wrapped_pool));

Modified: subversion/trunk/subversion/bindings/javahl/native/EditorProxy.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/bindings/javahl/native/EditorProxy.h?rev=1849238&r1=1849237&r2=1849238&view=diff
==============================================================================
--- subversion/trunk/subversion/bindings/javahl/native/EditorProxy.h (original)
+++ subversion/trunk/subversion/bindings/javahl/native/EditorProxy.h Tue Dec 18 21:19:32 2018
@@ -33,6 +33,8 @@
 #include "private/svn_editor.h"
 #include "private/svn_delta_private.h"
 
+#include "CxxCompat.hpp"
+
 /**
  * These callbacks are needed by the delta-to-Ev2 shims.
  */
@@ -53,7 +55,7 @@ struct EditorProxyCallbacks
 class EditorProxy
 {
 public:
-  typedef std::auto_ptr<EditorProxy> UniquePtr;
+  typedef ::JavaHL::cxx::owned_ptr<EditorProxy> UniquePtr;
 
   EditorProxy(jobject jeditor, apr_pool_t* edit_pool,
               const char* repos_root_url, const char* base_relpath,

Modified: subversion/trunk/subversion/bindings/javahl/native/OperationContext.cpp
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/bindings/javahl/native/OperationContext.cpp?rev=1849238&r1=1849237&r2=1849238&view=diff
==============================================================================
--- subversion/trunk/subversion/bindings/javahl/native/OperationContext.cpp (original)
+++ subversion/trunk/subversion/bindings/javahl/native/OperationContext.cpp Tue Dec 18 21:19:32
2018
@@ -43,7 +43,7 @@
 
 OperationContext::OperationContext(SVN::Pool &pool)
   : m_config(NULL),
-    m_prompter(NULL),
+    m_prompter(),
     m_cancelOperation(0),
     m_pool(&pool),
     m_jctx(NULL),
@@ -253,7 +253,7 @@ OperationContext::password(const char *p
 void
 OperationContext::setPrompt(Prompter::UniquePtr prompter)
 {
-  m_prompter = prompter;
+  m_prompter = JavaHL::cxx::move(prompter);
 }
 
 void
@@ -311,7 +311,7 @@ Prompter::UniquePtr OperationContext::cl
 {
   if (m_prompter.get())
     return m_prompter->clone();
-  return Prompter::UniquePtr(NULL);
+  return Prompter::UniquePtr();
 }
 
 void OperationContext::setTunnelCallback(jobject jtunnelcb)

Modified: subversion/trunk/subversion/bindings/javahl/native/OperationContext.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/bindings/javahl/native/OperationContext.h?rev=1849238&r1=1849237&r2=1849238&view=diff
==============================================================================
--- subversion/trunk/subversion/bindings/javahl/native/OperationContext.h (original)
+++ subversion/trunk/subversion/bindings/javahl/native/OperationContext.h Tue Dec 18 21:19:32
2018
@@ -37,6 +37,7 @@
 #include <jni.h>
 #include "Pool.h"
 #include "JNIStringHolder.h"
+#include "CxxCompat.hpp"
 
 class Prompter;
 
@@ -52,7 +53,7 @@ class OperationContext
 
   apr_hash_t * m_config;
 
-  std::auto_ptr<Prompter> m_prompter;
+  JavaHL::cxx::owned_ptr<Prompter> m_prompter;
   svn_atomic_t m_cancelOperation;
 
  protected:
@@ -90,7 +91,7 @@ class OperationContext
 
   virtual void username(const char *pi_username);
   virtual void password(const char *pi_password);
-  virtual void setPrompt(std::auto_ptr<Prompter> prompter);
+  virtual void setPrompt(JavaHL::cxx::owned_ptr<Prompter> prompter);
   svn_auth_baton_t *getAuthBaton(SVN::Pool &in_pool);
 
   void cancelOperation();
@@ -100,7 +101,7 @@ class OperationContext
   const char *getConfigDirectory() const;
   const char *getUsername() const;
   const char *getPassword() const;
-  std::auto_ptr<Prompter> clonePrompter() const;
+  JavaHL::cxx::owned_ptr<Prompter> clonePrompter() const;
 
   /**
    * Set the configuration directory, taking the usual steps to

Modified: subversion/trunk/subversion/bindings/javahl/native/Prompter.cpp
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/bindings/javahl/native/Prompter.cpp?rev=1849238&r1=1849237&r2=1849238&view=diff
==============================================================================
--- subversion/trunk/subversion/bindings/javahl/native/Prompter.cpp (original)
+++ subversion/trunk/subversion/bindings/javahl/native/Prompter.cpp Tue Dec 18 21:19:32 2018
@@ -45,7 +45,7 @@
 Prompter::UniquePtr Prompter::create(jobject jprompter)
 {
   if (!jprompter)
-    return UniquePtr(NULL);
+    return UniquePtr();
 
   // Make sure no C++ exceptions are propagated from here.
   const ::Java::Env jenv;
@@ -53,12 +53,12 @@ Prompter::UniquePtr Prompter::create(job
     {
       const jclass cls = ::Java::ClassCache::get_authn_cb(jenv)->get_class();
       if (!jenv.IsInstanceOf(jprompter, cls))
-        return UniquePtr(NULL);
+        return UniquePtr();
 
       return UniquePtr(new Prompter(jenv, jprompter));
     }
   SVN_JAVAHL_JNI_CATCH;
-  return UniquePtr(NULL);
+  return UniquePtr();
 }
 
 Prompter::UniquePtr Prompter::clone() const
@@ -431,7 +431,7 @@ svn_error_t *Prompter::dispatch_plaintex
 Prompter::UniquePtr CompatPrompter::create(jobject jprompter)
 {
   if (!jprompter)
-    return UniquePtr(NULL);
+    return UniquePtr();
 
   // Make sure no C++ exceptions are propagated from here.
   const ::Java::Env jenv;
@@ -440,12 +440,12 @@ Prompter::UniquePtr CompatPrompter::crea
       const jclass cls =
         ::Java::ClassCache::get_user_passwd_cb(jenv)->get_class();
       if (!jenv.IsInstanceOf(jprompter, cls))
-        return UniquePtr(NULL);
+        return UniquePtr();
 
       return UniquePtr(new CompatPrompter(jenv, jprompter));
     }
   SVN_JAVAHL_JNI_CATCH;
-  return UniquePtr(NULL);
+  return UniquePtr();
 }
 
 Prompter::UniquePtr CompatPrompter::clone() const

Modified: subversion/trunk/subversion/bindings/javahl/native/Prompter.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/bindings/javahl/native/Prompter.h?rev=1849238&r1=1849237&r2=1849238&view=diff
==============================================================================
--- subversion/trunk/subversion/bindings/javahl/native/Prompter.h (original)
+++ subversion/trunk/subversion/bindings/javahl/native/Prompter.h Tue Dec 18 21:19:32 2018
@@ -35,10 +35,13 @@
 
 #include "jniwrapper/jni_globalref.hpp"
 
+#include "CxxCompat.hpp"
+
+
 class Prompter
 {
 public:
-  typedef ::std::auto_ptr<Prompter> UniquePtr;
+  typedef ::JavaHL::cxx::owned_ptr<Prompter> UniquePtr;
 
   /**
    * Factory method; @a prompter is a local reference to the Java

Modified: subversion/trunk/subversion/bindings/javahl/native/RemoteSession.cpp
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/bindings/javahl/native/RemoteSession.cpp?rev=1849238&r1=1849237&r2=1849238&view=diff
==============================================================================
--- subversion/trunk/subversion/bindings/javahl/native/RemoteSession.cpp (original)
+++ subversion/trunk/subversion/bindings/javahl/native/RemoteSession.cpp Tue Dec 18 21:19:32
2018
@@ -104,7 +104,9 @@ RemoteSession::open(jint jretryAttempts,
   jobject jremoteSession = open(
       jretryAttempts, url.c_str(), uuid,
       (jconfigDirectory ? configDirectory.c_str() : NULL),
-      usernameStr, passwordStr, prompter, jprogress, jcfgcb, jtunnelcb);
+      usernameStr, passwordStr,
+      JavaHL::cxx::move(prompter),
+      jprogress, jcfgcb, jtunnelcb);
   if (JNIUtil::isExceptionThrown() || !jremoteSession)
     jremoteSession = NULL;
   return jremoteSession;
@@ -120,7 +122,9 @@ RemoteSession::open(jint jretryAttempts,
 {
   RemoteSession* session = new RemoteSession(
       jretryAttempts, url, uuid, configDirectory,
-      usernameStr, passwordStr, prompter, jcfgcb, jtunnelcb);
+      usernameStr, passwordStr,
+      JavaHL::cxx::move(prompter),
+      jcfgcb, jtunnelcb);
   if (JNIUtil::isJavaExceptionThrown() || !session)
     {
       delete session;
@@ -187,7 +191,9 @@ RemoteSession::RemoteSession(int retryAt
   : m_session(NULL), m_context(NULL)
 {
   m_context = new RemoteSessionContext(
-      pool, configDirectory, username, password, prompter, jcfgcb, jtunnelcb);
+      pool, configDirectory, username, password,
+      JavaHL::cxx::move(prompter),
+      jcfgcb, jtunnelcb);
   if (JNIUtil::isJavaExceptionThrown())
     return;
 
@@ -856,7 +862,8 @@ RemoteSession::status(jobject jthis, jst
                                 editor->delta_editor(),
                                 editor->delta_baton(),
                                 report_pool),);
-  rp->set_reporter_data(raw_reporter, report_baton, editor);
+  rp->set_reporter_data(raw_reporter, report_baton,
+                        JavaHL::cxx::move(editor));
 }
 
 // TODO: diff

Modified: subversion/trunk/subversion/bindings/javahl/native/RemoteSessionContext.cpp
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/bindings/javahl/native/RemoteSessionContext.cpp?rev=1849238&r1=1849237&r2=1849238&view=diff
==============================================================================
--- subversion/trunk/subversion/bindings/javahl/native/RemoteSessionContext.cpp (original)
+++ subversion/trunk/subversion/bindings/javahl/native/RemoteSessionContext.cpp Tue Dec 18
21:19:32 2018
@@ -43,7 +43,7 @@ RemoteSessionContext::RemoteSessionConte
   if (passwordStr != NULL)
     password(passwordStr);
 
-  setPrompt(prompter);
+  setPrompt(JavaHL::cxx::move(prompter));
   setConfigEventHandler(jcfgcb);
   setTunnelCallback(jtunnelcb);
 

Modified: subversion/trunk/subversion/bindings/javahl/native/RemoteSessionContext.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/bindings/javahl/native/RemoteSessionContext.h?rev=1849238&r1=1849237&r2=1849238&view=diff
==============================================================================
--- subversion/trunk/subversion/bindings/javahl/native/RemoteSessionContext.h (original)
+++ subversion/trunk/subversion/bindings/javahl/native/RemoteSessionContext.h Tue Dec 18 21:19:32
2018
@@ -30,6 +30,7 @@
 #include "svn_ra.h"
 
 #include "OperationContext.h"
+#include "CxxCompat.hpp"
 
 class RemoteSessionContext : public OperationContext
 {
@@ -37,7 +38,7 @@ class RemoteSessionContext : public Oper
     RemoteSessionContext(SVN::Pool &pool,
                          const char* jconfigDirectory,
                          const char* jusername, const char* jpassword,
-                         std::auto_ptr<Prompter> prompter,
+                         JavaHL::cxx::owned_ptr<Prompter> prompter,
                          jobject jcfgcb, jobject jtunnelcb);
     virtual ~RemoteSessionContext();
     void activate(jobject jremoteSession, jobject jprogress);

Modified: subversion/trunk/subversion/bindings/javahl/native/StateReporter.cpp
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/bindings/javahl/native/StateReporter.cpp?rev=1849238&r1=1849237&r2=1849238&view=diff
==============================================================================
--- subversion/trunk/subversion/bindings/javahl/native/StateReporter.cpp (original)
+++ subversion/trunk/subversion/bindings/javahl/native/StateReporter.cpp Tue Dec 18 21:19:32
2018
@@ -38,7 +38,7 @@ StateReporter::StateReporter()
   : m_valid(false),
     m_raw_reporter(NULL),
     m_report_baton(NULL),
-    m_editor(NULL),
+    m_editor(),
     m_target_revision(SVN_INVALID_REVNUM)
 {}
 
@@ -182,7 +182,7 @@ StateReporter::set_reporter_data(const s
 {
   //DEBUG:fprintf(stderr, "  (n) StateReporter::set_reporter_data()\n");
 
-  m_editor = editor;
+  m_editor = JavaHL::cxx::move(editor);
   m_raw_reporter = raw_reporter;
   m_report_baton = report_baton;
   m_valid = true;

Modified: subversion/trunk/subversion/bindings/javahl/native/jniwrapper/jni_class_cache.cpp
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/bindings/javahl/native/jniwrapper/jni_class_cache.cpp?rev=1849238&r1=1849237&r2=1849238&view=diff
==============================================================================
--- subversion/trunk/subversion/bindings/javahl/native/jniwrapper/jni_class_cache.cpp (original)
+++ subversion/trunk/subversion/bindings/javahl/native/jniwrapper/jni_class_cache.cpp Tue
Dec 18 21:19:32 2018
@@ -42,10 +42,11 @@
 #include "../Credential.hpp"
 #include "../ExternalItem.hpp"
 #include "../EditorCallbacks.hpp"
+#include "../CxxCompat.hpp"
 
 namespace
 {
-/* This class behaves like a dumbed-down std:auto_ptr, but it
+/* This class behaves like a dumbed-down std:unique_ptr, but it
    implements atomic access and modification of the wrapped
    pointer. */
 class ClassImplPtr
@@ -132,11 +133,11 @@ class ClassCacheImpl
 
   // The statically initialized calss wrappers are always defined and
   // therefore do not need atomic access.
-#define JNIWRAPPER_DEFINE_CACHED_CLASS(M, C)            \
-  std::auto_ptr<Object::ClassImpl> m_impl_##M;          \
-  const Object::ClassImpl* get_##M(Env)                 \
-    {                                                   \
-      return m_impl_##M.get();                          \
+#define JNIWRAPPER_DEFINE_CACHED_CLASS(M, C)                     \
+  JavaHL::cxx::owned_ptr<Object::ClassImpl> m_impl_##M;          \
+  const Object::ClassImpl* get_##M(Env)                          \
+    {                                                            \
+      return m_impl_##M.get();                                   \
     }
 
   JNIWRAPPER_DEFINE_CACHED_CLASS(object, Object)
@@ -153,7 +154,7 @@ class ClassCacheImpl
       Object::ClassImpl* pimpl = m_impl_##M.get();              \
       if (!pimpl)                                               \
         {                                                       \
-          std::auto_ptr<Object::ClassImpl> tmp(                 \
+          JavaHL::cxx::owned_ptr<Object::ClassImpl> tmp(        \
               new C::ClassImpl(                                 \
                   env, env.FindClass(C::m_class_name)));        \
           pimpl = m_impl_##M.test_and_set(tmp.get());           \

Modified: subversion/trunk/subversion/bindings/javahl/native/jniwrapper/jni_io_stream.cpp
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/bindings/javahl/native/jniwrapper/jni_io_stream.cpp?rev=1849238&r1=1849237&r2=1849238&view=diff
==============================================================================
--- subversion/trunk/subversion/bindings/javahl/native/jniwrapper/jni_io_stream.cpp (original)
+++ subversion/trunk/subversion/bindings/javahl/native/jniwrapper/jni_io_stream.cpp Tue Dec
18 21:19:32 2018
@@ -27,6 +27,8 @@
 
 #include "svn_private_config.h"
 
+#include "../CxxCompat.hpp"
+
 // Stream-wrapper-specific mark object type
 struct svn_stream_mark_t
 {
@@ -197,7 +199,7 @@ InputStream::get_global_stream(Env env,
 
   const bool has_mark = InputStream(env, jstream).mark_supported();
 
-  std::auto_ptr<GlobalObject> baton(new GlobalObject(env, jstream));
+  JavaHL::cxx::owned_ptr<GlobalObject> baton(new GlobalObject(env, jstream));
 
   svn_stream_t* const stream = svn_stream_create(baton.get(), pool.getPool());
   svn_stream_set_read2(stream, global_stream_read,
@@ -268,7 +270,7 @@ OutputStream::get_global_stream(Env env,
   if (!jstream)
     return NULL;
 
-  std::auto_ptr<GlobalObject> baton(new GlobalObject(env, jstream));
+  JavaHL::cxx::owned_ptr<GlobalObject> baton(new GlobalObject(env, jstream));
 
   svn_stream_t* const stream = svn_stream_create(baton.get(), pool.getPool());
   svn_stream_set_write(stream, global_stream_write);

Modified: subversion/trunk/subversion/bindings/javahl/native/org_apache_subversion_javahl_SVNClient.cpp
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/bindings/javahl/native/org_apache_subversion_javahl_SVNClient.cpp?rev=1849238&r1=1849237&r2=1849238&view=diff
==============================================================================
--- subversion/trunk/subversion/bindings/javahl/native/org_apache_subversion_javahl_SVNClient.cpp
(original)
+++ subversion/trunk/subversion/bindings/javahl/native/org_apache_subversion_javahl_SVNClient.cpp
Tue Dec 18 21:19:32 2018
@@ -280,7 +280,7 @@ Java_org_apache_subversion_javahl_SVNCli
   if (JNIUtil::isExceptionThrown())
     return;
 
-  cl->getClientContext().setPrompt(prompter);
+  cl->getClientContext().setPrompt(JavaHL::cxx::move(prompter));
 }
 
 JNIEXPORT void JNICALL
@@ -298,7 +298,7 @@ Java_org_apache_subversion_javahl_SVNCli
   if (JNIUtil::isExceptionThrown())
     return;
 
-  cl->getClientContext().setPrompt(prompter);
+  cl->getClientContext().setPrompt(JavaHL::cxx::move(prompter));
 }
 
 JNIEXPORT void JNICALL

Modified: subversion/trunk/subversion/bindings/javahl/native/org_apache_subversion_javahl_util_SubstLib.cpp
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/bindings/javahl/native/org_apache_subversion_javahl_util_SubstLib.cpp?rev=1849238&r1=1849237&r2=1849238&view=diff
==============================================================================
--- subversion/trunk/subversion/bindings/javahl/native/org_apache_subversion_javahl_util_SubstLib.cpp
(original)
+++ subversion/trunk/subversion/bindings/javahl/native/org_apache_subversion_javahl_util_SubstLib.cpp
Tue Dec 18 21:19:32 2018
@@ -37,6 +37,7 @@
 #include "JNIUtil.h"
 #include "NativeStream.hpp"
 #include "Utility.hpp"
+#include "CxxCompat.hpp"
 
 #include <apr_hash.h>
 
@@ -165,7 +166,7 @@ Java_org_apache_subversion_javahl_util_S
       const Java::Env env(jenv);
 
       // We'll allocate the stream in the bound object's pool.
-      std::auto_ptr<JavaHL::NativeInputStream>
+      JavaHL::cxx::owned_ptr<JavaHL::NativeInputStream>
         translated(new JavaHL::NativeInputStream());
       svn_stream_t* source = Java::InputStream::get_global_stream(
           env, jsource, translated->get_pool());
@@ -199,7 +200,7 @@ Java_org_apache_subversion_javahl_util_S
       const Java::Env env(jenv);
 
       // We'll allocate the stream in the bound object's pool.
-      std::auto_ptr<JavaHL::NativeOutputStream>
+      JavaHL::cxx::owned_ptr<JavaHL::NativeOutputStream>
         translated(new JavaHL::NativeOutputStream());
       svn_stream_t* destination = Java::OutputStream::get_global_stream(
           env, jdestination, translated->get_pool());



Mime
View raw message