On Thu, 18 Jan 2024 17:30:11 GMT, Alexey Ivanov <[email protected]> wrote:
>> Replaced asserts with NullPointerException calls because outside of testing
>> that would be more informative - i do not think many people running their
>> applications with assertions in system libraries enabled;
>> Added a code that will analyze the result of the getIcon and will fall back
>> to the default icon for the file type retrieved from the ShellFolder;
>> Added a test case made by Aleksei Ivanov.
>
> src/java.desktop/windows/classes/sun/awt/shell/Win32ShellFolder2.java line
> 1423:
>
>> 1421: if (resolutionVariants.containsValue(null)) {
>> 1422: throw new NullPointerException("There are null icons
>> in the MRI variants map");
>> 1423: }
>
> I'm unsure about this. The idea with assert was to provide a debugging aid
> without affecting regular runtime. We control all the paths that call this
> constructor and, therefore, we should ensure it's never called if
> `resolutionVariants` contains `null`.
>
> It's exactly what you've done in this PR.
Ok, i will revert that part.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/17475#discussion_r1457888450