8310890: Normalize identifier names

Reviewed-by: naoto, rriggs
This commit is contained in:
Pavel Rappo 2023-06-27 15:47:29 +00:00
parent 58bb6555e7
commit f6133edb08
10 changed files with 184 additions and 184 deletions

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2008, 2021, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2008, 2023, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -40,7 +40,7 @@ public class $NAME_CLZ$ extends Charset implements HistoricallyNamedCharset
} }
public String historicalName() { public String historicalName() {
return "$NAME_HIS$"; return "$NAME_HIST$";
} }
public boolean contains(Charset cs) { public boolean contains(Charset cs) {

File diff suppressed because it is too large Load Diff

View File

@ -3,7 +3,7 @@
# used in jdk8. # used in jdk8.
############################### sbcs ######################################### ############################### sbcs #########################################
# #
# clzName csName hisName containASCII pkg # clzName csName histName containASCII pkg
# #
IBM437 IBM437 Cp437 false sun.nio.cs IBM437 IBM437 Cp437 false sun.nio.cs
IBM737 x-IBM737 Cp737 false sun.nio.cs IBM737 x-IBM737 Cp737 false sun.nio.cs
@ -46,7 +46,7 @@ IBM1112 x-IBM1112 Cp1112 false sun.nio.cs.ext
IBM1122 x-IBM1122 Cp1122 false sun.nio.cs.ext IBM1122 x-IBM1122 Cp1122 false sun.nio.cs.ext
IBM1123 x-IBM1123 Cp1123 false sun.nio.cs.ext IBM1123 x-IBM1123 Cp1123 false sun.nio.cs.ext
IBM1124 x-IBM1124 Cp1124 false sun.nio.cs.ext IBM1124 x-IBM1124 Cp1124 false sun.nio.cs.ext
# map tables for 1140-1149 are updated manualy with the u+20ac entry # map tables for 1140-1149 are updated manually with the u+20ac entry
IBM1140 IBM01140 Cp1140 false sun.nio.cs.ext IBM1140 IBM01140 Cp1140 false sun.nio.cs.ext
IBM1141 IBM01141 Cp1141 false sun.nio.cs.ext IBM1141 IBM01141 Cp1141 false sun.nio.cs.ext
IBM1142 IBM01142 Cp1142 false sun.nio.cs.ext IBM1142 IBM01142 Cp1142 false sun.nio.cs.ext
@ -85,7 +85,7 @@ IBM875 x-IBM875 Cp875 false sun.nio.cs.ext
IBM918 IBM918 Cp918 false sun.nio.cs.ext IBM918 IBM918 Cp918 false sun.nio.cs.ext
IBM921 x-IBM921 Cp921 false sun.nio.cs.ext IBM921 x-IBM921 Cp921 false sun.nio.cs.ext
IBM922 x-IBM922 Cp922 false sun.nio.cs.ext IBM922 x-IBM922 Cp922 false sun.nio.cs.ext
# use name as hisname as well, cs did not support hisname prevously # use name as histname as well, cs did not support histname previously
ISO_8859_11 x-iso-8859-11 x-iso-8859-11 true sun.nio.cs.ext ISO_8859_11 x-iso-8859-11 x-iso-8859-11 true sun.nio.cs.ext
ISO_8859_3 ISO-8859-3 ISO8859_3 true sun.nio.cs.ext ISO_8859_3 ISO-8859-3 ISO8859_3 true sun.nio.cs.ext
ISO_8859_6 ISO-8859-6 ISO8859_6 true sun.nio.cs.ext ISO_8859_6 ISO-8859-6 ISO8859_6 true sun.nio.cs.ext
@ -113,7 +113,7 @@ TIS_620 TIS-620 TIS620 true sun.nio.cs.ext
# #
############################### dbcs ######################################### ############################### dbcs #########################################
# #
#clzName csName hisName dbtype pkg ascii b1min b1max b2min b2max #clzName csName histName dbtype pkg ascii b1min b1max b2min b2max
# #
Big5 Big5 Big5 basic sun.nio.cs.ext true 0xa1 0xf9 0x40 0xfe Big5 Big5 Big5 basic sun.nio.cs.ext true 0xa1 0xf9 0x40 0xfe
Johab x-Johab x-Johab basic sun.nio.cs.ext true 0x84 0xf9 0x31 0xfe Johab x-Johab x-Johab basic sun.nio.cs.ext true 0x84 0xf9 0x31 0xfe

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2015, 2023, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -29,7 +29,7 @@ class Charset {
String pkgName; String pkgName;
String clzName; String clzName;
String csName; String csName;
String hisName; String histName;
String type; String type;
String os; String os;
boolean isASCII; boolean isASCII;

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2010, 2023, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -43,7 +43,7 @@ public class DBCS {
{ {
String clzName = cs.clzName; String clzName = cs.clzName;
String csName = cs.csName; String csName = cs.csName;
String hisName = cs.hisName; String histName = cs.histName;
String pkgName = cs.pkgName; String pkgName = cs.pkgName;
boolean isASCII = cs.isASCII; boolean isASCII = cs.isASCII;
int b1Min = cs.b1Min; int b1Min = cs.b1Min;
@ -152,8 +152,8 @@ public class DBCS {
Scanner s = new Scanner(new File(srcDir, template)); Scanner s = new Scanner(new File(srcDir, template));
PrintStream ops = new PrintStream(new FileOutputStream( PrintStream ops = new PrintStream(new FileOutputStream(
new File(dstDir, clzName + ".java"))); new File(dstDir, clzName + ".java")));
if (hisName == null) if (histName == null)
hisName = ""; histName = "";
// (5) c2b replacement, only used for JIs0208/0212, which // (5) c2b replacement, only used for JIs0208/0212, which
// are two pure db charsets so default '3f' does not work // are two pure db charsets so default '3f' does not work
@ -174,7 +174,7 @@ public class DBCS {
continue; continue;
} }
line = line.replace("$PACKAGE$" , pkgName) line = line.replace("$PACKAGE$" , pkgName)
.replace("$IMPLEMENTS$", (hisName == null)? .replace("$IMPLEMENTS$", (histName == null)?
"" : "implements HistoricallyNamedCharset") "" : "implements HistoricallyNamedCharset")
.replace("$NAME_CLZ$", clzName) .replace("$NAME_CLZ$", clzName)
.replace("$NAME_ALIASES$", .replace("$NAME_ALIASES$",
@ -189,8 +189,8 @@ public class DBCS {
"return ((cs.name().equals(\"US-ASCII\")) || (cs instanceof " + clzName + "));": "return ((cs.name().equals(\"US-ASCII\")) || (cs instanceof " + clzName + "));":
"return (cs instanceof " + clzName + ");")) "return (cs instanceof " + clzName + ");"))
.replace("$HISTORICALNAME$", .replace("$HISTORICALNAME$",
(hisName == null)? "" : (histName == null)? "" :
" public String historicalName() { return \"" + hisName + "\"; }") " public String historicalName() { return \"" + histName + "\"; }")
.replace("$DECTYPE$", type) .replace("$DECTYPE$", type)
.replace("$ENCTYPE$", type) .replace("$ENCTYPE$", type)
.replace("$B1MIN$" , "0x" + Integer.toString(b1Min, 16)) .replace("$B1MIN$" , "0x" + Integer.toString(b1Min, 16))

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2009, 2017, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2009, 2023, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -155,7 +155,7 @@ public class Main {
throw new RuntimeException("Error: incorrect charset line [" + line + "]"); throw new RuntimeException("Error: incorrect charset line [" + line + "]");
} }
if ((cs = charsets.get(tokens[2])) != null) { if ((cs = charsets.get(tokens[2])) != null) {
throw new RuntimeException("Error: deplicate charset line [" + line + "]"); throw new RuntimeException("Error: duplicate charset line [" + line + "]");
} }
cs = new Charset(); cs = new Charset();
cs.csName = tokens[1]; cs.csName = tokens[1];
@ -179,8 +179,8 @@ public class Main {
case "os": case "os":
cs.os = tokens[2]; cs.os = tokens[2];
break; break;
case "hisname": case "histname":
cs.hisName = tokens[2]; cs.histName = tokens[2];
break; break;
case "ascii": case "ascii":
cs.isASCII = Boolean.parseBoolean(tokens[2]); cs.isASCII = Boolean.parseBoolean(tokens[2]);
@ -229,7 +229,7 @@ public class Main {
static void verbose(Charset cs) { static void verbose(Charset cs) {
System.out.printf("%s, %s, %s, %s, %s %b%n", System.out.printf("%s, %s, %s, %s, %s %b%n",
cs.clzName, cs.csName, cs.hisName, cs.pkgName, cs.type, cs.isASCII); cs.clzName, cs.csName, cs.histName, cs.pkgName, cs.type, cs.isASCII);
} }
static int toInteger(String s) { static int toInteger(String s) {

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2008, 2019, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2008, 2023, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -43,7 +43,7 @@ public class SBCS {
{ {
String clzName = cs.clzName; String clzName = cs.clzName;
String csName = cs.csName; String csName = cs.csName;
String hisName = cs.hisName; String histName = cs.histName;
String pkgName = cs.pkgName; String pkgName = cs.pkgName;
boolean isASCII = cs.isASCII; boolean isASCII = cs.isASCII;
boolean isLatin1Decodable = true; boolean isLatin1Decodable = true;
@ -170,8 +170,8 @@ public class SBCS {
line = line.replace("$NAME_ALIASES$", line = line.replace("$NAME_ALIASES$",
"ExtendedCharsets.aliasesFor(\"" + csName + "\")"); "ExtendedCharsets.aliasesFor(\"" + csName + "\")");
} }
if (line.indexOf("$NAME_HIS$", i) != -1) { if (line.indexOf("$NAME_HIST$", i) != -1) {
line = line.replace("$NAME_HIS$", hisName); line = line.replace("$NAME_HIST$", histName);
} }
if (line.indexOf("$CONTAINS$", i) != -1) { if (line.indexOf("$CONTAINS$", i) != -1) {
if (isASCII) if (isASCII)

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2003, 2022, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2003, 2023, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -608,10 +608,10 @@ public class EnumMap<K extends Enum<K>, V> extends AbstractMap<K, V>
return false; return false;
V ourValue = unmaskNull(vals[index]); V ourValue = unmaskNull(vals[index]);
Object hisValue = e.getValue(); Object otherValue = e.getValue();
return (e.getKey() == keyUniverse[index] && return (e.getKey() == keyUniverse[index] &&
(ourValue == hisValue || (ourValue == otherValue ||
(ourValue != null && ourValue.equals(hisValue)))); (ourValue != null && ourValue.equals(otherValue))));
} }
public int hashCode() { public int hashCode() {
@ -685,9 +685,9 @@ public class EnumMap<K extends Enum<K>, V> extends AbstractMap<K, V>
// Key types match, compare each value // Key types match, compare each value
for (int i = 0; i < keyUniverse.length; i++) { for (int i = 0; i < keyUniverse.length; i++) {
Object ourValue = vals[i]; Object ourValue = vals[i];
Object hisValue = em.vals[i]; Object otherValue = em.vals[i];
if (hisValue != ourValue && if (otherValue != ourValue &&
(hisValue == null || !hisValue.equals(ourValue))) (otherValue == null || !otherValue.equals(ourValue)))
return false; return false;
} }
return true; return true;

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2003, 2022, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2003, 2023, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -383,20 +383,20 @@ class AnnotationInvocationHandler implements InvocationHandler, Serializable {
continue; continue;
String member = memberMethod.getName(); String member = memberMethod.getName();
Object ourValue = memberValues.get(member); Object ourValue = memberValues.get(member);
Object hisValue = null; Object otherValue = null;
AnnotationInvocationHandler hisHandler = asOneOfUs(o); AnnotationInvocationHandler otherHandler = asOneOfUs(o);
if (hisHandler != null) { if (otherHandler != null) {
hisValue = hisHandler.memberValues.get(member); otherValue = otherHandler.memberValues.get(member);
} else { } else {
try { try {
hisValue = memberMethod.invoke(o); otherValue = memberMethod.invoke(o);
} catch (InvocationTargetException e) { } catch (InvocationTargetException e) {
return false; return false;
} catch (IllegalAccessException e) { } catch (IllegalAccessException e) {
throw new AssertionError(e); throw new AssertionError(e);
} }
} }
if (!memberValueEquals(ourValue, hisValue)) if (!memberValueEquals(ourValue, otherValue))
return false; return false;
} }
return true; return true;

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2017, 2022, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2017, 2023, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -451,7 +451,7 @@ public class TestCharsetMapping {
String pkgName; String pkgName;
String clzName; String clzName;
String csName; String csName;
String hisName; String histName;
String type; String type;
boolean isInternal; boolean isInternal;
Set<String> aliases = new HashSet<>(); Set<String> aliases = new HashSet<>();
@ -552,7 +552,7 @@ public class TestCharsetMapping {
cs.type = tokens[2]; cs.type = tokens[2];
break; break;
case "hisname": case "hisname":
cs.hisName = tokens[2]; cs.histName = tokens[2];
break; break;
case "internal": case "internal":
cs.isInternal = Boolean.parseBoolean(tokens[2]); cs.isInternal = Boolean.parseBoolean(tokens[2]);