From dev-return-24778-apmail-jackrabbit-dev-archive=jackrabbit.apache.org@jackrabbit.apache.org Tue Aug 04 11:13:35 2009 Return-Path: Delivered-To: apmail-jackrabbit-dev-archive@www.apache.org Received: (qmail 93202 invoked from network); 4 Aug 2009 11:13:34 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 4 Aug 2009 11:13:34 -0000 Received: (qmail 48185 invoked by uid 500); 4 Aug 2009 11:13:39 -0000 Delivered-To: apmail-jackrabbit-dev-archive@jackrabbit.apache.org Received: (qmail 48106 invoked by uid 500); 4 Aug 2009 11:13:39 -0000 Mailing-List: contact dev-help@jackrabbit.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@jackrabbit.apache.org Delivered-To: mailing list dev@jackrabbit.apache.org Received: (qmail 48097 invoked by uid 99); 4 Aug 2009 11:13:39 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 04 Aug 2009 11:13:39 +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; Tue, 04 Aug 2009 11:13:36 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id C2691234C045 for ; Tue, 4 Aug 2009 04:13:14 -0700 (PDT) Message-ID: <384642050.1249384394781.JavaMail.jira@brutus> Date: Tue, 4 Aug 2009 04:13:14 -0700 (PDT) From: "Tobias Bocanegra (JIRA)" To: dev@jackrabbit.apache.org Subject: [jira] Commented: (JCR-2238) Binary throws NullPointerException In-Reply-To: <63033435.1249300034802.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/JCR-2238?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12738927#action_12738927 ] Tobias Bocanegra commented on JCR-2238: --------------------------------------- i think the creator is responsible to dispose the binary, no matter if the binary was - created using ValueFactory.createBinary(InputStream) - retrieved from a property, eg: Property.getValue().getBinary(); - created in a own object implementing javax.jcr.Binary the most common code is probably: Binary bin = vf.createBinary(in); try { n.setProperty("foo", bin); n.setProperty("bar", bin); } finally { bin.dispose(); } > Binary throws NullPointerException > ----------------------------------- > > Key: JCR-2238 > URL: https://issues.apache.org/jira/browse/JCR-2238 > Project: Jackrabbit Content Repository > Issue Type: Bug > Components: jackrabbit-core > Reporter: Marcel Reutegger > Attachments: BinaryValueTest.patch > > > Precondition: repository with datastore disabled! > Steps to reproduce: > 1) create binary from stream > 2) set binary on property > 3) dispose binary > 4) get binary from property and dispose it immediately > 5) go to 4) > Binary.dispose() will throw a NullPointerException when 4) is executed the second time. > The exception is not thrown if the property is saved after 2). > See also attached test. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.