db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Thomas Nielsen (JIRA)" <j...@apache.org>
Subject [jira] Updated: (DERBY-1573) Unsafe synchronization in NetworkServerControlImpl
Date Mon, 18 Jun 2007 12:35:26 GMT

     [ 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.


Mime
View raw message