subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From br...@apache.org
Subject svn commit: r1710104 - in /subversion/trunk/subversion/bindings/javahl: native/org_apache_subversion_javahl_NativeResources.cpp src/org/apache/subversion/javahl/NativeResources.java
Date Thu, 22 Oct 2015 21:13:13 GMT
Author: brane
Date: Thu Oct 22 21:13:13 2015
New Revision: 1710104

URL: http://svn.apache.org/viewvc?rev=1710104&view=rev
Log:
Fix an ABI compatibility bug in the JavaHL library initialization.

[in subversion/bindings/javahl]
* native/org_apache_subversion_javahl_NativeResources.cpp: Resurrect.
  (Java_org_apache_subversion_javahl_NativeResources_initNativeLibrary)
   Implement this as a no-op.

* src/org/apache/subversion/javahl/NativeResources.java
  (initNativeLibrary): Restore the native function declarationt that
   was removed in 1.9.
  (init): Call initNativeLibrary which is require to make 1.8 and older
   JavaHL JNI libraries initialized far enough to make the version
   check work.

Added:
    subversion/trunk/subversion/bindings/javahl/native/org_apache_subversion_javahl_NativeResources.cpp
  (with props)
Modified:
    subversion/trunk/subversion/bindings/javahl/src/org/apache/subversion/javahl/NativeResources.java

Added: subversion/trunk/subversion/bindings/javahl/native/org_apache_subversion_javahl_NativeResources.cpp
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/bindings/javahl/native/org_apache_subversion_javahl_NativeResources.cpp?rev=1710104&view=auto
==============================================================================
--- subversion/trunk/subversion/bindings/javahl/native/org_apache_subversion_javahl_NativeResources.cpp
(added)
+++ subversion/trunk/subversion/bindings/javahl/native/org_apache_subversion_javahl_NativeResources.cpp
Thu Oct 22 21:13:13 2015
@@ -0,0 +1,35 @@
+/**
+ * @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
+ *
+ * @file org_apache_subversion_javahl_NativeResources.cpp
+ * @brief Implementation of the native methods in the Java class
+ * NativeResources.
+ */
+
+#include "../include/org_apache_subversion_javahl_NativeResources.h"
+
+JNIEXPORT void JNICALL
+Java_org_apache_subversion_javahl_NativeResources_initNativeLibrary
+(JNIEnv *env, jclass jclazz)
+{
+  // No-op; see comment in NativeResources.java
+}

Propchange: subversion/trunk/subversion/bindings/javahl/native/org_apache_subversion_javahl_NativeResources.cpp
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: subversion/trunk/subversion/bindings/javahl/src/org/apache/subversion/javahl/NativeResources.java
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/bindings/javahl/src/org/apache/subversion/javahl/NativeResources.java?rev=1710104&r1=1710103&r2=1710104&view=diff
==============================================================================
--- subversion/trunk/subversion/bindings/javahl/src/org/apache/subversion/javahl/NativeResources.java
(original)
+++ subversion/trunk/subversion/bindings/javahl/src/org/apache/subversion/javahl/NativeResources.java
Thu Oct 22 21:13:13 2015
@@ -141,6 +141,7 @@ public class NativeResources
      */
     private static final void init()
     {
+        initNativeLibrary();
         version = new Version();
         if (!version.isAtLeast(1, 10, 0))
         {
@@ -158,4 +159,11 @@ public class NativeResources
                 " but the run-time version is " + runtimeVersion);
         }
     }
+
+    /**
+     * Initialize the native library layer.
+     * @note This is a no-op in 1.9+, but we need it for ABI
+     *       compatibility with older versions of the native library.
+     */
+    private static native void initNativeLibrary();
 }



Mime
View raw message