You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jmeter.apache.org by vl...@apache.org on 2023/04/30 06:21:00 UTC

[jmeter] branch master updated (0a65d7ae14 -> 5020590c2d)

This is an automated email from the ASF dual-hosted git repository.

vladimirsitnikov pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/jmeter.git


    from 0a65d7ae14 fix(deps): bump activemq to 5.16.6 to support Java 8
     new 3443047c88 Use © instead of © for javadoc footer to better support non-UTF-8 encodings
     new 5020590c2d test: capture stderr in KeyToolUtils explicitly

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../jvm/src/main/kotlin/build-logic.java.gradle.kts        |  2 +-
 .../main/java/org/apache/jorphan/exec/KeyToolUtils.java    | 14 ++++++++++++--
 2 files changed, 13 insertions(+), 3 deletions(-)


[jmeter] 02/02: test: capture stderr in KeyToolUtils explicitly

Posted by vl...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

vladimirsitnikov pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/jmeter.git

commit 5020590c2dd6564e87cc2295e0090d2c6526c436
Author: Vladimir Sitnikov <si...@gmail.com>
AuthorDate: Mon Oct 31 11:49:43 2022 +0300

    test: capture stderr in KeyToolUtils explicitly
    
    By default SystemCommand redirects stderr to stdout in case stdErr hander was not set,
    which breaks output parsing when extra messages appear unexpectedly
    
    One of such messages is "Picked up _JAVA_OPTIONS: ..."
---
 .../main/java/org/apache/jorphan/exec/KeyToolUtils.java    | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/src/jorphan/src/main/java/org/apache/jorphan/exec/KeyToolUtils.java b/src/jorphan/src/main/java/org/apache/jorphan/exec/KeyToolUtils.java
index b7a5d34b4c..bef18bfbf5 100644
--- a/src/jorphan/src/main/java/org/apache/jorphan/exec/KeyToolUtils.java
+++ b/src/jorphan/src/main/java/org/apache/jorphan/exec/KeyToolUtils.java
@@ -421,8 +421,11 @@ public class KeyToolUtils {
             InputStream input, OutputStream output, String ... parameters)
             throws IOException {
         final File workingDir = keystore.getParentFile();
+        ByteArrayOutputStream stdErr = new ByteArrayOutputStream();
+        // If we omit stderr, then SystemCommand redirects stderr to stdout, and it might break keytool output
+        // with message like "Picked up _JAVA_OPTIONS: ..."
         final SystemCommand nativeCommand =
-                new SystemCommand(workingDir, 0L, 0, null, input, output, null);
+                new SystemCommand(workingDir, 0L, 0, null, input, output, stdErr);
         final List<String> arguments = new ArrayList<>();
         arguments.add(getKeyToolPath());
         arguments.add(command);
@@ -436,7 +439,14 @@ public class KeyToolUtils {
         arguments.add(alias);
         Collections.addAll(arguments, parameters);
 
-        runNativeCommand(nativeCommand, arguments);
+        try {
+            runNativeCommand(nativeCommand, arguments);
+        } catch (IOException e) {
+            if (stdErr.size() > 0) {
+                e.addSuppressed(new IOException("standard error (stderr) was: " + stdErr));
+            }
+            throw e;
+        }
     }
 
     /**


[jmeter] 01/02: Use © instead of © for javadoc footer to better support non-UTF-8 encodings

Posted by vl...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

vladimirsitnikov pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/jmeter.git

commit 3443047c888adcd951cb70f0f2bd5a8622a3d788
Author: Vladimir Sitnikov <si...@gmail.com>
AuthorDate: Tue Nov 1 09:42:17 2022 +0300

    Use &copy; instead of © for javadoc footer to better support non-UTF-8 encodings
    
    By default, javadoc uses defaultCharset encoding which is not reliable with non-latin characters
---
 build-logic/jvm/src/main/kotlin/build-logic.java.gradle.kts | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/build-logic/jvm/src/main/kotlin/build-logic.java.gradle.kts b/build-logic/jvm/src/main/kotlin/build-logic.java.gradle.kts
index 807ef91b07..783801b9b8 100644
--- a/build-logic/jvm/src/main/kotlin/build-logic.java.gradle.kts
+++ b/build-logic/jvm/src/main/kotlin/build-logic.java.gradle.kts
@@ -101,7 +101,7 @@ tasks.configureEach<Javadoc> {
         addStringOption("source", "8")
         val lastEditYear: String by rootProject.extra
         bottom =
-            "Copyright © 1998-$lastEditYear Apache Software Foundation. All Rights Reserved."
+            "Copyright &copy; 1998-$lastEditYear Apache Software Foundation. All Rights Reserved."
         if (JavaVersion.current() >= JavaVersion.VERSION_1_9) {
             addBooleanOption("html5", true)
             links("https://docs.oracle.com/javase/11/docs/api/")