Return-Path: Delivered-To: apmail-commons-issues-archive@minotaur.apache.org Received: (qmail 22636 invoked from network); 7 May 2009 13:32:55 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 7 May 2009 13:32:55 -0000 Received: (qmail 89959 invoked by uid 500); 7 May 2009 13:32:55 -0000 Delivered-To: apmail-commons-issues-archive@commons.apache.org Received: (qmail 89846 invoked by uid 500); 7 May 2009 13:32:55 -0000 Mailing-List: contact issues-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: issues@commons.apache.org Delivered-To: mailing list issues@commons.apache.org Received: (qmail 89836 invoked by uid 99); 7 May 2009 13:32:55 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 07 May 2009 13:32:55 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 07 May 2009 13:32:51 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id C5680234C04B for ; Thu, 7 May 2009 06:32:30 -0700 (PDT) Message-ID: <1483183329.1241703150807.JavaMail.jira@brutus> Date: Thu, 7 May 2009 06:32:30 -0700 (PDT) From: "Marek Zawirski (JIRA)" To: issues@commons.apache.org Subject: [jira] Commented: (VFS-253) AbstractFileObject: wrong synchronization of content-related code In-Reply-To: <895195014.1241702790582.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/VFS-253?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12706885#action_12706885 ] Marek Zawirski commented on VFS-253: ------------------------------------ {{DefaultFileContent}} seems to be designed to work with ThreadLocal instances, but have some methods dealing with global state, like {{isOpenGlobal()}}. Iif it gonna be closed globally it probably miss some {{closeGlobal()}} method or it should be closed only for calling thread in {{AbstractFileObject#close()}}. > AbstractFileObject: wrong synchronization of content-related code > ----------------------------------------------------------------- > > Key: VFS-253 > URL: https://issues.apache.org/jira/browse/VFS-253 > Project: Commons VFS > Issue Type: Bug > Affects Versions: 2.0 > Reporter: Marek Zawirski > > Creating content through {{AbstractFileObject#getContent()}} and {{DefaultFileContent}} itself seem to be synchronized, but closing the content by {{AbstractFileObject#close()}} and checking whether it is open, by {{AbstractFileObject#isContentOpen()}} are NOT synchronized. > Both these methods miss some lock-object. For {{close()}} it may result in severe race condition in case of {{FileObject}} shared across more than one thread. > BTW, thead-safeness of important VFS classes/interfaces like {{FileObject}} is not documented in javadoc. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.