[
https://issues.apache.org/jira/browse/DERBY-1573?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Thomas Nielsen updated DERBY-1573:
----------------------------------
Attachment: d1573.stat
> Unsafe synchronization in NetworkServerControlImpl
> --------------------------------------------------
>
> Key: DERBY-1573
> URL: https://issues.apache.org/jira/browse/DERBY-1573
> Project: Derby
> Issue Type: Bug
> Components: Network Server, Newcomer
> Affects Versions: 10.2.1.6
> Reporter: Knut Anders Hatlen
> Assignee: Thomas Nielsen
> Priority: Minor
> Attachments: d1573.diff, d1573.stat
>
>
> NetworkServerControlImpl has some constructs like this one:
> if (logWriter != null)
> {
> synchronized(logWriter) {
> logWriter.println(msg);
> }
> }
> Since logWriter might be set to null after the test for logWriter!=null and
> before synchronized(logWriter), one might get a NullPointerException. It
> would be safer to write this instead:
> PrintWriter lw = logWriter;
> if (lw != null) {
> synchronized (lw) {
> lw.println(msg);
> }
> }
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.