From bd0ed7ad8a7593f263827577f8941c0fe434da42 Mon Sep 17 00:00:00 2001 From: Samuel Audet Date: Sat, 6 Jan 2024 10:58:27 +0900 Subject: [PATCH] Update CHANGELOG.md and fix nits --- CHANGELOG.md | 1 + src/main/java/org/bytedeco/javacpp/tools/Parser.java | 12 ++++++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cf8c0e6c..071b30f7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,5 @@ + * Fix `Parser` handling of `template` specialization and their `friend` declarations ([pull #733](https://github.com/bytedeco/javacpp/pull/733)) * Improve `Parser` capabilities for `operator` and function templates ([pull #732](https://github.com/bytedeco/javacpp/pull/732)) * Fix `Parser` failing on nested initializer lists and on attributes found inside `enum` declarations * Fix `Parser` for basic containers like `std::optional >` ([issue #718](https://github.com/bytedeco/javacpp/issues/718)) diff --git a/src/main/java/org/bytedeco/javacpp/tools/Parser.java b/src/main/java/org/bytedeco/javacpp/tools/Parser.java index 93f8500a..d86f0816 100644 --- a/src/main/java/org/bytedeco/javacpp/tools/Parser.java +++ b/src/main/java/org/bytedeco/javacpp/tools/Parser.java @@ -1383,11 +1383,15 @@ Declarator declarator(Context context, String defaultName, int infoNumber, boole // template arguments Type[] types = templateArguments(context); dcl.cppName += "<"; - for (int i = 0; i 0) dcl.cppName += ","; + for (int i = 0; i < types.length; i++) { + if (i > 0) { + dcl.cppName += ","; + } dcl.cppName += types[i].cppName; } - if (dcl.cppName.endsWith(">")) dcl.cppName += " "; + if (dcl.cppName.endsWith(">")) { + dcl.cppName += " "; + } dcl.cppName += ">"; } else if (token.match(Token.IDENTIFIER) && (dcl.cppName.length() == 0 || dcl.cppName.endsWith("::"))) { @@ -1636,7 +1640,7 @@ Declarator declarator(Context context, String defaultName, int infoNumber, boole // pick the Java name from the InfoMap if appropriate String originalName = fieldPointer ? groupInfo.pointerTypes[0] : dcl.javaName; if (attr == null && defaultName == null && info != null && info.javaNames != null && info.javaNames.length > 0 - && (dcl.operator || Templates.notExists(info.cppNames[0]) || dcl.cppName.equals(info.cppNames[0]))) { + && (dcl.operator || Templates.notExists(info.cppNames[0]) || dcl.cppName.equals(info.cppNames[0]))) { dcl.javaName = info.javaNames[0]; }