Return-Path: X-Original-To: apmail-db-derby-commits-archive@www.apache.org Delivered-To: apmail-db-derby-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 30FB5D0CD for ; Tue, 18 Sep 2012 15:04:19 +0000 (UTC) Received: (qmail 29082 invoked by uid 500); 18 Sep 2012 15:04:19 -0000 Delivered-To: apmail-db-derby-commits-archive@db.apache.org Received: (qmail 29015 invoked by uid 500); 18 Sep 2012 15:04:18 -0000 Mailing-List: contact derby-commits-help@db.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: "Derby Development" List-Id: Delivered-To: mailing list derby-commits@db.apache.org Received: (qmail 29001 invoked by uid 99); 18 Sep 2012 15:04:18 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 18 Sep 2012 15:04:18 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 18 Sep 2012 15:04:17 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 6C43723889E2; Tue, 18 Sep 2012 15:03:34 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1387211 - in /db/derby/code/branches/10.5: ./ java/ java/testing/org/apache/derbyTesting/junit/SystemPropertyTestSetup.java Date: Tue, 18 Sep 2012 15:03:34 -0000 To: derby-commits@db.apache.org From: mamta@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20120918150334.6C43723889E2@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: mamta Date: Tue Sep 18 15:03:33 2012 New Revision: 1387211 URL: http://svn.apache.org/viewvc?rev=1387211&view=rev Log: DERBY-5663 (Getting NPE when trying to set derby.language.logStatementText property to true inside a junit suite.) Backporting changes(without the test changes) into 10.5.3.2. The test changed(largedata/LobLimitsTest.java) does not exist in 10.7 and earlier releases Modified: db/derby/code/branches/10.5/ (props changed) db/derby/code/branches/10.5/java/ (props changed) db/derby/code/branches/10.5/java/testing/org/apache/derbyTesting/junit/SystemPropertyTestSetup.java Propchange: db/derby/code/branches/10.5/ ------------------------------------------------------------------------------ Merged /db/derby/code/branches/10.7:r1386854 Merged /db/derby/code/trunk:r1309244 Merged /db/derby/code/branches/10.8:r1386677 Propchange: db/derby/code/branches/10.5/java/ ------------------------------------------------------------------------------ Merged /db/derby/code/branches/10.7/java:r1386854 Modified: db/derby/code/branches/10.5/java/testing/org/apache/derbyTesting/junit/SystemPropertyTestSetup.java URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.5/java/testing/org/apache/derbyTesting/junit/SystemPropertyTestSetup.java?rev=1387211&r1=1387210&r2=1387211&view=diff ============================================================================== --- db/derby/code/branches/10.5/java/testing/org/apache/derbyTesting/junit/SystemPropertyTestSetup.java (original) +++ db/derby/code/branches/10.5/java/testing/org/apache/derbyTesting/junit/SystemPropertyTestSetup.java Tue Sep 18 15:03:33 2012 @@ -51,7 +51,6 @@ public class SystemPropertyTestSetup ext { super(test); this.newValues = newValues; - this.oldValues = new Properties(); this.staticProperties = staticProperties; } @@ -67,7 +66,6 @@ public class SystemPropertyTestSetup ext { super(test); this.newValues = newValues; - this.oldValues = new Properties(); this.staticProperties = false; } /** @@ -77,6 +75,15 @@ public class SystemPropertyTestSetup ext protected void setUp() throws java.lang.Exception { + //DERBY-5663 Getting NPE when trying to set + // derby.language.logStatementText property to true inside a junit + // suite. + //The same instance of SystemPropertyTestSetup can be used again + // and hence we want to make sure that oldValues is not null as set + // in the tearDown() method. If we leave it null, we will run into NPE + // during the tearDown of SystemPropertyTestSetup during the + // decorator's reuse. + this.oldValues = new Properties(); setProperties(newValues); // shutdown engine so static properties take effect if (staticProperties) @@ -102,7 +109,6 @@ public class SystemPropertyTestSetup ext // shutdown engine to restore any static properties if (staticProperties) TestConfiguration.getCurrent().shutdownEngine(); - newValues = null; oldValues = null; }