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

CLDR-17560 skip more cases of ReportId.valueOf("supplemental") #3798

Merged
merged 1 commit into from
Jun 11, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 14 additions & 6 deletions tools/cldr-apps/src/main/java/org/unicode/cldr/web/ReportsDB.java
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,12 @@ public UserReport[] getAllReports(Integer onlyId, CLDRLocale onlyLoc) throws SQL
while (rs.next()) {
final int user = rs.getInt("submitter");
final String report = rs.getString("report");
ReportId reportId;
try {
reportId = ReportId.valueOf(report);
} catch (IllegalArgumentException iae) {
continue; // skip illegal enum values. may be a 'retired' enum
}
final String locale = rs.getString("locale");
final Boolean completed = rs.getBoolean("completed");
final Boolean acceptable = rs.getBoolean("acceptable");
Expand All @@ -129,11 +135,7 @@ public UserReport[] getAllReports(Integer onlyId, CLDRLocale onlyLoc) throws SQL
// now update it
UserReport userReport = l.computeIfAbsent(user, (i) -> new UserReport(i));
userReport.update(
locale,
ReportId.valueOf(report),
completed,
acceptable,
new Date(last_mod.getTime()));
locale, reportId, completed, acceptable, new Date(last_mod.getTime()));
}
}
return l.values().toArray(new UserReport[l.size()]);
Expand All @@ -157,6 +159,12 @@ public VoterReportStatus<Integer> clone(Integer onlyId, CLDRLocale onlyLoc)
while (rs.next()) {
final int user = rs.getInt("submitter");
final String report = rs.getString("report");
ReportId reportId;
try {
reportId = ReportId.valueOf(report);
} catch (IllegalArgumentException iae) {
continue; // skip illegal enum values. may be a 'retired' enum
}
final String locale = rs.getString("locale");
final Boolean completed = rs.getBoolean("completed");
final Boolean acceptable = rs.getBoolean("acceptable");
Expand All @@ -166,7 +174,7 @@ public VoterReportStatus<Integer> clone(Integer onlyId, CLDRLocale onlyLoc)
copy.markReportComplete(
user,
CLDRLocale.getInstance(locale),
ReportId.valueOf(report),
reportId,
completed,
acceptable,
new Date(last_mod.getTime()));
Expand Down
Loading