Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bump JSP to Unicode 14 #93

Merged
merged 8 commits into from
Jul 21, 2021
Merged

bump JSP to Unicode 14 #93

merged 8 commits into from
Jul 21, 2021

Conversation

srl295
Copy link
Member

@srl295 srl295 commented Jul 12, 2021

Fixes: #88

see diary here: https://gist.github.com/srl295/a788b4de315cd919bb5f0f4e3b2f69c7 (search for 'SRL')

also:
Fixes #103

@srl295
Copy link
Member Author

srl295 commented Jul 15, 2021

blocked by and based on. #44

srl295 added 3 commits July 20, 2021 11:15
Step 1a text files
For #88
- GenerateSubtagNames
- Extra{Property,PropertyValue}Aliases.txt
- PropertyAliases.txt from 14.0.0
- copied props with CopyPropsToUnicodeJsp
- leave some space between ICU and collections such as Hans
- replace some synchornized and static init with Bill Pugh singletons

for #88
@srl295 srl295 force-pushed the srl295/issue88-jsp-14 branch from 0602af8 to a3cf705 Compare July 20, 2021 16:16
@srl295 srl295 marked this pull request as ready for review July 20, 2021 19:37
@srl295 srl295 requested review from macchiati and markusicu July 20, 2021 19:37
@srl295 srl295 self-assigned this Jul 20, 2021
@srl295 srl295 force-pushed the srl295/issue88-jsp-14 branch from 73f1434 to c9461c5 Compare July 20, 2021 21:11
macchiati
macchiati previously approved these changes Jul 20, 2021
@@ -44,7 +44,7 @@
final BiMultimap<String,String> nameToAliases = new BiMultimap<String,String>(null,null);
final Map<String,BiMultimap<String,String>> nameToValueToAliases = new LinkedHashMap();

static CachedProps CACHED_PROPS = getInstance(VersionInfo.getInstance(12));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm surprised at this; if based on master it would be replacing 13 by 14.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this a bug? I hadn't changed this value. Should it be calculated ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lemme check.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, that should be the version of the beta props. I think it is built that way so that it doesn't pull in the BIN properties if BETA is off. For now, let's just leave it at 14, but file an issue.

* @param version
* @return
*/
public String versionToString(VersionInfo version) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a method on VersionInfo that produces a string with specified fields. Should be used instead of string building. Could be fixed later if you want.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I saw that but it is ICU @Internal and has its own behavior.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We use it in a bunch of places, and frankly there isn't a good reason for it not to be public. Mark

But this isn't a blocker at all!!

@macchiati
Copy link
Member

macchiati commented Jul 20, 2021 via email

@@ -44,7 +44,7 @@
final BiMultimap<String,String> nameToAliases = new BiMultimap<String,String>(null,null);
final Map<String,BiMultimap<String,String>> nameToValueToAliases = new LinkedHashMap();

static CachedProps CACHED_PROPS = getInstance(VersionInfo.getInstance(12));
static CachedProps CACHED_PROPS = getInstance(VersionInfo.getInstance(14));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be driven by the version string in class Settings?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a bit more complicated than that because of the interplay with the beta flag. I suggested that we go with 14 for now, and file an issue. We don't want to wait on the fuller solution.

@@ -9,6 +9,10 @@
import java.util.Set;
import java.util.TreeMap;
import java.util.TreeSet;
import java.util.Map.Entry;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know that Eclipse is dumb about this, but it would be much better to only import Map, and use Map.Entry in call sites.

Comment on lines +70 to +71
// Verify we didn't run over
if (newCode >= LIMIT) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need a hard limit?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if we have more than 'extrascripts' scripts, yes

Comment on lines +53 to +55
// Scripts without stable numbers
{"Hant", "Han Traditional"}, {"Hans", "Han Simplified"},
};
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need these? ICU has UScript.SIMPLIFIED_HAN and UScript.TRADITIONAL_HAN.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure.

LIMIT = UScript.CODE_LIMIT; // HANS + 1;

private static String[][] EXTENDED_NAME = {{"Hant", "Han Traditional"}, {"Hans", "Han Simplified"}};
LIMIT = UScript.CODE_LIMIT + EXTRA_COUNT; // HANS + 1;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove the comments about HANT/HANS -- since we have real UScript constants for them.

@@ -1,4 +1,4 @@
# Building UnicodeJsp
git # Building UnicodeJsp
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

docs/unicodejsps/index.md Outdated Show resolved Hide resolved
String fromDir = Settings.Output.BIN_DIR + latest.getUcdVersion() + "/";
VersionInfo ucdVersion = latest.getUcdVersion();
System.out.println("Copying Props for " + ucdVersion + " into JSP");
String fromDir = Settings.Output.BIN_DIR + ucdVersion + "/";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no tabs please

@@ -27,7 +28,8 @@

public class ListProps {

private static final UcdProperty DEBUG_LIST_VALUES = null ; // UcdProperty.Confusable_MA;
private static final String BIN_PROPS = Settings.Output.BIN_DIR;
private static final UcdProperty DEBUG_LIST_VALUES = null ; // UcdProperty.Confusable_MA;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tab

if (this != emoji) {
// 13.1, 14.0
sb.append(".")
.append(version.getMicro());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

getMicro() --> getMilli()

or indeed better call internal-for-CLDR-etc getVersionString()

public static final String UCD_DIR = DATA_DIR + "ucd/";
// TODO: IDN_DIR is used, but there is no .../data/IDN/ folder. Should this be .../data/idna/ ?
public static final String IDN_DIR = DATA_DIR + "IDN/";
// TODO: DICT_DIR is used, but there is no .../data/dict/ folder. ??
public static final String DICT_DIR = DATA_DIR + "dict/";

public enum DataDir {
security,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

enum constants should be uppercase

@@ -70,11 +76,58 @@ private static final String getRequiredPathAndFix(String key) {
public static final String UNICODETOOLS_DIR = UNICODETOOLS_REPO_DIR + "unicodetools/";
public static final String UNICODEJSPS_DIR = UNICODETOOLS_REPO_DIR + "UnicodeJsps/";
public static final String DATA_DIR = UNICODETOOLS_DIR + "data/";
public static final Path DATA_FILE = Paths.get(DATA_DIR);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

private?

}

public static void main(String args[]) throws IOException {
generateSubtagNames(); // this takes a sec, so run it first
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

indent 4 please

unicodetools/org/unicode/tools/UpdateJspFiles.java Outdated Show resolved Hide resolved
- typo/tab fixes
- add a unit test for Settings.UnicodeTools.DataDir
- Apply other suggestions from code review

Co-authored-by: Markus Scherer <markus.icu@gmail.com>
@srl295 srl295 force-pushed the srl295/issue88-jsp-14 branch from 8ffe009 to 933d2b8 Compare July 21, 2021 17:05
@srl295 srl295 requested review from markusicu and macchiati July 21, 2021 17:06
@srl295
Copy link
Member Author

srl295 commented Jul 21, 2021

OK, please take a look

Copy link
Member

@macchiati macchiati left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Go for it!

@srl295 srl295 merged commit 122b9b9 into main Jul 21, 2021
@srl295 srl295 deleted the srl295/issue88-jsp-14 branch July 21, 2021 17:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

What are /bin-props/? jsp: to Beta 14.0.0 data
3 participants