Re: Use single character replace variant in Resources.toPackageName(String)

2020-01-09 Thread Ivan Gerasimov
FYI.  I changed the year to 2020 and pushed the fix. Thank you Christoph and Alan! On 1/6/20 11:49 PM, Alan Bateman wrote: On 07/01/2020 07:09, Ivan Gerasimov wrote: So, I filed a Jira bug: BUGURL: https://bugs.openjdk.java.net/browse/JDK-8236705 WEBREV: http://cr.openjdk.java.net/~igerasim/8

Re: Use single character replace variant in Resources.toPackageName(String)

2020-01-06 Thread Christoph Dreis
Hi Ivan, I was indeed running with JDK 11 instead of JDK 13 (sorry), but like you I still think it's worthwhile. >BUGURL: https://bugs.openjdk.java.net/browse/JDK-8236705 >WEBREV: http://cr.openjdk.java.net/~igerasim/8236705/00/webrev/ > If we agree on the content of the fix, I can pus

Re: Use single character replace variant in Resources.toPackageName(String)

2020-01-06 Thread Alan Bateman
On 07/01/2020 07:09, Ivan Gerasimov wrote: So, I filed a Jira bug: BUGURL: https://bugs.openjdk.java.net/browse/JDK-8236705 WEBREV: http://cr.openjdk.java.net/~igerasim/8236705/00/webrev/ I added these source files in JDK 9, it was just an oversight that I didn't use the single char replace. M

Re: Use single character replace variant in Resources.toPackageName(String)

2020-01-06 Thread Ivan Gerasimov
So, I filed a Jira bug: BUGURL: https://bugs.openjdk.java.net/browse/JDK-8236705 WEBREV: http://cr.openjdk.java.net/~igerasim/8236705/00/webrev/ If we agree on the content of the fix, I can push it after a sanity build. With kind regards, Ivan On 1/6/20 10:41 PM, Ivan Gerasimov wrote: Hi Ch

Re: Use single character replace variant in Resources.toPackageName(String)

2020-01-06 Thread Ivan Gerasimov
Hi Christoph! First, the same optimization can be done in src/java.base/share/classes/jdk/internal/module/ModulePath.java:     mainClass = mainClass.replace("/", "."); Second, I wonder what was the JDK version you ran your benchmark on? After the fix for JDK-8222955 the method rep

Use single character replace variant in Resources.toPackageName(String)

2020-01-06 Thread Christoph Dreis
Hi and a happy new year, I recently noticed that jdk.internal.module.Resources.toPackageName(String) makes use of String.replace(CharSequence, CharSequence) while it could use the single char variant in my opinion: diff --git a/src/java.base/share/classes/jdk/internal/module/Resources.java b/s