addon to 8230613: Better ASCII conversions ?

Baesken, Matthias matthias.baesken at sap.com
Thu Jul 16 10:53:40 UTC 2020


Hello, recent change

https://hg.openjdk.java.net/jdk/jdk/rev/9e70cd55ae08

8230613: Better ASCII conversions

Adjusted one place  in  file Punycode.java   to throw  the declared ParseException in

    public static StringBuffer encode(StringBuffer src, boolean[] caseFlags) throws ParseException{  ...  }

I think we should  better adjust  the  remaining  throw   in  the same method  as well to a ParseException .  See  small patch below.
Should I open a JBS  issue  for this ?

Thanks, Matthias



diff -r 0150b301ac5a src/java.base/share/classes/jdk/internal/icu/impl/Punycode.java
--- a/src/java.base/share/classes/jdk/internal/icu/impl/Punycode.java   Wed Jul 15 21:24:39 2020 -0700
+++ b/src/java.base/share/classes/jdk/internal/icu/impl/Punycode.java   Thu Jul 16 12:49:07 2020 +0200
@@ -252,7 +252,7 @@
              * <n,i> state to <m,0>, but guard against overflow:
              */
             if(m-n>(0x7fffffff-MAX_CP_COUNT-delta)/(handledCPCount+1)) {
-                throw new RuntimeException("Internal program error");
+                throw new ParseException("Internal program error, potential overflow", -1);
             }
             delta+=(m-n)*(handledCPCount+1);
             n=m;


More information about the core-libs-dev mailing list