From dbf1b048d609cdcde26b43ecd66a4017bd482bc4 Mon Sep 17 00:00:00 2001 From: Elango Cheran Date: Thu, 19 Sep 2024 22:27:17 +0000 Subject: [PATCH] CLDR-17492 Update spotless to 2.43 and google-java-style 1.22 to support Java 21+ See #3757 --- .../org/unicode/cldr/util/CLDRCacheDir.java | 3 +++ .../org/unicode/cldr/util/CLDRConfigImpl.java | 1 + .../unicode/cldr/web/BallotBoxXMLSource.java | 1 + .../org/unicode/cldr/web/CookieSession.java | 1 + .../main/java/org/unicode/cldr/web/DBUtils.java | 3 +++ .../unicode/cldr/web/ErrorSubtypeClient.java | 4 ++++ .../cldr/web/FixedCandidateProvider.java | 1 + .../org/unicode/cldr/web/JspWebContext.java | 1 + .../unicode/cldr/web/KeepLoggedInManager.java | 1 + .../java/org/unicode/cldr/web/MailSender.java | 2 ++ .../java/org/unicode/cldr/web/STFactory.java | 12 ++++++++++++ .../org/unicode/cldr/web/SubtypeToURLMap.java | 3 +++ .../java/org/unicode/cldr/web/SurveyLog.java | 1 + .../java/org/unicode/cldr/web/SurveyMain.java | 6 ++++++ .../java/org/unicode/cldr/web/UserRegistry.java | 1 + .../org/unicode/cldr/web/api/Announcements.java | 3 +++ .../java/org/unicode/cldr/web/api/STError.java | 4 ++++ .../org/unicode/cldr/web/api/VoteAPIHelper.java | 1 + .../org/unicode/cldr/web/TestSTFactory.java | 15 ++++++++++++--- .../java/com/ibm/icu/dev/test/TestFmwk.java | 1 + .../java/com/ibm/icu/dev/test/TestUtil.java | 2 ++ .../java/com/ibm/icu/dev/test/UTF16Util.java | 8 ++++++++ .../ibm/icu/dev/test/UnicodeKnownIssues.java | 1 + .../java/com/ibm/icu/text/FixedDecimal.java | 1 + .../org/unicode/cldr/draft/ExemplarInfo.java | 1 + .../main/java/org/unicode/cldr/draft/Rule.java | 1 + .../org/unicode/cldr/draft/XLocaleDistance.java | 3 +++ .../org/unicode/cldr/icu/ICUResourceWriter.java | 6 ++++++ .../unicode/cldr/icu/LDML2ICUBinaryWriter.java | 1 + .../unicode/cldr/json/Ldml2JsonConverter.java | 4 ++++ .../unicode/cldr/json/LdmlConfigFileReader.java | 1 + .../cldr/test/BestMinimalPairSamples.java | 1 + .../cldr/test/CheckDisplayCollisions.java | 1 + .../org/unicode/cldr/test/CheckExemplars.java | 1 + .../cldr/test/DisplayAndInputProcessor.java | 3 +++ .../unicode/cldr/test/ExampleDependencies.java | 1 + .../cldr/tool/CLDRFilePseudolocalizer.java | 4 ++++ .../java/org/unicode/cldr/tool/CLDRFormat.java | 1 + .../cldr/tool/CopySubdivisionsIntoMain.java | 1 + .../org/unicode/cldr/tool/FallbackIterator.java | 1 + .../org/unicode/cldr/tool/KeyboardFlatten.java | 17 ++++++++++++----- .../main/java/org/unicode/cldr/tool/Main.java | 4 +++- .../unicode/cldr/tool/MakeTransliterator.java | 1 + .../org/unicode/cldr/tool/TablePrinter.java | 1 + .../org/unicode/cldr/tool/UnLiteracyParser.java | 1 + .../cldr/tool/resolver/CldrResolver.java | 1 + .../java/org/unicode/cldr/util/BidiUtils.java | 1 + .../java/org/unicode/cldr/util/CLDRConfig.java | 5 +++++ .../java/org/unicode/cldr/util/CLDRFile.java | 1 + .../java/org/unicode/cldr/util/CLDRLocale.java | 3 +++ .../java/org/unicode/cldr/util/CLDRPaths.java | 2 ++ .../org/unicode/cldr/util/CLDRTransforms.java | 4 ++++ .../org/unicode/cldr/util/CLDRTreeWriter.java | 2 ++ .../java/org/unicode/cldr/util/CLDRURLS.java | 8 ++++++++ .../cldr/util/CalculateLocaleCoverage.java | 1 + .../java/org/unicode/cldr/util/CldrUtility.java | 1 + .../java/org/unicode/cldr/util/Containment.java | 1 + .../cldr/util/DoctypeXmlStreamWrapper.java | 2 ++ .../java/org/unicode/cldr/util/DtdType.java | 1 + .../unicode/cldr/util/ElementAttributeInfo.java | 1 + .../main/java/org/unicode/cldr/util/Emoji.java | 3 +++ .../java/org/unicode/cldr/util/GrammarInfo.java | 4 ++++ .../unicode/cldr/util/LanguageTagParser.java | 1 + .../org/unicode/cldr/util/LocaleValidator.java | 1 + .../org/unicode/cldr/util/MapComparator.java | 2 ++ .../org/unicode/cldr/util/NodeListIterator.java | 1 + .../main/java/org/unicode/cldr/util/Pick.java | 5 +++++ .../cldr/util/PreferredAndAllowedHour.java | 1 + .../java/org/unicode/cldr/util/RegexLogger.java | 1 + .../java/org/unicode/cldr/util/RegexLookup.java | 1 + .../org/unicode/cldr/util/SimpleFactory.java | 1 + .../org/unicode/cldr/util/StandardCodes.java | 1 + .../unicode/cldr/util/SupplementalDataInfo.java | 1 + .../cldr/util/UnicodeSetPrettyPrinter.java | 1 + .../org/unicode/cldr/util/UnitConverter.java | 1 + .../main/java/org/unicode/cldr/util/Units.java | 1 + .../cldr/util/VariableAndPathParser.java | 1 + .../org/unicode/cldr/util/VoteResolver.java | 4 ++++ .../org/unicode/cldr/util/XMLFileReader.java | 1 + .../java/org/unicode/cldr/util/XMLSource.java | 1 + .../java/org/unicode/cldr/util/XPathParts.java | 1 + .../util/personname/PersonNameFormatter.java | 7 +++++++ .../unicode/cldr/util/props/BagFormatter.java | 4 ++++ .../cldr/util/props/RandomStringGenerator.java | 1 + .../unicode/cldr/tool/TestKeyboardFlatten.java | 7 +++++-- .../cldr/unittest/CheckLdmlDtdReferences.java | 1 + .../cldr/unittest/LikelySubtagsTest.java | 1 + .../unicode/cldr/unittest/TestAnnotations.java | 1 + .../java/org/unicode/cldr/unittest/TestBNF.java | 1 + .../unittest/TestDisplayAndInputProcessor.java | 1 + .../cldr/unittest/TestExampleGenerator.java | 3 +++ .../unicode/cldr/unittest/TestPathHeader.java | 1 + .../unittest/UnicodeSetPrettyPrinterTest.java | 1 + .../java/org/unicode/cldr/rdf/QueryClient.java | 1 + tools/pom.xml | 4 ++-- 95 files changed, 221 insertions(+), 13 deletions(-) diff --git a/tools/cldr-apps/src/main/java/org/unicode/cldr/util/CLDRCacheDir.java b/tools/cldr-apps/src/main/java/org/unicode/cldr/util/CLDRCacheDir.java index 88faf7c84ba..f742ac55c79 100644 --- a/tools/cldr-apps/src/main/java/org/unicode/cldr/util/CLDRCacheDir.java +++ b/tools/cldr-apps/src/main/java/org/unicode/cldr/util/CLDRCacheDir.java @@ -14,6 +14,7 @@ public class CLDRCacheDir { static final Logger logger = SurveyLog.forClass(CLDRCacheDir.class); private static final String CACHE_SUBDIR = ".cache"; + /** All users of the cache must have an enum entry here */ public enum CacheType { abstracts("Article excerpts from DBPedia"), @@ -27,10 +28,12 @@ public enum CacheType { public String getDescription() { return description; } + /** */ CacheType(String description) { this.description = description; } + /** * Get the 'latest good' date before which a cached item is considered stale. For example, * if the expiry is 3 days, then the Instant will reflect a date 3 days ago. For some item, diff --git a/tools/cldr-apps/src/main/java/org/unicode/cldr/util/CLDRConfigImpl.java b/tools/cldr-apps/src/main/java/org/unicode/cldr/util/CLDRConfigImpl.java index 83d9f379857..5689e9e9c3d 100644 --- a/tools/cldr-apps/src/main/java/org/unicode/cldr/util/CLDRConfigImpl.java +++ b/tools/cldr-apps/src/main/java/org/unicode/cldr/util/CLDRConfigImpl.java @@ -109,6 +109,7 @@ public File getHomeFile() { boolean isInitted = false; private Properties survprops; + /** * Defaults to SMOKETEST for server * diff --git a/tools/cldr-apps/src/main/java/org/unicode/cldr/web/BallotBoxXMLSource.java b/tools/cldr-apps/src/main/java/org/unicode/cldr/web/BallotBoxXMLSource.java index 35c437f057a..d477fe6a64d 100644 --- a/tools/cldr-apps/src/main/java/org/unicode/cldr/web/BallotBoxXMLSource.java +++ b/tools/cldr-apps/src/main/java/org/unicode/cldr/web/BallotBoxXMLSource.java @@ -15,6 +15,7 @@ public class BallotBoxXMLSource extends DelegateXMLSource { static final Logger logger = SurveyLog.forClass(BallotBoxXMLSource.class); BallotBox ballotBox; + /** original data before any votes */ XMLSource diskData; diff --git a/tools/cldr-apps/src/main/java/org/unicode/cldr/web/CookieSession.java b/tools/cldr-apps/src/main/java/org/unicode/cldr/web/CookieSession.java index d7de0bacada..5d6da591084 100644 --- a/tools/cldr-apps/src/main/java/org/unicode/cldr/web/CookieSession.java +++ b/tools/cldr-apps/src/main/java/org/unicode/cldr/web/CookieSession.java @@ -67,6 +67,7 @@ public class CookieSession { public Hashtable prefs = new Hashtable<>(); // user prefs public UserRegistry.User user = null; + /** * CookieSession.sm was formerly deprecated: "need to refactor anything that uses this." But, * refactor how?? One possibility: "sm = SurveyMain.getInstance(request)" as in diff --git a/tools/cldr-apps/src/main/java/org/unicode/cldr/web/DBUtils.java b/tools/cldr-apps/src/main/java/org/unicode/cldr/web/DBUtils.java index 44da39e3699..8f4ec06e6de 100644 --- a/tools/cldr-apps/src/main/java/org/unicode/cldr/web/DBUtils.java +++ b/tools/cldr-apps/src/main/java/org/unicode/cldr/web/DBUtils.java @@ -67,6 +67,7 @@ public class DBUtils { private static final String JDBC_SURVEYTOOL = ("jdbc/SurveyTool"); private static DataSource datasource = null; private String connectionUrl = null; + /** * @Deprecated */ @@ -99,6 +100,7 @@ public String getDBInfo() { public static int db_number_open = 0; public static int db_number_used = 0; private static final int db_UnicodeType = java.sql.Types.BLOB; + /** the StackTracker can track unclosed connections */ private static final StackTracker tracker = DEBUG ? new StackTracker() : null; @@ -625,6 +627,7 @@ private static String getDBOpenStack() { && !s.getClassName().startsWith("java."))); return callerElement.toString(); } + /** * Get an Autocommit Connection. Will be AutoCommit=true * diff --git a/tools/cldr-apps/src/main/java/org/unicode/cldr/web/ErrorSubtypeClient.java b/tools/cldr-apps/src/main/java/org/unicode/cldr/web/ErrorSubtypeClient.java index bda2db2b666..156aa18cb7b 100644 --- a/tools/cldr-apps/src/main/java/org/unicode/cldr/web/ErrorSubtypeClient.java +++ b/tools/cldr-apps/src/main/java/org/unicode/cldr/web/ErrorSubtypeClient.java @@ -33,15 +33,19 @@ public class ErrorSubtypeClient { /** range for the all-subtypes list. This will be written to */ static final String ALL_SUBTYPES_RANGE = "AllSubtypes!A1:A"; + /** range for the subtype map. This will be read. Don't count the header. */ static final String SUBTYPE_MAP_RANGE = "SubtypeToURLMap!A2:B"; /** default name of credentials (service key) file */ private static final String SUBTYPE_CREDENTIALS_JSON = "subtype-credentials.json"; + /** scopes needed */ private static final List SCOPES = Collections.singletonList(SheetsScopes.SPREADSHEETS); + /** property indicating the full credential path */ private static final String CLDR_SUBTYPE_CREDENTIAL_PATH = "CLDR_SUBTYPE_CREDENTIAL_PATH"; + /** * property indicating the Google Sheet ID of the spreadsheet. Spreadsheet must be shared with * the service credential for editing. diff --git a/tools/cldr-apps/src/main/java/org/unicode/cldr/web/FixedCandidateProvider.java b/tools/cldr-apps/src/main/java/org/unicode/cldr/web/FixedCandidateProvider.java index 714774f0eff..0bf47469216 100644 --- a/tools/cldr-apps/src/main/java/org/unicode/cldr/web/FixedCandidateProvider.java +++ b/tools/cldr-apps/src/main/java/org/unicode/cldr/web/FixedCandidateProvider.java @@ -42,6 +42,7 @@ public Collection apply(String xpath) { protected abstract Collection getCandidates(); } + /** Candidate provider for a single string (not regex) */ abstract static class StringCandidateProvider extends FixedCandidateProvider { final String pattern; diff --git a/tools/cldr-apps/src/main/java/org/unicode/cldr/web/JspWebContext.java b/tools/cldr-apps/src/main/java/org/unicode/cldr/web/JspWebContext.java index 474e198aa1d..1f91f8c5f08 100644 --- a/tools/cldr-apps/src/main/java/org/unicode/cldr/web/JspWebContext.java +++ b/tools/cldr-apps/src/main/java/org/unicode/cldr/web/JspWebContext.java @@ -23,6 +23,7 @@ private enum MainFormState { } MainFormState mainFormState = MainFormState.CLOSED; + /** List of xpaths indicating the types of data being submitted (numbers, currency, etc) */ Set podBases = null; diff --git a/tools/cldr-apps/src/main/java/org/unicode/cldr/web/KeepLoggedInManager.java b/tools/cldr-apps/src/main/java/org/unicode/cldr/web/KeepLoggedInManager.java index 79051065f97..6689f542b1a 100644 --- a/tools/cldr-apps/src/main/java/org/unicode/cldr/web/KeepLoggedInManager.java +++ b/tools/cldr-apps/src/main/java/org/unicode/cldr/web/KeepLoggedInManager.java @@ -25,6 +25,7 @@ public class KeepLoggedInManager { /** Algorithm to use */ private static final SignatureAlgorithm SIGNATURE_ALGORITHM = SignatureAlgorithm.HS256; + /** Keyfile, just base64 encoded binary data */ private static final String KEYFILE_NAME = KeepLoggedInManager.class.getName() + ".key"; diff --git a/tools/cldr-apps/src/main/java/org/unicode/cldr/web/MailSender.java b/tools/cldr-apps/src/main/java/org/unicode/cldr/web/MailSender.java index 6296dfb7f5b..ae466e8a4e1 100644 --- a/tools/cldr-apps/src/main/java/org/unicode/cldr/web/MailSender.java +++ b/tools/cldr-apps/src/main/java/org/unicode/cldr/web/MailSender.java @@ -46,11 +46,13 @@ public class MailSender implements Runnable { private static final class MailConfig { final boolean CLDR_SENDMAIL; + /** How many mails to process at a time? 0 = unlimited */ final int CLDR_MAIL_BATCHSIZE; final int CLDR_MAIL_DELAY_EACH; final int CLDR_MAIL_DELAY_FIRST; + /** How many seconds to wait between mails in batch processing? 0 = no delay */ final int CLDR_MAIL_DELAY_BATCH_ITEM; diff --git a/tools/cldr-apps/src/main/java/org/unicode/cldr/web/STFactory.java b/tools/cldr-apps/src/main/java/org/unicode/cldr/web/STFactory.java index f6f02208036..c418b53da6f 100644 --- a/tools/cldr-apps/src/main/java/org/unicode/cldr/web/STFactory.java +++ b/tools/cldr-apps/src/main/java/org/unicode/cldr/web/STFactory.java @@ -91,22 +91,31 @@ enum VoteLoadingContext { public final class PerLocaleData implements Comparable, BallotBox { /** Locale of this PLD */ private final CLDRLocale locale; + /** For readonly locales, there's no DB */ private final boolean readonly; + /** Stamp that tracks if this locale has been modified (by a vote) */ private final MutableStamp stamp; + /** unresolved XMLSource backed by the DB, or null for readonly */ private final BallotBoxXMLSource dataBackedSource; + /** unresolved XMLSource: == dataBackedSource, or for readonly == diskData */ private final XMLSource xmlsource; + /** Unresolved CLDRFile backed by {@link #xmlsource} */ private final CLDRFile file; + /** Resolved CLDRFile backed by {@link #xmlsource} */ private final CLDRFile rFile; + /** List of all XPaths present. Only mutated by makeSureInPathsForFile */ private Set pathsForFile; + /** which XPaths had votes? */ BitSet votesSometimeThisRelease = null; + /** Voting information for each XPath */ private final Map xpathToData = new HashMap<>(); @@ -124,6 +133,7 @@ final class PerXPathData { private final class PerUserData { /** What is this user voting for? */ String vote; + /** What is this user's override strength? */ Integer override; @@ -1254,6 +1264,7 @@ public BallotBox ballotBoxForLocale(CLDRLocale locale) { /** Config: # of hours before a locale is expired from the cache */ private final int CLDR_LOCALE_CACHE_HOURS = CLDRConfig.getInstance().getProperty("CLDR_LOCALE_EXPIRE_HOURS", 12); + /** Config: Max # of concurrent locales/sublocales in teh cache */ private final int CLDR_LOCALE_CACHE_MAX = CLDRConfig.getInstance().getProperty("CLDR_LOCALE_CACHE_MAX", 100); @@ -1827,6 +1838,7 @@ public final PathHeader getPathHeader(String xpath) { public SurveyMenus getSurveyMenus() { return surveyMenus.get(); } + /** * Resolving disk file, or null if none. * diff --git a/tools/cldr-apps/src/main/java/org/unicode/cldr/web/SubtypeToURLMap.java b/tools/cldr-apps/src/main/java/org/unicode/cldr/web/SubtypeToURLMap.java index 3b3cdc41591..4fe463a1c4d 100644 --- a/tools/cldr-apps/src/main/java/org/unicode/cldr/web/SubtypeToURLMap.java +++ b/tools/cldr-apps/src/main/java/org/unicode/cldr/web/SubtypeToURLMap.java @@ -45,6 +45,7 @@ description = "parse each of the params as a path or URL to a subtype map and check.") public class SubtypeToURLMap implements SubtypeToURLProvider { static final Logger logger = SurveyLog.forClass(SubtypeToURLMap.class); + /** * Little tool for validating input data. * @@ -283,6 +284,7 @@ public void write(PrintWriter pw) throws IOException { public List getUrls() { return urlList; } + /** get the subtypes that match a certain URL */ public Set getSubtypesForUrl(final String url) { Set set = new TreeSet<>(); @@ -453,6 +455,7 @@ static SubtypeToURLMap make() { } return map; } + /** * The date before which a cache's contents are invalid. * diff --git a/tools/cldr-apps/src/main/java/org/unicode/cldr/web/SurveyLog.java b/tools/cldr-apps/src/main/java/org/unicode/cldr/web/SurveyLog.java index ce4ee71e570..8d4d8121832 100644 --- a/tools/cldr-apps/src/main/java/org/unicode/cldr/web/SurveyLog.java +++ b/tools/cldr-apps/src/main/java/org/unicode/cldr/web/SurveyLog.java @@ -22,6 +22,7 @@ public class SurveyLog { public static final Logger forClass(Class clazz) { return Logger.getLogger(clazz.getName()); } + /** * Get a Logger class for the specified calling class, with an initial level * diff --git a/tools/cldr-apps/src/main/java/org/unicode/cldr/web/SurveyMain.java b/tools/cldr-apps/src/main/java/org/unicode/cldr/web/SurveyMain.java index 62309c70f95..de211efd707 100644 --- a/tools/cldr-apps/src/main/java/org/unicode/cldr/web/SurveyMain.java +++ b/tools/cldr-apps/src/main/java/org/unicode/cldr/web/SurveyMain.java @@ -210,6 +210,7 @@ public String display() { // ===== Configuration state private static Phase currentPhase = Phase.VETTING; private static Phase currentExtendedPhase = Phase.VETTING; + /** set by CLDR_PHASE property. * */ private static String oldVersion = "OLDVERSION"; @@ -357,6 +358,7 @@ private void setInstance() { } private static boolean initCalled = false; + /** * Was init() called on the servlet? This is called very early in server startup, * but should be noted here. @@ -368,6 +370,7 @@ public static boolean wasInitCalled() { } private static boolean didTryToStartUp = false; + /** * Did SurveyMain try to startup? Need to call GET /cldr-apps/survey for this to happen * if GET has not been called, then we don't have a SurveyMain instance yet and getInstance() will fail. @@ -453,6 +456,7 @@ public void doPost(HttpServletRequest request, HttpServletResponse response) } public static String defaultServletPath = null; + /** IP exclusion list */ public static Hashtable BAD_IPS = new Hashtable<>(); @@ -1460,6 +1464,7 @@ public static String getCurrev() { } static final Pattern HASH_PATTERN = Pattern.compile("^CLDR_([A-Z]+)_HASH$"); + /** * Get the current source revision * @@ -3362,6 +3367,7 @@ public static void markBusted(String what, Throwable t, String stack) { } private static long shortN = 0; + /** Only used by about.jsp to know whether it's safe to call DBUtils.getInstance() */ public static boolean isDbSetup = false; diff --git a/tools/cldr-apps/src/main/java/org/unicode/cldr/web/UserRegistry.java b/tools/cldr-apps/src/main/java/org/unicode/cldr/web/UserRegistry.java index 04715f2633a..937307c905b 100644 --- a/tools/cldr-apps/src/main/java/org/unicode/cldr/web/UserRegistry.java +++ b/tools/cldr-apps/src/main/java/org/unicode/cldr/web/UserRegistry.java @@ -94,6 +94,7 @@ private synchronized void notify(User u) { } private static final java.util.logging.Logger logger = SurveyLog.forClass(UserRegistry.class); + // user levels /** Administrator */ diff --git a/tools/cldr-apps/src/main/java/org/unicode/cldr/web/api/Announcements.java b/tools/cldr-apps/src/main/java/org/unicode/cldr/web/api/Announcements.java index a761da1d9f4..9b420c620e5 100644 --- a/tools/cldr-apps/src/main/java/org/unicode/cldr/web/api/Announcements.java +++ b/tools/cldr-apps/src/main/java/org/unicode/cldr/web/api/Announcements.java @@ -27,10 +27,13 @@ public class Announcements { public static final String AUDIENCE_EVERYONE = "Everyone"; public static final String ORGS_MINE = "Mine"; + /** all TC orgs, as defined by {@link Organization#isTCOrg()} */ public static final String ORGS_TC = "TC"; + /** excluding TC orgs, as defined by {@link Organization#isTCOrg()} */ public static final String ORGS_NON_TC = "NonTC"; + /** All organizations */ public static final String ORGS_ALL = "All"; diff --git a/tools/cldr-apps/src/main/java/org/unicode/cldr/web/api/STError.java b/tools/cldr-apps/src/main/java/org/unicode/cldr/web/api/STError.java index ab2fcd666d2..e89048b10d6 100644 --- a/tools/cldr-apps/src/main/java/org/unicode/cldr/web/api/STError.java +++ b/tools/cldr-apps/src/main/java/org/unicode/cldr/web/api/STError.java @@ -50,15 +50,19 @@ public String getMessage() { public void setMessage(String message) { this.message = message; } + /** Description of the error */ @Schema(description = "Error message") public String message; + /** identifies this as an error */ @Schema(description = "Always set to true, identifies this as an error.") public final boolean err = true; + /** Optional error code */ @Schema(description = "Error code if present") public ErrorCode code; + /** * Convenience function: return STError("something").build() => 500 * diff --git a/tools/cldr-apps/src/main/java/org/unicode/cldr/web/api/VoteAPIHelper.java b/tools/cldr-apps/src/main/java/org/unicode/cldr/web/api/VoteAPIHelper.java index 2eaf67925ec..ff77e3d34ae 100644 --- a/tools/cldr-apps/src/main/java/org/unicode/cldr/web/api/VoteAPIHelper.java +++ b/tools/cldr-apps/src/main/java/org/unicode/cldr/web/api/VoteAPIHelper.java @@ -436,6 +436,7 @@ public static Response handleVote( return new STError(se).build(); } } + /** * this function is the implementation of handleVote() but does not use any jax-rs, for unit * tests diff --git a/tools/cldr-apps/src/test/java/org/unicode/cldr/web/TestSTFactory.java b/tools/cldr-apps/src/test/java/org/unicode/cldr/web/TestSTFactory.java index 51de4343872..0fc13ab87f8 100644 --- a/tools/cldr-apps/src/test/java/org/unicode/cldr/web/TestSTFactory.java +++ b/tools/cldr-apps/src/test/java/org/unicode/cldr/web/TestSTFactory.java @@ -165,7 +165,10 @@ private String votedToString(boolean didVote) { @Test public void TestBasicVote() - throws SQLException, IOException, InvalidXPathException, VoteNotAcceptedException, + throws SQLException, + IOException, + InvalidXPathException, + VoteNotAcceptedException, LogoutException { STFactory fac = getFactory(); @@ -354,7 +357,10 @@ public void TestDenyVote() throws SQLException, IOException { @Test public void TestSparseVote() - throws SQLException, IOException, InvalidXPathException, SurveyException, + throws SQLException, + IOException, + InvalidXPathException, + SurveyException, LogoutException { STFactory fac = getFactory(); @@ -503,7 +509,10 @@ public static BufferedReader getUTF8Data(String name) throws java.io.IOException @Test public void TestVettingWithNonDistinguishing() - throws SQLException, IOException, InvalidXPathException, SurveyException, + throws SQLException, + IOException, + InvalidXPathException, + SurveyException, LogoutException { if (TestAll.skipIfNoDb()) return; STFactory fac = getFactory(); diff --git a/tools/cldr-code/src/main/java/com/ibm/icu/dev/test/TestFmwk.java b/tools/cldr-code/src/main/java/com/ibm/icu/dev/test/TestFmwk.java index 03ed8a91c12..671deca3e80 100644 --- a/tools/cldr-code/src/main/java/com/ibm/icu/dev/test/TestFmwk.java +++ b/tools/cldr-code/src/main/java/com/ibm/icu/dev/test/TestFmwk.java @@ -135,6 +135,7 @@ protected void handleException(Throwable e) { errln(sourceLocation(ex) + ex.toString() + '\n' + msg); } } + // use this instead of new random so we get a consistent seed // for our tests protected Random createRandom() { diff --git a/tools/cldr-code/src/main/java/com/ibm/icu/dev/test/TestUtil.java b/tools/cldr-code/src/main/java/com/ibm/icu/dev/test/TestUtil.java index 623ddf3a61c..bae93eec3ba 100644 --- a/tools/cldr-code/src/main/java/com/ibm/icu/dev/test/TestUtil.java +++ b/tools/cldr-code/src/main/java/com/ibm/icu/dev/test/TestUtil.java @@ -52,6 +52,7 @@ public static final BufferedReader getDataReader(String name) throws IOException '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z' }; + /** * Return true if the character is NOT printable ASCII. The tab, newline and linefeed characters * are considered unprintable. @@ -59,6 +60,7 @@ public static final BufferedReader getDataReader(String name) throws IOException public static boolean isUnprintable(int c) { return !(c >= 0x20 && c <= 0x7E); } + /** * Escape unprintable characters using uxxxx notation for U+0000 to U+FFFF and * Uxxxxxxxx for U+10000 and above. If the character is printable ASCII, then do diff --git a/tools/cldr-code/src/main/java/com/ibm/icu/dev/test/UTF16Util.java b/tools/cldr-code/src/main/java/com/ibm/icu/dev/test/UTF16Util.java index db0daba0409..482a6f3faf3 100644 --- a/tools/cldr-code/src/main/java/com/ibm/icu/dev/test/UTF16Util.java +++ b/tools/cldr-code/src/main/java/com/ibm/icu/dev/test/UTF16Util.java @@ -208,8 +208,10 @@ public static final int countCodePoint(StringBuffer source) { return result; } + /** The minimum value for Supplementary code points */ public static final int SUPPLEMENTARY_MIN_VALUE = 0x10000; + /** * Determines how many chars this char32 requires. If a validity check is required, use * isLegal() on char32 before calling. @@ -223,12 +225,14 @@ public static int getCharCount(int char32) { } return 2; } + /** * Lead surrogate maximum value * * @stable ICU 2.1 */ public static final int LEAD_SURROGATE_MAX_VALUE = 0xDBFF; + /** * Lead surrogate minimum value * @@ -242,12 +246,14 @@ public static int getCharCount(int char32) { * @stable ICU 2.1 */ public static final int TRAIL_SURROGATE_MIN_VALUE = 0xDC00; + /** * Trail surrogate maximum value * * @stable ICU 2.1 */ public static final int TRAIL_SURROGATE_MAX_VALUE = 0xDFFF; + /** * Determines whether the code value is a surrogate. * @@ -280,6 +286,7 @@ public static boolean isTrailSurrogate(char char16) { public static boolean isLeadSurrogate(char char16) { return LEAD_SURROGATE_MIN_VALUE <= char16 && char16 <= LEAD_SURROGATE_MAX_VALUE; } + /** * Extract a single UTF-32 value from a substring. Used when iterating forwards or backwards * (with UTF16.getCharCount(), as well as random access. If a validity check is @@ -331,6 +338,7 @@ public static int charAt(char source[], int start, int limit, int offset16) { } return single; // return unmatched surrogate } + /** Shift value for lead surrogate to form a supplementary character. */ private static final int LEAD_SURROGATE_SHIFT_ = 10; diff --git a/tools/cldr-code/src/main/java/com/ibm/icu/dev/test/UnicodeKnownIssues.java b/tools/cldr-code/src/main/java/com/ibm/icu/dev/test/UnicodeKnownIssues.java index 649bd623558..cc892d6f547 100644 --- a/tools/cldr-code/src/main/java/com/ibm/icu/dev/test/UnicodeKnownIssues.java +++ b/tools/cldr-code/src/main/java/com/ibm/icu/dev/test/UnicodeKnownIssues.java @@ -15,6 +15,7 @@ */ public class UnicodeKnownIssues { private Map> knownIssues = new TreeMap<>(); + /** * Max number of lines to show by default (including the "more") unless -allKnownIssues is * given. Must be at least 2. diff --git a/tools/cldr-code/src/main/java/com/ibm/icu/text/FixedDecimal.java b/tools/cldr-code/src/main/java/com/ibm/icu/text/FixedDecimal.java index 886843dcfa5..0e7fd0a069a 100644 --- a/tools/cldr-code/src/main/java/com/ibm/icu/text/FixedDecimal.java +++ b/tools/cldr-code/src/main/java/com/ibm/icu/text/FixedDecimal.java @@ -226,6 +226,7 @@ public FixedDecimal(long n) { } private static final long MAX_INTEGER_PART = 1000000000; + /** * Return a guess as to the number of decimals that would be displayed. This is only a guess; * callers should always supply the decimals explicitly if possible. Currently, it is up to 6 diff --git a/tools/cldr-code/src/main/java/org/unicode/cldr/draft/ExemplarInfo.java b/tools/cldr-code/src/main/java/org/unicode/cldr/draft/ExemplarInfo.java index 080e7bb4a1e..7509336eea3 100644 --- a/tools/cldr-code/src/main/java/org/unicode/cldr/draft/ExemplarInfo.java +++ b/tools/cldr-code/src/main/java/org/unicode/cldr/draft/ExemplarInfo.java @@ -95,6 +95,7 @@ public class ExemplarInfo { languageToExemplars.put( "gn", new ExemplarInfo("[a-vx-zá é í ó ú ý ñ ã ẽ ĩ õ ũ ỹ {g\u0303}]", "[a-z]")); } + // http://ja.wikipedia.org/wiki/学年別漢字配当表, http://kanji-a.seesaa.net/category/2203790-1.html private static UnicodeMap JapaneseEducationLevels = new UnicodeMap() diff --git a/tools/cldr-code/src/main/java/org/unicode/cldr/draft/Rule.java b/tools/cldr-code/src/main/java/org/unicode/cldr/draft/Rule.java index 03564329dc0..dec1e0cc3f9 100644 --- a/tools/cldr-code/src/main/java/org/unicode/cldr/draft/Rule.java +++ b/tools/cldr-code/src/main/java/org/unicode/cldr/draft/Rule.java @@ -10,6 +10,7 @@ public class Rule { private final boolean prematchFindAtEnd; private final Pattern postmatch; private final List results = new ArrayList<>(); + /** * if negative, is position before start position; otherwise is position relative to end of * replacement. To put *at* the start position, put a CURSOR at the start of the results. diff --git a/tools/cldr-code/src/main/java/org/unicode/cldr/draft/XLocaleDistance.java b/tools/cldr-code/src/main/java/org/unicode/cldr/draft/XLocaleDistance.java index 15ff2bc8fd8..6e5f7b96da3 100644 --- a/tools/cldr-code/src/main/java/org/unicode/cldr/draft/XLocaleDistance.java +++ b/tools/cldr-code/src/main/java/org/unicode/cldr/draft/XLocaleDistance.java @@ -1056,8 +1056,10 @@ static class RegionMapper implements IdMapper { * contains a variable, we replace that rule by multiple rules for the partitions. */ final Multimap variableToPartition; + /** Used for executing the rules. We map a region to a partition before processing. */ final Map regionToPartition; + /** * Used to support es_419 compared to es_AR, etc. * @@ -1065,6 +1067,7 @@ static class RegionMapper implements IdMapper { * @param regionToPartitionIn */ final Multimap macroToPartitions; + /** Used to get the paradigm region for a cluster, if there is one */ final ImmutableSet paradigms; diff --git a/tools/cldr-code/src/main/java/org/unicode/cldr/icu/ICUResourceWriter.java b/tools/cldr-code/src/main/java/org/unicode/cldr/icu/ICUResourceWriter.java index be2117676d8..48608f22817 100644 --- a/tools/cldr-code/src/main/java/org/unicode/cldr/icu/ICUResourceWriter.java +++ b/tools/cldr-code/src/main/java/org/unicode/cldr/icu/ICUResourceWriter.java @@ -51,6 +51,7 @@ public class ICUResourceWriter { public static final String DEPENDENCY = "dependency"; public static final int BIN_ALIGNMENT = 16; + /** This integer is a count of ALL the resources in this tree (not including the root object) */ public static int maxTableLength; @@ -68,14 +69,18 @@ public MalformedResourceError(String str, Resource res) { String[] note = new String[20]; int noteLen = 0; String translate; + /** This is a comment which will appear on the item. */ String comment; + /** This is the resource's name, or, 'key' */ public String name; + /** This links to the next sibling of this item in the list */ public Resource next; boolean noSort = false; + /** If this item contains other items, this points to the first item in its list */ public Resource first = null; @@ -661,6 +666,7 @@ public ResourceString(String name, String val) { } public String val; + /** one-line comment following the value. ignored unless in bare mode. */ public String smallComment = null; diff --git a/tools/cldr-code/src/main/java/org/unicode/cldr/icu/LDML2ICUBinaryWriter.java b/tools/cldr-code/src/main/java/org/unicode/cldr/icu/LDML2ICUBinaryWriter.java index d24e0aab3de..0f3440ba79c 100644 --- a/tools/cldr-code/src/main/java/org/unicode/cldr/icu/LDML2ICUBinaryWriter.java +++ b/tools/cldr-code/src/main/java/org/unicode/cldr/icu/LDML2ICUBinaryWriter.java @@ -38,6 +38,7 @@ public class LDML2ICUBinaryWriter { private static final byte MAGIC2 = 0x27; private static boolean INCLUDE_COPYRIGHT = false; + /** The number of bytes it takes to write magic number 1. */ private static final short BYTES_TAKEN_BY_MAGIC1 = 1; diff --git a/tools/cldr-code/src/main/java/org/unicode/cldr/json/Ldml2JsonConverter.java b/tools/cldr-code/src/main/java/org/unicode/cldr/json/Ldml2JsonConverter.java index 35c413c1019..4c60464c03d 100644 --- a/tools/cldr-code/src/main/java/org/unicode/cldr/json/Ldml2JsonConverter.java +++ b/tools/cldr-code/src/main/java/org/unicode/cldr/json/Ldml2JsonConverter.java @@ -112,6 +112,7 @@ enum RunType { this.isTiered = isTiered; this.hasLocales = hasLocales; } + /** * Is it split into modern/full? * @@ -120,6 +121,7 @@ enum RunType { public boolean tiered() { return isTiered; } + /** * Does it have locale IDs? * @@ -128,6 +130,7 @@ public boolean tiered() { public boolean locales() { return hasLocales; } + /** * return the options as a pipe-delimited list * @@ -1036,6 +1039,7 @@ private final String unicodeLocaleToString(String locale) { } Pattern IS_REGION_CODE = PatternCache.get("([A-Z][A-Z])|([0-9][0-9][0-9])"); + /** * Bottleneck for converting Unicode Locale ID (root, ca_ES_VALENCIA) to String for filename or * data item. If strictBcp47 is true (default) then it will convert to (und, ca-ES-valencia) diff --git a/tools/cldr-code/src/main/java/org/unicode/cldr/json/LdmlConfigFileReader.java b/tools/cldr-code/src/main/java/org/unicode/cldr/json/LdmlConfigFileReader.java index c399d01c833..220777bcd9d 100644 --- a/tools/cldr-code/src/main/java/org/unicode/cldr/json/LdmlConfigFileReader.java +++ b/tools/cldr-code/src/main/java/org/unicode/cldr/json/LdmlConfigFileReader.java @@ -14,6 +14,7 @@ /** Reader for the JSON_config.txt type files */ public class LdmlConfigFileReader { final List sections = new ArrayList(); + /** Map of package to description */ final Map packages = new TreeMap<>(); diff --git a/tools/cldr-code/src/main/java/org/unicode/cldr/test/BestMinimalPairSamples.java b/tools/cldr-code/src/main/java/org/unicode/cldr/test/BestMinimalPairSamples.java index 54043481266..385e36ac46b 100644 --- a/tools/cldr-code/src/main/java/org/unicode/cldr/test/BestMinimalPairSamples.java +++ b/tools/cldr-code/src/main/java/org/unicode/cldr/test/BestMinimalPairSamples.java @@ -369,6 +369,7 @@ public boolean isBetterUnit(String longUnitId, String formerLongUnitId) { "duration-day", "duration-hour", "duration-minute"); + /** * better result is smaller * diff --git a/tools/cldr-code/src/main/java/org/unicode/cldr/test/CheckDisplayCollisions.java b/tools/cldr-code/src/main/java/org/unicode/cldr/test/CheckDisplayCollisions.java index 2d074ec9769..b508ee5afa8 100644 --- a/tools/cldr-code/src/main/java/org/unicode/cldr/test/CheckDisplayCollisions.java +++ b/tools/cldr-code/src/main/java/org/unicode/cldr/test/CheckDisplayCollisions.java @@ -26,6 +26,7 @@ public class CheckDisplayCollisions extends FactoryCheckCLDR { private static final String DEBUG_PATH_PART = "-mass"; // example: + // "//ldml/dates/fields/field[@type=\"sun-narrow\"]/relative[@type=\"-1\"]"; /** Set to true to get verbose logging of path removals */ private static final boolean LOG_PATH_REMOVALS = false; diff --git a/tools/cldr-code/src/main/java/org/unicode/cldr/test/CheckExemplars.java b/tools/cldr-code/src/main/java/org/unicode/cldr/test/CheckExemplars.java index 1bd58569ecf..092f19d6b6c 100644 --- a/tools/cldr-code/src/main/java/org/unicode/cldr/test/CheckExemplars.java +++ b/tools/cldr-code/src/main/java/org/unicode/cldr/test/CheckExemplars.java @@ -55,6 +55,7 @@ public class CheckExemplars extends FactoryCheckCLDR { } AlwaysOK.freeze(); } + // TODO Fix some of these characters private static final UnicodeSet SPECIAL_ALLOW = new UnicodeSet( diff --git a/tools/cldr-code/src/main/java/org/unicode/cldr/test/DisplayAndInputProcessor.java b/tools/cldr-code/src/main/java/org/unicode/cldr/test/DisplayAndInputProcessor.java index 63fc4b8edc7..9663c562f01 100644 --- a/tools/cldr-code/src/main/java/org/unicode/cldr/test/DisplayAndInputProcessor.java +++ b/tools/cldr-code/src/main/java/org/unicode/cldr/test/DisplayAndInputProcessor.java @@ -137,6 +137,7 @@ public class DisplayAndInputProcessor { /** string of whitespace, possibly including NBSP and/or NNBSP, ie., [\u00A0\t\n\r\u202F]+ */ private static final Pattern WHITESPACE_AND_NBSP_TO_NORMALIZE = PatternCache.get("[\\s\\u00A0]+"); + // Reverted 2022-12-08 from: // private static final Pattern WHITESPACE_AND_NBSP_TO_NORMALIZE = // PatternCache.get("[\\s\\u00A0\\u202F]+"); @@ -144,6 +145,7 @@ public class DisplayAndInputProcessor { /** one or more NBSP (or NNBSP) followed by one or more regular spaces */ private static final Pattern NBSP_PLUS_SPACE_TO_NORMALIZE = PatternCache.get("\\u00A0+\\u0020+"); + // Reverted 2022-12-08 from: // private static final Pattern NBSP_PLUS_SPACE_TO_NORMALIZE = // PatternCache.get("[\\u00A0\\u202F]+\\u0020+"); @@ -151,6 +153,7 @@ public class DisplayAndInputProcessor { /** one or more regular spaces followed by one or more NBSP (or NNBSP) */ private static final Pattern SPACE_PLUS_NBSP_TO_NORMALIZE = PatternCache.get("\\u0020+\\u00A0+"); + // Reverted 2022-12-08 from: // private static final Pattern SPACE_PLUS_NBSP_TO_NORMALIZE = // PatternCache.get("\\u0020+[\\u00A0\\u202F]+"); diff --git a/tools/cldr-code/src/main/java/org/unicode/cldr/test/ExampleDependencies.java b/tools/cldr-code/src/main/java/org/unicode/cldr/test/ExampleDependencies.java index 745709730c6..a075edfb72d 100644 --- a/tools/cldr-code/src/main/java/org/unicode/cldr/test/ExampleDependencies.java +++ b/tools/cldr-code/src/main/java/org/unicode/cldr/test/ExampleDependencies.java @@ -1,4 +1,5 @@ package org.unicode.cldr.test; + /* DO NOT EDIT THIS FILE, instead regenerate it using GenerateExampleDependencies.java */ import com.google.common.collect.ImmutableSetMultimap; diff --git a/tools/cldr-code/src/main/java/org/unicode/cldr/tool/CLDRFilePseudolocalizer.java b/tools/cldr-code/src/main/java/org/unicode/cldr/tool/CLDRFilePseudolocalizer.java index b93e8408778..0e6f8a31a1b 100644 --- a/tools/cldr-code/src/main/java/org/unicode/cldr/tool/CLDRFilePseudolocalizer.java +++ b/tools/cldr-code/src/main/java/org/unicode/cldr/tool/CLDRFilePseudolocalizer.java @@ -261,12 +261,16 @@ public String fragment(String text) { private static class PseudolocalizerXB extends Pseudolocalizer { /** Right-to-left override character. */ private static final String RLO = "\u202e"; + /** Right-to-left mark character. */ private static final String RLM = "\u200f"; + /** Pop direction formatting character. */ private static final String PDF = "\u202c"; + /** Prefix to add before each LTR word */ private static final String BIDI_PREFIX = RLM + RLO; + /** Postfix to add after each LTR word */ private static final String BIDI_POSTFIX = PDF + RLM; diff --git a/tools/cldr-code/src/main/java/org/unicode/cldr/tool/CLDRFormat.java b/tools/cldr-code/src/main/java/org/unicode/cldr/tool/CLDRFormat.java index 3e369d6527b..0cecd970bf9 100644 --- a/tools/cldr-code/src/main/java/org/unicode/cldr/tool/CLDRFormat.java +++ b/tools/cldr-code/src/main/java/org/unicode/cldr/tool/CLDRFormat.java @@ -14,6 +14,7 @@ import org.unicode.cldr.util.PathUtilities; import org.unicode.cldr.util.PatternCache; import org.unicode.cldr.util.SimpleFactory; + // import org.unicode.cldr.util.XPathParts.Comments; public class CLDRFormat { diff --git a/tools/cldr-code/src/main/java/org/unicode/cldr/tool/CopySubdivisionsIntoMain.java b/tools/cldr-code/src/main/java/org/unicode/cldr/tool/CopySubdivisionsIntoMain.java index 91392324ffb..0f63f6c4825 100644 --- a/tools/cldr-code/src/main/java/org/unicode/cldr/tool/CopySubdivisionsIntoMain.java +++ b/tools/cldr-code/src/main/java/org/unicode/cldr/tool/CopySubdivisionsIntoMain.java @@ -28,6 +28,7 @@ public class CopySubdivisionsIntoMain { private static final String SUBDIVISION_TARGET_DIR = CLDRPaths.SUBDIVISIONS_DIRECTORY; // CLDRPaths.SUBDIVISIONS_DIRECTORY; + // for testing, CLDRPaths.GEN_DIRECTORY + "test_subdivisions/"; enum MyOptions { diff --git a/tools/cldr-code/src/main/java/org/unicode/cldr/tool/FallbackIterator.java b/tools/cldr-code/src/main/java/org/unicode/cldr/tool/FallbackIterator.java index 9be11f41bb0..d9c6e43fcf7 100644 --- a/tools/cldr-code/src/main/java/org/unicode/cldr/tool/FallbackIterator.java +++ b/tools/cldr-code/src/main/java/org/unicode/cldr/tool/FallbackIterator.java @@ -203,6 +203,7 @@ private enum Type { if (DEBUG) System.out.println(fallbackRule); } } + // we can look at doing this incrementally later on, but for now just generate and delegate. private static Iterator emptyIterator; diff --git a/tools/cldr-code/src/main/java/org/unicode/cldr/tool/KeyboardFlatten.java b/tools/cldr-code/src/main/java/org/unicode/cldr/tool/KeyboardFlatten.java index 78ed9358ecd..f93921083dd 100644 --- a/tools/cldr-code/src/main/java/org/unicode/cldr/tool/KeyboardFlatten.java +++ b/tools/cldr-code/src/main/java/org/unicode/cldr/tool/KeyboardFlatten.java @@ -30,8 +30,11 @@ /** Read a Keyboard and write it out with no import statements */ public class KeyboardFlatten { public static void flatten(String path, OutputStream stream) - throws MalformedURLException, SAXException, TransformerConfigurationException, - TransformerException, TransformerFactoryConfigurationError { + throws MalformedURLException, + SAXException, + TransformerConfigurationException, + TransformerException, + TransformerFactoryConfigurationError { final String filename = PathUtilities.getNormalizedPathString(path); // Force filerefs to be URI's if needed: note this is independent of any // other files @@ -41,8 +44,11 @@ public static void flatten(String path, OutputStream stream) } public static void flatten(InputSource inputSource, String filename, OutputStream stream) - throws SAXException, TransformerConfigurationException, TransformerException, - TransformerFactoryConfigurationError, MalformedURLException { + throws SAXException, + TransformerConfigurationException, + TransformerException, + TransformerFactoryConfigurationError, + MalformedURLException { final DocumentBuilderFactory dfactory = getKeyboardDocFactory(); final ErrorHandler nullHandler = getNullHandler(filename); // Parse @@ -259,7 +265,8 @@ private static Document parseDocument( * @param doc */ private static void write(Document doc, OutputStream stream) - throws TransformerConfigurationException, TransformerException, + throws TransformerConfigurationException, + TransformerException, TransformerFactoryConfigurationError { TransformerFactory.newInstance() .newTransformer() diff --git a/tools/cldr-code/src/main/java/org/unicode/cldr/tool/Main.java b/tools/cldr-code/src/main/java/org/unicode/cldr/tool/Main.java index c8bd9d590f5..7a86695fda6 100644 --- a/tools/cldr-code/src/main/java/org/unicode/cldr/tool/Main.java +++ b/tools/cldr-code/src/main/java/org/unicode/cldr/tool/Main.java @@ -49,7 +49,9 @@ public static void main(String args[]) throws Throwable { } public static void invoke(Class c, final String[] args2) - throws NoSuchMethodException, IllegalArgumentException, IllegalAccessException, + throws NoSuchMethodException, + IllegalArgumentException, + IllegalAccessException, InvocationTargetException { final Method main = getStaticMain(c); if (main == null) { diff --git a/tools/cldr-code/src/main/java/org/unicode/cldr/tool/MakeTransliterator.java b/tools/cldr-code/src/main/java/org/unicode/cldr/tool/MakeTransliterator.java index 7db0e107d52..cc8f053e63a 100644 --- a/tools/cldr-code/src/main/java/org/unicode/cldr/tool/MakeTransliterator.java +++ b/tools/cldr-code/src/main/java/org/unicode/cldr/tool/MakeTransliterator.java @@ -540,6 +540,7 @@ private static void showSet(UnicodeSet sourceCharacters) { public static UnicodeSet vowels = new UnicodeSet("[aeiou æ ɑ ə ɛ ɪ ʊ â î ô]").freeze(); public static UnicodeSet short_vowels = new UnicodeSet("[ɑ æ ə ɛ ɪ ʊ]").freeze(); + /** * Return true if the strings are essentially the same. Differences between schwas and short * vowels are counted in certain cases diff --git a/tools/cldr-code/src/main/java/org/unicode/cldr/tool/TablePrinter.java b/tools/cldr-code/src/main/java/org/unicode/cldr/tool/TablePrinter.java index 29c3b5301c5..b86f5ccb049 100644 --- a/tools/cldr-code/src/main/java/org/unicode/cldr/tool/TablePrinter.java +++ b/tools/cldr-code/src/main/java/org/unicode/cldr/tool/TablePrinter.java @@ -96,6 +96,7 @@ private static class Column { private boolean repeatHeader = false; private boolean hidden = false; private boolean isHeader = false; + // private boolean divider = false; public Column(String header) { diff --git a/tools/cldr-code/src/main/java/org/unicode/cldr/tool/UnLiteracyParser.java b/tools/cldr-code/src/main/java/org/unicode/cldr/tool/UnLiteracyParser.java index c90d868a3a1..5c14a874a48 100644 --- a/tools/cldr-code/src/main/java/org/unicode/cldr/tool/UnLiteracyParser.java +++ b/tools/cldr-code/src/main/java/org/unicode/cldr/tool/UnLiteracyParser.java @@ -22,6 +22,7 @@ public class UnLiteracyParser extends XMLFileReader.SimpleHandler { static final String ILLITERATE = "Illiterate"; private static final String UNKNOWN = "Unknown"; private static final String TOTAL = "Total"; + // Debug stuff public static void main(String args[]) { final UnLiteracyParser ulp = new UnLiteracyParser().read(); diff --git a/tools/cldr-code/src/main/java/org/unicode/cldr/tool/resolver/CldrResolver.java b/tools/cldr-code/src/main/java/org/unicode/cldr/tool/resolver/CldrResolver.java index 1f5bd8895d7..01bc3bb16c4 100644 --- a/tools/cldr-code/src/main/java/org/unicode/cldr/tool/resolver/CldrResolver.java +++ b/tools/cldr-code/src/main/java/org/unicode/cldr/tool/resolver/CldrResolver.java @@ -74,6 +74,7 @@ public class CldrResolver { /* Private instance variables */ private Factory cldrFactory; private ResolutionType resolutionType; + // Cache for resolved CLDRFiles. // This is most useful for simple resolution, where the resolved locales are // required to resolve their children. diff --git a/tools/cldr-code/src/main/java/org/unicode/cldr/util/BidiUtils.java b/tools/cldr-code/src/main/java/org/unicode/cldr/util/BidiUtils.java index dc7e9f2761b..23e621c95f4 100644 --- a/tools/cldr-code/src/main/java/org/unicode/cldr/util/BidiUtils.java +++ b/tools/cldr-code/src/main/java/org/unicode/cldr/util/BidiUtils.java @@ -48,6 +48,7 @@ private SpanClass(String unicodeSetSource) { } } } + /** * Checks the ordering of the example, under the specified bidiDirectionOptions; * diff --git a/tools/cldr-code/src/main/java/org/unicode/cldr/util/CLDRConfig.java b/tools/cldr-code/src/main/java/org/unicode/cldr/util/CLDRConfig.java index 4d1f1131908..846d8f86ade 100644 --- a/tools/cldr-code/src/main/java/org/unicode/cldr/util/CLDRConfig.java +++ b/tools/cldr-code/src/main/java/org/unicode/cldr/util/CLDRConfig.java @@ -37,6 +37,7 @@ public class CLDRConfig extends Properties { public static boolean SKIP_SEED = System.getProperty("CLDR_SKIP_SEED") != null; private static final long serialVersionUID = -2605254975303398336L; public static boolean DEBUG = false; + /** This is the special implementation which will be used, i.e. CLDRConfigImpl */ public static final String SUBCLASS = CLDRConfig.class.getName() + "Impl"; @@ -554,6 +555,7 @@ private FileWrapper() { public File getCldrDir() { return this.cldrDir; } + // singleton private static FileWrapper fileWrapperInstance = new FileWrapper(); @@ -604,10 +606,13 @@ public Set getCLDRFilesMatching(FilenameFilter filter, final File baseDir) /** TODO: better place for these constants? */ private static final String COMMON_DIR = "common"; + /** TODO: better place for these constants? */ private static final String EXEMPLARS_DIR = "exemplars"; + /** TODO: better place for these constants? */ private static final String SEED_DIR = "seed"; + /** TODO: better place for these constants? */ private static final String KEYBOARDS_DIR = "keyboards"; diff --git a/tools/cldr-code/src/main/java/org/unicode/cldr/util/CLDRFile.java b/tools/cldr-code/src/main/java/org/unicode/cldr/util/CLDRFile.java index 646548c22f3..2a354545872 100644 --- a/tools/cldr-code/src/main/java/org/unicode/cldr/util/CLDRFile.java +++ b/tools/cldr-code/src/main/java/org/unicode/cldr/util/CLDRFile.java @@ -110,6 +110,7 @@ public class CLDRFile implements Freezable, Iterable, LocaleSt private static final ImmutableSet casesNominativeOnly = ImmutableSet.of(GrammaticalFeature.grammaticalCase.getDefault(null)); + /** * Variable to control whether File reads are buffered; this will about halve the time spent in * loadFromFile() and Factory.make() from about 20 % to about 10 %. It will also noticeably diff --git a/tools/cldr-code/src/main/java/org/unicode/cldr/util/CLDRLocale.java b/tools/cldr-code/src/main/java/org/unicode/cldr/util/CLDRLocale.java index 5bfdf3d0472..067997a9212 100644 --- a/tools/cldr-code/src/main/java/org/unicode/cldr/util/CLDRLocale.java +++ b/tools/cldr-code/src/main/java/org/unicode/cldr/util/CLDRLocale.java @@ -227,10 +227,13 @@ public enum FormatBehavior { /** Cached ICU format locale */ private ULocale ulocale; + /** base name, 'without parameters'. Currently same as fullname. */ private String basename; + /** Full name */ private String fullname; + /** The LocaleIDParser interprets the various parts (language, country, script, etc). */ private LocaleIDParser parts = null; diff --git a/tools/cldr-code/src/main/java/org/unicode/cldr/util/CLDRPaths.java b/tools/cldr-code/src/main/java/org/unicode/cldr/util/CLDRPaths.java index 97a7dbc1867..37265881468 100644 --- a/tools/cldr-code/src/main/java/org/unicode/cldr/util/CLDRPaths.java +++ b/tools/cldr-code/src/main/java/org/unicode/cldr/util/CLDRPaths.java @@ -38,6 +38,7 @@ public class CLDRPaths { /** Maintained in GitHub, base directory for CLDR */ public static final String BASE_DIRECTORY = CldrUtility.getPath(CldrUtility.getProperty(CldrUtility.DIR_KEY, null)); + /** * Get path to dtd2md dir * @@ -158,6 +159,7 @@ public static final Path getDtd2MdDirectory() { @Deprecated public static final String SUPPLEMENTAL_DIRECTORY = CldrUtility.getPath(COMMON_DIRECTORY, "supplemental/"); + /** Only the default, if no other directory is specified. */ public static final String DEFAULT_SUPPLEMENTAL_DIRECTORY = CldrUtility.getPath(COMMON_DIRECTORY, "supplemental/"); diff --git a/tools/cldr-code/src/main/java/org/unicode/cldr/util/CLDRTransforms.java b/tools/cldr-code/src/main/java/org/unicode/cldr/util/CLDRTransforms.java index 2bcee0f7dd9..a051b8301b5 100644 --- a/tools/cldr-code/src/main/java/org/unicode/cldr/util/CLDRTransforms.java +++ b/tools/cldr-code/src/main/java/org/unicode/cldr/util/CLDRTransforms.java @@ -56,6 +56,7 @@ public CLDRTransforms setShowProgress(Appendable showProgress) { } final Set overridden = new HashSet<>(); + // final DependencyOrder dependencyOrder = new DependencyOrder(); // static public class RegexFindFilenameFilter implements FilenameFilter { @@ -830,6 +831,7 @@ public void handlePathValue(String path, String value) { } static boolean ALREADY_REGISTERED = false; + /** * Register just those transliterators that are different than ICU. TODO: check against the file * system to make sure the list is accurate. @@ -1090,6 +1092,7 @@ public static Set getFileRegistrationOrder(String dir) { } return ImmutableSet.copyOf(orderedDependents); } + // fails match: :: [:Latin:] fullwidth-halfwidth (); static final Pattern TRANSLIT_FINDER = @@ -1104,6 +1107,7 @@ public static Set getFileRegistrationOrder(String dir) { + "\\s*\\)" + ")?" + "\\s*;\\s*(#.*)?"); + // static { // Matcher matcher = TRANSLIT_FINDER.matcher("::[:Latin:] fullwidth-halfwidth();"); // System.out.println(matcher.matches()); diff --git a/tools/cldr-code/src/main/java/org/unicode/cldr/util/CLDRTreeWriter.java b/tools/cldr-code/src/main/java/org/unicode/cldr/util/CLDRTreeWriter.java index e85ad5b591d..bee0bc34322 100644 --- a/tools/cldr-code/src/main/java/org/unicode/cldr/util/CLDRTreeWriter.java +++ b/tools/cldr-code/src/main/java/org/unicode/cldr/util/CLDRTreeWriter.java @@ -9,12 +9,14 @@ public class CLDRTreeWriter implements AutoCloseable { private final Set locales = new TreeSet<>(); private final Set removed = new TreeSet<>(); private final String path; + /** * @param path root of files to write */ public CLDRTreeWriter(String forPath) { path = forPath; } + /** mark a file as written */ public void write(CLDRFile f) throws IOException { final String locale = f.getLocaleID(); diff --git a/tools/cldr-code/src/main/java/org/unicode/cldr/util/CLDRURLS.java b/tools/cldr-code/src/main/java/org/unicode/cldr/util/CLDRURLS.java index 78a3dc24e45..c9c327741b9 100644 --- a/tools/cldr-code/src/main/java/org/unicode/cldr/util/CLDRURLS.java +++ b/tools/cldr-code/src/main/java/org/unicode/cldr/util/CLDRURLS.java @@ -9,6 +9,7 @@ public abstract class CLDRURLS { public static final String CLDR_SCHEMA_BASE = "https://schemas.unicode.org/cldr"; public static final String CLDR_CURVER_BASE = CLDR_SCHEMA_BASE + "/" + CLDRFile.GEN_VERSION; + /** Base URL for the CLDR repository */ public static final String CLDR_REPO_BASE = "https://github.com/unicode-org/cldr/"; @@ -17,11 +18,13 @@ public abstract class CLDRURLS { "https://github.com/unicode-org/cldr-staging/blob/main/"; public static final String DEFAULT_COMMIT_BASE = CLDR_REPO_BASE + "commit/"; + /** Hostname for the Survey Tool */ public static final String DEFAULT_HOST = "st.unicode.org"; public static final String DEFAULT_PATH = "/cldr-apps"; public static final String DEFAULT_BASE = "https://" + DEFAULT_HOST + DEFAULT_PATH; + /** URL for filing a new ticket */ public static final String CLDR_NEWTICKET_URL = "https://cldr.unicode.org/index/bug-reports#TOC-Filing-a-Ticket"; @@ -30,18 +33,22 @@ public abstract class CLDRURLS { public static final String CLDR_HOMEPAGE = "https://cldr.unicode.org"; public static final String UNICODE_CONSORTIUM = "The Unicode Consortium"; public static final String CLDR_UPDATINGDTD_URL = CLDR_HOMEPAGE + "/development/updating-dtds"; + /** Our license, in SPDX format */ public static final String UNICODE_SPDX = "Unicode-3.0"; + /** * See: * https://spdx.github.io/spdx-spec/appendix-V-using-SPDX-short-identifiers-in-source-files/ */ public static final String UNICODE_SPDX_HEADER = "SPDX-License-Identifier: " + UNICODE_SPDX; + /** * Override this property if you want to change the absolute URL to the SurveyTool base from * DEFAULT_BASE */ public static final String CLDR_SURVEY_BASE = "CLDR_SURVEY_BASE"; + /** * Override this property if you want to change the relative URL to the SurveyTool base from * DEFAULT_PATH (within SurveyTool only) @@ -78,6 +85,7 @@ public enum Special { } protected static String VPATH = "/v#"; + /** Constant for an unknown git revision. Use the same in the builders. */ public static final String UNKNOWN_REVISION = "(unknown)"; diff --git a/tools/cldr-code/src/main/java/org/unicode/cldr/util/CalculateLocaleCoverage.java b/tools/cldr-code/src/main/java/org/unicode/cldr/util/CalculateLocaleCoverage.java index c23ee2d6478..a70b084cb2b 100644 --- a/tools/cldr-code/src/main/java/org/unicode/cldr/util/CalculateLocaleCoverage.java +++ b/tools/cldr-code/src/main/java/org/unicode/cldr/util/CalculateLocaleCoverage.java @@ -45,6 +45,7 @@ public static final class CoverageResult { public boolean icu = false; public int sumFound; public int sumUnconfirmed; + /** in order of the Level enum */ public double proportions[] = new double[Level.values().length]; diff --git a/tools/cldr-code/src/main/java/org/unicode/cldr/util/CldrUtility.java b/tools/cldr-code/src/main/java/org/unicode/cldr/util/CldrUtility.java index 308c0ef1b84..878c421af18 100644 --- a/tools/cldr-code/src/main/java/org/unicode/cldr/util/CldrUtility.java +++ b/tools/cldr-code/src/main/java/org/unicode/cldr/util/CldrUtility.java @@ -88,6 +88,7 @@ public class CldrUtility { public static final Pattern SEMI_SPLIT = PatternCache.get("\\s*;\\s*"); private static final boolean HANDLEFILE_SHOW_SKIP = false; + /** * Constant for "∅∅∅". Indicates that a child locale has no value for a path even though a * parent does. diff --git a/tools/cldr-code/src/main/java/org/unicode/cldr/util/Containment.java b/tools/cldr-code/src/main/java/org/unicode/cldr/util/Containment.java index 57a47ed668c..ac35a01d67e 100644 --- a/tools/cldr-code/src/main/java/org/unicode/cldr/util/Containment.java +++ b/tools/cldr-code/src/main/java/org/unicode/cldr/util/Containment.java @@ -60,6 +60,7 @@ public class Containment { static final Map toOrder = new LinkedHashMap<>(); static int level = 0; static int order; + /** track whether any errors, such as loops, were detected */ public static boolean hadErrors = false; diff --git a/tools/cldr-code/src/main/java/org/unicode/cldr/util/DoctypeXmlStreamWrapper.java b/tools/cldr-code/src/main/java/org/unicode/cldr/util/DoctypeXmlStreamWrapper.java index f1e9f7370e9..c71599f2fb3 100644 --- a/tools/cldr-code/src/main/java/org/unicode/cldr/util/DoctypeXmlStreamWrapper.java +++ b/tools/cldr-code/src/main/java/org/unicode/cldr/util/DoctypeXmlStreamWrapper.java @@ -17,10 +17,12 @@ public class DoctypeXmlStreamWrapper { private static final byte DOCTYPE_BYTES[] = DOCTYPE.getBytes(StandardCharsets.UTF_8); // the string to look for: xmlns=" private static final String XMLNS_EQUALS = LDMLConstants.XMLNS + "=\""; + /** * Size of the input buffer, needs to be able to handle any expansion when the header is updated */ public static int BUFFER_MAX_SIZE = 1024; + /** Size of the first read, needs to contain xmlns="..." and be less than BUFFER_MAX_SIZE */ public static int BUFFER_READ_SIZE = 512; diff --git a/tools/cldr-code/src/main/java/org/unicode/cldr/util/DtdType.java b/tools/cldr-code/src/main/java/org/unicode/cldr/util/DtdType.java index e629f26530b..5b4320a47a6 100644 --- a/tools/cldr-code/src/main/java/org/unicode/cldr/util/DtdType.java +++ b/tools/cldr-code/src/main/java/org/unicode/cldr/util/DtdType.java @@ -41,6 +41,7 @@ public enum DtdType { static Pattern FIRST_ELEMENT = PatternCache.get("//([^/\\[]*)"); public final String dtdPath; + /** * The actual root type used with the DTD. Used for ldmlICU.dtd which is used with the * root type. This mechanism isn't used for keyboard2, which simply has a different element diff --git a/tools/cldr-code/src/main/java/org/unicode/cldr/util/ElementAttributeInfo.java b/tools/cldr-code/src/main/java/org/unicode/cldr/util/ElementAttributeInfo.java index 019eb80cde9..de54ef577e1 100644 --- a/tools/cldr-code/src/main/java/org/unicode/cldr/util/ElementAttributeInfo.java +++ b/tools/cldr-code/src/main/java/org/unicode/cldr/util/ElementAttributeInfo.java @@ -34,6 +34,7 @@ public class ElementAttributeInfo { Relation.of(new LinkedHashMap>(), LinkedHashSet.class); static Map> cache = new HashMap<>(); // new + // HashMap(); diff --git a/tools/cldr-code/src/main/java/org/unicode/cldr/util/Emoji.java b/tools/cldr-code/src/main/java/org/unicode/cldr/util/Emoji.java index dc07ebd1c75..8bf5d4bfc11 100644 --- a/tools/cldr-code/src/main/java/org/unicode/cldr/util/Emoji.java +++ b/tools/cldr-code/src/main/java/org/unicode/cldr/util/Emoji.java @@ -128,11 +128,13 @@ public class Emoji { emojiToMinorCategory.setErrorOnReset(true); toName.setErrorOnReset(true); } + /** * A mapping from a majorCategory to a unique ordering number, based on the first time it is * encountered. */ static final Map majorToOrder = new HashMap<>(); + /** * A mapping from a minorCategory to a unique ordering number, based on the first time it is * encountered. @@ -146,6 +148,7 @@ public class Emoji { static final UnicodeMap restoreVariants = new UnicodeMap<>(); static final Set> genderSets; + // ߘ€ E1.0 grinning face static { /* diff --git a/tools/cldr-code/src/main/java/org/unicode/cldr/util/GrammarInfo.java b/tools/cldr-code/src/main/java/org/unicode/cldr/util/GrammarInfo.java index 1abab36d057..41779eaba3d 100644 --- a/tools/cldr-code/src/main/java/org/unicode/cldr/util/GrammarInfo.java +++ b/tools/cldr-code/src/main/java/org/unicode/cldr/util/GrammarInfo.java @@ -71,6 +71,7 @@ public enum CaseValues { terminative; public static Comparator COMPARATOR = EnumComparator.create(CaseValues.class); } + /** * There is no standard order of grammatical gender values across languages. The ordering uses * Polish order https://en.wikipedia.org/wiki/Polish_grammar#Gender as a base (since it has most @@ -140,6 +141,7 @@ public String getShortName() { public CharSequence getSymbol() { return symbol; } + /** Gets the default value. The parameter only needs to be set for grammaticalGender */ public String getDefault(Collection featureValuesFromGrammaticalInfo) { return this == grammaticalGender @@ -541,6 +543,7 @@ public static String getGrammaticalInfoAttributes( "volume-quart", "volume-tablespoon", "volume-teaspoon"); + // compounds // "kilogram-per-cubic-meter", "kilometer-per-liter", "concentr-gram-per-mole", // "speed-mile-per-second", "volumetricflow-cubic-foot-per-second", @@ -763,6 +766,7 @@ public static Set getSpecialsToTranslate() { } public static final boolean DEBUG = false; + /** Internal class for thread-safety */ static class UnitsToAddGrammar { static final Set data; diff --git a/tools/cldr-code/src/main/java/org/unicode/cldr/util/LanguageTagParser.java b/tools/cldr-code/src/main/java/org/unicode/cldr/util/LanguageTagParser.java index 9900eab0393..8faa2e96c58 100644 --- a/tools/cldr-code/src/main/java/org/unicode/cldr/util/LanguageTagParser.java +++ b/tools/cldr-code/src/main/java/org/unicode/cldr/util/LanguageTagParser.java @@ -907,6 +907,7 @@ private void appendField( } } } + /** * Return the script of the locale (without creating a CLDRFile). Note that for ja, the script * is Jpan; for ko, Kore; and zh/yue, either Hant or Hans.
diff --git a/tools/cldr-code/src/main/java/org/unicode/cldr/util/LocaleValidator.java b/tools/cldr-code/src/main/java/org/unicode/cldr/util/LocaleValidator.java index b83c5b57d59..d6f34b155e8 100644 --- a/tools/cldr-code/src/main/java/org/unicode/cldr/util/LocaleValidator.java +++ b/tools/cldr-code/src/main/java/org/unicode/cldr/util/LocaleValidator.java @@ -210,6 +210,7 @@ private enum Validation { abort, keepOn } + /** * Returns true if it doesn't validate and errors == null (allows for fast rejection) * diff --git a/tools/cldr-code/src/main/java/org/unicode/cldr/util/MapComparator.java b/tools/cldr-code/src/main/java/org/unicode/cldr/util/MapComparator.java index e508db4e830..5c72b96f1e9 100644 --- a/tools/cldr-code/src/main/java/org/unicode/cldr/util/MapComparator.java +++ b/tools/cldr-code/src/main/java/org/unicode/cldr/util/MapComparator.java @@ -26,6 +26,7 @@ public class MapComparator implements Comparator, Freezable> { private static final class CollatorHelper { public static final Collator UCA = getUCA(); + /** * This does not change, so we can create one and freeze it. * @@ -37,6 +38,7 @@ private static Collator getUCA() { return newUca.freeze(); } } + // initialize this once private Map ordering = new TreeMap<>(); // maps from name to rank private List rankToName = new ArrayList<>(); diff --git a/tools/cldr-code/src/main/java/org/unicode/cldr/util/NodeListIterator.java b/tools/cldr-code/src/main/java/org/unicode/cldr/util/NodeListIterator.java index 866187ee1f9..82db69802ce 100644 --- a/tools/cldr-code/src/main/java/org/unicode/cldr/util/NodeListIterator.java +++ b/tools/cldr-code/src/main/java/org/unicode/cldr/util/NodeListIterator.java @@ -15,6 +15,7 @@ public class NodeListIterator implements Iterator { /** The NodeList to work on */ private NodeList nodeList; + /** Since node lists are indexed by position, the current position */ private int currentPos = 0; diff --git a/tools/cldr-code/src/main/java/org/unicode/cldr/util/Pick.java b/tools/cldr-code/src/main/java/org/unicode/cldr/util/Pick.java index 6cbc83c81bb..76e6e1a5383 100644 --- a/tools/cldr-code/src/main/java/org/unicode/cldr/util/Pick.java +++ b/tools/cldr-code/src/main/java/org/unicode/cldr/util/Pick.java @@ -122,6 +122,7 @@ public static Pick.Sequence makeSequence() { public static Pick.Alternation makeAlternation() { return new Alternation(); } + /* static public Pick.Sequence and(Object item) { return new Sequence().and2(item); @@ -166,6 +167,7 @@ public static Pick codePoint(UnicodeSet source) { public static Pick string(String source) { return new Literal(source); } + /* static public Pick unquoted(String source) { return new Literal(source); @@ -176,6 +178,7 @@ static public Pick string(int minLength, int maxLength, Pick item) { */ public abstract String getInternal(int depth, Set alreadySeen); + // Internals protected String name; @@ -614,6 +617,7 @@ public void setMax(String type) { public String toString() { return "index; " + index + ", maxInt:" + maxInt + ", maxType: " + maxType; } + /*private static final Object BAD = new Object(); private static final Object GOOD = new Object();*/ @@ -832,6 +836,7 @@ public String toString() { return result; } } + /* private static Pick convert(Object obj) { if (obj instanceof Pick) return (Pick)obj; diff --git a/tools/cldr-code/src/main/java/org/unicode/cldr/util/PreferredAndAllowedHour.java b/tools/cldr-code/src/main/java/org/unicode/cldr/util/PreferredAndAllowedHour.java index 96c46452ed7..d1903b22c6a 100644 --- a/tools/cldr-code/src/main/java/org/unicode/cldr/util/PreferredAndAllowedHour.java +++ b/tools/cldr-code/src/main/java/org/unicode/cldr/util/PreferredAndAllowedHour.java @@ -54,6 +54,7 @@ public static boolean isHourCharacter(String c) { t -> t.allowed, lexicographical(Comparator.naturalOrder())); public final HourStyle preferred; + /** Unique allowed styles, in the order they were specified during construction. */ public final ImmutableList allowed; diff --git a/tools/cldr-code/src/main/java/org/unicode/cldr/util/RegexLogger.java b/tools/cldr-code/src/main/java/org/unicode/cldr/util/RegexLogger.java index 2b14d19f7a5..16b9e666d05 100644 --- a/tools/cldr-code/src/main/java/org/unicode/cldr/util/RegexLogger.java +++ b/tools/cldr-code/src/main/java/org/unicode/cldr/util/RegexLogger.java @@ -29,6 +29,7 @@ public class RegexLogger { /** Should debugging be done? - if not, a null implementation will be used */ private static final boolean DEBUG = false; + /** Instance */ private static RegexLoggerInterface instance = null; diff --git a/tools/cldr-code/src/main/java/org/unicode/cldr/util/RegexLookup.java b/tools/cldr-code/src/main/java/org/unicode/cldr/util/RegexLookup.java index 5d10a94a285..0581452c79a 100644 --- a/tools/cldr-code/src/main/java/org/unicode/cldr/util/RegexLookup.java +++ b/tools/cldr-code/src/main/java/org/unicode/cldr/util/RegexLookup.java @@ -357,6 +357,7 @@ public class RTNode extends NodeBase { // T _val; List _children = new ArrayList<>(); int _rank = -1; // rank -1 means the node was not inserted, but only used for structural + // purposes // constructor for regular nodes with a Finder diff --git a/tools/cldr-code/src/main/java/org/unicode/cldr/util/SimpleFactory.java b/tools/cldr-code/src/main/java/org/unicode/cldr/util/SimpleFactory.java index 60a7d8ddf28..f8a8a43d4ec 100644 --- a/tools/cldr-code/src/main/java/org/unicode/cldr/util/SimpleFactory.java +++ b/tools/cldr-code/src/main/java/org/unicode/cldr/util/SimpleFactory.java @@ -41,6 +41,7 @@ public class SimpleFactory extends Factory { /** Object that is used for synchronization when looking up simple factories */ private static final Object FACTORY_LOOKUP_SYNC = new Object(); + /** * The maximum cache size the caches in 15 is a safe limit for instances with limited amounts of * memory (around 128MB). Larger numbers are tolerable if more memory is available. This diff --git a/tools/cldr-code/src/main/java/org/unicode/cldr/util/StandardCodes.java b/tools/cldr-code/src/main/java/org/unicode/cldr/util/StandardCodes.java index 02f8f9fe478..de805d2f5bf 100644 --- a/tools/cldr-code/src/main/java/org/unicode/cldr/util/StandardCodes.java +++ b/tools/cldr-code/src/main/java/org/unicode/cldr/util/StandardCodes.java @@ -104,6 +104,7 @@ public static CodeType from(String name) { private static final class StandardCodesHelper { static final StandardCodes SINGLETON = new StandardCodes(); } + /** Get the singleton copy of the standard codes. */ public static synchronized StandardCodes make() { return StandardCodesHelper.SINGLETON; diff --git a/tools/cldr-code/src/main/java/org/unicode/cldr/util/SupplementalDataInfo.java b/tools/cldr-code/src/main/java/org/unicode/cldr/util/SupplementalDataInfo.java index e71a1ad97f4..2caae47d1b2 100644 --- a/tools/cldr-code/src/main/java/org/unicode/cldr/util/SupplementalDataInfo.java +++ b/tools/cldr-code/src/main/java/org/unicode/cldr/util/SupplementalDataInfo.java @@ -1361,6 +1361,7 @@ class MyHandler extends XMLFileReader.SimpleHandler { LanguageTagParser languageTagParser = null; // postpone assignment until needed, to avoid re-entrance of + // SupplementalDataInfo.getInstance /** Finish processing anything left hanging in the file. */ diff --git a/tools/cldr-code/src/main/java/org/unicode/cldr/util/UnicodeSetPrettyPrinter.java b/tools/cldr-code/src/main/java/org/unicode/cldr/util/UnicodeSetPrettyPrinter.java index dbf2962369e..6ad27753078 100644 --- a/tools/cldr-code/src/main/java/org/unicode/cldr/util/UnicodeSetPrettyPrinter.java +++ b/tools/cldr-code/src/main/java/org/unicode/cldr/util/UnicodeSetPrettyPrinter.java @@ -316,6 +316,7 @@ UnicodeSetPrettyPrinter appendQuoted(int codePoint) { UTF16.append(target, codePoint); return this; } + // Appender append(String s) { // target.append(s); // return this; diff --git a/tools/cldr-code/src/main/java/org/unicode/cldr/util/UnitConverter.java b/tools/cldr-code/src/main/java/org/unicode/cldr/util/UnitConverter.java index 44620cfbb13..789350e075d 100644 --- a/tools/cldr-code/src/main/java/org/unicode/cldr/util/UnitConverter.java +++ b/tools/cldr-code/src/main/java/org/unicode/cldr/util/UnitConverter.java @@ -2185,6 +2185,7 @@ public enum UnitComplexity { } private ConcurrentHashMap COMPLEXITY = new ConcurrentHashMap<>(); + // TODO This is safe but should use regular cache public UnitComplexity getComplexity(String longOrShortId) { diff --git a/tools/cldr-code/src/main/java/org/unicode/cldr/util/Units.java b/tools/cldr-code/src/main/java/org/unicode/cldr/util/Units.java index 68e4e9f9825..176c3890f45 100644 --- a/tools/cldr-code/src/main/java/org/unicode/cldr/util/Units.java +++ b/tools/cldr-code/src/main/java/org/unicode/cldr/util/Units.java @@ -86,6 +86,7 @@ public static class TypeAndCore { public String type; public String core; } + /** * Returns the type and core for a unit, be it long or short * diff --git a/tools/cldr-code/src/main/java/org/unicode/cldr/util/VariableAndPathParser.java b/tools/cldr-code/src/main/java/org/unicode/cldr/util/VariableAndPathParser.java index 4069e0285d5..348449b9b4a 100644 --- a/tools/cldr-code/src/main/java/org/unicode/cldr/util/VariableAndPathParser.java +++ b/tools/cldr-code/src/main/java/org/unicode/cldr/util/VariableAndPathParser.java @@ -52,6 +52,7 @@ public static interface ExtractablePath { /** XPathExpressionParser, used internally */ private final XPathExpressionParser xpExpParser; + /** pointer to the implementation of the interface called for variable extraction */ private ExtractableVariable variableExtractor; diff --git a/tools/cldr-code/src/main/java/org/unicode/cldr/util/VoteResolver.java b/tools/cldr-code/src/main/java/org/unicode/cldr/util/VoteResolver.java index 8b92aa1bbac..e6eab29b6a4 100644 --- a/tools/cldr-code/src/main/java/org/unicode/cldr/util/VoteResolver.java +++ b/tools/cldr-code/src/main/java/org/unicode/cldr/util/VoteResolver.java @@ -480,6 +480,7 @@ public static class VoterInfo { private Organization organization; private Level level; private String name; + /** * A set of locales associated with this voter; it is often empty (as when the user has "*" * for their set of locales); it may not serve any purpose in ordinary operation of Survey @@ -587,12 +588,14 @@ public MaxCounter add(T obj, long countValue, long time) { private class OrganizationToValueAndVote { private final Map> orgToVotes = new EnumMap<>(Organization.class); + /** * All votes, even those that aren't any org's vote because they lost an intra-org dispute */ private final Counter allVotesIncludingIntraOrgDispute = new Counter<>(); private final Map orgToMax = new EnumMap<>(Organization.class); + /** The result of {@link #getTotals(EnumSet)} */ private final Counter totals = new Counter<>(true); @@ -2256,6 +2259,7 @@ public static Status calculateStatus(CLDRFile baselineFile, String path) { } return status; } + /** * Get the possibly modified value. If value matches the bailey value or inheritance marker, * possibly change it from bailey value to inheritance marker, or vice-versa, as needed to meet diff --git a/tools/cldr-code/src/main/java/org/unicode/cldr/util/XMLFileReader.java b/tools/cldr-code/src/main/java/org/unicode/cldr/util/XMLFileReader.java index 46549e9817b..64c3b984c58 100644 --- a/tools/cldr-code/src/main/java/org/unicode/cldr/util/XMLFileReader.java +++ b/tools/cldr-code/src/main/java/org/unicode/cldr/util/XMLFileReader.java @@ -43,6 +43,7 @@ */ public class XMLFileReader { static final boolean SHOW_ALL = false; + /** Handlers to use in read() */ public static int CONTENT_HANDLER = 1, ERROR_HANDLER = 2, diff --git a/tools/cldr-code/src/main/java/org/unicode/cldr/util/XMLSource.java b/tools/cldr-code/src/main/java/org/unicode/cldr/util/XMLSource.java index 780cbfc7317..c2a538b2d94 100644 --- a/tools/cldr-code/src/main/java/org/unicode/cldr/util/XMLSource.java +++ b/tools/cldr-code/src/main/java/org/unicode/cldr/util/XMLSource.java @@ -299,6 +299,7 @@ public static final class Alias { static final Pattern aliasPattern = Pattern.compile( "(?:\\[@source=\"([^\"]*)\"])?(?:\\[@path=\"([^\"]*)\"])?(?:\\[@draft=\"([^\"]*)\"])?"); + // constant, so no need to sync public static Alias make(String aliasPath) { diff --git a/tools/cldr-code/src/main/java/org/unicode/cldr/util/XPathParts.java b/tools/cldr-code/src/main/java/org/unicode/cldr/util/XPathParts.java index 4dd125786db..1da33da90fa 100644 --- a/tools/cldr-code/src/main/java/org/unicode/cldr/util/XPathParts.java +++ b/tools/cldr-code/src/main/java/org/unicode/cldr/util/XPathParts.java @@ -477,6 +477,7 @@ protected void handleClearElements() { protected void handleAddElement(String element) { addElement(element); } + /** * Add an Element object to this XPathParts, using the given element name. If this is the first * Element in this XPathParts, also set dtdData. Do not set any attributes. diff --git a/tools/cldr-code/src/main/java/org/unicode/cldr/util/personname/PersonNameFormatter.java b/tools/cldr-code/src/main/java/org/unicode/cldr/util/personname/PersonNameFormatter.java index ac77c3039b8..afe53acf199 100644 --- a/tools/cldr-code/src/main/java/org/unicode/cldr/util/personname/PersonNameFormatter.java +++ b/tools/cldr-code/src/main/java/org/unicode/cldr/util/personname/PersonNameFormatter.java @@ -89,6 +89,7 @@ public enum Order { public static final Comparator> ITERABLE_COMPARE = Comparators.lexicographical(Comparator.naturalOrder()); public static final Set ALL = ImmutableSet.copyOf(Order.values()); + /** Use this instead of valueOf if value might be null */ public static Order from(String item) { return item == null ? null : Order.valueOf(item); @@ -133,6 +134,7 @@ public enum Usage { public static final Comparator> ITERABLE_COMPARE = Comparators.lexicographical(Comparator.naturalOrder()); public static final Set ALL = ImmutableSet.copyOf(Usage.values()); + /** Use this instead of valueOf if value might be null */ public static Usage from(String item) { return item == null ? null : Usage.valueOf(item); @@ -145,6 +147,7 @@ public enum Formality { public static final Comparator> ITERABLE_COMPARE = Comparators.lexicographical(Comparator.naturalOrder()); public static final Set ALL = ImmutableSet.copyOf(Formality.values()); + /** Use this instead of valueOf if value might be null */ public static Formality from(String item) { return item == null ? null : Formality.valueOf(item); @@ -310,6 +313,7 @@ public enum Optionality { optional, disallowed } + /** * Types of samples, only for use by CLDR * @@ -1767,14 +1771,17 @@ public static interface NameObject { * the locale of the person name formatter. */ public ULocale getNameLocale(); + /** Returns a mapping for the modified fields directly supported to their values. */ public ImmutableMap getModifiedFieldToValue(); + /** * Returns the set of fields directly supported. Should be overridden for speed. It returns * the same value as getModifiedFieldToValue().keySet().stream().map(x -> * x.field).collect(Collectors.toSet()), but may be optimized. */ public Set getAvailableFields(); + /** * Returns the best available value for the modified field, or null if nothing is available. * Null is returned in all and only those cases where diff --git a/tools/cldr-code/src/main/java/org/unicode/cldr/util/props/BagFormatter.java b/tools/cldr-code/src/main/java/org/unicode/cldr/util/props/BagFormatter.java index f14d7ee6600..c18655f7ac5 100644 --- a/tools/cldr-code/src/main/java/org/unicode/cldr/util/props/BagFormatter.java +++ b/tools/cldr-code/src/main/java/org/unicode/cldr/util/props/BagFormatter.java @@ -88,6 +88,7 @@ public void showSetDifferences( PrintWriter pw, String name1, UnicodeSet set1, String name2, UnicodeSet set2) { showSetDifferences(pw, name1, set1, name2, set2, -1); } + /** * Compare two UnicodeSets, and show the differences * @@ -698,6 +699,7 @@ private static class NameIterator { this.source = source; this.limit = source.length(); } + /** * Find next word, including trailing spaces * @@ -734,6 +736,7 @@ static int findMatchingEnd(String s1, String s2) { private class RangeFinder { int start, limit; private int veryLimit; + // String label, value; void reset(int rangeStart, int rangeLimit) { limit = rangeStart; @@ -1104,6 +1107,7 @@ public BagFormatter setRangeBreakSource(UnicodeLabel label) { public Transliterator getFixName() { return fixName; } + /** * @param fixName The fixName to set. */ diff --git a/tools/cldr-code/src/main/java/org/unicode/cldr/util/props/RandomStringGenerator.java b/tools/cldr-code/src/main/java/org/unicode/cldr/util/props/RandomStringGenerator.java index d33b05b0390..f8b770f4c5f 100644 --- a/tools/cldr-code/src/main/java/org/unicode/cldr/util/props/RandomStringGenerator.java +++ b/tools/cldr-code/src/main/java/org/unicode/cldr/util/props/RandomStringGenerator.java @@ -24,6 +24,7 @@ public class RandomStringGenerator { * debugging. */ public static UnicodeSet DEBUG_REDUCE_SET_SIZE = null; // new + // UnicodeSet("[\\u0000-\\u00FF\\u0300-\\u03FF\\u2000-\\u20FF]"); // // new UnicodeSet("[\\u0000-\\u00FF\\u2000-\\u20FF]"); // // or null diff --git a/tools/cldr-code/src/test/java/org/unicode/cldr/tool/TestKeyboardFlatten.java b/tools/cldr-code/src/test/java/org/unicode/cldr/tool/TestKeyboardFlatten.java index c2b604b627b..5199e6147c9 100644 --- a/tools/cldr-code/src/test/java/org/unicode/cldr/tool/TestKeyboardFlatten.java +++ b/tools/cldr-code/src/test/java/org/unicode/cldr/tool/TestKeyboardFlatten.java @@ -39,8 +39,11 @@ void TestBrokenImports(final String path) throws IOException { @Test void TestImportMaltese() - throws TransformerConfigurationException, SAXException, TransformerException, - TransformerFactoryConfigurationError, IOException { + throws TransformerConfigurationException, + SAXException, + TransformerException, + TransformerFactoryConfigurationError, + IOException { final File base = CLDRConfig.getInstance().getCldrBaseDirectory(); final File mtxml = new File(base, "keyboards/3.0/mt.xml"); ByteArrayOutputStream baos = new ByteArrayOutputStream(); diff --git a/tools/cldr-code/src/test/java/org/unicode/cldr/unittest/CheckLdmlDtdReferences.java b/tools/cldr-code/src/test/java/org/unicode/cldr/unittest/CheckLdmlDtdReferences.java index f708a5e53a8..8e9d52a2080 100644 --- a/tools/cldr-code/src/test/java/org/unicode/cldr/unittest/CheckLdmlDtdReferences.java +++ b/tools/cldr-code/src/test/java/org/unicode/cldr/unittest/CheckLdmlDtdReferences.java @@ -43,6 +43,7 @@ public class CheckLdmlDtdReferences { static Map> foundElementsToLink = new LinkedHashMap<>(); static Map> childToParent = new LinkedHashMap<>(); + // static Map> foundAttributesToLink = new // LinkedHashMap<>(); static { diff --git a/tools/cldr-code/src/test/java/org/unicode/cldr/unittest/LikelySubtagsTest.java b/tools/cldr-code/src/test/java/org/unicode/cldr/unittest/LikelySubtagsTest.java index 236c3061fd4..832e838983a 100644 --- a/tools/cldr-code/src/test/java/org/unicode/cldr/unittest/LikelySubtagsTest.java +++ b/tools/cldr-code/src/test/java/org/unicode/cldr/unittest/LikelySubtagsTest.java @@ -169,6 +169,7 @@ void add(LanguageTagParser ltp, boolean source) { final LanguageTagParser sourceLtp = new LanguageTagParser(); final Set KNOWN_ERRORS = Set.of("en_Latn_MU", "en_Latn_SL", "en_Latn_TK", "en_Latn_ZM"); + /** * Return false if we should skip the language * diff --git a/tools/cldr-code/src/test/java/org/unicode/cldr/unittest/TestAnnotations.java b/tools/cldr-code/src/test/java/org/unicode/cldr/unittest/TestAnnotations.java index 278212e74e7..4ba9697a01b 100644 --- a/tools/cldr-code/src/test/java/org/unicode/cldr/unittest/TestAnnotations.java +++ b/tools/cldr-code/src/test/java/org/unicode/cldr/unittest/TestAnnotations.java @@ -215,6 +215,7 @@ public void TestNames() { static final UnicodeSet symbols = new UnicodeSet(Emoji.EXTRA_SYMBOL_MINOR_CATEGORIES.keySet()).freeze(); + /** The English name should line up with the emoji-test.txt file */ public void TestNamesVsEmojiData() { for (Entry s : eng.getExplicitValues().entrySet()) { diff --git a/tools/cldr-code/src/test/java/org/unicode/cldr/unittest/TestBNF.java b/tools/cldr-code/src/test/java/org/unicode/cldr/unittest/TestBNF.java index c6fb852c579..3c99b9b4a12 100644 --- a/tools/cldr-code/src/test/java/org/unicode/cldr/unittest/TestBNF.java +++ b/tools/cldr-code/src/test/java/org/unicode/cldr/unittest/TestBNF.java @@ -103,6 +103,7 @@ static void testMatch(Pick p, String source) { boolean value = p.match(source, pp); System.out.println("Match: " + value + ", " + pp); } + /* static void testParser() { try { diff --git a/tools/cldr-code/src/test/java/org/unicode/cldr/unittest/TestDisplayAndInputProcessor.java b/tools/cldr-code/src/test/java/org/unicode/cldr/unittest/TestDisplayAndInputProcessor.java index 463049568ea..f2f742693e9 100644 --- a/tools/cldr-code/src/test/java/org/unicode/cldr/unittest/TestDisplayAndInputProcessor.java +++ b/tools/cldr-code/src/test/java/org/unicode/cldr/unittest/TestDisplayAndInputProcessor.java @@ -398,6 +398,7 @@ private void showCldrFile(final CLDRFile cldrFile) { } } } + /** DAIP can add characters to UnicodeSets, so remove them for a clean test. Could optimize */ UnicodeSet suppressAdditions(UnicodeSet value, UnicodeSet input_value) { for (UnicodeSetIterator usi = new UnicodeSetIterator(value); usi.next(); ) { diff --git a/tools/cldr-code/src/test/java/org/unicode/cldr/unittest/TestExampleGenerator.java b/tools/cldr-code/src/test/java/org/unicode/cldr/unittest/TestExampleGenerator.java index 121390a1be1..32b2c91898d 100644 --- a/tools/cldr-code/src/test/java/org/unicode/cldr/unittest/TestExampleGenerator.java +++ b/tools/cldr-code/src/test/java/org/unicode/cldr/unittest/TestExampleGenerator.java @@ -166,6 +166,7 @@ public void testCurrency() { "//ldml/numbers/minimalPairs/pluralMinimalPairs[@count=\"([^\"]*+)\"]", "//ldml/numbers/minimalPairs/ordinalMinimalPairs[@ordinal=\"([^\"]*+)\"]", "//ldml/characters/parseLenients[@scope=\"([^\"]*+)\"][@level=\"([^\"]*+)\"]/parseLenient[@sample=\"([^\"]*+)\"]"); + // Only add to above if the example should NEVER appear. /** @@ -243,6 +244,7 @@ public void testCurrency() { "//ldml/personNames/parameterDefault[@parameter=\"([^\"]*+)\"]" // TODO // CLDR-15384 ); + // Add to above if the example SHOULD appear, but we don't have it yet. TODO Add later /** @@ -274,6 +276,7 @@ public void testCurrency() { "//ldml/dates/timeZoneNames/metazone[@type=\"([^\"]*+)\"]/long/standard", "//ldml/dates/timeZoneNames/metazone[@type=\"([^\"]*+)\"]/long/daylight", "//ldml/units/durationUnit[@type=\"([^\"]*+)\"]/durationUnitPattern"); + // Only add to above if the background should NEVER appear. /** diff --git a/tools/cldr-code/src/test/java/org/unicode/cldr/unittest/TestPathHeader.java b/tools/cldr-code/src/test/java/org/unicode/cldr/unittest/TestPathHeader.java index 9c46cf97ac9..ac9aa4c85db 100644 --- a/tools/cldr-code/src/test/java/org/unicode/cldr/unittest/TestPathHeader.java +++ b/tools/cldr-code/src/test/java/org/unicode/cldr/unittest/TestPathHeader.java @@ -1571,6 +1571,7 @@ public void TestQuotes() { assertEquals("No quotes in pathheader", false, trial.toString().contains("\"")); } } + /** * Make sure that the PathHeader sort order is consistent with the grammatical feature orders * "//ldml/units/unitLength[@type=\"long\"]/unit[@type=\"volume-liter\"]/displayName" diff --git a/tools/cldr-code/src/test/java/org/unicode/cldr/unittest/UnicodeSetPrettyPrinterTest.java b/tools/cldr-code/src/test/java/org/unicode/cldr/unittest/UnicodeSetPrettyPrinterTest.java index c8d1d1da369..7b45737fe85 100644 --- a/tools/cldr-code/src/test/java/org/unicode/cldr/unittest/UnicodeSetPrettyPrinterTest.java +++ b/tools/cldr-code/src/test/java/org/unicode/cldr/unittest/UnicodeSetPrettyPrinterTest.java @@ -196,6 +196,7 @@ public void testSimpleUnicodesetSyntaxErrors() { } final Matcher matchLocale; // fine-grained control for verbose + // use -DUnicodeSetPrettyPrinterTest:showAnyway=.* for all { String matchString = System.getProperty("UnicodeSetPrettyPrinterTest:showAnyway"); diff --git a/tools/cldr-rdf/src/main/java/org/unicode/cldr/rdf/QueryClient.java b/tools/cldr-rdf/src/main/java/org/unicode/cldr/rdf/QueryClient.java index 95a419d5ce2..adc9ca49252 100644 --- a/tools/cldr-rdf/src/main/java/org/unicode/cldr/rdf/QueryClient.java +++ b/tools/cldr-rdf/src/main/java/org/unicode/cldr/rdf/QueryClient.java @@ -142,6 +142,7 @@ public static void dumpResults(ResultSet rs) { System.out.println(); } } + /** * Load a query from a resource * diff --git a/tools/pom.xml b/tools/pom.xml index 7f629fa02a8..35e25d56452 100644 --- a/tools/pom.xml +++ b/tools/pom.xml @@ -34,8 +34,8 @@ 8.0.30 0.11.5 - 2.35.0 - 1.15.0 + 2.43.0 + 1.22.0