RFR: JDK-8344057 : Remove doPrivileged calls from unix platform sources in the java.desktop module [v2]
Harshitha Onkar
honkar at openjdk.org
Tue Nov 19 19:47:47 UTC 2024
On Mon, 18 Nov 2024 20:29:12 GMT, Harshitha Onkar <honkar at openjdk.org> wrote:
>> Harshitha Onkar has updated the pull request incrementally with one additional commit since the last revision:
>>
>> removed PrivilegedAction from UnixPrintJob
>
> src/java.desktop/unix/classes/sun/print/PrintServiceLookupProvider.java line 914:
>
>> 912: }
>> 913: } catch (IOException io) {
>> 914: io.printStackTrace();
>
> Review required. In the original code IOException was being thrown here -
>
>
> AccessController.doPrivileged(
> new PrivilegedExceptionAction<ArrayList<String>>() {
> public ArrayList<String> run() throws IOException
>
> Now that the doPrevileged calls is removed, Do we catch the IOException and print stacktrace or propagate it?
> If the IOException is propagated then IOException needs to be thrown by execCmd() method and methods that in-turn call execCmd().
>
> getPrinterIsAcceptingJobsBSD()
> getPrinterIsAcceptingJobsAIX()
> getQueuedJobCountBSD()
> getQueuedJobCountAIX()
@prrace Can you please review this code snippet? Is it okay to catch IOException here or propagate it ?
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/22218#discussion_r1848966214
More information about the client-libs-dev
mailing list