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

sunlan pushed a commit to branch GROOVY_4_0_X
in repository https://gitbox.apache.org/repos/asf/groovy.git


The following commit(s) were added to refs/heads/GROOVY_4_0_X by this push:
     new 3650540f52 Simplify constructing chars
3650540f52 is described below

commit 3650540f5230e6ab645d18d1305f9da006057a8f
Author: Daniel Sun <[email protected]>
AuthorDate: Wed Jan 15 00:44:51 2025 +0900

    Simplify constructing chars
---
 src/main/java/org/apache/groovy/parser/antlr4/util/StringUtils.java | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git 
a/src/main/java/org/apache/groovy/parser/antlr4/util/StringUtils.java 
b/src/main/java/org/apache/groovy/parser/antlr4/util/StringUtils.java
index d4fc339e1c..fac53d2edc 100644
--- a/src/main/java/org/apache/groovy/parser/antlr4/util/StringUtils.java
+++ b/src/main/java/org/apache/groovy/parser/antlr4/util/StringUtils.java
@@ -47,7 +47,7 @@ public class StringUtils {
                                        return _0;
                                }
 
-                               return _1 + new 
String(Character.toChars(Integer.parseInt(_2, 16)));
+                return _1 + ((char) Integer.parseInt(_2, 16));
                        }
                });
        }
@@ -63,7 +63,7 @@ public class StringUtils {
                                        return _0;
                                }
 
-                               return _1 + new 
String(Character.toChars(Integer.parseInt(_2, 8)));
+                return _1 + ((char) Integer.parseInt(_2, 8));
                        }
                });
        }
@@ -251,4 +251,4 @@ public class StringUtils {
         * Represents a failed index search.
         */
        private static final int INDEX_NOT_FOUND = -1;
-}
\ No newline at end of file
+}

Reply via email to