From: <tho...@us...> - 2011-07-12 18:56:21
|
Revision: 4899 http://bigdata.svn.sourceforge.net/bigdata/?rev=4899&view=rev Author: thompsonbry Date: 2011-07-12 18:56:14 +0000 (Tue, 12 Jul 2011) Log Message: ----------- Bug fix to BigdataValueFactory.asValue() in the 1.0.0 release branch. It was always returning a new value if the given value was not a TermId. This was causing the SIDs tests to fail since a SidIV is not a TermId. Test setup/tear down changes to TestFactory in the 1.0.0 release branch and in the development branch. The fixture reference is now cleared when the test is torn down to prevent memory leaks during CI. Modified Paths: -------------- branches/BIGDATA_RELEASE_1_0_0/bigdata-rdf/src/java/com/bigdata/rdf/model/BigdataValueFactoryImpl.java branches/BIGDATA_RELEASE_1_0_0/bigdata-rdf/src/test/com/bigdata/rdf/model/TestFactory.java branches/TERMS_REFACTOR_BRANCH/bigdata-rdf/src/test/com/bigdata/rdf/model/TestFactory.java Modified: branches/BIGDATA_RELEASE_1_0_0/bigdata-rdf/src/java/com/bigdata/rdf/model/BigdataValueFactoryImpl.java =================================================================== --- branches/BIGDATA_RELEASE_1_0_0/bigdata-rdf/src/java/com/bigdata/rdf/model/BigdataValueFactoryImpl.java 2011-07-12 17:39:31 UTC (rev 4898) +++ branches/BIGDATA_RELEASE_1_0_0/bigdata-rdf/src/java/com/bigdata/rdf/model/BigdataValueFactoryImpl.java 2011-07-12 18:56:14 UTC (rev 4899) @@ -43,6 +43,7 @@ import com.bigdata.cache.WeakValueCache; import com.bigdata.rdf.internal.IV; +import com.bigdata.rdf.internal.TermId; import com.bigdata.rdf.lexicon.LexiconRelation; import com.bigdata.util.CanonicalFactory; @@ -453,7 +454,7 @@ final IV<?, ?> iv = v1.getIV(); - if (iv == null || iv.isTermId() && iv.getTermId() != 0L) { + if (iv == null || !iv.isTermId() || iv.getTermId() != TermId.NULL) { /* * A value from the same value factory whose IV is either Modified: branches/BIGDATA_RELEASE_1_0_0/bigdata-rdf/src/test/com/bigdata/rdf/model/TestFactory.java =================================================================== --- branches/BIGDATA_RELEASE_1_0_0/bigdata-rdf/src/test/com/bigdata/rdf/model/TestFactory.java 2011-07-12 17:39:31 UTC (rev 4898) +++ branches/BIGDATA_RELEASE_1_0_0/bigdata-rdf/src/test/com/bigdata/rdf/model/TestFactory.java 2011-07-12 18:56:14 UTC (rev 4899) @@ -62,8 +62,24 @@ super(name); } - final BigdataValueFactory vf = BigdataValueFactoryImpl.getInstance(getName()); + private BigdataValueFactory vf; + + protected void setUp() throws Exception { + super.setUp(); + + vf = BigdataValueFactoryImpl.getInstance(getName()); + + } + + protected void tearDown() throws Exception { + + vf = null; + + super.tearDown(); + + } + public void test_create_literal_xsdInt() { final BigdataLiteral l1 = vf.createLiteral("12", XSD.INT); Modified: branches/TERMS_REFACTOR_BRANCH/bigdata-rdf/src/test/com/bigdata/rdf/model/TestFactory.java =================================================================== --- branches/TERMS_REFACTOR_BRANCH/bigdata-rdf/src/test/com/bigdata/rdf/model/TestFactory.java 2011-07-12 17:39:31 UTC (rev 4898) +++ branches/TERMS_REFACTOR_BRANCH/bigdata-rdf/src/test/com/bigdata/rdf/model/TestFactory.java 2011-07-12 18:56:14 UTC (rev 4899) @@ -63,8 +63,24 @@ super(name); } - final BigdataValueFactory vf = BigdataValueFactoryImpl.getInstance(getName()); + private BigdataValueFactory vf; + + protected void setUp() throws Exception { + super.setUp(); + + vf = BigdataValueFactoryImpl.getInstance(getName()); + + } + + protected void tearDown() throws Exception { + + vf = null; + + super.tearDown(); + + } + public void test_create_literal_xsdInt() { final BigdataLiteral l1 = vf.createLiteral("12", XSD.INT); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |