From 66738d6e8345944d8eb9bb828647dd3d6fdc7c68 Mon Sep 17 00:00:00 2001 From: Samuel Audet Date: Mon, 8 Mar 2021 12:24:58 +0900 Subject: [PATCH] Release version 1.5.5 --- CHANGELOG.md | 1 + README.md | 8 ++++---- platform/pom.xml | 2 +- pom.xml | 2 +- .../java/org/bytedeco/javacpp/ClassProperties.java | 6 ++---- .../java/org/bytedeco/javacpp/tools/Generator.java | 12 ++++++++++++ 6 files changed, 21 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0031dea91..7c615fe60 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,5 @@ +### March 8, 2021 version 1.5.5 * Ensure `System.gc()` never gets called with "org.bytedeco.javacpp.nopointergc" ([issue tensorflow/java#208](https://github.com/tensorflow/java/issues/208)) * Add `Info.immutable` to disable generating setters for public data members ([pull #461](https://github.com/bytedeco/javacpp/pull/461)) * Map `String` to `char*` with `Charset.forName(STRING_BYTES_CHARSET)` when that macro is defined ([pull #460](https://github.com/bytedeco/javacpp/pull/460)) diff --git a/README.md b/README.md index 9e6f9b02f..658cb1c14 100644 --- a/README.md +++ b/README.md @@ -26,27 +26,27 @@ We can also have everything downloaded and installed automatically with: org.bytedeco javacpp - 1.5.4 + 1.5.5 ``` * Gradle (inside the `build.gradle` file) ```groovy dependencies { - implementation group: 'org.bytedeco', name: 'javacpp', version: '1.5.4' + implementation group: 'org.bytedeco', name: 'javacpp', version: '1.5.5' } ``` * Leiningen (inside the `project.clj` file) ```clojure :dependencies [ - [org.bytedeco/javacpp "1.5.4"] + [org.bytedeco/javacpp "1.5.5"] ] ``` * sbt (inside the `build.sbt` file) ```scala - libraryDependencies += "org.bytedeco" % "javacpp" % "1.5.4" + libraryDependencies += "org.bytedeco" % "javacpp" % "1.5.5" ``` Another option available to Gradle users is [Gradle JavaCPP](https://github.com/bytedeco/gradle-javacpp), and similarly for Scala users there is [SBT-JavaCPP](https://github.com/bytedeco/sbt-javacpp). diff --git a/platform/pom.xml b/platform/pom.xml index 4b40e996d..9d7fe5688 100644 --- a/platform/pom.xml +++ b/platform/pom.xml @@ -4,7 +4,7 @@ 4.0.0 org.bytedeco javacpp-platform - 1.5.5-SNAPSHOT + 1.5.5 JavaCPP Platform The missing bridge between Java and native C++ diff --git a/pom.xml b/pom.xml index d3050e0f4..3aa1d857f 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ 4.0.0 org.bytedeco javacpp - 1.5.5-SNAPSHOT + 1.5.5 JavaCPP The missing bridge between Java and native C++ diff --git a/src/main/java/org/bytedeco/javacpp/ClassProperties.java b/src/main/java/org/bytedeco/javacpp/ClassProperties.java index 552db195c..96f614e71 100644 --- a/src/main/java/org/bytedeco/javacpp/ClassProperties.java +++ b/src/main/java/org/bytedeco/javacpp/ClassProperties.java @@ -111,11 +111,9 @@ public void addAll(String key, Collection values) { new File(root + value).exists()) { value = root + value; } - if (values2.contains(value)) { - // remove existing values to allow overriding them - values2.remove(value); + if (!values2.contains(value)) { + values2.add(value); } - values2.add(value); } } } diff --git a/src/main/java/org/bytedeco/javacpp/tools/Generator.java b/src/main/java/org/bytedeco/javacpp/tools/Generator.java index c6708234f..6bfa65288 100644 --- a/src/main/java/org/bytedeco/javacpp/tools/Generator.java +++ b/src/main/java/org/bytedeco/javacpp/tools/Generator.java @@ -2364,6 +2364,12 @@ String returnBefore(MethodInformation methodInfo) { } } } else if (methodInfo.returnType == String.class) { + if (returnBy instanceof ByPtrPtr) { + typeName[0] = valueTypeName; + } + if (!typeName[0].startsWith("const ")) { + typeName[0] = "const " + typeName[0]; + } out.println(" jstring rarg = NULL;"); out.println(" " + typeName[0] + " rptr;"); if (returnBy instanceof ByRef) { @@ -3179,6 +3185,12 @@ void callback(Class cls, Method callbackMethod, String callbackName, int allo out.println(" args[" + j + "].l = obj" + j + ";"); } else if (callbackParameterTypes[j] == String.class) { passesStrings = true; + if (passBy instanceof ByPtrPtr) { + typeName[0] = valueTypeName; + } + if (!typeName[0].startsWith("const ")) { + typeName[0] = "const " + typeName[0]; + } if (adapterInfo != null) { final String adapter = "adapter" + j; out.println(" jstring obj" + j + " = " + createString("(" + typeName[0] + ") " + adapter, adapter, callbackParameterAnnotations[j]));