Skip to content

Commit

Permalink
CLDR-17560 skip more cases of ReportId.valueOf("supplemental") (#3798)
Browse files Browse the repository at this point in the history
  • Loading branch information
srl295 authored Jun 11, 2024
1 parent 678fda9 commit 6252d0d
Showing 1 changed file with 14 additions and 6 deletions.
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

0 comments on commit 6252d0d

Please sign in to comment.