On Thu, 16 Mar 2023 17:00:59 GMT, Naoto Sato <na...@openjdk.org> wrote:

>> @naotoj as these localedata resource files are not `.class`, the plugin 
>> should not use ASM (or Classfile API) to parse it but ASM ClassReader just 
>> happens to work.   Is the format documented anywhere?
>> 
>> @asotona  I agree that this ASM dependency should be replaced with a simple 
>> class to parse the localedata resources.   We can create a follow-up issue 
>> to document or validate the file format if appropriate.
>
> There is no common binary format for "localedata", the file in question is 
> the custom format specific for `BreakIterator`, ancient code from Taligent. 
> IIUC, only description of the format is in the source: 
> https://github.com/openjdk/jdk/blob/2f23c80e0de44815d26a7d541701e16c9c1d32bc/src/java.base/share/classes/sun/text/RuleBasedBreakIterator.java#L325

I further clarified with Naoto and I now understand the problem.    The plugin 
intends to transform `.class` that implements `LocaleDataMetaInfo` in 
`jdk.localedata` module.   It's a bug in the plugin `--include-locales=*` which 
will read all resources from `jdk.localedata` with ASM ClassReader and the 
plugin just happens to work.  The plugin should only read `.class` entries or 
specific `LocaleDataMetaInfo` implementation classes.    I created 
https://bugs.openjdk.org/browse/JDK-8304367 that Naoto will help fixing. 

@asotona your previous version converting it to ClassFile API should work after 
JDK-8304367.

-------------

PR: https://git.openjdk.org/jdk/pull/12944

Reply via email to