Source of sun.nio.cs.StandardCharsets.java - Please help!
Xueming Shen
Xueming.Shen at Sun.COM
Mon Apr 13 22:16:21 UTC 2009
Ulf Zibis wrote:
>
> > it should be simplified to something like below (let me know if I'm
> wrong on this one)
>
> I'm not sure, if I'm the right person to "review" your
My apology for the confusion. "that" is not for you, the author of that
script is still here:-) so I asked just in case, but
I believe he is just too busy to look back.
>
> You said, I could run the awk script myself from cygwin. As I'm also
> not familiar to cygwin till this day, can you please give me an
> example, what I should type in at cygwin shell to run the
> genCharsetProvider.sh script, for my first attempt at walking.
I'm still using MKS ksh, but it should not matter. For that particular
script, you can copy/paste the command from the the
makefile, so it should look like
sh -e genCharsetprovider.sh {TheDirOf}/standard-charsets {DestinateDir}
before that you should also
(1)copy Mark's Hasher to current dir and compile it
(2)do something to the addNotices.sh script, it would be easy to simply
remove it from the script for now
(3)add "HASHER='java Hasher' at the beginning of the script
(4)add "NAWK=awk" at the beginning.
Then start your awk hack.
I would be happy to do the following for you, but I'm still not quite
sure about (2), it might be easy if you just send me the
result you would like to see. OK, I have not written any awk script for
12 years, so don't count on me:-) If you are really
not familiar with it, I would suggest you simply write a small java tool
(use Scanner, for example) to generate whatever you
like.
>
> My modified "awk script" is supposed to do following:
> (1) If variable $3, the charset class name, starts with "%", creation
> of the static String[] aliases should be omitted.
> (2) If variable $3 equals "%S", it should be replaced by constant
> SINGLE_BYTE_CLN. SINGLE_BYTE_CLN should be defined in
> FastCharsetProvider.java, from which StandardCharsets.java is
> subclassed from, as following:
> static final String SINGLE_BYTE_CLN = "SingleByteCharset";
> For running the script first, maybe it should be inlined directly
> as "SingleByteCharset" to make it simpler.
> (3) invokation of constructor should be shortened to:
> super("$PKG", new Aliases(), new Classes());
> (for details, why saving 1 HashMap in constructor, see:
> http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6790402)
>
> In awaiting your additional answer,
>
> -Ulf
>
>
>
> Am 12.04.2009 09:43, Xueming Shen schrieb:
>> Ulf,
>>
>> While I am kind of able to guess what you want to achieve I'm not
>> sure I understand what
>> your modified "awk script" is supposed to do. genCharsetProvider.sh
>> is a shell scrip + awk,
>> it should be easy to experiment in any popular shell tool (cygwin)
>> without a C/C++ compiler
>> installed. I have to admit that I am not aware that awk supports the
>> syntax you are using, so I
>> can't help more on them.
>>
>> Just took a quick look at the original awk script, it looks like
>> there might be some "old" leftover code,
>> it should be simplified to something like below (let me know if I'm
>> wrong on this one)
>>
>> Sherman
>>
>> ------------------------------------
>> 72c72,73
>> < BEGIN { n = 1; }
>> ---
>> > BEGIN { n = 1; m = 1; }
>> >
>> 74c75,79
>> < n++;
>> ---
>> > csn = $2; cln = $3;
>> > lcsn = tolower(csn);
>> > lcsns[n++] = lcsn;
>> > csns[lcsn] = csn;
>> > classMap[lcsn] = cln;
>> 77c82
>> < printf " static final String[] aliases_%s = new String[]
>> {\n", $3;
>> ---
>> > printf " static final String[] aliases_%s = new String[]
>> {\n", cln;
>> 80a86,87
>> > acsns[m++] = tolower($2);
>> > aliasMap[tolower($2)] = lcsn;
>> 88a96
>> >
>>
>>
>> Ulf Zibis wrote:
>>> Hi all,
>>>
>>> as I'm working on Windows and I don't have Microsoft Visual Studio
>>> C++ 2008 (VS2008) Standard Edition compiler, I can't run makefiles.
>>>
>>> So I ask you, if somebody can run
>>> OpenJDK7\jdk\make\java\nio\Makefile for me, to generate source of
>>> sun.nio.cs.StandardCharsets.java (output of >
>>> \jdk\make\java\nio\genCharsetProvider.sh).
>>>
>>> Additionally I have modified (see attachment):
>>> OpenJDK7\jdk\make\java\nio\genCharsetProvider.sh
>>> OpenJDK7\jdk\src\share\classes\sun\nio\cs\standard-charsets
>>>
>>> Please too run the makefile with my modifications, and send me the
>>> resulting output sun.nio.cs.StandardCharsets.java.
>>> If there are some syntax errors (I'm not familiar with make syntax)
>>> in my modified genCharsetProvider.sh, please try to correct them.
>>>
>>> Thanks in advance for your investigation,
>>>
>>> -Ulf
>>>
>>> P.S.: please send your answer via the mailing list, so nobody would
>>> do the work twice.
>>
>>
>
More information about the core-libs-dev
mailing list