subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From br...@apache.org
Subject svn commit: r1677364 - in /subversion/trunk/subversion/bindings/javahl/native/jniwrapper: jni_base.cpp jni_globalref.hpp
Date Sun, 03 May 2015 02:51:46 GMT
Author: brane
Date: Sun May  3 02:51:46 2015
New Revision: 1677364

URL: http://svn.apache.org/r1677364
Log:
Make the JavaHL global reference wrapper self-contained.

[in subversion/bindings/javahl/native]
* jniwrapper/jni_base.cpp
  (GlobalObject::operator=,
   GlobalObject::~GlobalObject,
   GlobalClass::operator=): Remove out-of-line implementations.
* jniwrapper/jni_globalref.hpp: Include <memory>.
  (GlobalObject::operator=,
   GlobalObject::~GlobalObject,
   GlobalClass::operator=): Add inline implementations.
  (GlobalObject::get, GlobalClass::get): Tag as nothrow.

Modified:
    subversion/trunk/subversion/bindings/javahl/native/jniwrapper/jni_base.cpp
    subversion/trunk/subversion/bindings/javahl/native/jniwrapper/jni_globalref.hpp

Modified: subversion/trunk/subversion/bindings/javahl/native/jniwrapper/jni_base.cpp
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/bindings/javahl/native/jniwrapper/jni_base.cpp?rev=1677364&r1=1677363&r2=1677364&view=diff
==============================================================================
--- subversion/trunk/subversion/bindings/javahl/native/jniwrapper/jni_base.cpp (original)
+++ subversion/trunk/subversion/bindings/javahl/native/jniwrapper/jni_base.cpp Sun May  3
02:51:46 2015
@@ -179,30 +179,6 @@ void Env::throw_java_out_of_memory(const
 const jint LocalFrame::DEFAULT_CAPACITY = 16;
 
 
-// class Java::GlobalObject
-
-GlobalObject& GlobalObject::operator=(jobject that)
-{
-  this->~GlobalObject();
-  return *new(this) GlobalObject(Env(), that);
-}
-
-GlobalObject::~GlobalObject()
-{
-  if (m_obj)
-    Env().DeleteGlobalRef(m_obj);
-}
-
-
-// class Java::GlobalClass
-
-GlobalClass& GlobalClass::operator=(jclass that)
-{
-  this->~GlobalClass();
-  return *new(this) GlobalClass(Env(), that);
-}
-
-
 // Class Java::Object
 
 const char* const Object::m_class_name = "java/lang/Object";

Modified: subversion/trunk/subversion/bindings/javahl/native/jniwrapper/jni_globalref.hpp
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/bindings/javahl/native/jniwrapper/jni_globalref.hpp?rev=1677364&r1=1677363&r2=1677364&view=diff
==============================================================================
--- subversion/trunk/subversion/bindings/javahl/native/jniwrapper/jni_globalref.hpp (original)
+++ subversion/trunk/subversion/bindings/javahl/native/jniwrapper/jni_globalref.hpp Sun May
 3 02:51:46 2015
@@ -24,6 +24,8 @@
 #ifndef SVN_JAVAHL_JNIWRAPPER_GLOBALREF_HPP
 #define SVN_JAVAHL_JNIWRAPPER_GLOBALREF_HPP
 
+#include <memory>
+
 #include <jni.h>
 
 #include "jni_env.hpp"
@@ -43,11 +45,19 @@ public:
     : m_obj(obj ? env.NewGlobalRef(obj) : NULL)
     {}
 
-  ~GlobalObject();
+  ~GlobalObject() throw()
+    {
+      if (m_obj)
+        Env().DeleteGlobalRef(m_obj);
+    }
 
-  GlobalObject& operator=(jobject that);
+  GlobalObject& operator=(jobject that)
+    {
+      this->~GlobalObject();
+      return *new(this) GlobalObject(Env(), that);
+    }
 
-  jobject get() const
+  jobject get() const throw()
     {
       return m_obj;
     }
@@ -73,9 +83,13 @@ public:
     : GlobalObject(env, cls)
     {}
 
-  GlobalClass& operator=(jclass that);
+  GlobalClass& operator=(jclass that)
+    {
+      GlobalObject::operator=(that);
+      return *this;
+    }
 
-  jclass get() const
+  jclass get() const throw()
     {
       return jclass(GlobalObject::get());
     }



Mime
View raw message