ICU-1948 fix alias handling in the perl file

X-SVN-Rev: 9110
This commit is contained in:
Ram Viswanadha 2002-07-12 05:18:15 +00:00
parent 2d0512330f
commit 525f969f4c
2 changed files with 14 additions and 13 deletions

View File

@ -99,7 +99,7 @@ foreach my $loc (sort keys %aliases) {
my $aliasee = $aliases{$loc};
if (!exists($patched{$alias})) {
# Patch the alias
patchAliasee($aliasee);
#patchAliasee($aliasee);
$patched{$aliasee} = 1;
}
patchAlias($loc, $aliasee);
@ -182,10 +182,10 @@ sub patchAliasee {
open(IN, $file) or die;
open(OUT, ">$file.new") or die;
while (<IN>) {
# if (/^\s*contents\s*=\s*new\s+Object/) {
# print OUT " contents = _contents;\n";
#if (/^\s*data\s*=\s*new\s+Object/) {
# print OUT " super.contents = data;\n";
# print OUT " };\n";
# print OUT ' static final Object[][] _contents =', "\n";
# print OUT ' static final Object[][] data =', "\n";
# s/^\s*contents\s*=\s*/ /;
# print OUT;
# } elsif (/^\s*\}\s*;/) {
@ -214,16 +214,17 @@ sub patchAlias {
my $file = "LocaleElements_$loc.java";
open(IN, $file) or die;
open(OUT, ">$file.new") or die;
my $var = "static final Object";
while (<IN>) {
if (/^\s*contents\s*=\s*new\s+Object/) {
# Consume the next 5 lines
<IN>;
<IN>;
<IN>;
<IN>;
<IN>;
if(/$var/){
# Output our new data
print OUT " contents = LocaleElements_$aliasee._contents;\n";
print OUT " static final Object[][] data = LocaleElements_$aliasee.data;\n";
#consume the next 3 lines
<IN>;
<IN>;
<IN>;
<IN>;
<IN>;
} else {
print OUT;
}

View File

@ -78,7 +78,7 @@ static const char* javaClassICU= " extends ICUListResourceBundle {\n\n"
" public %s () {\n"
" super.contents = data;\n"
" }\n"
" private static Object[][] data = new Object[][] { \n";
" static final Object[][] data = new Object[][] { \n";
static int tabCount = 3;
static FileStream* out=NULL;