From bb59926e8cfd6258d0264528f4b40a21fac9914c Mon Sep 17 00:00:00 2001 From: "Steven R. Loomis" Date: Mon, 3 Jun 2024 10:28:24 -0500 Subject: [PATCH] CLDR-17560 skip invalid report ids - in #3743, ReportId.supplemental was retired, but it occurs in some user rows - skip over invalid rows --- .../src/main/java/org/unicode/cldr/web/ReportsDB.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tools/cldr-apps/src/main/java/org/unicode/cldr/web/ReportsDB.java b/tools/cldr-apps/src/main/java/org/unicode/cldr/web/ReportsDB.java index 4d32562982a..56ff19f99f3 100644 --- a/tools/cldr-apps/src/main/java/org/unicode/cldr/web/ReportsDB.java +++ b/tools/cldr-apps/src/main/java/org/unicode/cldr/web/ReportsDB.java @@ -91,10 +91,16 @@ public ReportStatus getReportStatus(Integer user, CLDRLocale locale) { locale.getBaseName()); ResultSet rs = ps.executeQuery(); ) { while (rs.next()) { - final String report = rs.getString("report"); + final String reportStr = rs.getString("report"); + ReportId report = null; + try { + report = ReportId.valueOf(reportStr); + } catch (IllegalArgumentException iae) { + continue; // skip illegal enum values. may be a 'retired' enum + } final Boolean completed = rs.getBoolean("completed"); final Boolean acceptable = rs.getBoolean("acceptable"); - status.mark(ReportId.valueOf(report), completed, acceptable); + status.mark(report, completed, acceptable); } } catch (SQLException e) { SurveyLog.logException(e, "fetching reportStatus for " + user + ":" + locale);