You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by el...@apache.org on 2025/08/12 11:11:25 UTC

(maven-scm) branch utf created (now 80a8e1768)

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

elharo pushed a change to branch utf
in repository https://gitbox.apache.org/repos/asf/maven-scm.git


      at 80a8e1768 Use Charset to remove formal need for RuntimeException

This branch includes the following new commits:

     new 80a8e1768 Use Charset to remove formal need for RuntimeException

The 1 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.



(maven-scm) 01/01: Use Charset to remove formal need for RuntimeException

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

elharo pushed a commit to branch utf
in repository https://gitbox.apache.org/repos/asf/maven-scm.git

commit 80a8e1768fe441f9d7b341f5479eddb3e422b7f4
Author: Elliotte Rusty Harold <el...@ibiblio.org>
AuthorDate: Tue Aug 12 07:11:14 2025 -0400

    Use Charset to remove formal need for RuntimeException
---
 .../provider/git/gitexe/command/status/GitStatusConsumer.java  | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/main/java/org/apache/maven/scm/provider/git/gitexe/command/status/GitStatusConsumer.java b/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/main/java/org/apache/maven/scm/provider/git/gitexe/command/status/GitStatusConsumer.java
index 68b8a878c..fa525c65a 100644
--- a/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/main/java/org/apache/maven/scm/provider/git/gitexe/command/status/GitStatusConsumer.java
+++ b/maven-scm-providers/maven-scm-providers-git/maven-scm-provider-gitexe/src/main/java/org/apache/maven/scm/provider/git/gitexe/command/status/GitStatusConsumer.java
@@ -19,9 +19,9 @@
 package org.apache.maven.scm.provider.git.gitexe.command.status;
 
 import java.io.File;
-import java.io.UnsupportedEncodingException;
 import java.net.URI;
 import java.net.URISyntaxException;
+import java.nio.charset.StandardCharsets;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.regex.Matcher;
@@ -376,11 +376,7 @@ private static String unescape(String fileEntry) {
                 break;
             }
         }
-        try {
-            // explicit say UTF-8, otherwise it'll fail at least on Windows cmdline
-            return new String(outba, 0, outSub, "UTF-8");
-        } catch (UnsupportedEncodingException e) {
-            throw new RuntimeException(e);
-        }
+      // explicitly say UTF-8, otherwise it'll fail at least on Windows cmdline
+      return new String(outba, 0, outSub, StandardCharsets.UTF_8);
     }
 }