ICU4J API proposal: deprecate ICUUncheckedIOException

2 views
Skip to first unread message

Markus Scherer

unread,
Jun 3, 2026, 6:12:51 PM (7 days ago) Jun 3
to icu-design
Dear ICU team & users,

I would like to propose the following API for: ICU 79

Please provide feedback by: next Wednesday, 2026-jun-10

Designated API reviewer: Mihai

Ticket: https://unicode-org.atlassian.net/browse/ICU-22148

Pull request: https://github.com/unicode-org/icu/pull/4016


In Java, checked exceptions are inconvenient. For example, widening APIs that take StringBuilder to working with Appendable requires either declaring that an IOException may be thrown, or wrapping one into an unchecked exception.


In ICU 53, we created ICUUncheckedIOException for this, many years before ICU4J could rely on Java 8 which introduced a similar UncheckedIOException. At this point, our own class is redundant.


I propose that we

  • deprecate ICUUncheckedIOException

  • keep throwing it from code that already does so

  • change it into a subclass of UncheckedIOException


Callers can then choose to catch the standard exception, and new ICU code can throw that.


Sincerely,
markus
Reply all
Reply to author
Forward
0 new messages