From: <lh...@us...> - 2008-08-07 14:39:31
|
Revision: 104 http://tinytim.svn.sourceforge.net/tinytim/?rev=104&view=rev Author: lheuer Date: 2008-08-07 14:39:40 +0000 (Thu, 07 Aug 2008) Log Message: ----------- - Removed TMAPI 1.0 libs - Changed build properties - Changed TopicMapSystemFactory class name (META-INF) Modified Paths: -------------- tinytim/trunk/build.properties tinytim/trunk/src/main/resources/META-INF/services/org.tmapi.core.TopicMapSystemFactory Removed Paths: ------------- tinytim/trunk/lib/LICENSE.tmapi-test.txt tinytim/trunk/lib/LICENSE.tmapi.txt tinytim/trunk/lib/tmapi-1_0SP1.jar tinytim/trunk/lib/tmapi-test-1_0SP1.jar Modified: tinytim/trunk/build.properties =================================================================== --- tinytim/trunk/build.properties 2008-08-07 14:36:54 UTC (rev 103) +++ tinytim/trunk/build.properties 2008-08-07 14:39:40 UTC (rev 104) @@ -1,4 +1,4 @@ -version=1.5.0 -version_suffix=beta +version=2.0.0 +version_suffix=alpha1 debug=off optimize=on Deleted: tinytim/trunk/lib/LICENSE.tmapi-test.txt =================================================================== --- tinytim/trunk/lib/LICENSE.tmapi-test.txt 2008-08-07 14:36:54 UTC (rev 103) +++ tinytim/trunk/lib/LICENSE.tmapi-test.txt 2008-08-07 14:39:40 UTC (rev 104) @@ -1,21 +0,0 @@ -TMAPI 1.0 - - Version 1.0 of the Topic Maps API (TMAPI), created collectively by - the membership of the tmapi-discuss mailing list - (http://lists.sourceforge.net/mailman/listinfo/tmapi-discuss), - is hereby released into the public domain. - - No one owns TMAPI: you may use it freely in both commercial and - non-commercial applications, bundle it with your software - distribution, include it on a CD-ROM, list the source code in a - book, mirror the documentation at your own web site, or use it in - any other way you see fit. - - Kal Ahmed (kal at techquila.com) - Lars Marius Garshol (larsga at users.sourceforge.net) - Geir Ove Gr\xF8nmo (grove at users.sourceforge.net) - Lars Heuer (lheuer at users.sourceforge.net) - Stefan Lischke (lischke2 at users.sourceforge.net) - Graham Moore (gra_moore at users.sourceforge.net) - - 08 April 2004 Deleted: tinytim/trunk/lib/LICENSE.tmapi.txt =================================================================== --- tinytim/trunk/lib/LICENSE.tmapi.txt 2008-08-07 14:36:54 UTC (rev 103) +++ tinytim/trunk/lib/LICENSE.tmapi.txt 2008-08-07 14:39:40 UTC (rev 104) @@ -1,21 +0,0 @@ -TMAPI 1.0 - - Version 1.0 of the Topic Maps API (TMAPI), created collectively by - the membership of the tmapi-discuss mailing list - (http://lists.sourceforge.net/mailman/listinfo/tmapi-discuss), - is hereby released into the public domain. - - No one owns TMAPI: you may use it freely in both commercial and - non-commercial applications, bundle it with your software - distribution, include it on a CD-ROM, list the source code in a - book, mirror the documentation at your own web site, or use it in - any other way you see fit. - - Kal Ahmed (kal at techquila.com) - Lars Marius Garshol (larsga at users.sourceforge.net) - Geir Ove Gr\xF8nmo (grove at users.sourceforge.net) - Lars Heuer (lheuer at users.sourceforge.net) - Stefan Lischke (lischke2 at users.sourceforge.net) - Graham Moore (gra_moore at users.sourceforge.net) - - 08 April 2004 Modified: tinytim/trunk/src/main/resources/META-INF/services/org.tmapi.core.TopicMapSystemFactory =================================================================== --- tinytim/trunk/src/main/resources/META-INF/services/org.tmapi.core.TopicMapSystemFactory 2008-08-07 14:36:54 UTC (rev 103) +++ tinytim/trunk/src/main/resources/META-INF/services/org.tmapi.core.TopicMapSystemFactory 2008-08-07 14:39:40 UTC (rev 104) @@ -1 +1 @@ -org.tinytim.TopicMapSystemFactoryImpl +org.tinytim.core.TopicMapSystemFactoryImpl This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lh...@us...> - 2008-08-21 12:04:10
|
Revision: 139 http://tinytim.svn.sourceforge.net/tinytim/?rev=139&view=rev Author: lheuer Date: 2008-08-21 12:04:16 +0000 (Thu, 21 Aug 2008) Log Message: ----------- - Updated to unofficial TMAPI 2.0 a1 - Minor tweaks - Prepared build for tinyTiM 2.0 a1 Modified Paths: -------------- tinytim/trunk/build.properties tinytim/trunk/build.xml tinytim/trunk/src/main/java/org/tinytim/core/ConstructImpl.java tinytim/trunk/src/main/java/org/tinytim/core/IScope.java tinytim/trunk/src/main/java/org/tinytim/core/Scope.java tinytim/trunk/src/main/java/org/tinytim/index/ScopedIndexImpl.java tinytim/trunk/src/main/java/org/tinytim/internal/utils/Check.java tinytim/trunk/src/main/java/org/tinytim/internal/utils/WeakObjectRegistry.java tinytim/trunk/src/test/java/org/tinytim/core/AllTests.java Added Paths: ----------- tinytim/trunk/lib/tmapi-2.0a1-tests.jar tinytim/trunk/lib/tmapi-2.0a1.jar tinytim/trunk/src/test/java/org/tinytim/core/TestIConstruct.java Modified: tinytim/trunk/build.properties =================================================================== --- tinytim/trunk/build.properties 2008-08-19 14:03:18 UTC (rev 138) +++ tinytim/trunk/build.properties 2008-08-21 12:04:16 UTC (rev 139) @@ -1,4 +1,4 @@ version=2.0.0 -version_suffix=alpha1 +version_suffix=a1 debug=off optimize=on Modified: tinytim/trunk/build.xml =================================================================== --- tinytim/trunk/build.xml 2008-08-19 14:03:18 UTC (rev 138) +++ tinytim/trunk/build.xml 2008-08-21 12:04:16 UTC (rev 139) @@ -27,12 +27,27 @@ <property name="dir.test" value="${basedir}/src/test/java"/> <property name="dir.lib" value="${basedir}/lib"/> <property name="dir.res" value="${basedir}/src/main/resources"/> + <property name="dir.coverage" value="${basedir}/coverage"/> <property name="lib.junit" value="${dir.lib}/junit-4.4.jar"/> - <property name="lib.trove" value="${dir.lib}/trove-2.0.3.jar"/> - <property name="lib.tmapi" value="${dir.lib}/tmapi-1_0SP1.jar"/> - <property name="lib.tmapi.tests" value="${dir.lib}/tmapi-test-1_0SP1.jar"/> + <property name="lib.trove" value="${dir.lib}/trove-2.0.4.jar"/> + <property name="lib.tmapi" value="${dir.lib}/tmapi-2.0a1.jar"/> + <property name="lib.tmapi.tests" value="${dir.lib}/tmapi-2.0a1-tests.jar"/> + <property name="lib.emma" value="${dir.lib}/emma.jar"/> + <property name="lib.emma.task" value="${dir.lib}/emma_ant.jar"/> + <!-- directory that contains emma.jar and emma_ant.jar: --> + <property name="dir.emma" value="${dir.lib}" /> + + <!-- path element used by EMMA taskdef below: --> + <path id="emma.lib" > + <pathelement location="${dir.emma}/emma.jar" /> + <pathelement location="${dir.emma}/emma_ant.jar" /> + </path> + + <!-- this loads <emma> and <emmajava> custom tasks: --> + <taskdef resource="emma_ant.properties" classpathref="emma.lib" /> + <target name="help"> <echo message="--------------------"/> <echo message="tinyTiM - Build file"/> @@ -40,9 +55,11 @@ <echo message=""/> <echo message="Available targets:"/> <echo message=""/> - <echo message=" jar Creates the jar"/> - <echo message=" doc Creates the API documentation"/> - <echo message=" release Creates the jar and a distributable file"/> + <echo message=" jar Creates the jar"/> + <echo message=" testjar Creates the jar with the tests"/> + <echo message=" doc Creates the API documentation"/> + <echo message=" coverage Creates a coverage report"/> + <echo message=" release Creates the jar and a distributable file"/> </target> <target name="init"> @@ -50,6 +67,7 @@ <property name="dist.name" value="tinytim-${dist.version}"/> <property name="tinytim.jar" value="${dist.name}.jar"/> + <property name="tinytim-test.jar" value="${dist.name}-tests.jar"/> <property name="tinytim.tar" value="${dist.name}.tar"/> <property name="tinytim.tar.gz" value="${tinytim.tar}.gz"/> <property name="tinytim.zip" value="${dist.name}.zip"/> @@ -60,6 +78,15 @@ <property name="dir.build.classes" value="${dir.build}/classes"/> <property name="dir.build.tests" value="${dir.build}/tests"/> <property name="dir.javadocs" value="${dir.dist}/docs/api"/> + + <path id="run.classpath" > + <pathelement location="${dir.build.classes}" /> + <pathelement location="${dir.build.tests}" /> + <pathelement location="${lib.junit}"/> + <pathelement location="${lib.tmapi}"/> + <pathelement location="${lib.tmapi.tests}"/> + <pathelement location="${lib.trove}"/> + </path> </target> <!-- =================================================================== --> @@ -79,9 +106,9 @@ </target> <!-- =================================================================== --> - <!-- Tests --> + <!-- Coverage Tests --> <!-- =================================================================== --> - <target name="test" depends="compile"> + <target name="coverage" depends="compile"> <mkdir dir="${dir.build.tests}"/> <javac destdir="${dir.build.tests}" debug="${debug}" @@ -96,23 +123,42 @@ </classpath> <src path="${dir.test}"/> </javac> - <junit printsummary="true" showoutput="false" - errorProperty="test.failed" failureProperty="test.failed"> + <mkdir dir="${dir.coverage}"/> + <emmajava libclasspathref="emma.lib" + sourcepath="${dir.src}" + fullmetadata="yes" + classname="org.tinytim.core.AllTests" + classpathref="run.classpath" + > + <filter includes="org.tinytim.*" excludes="org.tinytim.*Test*, org.tinytim.*$*" /> + <html outfile="${dir.coverage}/index.html" /> + </emmajava> + </target> + + <!-- =================================================================== --> + <!-- Tests --> + <!-- =================================================================== --> + <target name="test" depends="compile"> + <mkdir dir="${dir.build.tests}"/> + <javac destdir="${dir.build.tests}" + debug="${debug}" + optimize="${optimize}" + target="1.5"> <classpath> <pathelement location="${dir.build.classes}"/> - <pathelement location="${dir.build.tests}"/> <pathelement location="${lib.junit}"/> <pathelement location="${lib.tmapi}"/> <pathelement location="${lib.tmapi.tests}"/> <pathelement location="${lib.trove}"/> </classpath> + <src path="${dir.test}"/> + </javac> + <junit printsummary="true" showoutput="false" + errorProperty="test.failed" failureProperty="test.failed" + fork="true"> + <classpath refid="run.classpath"/> <formatter type="brief" usefile="false"/> - <batchtest fork="no" todir="${dir.build}"> - <fileset dir="${dir.build.tests}/"> - <include name="**/Test**.class"/> - <exclude name="**/Test*$**.class"/> - </fileset> - </batchtest> + <test name="org.tinytim.core.AllTests"/> </junit> <fail message="Tests failed. Check test output." if="test.failed"/> </target> @@ -147,15 +193,16 @@ windowtitle="tinyTiM API v${dist.version}" doctitle="tinyTiM API v${dist.version}"> <fileset dir="${dir.src}"> - <exclude name="**/*Impl.*"/> + <exclude name="org/tinytim/core/**"/> <exclude name="org/tinytim/index/**"/> - <exclude name="org/tinytim/IConstruct*"/> - <exclude name="org/tinytim/IDatatypeAware*"/> - <exclude name="org/tinytim/IRI*"/> - <exclude name="org/tinytim/IEvent*"/> - <exclude name="org/tinytim/Event*"/> + <exclude name="org/tinytim/internal/**"/> </fileset> - <link href="http://www.tmapi.org/apiDocs/"/> +<!-- + <doclet name="net.gleamynode.apiviz.APIviz" + path="${dir.lib}/apiviz-1.1.3.jar"> + </doclet> +--> + <link href="http://www.tmapi.org/2.0/api/"/> </javadoc> </target> @@ -179,12 +226,29 @@ </target> <!-- =================================================================== --> + <!-- Creates the test jar --> + <!-- =================================================================== --> + <target name="testjar" depends="compile, test"> + <jar destfile="${dir.build}/${tinytim-test.jar}"> + <fileset dir="${dir.build.tests}"> + <include name="**/*.*"/> + </fileset> + <manifest> + <attribute name="Implementation-Title" value="tinyTiM Tests"/> + <attribute name="Implementation-Version" value="${dist.version}"/> + <attribute name="Implementation-URL" value="http://sourceforge.net/projects/tinytim"/> + </manifest> + </jar> + </target> + + <!-- =================================================================== --> <!-- Prepares a distribution --> <!-- =================================================================== --> - <target name="dist" depends="jar, doc"> + <target name="dist" depends="jar, testjar, doc"> <mkdir dir="${dir.dist}"/> <copy todir="${dir.dist}" file="${dir.build}/${tinytim.jar}"/> + <copy todir="${dir.dist}" file="${dir.build}/${tinytim-test.jar}"/> <copy todir="${dir.dist}/src"> <fileset dir="${dir.src}"/> @@ -193,7 +257,12 @@ <fileset dir="${dir.test}"/> </copy> <copy todir="${dir.dist}/lib"> - <fileset dir="${dir.lib}"/> + <fileset dir="${dir.lib}"> + <include name="tmapi*"/> + <include name="junit*"/> + <include name="LICENSE.junit*"/> + <include name="LICENSE.tmapi*"/> + </fileset> </copy> <copy todir="${dir.dist}" file="CHANGES.txt"/> Property changes on: tinytim/trunk/lib/tmapi-2.0a1-tests.jar ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Property changes on: tinytim/trunk/lib/tmapi-2.0a1.jar ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Modified: tinytim/trunk/src/main/java/org/tinytim/core/ConstructImpl.java =================================================================== --- tinytim/trunk/src/main/java/org/tinytim/core/ConstructImpl.java 2008-08-19 14:03:18 UTC (rev 138) +++ tinytim/trunk/src/main/java/org/tinytim/core/ConstructImpl.java 2008-08-21 12:04:16 UTC (rev 139) @@ -116,7 +116,7 @@ */ @Override public final int hashCode() { - return _id.hashCode(); + return super.hashCode(); } /** Modified: tinytim/trunk/src/main/java/org/tinytim/core/IScope.java =================================================================== --- tinytim/trunk/src/main/java/org/tinytim/core/IScope.java 2008-08-19 14:03:18 UTC (rev 138) +++ tinytim/trunk/src/main/java/org/tinytim/core/IScope.java 2008-08-21 12:04:16 UTC (rev 139) @@ -20,6 +20,7 @@ */ package org.tinytim.core; +import java.util.Collection; import java.util.Set; import org.tmapi.core.Topic; @@ -83,4 +84,6 @@ */ public int size(); + public boolean containsAll(Collection<Topic> scope); + } Modified: tinytim/trunk/src/main/java/org/tinytim/core/Scope.java =================================================================== --- tinytim/trunk/src/main/java/org/tinytim/core/Scope.java 2008-08-19 14:03:18 UTC (rev 138) +++ tinytim/trunk/src/main/java/org/tinytim/core/Scope.java 2008-08-21 12:04:16 UTC (rev 139) @@ -99,6 +99,13 @@ } /* (non-Javadoc) + * @see org.tinytim.core.IScope#containsAll(java.util.Collection) + */ + public boolean containsAll(Collection<Topic> scope) { + return _set.containsAll(scope); + } + + /* (non-Javadoc) * @see org.tinytim.core.IScope#add(org.tmapi.core.Topic) */ public IScope add(Topic theme) { Modified: tinytim/trunk/src/main/java/org/tinytim/index/ScopedIndexImpl.java =================================================================== --- tinytim/trunk/src/main/java/org/tinytim/index/ScopedIndexImpl.java 2008-08-19 14:03:18 UTC (rev 138) +++ tinytim/trunk/src/main/java/org/tinytim/index/ScopedIndexImpl.java 2008-08-21 12:04:16 UTC (rev 139) @@ -87,6 +87,9 @@ */ public Collection<Association> getAssociations(Topic[] themes, boolean matchAll) { + if (themes == null) { + throw new IllegalArgumentException("The themes must not be null"); + } Set<Association> result = CollectionFactory.createIdentitySet(); if (!matchAll) { for (Topic theme: themes) { @@ -125,6 +128,9 @@ */ public Collection<Occurrence> getOccurrences(Topic[] themes, boolean matchAll) { + if (themes == null) { + throw new IllegalArgumentException("The themes must not be null"); + } Set<Occurrence> result = CollectionFactory.createIdentitySet(); if (!matchAll) { for (Topic theme: themes) { @@ -162,6 +168,9 @@ * @see org.tmapi.index.ScopedIndex#getNames(org.tmapi.core.Topic[], boolean) */ public Collection<Name> getNames(Topic[] themes, boolean matchAll) { + if (themes == null) { + throw new IllegalArgumentException("The themes must not be null"); + } Set<Name> result = CollectionFactory.createIdentitySet(); if (!matchAll) { for (Topic theme: themes) { @@ -190,6 +199,9 @@ * @see org.tmapi.index.ScopedIndex#getVariants(org.tmapi.core.Topic) */ public Collection<Variant> getVariants(Topic theme) { + if (theme == null) { + throw new IllegalArgumentException("The theme must not be null"); + } Collection<Variant> vars = _theme2Variants.get(theme); return vars == null ? Collections.<Variant>emptySet() : CollectionFactory.createList(vars); @@ -199,6 +211,9 @@ * @see org.tmapi.index.ScopedIndex#getVariants(org.tmapi.core.Topic[], boolean) */ public Collection<Variant> getVariants(Topic[] themes, boolean matchAll) { + if (themes == null) { + throw new IllegalArgumentException("The themes must not be null"); + } Set<Variant> result = CollectionFactory.createIdentitySet(); if (!matchAll) { for (Topic theme: themes) { Modified: tinytim/trunk/src/main/java/org/tinytim/internal/utils/Check.java =================================================================== --- tinytim/trunk/src/main/java/org/tinytim/internal/utils/Check.java 2008-08-19 14:03:18 UTC (rev 138) +++ tinytim/trunk/src/main/java/org/tinytim/internal/utils/Check.java 2008-08-21 12:04:16 UTC (rev 139) @@ -31,7 +31,7 @@ * * * @author Lars Heuer (heuer[at]semagia.com) <a href="http://www.semagia.com/">Semagia</a> - * @version $Rev:$ - $Date:$ + * @version $Rev$ - $Date$ */ public class Check { Modified: tinytim/trunk/src/main/java/org/tinytim/internal/utils/WeakObjectRegistry.java =================================================================== --- tinytim/trunk/src/main/java/org/tinytim/internal/utils/WeakObjectRegistry.java 2008-08-19 14:03:18 UTC (rev 138) +++ tinytim/trunk/src/main/java/org/tinytim/internal/utils/WeakObjectRegistry.java 2008-08-21 12:04:16 UTC (rev 139) @@ -21,8 +21,6 @@ package org.tinytim.internal.utils; import java.lang.ref.WeakReference; -import java.util.AbstractSet; -import java.util.Iterator; import java.util.Map; import java.util.WeakHashMap; @@ -32,7 +30,7 @@ * @author Lars Heuer (heuer[at]semagia.com) <a href="http://www.semagia.com/">Semagia</a> * @version $Rev$ - $Date$ */ -public final class WeakObjectRegistry<E> extends AbstractSet<E> { +public final class WeakObjectRegistry<E> { private final Map<E, WeakReference<E>> _obj2Ref; @@ -60,7 +58,6 @@ /* (non-Javadoc) * @see java.util.AbstractCollection#add(java.lang.Object) */ - @Override public boolean add(E obj) { WeakReference<E> ref = new WeakReference<E>(obj); ref = _obj2Ref.put(obj, ref); @@ -68,42 +65,15 @@ } /* (non-Javadoc) - * @see java.util.AbstractCollection#remove(java.lang.Object) - */ - @Override - public boolean remove(Object obj) { - WeakReference<E> ref = _obj2Ref.remove(obj); - return ref != null && ref.get() != null; - } - - /* (non-Javadoc) * @see java.util.AbstractCollection#clear() */ - @Override public void clear() { _obj2Ref.clear(); } /* (non-Javadoc) - * @see java.util.AbstractCollection#contains(java.lang.Object) - */ - @Override - public boolean contains(Object obj) { - return get(obj) != null; - } - - /* (non-Javadoc) - * @see java.util.AbstractCollection#iterator() - */ - @Override - public Iterator<E> iterator() { - return _obj2Ref.keySet().iterator(); - } - - /* (non-Javadoc) * @see java.util.AbstractCollection#size() */ - @Override public int size() { return _obj2Ref.size(); } Modified: tinytim/trunk/src/test/java/org/tinytim/core/AllTests.java =================================================================== --- tinytim/trunk/src/test/java/org/tinytim/core/AllTests.java 2008-08-19 14:03:18 UTC (rev 138) +++ tinytim/trunk/src/test/java/org/tinytim/core/AllTests.java 2008-08-21 12:04:16 UTC (rev 139) @@ -42,6 +42,7 @@ TestSuite suite = new TestSuite(); suite.addTestSuite(TestDuplicateRemovalUtils.class); suite.addTestSuite(TestIRI.class); + suite.addTestSuite(TestIConstruct.class); suite.addTestSuite(TestScope.class); suite.addTestSuite(TestLiteral.class); suite.addTestSuite(TestItemIdentifierConstraint.class); Added: tinytim/trunk/src/test/java/org/tinytim/core/TestIConstruct.java =================================================================== --- tinytim/trunk/src/test/java/org/tinytim/core/TestIConstruct.java (rev 0) +++ tinytim/trunk/src/test/java/org/tinytim/core/TestIConstruct.java 2008-08-21 12:04:16 UTC (rev 139) @@ -0,0 +1,79 @@ +/* + * This is tinyTiM, a tiny Topic Maps engine. + * + * Copyright (C) 2008 Lars Heuer (heuer[at]semagia.com) + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * + */ +package org.tinytim.core; + +import org.tmapi.core.Association; +import org.tmapi.core.Construct; +import org.tmapi.core.Name; +import org.tmapi.core.Occurrence; +import org.tmapi.core.Role; +import org.tmapi.core.Topic; +import org.tmapi.core.TopicMap; +import org.tmapi.core.Variant; + +/** + * + * + * @author Lars Heuer (heuer[at]semagia.com) <a href="http://www.semagia.com/">Semagia</a> + * @version $Rev:$ - $Date:$ + */ +public class TestIConstruct extends TinyTimTestCase { + + + private void _testConstruct(Construct construct) { + IConstruct c = (IConstruct) construct; + assertEquals(c.isTopicMap(), c instanceof TopicMap); + assertEquals(c.isTopic(), c instanceof Topic); + assertEquals(c.isAssociation(), c instanceof Association); + assertEquals(c.isRole(), c instanceof Role); + assertEquals(c.isOccurrence(), c instanceof Occurrence); + assertEquals(c.isName(), c instanceof Name); + assertEquals(c.isVariant(), c instanceof Variant); + } + + public void testTopicMap() { + _testConstruct(_tm); + } + + public void testTopic() { + _testConstruct(createTopic()); + } + + public void testAssociation() { + _testConstruct(createAssociation()); + } + + public void testRole() { + _testConstruct(createRole()); + } + + public void testOccurrence() { + _testConstruct(createOccurrence()); + } + + public void testName() { + _testConstruct(createName()); + } + + public void testVariant() { + _testConstruct(createVariant()); + } +} Property changes on: tinytim/trunk/src/test/java/org/tinytim/core/TestIConstruct.java ___________________________________________________________________ Added: svn:keywords + Rev Date Id Added: svn:eol-style + native This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lh...@us...> - 2008-08-25 14:07:04
|
Revision: 148 http://tinytim.svn.sourceforge.net/tinytim/?rev=148&view=rev Author: lheuer Date: 2008-08-25 14:07:12 +0000 (Mon, 25 Aug 2008) Log Message: ----------- - Updated JUnit to 4.5 (thanks Markus! ;) - Updated CHANGES.txt Modified Paths: -------------- tinytim/trunk/CHANGES.txt Added Paths: ----------- tinytim/trunk/lib/junit-4.5.jar Removed Paths: ------------- tinytim/trunk/lib/junit-4.4.jar Modified: tinytim/trunk/CHANGES.txt =================================================================== --- tinytim/trunk/CHANGES.txt 2008-08-21 16:42:01 UTC (rev 147) +++ tinytim/trunk/CHANGES.txt 2008-08-25 14:07:12 UTC (rev 148) @@ -2,9 +2,10 @@ Changes Log =========== -2.0.0 a1 (xx.08.2008) +2.0.0 a1 (26.08.2008) --------------------- * Implementation of the TMAPI 2.0 interfaces +* Internal code refactoring 1.5.0 beta (08.08.2008) Property changes on: tinytim/trunk/lib/junit-4.5.jar ___________________________________________________________________ Added: svn:mime-type + application/octet-stream This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lh...@us...> - 2008-09-08 12:09:00
|
Revision: 158 http://tinytim.svn.sourceforge.net/tinytim/?rev=158&view=rev Author: lheuer Date: 2008-09-08 12:09:10 +0000 (Mon, 08 Sep 2008) Log Message: ----------- * Prepared 2.0.0a2 Modified Paths: -------------- tinytim/trunk/CHANGES.txt tinytim/trunk/README.txt tinytim/trunk/build.properties tinytim/trunk/build.xml Modified: tinytim/trunk/CHANGES.txt =================================================================== --- tinytim/trunk/CHANGES.txt 2008-09-08 11:37:54 UTC (rev 157) +++ tinytim/trunk/CHANGES.txt 2008-09-08 12:09:10 UTC (rev 158) @@ -2,6 +2,12 @@ Changes Log =========== +2.0.0 a2 (08.09.2008) +--------------------- +* Internal code refactoring +* Better duplicate literal supression + + 2.0.0 a1 (26.08.2008) --------------------- * Implementation of the TMAPI 2.0 interfaces Modified: tinytim/trunk/README.txt =================================================================== --- tinytim/trunk/README.txt 2008-09-08 11:37:54 UTC (rev 157) +++ tinytim/trunk/README.txt 2008-09-08 12:09:10 UTC (rev 158) @@ -6,17 +6,22 @@ ---------------- tinyTiM is a tiny Topic Maps engine which keeps topic maps in-memory. This Topic Maps engine is meant to be used together with the TMAPI interfaces, -see <http://www.tmapi.org/> for details. +see <http://www.tmapi.org/2.0/> for details. Installation ------------ -No real installation needed, simply put the ``tinytim-2.0.0a1.jar`` and +No real installation needed, simply put the ``tinytim-2.0.0a2.jar`` and ``tmapi-2.0a1.jar`` into your classpath. That's all. :) Optionally, you can put the ``trove-<VERSION>.jar`` into your classpath which makes tinyTiM slightly more memory efficient and faster. +Mailing List +------------ +If you have questions or suggestions, use our mailinglist +<http://tinytim.sourceforge.net/mailinglist> + Latest Version -------------- Visit tinyTiM's homepage <http://sourceforge.net/projects/tinytim> for the Modified: tinytim/trunk/build.properties =================================================================== --- tinytim/trunk/build.properties 2008-09-08 11:37:54 UTC (rev 157) +++ tinytim/trunk/build.properties 2008-09-08 12:09:10 UTC (rev 158) @@ -1,4 +1,4 @@ version=2.0.0 -version_suffix=a1 +version_suffix=a2 debug=off optimize=on Modified: tinytim/trunk/build.xml =================================================================== --- tinytim/trunk/build.xml 2008-09-08 11:37:54 UTC (rev 157) +++ tinytim/trunk/build.xml 2008-09-08 12:09:10 UTC (rev 158) @@ -29,7 +29,7 @@ <property name="dir.res" value="${basedir}/src/main/resources"/> <property name="dir.coverage" value="${basedir}/coverage"/> - <property name="lib.junit" value="${dir.lib}/junit-4.4.jar"/> + <property name="lib.junit" value="${dir.lib}/junit-4.5.jar"/> <property name="lib.trove" value="${dir.lib}/trove-2.0.4.jar"/> <property name="lib.tmapi" value="${dir.lib}/tmapi-2.0a1.jar"/> <property name="lib.tmapi.tests" value="${dir.lib}/tmapi-2.0a1-tests.jar"/> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lh...@us...> - 2008-09-18 13:02:27
|
Revision: 161 http://tinytim.svn.sourceforge.net/tinytim/?rev=161&view=rev Author: lheuer Date: 2008-09-18 13:02:34 +0000 (Thu, 18 Sep 2008) Log Message: ----------- - Moved to Apache License 2.0 Modified Paths: -------------- tinytim/trunk/CHANGES.txt tinytim/trunk/LICENSE.txt tinytim/trunk/README.txt tinytim/trunk/build.properties tinytim/trunk/build.xml tinytim/trunk/src/main/java/org/tinytim/core/AssociationImpl.java tinytim/trunk/src/main/java/org/tinytim/core/ConstructImpl.java tinytim/trunk/src/main/java/org/tinytim/core/CopyUtils.java tinytim/trunk/src/main/java/org/tinytim/core/DatatypeAwareConstruct.java tinytim/trunk/src/main/java/org/tinytim/core/DecimalLiteral.java tinytim/trunk/src/main/java/org/tinytim/core/Event.java tinytim/trunk/src/main/java/org/tinytim/core/IConstant.java tinytim/trunk/src/main/java/org/tinytim/core/IConstruct.java tinytim/trunk/src/main/java/org/tinytim/core/IEventHandler.java tinytim/trunk/src/main/java/org/tinytim/core/IEventPublisher.java tinytim/trunk/src/main/java/org/tinytim/core/ILiteral.java tinytim/trunk/src/main/java/org/tinytim/core/ILiteralAware.java tinytim/trunk/src/main/java/org/tinytim/core/ILocator.java tinytim/trunk/src/main/java/org/tinytim/core/IMovable.java tinytim/trunk/src/main/java/org/tinytim/core/IRI.java tinytim/trunk/src/main/java/org/tinytim/core/IScope.java tinytim/trunk/src/main/java/org/tinytim/core/IScoped.java tinytim/trunk/src/main/java/org/tinytim/core/IdGenerator.java tinytim/trunk/src/main/java/org/tinytim/core/IdentityManager.java tinytim/trunk/src/main/java/org/tinytim/core/IntegerLiteral.java tinytim/trunk/src/main/java/org/tinytim/core/Literal.java tinytim/trunk/src/main/java/org/tinytim/core/LiteralNormalizer.java tinytim/trunk/src/main/java/org/tinytim/core/MergeUtils.java tinytim/trunk/src/main/java/org/tinytim/core/NameImpl.java tinytim/trunk/src/main/java/org/tinytim/core/OccurrenceImpl.java tinytim/trunk/src/main/java/org/tinytim/core/RoleImpl.java tinytim/trunk/src/main/java/org/tinytim/core/Scope.java tinytim/trunk/src/main/java/org/tinytim/core/ScopedImpl.java tinytim/trunk/src/main/java/org/tinytim/core/SignatureGenerator.java tinytim/trunk/src/main/java/org/tinytim/core/TopicImpl.java tinytim/trunk/src/main/java/org/tinytim/core/TopicMapImpl.java tinytim/trunk/src/main/java/org/tinytim/core/TopicMapSystemFactoryImpl.java tinytim/trunk/src/main/java/org/tinytim/core/TopicMapSystemImpl.java tinytim/trunk/src/main/java/org/tinytim/core/TypedImpl.java tinytim/trunk/src/main/java/org/tinytim/core/VariantImpl.java tinytim/trunk/src/main/java/org/tinytim/index/AbstractIndex.java tinytim/trunk/src/main/java/org/tinytim/index/IIndexManager.java tinytim/trunk/src/main/java/org/tinytim/index/IndexManager.java tinytim/trunk/src/main/java/org/tinytim/index/LiteralIndexImpl.java tinytim/trunk/src/main/java/org/tinytim/index/ScopedIndexImpl.java tinytim/trunk/src/main/java/org/tinytim/index/TypeInstanceIndexImpl.java tinytim/trunk/src/main/java/org/tinytim/internal/utils/Check.java tinytim/trunk/src/main/java/org/tinytim/internal/utils/CollectionFactory.java tinytim/trunk/src/main/java/org/tinytim/internal/utils/DefaultIntObjectMap.java tinytim/trunk/src/main/java/org/tinytim/internal/utils/ICollectionFactory.java tinytim/trunk/src/main/java/org/tinytim/internal/utils/IIntObjectMap.java tinytim/trunk/src/main/java/org/tinytim/internal/utils/JavaCollectionFactory.java tinytim/trunk/src/main/java/org/tinytim/internal/utils/TroveCollectionFactory.java tinytim/trunk/src/main/java/org/tinytim/internal/utils/WeakObjectRegistry.java tinytim/trunk/src/main/java/org/tinytim/utils/DuplicateRemovalUtils.java tinytim/trunk/src/main/java/org/tinytim/utils/Feature.java tinytim/trunk/src/main/java/org/tinytim/utils/TopicUtils.java tinytim/trunk/src/main/java/org/tinytim/utils/TypeInstanceConverter.java tinytim/trunk/src/main/java/org/tinytim/voc/TMDM.java tinytim/trunk/src/main/java/org/tinytim/voc/Vocabulary.java tinytim/trunk/src/main/java/org/tinytim/voc/XSD.java tinytim/trunk/src/main/java/org/tinytim/voc/XTM10.java tinytim/trunk/src/test/java/org/tinytim/core/AbstractTMAPITestSuite.java tinytim/trunk/src/test/java/org/tinytim/core/AllTests.java tinytim/trunk/src/test/java/org/tinytim/core/TestIConstruct.java tinytim/trunk/src/test/java/org/tinytim/core/TestIRI.java tinytim/trunk/src/test/java/org/tinytim/core/TestItemIdentifierConstraint.java tinytim/trunk/src/test/java/org/tinytim/core/TestLiteral.java tinytim/trunk/src/test/java/org/tinytim/core/TestLiteralNormalizer.java tinytim/trunk/src/test/java/org/tinytim/core/TestScope.java tinytim/trunk/src/test/java/org/tinytim/core/TestSignatureGenerator.java tinytim/trunk/src/test/java/org/tinytim/core/TestTMAPICore.java tinytim/trunk/src/test/java/org/tinytim/core/TestTMAPIIndex.java tinytim/trunk/src/test/java/org/tinytim/core/TestTopicMapSystemFactoryImpl.java tinytim/trunk/src/test/java/org/tinytim/core/TinyTimTestCase.java tinytim/trunk/src/test/java/org/tinytim/utils/TestDuplicateRemovalUtils.java tinytim/trunk/src/test/java/org/tinytim/utils/TestTopicUtils.java tinytim/trunk/src/test/java/org/tinytim/utils/TestTypeInstanceConverter.java Modified: tinytim/trunk/CHANGES.txt =================================================================== --- tinytim/trunk/CHANGES.txt 2008-09-08 12:26:52 UTC (rev 160) +++ tinytim/trunk/CHANGES.txt 2008-09-18 13:02:34 UTC (rev 161) @@ -2,6 +2,11 @@ Changes Log =========== +2.0.0 a3 (xx.09.2008) +--------------------- +* Moved to Apache License 2.0 + + 2.0.0 a2 (08.09.2008) --------------------- * Internal code refactoring Modified: tinytim/trunk/LICENSE.txt =================================================================== --- tinytim/trunk/LICENSE.txt 2008-09-08 12:26:52 UTC (rev 160) +++ tinytim/trunk/LICENSE.txt 2008-09-18 13:02:34 UTC (rev 161) @@ -1,504 +1,202 @@ - GNU LESSER GENERAL PUBLIC LICENSE - Version 2.1, February 1999 - Copyright (C) 1991, 1999 Free Software Foundation, Inc. - 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ -[This is the first released version of the Lesser GPL. It also counts - as the successor of the GNU Library Public License, version 2, hence - the version number 2.1.] + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - Preamble + 1. Definitions. - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -Licenses are intended to guarantee your freedom to share and change -free software--to make sure the software is free for all its users. + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. - This license, the Lesser General Public License, applies to some -specially designated software packages--typically libraries--of the -Free Software Foundation and other authors who decide to use it. You -can use it too, but we suggest you first think carefully about whether -this license or the ordinary General Public License is the better -strategy to use in any particular case, based on the explanations below. + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. - When we speak of free software, we are referring to freedom of use, -not price. Our General Public Licenses are designed to make sure that -you have the freedom to distribute copies of free software (and charge -for this service if you wish); that you receive source code or can get -it if you want it; that you can change the software and use pieces of -it in new free programs; and that you are informed that you can do -these things. + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. - To protect your rights, we need to make restrictions that forbid -distributors to deny you these rights or to ask you to surrender these -rights. These restrictions translate to certain responsibilities for -you if you distribute copies of the library or if you modify it. + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. - For example, if you distribute copies of the library, whether gratis -or for a fee, you must give the recipients all the rights that we gave -you. You must make sure that they, too, receive or can get the source -code. If you link other code with the library, you must provide -complete object files to the recipients, so that they can relink them -with the library after making changes to the library and recompiling -it. And you must show them these terms so they know their rights. + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. - We protect your rights with a two-step method: (1) we copyright the -library, and (2) we offer you this license, which gives you legal -permission to copy, distribute and/or modify the library. + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. - To protect each distributor, we want to make it very clear that -there is no warranty for the free library. Also, if the library is -modified by someone else and passed on, the recipients should know -that what they have is not the original version, so that the original -author's reputation will not be affected by problems that might be -introduced by others. - - Finally, software patents pose a constant threat to the existence of -any free program. We wish to make sure that a company cannot -effectively restrict the users of a free program by obtaining a -restrictive license from a patent holder. Therefore, we insist that -any patent license obtained for a version of the library must be -consistent with the full freedom of use specified in this license. + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). - Most GNU software, including some libraries, is covered by the -ordinary GNU General Public License. This license, the GNU Lesser -General Public License, applies to certain designated libraries, and -is quite different from the ordinary General Public License. We use -this license for certain libraries in order to permit linking those -libraries into non-free programs. + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. - When a program is linked with a library, whether statically or using -a shared library, the combination of the two is legally speaking a -combined work, a derivative of the original library. The ordinary -General Public License therefore permits such linking only if the -entire combination fits its criteria of freedom. The Lesser General -Public License permits more lax criteria for linking other code with -the library. + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." - We call this license the "Lesser" General Public License because it -does Less to protect the user's freedom than the ordinary General -Public License. It also provides other free software developers Less -of an advantage over competing non-free programs. These disadvantages -are the reason we use the ordinary General Public License for many -libraries. However, the Lesser license provides advantages in certain -special circumstances. + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. - For example, on rare occasions, there may be a special need to -encourage the widest possible use of a certain library, so that it becomes -a de-facto standard. To achieve this, non-free programs must be -allowed to use the library. A more frequent case is that a free -library does the same job as widely used non-free libraries. In this -case, there is little to gain by limiting the free library to free -software only, so we use the Lesser General Public License. + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. - In other cases, permission to use a particular library in non-free -programs enables a greater number of people to use a large body of -free software. For example, permission to use the GNU C Library in -non-free programs enables many more people to use the whole GNU -operating system, as well as its variant, the GNU/Linux operating -system. + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. - Although the Lesser General Public License is Less protective of the -users' freedom, it does ensure that the user of a program that is -linked with the Library has the freedom and the wherewithal to run -that program using a modified version of the Library. + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: - The precise terms and conditions for copying, distribution and -modification follow. Pay close attention to the difference between a -"work based on the library" and a "work that uses the library". The -former contains code derived from the library, whereas the latter must -be combined with the library in order to run. - - GNU LESSER GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and - 0. This License Agreement applies to any software library or other -program which contains a notice placed by the copyright holder or -other authorized party saying it may be distributed under the terms of -this Lesser General Public License (also called "this License"). -Each licensee is addressed as "you". + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and - A "library" means a collection of software functions and/or data -prepared so as to be conveniently linked with application programs -(which use some of those functions and data) to form executables. + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and - The "Library", below, refers to any such software library or work -which has been distributed under these terms. A "work based on the -Library" means either the Library or any derivative work under -copyright law: that is to say, a work containing the Library or a -portion of it, either verbatim or with modifications and/or translated -straightforwardly into another language. (Hereinafter, translation is -included without limitation in the term "modification".) + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. - "Source code" for a work means the preferred form of the work for -making modifications to it. For a library, complete source code means -all the source code for all modules it contains, plus any associated -interface definition files, plus the scripts used to control compilation -and installation of the library. + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. - Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running a program using the Library is not restricted, and output from -such a program is covered only if its contents constitute a work based -on the Library (independent of the use of the Library in a tool for -writing it). Whether that is true depends on what the Library does -and what the program that uses the Library does. - - 1. You may copy and distribute verbatim copies of the Library's -complete source code as you receive it, in any medium, provided that -you conspicuously and appropriately publish on each copy an -appropriate copyright notice and disclaimer of warranty; keep intact -all the notices that refer to this License and to the absence of any -warranty; and distribute a copy of this License along with the -Library. + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. - You may charge a fee for the physical act of transferring a copy, -and you may at your option offer warranty protection in exchange for a -fee. - - 2. You may modify your copy or copies of the Library or any portion -of it, thus forming a work based on the Library, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. - a) The modified work must itself be a software library. + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. - b) You must cause the files modified to carry prominent notices - stating that you changed the files and the date of any change. + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. - c) You must cause the whole of the work to be licensed at no - charge to all third parties under the terms of this License. + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. - d) If a facility in the modified Library refers to a function or a - table of data to be supplied by an application program that uses - the facility, other than as an argument passed when the facility - is invoked, then you must make a good faith effort to ensure that, - in the event an application does not supply such function or - table, the facility still operates, and performs whatever part of - its purpose remains meaningful. + END OF TERMS AND CONDITIONS - (For example, a function in a library to compute square roots has - a purpose that is entirely well-defined independent of the - application. Therefore, Subsection 2d requires that any - application-supplied function or table used by this function must - be optional: if the application does not supply it, the square - root function must still compute square roots.) + APPENDIX: How to apply the Apache License to your work. -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Library, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Library, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote -it. + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Library. + Copyright [yyyy] [name of copyright owner] -In addition, mere aggregation of another work not based on the Library -with the Library (or with a work based on the Library) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at - 3. You may opt to apply the terms of the ordinary GNU General Public -License instead of this License to a given copy of the Library. To do -this, you must alter all the notices that refer to this License, so -that they refer to the ordinary GNU General Public License, version 2, -instead of to this License. (If a newer version than version 2 of the -ordinary GNU General Public License has appeared, then you can specify -that version instead if you wish.) Do not make any other change in -these notices. - - Once this change is made in a given copy, it is irreversible for -that copy, so the ordinary GNU General Public License applies to all -subsequent copies and derivative works made from that copy. + http://www.apache.org/licenses/LICENSE-2.0 - This option is useful when you wish to copy part of the code of -the Library into a program that is not a library. - - 4. You may copy and distribute the Library (or a portion or -derivative of it, under Section 2) in object code or executable form -under the terms of Sections 1 and 2 above provided that you accompany -it with the complete corresponding machine-readable source code, which -must be distributed under the terms of Sections 1 and 2 above on a -medium customarily used for software interchange. - - If distribution of object code is made by offering access to copy -from a designated place, then offering equivalent access to copy the -source code from the same place satisfies the requirement to -distribute the source code, even though third parties are not -compelled to copy the source along with the object code. - - 5. A program that contains no derivative of any portion of the -Library, but is designed to work with the Library by being compiled or -linked with it, is called a "work that uses the Library". Such a -work, in isolation, is not a derivative work of the Library, and -therefore falls outside the scope of this License. - - However, linking a "work that uses the Library" with the Library -creates an executable that is a derivative of the Library (because it -contains portions of the Library), rather than a "work that uses the -library". The executable is therefore covered by this License. -Section 6 states terms for distribution of such executables. - - When a "work that uses the Library" uses material from a header file -that is part of the Library, the object code for the work may be a -derivative work of the Library even though the source code is not. -Whether this is true is especially significant if the work can be -linked without the Library, or if the work is itself a library. The -threshold for this to be true is not precisely defined by law. - - If such an object file uses only numerical parameters, data -structure layouts and accessors, and small macros and small inline -functions (ten lines or less in length), then the use of the object -file is unrestricted, regardless of whether it is legally a derivative -work. (Executables containing this object code plus portions of the -Library will still fall under Section 6.) - - Otherwise, if the work is a derivative of the Library, you may -distribute the object code for the work under the terms of Section 6. -Any executables containing that work also fall under Section 6, -whether or not they are linked directly with the Library itself. - - 6. As an exception to the Sections above, you may also combine or -link a "work that uses the Library" with the Library to produce a -work containing portions of the Library, and distribute that work -under terms of your choice, provided that the terms permit -modification of the work for the customer's own use and reverse -engineering for debugging such modifications. - - You must give prominent notice with each copy of the work that the -Library is used in it and that the Library and its use are covered by -this License. You must supply a copy of this License. If the work -during execution displays copyright notices, you must include the -copyright notice for the Library among them, as well as a reference -directing the user to the copy of this License. Also, you must do one -of these things: - - a) Accompany the work with the complete corresponding - machine-readable source code for the Library including whatever - changes were used in the work (which must be distributed under - Sections 1 and 2 above); and, if the work is an executable linked - with the Library, with the complete machine-readable "work that - uses the Library", as object code and/or source code, so that the - user can modify the Library and then relink to produce a modified - executable containing the modified Library. (It is understood - that the user who changes the contents of definitions files in the - Library will not necessarily be able to recompile the application - to use the modified definitions.) - - b) Use a suitable shared library mechanism for linking with the - Library. A suitable mechanism is one that (1) uses at run time a - copy of the library already present on the user's computer system, - rather than copying library functions into the executable, and (2) - will operate properly with a modified version of the library, if - the user installs one, as long as the modified version is - interface-compatible with the version that the work was made with. - - c) Accompany the work with a written offer, valid for at - least three years, to give the same user the materials - specified in Subsection 6a, above, for a charge no more - than the cost of performing this distribution. - - d) If distribution of the work is made by offering access to copy - from a designated place, offer equivalent access to copy the above - specified materials from the same place. - - e) Verify that the user has already received a copy of these - materials or that you have already sent this user a copy. - - For an executable, the required form of the "work that uses the -Library" must include any data and utility programs needed for -reproducing the executable from it. However, as a special exception, -the materials to be distributed need not include anything that is -normally distributed (in either source or binary form) with the major -components (compiler, kernel, and so on) of the operating system on -which the executable runs, unless that component itself accompanies -the executable. - - It may happen that this requirement contradicts the license -restrictions of other proprietary libraries that do not normally -accompany the operating system. Such a contradiction means you cannot -use both them and the Library together in an executable that you -distribute. - - 7. You may place library facilities that are a work based on the -Library side-by-side in a single library together with other library -facilities not covered by this License, and distribute such a combined -library, provided that the separate distribution of the work based on -the Library and of the other library facilities is otherwise -permitted, and provided that you do these two things: - - a) Accompany the combined library with a copy of the same work - based on the Library, uncombined with any other library - facilities. This must be distributed under the terms of the - Sections above. - - b) Give prominent notice with the combined library of the fact - that part of it is a work based on the Library, and explaining - where to find the accompanying uncombined form of the same work. - - 8. You may not copy, modify, sublicense, link with, or distribute -the Library except as expressly provided under this License. Any -attempt otherwise to copy, modify, sublicense, link with, or -distribute the Library is void, and will automatically terminate your -rights under this License. However, parties who have received copies, -or rights, from you under this License will not have their licenses -terminated so long as such parties remain in full compliance. - - 9. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Library or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Library (or any work based on the -Library), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Library or works based on it. - - 10. Each time you redistribute the Library (or any work based on the -Library), the recipient automatically receives a license from the -original licensor to copy, distribute, link with or modify the Library -subject to these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties with -this License. - - 11. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Library at all. For example, if a patent -license would not permit royalty-free redistribution of the Library by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Library. - -If any portion of this section is held invalid or unenforceable under any -particular circumstance, the balance of the section is intended to apply, -and the section as a whole is intended to apply in other circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 12. If the distribution and/or use of the Library is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Library under this License may add -an explicit geographical distribution limitation excluding those countries, -so that distribution is permitted only in or among countries not thus -excluded. In such case, this License incorporates the limitation as if -written in the body of this License. - - 13. The Free Software Foundation may publish revised and/or new -versions of the Lesser General Public License from time to time. -Such new versions will be similar in spirit to the present version, -but may differ in detail to address new problems or concerns. - -Each version is given a distinguishing version number. If the Library -specifies a version number of this License which applies to it and -"any later version", you have the option of following the terms and -conditions either of that version or of any later version published by -the Free Software Foundation. If the Library does not specify a -license version number, you may choose any version ever published by -the Free Software Foundation. - - 14. If you wish to incorporate parts of the Library into other free -programs whose distribution conditions are incompatible with these, -write to the author to ask for permission. For software which is -copyrighted by the Free Software Foundation, write to the Free -Software Foundation; we sometimes make exceptions for this. Our -decision will be guided by the two goals of preserving the free status -of all derivatives of our free software and of promoting the sharing -and reuse of software generally. - - NO WARRANTY - - 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO -WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. -EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR -OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY -KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE -LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME -THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN -WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY -AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU -FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR -CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE -LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING -RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A -FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF -SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Libraries - - If you develop a new library, and you want it to be of the greatest -possible use to the public, we recommend making it free software that -everyone can redistribute and change. You can do so by permitting -redistribution under these terms (or, alternatively, under the terms of the -ordinary General Public License). - - To apply these terms, attach the following notices to the library. It is -safest to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least the -"copyright" line and a pointer to where the full notice is found. - - <one line to give the library's name and a brief idea of what it does.> - Copyright (C) <year> <name of author> - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -Also add information on how to contact you by electronic and paper mail. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the library, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the - library `Frob' (a library for tweaking knobs) written by James Random Hacker. - - <signature of Ty Coon>, 1 April 1990 - Ty Coon, President of Vice - -That's all there is to it! - - + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. Modified: tinytim/trunk/README.txt =================================================================== --- tinytim/trunk/README.txt 2008-09-08 12:26:52 UTC (rev 160) +++ tinytim/trunk/README.txt 2008-09-18 13:02:34 UTC (rev 161) @@ -30,5 +30,5 @@ License ------- -tinyTiM is licensed under the GNU Lesser General Public License (LGPL) -Version 2.1, see LICENSE.txt for details. +tinyTiM is licensed under the Apache License Version 2.0, see LICENSE.txt +for details. Modified: tinytim/trunk/build.properties =================================================================== --- tinytim/trunk/build.properties 2008-09-08 12:26:52 UTC (rev 160) +++ tinytim/trunk/build.properties 2008-09-18 13:02:34 UTC (rev 161) @@ -1,4 +1,4 @@ version=2.0.0 -version_suffix=a2 +version_suffix=a3-snapshot debug=off optimize=on Modified: tinytim/trunk/build.xml =================================================================== --- tinytim/trunk/build.xml 2008-09-08 12:26:52 UTC (rev 160) +++ tinytim/trunk/build.xml 2008-09-18 13:02:34 UTC (rev 161) @@ -1,25 +1,4 @@ <?xml version="1.0" encoding="utf-8"?> -<!-- - ==================================================================== - This is tinyTiM, a tiny Topic Maps engine. - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with this library; if not, write to the Free - Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - ==================================================================== - - $Rev:$ - $Date:$ ---> <project name="tinyTiM" default="jar" basedir="."> <property file="build.properties"/> Modified: tinytim/trunk/src/main/java/org/tinytim/core/AssociationImpl.java =================================================================== --- tinytim/trunk/src/main/java/org/tinytim/core/AssociationImpl.java 2008-09-08 12:26:52 UTC (rev 160) +++ tinytim/trunk/src/main/java/org/tinytim/core/AssociationImpl.java 2008-09-18 13:02:34 UTC (rev 161) @@ -1,22 +1,17 @@ /* - * This is tinyTiM, a tiny Topic Maps engine. + * Copyright 2008 Lars Heuer (heuer[at]semagia.com) * - * Copyright (C) 2008 Lars Heuer (heuer[at]semagia.com) - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. + * http://www.apache.org/licenses/LICENSE-2.0 * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package org.tinytim.core; Modified: tinytim/trunk/src/main/java/org/tinytim/core/ConstructImpl.java =================================================================== --- tinytim/trunk/src/main/java/org/tinytim/core/ConstructImpl.java 2008-09-08 12:26:52 UTC (rev 160) +++ tinytim/trunk/src/main/java/org/tinytim/core/ConstructImpl.java 2008-09-18 13:02:34 UTC (rev 161) @@ -1,22 +1,17 @@ /* - * This is tinyTiM, a tiny Topic Maps engine. + * Copyright 2008 Lars Heuer (heuer[at]semagia.com) * - * Copyright (C) 2008 Lars Heuer (heuer[at]semagia.com) - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. + * http://www.apache.org/licenses/LICENSE-2.0 * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package org.tinytim.core; Modified: tinytim/trunk/src/main/java/org/tinytim/core/CopyUtils.java =================================================================== --- tinytim/trunk/src/main/java/org/tinytim/core/CopyUtils.java 2008-09-08 12:26:52 UTC (rev 160) +++ tinytim/trunk/src/main/java/org/tinytim/core/CopyUtils.java 2008-09-18 13:02:34 UTC (rev 161) @@ -1,22 +1,17 @@ /* - * This is tinyTiM, a tiny Topic Maps engine. + * Copyright 2008 Lars Heuer (heuer[at]semagia.com) * - * Copyright (C) 2008 Lars Heuer (heuer[at]semagia.com) - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. + * http://www.apache.org/licenses/LICENSE-2.0 * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package org.tinytim.core; Modified: tinytim/trunk/src/main/java/org/tinytim/core/DatatypeAwareConstruct.java =================================================================== --- tinytim/trunk/src/main/java/org/tinytim/core/DatatypeAwareConstruct.java 2008-09-08 12:26:52 UTC (rev 160) +++ tinytim/trunk/src/main/java/org/tinytim/core/DatatypeAwareConstruct.java 2008-09-18 13:02:34 UTC (rev 161) @@ -1,22 +1,17 @@ /* - * This is tinyTiM, a tiny Topic Maps engine. + * Copyright 2008 Lars Heuer (heuer[at]semagia.com) * - * Copyright (C) 2008 Lars Heuer (heuer[at]semagia.com) - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. + * http://www.apache.org/licenses/LICENSE-2.0 * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package org.tinytim.core; Modified: tinytim/trunk/src/main/java/org/tinytim/core/DecimalLiteral.java =================================================================== --- tinytim/trunk/src/main/java/org/tinytim/core/DecimalLiteral.java 2008-09-08 12:26:52 UTC (rev 160) +++ tinytim/trunk/src/main/java/org/tinytim/core/DecimalLiteral.java 2008-09-18 13:02:34 UTC (rev 161) @@ -1,22 +1,17 @@ /* - * This is tinyTiM, a tiny Topic Maps engine. + * Copyright 2008 Lars Heuer (heuer[at]semagia.com) * - * Copyright (C) 2008 Lars Heuer (heuer[at]semagia.com) - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. + * http://www.apache.org/licenses/LICENSE-2.0 * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package org.tinytim.core; @@ -30,7 +25,7 @@ * * * @author Lars Heuer (heuer[at]semagia.com) <a href="http://www.semagia.com/">Semagia</a> - * @version $Rev:$ - $Date:$ + * @version $Rev$ - $Date$ */ final class DecimalLiteral implements ILiteral { Modified: tinytim/trunk/src/main/java/org/tinytim/core/Event.java =================================================================== --- tinytim/trunk/src/main/java/org/tinytim/core/Event.java 2008-09-08 12:26:52 UTC (rev 160) +++ tinytim/trunk/src/main/java/org/tinytim/core/Event.java 2008-09-18 13:02:34 UTC (rev 161) @@ -1,22 +1,17 @@ /* - * This is tinyTiM, a tiny Topic Maps engine. + * Copyright 2008 Lars Heuer (heuer[at]semagia.com) * - * Copyright (C) 2008 Lars Heuer (heuer[at]semagia.com) - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. + * http://www.apache.org/licenses/LICENSE-2.0 * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package org.tinytim.core; Modified: tinytim/trunk/src/main/java/org/tinytim/core/IConstant.java =================================================================== --- tinytim/trunk/src/main/java/org/tinytim/core/IConstant.java 2008-09-08 12:26:52 UTC (rev 160) +++ tinytim/trunk/src/main/java/org/tinytim/core/IConstant.java 2008-09-18 13:02:34 UTC (rev 161) @@ -1,22 +1,17 @@ /* - * This is tinyTiM, a tiny Topic Maps engine. + * Copyright 2008 Lars Heuer (heuer[at]semagia.com) * - * Copyright (C) 2008 Lars Heuer (heuer[at]semagia.com) - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. + * http://www.apache.org/licenses/LICENSE-2.0 * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package org.tinytim.core; Modified: tinytim/trunk/src/main/java/org/tinytim/core/IConstruct.java =================================================================== --- tinytim/trunk/src/main/java/org/tinytim/core/IConstruct.java 2008-09-08 12:26:52 UTC (rev 160) +++ tinytim/trunk/src/main/java/org/tinytim/core/IConstruct.java 2008-09-18 13:02:34 UTC (rev 161) @@ -1,22 +1,17 @@ /* - * This is tinyTiM, a tiny Topic Maps engine. + * Copyright 2008 Lars Heuer (heuer[at]semagia.com) * - * Copyright (C) 2008 Lars Heuer (heuer[at]semagia.com) - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the ... [truncated message content] |
From: Markus U. <mar...@gm...> - 2008-10-09 22:38:20
|
Hi, It seems that you forgot to brand the Apache License 2.0 template (this also applies to the copy for tinytim-mio). The files mentioned below were taken from the respective repositories/homepage: $ diff -b LICENSE.log4j LICENSE.tinytim20 190c190 < Copyright 1999-2005 The Apache Software Foundation --- > Copyright [yyyy] [name of copyright owner] Ad astra, Markus 2008/9/18 <lh...@us...> > Revision: 161 > http://tinytim.svn.sourceforge.net/tinytim/?rev=161&view=rev > Author: lheuer > Date: 2008-09-18 13:02:34 +0000 (Thu, 18 Sep 2008) > > Log Message: > ----------- > - Moved to Apache License 2.0 [...] |
From: <lh...@us...> - 2008-11-12 15:26:18
|
Revision: 179 http://tinytim.svn.sourceforge.net/tinytim/?rev=179&view=rev Author: lheuer Date: 2008-11-12 15:26:11 +0000 (Wed, 12 Nov 2008) Log Message: ----------- Updated changes and readme Modified Paths: -------------- tinytim/trunk/CHANGES.txt tinytim/trunk/README.txt Modified: tinytim/trunk/CHANGES.txt =================================================================== --- tinytim/trunk/CHANGES.txt 2008-11-12 15:09:23 UTC (rev 178) +++ tinytim/trunk/CHANGES.txt 2008-11-12 15:26:11 UTC (rev 179) @@ -2,11 +2,17 @@ Changes Log =========== -2.0.0 a3 (xx.10.2008) +2.0.0 a3 (xx.11.2008) --------------------- * Moved to Apache License 2.0 +* Internal code refactoring +Bugfixes: +--------- +* Bug #2269551 -- Topic types are not considered as dependency +* Bug #2221024 -- Merging topic maps causes an autom. generated topic iid + 2.0.0 a2 (08.09.2008) --------------------- * Internal code refactoring Modified: tinytim/trunk/README.txt =================================================================== --- tinytim/trunk/README.txt 2008-11-12 15:09:23 UTC (rev 178) +++ tinytim/trunk/README.txt 2008-11-12 15:26:11 UTC (rev 179) @@ -4,14 +4,14 @@ What is tinyTiM? ---------------- -tinyTiM is a tiny Topic Maps engine which keeps topic maps in-memory. +tinyTiM is a tiny Topic Maps engine with a small jar footprint. This Topic Maps engine is meant to be used together with the TMAPI interfaces, see <http://www.tmapi.org/2.0/> for details. Installation ------------ -No real installation needed, simply put the ``tinytim-2.0.0a2.jar`` and +No real installation needed, simply put the ``tinytim-2.0.0a3.jar`` and ``tmapi-2.0a1.jar`` into your classpath. That's all. :) Optionally, you can put the ``trove-<VERSION>.jar`` into your classpath which makes tinyTiM slightly more memory efficient and faster. @@ -24,7 +24,7 @@ Latest Version -------------- -Visit tinyTiM's homepage <http://sourceforge.net/projects/tinytim> for the +Visit tinyTiM's homepage <http://tinytim.sourceforge.net/> for the latest version. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lh...@us...> - 2008-11-14 15:42:30
|
Revision: 193 http://tinytim.svn.sourceforge.net/tinytim/?rev=193&view=rev Author: lheuer Date: 2008-11-14 15:42:28 +0000 (Fri, 14 Nov 2008) Log Message: ----------- - Simplified Version.java - Preparation for release 2.0.0a3 Modified Paths: -------------- tinytim/trunk/build.properties tinytim/trunk/build.xml tinytim/trunk/src/main/java/org/tinytim/Version.java Modified: tinytim/trunk/build.properties =================================================================== --- tinytim/trunk/build.properties 2008-11-14 14:10:29 UTC (rev 192) +++ tinytim/trunk/build.properties 2008-11-14 15:42:28 UTC (rev 193) @@ -1,4 +1,5 @@ version=2.0.0 -version_suffix=a3-snapshot +version_suffix=a3 +#release_type= debug=off optimize=on Modified: tinytim/trunk/build.xml =================================================================== --- tinytim/trunk/build.xml 2008-11-14 14:10:29 UTC (rev 192) +++ tinytim/trunk/build.xml 2008-11-14 15:42:28 UTC (rev 193) @@ -1,6 +1,8 @@ <?xml version="1.0" encoding="utf-8"?> <project name="tinyTiM" default="jar" basedir="."> <property file="build.properties"/> + <tstamp/> + <property name="release_type" value="-snapshot-${DSTAMP}${TSTAMP}"/> <property name="dir.src" value="${basedir}/src/main/java"/> <property name="dir.test" value="${basedir}/src/test/java"/> @@ -42,7 +44,7 @@ </target> <target name="init"> - <property name="dist.version" value="${version}${version_suffix}"/> + <property name="dist.version" value="${version}${version_suffix}${release_type}"/> <property name="dist.name" value="tinytim-${dist.version}"/> <property name="tinytim.jar" value="${dist.name}.jar"/> @@ -146,6 +148,7 @@ <!-- Compile source files --> <!-- =================================================================== --> <target name="compile" depends="clean, prepare"> + <replace file="${dir.src}/org/tinytim/Version.java" token="@RELEASE@" value="${dist.version}"/> <javac destdir="${dir.build.classes}" debug="${debug}" target="1.5"> @@ -155,6 +158,7 @@ </classpath> <src path="${dir.src}"/> </javac> + <replace file="${dir.src}/org/tinytim/Version.java" token="${dist.version}" value="@RELEASE@"/> </target> <!-- =================================================================== --> @@ -175,10 +179,11 @@ <exclude name="org/tinytim/core/**"/> <exclude name="org/tinytim/index/**"/> <exclude name="org/tinytim/internal/**"/> + <exclude name="org/tinytim/utils/Property.*"/> </fileset> <!-- <doclet name="net.gleamynode.apiviz.APIviz" - path="${dir.lib}/apiviz-1.1.3.jar"> + path="${dir.lib}/apiviz-1.2.4.GA.jar"> </doclet> --> <link href="http://www.tmapi.org/2.0/api/"/> @@ -199,7 +204,7 @@ <manifest> <attribute name="Implementation-Title" value="tinyTiM"/> <attribute name="Implementation-Version" value="${dist.version}"/> - <attribute name="Implementation-URL" value="http://sourceforge.net/projects/tinytim"/> + <attribute name="Implementation-URL" value="http://tinytim.sourceforge.net/"/> </manifest> </jar> </target> @@ -215,7 +220,7 @@ <manifest> <attribute name="Implementation-Title" value="tinyTiM Tests"/> <attribute name="Implementation-Version" value="${dist.version}"/> - <attribute name="Implementation-URL" value="http://sourceforge.net/projects/tinytim"/> + <attribute name="Implementation-URL" value="http://tinytim.sourceforge.net/"/> </manifest> </jar> </target> @@ -232,6 +237,7 @@ <copy todir="${dir.dist}/src"> <fileset dir="${dir.src}"/> </copy> + <replace file="${dir.dist}/src/org/tinytim/Version.java" token="@RELEASE@" value="${dist.version}"/> <copy todir="${dir.dist}/test"> <fileset dir="${dir.test}"/> </copy> @@ -239,8 +245,10 @@ <fileset dir="${dir.lib}"> <include name="tmapi*"/> <include name="junit*"/> + <include name="trove*"/> + <include name="LICENSE.tmapi*"/> <include name="LICENSE.junit*"/> - <include name="LICENSE.tmapi*"/> + <include name="LICENSE.trove*"/> </fileset> </copy> Modified: tinytim/trunk/src/main/java/org/tinytim/Version.java =================================================================== --- tinytim/trunk/src/main/java/org/tinytim/Version.java 2008-11-14 14:10:29 UTC (rev 192) +++ tinytim/trunk/src/main/java/org/tinytim/Version.java 2008-11-14 15:42:28 UTC (rev 193) @@ -23,16 +23,14 @@ */ public class Version { - private static final String _MAJOR = "@MAJOR@"; - private static final String _MINOR = "@MINOR@"; - private static final String _MICRO = "@MICRO@"; - private static final String _STATE ="@STATE@"; - private static final String _DATE = "@DATE@"; + private Version() { + // noop. + } /** * The release information. */ // Not final since Java compilers copy the string into classes - public static String RELEASE = _MAJOR + "." + _MINOR + "." + _MICRO + _STATE + _DATE; + public static String RELEASE = "@RELEASE@"; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lh...@us...> - 2009-07-02 11:20:44
|
Revision: 300 http://tinytim.svn.sourceforge.net/tinytim/?rev=300&view=rev Author: lheuer Date: 2009-07-02 11:20:22 +0000 (Thu, 02 Jul 2009) Log Message: ----------- - Update to the inofficial TMAPI 2.0 a2 version - Moved TinyTimMapInputHandler into the core - Updated changes, and build.xml to reflect these changes Modified Paths: -------------- tinytim/trunk/CHANGES.txt tinytim/trunk/build.xml Added Paths: ----------- tinytim/trunk/lib/semagia-mio-0.9.4.jar tinytim/trunk/lib/tmapi-2.0a2-tests.jar tinytim/trunk/lib/tmapi-2.0a2.jar tinytim/trunk/src/main/java/org/tinytim/mio/ tinytim/trunk/src/main/java/org/tinytim/mio/TinyTimMapInputHandler.java tinytim/trunk/src/test/java/org/tinytim/mio/ tinytim/trunk/src/test/java/org/tinytim/mio/TestTinyTimMapInputHandler.java Removed Paths: ------------- tinytim/trunk/lib/tmapi-2.0a1-tests.jar tinytim/trunk/lib/tmapi-2.0a1.jar Modified: tinytim/trunk/CHANGES.txt =================================================================== --- tinytim/trunk/CHANGES.txt 2009-07-02 11:07:24 UTC (rev 299) +++ tinytim/trunk/CHANGES.txt 2009-07-02 11:20:22 UTC (rev 300) @@ -2,6 +2,17 @@ Changes Log =========== +2.0.0 a5 (xx.yy.2009) +--------------------- + +Bugfixes: +--------- +* Bug #2812460 -- Port the Check class from Ontopia back to + tinyTiM +* Bug #2809821 -- Ensure same topic map constraint +* + + 2.0.0 a4 (06.12.2008) --------------------- Modified: tinytim/trunk/build.xml =================================================================== --- tinytim/trunk/build.xml 2009-07-02 11:07:24 UTC (rev 299) +++ tinytim/trunk/build.xml 2009-07-02 11:20:22 UTC (rev 300) @@ -12,8 +12,9 @@ <property name="lib.junit" value="${dir.lib}/junit-4.5.jar"/> <property name="lib.trove" value="${dir.lib}/trove-2.0.4.jar"/> - <property name="lib.tmapi" value="${dir.lib}/tmapi-2.0a1.jar"/> - <property name="lib.tmapi.tests" value="${dir.lib}/tmapi-2.0a1-tests.jar"/> + <property name="lib.mio" value="${dir.lib}/semagia-mio-0.9.4.jar"/> + <property name="lib.tmapi" value="${dir.lib}/tmapi-2.0a2.jar"/> + <property name="lib.tmapi.tests" value="${dir.lib}/tmapi-2.0a2-tests.jar"/> <property name="lib.emma" value="${dir.lib}/emma.jar"/> <property name="lib.emma.task" value="${dir.lib}/emma_ant.jar"/> @@ -64,6 +65,7 @@ <pathelement location="${dir.build.classes}" /> <pathelement location="${dir.build.tests}" /> <pathelement location="${lib.junit}"/> + <pathelement location="${lib.mio}"/> <pathelement location="${lib.tmapi}"/> <pathelement location="${lib.tmapi.tests}"/> <pathelement location="${lib.trove}"/> @@ -98,6 +100,7 @@ <classpath> <pathelement location="${dir.build.classes}"/> <pathelement location="${lib.junit}"/> + <pathelement location="${lib.mio}"/> <pathelement location="${lib.tmapi}"/> <pathelement location="${lib.tmapi.tests}"/> <pathelement location="${lib.trove}"/> @@ -128,6 +131,7 @@ <classpath> <pathelement location="${dir.build.classes}"/> <pathelement location="${lib.junit}"/> + <pathelement location="${lib.mio}"/> <pathelement location="${lib.tmapi}"/> <pathelement location="${lib.tmapi.tests}"/> <pathelement location="${lib.trove}"/> @@ -155,6 +159,7 @@ <classpath> <pathelement location="${lib.tmapi}"/> <pathelement location="${lib.trove}"/> + <pathelement location="${lib.mio}"/> </classpath> <src path="${dir.src}"/> </javac> Added: tinytim/trunk/lib/semagia-mio-0.9.4.jar =================================================================== (Binary files differ) Property changes on: tinytim/trunk/lib/semagia-mio-0.9.4.jar ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Deleted: tinytim/trunk/lib/tmapi-2.0a1-tests.jar =================================================================== (Binary files differ) Deleted: tinytim/trunk/lib/tmapi-2.0a1.jar =================================================================== (Binary files differ) Added: tinytim/trunk/lib/tmapi-2.0a2-tests.jar =================================================================== (Binary files differ) Property changes on: tinytim/trunk/lib/tmapi-2.0a2-tests.jar ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: tinytim/trunk/lib/tmapi-2.0a2.jar =================================================================== (Binary files differ) Property changes on: tinytim/trunk/lib/tmapi-2.0a2.jar ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: tinytim/trunk/src/main/java/org/tinytim/mio/TinyTimMapInputHandler.java =================================================================== --- tinytim/trunk/src/main/java/org/tinytim/mio/TinyTimMapInputHandler.java (rev 0) +++ tinytim/trunk/src/main/java/org/tinytim/mio/TinyTimMapInputHandler.java 2009-07-02 11:20:22 UTC (rev 300) @@ -0,0 +1,530 @@ +/* + * Copyright 2008 Lars Heuer (heuer[at]semagia.com) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tinytim.mio; + +import java.util.List; + +import org.tinytim.core.Scope; +import org.tinytim.core.value.Literal; +import org.tinytim.internal.api.IConstruct; +import org.tinytim.internal.api.IConstructFactory; +import org.tinytim.internal.api.ILiteralAware; +import org.tinytim.internal.api.IName; +import org.tinytim.internal.api.IScope; +import org.tinytim.internal.api.IScoped; +import org.tinytim.internal.api.ITopic; +import org.tinytim.internal.api.ITopicMap; +import org.tinytim.internal.api.IVariant; +import org.tinytim.internal.utils.CollectionFactory; +import org.tinytim.utils.TypeInstanceConverter; +import org.tinytim.voc.TMDM; + +import org.tmapi.core.Association; +import org.tmapi.core.Construct; +import org.tmapi.core.Locator; +import org.tmapi.core.Reifiable; +import org.tmapi.core.Role; +import org.tmapi.core.Scoped; +import org.tmapi.core.Topic; +import org.tmapi.core.TopicMap; +import org.tmapi.core.Typed; + +import com.semagia.mio.IMapHandler; +import com.semagia.mio.IRef; +import com.semagia.mio.MIOException; + +/** + * Implementation of a {@link com.semagia.mio.IMapHandler} for tinyTiM. + * + * @author Lars Heuer (heuer[at]semagia.com) <a href="http://www.semagia.com/">Semagia</a> + * @version $Rev: 267 $ - $Date: 2009-02-24 14:56:47 +0100 (Di, 24 Feb 2009) $ + */ +public final class TinyTimMapInputHandler implements IMapHandler { + + private static final byte + INITIAL = 1, + TOPIC = 2, + ASSOCIATION = 3, + ROLE = 4, + OCCURRENCE = 5, + NAME = 6, + VARIANT = 7, + SCOPE = 8, + THEME = 9, + REIFIER = 10, + PLAYER = 11, + ISA = 12, + TYPE = 13; + + private static final int _CONSTRUCT_SIZE = 6; + private static final int _STATE_SIZE = 10; + private static final int _SCOPE_SIZE = 6; + + private final IConstructFactory _factory; + private final ITopicMap _tm; + private final List<Topic> _scope; + private byte[] _stateStack; + private int _stateSize; + private IConstruct[] _constructStack; + private int _constructSize; + + public TinyTimMapInputHandler(TopicMap topicMap) { + if (topicMap == null) { + throw new IllegalArgumentException("The topic map must not be null"); + } + _tm = (ITopicMap) topicMap; + _factory = _tm.getConstructFactory(); + _scope = CollectionFactory.createList(_SCOPE_SIZE); + } + + /* (non-Javadoc) + * @see com.semagia.mio.IMapHandler#startTopicMap() + */ + public void startTopicMap() throws MIOException { + _constructStack = new IConstruct[_CONSTRUCT_SIZE]; + _stateStack = new byte[_STATE_SIZE]; + _constructSize = 0; + _stateSize = 0; + _enterState(INITIAL, _tm); + } + + /* (non-Javadoc) + * @see com.semagia.mio.IMapHandler#endTopicMap() + */ + public void endTopicMap() throws MIOException { + TypeInstanceConverter.convertAssociationsToTypes(_tm); + _constructStack = null; + _stateStack = null; + _scope.clear(); + } + + /* (non-Javadoc) + * @see com.semagia.mio.IMapHandler#startTopic(com.semagia.mio.IRef) + */ + public void startTopic(IRef identity) throws MIOException { + _enterState(TOPIC, _createTopic(identity)); + } + + /* (non-Javadoc) + * @see com.semagia.mio.IMapHandler#endTopic() + */ + public void endTopic() throws MIOException { + _handleTopic((Topic) _leaveStatePopConstruct(TOPIC)); + } + + /* (non-Javadoc) + * @see com.semagia.mio.IMapHandler#startAssociation() + */ + public void startAssociation() throws MIOException { + _enterState(ASSOCIATION, _factory.createAssociation()); + } + + /* (non-Javadoc) + * @see com.semagia.mio.IMapHandler#endAssociation() + */ + public void endAssociation() throws MIOException { + _leaveStatePopConstruct(ASSOCIATION); + } + + /* (non-Javadoc) + * @see com.semagia.mio.IMapHandler#startRole() + */ + public void startRole() throws MIOException { + assert _state() == ASSOCIATION; + _enterState(ROLE, _factory.createRole((Association) _peekConstruct())); + } + + /* (non-Javadoc) + * @see com.semagia.mio.IMapHandler#endRole() + */ + public void endRole() throws MIOException { + _leaveStatePopConstruct(ROLE); + } + + /* (non-Javadoc) + * @see com.semagia.mio.IMapHandler#startPlayer() + */ + public void startPlayer() throws MIOException { + assert _state() == ROLE; + _enterState(PLAYER); + } + + /* (non-Javadoc) + * @see com.semagia.mio.IMapHandler#endPlayer() + */ + public void endPlayer() throws MIOException { + _leaveState(PLAYER); + assert _state() == ROLE; + } + + /* (non-Javadoc) + * @see com.semagia.mio.IMapHandler#startOccurrence() + */ + public void startOccurrence() throws MIOException { + _enterState(OCCURRENCE, _factory.createOccurrence(_peekTopic())); + } + + /* (non-Javadoc) + * @see com.semagia.mio.IMapHandler#endOccurrence() + */ + public void endOccurrence() throws MIOException { + _leaveStatePopConstruct(OCCURRENCE); + } + + /* (non-Javadoc) + * @see com.semagia.mio.IMapHandler#startName() + */ + public void startName() throws MIOException { + _enterState(NAME, _factory.createName(_peekTopic())); + } + + /* (non-Javadoc) + * @see com.semagia.mio.IMapHandler#endName() + */ + public void endName() throws MIOException { + IName name = (IName) _leaveStatePopConstruct(NAME); + if (name.getType() == null) { + name.setType(_tm.createTopicBySubjectIdentifier(TMDM.TOPIC_NAME)); + } + } + + /* (non-Javadoc) + * @see com.semagia.mio.IMapHandler#startVariant() + */ + public void startVariant() throws MIOException { + assert _state() == NAME; + _enterState(VARIANT, _factory.createVariant((IName) _peekConstruct())); + } + + /* (non-Javadoc) + * @see com.semagia.mio.IMapHandler#endVariant() + */ + public void endVariant() throws MIOException { + IVariant variant = (IVariant) _leaveStatePopConstruct(VARIANT); + IName name = (IName) _peekConstruct(); + IScope scope = variant.getScopeObject(); + if (scope.isUnconstrained() || name.getScopeObject().equals(scope)) { + _reportError("The variant has no scope"); + } + } + + /* (non-Javadoc) + * @see com.semagia.mio.IMapHandler#startType() + */ + public void startType() throws MIOException { + assert _peekConstruct() instanceof Typed; + _enterState(TYPE); + } + + /* (non-Javadoc) + * @see com.semagia.mio.IMapHandler#endType() + */ + public void endType() throws MIOException { + _leaveState(TYPE); + assert _peekConstruct() instanceof Typed; + } + + /* (non-Javadoc) + * @see com.semagia.mio.IMapHandler#startScope() + */ + public void startScope() throws MIOException { + assert _peekConstruct() instanceof Scoped; + _enterState(SCOPE); + } + + /* (non-Javadoc) + * @see com.semagia.mio.IMapHandler#endScope() + */ + public void endScope() throws MIOException { + _leaveState(SCOPE); + ((IScoped) _peekConstruct()).setScopeObject(Scope.create(_scope)); + _scope.clear(); + } + + /* (non-Javadoc) + * @see com.semagia.mio.IMapHandler#startTheme() + */ + public void startTheme() throws MIOException { + assert _state() == SCOPE; + _enterState(THEME); + } + + /* (non-Javadoc) + * @see com.semagia.mio.IMapHandler#endTheme() + */ + public void endTheme() throws MIOException { + _leaveState(THEME); + assert _state() == SCOPE; + } + + /* (non-Javadoc) + * @see com.semagia.mio.IMapHandler#subjectIdentifier(java.lang.String) + */ + public void subjectIdentifier(String subjectIdentifier) throws MIOException { + Locator sid = _tm.createLocator(subjectIdentifier); + ITopic topic = _peekTopic(); + Topic existing = _tm.getTopicBySubjectIdentifier(sid); + if (existing != null && !(existing.equals(topic))) { + _merge(existing, topic); + } + else { + IConstruct tmo = (IConstruct) _tm.getConstructByItemIdentifier(sid); + if (tmo != null && tmo.isTopic() && !tmo.equals(topic)) { + _merge((Topic) tmo, topic); + } + } + topic.addSubjectIdentifier(sid); + } + + /* (non-Javadoc) + * @see com.semagia.mio.IMapHandler#subjectLocator(java.lang.String) + */ + public void subjectLocator(String subjectLocator) throws MIOException { + Locator slo = _tm.createLocator(subjectLocator); + ITopic topic = _peekTopic(); + Topic existing = _tm.getTopicBySubjectLocator(slo); + if (existing != null && !(existing.equals(topic))) { + _merge(existing, topic); + } + topic.addSubjectLocator(slo); + } + + /* (non-Javadoc) + * @see com.semagia.mio.IMapHandler#itemIdentifier(java.lang.String) + */ + public void itemIdentifier(String itemIdentifier) throws MIOException { + Locator iid = _tm.createLocator(itemIdentifier); + IConstruct tmo = _peekConstruct(); + if (_state() == TOPIC) { + IConstruct existing = (IConstruct) _tm.getConstructByItemIdentifier(iid); + if (existing != null && existing.isTopic() && !existing.equals(tmo)) { + _merge((Topic) existing, (ITopic) tmo); + } + else { + Topic topic = _tm.getTopicBySubjectIdentifier(iid); + if (topic != null && !topic.equals(tmo)) { + _merge(topic, (ITopic) tmo); + } + } + } + tmo.addItemIdentifier(iid); + } + + /* (non-Javadoc) + * @see com.semagia.mio.IMapHandler#startIsa() + */ + public void startIsa() throws MIOException { + assert _state() == TOPIC; + _enterState(ISA); + } + + /* (non-Javadoc) + * @see com.semagia.mio.IMapHandler#endIsa() + */ + public void endIsa() throws MIOException { + _leaveState(ISA); + assert _state() == TOPIC; + } + + /* (non-Javadoc) + * @see com.semagia.mio.IMapHandler#startReifier() + */ + public void startReifier() throws MIOException { + assert _peekConstruct() instanceof Reifiable; + _enterState(REIFIER); + } + + /* (non-Javadoc) + * @see com.semagia.mio.IMapHandler#endReifier() + */ + public void endReifier() throws MIOException { + _leaveState(REIFIER); + assert _peekConstruct() instanceof Reifiable; + } + + /* (non-Javadoc) + * @see com.semagia.mio.IMapHandler#topicRef(com.semagia.mio.IRef) + */ + public void topicRef(IRef identity) throws MIOException { + _handleTopic(_createTopic(identity)); + } + + /* (non-Javadoc) + * @see com.semagia.mio.IMapHandler#value(java.lang.String) + */ + public void value(String value) throws MIOException { + assert _state() == NAME; + ((IName) _peekConstruct()).setValue(value); + } + + /* (non-Javadoc) + * @see com.semagia.mio.IMapHandler#value(java.lang.String, java.lang.String) + */ + public void value(String value, String datatype) throws MIOException { + ((ILiteralAware) _peekConstruct()).setLiteral(Literal.create(value, datatype)); + } + + /** + * Enters a state. + * + * @param state The state to push ontop of the state stack. + */ + private void _enterState(byte state) { + if (_stateSize >= _stateStack.length) { + byte[] states = new byte[_stateStack.length*2]; + System.arraycopy(_stateStack, 0, states, 0, _stateStack.length); + _stateStack = states; + } + _stateStack[_stateSize++] = state; + } + + /** + * Enters a state and pushes the Topic Maps construct ontop of the construct + * stack. + * + * @param state The state to enter. + * @param tmo The Topic Maps construct which should be pushed to the stack. + */ + private void _enterState(byte state, Construct tmo) { + _enterState(state); + if (_constructSize >= _constructStack.length) { + IConstruct[] constructs = new IConstruct[_constructStack.length*2]; + System.arraycopy(_constructStack, 0, constructs, 0, _constructStack.length); + _constructStack = constructs; + } + _constructStack[_constructSize++] = (IConstruct) tmo; + } + + /** + * Leaves a state. + * + * @param state The state to leave. + * @throws MIOException If the state is not equals to the current state. + */ + private void _leaveState(byte state) throws MIOException { + if (state != _state()) { + _reportError("Unexpected state: " + _state() + ", expected: " + state); + } + _stateSize--; + } + + /** + * Leaves a state and removed the Topic Maps construct from the top of the + * construct stack. + * + * @param state The state to leave. + * @throws MIOException If the state is not equals to the current state. + */ + private IConstruct _leaveStatePopConstruct(byte state) throws MIOException { + _leaveState(state); + final IConstruct construct = _peekConstruct(); + _constructSize--; + _constructStack[_constructSize] = null; + return construct; + } + + /** + * Returns the Topic Maps construct on top of the stack. + * + * @return The Topic Maps construct. + */ + private IConstruct _peekConstruct() { + return _constructStack[_constructSize-1]; + } + + /** + * Returns the topic on top of the stack. + * + * @return The topic. + */ + private ITopic _peekTopic() { + return (ITopic) _peekConstruct(); + } + + /** + * Returns the current state. + * + * @return The current state. + */ + private byte _state() { + return _stateStack[_stateSize-1]; + } + + /** + * Handles the topic dependent on the current state. + * + * @param topic The topic to handle. + */ + private void _handleTopic(Topic topic) { + switch (_state()) { + case ISA: _peekTopic().addType(topic); break; + case TYPE: ((Typed) _peekConstruct()).setType(topic); break; + case PLAYER: ((Role) _peekConstruct()).setPlayer(topic); break; + case THEME: _scope.add(topic); break; + case REIFIER: ((Reifiable) _peekConstruct()).setReifier(topic); break; + } + } + + /** + * Merges the <tt>source</tt> topic with the <tt>target</tt>. + * + * Further, this method ensures that the construct stack stays valid: If + * the <tt>source</tt> is part of the stack, it is replaced with + * <tt>target</tt>. + * + * @param source The source topic (will be removed). + * @param target The target topic. + */ + private void _merge(Topic source, ITopic target) { + for (int i=0; i <_constructSize; i++) { + if (_constructStack[i].equals(source)) { + _constructStack[i] = target; + } + } + target.mergeIn(source); + } + + /** + * Returns either an existing topic with the specified identity or creates + * a topic with the given identity. + * + * @param ref The identity of the topic. + * @return A topic instance. + * @throws MIOException + */ + private ITopic _createTopic(IRef ref) throws MIOException { + Locator loc = _tm.createLocator(ref.getIRI()); + switch (ref.getType()) { + case IRef.ITEM_IDENTIFIER: return (ITopic) _tm.createTopicByItemIdentifier(loc); + case IRef.SUBJECT_IDENTIFIER: return (ITopic) _tm.createTopicBySubjectIdentifier(loc); + case IRef.SUBJECT_LOCATOR: return (ITopic) _tm.createTopicBySubjectLocator(loc); + default: _reportError("Unknown reference type " + ref.getType()); + } + // Never returned, an exception was thrown + return null; + } + + /** + * Reports an error. + * + * @param msg The error message. + * @throws MIOException Thrown in any case. + */ + private static void _reportError(String msg) throws MIOException { + throw new MIOException(msg); + } + +} Added: tinytim/trunk/src/test/java/org/tinytim/mio/TestTinyTimMapInputHandler.java =================================================================== --- tinytim/trunk/src/test/java/org/tinytim/mio/TestTinyTimMapInputHandler.java (rev 0) +++ tinytim/trunk/src/test/java/org/tinytim/mio/TestTinyTimMapInputHandler.java 2009-07-02 11:20:22 UTC (rev 300) @@ -0,0 +1,368 @@ +/* + * Copyright 2008 Lars Heuer (heuer[at]semagia.com) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tinytim.mio; + +import org.tinytim.core.TinyTimTestCase; +import org.tinytim.voc.TMDM; +import org.tinytim.voc.XSD; +import org.tmapi.core.Locator; +import org.tmapi.core.Name; +import org.tmapi.core.Occurrence; +import org.tmapi.core.Topic; + +import com.semagia.mio.IRef; +import com.semagia.mio.MIOException; +import com.semagia.mio.helpers.Ref; + +/** + * Tests against the {@link org.tinytim.mio.TinyTimMapInputHandler}. + * + * @author Lars Heuer (heuer[at]semagia.com) <a href="http://www.semagia.com/">Semagia</a> + * @version $Rev: 209 $ - $Date: 2008-11-19 14:45:23 +0100 (Mi, 19 Nov 2008) $ + */ +public class TestTinyTimMapInputHandler extends TinyTimTestCase { + + private static final String _XSD_STRING = XSD.STRING.getReference(); + private static final String _XSD_ANY_URI = XSD.ANY_URI.getReference(); + + private TinyTimMapInputHandler _handler; + + /* (non-Javadoc) + * @see junit.framework.TestCase#setUp() + */ + @Override + protected void setUp() throws Exception { + super.setUp(); + _handler = new TinyTimMapInputHandler(_tm); + } + + public void testMappaIssue23() throws Exception { + // http://code.google.com/p/mappa/issues/detail?id=23 + String iid = "http://mappa.semagia.com/issue-23"; + String iid2 = "http://mappa.semagia.com/issue-23_"; + final IRef TOPIC_NAME = Ref.createSubjectIdentifier(TMDM.TOPIC_NAME.getReference()); + TinyTimMapInputHandler handler = this._handler; + handler.startTopicMap(); + handler.startTopic(Ref.createItemIdentifier(iid)); + handler.startName(); + handler.value("test"); + handler.startType(); + handler.topicRef(TOPIC_NAME); + handler.endType(); + handler.endName(); + handler.endTopic(); + handler.startTopic(Ref.createItemIdentifier(iid2)); + handler.startName(); + handler.value("a test"); + handler.startType(); + handler.topicRef(TOPIC_NAME); + handler.endType(); + handler.endName(); + handler.subjectIdentifier(TOPIC_NAME.getIRI()); + handler.endTopic(); + handler.endTopicMap(); + } + + /** + * Simple startTopicMap, followed by an endTopicMap event. + */ + public void testEmpty() throws Exception { + assertEquals(0, _tm.getTopics().size()); + assertEquals(0, _tm.getAssociations().size()); + _handler.startTopicMap(); + _handler.endTopicMap(); + assertEquals(0, _tm.getTopics().size()); + assertEquals(0, _tm.getAssociations().size()); + } + + /** + * Tests reifying a topic map. + */ + public void testTMReifier() throws Exception { + String itemIdent = "http://sf.net/projects/tinytim/test#1"; + assertEquals(0, _tm.getTopics().size()); + assertEquals(0, _tm.getAssociations().size()); + _handler.startTopicMap(); + _handler.startReifier(); + _handler.startTopic(Ref.createItemIdentifier(itemIdent)); + _handler.endTopic(); + _handler.endReifier(); + _handler.endTopicMap(); + assertEquals(1, _tm.getTopics().size()); + assertEquals(0, _tm.getAssociations().size()); + Topic topic = (Topic) _tm.getConstructByItemIdentifier(_tm.createLocator(itemIdent)); + assertNotNull(topic); + assertNotNull(_tm.getReifier()); + assertEquals(topic, _tm.getReifier()); + } + + /** + * Tests topic creation with an item identifier. + */ + public void testTopicIdentityItemIdentifier() throws Exception { + String itemIdent = "http://sf.net/projects/tinytim/test#1"; + _handler.startTopicMap(); + _handler.startTopic(Ref.createItemIdentifier(itemIdent)); + _handler.endTopic(); + _handler.endTopicMap(); + assertEquals(1, _tm.getTopics().size()); + Topic topic = (Topic) _tm.getConstructByItemIdentifier(_tm.createLocator(itemIdent)); + assertNotNull(topic); + } + + /** + * Tests topic creation with a subject identifier. + */ + public void testTopicIdentitySubjectIdentifier() throws Exception { + String subjIdent = "http://sf.net/projects/tinytim/test#1"; + _handler.startTopicMap(); + _handler.startTopic(Ref.createSubjectIdentifier(subjIdent)); + _handler.endTopic(); + _handler.endTopicMap(); + assertEquals(1, _tm.getTopics().size()); + Topic topic = _tm.getTopicBySubjectIdentifier(_tm.createLocator(subjIdent)); + assertNotNull(topic); + } + + /** + * Tests topic creation with a subject locator. + */ + public void testTopicIdentitySubjectLocator() throws Exception { + String subjLoc = "http://sf.net/projects/tinytim/test#1"; + _handler.startTopicMap(); + _handler.startTopic(Ref.createSubjectLocator(subjLoc)); + _handler.endTopic(); + _handler.endTopicMap(); + assertEquals(1, _tm.getTopics().size()); + Topic topic = _tm.getTopicBySubjectLocator(_tm.createLocator(subjLoc)); + assertNotNull(topic); + } + + /** + * Tests transparent merging. + */ + public void testTopicMerging() throws Exception { + String ref = "http://sf.net/projects/tinytim/test#1"; + String itemIdent = "http://example.org/1"; + _handler.startTopicMap(); + _handler.startTopic(Ref.createSubjectIdentifier(ref)); + // Topic in topic event + _handler.startTopic(Ref.createItemIdentifier(itemIdent)); + _handler.itemIdentifier(ref); + _handler.endTopic(); + _handler.startOccurrence(); + _handler.value("tinyTiM", _XSD_STRING); + _handler.endOccurrence(); + _handler.endTopic(); + _handler.endTopicMap(); + assertEquals(1, _tm.getTopics().size()); + Topic topic = _tm.getTopicBySubjectIdentifier(_tm.createLocator(ref)); + assertNotNull(topic); + assertEquals(topic, _tm.getConstructByItemIdentifier(_tm.createLocator(ref))); + assertEquals(topic, _tm.getConstructByItemIdentifier(_tm.createLocator(itemIdent))); + assertEquals(1, topic.getOccurrences().size()); + Occurrence occ = (Occurrence) topic.getOccurrences().iterator().next(); + assertEquals("tinyTiM", occ.getValue()); + } + + /** + * Tests assigning identities to a topic. + */ + public void testTopicIdentities1() throws Exception { + String ref = "http://sf.net/projects/tinytim/test#1"; + _handler.startTopicMap(); + _handler.startTopic(Ref.createSubjectIdentifier(ref)); + _handler.itemIdentifier(ref); + _handler.endTopic(); + _handler.endTopicMap(); + assertEquals(1, _tm.getTopics().size()); + Locator loc = _tm.createLocator(ref); + Topic topic = _tm.getTopicBySubjectIdentifier(loc); + assertNotNull(topic); + assertEquals(topic, _tm.getConstructByItemIdentifier(loc)); + } + + /** + * Tests assigning identities to a topic. + */ + public void testTopicIdentities2() throws Exception { + String ref = "http://sf.net/projects/tinytim/test#1"; + _handler.startTopicMap(); + _handler.startTopic(Ref.createItemIdentifier(ref)); + _handler.subjectIdentifier(ref); + _handler.endTopic(); + _handler.endTopicMap(); + assertEquals(1, _tm.getTopics().size()); + Locator loc = _tm.createLocator(ref); + Topic topic = _tm.getTopicBySubjectIdentifier(loc); + assertNotNull(topic); + assertEquals(topic, _tm.getConstructByItemIdentifier(loc)); + } + + /** + * Tests reifying the topic map. + */ + public void testTopicMapReifier() throws Exception { + String ref = "http://sf.net/projects/tinytim/test#1"; + _handler.startTopicMap(); + _handler.startReifier(); + _handler.startTopic(Ref.createSubjectIdentifier(ref)); + _handler.endTopic(); + _handler.endReifier(); + _handler.endTopicMap(); + assertNotNull(_tm.getReifier()); + Topic topic = _tm.getTopicBySubjectIdentifier(_tm.createLocator(ref)); + assertNotNull(topic); + assertEquals(topic, _tm.getReifier()); + } + + /** + * Tests occurrence creation with a value of datatype xsd:string. + */ + public void testOccurrenceValueString() throws Exception { + String ref = "http://sf.net/projects/tinytim/test#1"; + String val = "tinyTiM"; + _handler.startTopicMap(); + _handler.startTopic(Ref.createSubjectIdentifier(ref)); + _handler.startOccurrence(); + _handler.value(val, _XSD_STRING); + _handler.endOccurrence(); + _handler.endTopic(); + _handler.endTopicMap(); + Topic topic = _tm.getTopicBySubjectIdentifier(_tm.createLocator(ref)); + assertNotNull(topic); + Occurrence occ = (Occurrence) topic.getOccurrences().iterator().next(); + assertEquals(val, occ.getValue()); + assertEquals(XSD.STRING, occ.getDatatype()); + } + + /** + * Tests occurrence creation with a value of datatype xsd:anyURI. + */ + public void testOccurrenceValueURI() throws Exception { + String ref = "http://sf.net/projects/tinytim/test#1"; + String val = "http://sf.net/projects/tinytim"; + _handler.startTopicMap(); + _handler.startTopic(Ref.createSubjectIdentifier(ref)); + _handler.startOccurrence(); + _handler.value(val, _XSD_ANY_URI); + _handler.endOccurrence(); + _handler.endTopic(); + _handler.endTopicMap(); + Topic topic = _tm.getTopicBySubjectIdentifier(_tm.createLocator(ref)); + assertNotNull(topic); + Occurrence occ = (Occurrence) topic.getOccurrences().iterator().next(); + assertEquals(val, occ.getValue()); + assertEquals(XSD.ANY_URI, occ.getDatatype()); + } + + /** + * Tests if the name type is automatically set. + */ + public void testDefaultNameType() throws Exception { + String ref = "http://sf.net/projects/tinytim/test#1"; + String val = "tinyTiM"; + _handler.startTopicMap(); + _handler.startTopic(Ref.createSubjectIdentifier(ref)); + _handler.startName(); + _handler.value(val); + _handler.endName(); + _handler.endTopic(); + _handler.endTopicMap(); + Topic topic = _tm.getTopicBySubjectIdentifier(_tm.createLocator(ref)); + assertNotNull(topic); + Name name = topic.getNames().iterator().next(); + assertEquals(val, name.getValue()); + assertNotNull(name.getType()); + assertTrue(name.getType().getSubjectIdentifiers().contains(TMDM.TOPIC_NAME)); + } + + /** + * Tests if a variant with no scope is reported as error. + */ + public void testVariantNoScopeError() throws Exception { + String ref = "http://sf.net/projects/tinytim/test#1"; + String val = "tinyTiM"; + _handler.startTopicMap(); + _handler.startTopic(Ref.createSubjectIdentifier(ref)); + _handler.startName(); + _handler.value(val); + _handler.startVariant(); + _handler.value(val, _XSD_STRING); + try { + _handler.endVariant(); + fail("A variant with no scope shouldn't be allowed"); + } + catch (MIOException ex) { + // noop. + } + } + + /** + * Tests if a variant with a scope equals to the parent's scope is rejected. + */ + public void testVariantNoScopeError2() throws Exception { + String ref = "http://sf.net/projects/tinytim/test#1"; + String theme = "http://sf.net/projects/tinytim/test#theme"; + String val = "tinyTiM"; + _handler.startTopicMap(); + _handler.startTopic(Ref.createSubjectIdentifier(ref)); + _handler.startName(); + _handler.startScope(); + _handler.startTheme(); + _handler.topicRef(Ref.createItemIdentifier(theme)); + _handler.endTheme(); + _handler.endScope(); + _handler.value(val); + + _handler.startVariant(); + _handler.value(val, _XSD_STRING); + _handler.startScope(); + _handler.startTheme(); + _handler.topicRef(Ref.createItemIdentifier(theme)); + _handler.endTheme(); + _handler.endScope(); + try { + _handler.endVariant(); + fail("A variant with a scope equals to the parent's scope shouldn't be allowed"); + } + catch (MIOException ex) { + // noop. + } + } + + /** + * Tests nested startTopic/endTopic events. + */ + public void testNestedTopics() throws Exception { + String base = "http://tinytim.sourceforge.net/test-nesting#"; + final int MAX = 10000; + String[] iids = new String[MAX]; + _handler.startTopicMap(); + for (int i=0; i<MAX; i++) { + iids[i] = base + i; + _handler.startTopic(Ref.createItemIdentifier(iids[i])); + } + for (int i=0; i<MAX; i++) { + _handler.endTopic(); + } + _handler.endTopicMap(); + for (String iid: iids) { + assertNotNull(_tm.getConstructByItemIdentifier(createLocator(iid))); + } + } + +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lh...@us...> - 2009-07-22 08:33:22
|
Revision: 318 http://tinytim.svn.sourceforge.net/tinytim/?rev=318&view=rev Author: lheuer Date: 2009-07-22 08:33:17 +0000 (Wed, 22 Jul 2009) Log Message: ----------- - Added MapHander test case to AllTests - MapHandler checks for invalid names / variants (no value) - Updated TMAPI tests Modified Paths: -------------- tinytim/trunk/lib/tmapi-2.0a2-tests.jar tinytim/trunk/src/main/java/org/tinytim/mio/TinyTimMapInputHandler.java tinytim/trunk/src/test/java/org/tinytim/core/AllTests.java tinytim/trunk/src/test/java/org/tinytim/mio/TestTinyTimMapInputHandler.java Modified: tinytim/trunk/lib/tmapi-2.0a2-tests.jar =================================================================== (Binary files differ) Modified: tinytim/trunk/src/main/java/org/tinytim/mio/TinyTimMapInputHandler.java =================================================================== --- tinytim/trunk/src/main/java/org/tinytim/mio/TinyTimMapInputHandler.java 2009-07-21 15:03:43 UTC (rev 317) +++ tinytim/trunk/src/main/java/org/tinytim/mio/TinyTimMapInputHandler.java 2009-07-22 08:33:17 UTC (rev 318) @@ -216,6 +216,9 @@ @Override public void endName() throws MIOException { IName name = (IName) _leaveStatePopConstruct(NAME); + if (name.getLiteral() == null) { + throw new MIOException("The name '" + name + "' has no value"); + } if (name.getType() == null) { name.setType(_tm.createTopicBySubjectIdentifier(TMDM.TOPIC_NAME)); } @@ -237,6 +240,9 @@ @Override public void endVariant() throws MIOException { IVariant variant = (IVariant) _leaveStatePopConstruct(VARIANT); + if (variant.getLiteral() == null) { + throw new MIOException("The variant '" + variant + "' has no value"); + } IName name = (IName) _peekConstruct(); IScope scope = variant.getScopeObject(); if (scope.isUnconstrained() || name.getScopeObject().equals(scope)) { @@ -604,8 +610,7 @@ private void _handleReifier(Reifiable reifiable, Topic reifier) throws MIOException { final Reifiable reified = reifier.getReified(); if (reified != null && !reifiable.equals(reified)) { - if (!_sameConstructKind((IConstruct) reifiable, (IConstruct) reified) - || !_areMergable((IConstruct) reifiable, (IConstruct) reified)) { + if (!_areMergable((IConstruct) reifiable, (IConstruct) reified)) { throw new MIOException("The topic " + reifier + " reifies another construct"); } // The construct reified by 'reifier' has the same parent as the @@ -619,6 +624,14 @@ } } + /** + * Returns if <tt>a</tt> and <tt>b</tt> represent the same information + * item (i.e. both are associations). + * + * @param a A Topic Maps construct. + * @param b A Topic Maps construct. + * @return <tt>true</tt> if they represent the same information item, otherwise <tt>false</tt>. + */ private boolean _sameConstructKind(IConstruct a, IConstruct b) { return a.isAssociation() && b.isAssociation() || a.isName() && b.isName() @@ -630,9 +643,10 @@ } private boolean _areMergable(IConstruct a, IConstruct b) { - return a.isRole() && b.isRole() - || (a.isVariant() && b.isVariant() && a.getParent().getParent().equals(b.getParent().getParent())) - || a.getParent().equals(b.getParent()); + return _sameConstructKind(a, b) + && (a.isRole() && b.isRole() + || (a.isVariant() && b.isVariant() && a.getParent().getParent().equals(b.getParent().getParent())) + || a.getParent().equals(b.getParent())); } /** Modified: tinytim/trunk/src/test/java/org/tinytim/core/AllTests.java =================================================================== --- tinytim/trunk/src/test/java/org/tinytim/core/AllTests.java 2009-07-21 15:03:43 UTC (rev 317) +++ tinytim/trunk/src/test/java/org/tinytim/core/AllTests.java 2009-07-22 08:33:17 UTC (rev 318) @@ -19,6 +19,7 @@ import org.tinytim.core.value.TestLiteralNormalizer; import org.tinytim.core.value.TestLocatorImpl; import org.tinytim.internal.utils.TestSignatureGenerator; +import org.tinytim.mio.TestTinyTimMapInputHandler; import org.tinytim.utils.TestDuplicateRemovalUtils; import org.tinytim.utils.TestTopicUtils; @@ -45,6 +46,7 @@ suite.addTestSuite(TestIConstructFactory.class); suite.addTestSuite(TestScope.class); suite.addTestSuite(TestLiteral.class); + suite.addTestSuite(TestTinyTimMapInputHandler.class); suite.addTestSuite(TestLiteralNormalizer.class); suite.addTestSuite(TestSignatureGenerator.class); suite.addTest(TestTMAPICore.suite()); Modified: tinytim/trunk/src/test/java/org/tinytim/mio/TestTinyTimMapInputHandler.java =================================================================== --- tinytim/trunk/src/test/java/org/tinytim/mio/TestTinyTimMapInputHandler.java 2009-07-21 15:03:43 UTC (rev 317) +++ tinytim/trunk/src/test/java/org/tinytim/mio/TestTinyTimMapInputHandler.java 2009-07-22 08:33:17 UTC (rev 318) @@ -51,6 +51,44 @@ _handler = new TinyTimMapInputHandler(_tm); } + public void testVariantNoValue() throws Exception { + final IRef theTopic = Ref.createItemIdentifier("http://test.semagia.com/the-topic"); + final IRef theme = Ref.createItemIdentifier("http://test.semagia.com/theme"); + TinyTimMapInputHandler handler = _handler; + handler.startTopicMap(); + handler.startTopic(theTopic); + handler.startName(); + handler.value("Semagia"); + handler.startVariant(); + handler.startScope(); + handler.startTheme(); + handler.topicRef(theme); + handler.endTheme(); + handler.endScope(); + try { + handler.endVariant(); + fail("Expected an error since the variant has no value"); + } + catch (MIOException ex) { + // noop. + } + } + + public void testNameNoValue() throws Exception { + final IRef theTopic = Ref.createItemIdentifier("http://test.semagia.com/the-topic"); + TinyTimMapInputHandler handler = _handler; + handler.startTopicMap(); + handler.startTopic(theTopic); + handler.startName(); + try { + handler.endName(); + fail("Expected an error since the name has no value"); + } + catch (MIOException ex) { + // noop. + } + } + /** * <a href="http://code.google.com/p/mappa/issues/detail?id=23">http://code.google.com/p/mappa/issues/detail?id=23</a> */ @@ -320,6 +358,7 @@ handler.startReifier(); handler.topicRef(reifier); handler.endReifier(); + handler.value("variant", _XSD_STRING); handler.itemIdentifier(variantIID); handler.startScope(); handler.startTheme(); @@ -335,6 +374,7 @@ handler.startReifier(); handler.topicRef(reifier); handler.endReifier(); + handler.value("variant", _XSD_STRING); handler.startScope(); handler.startTheme(); handler.topicRef(theme); @@ -369,6 +409,7 @@ handler.startReifier(); handler.topicRef(reifier); handler.endReifier(); + handler.value("variant", _XSD_STRING); handler.startScope(); handler.startTheme(); handler.topicRef(theme); @@ -383,6 +424,7 @@ handler.startReifier(); handler.topicRef(reifier); handler.endReifier(); + handler.value("variant", _XSD_STRING); handler.itemIdentifier(variantIID); handler.startScope(); handler.startTheme(); @@ -418,6 +460,7 @@ handler.startReifier(); handler.topicRef(reifier); handler.endReifier(); + handler.value("variant", _XSD_STRING); handler.startScope(); handler.startTheme(); handler.topicRef(theme); @@ -433,6 +476,7 @@ handler.startReifier(); handler.topicRef(reifier); handler.endReifier(); + handler.value("variant", _XSD_STRING); handler.itemIdentifier(variantIID); handler.startScope(); handler.startTheme(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lh...@us...> - 2009-07-23 12:26:39
|
Revision: 329 http://tinytim.svn.sourceforge.net/tinytim/?rev=329&view=rev Author: lheuer Date: 2009-07-23 12:26:38 +0000 (Thu, 23 Jul 2009) Log Message: ----------- Fixes #2824837 and the remaining problem with the VariantReifier3 test Modified Paths: -------------- tinytim/trunk/CHANGES.txt tinytim/trunk/src/main/java/org/tinytim/core/AssociationImpl.java tinytim/trunk/src/main/java/org/tinytim/mio/TinyTimMapInputHandler.java tinytim/trunk/src/test/java/org/tinytim/mio/TestTinyTimMapInputHandler.java Modified: tinytim/trunk/CHANGES.txt =================================================================== --- tinytim/trunk/CHANGES.txt 2009-07-23 12:21:03 UTC (rev 328) +++ tinytim/trunk/CHANGES.txt 2009-07-23 12:26:38 UTC (rev 329) @@ -9,11 +9,11 @@ Bugfixes: --------- -* Bug #2812460 -- Port the Check class from Ontopia back to - tinyTiM +* Bug #2812460 -- Port the Check class from Ontopia back to tinyTiM * Bug #2809821 -- Ensure same topic map constraint * Bug #2561306 -- Move TinyTimMapInputHandler to the core * Bug #2824834 -- Reifier at duplicate construct fails +* Bug #2824837 -- Same iid at a duplicate statement does not work 2.0.0 a4 (06.12.2008) Modified: tinytim/trunk/src/main/java/org/tinytim/core/AssociationImpl.java =================================================================== --- tinytim/trunk/src/main/java/org/tinytim/core/AssociationImpl.java 2009-07-23 12:21:03 UTC (rev 328) +++ tinytim/trunk/src/main/java/org/tinytim/core/AssociationImpl.java 2009-07-23 12:26:38 UTC (rev 329) @@ -19,13 +19,13 @@ import java.util.Set; import org.tinytim.internal.api.Event; +import org.tinytim.internal.api.IAssociation; import org.tinytim.internal.api.IConstant; import org.tinytim.internal.api.IScope; import org.tinytim.internal.api.ITopicMap; import org.tinytim.internal.utils.Check; import org.tinytim.internal.utils.CollectionFactory; -import org.tmapi.core.Association; import org.tmapi.core.Role; import org.tmapi.core.Topic; import org.tmapi.core.TopicMap; @@ -36,7 +36,7 @@ * @author Lars Heuer (heuer[at]semagia.com) <a href="http://www.semagia.com/">Semagia</a> * @version $Rev$ - $Date$ */ -final class AssociationImpl extends ScopedImpl implements Association { +final class AssociationImpl extends ScopedImpl implements IAssociation { private Set<Role> _roles; Modified: tinytim/trunk/src/main/java/org/tinytim/mio/TinyTimMapInputHandler.java =================================================================== --- tinytim/trunk/src/main/java/org/tinytim/mio/TinyTimMapInputHandler.java 2009-07-23 12:21:03 UTC (rev 328) +++ tinytim/trunk/src/main/java/org/tinytim/mio/TinyTimMapInputHandler.java 2009-07-23 12:26:38 UTC (rev 329) @@ -17,9 +17,11 @@ import java.util.List; import java.util.Map; +import java.util.Set; import org.tinytim.core.Scope; import org.tinytim.core.value.Literal; +import org.tinytim.internal.api.IAssociation; import org.tinytim.internal.api.IConstruct; import org.tinytim.internal.api.IConstructFactory; import org.tinytim.internal.api.ILiteralAware; @@ -35,15 +37,14 @@ import org.tinytim.utils.TypeInstanceConverter; import org.tinytim.voc.TMDM; -import org.tmapi.core.Association; import org.tmapi.core.Construct; import org.tmapi.core.Locator; import org.tmapi.core.Reifiable; import org.tmapi.core.Role; -import org.tmapi.core.Scoped; import org.tmapi.core.Topic; import org.tmapi.core.TopicMap; import org.tmapi.core.Typed; +import org.tmapi.core.Variant; import com.semagia.mio.IMapHandler; import com.semagia.mio.IRef; @@ -76,11 +77,13 @@ private static final int _STATE_SIZE = 10; private static final int _SCOPE_SIZE = 6; private static final int _DELAYED_REIFICATION_SIZE = 2; + private static final int _DELAYED_ITEM_IDENTIFIER_SIZE = 2; private final IConstructFactory _factory; private final ITopicMap _tm; private final List<Topic> _scope; - private final Map<Reifiable, Topic> _delayedReification; + private final Map<Reifiable, ITopic> _delayedReification; + private final Map<IConstruct, Set<Locator>> _delayedItemIdentifiers; private byte[] _stateStack; private int _stateSize; private IConstruct[] _constructStack; @@ -94,6 +97,7 @@ _factory = _tm.getConstructFactory(); _scope = CollectionFactory.createList(_SCOPE_SIZE); _delayedReification = CollectionFactory.createIdentityMap(_DELAYED_REIFICATION_SIZE); + _delayedItemIdentifiers = CollectionFactory.createIdentityMap(_DELAYED_ITEM_IDENTIFIER_SIZE); } /* (non-Javadoc) @@ -114,6 +118,12 @@ @Override public void endTopicMap() throws MIOException { TypeInstanceConverter.convertAssociationsToTypes(_tm); + if (!_delayedReification.isEmpty()) { + throw new MIOException("ERROR: Unhandled reifications"); + } + if (!_delayedItemIdentifiers.isEmpty()) { + throw new MIOException("ERROR: Unhandled item identifiers"); + } _constructStack = null; _stateStack = null; _scope.clear(); @@ -148,7 +158,7 @@ */ @Override public void endAssociation() throws MIOException { - _leaveStatePopReifiable(ASSOCIATION); + _handleDelayedEvents(_leaveStatePopConstruct(ASSOCIATION)); } /* (non-Javadoc) @@ -157,7 +167,7 @@ @Override public void startRole() throws MIOException { assert _state() == ASSOCIATION; - _enterState(ROLE, _factory.createRole((Association) _peekConstruct())); + _enterState(ROLE, _factory.createRole((IAssociation) _peekConstruct())); } /* (non-Javadoc) @@ -199,7 +209,7 @@ */ @Override public void endOccurrence() throws MIOException { - _leaveStatePopReifiable(OCCURRENCE); + _handleDelayedEvents(_leaveStatePopConstruct(OCCURRENCE)); } /* (non-Javadoc) @@ -222,7 +232,7 @@ if (name.getType() == null) { name.setType(_tm.createTopicBySubjectIdentifier(TMDM.TOPIC_NAME)); } - _handleDelayedReifier(name); + _handleDelayedEvents(name); } /* (non-Javadoc) @@ -273,7 +283,7 @@ */ @Override public void startScope() throws MIOException { - assert _peekConstruct() instanceof Scoped; + assert _peekConstruct() instanceof IScoped; _enterState(SCOPE); } @@ -346,8 +356,8 @@ public void itemIdentifier(String itemIdentifier) throws MIOException { Locator iid = _tm.createLocator(itemIdentifier); IConstruct tmo = _peekConstruct(); + IConstruct existing = (IConstruct) _tm.getConstructByItemIdentifier(iid); if (_state() == TOPIC) { - IConstruct existing = (IConstruct) _tm.getConstructByItemIdentifier(iid); if (existing != null && existing.isTopic() && !existing.equals(tmo)) { _merge((Topic) existing, (ITopic) tmo); } @@ -357,8 +367,24 @@ _merge(topic, (ITopic) tmo); } } + tmo.addItemIdentifier(iid); } - tmo.addItemIdentifier(iid); + else if (existing != null && !existing.equals(tmo)) { + if (!_areMergable(tmo, existing)) { + throw new MIOException("A Topic Maps construct with the item identifier '" + itemIdentifier + "' exists already"); + } + else { + Set<Locator> iids = _delayedItemIdentifiers.get(tmo); + if (iids == null) { + iids = CollectionFactory.createIdentitySet(); + } + iids.add(iid); + _delayedItemIdentifiers.put(tmo, iids); + } + } + else { + tmo.addItemIdentifier(iid); + } } /* (non-Javadoc) @@ -481,10 +507,6 @@ return construct; } - private Reifiable _leaveStatePopReifiable(byte state) throws MIOException { - return _handleDelayedReifier((Reifiable) _leaveStatePopConstruct(state)); - } - /** * Returns the Topic Maps construct on top of the stack. * @@ -495,75 +517,88 @@ } /** - * + * Issues the delayed item identifier and reifier events. * - * @param reifiable - * @return - * @throws MIOException + * @param construct */ - private Reifiable _handleDelayedReifier(final Reifiable reifiable) throws MIOException { - Topic reifier = _delayedReification.remove(reifiable); - final IConstruct c = (IConstruct) reifiable; - if (reifier != null) { - return _handleDelayedReifier(reifiable, reifier); + private void _handleDelayedEvents(IConstruct tmc) throws MIOException { + IConstruct existing = _processDelayedEvents(tmc); + if (tmc.isAssociation()) { + IAssociation existingAssoc = (IAssociation) existing; + IConstruct existingRole = null; + for (Role role: ((IAssociation) tmc).getRoles()) { + existingRole = _processDelayedEvents((IConstruct) role); + if (existingRole != null && existingAssoc == null) { + existingAssoc = (IAssociation) existingRole.getParent(); + } + } + if (existingAssoc != null && !existingAssoc.equals(tmc)) { + MergeUtils.moveRoleCharacteristics((IAssociation) tmc, existingAssoc); + existing = existingAssoc; + } } - List<? extends Reifiable> reifiables = null; - if (c.isAssociation()) { - reifiables = CollectionFactory.createList(((Association) c).getRoles()); + else if (tmc.isName()) { + IName existingName = (IName) existing; + IConstruct existingVariant = null; + for (Variant role: ((IName) tmc).getVariants()) { + existingVariant = _processDelayedEvents((IConstruct) role); + if (existingVariant != null && existingName == null) { + existingName = (IName) existingVariant.getParent(); + } + } + if (existingName != null && !existingName.equals(tmc)) { + MergeUtils.moveVariants((IName) tmc, existingName); + existing = existingName; + } } - else if (c.isName()) { - reifiables = CollectionFactory.createList(((IName) c).getVariants()); + if (existing != null && !existing.equals(tmc)) { + tmc.remove(); } - if (reifiables == null || _delayedReification.isEmpty()) { - return reifiable; + } + + private IConstruct _processDelayedEvents(IConstruct tmc) throws MIOException { + IConstruct existing = null; + Set<Locator> iids = _delayedItemIdentifiers.remove(tmc); + Topic reifier = _delayedReification.remove(tmc); + final int signature = SignatureGenerator.generateSignature(tmc); + if (iids != null) { + existing = _handleItemIdentifiers(signature, tmc, iids); } - boolean foundReifier = false; - final int parentSignature = SignatureGenerator.generateSignature(c); - for (Reifiable r: reifiables) { - reifier = _delayedReification.remove(r); - if (reifier == null) { - continue; - } - if (parentSignature == SignatureGenerator.generateSignature((IConstruct) reifier.getReified().getParent())) { - _handleDelayedReifier(r, reifier); - foundReifier = !c.equals(reifier.getReified().getParent()); - } - else { - throw new MIOException("The topic '" + reifier + "' reifies another construct"); - } + if (reifier != null) { + existing = _handleReification(signature, tmc, reifier); } - if (foundReifier) { - c.remove(); + return existing; + } + + private IConstruct _handleReification(int signature, IConstruct tmc, + Topic reifier) throws MIOException { + final IConstruct existing = (IConstruct) reifier.getReified(); + final boolean checkParent = tmc.isRole() || tmc.isVariant(); + final int parentSignature = checkParent ? SignatureGenerator.generateSignature((IConstruct)tmc.getParent()) + : -1; + if (signature != SignatureGenerator.generateSignature(existing) + || (checkParent && parentSignature != SignatureGenerator.generateSignature((IConstruct) existing.getParent()))) { + throw new MIOException("The topic '" + reifier + "' reifies another construct"); } - return reifiable; + MergeUtils.moveItemIdentifiers(tmc, existing); + return existing; } - /** - * - * - * @param reifiable - * @param reifier - * @return - * @throws MIOException - */ - private Reifiable _handleDelayedReifier(final Reifiable reifiable, final Topic reifier) throws MIOException { - IConstruct c = (IConstruct) reifiable; - IConstruct reified = (IConstruct) reifier.getReified(); - if (SignatureGenerator.generateSignature(c) == - SignatureGenerator.generateSignature(reified)) { - MergeUtils.moveItemIdentifiers(reifiable, reifier.getReified()); - if (c.isAssociation()) { - MergeUtils.moveRoleCharacteristics((Association) c, (Association) reifier.getReified()); + private IConstruct _handleItemIdentifiers(int signature, IConstruct tmc, + Set<Locator> iids) throws MIOException { + IConstruct existing = null; + final boolean checkParent = tmc.isRole() || tmc.isVariant(); + final int parentSignature = checkParent ? SignatureGenerator.generateSignature((IConstruct)tmc.getParent()) + : -1; + for (Locator iid: iids) { + existing = (IConstruct) _tm.getConstructByItemIdentifier(iid); + if (signature != SignatureGenerator.generateSignature(existing) + || (checkParent && parentSignature != SignatureGenerator.generateSignature((IConstruct) existing.getParent()))) { + throw new MIOException("The item identifier '" + iid + "' is already assigned"); } - else if (c.isName()) { - MergeUtils.moveVariants((IName)c, (IName) reified); - } - reifiable.remove(); - return reifier.getReified(); + MergeUtils.moveItemIdentifiers(tmc, existing); } - else { - throw new MIOException("The topic " + reifier + " reifies another construct"); - } + return existing; } /** @@ -596,7 +631,7 @@ case TYPE: ((Typed) _peekConstruct()).setType(topic); break; case PLAYER: ((Role) _peekConstruct()).setPlayer(topic); break; case THEME: _scope.add(topic); break; - case REIFIER: _handleReifier((Reifiable) _peekConstruct(), topic); break; + case REIFIER: _handleReifier((Reifiable) _peekConstruct(), (ITopic) topic); break; } } @@ -607,7 +642,7 @@ * @param reifier * @throws MIOException */ - private void _handleReifier(Reifiable reifiable, Topic reifier) throws MIOException { + private void _handleReifier(Reifiable reifiable, ITopic reifier) throws MIOException { final Reifiable reified = reifier.getReified(); if (reified != null && !reifiable.equals(reified)) { if (!_areMergable((IConstruct) reifiable, (IConstruct) reified)) { @@ -644,8 +679,8 @@ private boolean _areMergable(IConstruct a, IConstruct b) { return _sameConstructKind(a, b) - && (a.isRole() && b.isRole() - || (a.isVariant() && b.isVariant() && a.getParent().getParent().equals(b.getParent().getParent())) + && (a.isRole() + || (a.isVariant() && a.getParent().getParent().equals(b.getParent().getParent())) || a.getParent().equals(b.getParent())); } Modified: tinytim/trunk/src/test/java/org/tinytim/mio/TestTinyTimMapInputHandler.java =================================================================== --- tinytim/trunk/src/test/java/org/tinytim/mio/TestTinyTimMapInputHandler.java 2009-07-23 12:21:03 UTC (rev 328) +++ tinytim/trunk/src/test/java/org/tinytim/mio/TestTinyTimMapInputHandler.java 2009-07-23 12:26:38 UTC (rev 329) @@ -51,74 +51,74 @@ _handler = new TinyTimMapInputHandler(_tm); } -// public void testVariantNoValue() throws Exception { -// final IRef theTopic = Ref.createItemIdentifier("http://test.semagia.com/the-topic"); -// final IRef theme = Ref.createItemIdentifier("http://test.semagia.com/theme"); -// TinyTimMapInputHandler handler = _handler; -// handler.startTopicMap(); -// handler.startTopic(theTopic); -// handler.startName(); -// handler.value("Semagia"); -// handler.startVariant(); -// handler.startScope(); -// handler.startTheme(); -// handler.topicRef(theme); -// handler.endTheme(); -// handler.endScope(); -// try { -// handler.endVariant(); -// fail("Expected an error since the variant has no value"); -// } -// catch (MIOException ex) { -// // noop. -// } -// } -// -// public void testNameNoValue() throws Exception { -// final IRef theTopic = Ref.createItemIdentifier("http://test.semagia.com/the-topic"); -// TinyTimMapInputHandler handler = _handler; -// handler.startTopicMap(); -// handler.startTopic(theTopic); -// handler.startName(); -// try { -// handler.endName(); -// fail("Expected an error since the name has no value"); -// } -// catch (MIOException ex) { -// // noop. -// } -// } -// -// /** -// * <a href="http://code.google.com/p/mappa/issues/detail?id=23">http://code.google.com/p/mappa/issues/detail?id=23</a> -// */ -// public void testMappaIssue23() throws Exception { -// String iid = "http://mappa.semagia.com/issue-23"; -// String iid2 = "http://mappa.semagia.com/issue-23_"; -// final IRef TOPIC_NAME = Ref.createSubjectIdentifier(TMDM.TOPIC_NAME.getReference()); -// TinyTimMapInputHandler handler = _handler; -// handler.startTopicMap(); -// handler.startTopic(Ref.createItemIdentifier(iid)); -// handler.startName(); -// handler.value("test"); -// handler.startType(); -// handler.topicRef(TOPIC_NAME); -// handler.endType(); -// handler.endName(); -// handler.endTopic(); -// handler.startTopic(Ref.createItemIdentifier(iid2)); -// handler.startName(); -// handler.value("a test"); -// handler.startType(); -// handler.topicRef(TOPIC_NAME); -// handler.endType(); -// handler.endName(); -// handler.subjectIdentifier(TOPIC_NAME.getIRI()); -// handler.endTopic(); -// handler.endTopicMap(); -// } + public void testVariantNoValue() throws Exception { + final IRef theTopic = Ref.createItemIdentifier("http://test.semagia.com/the-topic"); + final IRef theme = Ref.createItemIdentifier("http://test.semagia.com/theme"); + TinyTimMapInputHandler handler = _handler; + handler.startTopicMap(); + handler.startTopic(theTopic); + handler.startName(); + handler.value("Semagia"); + handler.startVariant(); + handler.startScope(); + handler.startTheme(); + handler.topicRef(theme); + handler.endTheme(); + handler.endScope(); + try { + handler.endVariant(); + fail("Expected an error since the variant has no value"); + } + catch (MIOException ex) { + // noop. + } + } + public void testNameNoValue() throws Exception { + final IRef theTopic = Ref.createItemIdentifier("http://test.semagia.com/the-topic"); + TinyTimMapInputHandler handler = _handler; + handler.startTopicMap(); + handler.startTopic(theTopic); + handler.startName(); + try { + handler.endName(); + fail("Expected an error since the name has no value"); + } + catch (MIOException ex) { + // noop. + } + } + /** + * <a href="http://code.google.com/p/mappa/issues/detail?id=23">http://code.google.com/p/mappa/issues/detail?id=23</a> + */ + public void testMappaIssue23() throws Exception { + String iid = "http://mappa.semagia.com/issue-23"; + String iid2 = "http://mappa.semagia.com/issue-23_"; + final IRef TOPIC_NAME = Ref.createSubjectIdentifier(TMDM.TOPIC_NAME.getReference()); + TinyTimMapInputHandler handler = _handler; + handler.startTopicMap(); + handler.startTopic(Ref.createItemIdentifier(iid)); + handler.startName(); + handler.value("test"); + handler.startType(); + handler.topicRef(TOPIC_NAME); + handler.endType(); + handler.endName(); + handler.endTopic(); + handler.startTopic(Ref.createItemIdentifier(iid2)); + handler.startName(); + handler.value("a test"); + handler.startType(); + handler.topicRef(TOPIC_NAME); + handler.endType(); + handler.endName(); + handler.subjectIdentifier(TOPIC_NAME.getIRI()); + handler.endTopic(); + handler.endTopicMap(); + } + + /** * <a href="http://code.google.com/p/ontopia/issues/detail?id=84">http://code.google.com/p/ontopia/issues/detail?id=84</a> * <a href="http://code.google.com/p/ontopia/issues/detail?id=77">http://code.google.com/p/ontopia/issues/detail?id=77</a> */ @@ -494,6 +494,50 @@ } } + public void testSameIIDIssueAssociation() throws Exception { + TinyTimMapInputHandler handler = _handler; + final IRef assocType = Ref.createItemIdentifier("http://test.semagia.com/assoc-type"); + final IRef roleType = Ref.createItemIdentifier("http://test.semagia.com/role-type"); + final IRef rolePlayer = Ref.createItemIdentifier("http://test.semagia.com/role-player"); + final String iid = "http://test.semagia.com/iid"; + handler.startTopicMap(); + handler.startAssociation(); + handler.itemIdentifier(iid); + handler.startType(); + handler.topicRef(assocType); + handler.endType(); + handler.startRole(); + handler.startType(); + handler.topicRef(roleType); + handler.endType(); + handler.startPlayer(); + handler.topicRef(rolePlayer); + handler.endPlayer(); + handler.endRole(); + handler.endAssociation(); + + handler.startAssociation(); + handler.itemIdentifier(iid); + handler.startType(); + handler.topicRef(assocType); + handler.endType(); + handler.startRole(); + handler.startType(); + handler.topicRef(roleType); + handler.endType(); + handler.startPlayer(); + handler.topicRef(rolePlayer); + handler.endPlayer(); + handler.endRole(); + handler.endAssociation(); + handler.endTopicMap(); + assertEquals(1, _tm.getAssociations().size()); + final Association assoc = _tm.getAssociations().iterator().next(); + final Construct tmc = _tm.getConstructByItemIdentifier(createLocator(iid)); + assertNotNull(tmc); + assertEquals(assoc, tmc); + } + /** * Simple startTopicMap, followed by an endTopicMap event. */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lh...@us...> - 2009-07-23 16:45:59
|
Revision: 331 http://tinytim.svn.sourceforge.net/tinytim/?rev=331&view=rev Author: lheuer Date: 2009-07-23 16:45:58 +0000 (Thu, 23 Jul 2009) Log Message: ----------- Preparing release Modified Paths: -------------- tinytim/trunk/CHANGES.txt tinytim/trunk/README.txt tinytim/trunk/build.properties Modified: tinytim/trunk/CHANGES.txt =================================================================== --- tinytim/trunk/CHANGES.txt 2009-07-23 16:41:16 UTC (rev 330) +++ tinytim/trunk/CHANGES.txt 2009-07-23 16:45:58 UTC (rev 331) @@ -2,9 +2,10 @@ Changes Log =========== -2.0.0 a5 (xx.yy.2009) +2.0.0 a5 (23.07.2009) --------------------- +* Updated to TMAPI 2.0a2 * Updated TMCL constants (implemented by Hannes Niederhausen) Bugfixes: @@ -16,6 +17,7 @@ * Bug #2824837 -- Same iid at a duplicate statement does not work + 2.0.0 a4 (06.12.2008) --------------------- Modified: tinytim/trunk/README.txt =================================================================== --- tinytim/trunk/README.txt 2009-07-23 16:41:16 UTC (rev 330) +++ tinytim/trunk/README.txt 2009-07-23 16:45:58 UTC (rev 331) @@ -11,8 +11,8 @@ Installation ------------ -No real installation needed, simply put the ``tinytim-2.0.0a4.jar`` and -``tmapi-2.0a1.jar`` into your classpath. That's all. :) +No real installation needed, simply put the ``tinytim-2.0.0a5.jar`` and +``tmapi-2.0a2.jar`` into your classpath. That's all. :) Optionally, you can put the ``trove-<VERSION>.jar`` into your classpath which makes tinyTiM slightly more memory efficient and faster. Modified: tinytim/trunk/build.properties =================================================================== --- tinytim/trunk/build.properties 2009-07-23 16:41:16 UTC (rev 330) +++ tinytim/trunk/build.properties 2009-07-23 16:45:58 UTC (rev 331) @@ -1,5 +1,5 @@ version=2.0.0 version_suffix=a5 -#release_type= +release_type= debug=off optimize=on This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lh...@us...> - 2009-07-23 16:49:55
|
Revision: 333 http://tinytim.svn.sourceforge.net/tinytim/?rev=333&view=rev Author: lheuer Date: 2009-07-23 16:49:53 +0000 (Thu, 23 Jul 2009) Log Message: ----------- trunk represents 2.0.0a6 now Modified Paths: -------------- tinytim/trunk/CHANGES.txt tinytim/trunk/README.txt tinytim/trunk/build.properties Modified: tinytim/trunk/CHANGES.txt =================================================================== --- tinytim/trunk/CHANGES.txt 2009-07-23 16:47:14 UTC (rev 332) +++ tinytim/trunk/CHANGES.txt 2009-07-23 16:49:53 UTC (rev 333) @@ -2,6 +2,12 @@ Changes Log =========== +2.0.0 a6 (xx.yy.2009) +--------------------- + + + + 2.0.0 a5 (23.07.2009) --------------------- Modified: tinytim/trunk/README.txt =================================================================== --- tinytim/trunk/README.txt 2009-07-23 16:47:14 UTC (rev 332) +++ tinytim/trunk/README.txt 2009-07-23 16:49:53 UTC (rev 333) @@ -11,7 +11,7 @@ Installation ------------ -No real installation needed, simply put the ``tinytim-2.0.0a5.jar`` and +No real installation needed, simply put the ``tinytim-2.0.0a6.jar`` and ``tmapi-2.0a2.jar`` into your classpath. That's all. :) Optionally, you can put the ``trove-<VERSION>.jar`` into your classpath which makes tinyTiM slightly more memory efficient and faster. Modified: tinytim/trunk/build.properties =================================================================== --- tinytim/trunk/build.properties 2009-07-23 16:47:14 UTC (rev 332) +++ tinytim/trunk/build.properties 2009-07-23 16:49:53 UTC (rev 333) @@ -1,5 +1,5 @@ version=2.0.0 -version_suffix=a5 -release_type= +version_suffix=a6 +#release_type= debug=off optimize=on This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bo...@us...> - 2009-07-28 10:00:43
|
Revision: 339 http://tinytim.svn.sourceforge.net/tinytim/?rev=339&view=rev Author: bosso Date: 2009-07-28 10:00:29 +0000 (Tue, 28 Jul 2009) Log Message: ----------- * added build to svn:ignore * minor changes regarding java6 warnings (seen in eclipse) Modified Paths: -------------- tinytim/trunk/src/main/java/org/tinytim/core/TopicMapSystemFactoryImpl.java tinytim/trunk/src/main/java/org/tinytim/index/TypeInstanceIndexImpl.java Property Changed: ---------------- tinytim/trunk/ Property changes on: tinytim/trunk ___________________________________________________________________ Added: svn:ignore + .project .settings build .classpath Modified: tinytim/trunk/src/main/java/org/tinytim/core/TopicMapSystemFactoryImpl.java =================================================================== --- tinytim/trunk/src/main/java/org/tinytim/core/TopicMapSystemFactoryImpl.java 2009-07-23 20:45:41 UTC (rev 338) +++ tinytim/trunk/src/main/java/org/tinytim/core/TopicMapSystemFactoryImpl.java 2009-07-28 10:00:29 UTC (rev 339) @@ -158,7 +158,7 @@ public void setProperty(final String propertyName, Object value) { if (value != null) { if (Property.TMSHARE.equals(propertyName)) { - if (!(value instanceof Set)) { + if (!(value instanceof Set<?>)) { value = Collections.singleton(value); } } Modified: tinytim/trunk/src/main/java/org/tinytim/index/TypeInstanceIndexImpl.java =================================================================== --- tinytim/trunk/src/main/java/org/tinytim/index/TypeInstanceIndexImpl.java 2009-07-23 20:45:41 UTC (rev 338) +++ tinytim/trunk/src/main/java/org/tinytim/index/TypeInstanceIndexImpl.java 2009-07-28 10:00:29 UTC (rev 339) @@ -333,7 +333,6 @@ } private final class AddTypedHandler extends _EvtHandler { - @SuppressWarnings("unchecked") public void handleEvent(Event evt, IConstruct sender, Object oldValue, Object newValue) { Typed typed = (Typed) newValue; @@ -343,7 +342,6 @@ } private final class RemoveTypedHandler extends _EvtHandler { - @SuppressWarnings("unchecked") public void handleEvent(Event evt, IConstruct sender, Object oldValue, Object newValue) { Typed typed = (Typed) oldValue; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lh...@us...> - 2009-08-27 13:08:42
|
Revision: 356 http://tinytim.svn.sourceforge.net/tinytim/?rev=356&view=rev Author: lheuer Date: 2009-08-27 13:08:17 +0000 (Thu, 27 Aug 2009) Log Message: ----------- - New TinyTimMapInputHandler based upon the mio.HamsterHandler - Removed ConstructFactory - Added @Override annotation (requires Java 6) Modified Paths: -------------- tinytim/trunk/build.xml tinytim/trunk/src/main/java/org/tinytim/core/AssociationImpl.java tinytim/trunk/src/main/java/org/tinytim/core/ConstructImpl.java tinytim/trunk/src/main/java/org/tinytim/core/DatatypeAwareConstruct.java tinytim/trunk/src/main/java/org/tinytim/core/IdGenerator.java tinytim/trunk/src/main/java/org/tinytim/core/MemoryTopicMap.java tinytim/trunk/src/main/java/org/tinytim/core/MemoryTopicMapSystem.java tinytim/trunk/src/main/java/org/tinytim/core/NameImpl.java tinytim/trunk/src/main/java/org/tinytim/core/OccurrenceImpl.java tinytim/trunk/src/main/java/org/tinytim/core/RoleImpl.java tinytim/trunk/src/main/java/org/tinytim/core/Scope.java tinytim/trunk/src/main/java/org/tinytim/core/ScopedImpl.java tinytim/trunk/src/main/java/org/tinytim/core/TopicImpl.java tinytim/trunk/src/main/java/org/tinytim/core/TypedImpl.java tinytim/trunk/src/main/java/org/tinytim/core/VariantImpl.java tinytim/trunk/src/main/java/org/tinytim/internal/api/IAssociation.java tinytim/trunk/src/main/java/org/tinytim/internal/api/IName.java tinytim/trunk/src/main/java/org/tinytim/internal/api/ITopic.java tinytim/trunk/src/main/java/org/tinytim/internal/api/ITopicMap.java tinytim/trunk/src/main/java/org/tinytim/internal/api/IVariant.java tinytim/trunk/src/main/java/org/tinytim/internal/utils/Check.java tinytim/trunk/src/main/java/org/tinytim/internal/utils/CopyUtils.java tinytim/trunk/src/main/java/org/tinytim/internal/utils/MergeUtils.java tinytim/trunk/src/main/java/org/tinytim/mio/TinyTimMapInputHandler.java tinytim/trunk/src/test/java/org/tinytim/core/AllTests.java Added Paths: ----------- tinytim/trunk/lib/semagia-mio-0.9.5.jar tinytim/trunk/src/main/java/org/tinytim/internal/api/IRole.java Removed Paths: ------------- tinytim/trunk/lib/semagia-mio-0.9.4.jar tinytim/trunk/src/main/java/org/tinytim/core/MemoryConstructFactory.java tinytim/trunk/src/main/java/org/tinytim/internal/api/IConstructFactory.java tinytim/trunk/src/test/java/org/tinytim/core/TestIConstructFactory.java tinytim/trunk/src/test/java/org/tinytim/mio/TestTinyTimMapInputHandler.java Modified: tinytim/trunk/build.xml =================================================================== --- tinytim/trunk/build.xml 2009-08-18 12:54:43 UTC (rev 355) +++ tinytim/trunk/build.xml 2009-08-27 13:08:17 UTC (rev 356) @@ -12,7 +12,7 @@ <property name="lib.junit" value="${dir.lib}/junit-4.5.jar"/> <property name="lib.trove" value="${dir.lib}/trove-2.0.4.jar"/> - <property name="lib.mio" value="${dir.lib}/semagia-mio-0.9.4.jar"/> + <property name="lib.mio" value="${dir.lib}/semagia-mio-0.9.5.jar"/> <property name="lib.tmapi" value="${dir.lib}/tmapi-2.0a2.jar"/> <property name="lib.tmapi.tests" value="${dir.lib}/tmapi-2.0a2-tests.jar"/> <property name="lib.emma" value="${dir.lib}/emma.jar"/> Deleted: tinytim/trunk/lib/semagia-mio-0.9.4.jar =================================================================== (Binary files differ) Added: tinytim/trunk/lib/semagia-mio-0.9.5.jar =================================================================== (Binary files differ) Property changes on: tinytim/trunk/lib/semagia-mio-0.9.5.jar ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Modified: tinytim/trunk/src/main/java/org/tinytim/core/AssociationImpl.java =================================================================== --- tinytim/trunk/src/main/java/org/tinytim/core/AssociationImpl.java 2009-08-18 12:54:43 UTC (rev 355) +++ tinytim/trunk/src/main/java/org/tinytim/core/AssociationImpl.java 2009-08-27 13:08:17 UTC (rev 356) @@ -40,11 +40,6 @@ private Set<Role> _roles; - AssociationImpl(ITopicMap tm) { - super(tm); - _roles = CollectionFactory.createIdentitySet(IConstant.ASSOC_ROLE_SIZE); - } - AssociationImpl(ITopicMap topicMap, Topic type, IScope scope) { super(topicMap, type, scope); _roles = CollectionFactory.createIdentitySet(IConstant.ASSOC_ROLE_SIZE); @@ -58,6 +53,16 @@ return _tm; } + void attachRole(RoleImpl role) { + role._parent = this; + _roles.add(role); + } + + void detachRole(RoleImpl role) { + role._parent = null; + _roles.remove(role); + } + /** * Adds a role to this association. * Modified: tinytim/trunk/src/main/java/org/tinytim/core/ConstructImpl.java =================================================================== --- tinytim/trunk/src/main/java/org/tinytim/core/ConstructImpl.java 2009-08-18 12:54:43 UTC (rev 355) +++ tinytim/trunk/src/main/java/org/tinytim/core/ConstructImpl.java 2009-08-27 13:08:17 UTC (rev 356) @@ -208,4 +208,5 @@ sb.append("]"); return sb.toString(); } + } Modified: tinytim/trunk/src/main/java/org/tinytim/core/DatatypeAwareConstruct.java =================================================================== --- tinytim/trunk/src/main/java/org/tinytim/core/DatatypeAwareConstruct.java 2009-08-18 12:54:43 UTC (rev 355) +++ tinytim/trunk/src/main/java/org/tinytim/core/DatatypeAwareConstruct.java 2009-08-27 13:08:17 UTC (rev 356) @@ -42,10 +42,6 @@ private ILiteral _literal; - protected DatatypeAwareConstruct(ITopicMap tm) { - super(tm); - } - protected DatatypeAwareConstruct(ITopicMap topicMap, Topic type, ILiteral literal, IScope scope) { super(topicMap, type, scope); _literal = literal; Modified: tinytim/trunk/src/main/java/org/tinytim/core/IdGenerator.java =================================================================== --- tinytim/trunk/src/main/java/org/tinytim/core/IdGenerator.java 2009-08-18 12:54:43 UTC (rev 355) +++ tinytim/trunk/src/main/java/org/tinytim/core/IdGenerator.java 2009-08-27 13:08:17 UTC (rev 356) @@ -38,4 +38,5 @@ public static long nextId() { return _COUNTER.getAndIncrement(); } + } Deleted: tinytim/trunk/src/main/java/org/tinytim/core/MemoryConstructFactory.java =================================================================== --- tinytim/trunk/src/main/java/org/tinytim/core/MemoryConstructFactory.java 2009-08-18 12:54:43 UTC (rev 355) +++ tinytim/trunk/src/main/java/org/tinytim/core/MemoryConstructFactory.java 2009-08-27 13:08:17 UTC (rev 356) @@ -1,99 +0,0 @@ -/* - * Copyright 2008 Lars Heuer (heuer[at]semagia.com) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.tinytim.core; - -import org.tinytim.internal.api.IConstructFactory; -import org.tinytim.internal.api.IName; -import org.tinytim.internal.api.IOccurrence; -import org.tinytim.internal.api.ITopic; -import org.tinytim.internal.api.IVariant; - -import org.tmapi.core.Association; -import org.tmapi.core.Role; -import org.tmapi.core.Topic; - -/** - * - * - * @author Lars Heuer (heuer[at]semagia.com) <a href="http://www.semagia.com/">Semagia</a> - * @version $Rev$ - $Date$ - */ -final class MemoryConstructFactory implements IConstructFactory { - - private final MemoryTopicMap _tm; - - public MemoryConstructFactory(MemoryTopicMap tm) { - _tm = tm; - } - - /* (non-Javadoc) - * @see org.tinytim.internal.api.IConstructFactory#createTopic() - */ - public ITopic createTopic() { - TopicImpl topic = new TopicImpl(_tm); - _tm.addTopic(topic); - return topic; - } - - /* (non-Javadoc) - * @see org.tinytim.internal.api.IConstructFactory#createAssociation() - */ - public Association createAssociation() { - AssociationImpl assoc = new AssociationImpl(_tm); - _tm.addAssociation(assoc); - return assoc; - } - - /* (non-Javadoc) - * @see org.tinytim.internal.api.IConstructFactory#createName(org.tinytim.internal.api.ITopic) - */ - public IName createName(ITopic parent) { - NameImpl name = new NameImpl(_tm); - ((TopicImpl) parent).addName(name); - return name; - } - - /* (non-Javadoc) - * @see org.tinytim.internal.api.IConstructFactory#createOccurrence(org.tinytim.internal.api.ITopic) - */ - public IOccurrence createOccurrence(ITopic parent) { - OccurrenceImpl occ = new OccurrenceImpl(_tm); - ((TopicImpl) parent).addOccurrence(occ); - return occ; - } - - /* (non-Javadoc) - * @see org.tinytim.internal.api.IConstructFactory#createRole(org.tmapi.core.Association) - */ - public Role createRole(Association parent) { - RoleImpl role = new RoleImpl(_tm); - ((AssociationImpl) parent).addRole(role); - return role; - } - - /* (non-Javadoc) - * @see org.tinytim.internal.api.IConstructFactory#createVariant(org.tinytim.internal.api.IName) - */ - public IVariant createVariant(IName parent) { - VariantImpl variant = new VariantImpl(_tm); - for (Topic theme: parent.getScope()) { - variant._addNameTheme(theme); - } - ((NameImpl) parent).addVariant(variant); - return variant; - } - -} Modified: tinytim/trunk/src/main/java/org/tinytim/core/MemoryTopicMap.java =================================================================== --- tinytim/trunk/src/main/java/org/tinytim/core/MemoryTopicMap.java 2009-08-18 12:54:43 UTC (rev 355) +++ tinytim/trunk/src/main/java/org/tinytim/core/MemoryTopicMap.java 2009-08-27 13:08:17 UTC (rev 356) @@ -24,11 +24,13 @@ import org.tinytim.core.value.Literal; import org.tinytim.index.IndexManager; import org.tinytim.internal.api.Event; +import org.tinytim.internal.api.IAssociation; import org.tinytim.internal.api.IConstant; import org.tinytim.internal.api.IConstruct; -import org.tinytim.internal.api.IConstructFactory; import org.tinytim.internal.api.IEventHandler; import org.tinytim.internal.api.IIndexManager; +import org.tinytim.internal.api.IScope; +import org.tinytim.internal.api.ITopic; import org.tinytim.internal.api.ITopicMap; import org.tinytim.internal.utils.Check; import org.tinytim.internal.utils.CollectionFactory; @@ -54,7 +56,6 @@ */ final class MemoryTopicMap extends AbstractTopicMap implements ITopicMap { - private final IConstructFactory _factory; private final IdentityManager _identityManager; private final IIndexManager _indexManager; private final Locator _locator; @@ -68,7 +69,6 @@ MemoryTopicMap(AbstractTopicMapSystem sys, Locator locator) { super(); super._tm = this; - _factory = new MemoryConstructFactory(this); _sys = sys; _locator = locator; _topics = CollectionFactory.createIdentitySet(IConstant.TM_TOPIC_SIZE); @@ -92,16 +92,17 @@ return this; } - /* (non-Javadoc) - * @see org.tinytim.api.internal.ITopicMap#getConstructFactory() - */ - public IConstructFactory getConstructFactory() { - return _factory; + @Override + public ITopic createEmptyTopic() { + TopicImpl topic = new TopicImpl(this); + addTopic(topic); + return topic; } /* (non-Javadoc) * @see org.tmapi.core.TopicMap#createLocator(java.lang.String) */ + @Override public Locator createLocator(String reference) { return Literal.createIRI(reference); } @@ -109,6 +110,7 @@ /* (non-Javadoc) * @see org.tmapi.core.TopicMap#getTopics() */ + @Override public Set<Topic> getTopics() { return Collections.unmodifiableSet(_topics); } @@ -116,8 +118,9 @@ /* (non-Javadoc) * @see org.tmapi.core.TopicMap#createTopic() */ + @Override public Topic createTopic() { - Topic topic = _factory.createTopic(); + Topic topic = createEmptyTopic(); topic.addItemIdentifier(Literal.createIRI("urn:x-tinytim:" + IdGenerator.nextId())); return topic; } @@ -125,6 +128,7 @@ /* (non-Javadoc) * @see org.tmapi.core.TopicMap#createTopicByItemIdentifier(org.tmapi.core.Locator) */ + @Override public Topic createTopicByItemIdentifier(Locator iid) { Check.itemIdentifierNotNull(this, iid); Construct construct = getConstructByItemIdentifier(iid); @@ -141,7 +145,7 @@ return topic; } } - Topic topic = _factory.createTopic(); + Topic topic = createEmptyTopic(); topic.addItemIdentifier(iid); return topic; } @@ -149,6 +153,7 @@ /* (non-Javadoc) * @see org.tmapi.core.TopicMap#createTopicBySubjectIdentifier(org.tmapi.core.Locator) */ + @Override public Topic createTopicBySubjectIdentifier(Locator sid) { Check.subjectIdentifierNotNull(this, sid); Topic topic = getTopicBySubjectIdentifier(sid); @@ -163,7 +168,7 @@ return topic; } } - topic = _factory.createTopic(); + topic = createEmptyTopic(); topic.addSubjectIdentifier(sid); return topic; } @@ -171,13 +176,14 @@ /* (non-Javadoc) * @see org.tmapi.core.TopicMap#createTopicBySubjectLocator(org.tmapi.core.Locator) */ + @Override public Topic createTopicBySubjectLocator(Locator slo) { Check.subjectLocatorNotNull(this, slo); Topic topic = getTopicBySubjectLocator(slo); if (topic != null) { return topic; } - topic = _factory.createTopic(); + topic = createEmptyTopic(); topic.addSubjectLocator(slo); return topic; } @@ -210,21 +216,34 @@ /* (non-Javadoc) * @see org.tmapi.core.TopicMap#getAssociations() */ + @Override public Set<Association> getAssociations() { return Collections.unmodifiableSet(_assocs); } + @Override public Association createAssociation(Topic type, Topic... scope) { Check.scopeNotNull(this, scope); return createAssociation(type, Arrays.asList(scope)); } - public Association createAssociation(Topic type, Collection<Topic> scope) { + /* (non-Javadoc) + * @see org.tmapi.core.TopicMap#createAssociation(org.tmapi.core.Topic, java.util.Collection) + */ + @Override + public IAssociation createAssociation(Topic type, Collection<Topic> scope) { + return createAssociation(type, createScope(scope)); + } + + + /* (non-Javadoc) + * @see org.tinytim.internal.api.ITopicMap#createAssociation(org.tinytim.internal.api.ITopic, org.tinytim.internal.api.IScope) + */ + @Override + public IAssociation createAssociation(Topic type, IScope scope) { Check.typeNotNull(this, type); - Check.scopeNotNull(this, scope); Check.sameTopicMap(this, type); - Check.sameTopicMap(this, scope); - AssociationImpl assoc = new AssociationImpl(this, type, Scope.create(scope)); + AssociationImpl assoc = new AssociationImpl(this, type, scope); addAssociation(assoc); return assoc; } @@ -258,6 +277,7 @@ /* (non-Javadoc) * @see org.tmapi.core.TopicMap#getConstructById(java.lang.String) */ + @Override public Construct getConstructById(String id) { return _identityManager.getConstructById(id); } @@ -265,6 +285,7 @@ /* (non-Javadoc) * @see org.tmapi.core.TopicMap#getTopicBySubjectIdentifier(org.tmapi.core.Locator) */ + @Override public Topic getTopicBySubjectIdentifier(Locator sid) { Check.subjectIdentifierNotNull(sid); return _identityManager.getTopicBySubjectIdentifier(sid); @@ -273,6 +294,7 @@ /* (non-Javadoc) * @see org.tmapi.core.TopicMap#getTopicBySubjectLocator(org.tmapi.core.Locator) */ + @Override public Topic getTopicBySubjectLocator(Locator slo) { Check.subjectLocatorNotNull(slo); return _identityManager.getTopicBySubjectLocator(slo); @@ -281,6 +303,7 @@ /* (non-Javadoc) * @see org.tmapi.core.TopicMap#getConstructByItemIdentifier(org.tmapi.core.Locator) */ + @Override public Construct getConstructByItemIdentifier(Locator iid) { Check.itemIdentifierNotNull(iid); return _identityManager.getConstructByItemIdentifier(iid); @@ -289,6 +312,7 @@ /* (non-Javadoc) * @see org.tmapi.core.TopicMap#getReifier() */ + @Override public Topic getReifier() { return _reifier; } @@ -296,6 +320,7 @@ /* (non-Javadoc) * @see org.tmapi.core.Reifiable#setReifier(org.tmapi.core.Topic) */ + @Override public void setReifier(Topic reifier) { Check.sameTopicMap(this, reifier); if (_reifier == reifier) { @@ -328,9 +353,17 @@ throw new UnsupportedOperationException("Index '" + indexInterface.getName() + "' is unknown"); } + @Override + public IScope createScope(Collection<Topic> themes) { + Check.scopeNotNull(this, themes); + Check.sameTopicMap(this, themes); + return Scope.create(themes); + } + /* (non-Javadoc) * @see org.tmapi.core.TopicMap#mergeIn(org.tmapi.core.TopicMap) */ + @Override public void mergeIn(TopicMap other) { MergeUtils.merge(other, this); } @@ -338,6 +371,7 @@ /* (non-Javadoc) * @see org.tmapi.core.TopicMap#close() */ + @Override public void close() { remove(); } @@ -353,6 +387,7 @@ /* (non-Javadoc) * @see org.tmapi.core.TopicMap#remove() */ + @Override public void remove() { _sys.removeTopicMap(this); _sys = null; @@ -375,6 +410,7 @@ /* (non-Javadoc) * @see org.tinytim.internal.api.IEventHandler#handleEvent(org.tinytim.internal.api.Event, org.tinytim.internal.api.IConstruct, java.lang.Object, java.lang.Object) */ + @Override public void handleEvent(Event evt, IConstruct sender, Object oldValue, Object newValue) { if (!_evtHandlers.containsKey(evt)) { _eventMultiplier.handleEvent(evt, sender, oldValue, newValue); @@ -390,6 +426,7 @@ /* (non-Javadoc) * @see org.tinytim.IEventPublisher#subscribe(org.tinytim.Event, org.tinytim.IEventHandler) */ + @Override public void subscribe(Event event, IEventHandler handler) { Collection<IEventHandler> handlers = _evtHandlers.get(event); if (handlers == null) { @@ -402,6 +439,7 @@ /* (non-Javadoc) * @see org.tinytim.internal.api.IEventPublisher#unsubscribe(org.tinytim.internal.api.Event, org.tinytim.internal.api.IEventHandler) */ + @Override public void unsubscribe(Event event, IEventHandler handler) { Collection<IEventHandler> handlers = _evtHandlers.get(event); if (handlers != null) { @@ -412,6 +450,7 @@ /* (non-Javadoc) * @see org.tinytim.internal.api.IIndexManagerAware#getIndexManager() */ + @Override public IIndexManager getIndexManager() { return _indexManager; } Modified: tinytim/trunk/src/main/java/org/tinytim/core/MemoryTopicMapSystem.java =================================================================== --- tinytim/trunk/src/main/java/org/tinytim/core/MemoryTopicMapSystem.java 2009-08-18 12:54:43 UTC (rev 355) +++ tinytim/trunk/src/main/java/org/tinytim/core/MemoryTopicMapSystem.java 2009-08-27 13:08:17 UTC (rev 356) @@ -54,6 +54,7 @@ /* (non-Javadoc) * @see org.tmapi.core.TopicMapSystem#createTopicMap(org.tmapi.core.Locator) */ + @Override public TopicMap createTopicMap(Locator locator) throws TopicMapExistsException { if (_topicMaps.containsKey(locator)) { throw new TopicMapExistsException("A topic map with the IRI + '" + locator.getReference() + "' exists in the system"); @@ -66,6 +67,7 @@ /* (non-Javadoc) * @see org.tmapi.core.TopicMapSystem#getLocators() */ + @Override public Set<Locator> getLocators() { return Collections.unmodifiableSet(_topicMaps.keySet()); } @@ -73,6 +75,7 @@ /* (non-Javadoc) * @see org.tmapi.core.TopicMapSystem#getTopicMap(org.tmapi.core.Locator) */ + @Override public TopicMap getTopicMap(Locator iri) { return _topicMaps.get(iri); } @@ -80,6 +83,7 @@ /* (non-Javadoc) * @see org.tmapi.core.TopicMapSystem#close() */ + @Override public void close() { super.close(); _topicMaps.clear(); Modified: tinytim/trunk/src/main/java/org/tinytim/core/NameImpl.java =================================================================== --- tinytim/trunk/src/main/java/org/tinytim/core/NameImpl.java 2009-08-18 12:54:43 UTC (rev 355) +++ tinytim/trunk/src/main/java/org/tinytim/core/NameImpl.java 2009-08-27 13:08:17 UTC (rev 356) @@ -47,11 +47,6 @@ private ILiteral _literal; private Set<Variant> _variants; - - NameImpl(ITopicMap tm) { - super(tm); - } - NameImpl(ITopicMap topicMap, Topic type, ILiteral literal, IScope scope) { super(topicMap, type, scope); _literal = literal; @@ -60,6 +55,7 @@ /* (non-Javadoc) * @see org.tinytim.core.ConstructImpl#getParent() */ + @Override public Topic getParent() { return (Topic) _parent; } @@ -67,6 +63,7 @@ /* (non-Javadoc) * @see org.tinytim.internal.api.ILiteralAware#getLiteral() */ + @Override public ILiteral getLiteral() { return _literal; } @@ -74,6 +71,7 @@ /* (non-Javadoc) * @see org.tinytim.internal.api.ILiteralAware#setLiteral(org.tinytim.internal.api.ILiteral) */ + @Override public void setLiteral(ILiteral literal) { assert literal != null; _fireEvent(Event.SET_LITERAL, _literal, literal); @@ -83,6 +81,7 @@ /* (non-Javadoc) * @see org.tmapi.core.Name#getValue() */ + @Override public String getValue() { return _literal.getValue(); } @@ -90,6 +89,7 @@ /* (non-Javadoc) * @see org.tmapi.core.Name#setValue(java.lang.String) */ + @Override public void setValue(String value) { Check.valueNotNull(this, value); setLiteral(Literal.create(value)); @@ -116,7 +116,7 @@ public void removeTheme(Topic theme) { IScope scope = _scope; super.removeTheme(theme); - if (_variants != null && scope != _scope) { + if (_variants != null && _scope != scope) { for (Variant variant: _variants) { ((VariantImpl) variant)._removeNameTheme(theme); } @@ -126,6 +126,7 @@ /* (non-Javadoc) * @see org.tmapi.core.Name#getVariants() */ + @Override public Set<Variant> getVariants() { return _variants == null ? Collections.<Variant>emptySet() : Collections.unmodifiableSet(_variants); @@ -134,22 +135,25 @@ /* (non-Javadoc) * @see org.tmapi.core.Name#createVariant(org.tmapi.core.Locator, java.util.Collection) */ + @Override public Variant createVariant(Locator value, Collection<Topic> scope) { Check.valueNotNull(this, value); - return createVariant(Literal.create(value), scope); + return createVariant(Literal.create(value), _tm.createScope(scope)); } /* (non-Javadoc) - * @see org.tmapi.core.Name#createVariant(java.lang.String, java.util.Collection) + * @see org.tmapi.core.Name#createVariant(org.tmapi.core.Locator, java.util.Collection) */ + @Override public Variant createVariant(String value, Collection<Topic> scope) { Check.valueNotNull(this, value); - return createVariant(Literal.create(value), scope); + return createVariant(Literal.create(value), _tm.createScope(scope)); } /* (non-Javadoc) * @see org.tmapi.core.Name#createVariant(org.tmapi.core.Locator, org.tmapi.core.Topic[]) */ + @Override public Variant createVariant(Locator value, Topic... scope) { Check.scopeNotNull(this, scope); return createVariant(value, Arrays.asList(scope)); @@ -158,15 +162,17 @@ /* (non-Javadoc) * @see org.tmapi.core.Name#createVariant(java.lang.String, org.tmapi.core.Locator, java.util.Collection) */ + @Override public Variant createVariant(String value, Locator datatype, Collection<Topic> scope) { Check.valueNotNull(this, value, datatype); - return _createVariant(value, datatype, scope); + return createVariant(Literal.create(value, datatype), _tm.createScope(scope)); } /* (non-Javadoc) * @see org.tmapi.core.Name#createVariant(java.lang.String, org.tmapi.core.Locator, org.tmapi.core.Topic[]) */ + @Override public Variant createVariant(String value, Locator datatype, Topic... scope) { Check.scopeNotNull(this, scope); return createVariant(value, datatype, Arrays.asList(scope)); @@ -175,25 +181,22 @@ /* (non-Javadoc) * @see org.tmapi.core.Name#createVariant(java.lang.String, org.tmapi.core.Topic[]) */ + @Override public Variant createVariant(String value, Topic... scope) { Check.scopeNotNull(this, scope); return createVariant(value, Arrays.asList(scope)); } - private Variant _createVariant(String value, Locator datatype, Collection<Topic> scope) { - Check.valueNotNull(this, value, datatype); - return createVariant(Literal.create(value, datatype), scope); - } - - public IVariant createVariant(ILiteral literal, Collection<Topic> scope) { - Check.sameTopicMap(this, scope); - if (scope.isEmpty()) { + @Override + public IVariant createVariant(ILiteral literal, IScope scope) { + Check.valueNotNull(this, literal); + if (scope.isUnconstrained()) { throw new ModelConstraintException(this, "The scope of the variant must not be unconstrained"); } - if (_scope.containsAll(scope)) { + if (_scope.containsAll(scope.asSet())) { throw new ModelConstraintException(this, "The variant's scope is not a true superset of the parent's scope"); } - VariantImpl variant = new VariantImpl(_tm, literal, Scope.create(scope)); + VariantImpl variant = new VariantImpl(_tm, literal, scope); addVariant(variant); for (Topic theme: _scope) { variant._addNameTheme(theme); @@ -236,6 +239,7 @@ /* (non-Javadoc) * @see org.tinytim.internal.api.IMovable#moveTo(org.tmapi.core.Construct) */ + @Override public void moveTo(Topic newParent) { ((TopicImpl) _parent).detachName(this, true); ((TopicImpl) newParent).attachName(this, true); @@ -253,6 +257,7 @@ /* (non-Javadoc) * @see org.tmapi.core.Construct#remove() */ + @Override public void remove() { ((TopicImpl) _parent).removeName(this); super.dispose(); Modified: tinytim/trunk/src/main/java/org/tinytim/core/OccurrenceImpl.java =================================================================== --- tinytim/trunk/src/main/java/org/tinytim/core/OccurrenceImpl.java 2009-08-18 12:54:43 UTC (rev 355) +++ tinytim/trunk/src/main/java/org/tinytim/core/OccurrenceImpl.java 2009-08-27 13:08:17 UTC (rev 356) @@ -31,10 +31,6 @@ */ final class OccurrenceImpl extends DatatypeAwareConstruct implements IOccurrence { - OccurrenceImpl(ITopicMap tm) { - super(tm); - } - OccurrenceImpl(ITopicMap topicMap, Topic type, ILiteral literal, IScope scope) { super(topicMap, type, literal, scope); } @@ -42,6 +38,7 @@ /* (non-Javadoc) * @see org.tmapi.core.Occurrence#getParent() */ + @Override public Topic getParent() { return (Topic) _parent; } @@ -49,6 +46,7 @@ /* (non-Javadoc) * @see org.tinytim.internal.api.IMovable#moveTo(org.tmapi.core.Construct) */ + @Override public void moveTo(Topic newParent) { ((TopicImpl) _parent).detachOccurrence(this, true); ((TopicImpl) newParent).attachOccurrence(this, true); @@ -66,6 +64,7 @@ /* (non-Javadoc) * @see org.tmapi.core.Construct#remove() */ + @Override public void remove() { ((TopicImpl) _parent).removeOccurrence(this); super.dispose(); Modified: tinytim/trunk/src/main/java/org/tinytim/core/RoleImpl.java =================================================================== --- tinytim/trunk/src/main/java/org/tinytim/core/RoleImpl.java 2009-08-18 12:54:43 UTC (rev 355) +++ tinytim/trunk/src/main/java/org/tinytim/core/RoleImpl.java 2009-08-27 13:08:17 UTC (rev 356) @@ -16,11 +16,12 @@ package org.tinytim.core; import org.tinytim.internal.api.Event; +import org.tinytim.internal.api.IAssociation; +import org.tinytim.internal.api.IRole; import org.tinytim.internal.api.ITopicMap; import org.tinytim.internal.utils.Check; import org.tmapi.core.Association; -import org.tmapi.core.Role; import org.tmapi.core.Topic; /** @@ -29,14 +30,10 @@ * @author Lars Heuer (heuer[at]semagia.com) <a href="http://www.semagia.com/">Semagia</a> * @version $Rev$ - $Date$ */ -final class RoleImpl extends TypedImpl implements Role { +final class RoleImpl extends TypedImpl implements IRole { private Topic _player; - RoleImpl(ITopicMap tm) { - super(tm); - } - RoleImpl(ITopicMap tm, Topic type, Topic player) { super(tm, type); _player = player; @@ -45,6 +42,7 @@ /* (non-Javadoc) * @see org.tinytim.core.ConstructImpl#getParent() */ + @Override public Association getParent() { return (Association) _parent; } @@ -52,6 +50,7 @@ /* (non-Javadoc) * @see org.tmapi.core.Role#getPlayer() */ + @Override public Topic getPlayer() { return _player; } @@ -59,6 +58,7 @@ /* (non-Javadoc) * @see org.tmapi.core.Role#setPlayer(org.tmapi.core.Topic) */ + @Override public void setPlayer(Topic player) { Check.playerNotNull(this, player); Check.sameTopicMap(this, player); @@ -75,6 +75,12 @@ } } + @Override + public void moveTo(IAssociation newParent) { + ((AssociationImpl) _parent).detachRole(this); + ((AssociationImpl) newParent).attachRole(this); + } + /* (non-Javadoc) * @see org.tinytim.core.ConstructImpl#isRole() */ @@ -86,6 +92,7 @@ /* (non-Javadoc) * @see org.tmapi.core.Construct#remove() */ + @Override public void remove() { ((AssociationImpl) _parent).removeRole(this); super.dispose(); Modified: tinytim/trunk/src/main/java/org/tinytim/core/Scope.java =================================================================== --- tinytim/trunk/src/main/java/org/tinytim/core/Scope.java 2009-08-18 12:54:43 UTC (rev 355) +++ tinytim/trunk/src/main/java/org/tinytim/core/Scope.java 2009-08-27 13:08:17 UTC (rev 356) @@ -24,7 +24,6 @@ import org.tinytim.internal.api.IScope; import org.tinytim.internal.utils.CollectionFactory; import org.tinytim.internal.utils.WeakObjectRegistry; - import org.tmapi.core.Topic; /** @@ -86,6 +85,7 @@ /* (non-Javadoc) * @see org.tinytim.internal.api.IScope#asSet() */ + @Override public Set<Topic> asSet() { // _set is immutable return _set; @@ -94,6 +94,7 @@ /* (non-Javadoc) * @see org.tinytim.internal.api.IScope#contains(org.tmapi.core.Topic) */ + @Override public boolean contains(Topic theme) { return _set.contains(theme); } @@ -101,6 +102,7 @@ /* (non-Javadoc) * @see org.tinytim.internal.api.IScope#containsAll(java.util.Collection) */ + @Override public boolean containsAll(Collection<Topic> scope) { return _set.containsAll(scope); } @@ -108,6 +110,7 @@ /* (non-Javadoc) * @see org.tinytim.internal.api.IScope#add(org.tmapi.core.Topic) */ + @Override public IScope add(Topic theme) { if (_set.contains(theme)) { return this; @@ -120,6 +123,7 @@ /* (non-Javadoc) * @see org.tinytim.internal.api.IScope#remove(org.tmapi.core.Topic) */ + @Override public IScope remove(Topic theme) { if (!_set.contains(theme)) { return this; @@ -132,6 +136,7 @@ /* (non-Javadoc) * @see java.lang.Iterable#iterator() */ + @Override public Iterator<Topic> iterator(){ return _set.iterator(); } @@ -139,6 +144,7 @@ /* (non-Javadoc) * @see org.tinytim.internal.api.IScope#isUnconstrained() */ + @Override public boolean isUnconstrained() { return this == UCS; } @@ -146,6 +152,7 @@ /* (non-Javadoc) * @see org.tinytim.internal.api.IScope#size() */ + @Override public int size() { return _set.size(); } Modified: tinytim/trunk/src/main/java/org/tinytim/core/ScopedImpl.java =================================================================== --- tinytim/trunk/src/main/java/org/tinytim/core/ScopedImpl.java 2009-08-18 12:54:43 UTC (rev 355) +++ tinytim/trunk/src/main/java/org/tinytim/core/ScopedImpl.java 2009-08-27 13:08:17 UTC (rev 356) @@ -20,6 +20,7 @@ import org.tinytim.internal.api.Event; import org.tinytim.internal.api.IScope; import org.tinytim.internal.api.IScoped; +import org.tinytim.internal.api.ITopic; import org.tinytim.internal.api.ITopicMap; import org.tinytim.internal.utils.Check; @@ -34,15 +35,8 @@ */ abstract class ScopedImpl extends TypedImpl implements IScoped { - //NOTE: This class does NOT implement IScoped by intention! - protected IScope _scope; - protected ScopedImpl(ITopicMap tm) { - super(tm); - _scope = Scope.UCS; - } - protected ScopedImpl(ITopicMap topicMap, Topic type, IScope scope) { super(topicMap, type); _scope = scope; @@ -51,6 +45,7 @@ /* (non-Javadoc) * @see org.tinytim.internal.api.IScoped#getScopeObject() */ + @Override public IScope getScopeObject() { return _scope; } @@ -58,6 +53,7 @@ /* (non-Javadoc) * @see org.tinytim.internal.api.IScoped#setScopeObject(org.tinytim.internal.api.IScope) */ + @Override public void setScopeObject(IScope scope) { if (_scope == scope) { return; @@ -69,6 +65,7 @@ /* (non-Javadoc) * @see org.tmapi.core.Scoped#getScope() */ + @Override public Set<Topic> getScope() { return _scope.asSet(); } @@ -76,6 +73,7 @@ /* (non-Javadoc) * @see org.tmapi.core.Scoped#addTheme(org.tmapi.core.Topic) */ + @Override public void addTheme(Topic theme) { Check.themeNotNull(this, theme); Check.sameTopicMap(this, theme); @@ -85,11 +83,12 @@ /* (non-Javadoc) * @see org.tmapi.core.Scoped#removeTheme(org.tmapi.core.Topic) */ + @Override public void removeTheme(Topic theme) { if (theme == null) { return; } - setScopeObject(_scope.remove(theme)); + setScopeObject(_scope.remove((ITopic) theme)); } /* (non-Javadoc) Modified: tinytim/trunk/src/main/java/org/tinytim/core/TopicImpl.java =================================================================== --- tinytim/trunk/src/main/java/org/tinytim/core/TopicImpl.java 2009-08-18 12:54:43 UTC (rev 355) +++ tinytim/trunk/src/main/java/org/tinytim/core/TopicImpl.java 2009-08-27 13:08:17 UTC (rev 356) @@ -26,6 +26,7 @@ import org.tinytim.internal.api.ILiteral; import org.tinytim.internal.api.IName; import org.tinytim.internal.api.IOccurrence; +import org.tinytim.internal.api.IScope; import org.tinytim.internal.api.ITopic; import org.tinytim.internal.api.ITopicMap; import org.tinytim.internal.utils.Check; @@ -84,6 +85,7 @@ /* (non-Javadoc) * @see org.tmapi.core.Topic#addSubjectIdentifier(org.tmapi.core.Locator) */ + @Override public void addSubjectIdentifier(Locator sid) { Check.subjectIdentifierNotNull(this, sid); if (_sids.contains(sid)) { @@ -96,6 +98,7 @@ /* (non-Javadoc) * @see org.tmapi.core.Topic#removeSubjectIdentifier(org.tmapi.core.Locator) */ + @Override public void removeSubjectIdentifier(Locator sid) { if (!_sids.contains(sid)) { return; @@ -107,6 +110,7 @@ /* (non-Javadoc) * @see org.tmapi.core.Topic#getSubjectLocators() */ + @Override public Set<Locator> getSubjectLocators() { return _slos == null ? Collections.<Locator>emptySet() : Collections.unmodifiableSet(_slos); @@ -115,6 +119,7 @@ /* (non-Javadoc) * @see org.tmapi.core.Topic#addSubjectLocator(org.tmapi.core.Locator) */ + @Override public void addSubjectLocator(Locator slo) { Check.subjectLocatorNotNull(this, slo); if (_slos != null && _sids.contains(slo)) { @@ -130,6 +135,7 @@ /* (non-Javadoc) * @see org.tmapi.core.Topic#removeSubjectLocator(org.tmapi.core.Locator) */ + @Override public void removeSubjectLocator(Locator slo) { if (_slos == null || !_slos.contains(slo)) { return; @@ -141,6 +147,7 @@ /* (non-Javadoc) * @see org.tmapi.core.Topic#getOccurrences() */ + @Override public Set<Occurrence> getOccurrences() { return Collections.unmodifiableSet(_occs); } @@ -148,30 +155,34 @@ /* (non-Javadoc) * @see org.tmapi.core.Topic#createOccurrence(org.tmapi.core.Topic, java.lang.String, java.util.Collection) */ + @Override public Occurrence createOccurrence(Topic type, String value, Collection<Topic> scope) { Check.valueNotNull(this, value); - return createOccurrence(type, Literal.create(value), scope); + return createOccurrence(type, Literal.create(value), _tm.createScope(scope)); } /* (non-Javadoc) * @see org.tmapi.core.Topic#createOccurrence(org.tmapi.core.Locator, org.tmapi.core.Topic, java.util.Collection) */ + @Override public Occurrence createOccurrence(Topic type, Locator value, Collection<Topic> scope) { Check.valueNotNull(this, value); - return createOccurrence(type, Literal.create(value), scope); + return createOccurrence(type, Literal.create(value), _tm.createScope(scope)); } /* (non-Javadoc) * @see org.tmapi.core.Topic#createOccurrence(org.tmapi.core.Topic, java.lang.String, org.tmapi.core.Locator, java.util.Collection) */ + @Override public Occurrence createOccurrence(Topic type, String value, Locator datatype, Collection<Topic> scope) { Check.valueNotNull(this, value, datatype); - return createOccurrence(type, Literal.create(value, datatype), scope); + return createOccurrence(type, Literal.create(value, datatype), _tm.createScope(scope)); } /* (non-Javadoc) * @see org.tmapi.core.Topic#createOccurrence(org.tmapi.core.Topic, java.lang.String, org.tmapi.core.Locator, org.tmapi.core.Topic[]) */ + @Override public Occurrence createOccurrence(Topic type, String value, Locator datatype, Topic... scope) { Check.scopeNotNull(this, scope); return createOccurrence(type, value, datatype, Arrays.asList(scope)); @@ -180,6 +191,7 @@ /* (non-Javadoc) * @see org.tmapi.core.Topic#createOccurrence(org.tmapi.core.Topic, org.tmapi.core.Locator, org.tmapi.core.Topic[]) */ + @Override public Occurrence createOccurrence(Topic type, Locator value, Topic... scope) { Check.scopeNotNull(this, scope); return createOccurrence(type, value, Arrays.asList(scope)); @@ -188,17 +200,19 @@ /* (non-Javadoc) * @see org.tmapi.core.Topic#createOccurrence(org.tmapi.core.Topic, java.lang.String, org.tmapi.core.Topic[]) */ + @Override public Occurrence createOccurrence(Topic type, String value, Topic... scope) { Check.scopeNotNull(this, scope); return createOccurrence(type, value, Arrays.asList(scope)); } - public IOccurrence createOccurrence(Topic type, ILiteral literal, Collection<Topic> scope) { + @Override + public IOccurrence createOccurrence(Topic type, ILiteral literal, IScope scope) { Check.typeNotNull(this, type); - Check.scopeNotNull(this, scope); + Check.valueNotNull(this, literal); + Check.scopeNotNull(this, scope.asSet()); Check.sameTopicMap(this, type); - Check.sameTopicMap(this, scope); - IOccurrence occ = new OccurrenceImpl(_tm, type, literal, Scope.create(scope)); + IOccurrence occ = new OccurrenceImpl(_tm, type, literal, scope); addOccurrence(occ); return occ; } @@ -250,6 +264,7 @@ /* (non-Javadoc) * @see org.tmapi.core.Topic#getNames() */ + @Override public Set<Name> getNames() { return Collections.unmodifiableSet(_names); } @@ -257,6 +272,7 @@ /* (non-Javadoc) * @see org.tmapi.core.Topic#getNames(org.tmapi.core.Topic) */ + @Override public Set<Name> getNames(Topic type) { Check.typeNotNull(type); Set<Name> names = CollectionFactory.createIdentitySet(); @@ -271,6 +287,7 @@ /* (non-Javadoc) * @see org.tmapi.core.Topic#createName(java.lang.String, org.tmapi.core.Topic[]) */ + @Override public Name createName(String value, Topic... scope) { Check.scopeNotNull(this, scope); return createName(value, Arrays.asList(scope)); @@ -279,6 +296,7 @@ /* (non-Javadoc) * @see org.tmapi.core.Topic#createName(org.tmapi.core.Topic, java.lang.String, org.tmapi.core.Topic[]) */ + @Override public Name createName(Topic type, String value, Topic... scope) { Check.scopeNotNull(this, scope); return createName(type, value, Arrays.asList(scope)); @@ -287,6 +305,7 @@ /* (non-Javadoc) * @see org.tmapi.core.Topic#getOccurrences(org.tmapi.core.Topic) */ + @Override public Set<Occurrence> getOccurrences(Topic type) { Check.typeNotNull(type); Set<Occurrence> occs = CollectionFactory.createIdentitySet(); @@ -301,6 +320,7 @@ /* (non-Javadoc) * @see org.tmapi.core.Topic#createName(java.lang.String, java.util.Collection) */ + @Override public Name createName(String value, Collection<Topic> scope) { return createName(_tm.createTopicBySubjectIdentifier(TMDM.TOPIC_NAME), value, scope); } @@ -308,18 +328,20 @@ /* (non-Javadoc) * @see org.tmapi.core.Topic#createName(org.tmapi.core.Topic, java.lang.String, java.util.Collection) */ + @Override public Name createName(Topic type, String value, Collection<Topic> scope) { Check.valueNotNull(this, value); - return createName(type, Literal.create(value), scope); + return createName(type, Literal.create(value), _tm.createScope(scope)); } - public IName createName(Topic type, ILiteral literal, Collection<Topic> scope) { + @Override + public IName createName(Topic type, ILiteral literal, IScope scope) { Check.typeNotNull(this, type); Check.scopeNotNull(this, scope); Check.sameTopicMap(this, type); - Check.sameTopicMap(this, scope); - NameImpl name = new NameImpl(_tm, type, literal, Scope.create(scope)); - addName(name); + Check.valueNotNull(this, literal); + IName name = new NameImpl(_tm, type, literal, scope); + this.addName(name); return name; } @@ -361,6 +383,7 @@ /* (non-Javadoc) * @see org.tmapi.core.Topic#getReified() */ + @Override public Reifiable getReified() { return _reified; } @@ -368,6 +391,7 @@ /* (non-Javadoc) * @see org.tmapi.core.Topic#getRolesPlayed() */ + @Override public Set<Role> getRolesPlayed() { return _rolesPlayed == null ? Collections.<Role>emptySet() : Collections.unmodifiableSet(_rolesPlayed); @@ -376,6 +400,7 @@ /* (non-Javadoc) * @see org.tmapi.core.Topic#getRolesPlayed(org.tmapi.core.Topic) */ + @Override public Set<Role> getRolesPlayed(Topic type) { Check.typeNotNull(type); if (_rolesPlayed == null) { @@ -393,6 +418,7 @@ /* (non-Javadoc) * @see org.tmapi.core.Topic#getRolesPlayed(org.tmapi.core.Topic, org.tmapi.core.Topic) */ + @Override public Set<Role> getRolesPlayed(Topic type, Topic assoc) { Check.typeNotNull(type); if (assoc == null) { @@ -427,6 +453,7 @@ /* (non-Javadoc) * @see org.tmapi.core.Topic#getTypes() */ + @Override public Set<Topic> getTypes() { return _types == null ? Collections.<Topic>emptySet() : Collections.unmodifiableSet(_types); @@ -435,6 +462,7 @@ /* (non-Javadoc) * @see org.tmapi.core.Topic#addType(org.tmapi.core.Topic) */ + @Override public void addType(Topic type) { Check.typeNotNull(this, type); Check.sameTopicMap(this, type); @@ -451,6 +479,7 @@ /* (non-Javadoc) * @see org.tmapi.core.Topic#removeType(org.tmapi.core.Topic) */ + @Override public void removeType(Topic type) { if (_types == null || !_types.contains(type)) { return; @@ -462,6 +491,7 @@ /* (non-Javadoc) * @see org.tmapi.core.Topic#mergeIn(org.tmapi.core.Topic) */ + @Override public void mergeIn(Topic source) { MergeUtils.merge(source, this); } @@ -477,6 +507,7 @@ /* (non-Javadoc) * @see org.tmapi.core.Construct#remove() */ + @Override public void remove() throws TopicInUseException { if (!TopicUtils.isRemovable(this, true)) { throw new TopicInUseException(this, "The topic is used as type, player, reifier, or theme"); Modified: tinytim/trunk/src/main/java/org/tinytim/core/TypedImpl.java =================================================================== --- tinytim/trunk/src/main/java/org/tinytim/core/TypedImpl.java 2009-08-18 12:54:43 UTC (rev 355) +++ tinytim/trunk/src/main/java/org/tinytim/core/TypedImpl.java 2009-08-27 13:08:17 UTC (rev 356) @@ -38,10 +38,6 @@ private Topic _type; private Topic _reifier; - protected TypedImpl(ITopicMap tm) { - super(tm); - } - protected TypedImpl(ITopicMap topicMap, Topic type) { super(topicMap); _type = type; @@ -70,6 +66,7 @@ /* (non-Javadoc) * @see org.tmapi.core.Reifiable#getReifier() */ + @Override public Topic getReifier() { return _reifier; } @@ -77,6 +74,7 @@ /* (non-Javadoc) * @see org.tmapi.core.Reifiable#setReifier(org.tmapi.core.Topic) */ + @Override public void setReifier(Topic reifier) { Check.sameTopicMap(this, reifier); if (_reifier == reifier) { Modified: tinytim/trunk/src/main/java/org/tinytim/core/VariantImpl.java =================================================================== --- tinytim/trunk/src/main/java/org/tinytim/core/VariantImpl.java 2009-08-18 12:54:43 UTC (rev 355) +++ tinytim/trunk/src/main/java/org/tinytim/core/VariantImpl.java 2009-08-27 13:08:17 UTC (rev 356) @@ -19,6 +19,7 @@ import org.tinytim.internal.api.Event; import org.tinytim.internal.api.ILiteral; +import org.tinytim.internal.api.IName; import org.tinytim.internal.api.IScope; import org.tinytim.internal.api.ITopicMap; import org.tinytim.internal.api.IVariant; @@ -36,10 +37,6 @@ final class VariantImpl extends DatatypeAwareConstruct implements IVariant { - VariantImpl(ITopicMap tm) { - super(tm); - } - VariantImpl(ITopicMap topicMap, ILiteral literal, IScope scope) { super(topicMap, null, literal, scope); } @@ -47,13 +44,14 @@ /* (non-Javadoc) * @see org.tinytim.core.ConstructImpl#getParent() */ - public Name getParent() { - return (Name) _parent; + public IName getParent() { + return (IName) _parent; } /* (non-Javadoc) * @see org.tinytim.internal.api.IMovable#moveTo(org.tmapi.core.Construct) */ + @Override public void moveTo(Name newParent) { ((NameImpl) _parent).detachVariant(this); ((NameImpl) newParent).attachVariant(this); Modified: tinytim/trunk/src/main/java/org/tinytim/internal/api/IAssociation.java =================================================================== --- tinytim/trunk/src/main/java/org/tinytim/internal/api/IAssociation.java 2009-08-18 12:54:43 UTC (rev 355) +++ tinytim/trunk/src/main/java/org/tinytim/internal/api/IAssociation.java 2009-08-27 13:08:17 UTC (rev 356) @@ -21,7 +21,7 @@ * * * @author Lars Heuer (heuer[at]semagia.com) <a href="http://www.semagia.com/">Semagia</a> - * @version $Rev:$ - $Date:$ + * @version $Rev$ - $Date$ */ public interface IAssociation extends Association, IScoped { Deleted: tinytim/trunk/src/main/java/org/tinytim/internal/api/IConstructFactory.java =================================================================== --- tinytim/trunk/src/main/java/org/tinytim/internal/api/IConstructFactory.java 2009-08-18 12:54:43 UTC (rev 355) +++ tinytim/trunk/src/main/java/org/tinytim/internal/api/IConstructFactory.java 2009-08-27 13:08:17 UTC (rev 356) @@ -1,80 +0,0 @@ -/* - * Copyright 2008 Lars Heuer (heuer[at]semagia.com) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.tinytim.internal.api; - -import org.tmapi.core.Association; -import org.tmapi.core.Role; - -/** - * Factory for {@link IConstruct}s. - * <p> - * This interface is not meant to be used outside of the tinyTiM package. - * </p> - * - * @author Lars Heuer (heuer[at]semagia.com) <a href="http://www.semagia.com/">Semagia</a> - * @version $Rev$ - $Date$ - */ -public interface IConstructFactory { - - /** - * Creates a topic attached to the topic map this factory belongs to. - * - * @return A topic with no identity. - */ - public ITopic createTopic(); - - /** - * Creates an association attached to the topic map this - * factory belongs to. - * - * @return An association with no type, scope, and roles. - */ - public Association createAssociation(); - - /** - * Creates a role attached to the specified <tt>parent</tt>. - * - * @param parent The parent of the role. - * @return A role with no type and player. - */ - public Role createRole(Association parent); - - /** - * Creates an occurrence attached to the specified <tt>parent</tt>. - * - * @param parent The parent of the occurrence. - * @return An occurrence with no type, literal, and scope. - */ - public IOccurrence createOccurrence(ITopic parent); - - /** - * Creates a name attached to the specified <tt>parent</tt>. - * - * @param parent The parent of the name. - * @return A name with no type, literal, and scope. - */ - public IName createName(ITopic parent); - - /** - * Creates a variant attached to the specified <tt>parent</tt>. - * - * @param parent The parent of the variant. - * @return A variant with the parent's scope, but no own scope and - * no literal. - */ - public IVariant createVariant(IName parent); - -} Modified: tinytim/trunk/src/main/java/org/tinytim/internal/api/IName.java =================================================================== --- tinytim/trunk/src/main/java/org/tinytim/internal/api/IName.java 2009-08-18 12:54:43 UTC (rev 355) +++ tinytim/trunk/src/main/java/org/tinytim/internal/api/IName.java 2009-08-27 13:08:17 UTC (rev 356) @@ -15,8 +15,6 @@ */ package org.tinytim.internal.api; -import java.util.Collection; - import org.tmapi.core.Name; import org.tmapi.core.Topic; @@ -28,6 +26,6 @@ */ public interface IName extends Name, IScoped, ILiteralAware, IMovable<Topic>{ - public IVariant createVariant(ILiteral literal, Collection<Topic> scope); + public IVariant createVariant(ILiteral literal, IScope scope); } Added: tinytim/trunk/src/main/java/org/tinytim/internal/api/IRole.java =================================================================== --- tinytim/trunk/src/main/java/org/tinytim/internal/api/IRole.java (rev 0) +++ tinytim/trunk/src/main/java/org/tinytim/internal/api/IRole.java 2009-08-27 13:08:17 UTC (rev 356) @@ -0,0 +1,28 @@ +/* + * Copyright 2009 Lars Heuer (heuer[at]semagia.com). All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.tinytim.internal.api; + +import org.tmapi.core.Role; + +/** + * + * + * @author Lars Heuer (heuer[at]semagia.com) <a href="http://www.semagia.com/">Semagia</a> + * @version $Rev:$ - $Date:$ + */ +public interface IRole extends Role, IMovable<IAssociation> { + +} Property changes on: tinytim/trunk/src/main/java/org/tinytim/internal/api/IRole.java ___________________________________________________________________ Added: svn:keywords + Rev Date Id Added: svn:eol-style + native Modified: tinytim/trunk/src/main/java/org/tinytim/internal/api/ITopic.java =================================================================== --- tinytim/trunk/src/main/java/org/tinytim/internal/api/ITopic.java 2009-08-18 12:54:43 UTC (rev 355) +++ tinytim/trunk/src/main/java/org/tinytim/internal/api/ITopic.java 2009-08-27 13:08:17 UTC (rev 356) @@ -15,8 +15,6 @@ */ package org.tinytim.internal.api; -import java.util.Collection; - import org.tmapi.core.Topic; /** @@ -27,8 +25,8 @@ */ public interface ITopic extends Topic, IConstruct { - public IOccurrence createOccurrence(Topic type, ILiteral literal, Collection<Topic> scope); + public IOccurrence createOccurrence(Topic type, ILiteral literal, IScope scope); - public IName createName(Topic type, ILiteral literal, Collection<Topic> scope); + public IName createName(Topic type, ILiteral literal, IScope scope); } Modified: tinytim/trunk/src/main/java/org/tinytim/internal/api/ITopicMap.java =================================================================== --- tinytim/trunk/src/main/java/org/tinytim/internal/api/ITopicMap.java 2009-08-18 12:54:43 UTC (rev 355) +++ tinytim/trunk/src/main/java/org/tinytim/internal/api/ITopicMap.java 2009-08-27 13:08:17 UTC (rev 356) @@ -15,6 +15,9 @@ */ package org.tinytim.internal.api; +import java.util.Collection; + +import org.tmapi.core.Topic; import org.tmapi.core.TopicMap; /** @@ -27,9 +30,13 @@ * @author Lars Heuer (heuer[at]semagia.com) <a href="http://www.semagia.com/">Semagia</a> * @version $Rev$ - $Date$ */ -public interface ITopicMap extends TopicMap, IConstruct, IIndexManagerAware, +public interface ITopicMap extends TopicMap, IIndexManagerAware, IEventHandler, IEventPublisher { - public IConstructFactory getConstructFactory(); + public ITopic createEmptyTopic(); + public IAssociation createAssociation(Topic type, IScope scope); + + public IScope createScope(Collection<Topic> themes); + } Modified: tinytim/trunk/src/main/java/org/tinytim/internal/api/IVariant.java =================================================================== --- tinytim/trunk/src/main/java/org/tinytim/internal/api/IVariant.java 2009-08-18 12:54:43 UTC (rev 355) +++ tinytim/trunk/src/main/java/org/tinytim/internal/api/IVariant.java 2009-08-27 13:08:17 UTC (rev 356) @@ -26,4 +26,6 @@ */ public interface IVariant extends Variant, IScoped, ILiteralAware, IMovable<Name> { + public IName getParent(); + } Modified: tinytim/trunk/src/main/java/org/tinytim/internal/utils/Check.java =================================================================== --- tinytim/trunk/src/main/java/org/tinytim/internal/utils/Check.java 2009-08-18 12:54:43 UTC (rev 355) +++ tinytim/trunk/src/main/java/org/tinytim/internal/utils/Check.java 2009-08-27 13:08:17 UTC (rev 356) @@ -47,9 +47,9 @@ } /** - * + * Throws an {@link IllegalArgumentException}. * - * @param msg + * @param msg The error message. */ private static void _reportIllegalArgument(String msg) { throw new IllegalArgumentException(msg); @@ -75,7 +75,7 @@ * @param sender The sender. * @param scope The scope. */ - public static void scopeNotNull(Construct sender, Collection<Topic> scope) { + public static void scopeNotNull(Construct sender, Iterable<Topic> scope) { if (scope == null) { _reportModelConstraintViolation(sender, "The scope must not be null"); } @@ -200,6 +200,13 @@ _sameTopicMap(sender, sender.getTopicMap(), construct); } + /** + * Throws a {@link ModelConstraintException} iff the specified <tt>constructs</tt> + * do not belong to the same topic map as the <tt>sender</tt>. + * + * @param sender The sender. + * @param constructs The constructs. + */ public static void sameTopicMap(Construct sender, Construct...constructs) { if (constructs == null || constructs.length == 0) { return; @@ -210,6 +217,13 @@ } } + /** + * Throws a {@link ModelConstraintException} iff the specified <tt>constructs</tt> + * do not belong to the same topic map as the <tt>sender</tt>. + * + * @param sender The sender. + * @param constructs The constructs. + */ public static void sameTopicMap(Construct sender, Collection<? extends Construct> constructs) { if (constructs == null) { return; Modified: tinytim/trunk/src/main/java/org/tinytim/internal/utils/CopyUtils.java =================================================================== --- tinytim/trunk/src/main/java/org/tinytim/internal/utils/CopyUtils.java 2009-08-18 12:54:43 UTC (rev 355) +++ tinytim/trunk/src/main/java/org/tinytim/internal/utils/CopyUtils.java 2009-08-27 13:08:17 UTC (rev 356) @@ -20,6 +20,7 @@ import org.tinytim.internal.api.ILiteralAware; import org.tinytim.internal.api.IName; +import org.tinytim.internal.api.IScope; import org.tinytim.internal.api.ITopic; import org.tinytim.internal.api.ITopicMap; @@ -126,9 +127,9 @@ * @param mergeMap The map which holds the merge mappings. * @return The newly created topic in the target topic map. */ - private static Topic _copyTopic(Topic topic, ITopicMap target, + private static ITopic _copyTopic(Topic topic, ITopicMap target, Map<Topic, Topic> mergeMap) { - Topic targetTopic = target.getConstructFactory().createTopic(); + ITopic targetTopic = target.createEmptyTopic(); _copyIdentities(topic, ... [truncated message content] |
From: <lh...@us...> - 2009-10-09 11:54:55
|
Revision: 359 http://tinytim.svn.sourceforge.net/tinytim/?rev=359&view=rev Author: lheuer Date: 2009-10-09 11:54:46 +0000 (Fri, 09 Oct 2009) Log Message: ----------- Update to TMAPI 2.0b1 (unofficial build), update to trove 2.1.0 Modified Paths: -------------- tinytim/trunk/build.xml tinytim/trunk/src/main/java/org/tinytim/core/TopicMapSystemFactoryImpl.java tinytim/trunk/src/main/java/org/tinytim/utils/Feature.java Added Paths: ----------- tinytim/trunk/lib/tmapi-2.0b1-tests.jar tinytim/trunk/lib/tmapi-2.0b1.jar tinytim/trunk/lib/trove-2.1.0.jar Removed Paths: ------------- tinytim/trunk/lib/tmapi-2.0a2-tests.jar tinytim/trunk/lib/tmapi-2.0a2.jar tinytim/trunk/lib/trove-2.0.4.jar Modified: tinytim/trunk/build.xml =================================================================== --- tinytim/trunk/build.xml 2009-09-28 14:15:42 UTC (rev 358) +++ tinytim/trunk/build.xml 2009-10-09 11:54:46 UTC (rev 359) @@ -11,10 +11,10 @@ <property name="dir.coverage" value="${basedir}/coverage"/> <property name="lib.junit" value="${dir.lib}/junit-4.5.jar"/> - <property name="lib.trove" value="${dir.lib}/trove-2.0.4.jar"/> + <property name="lib.trove" value="${dir.lib}/trove-2.1.0.jar"/> <property name="lib.mio" value="${dir.lib}/semagia-mio-0.9.5.jar"/> - <property name="lib.tmapi" value="${dir.lib}/tmapi-2.0a2.jar"/> - <property name="lib.tmapi.tests" value="${dir.lib}/tmapi-2.0a2-tests.jar"/> + <property name="lib.tmapi" value="${dir.lib}/tmapi-2.0b1.jar"/> + <property name="lib.tmapi.tests" value="${dir.lib}/tmapi-2.0b1-tests.jar"/> <property name="lib.emma" value="${dir.lib}/emma.jar"/> <property name="lib.emma.task" value="${dir.lib}/emma_ant.jar"/> Deleted: tinytim/trunk/lib/tmapi-2.0a2-tests.jar =================================================================== (Binary files differ) Deleted: tinytim/trunk/lib/tmapi-2.0a2.jar =================================================================== (Binary files differ) Added: tinytim/trunk/lib/tmapi-2.0b1-tests.jar =================================================================== (Binary files differ) Property changes on: tinytim/trunk/lib/tmapi-2.0b1-tests.jar ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: tinytim/trunk/lib/tmapi-2.0b1.jar =================================================================== (Binary files differ) Property changes on: tinytim/trunk/lib/tmapi-2.0b1.jar ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Deleted: tinytim/trunk/lib/trove-2.0.4.jar =================================================================== (Binary files differ) Added: tinytim/trunk/lib/trove-2.1.0.jar =================================================================== (Binary files differ) Property changes on: tinytim/trunk/lib/trove-2.1.0.jar ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Modified: tinytim/trunk/src/main/java/org/tinytim/core/TopicMapSystemFactoryImpl.java =================================================================== --- tinytim/trunk/src/main/java/org/tinytim/core/TopicMapSystemFactoryImpl.java 2009-09-28 14:15:42 UTC (rev 358) +++ tinytim/trunk/src/main/java/org/tinytim/core/TopicMapSystemFactoryImpl.java 2009-10-09 11:54:46 UTC (rev 359) @@ -41,7 +41,8 @@ private static final FeatureInfo[] _FEATURES = new FeatureInfo[] { // Feature IRI, default value, fixed? new FeatureInfo(Feature.AUTOMERGE, false, true), - new FeatureInfo(Feature.READ_ONLY, false, true) + new FeatureInfo(Feature.READ_ONLY, false, true), + new FeatureInfo(Feature.TYPE_INSTANCE_ASSOCS, false, true) }; private static final TMSystemInfo[] _SYSTEMS = new TMSystemInfo[] { Modified: tinytim/trunk/src/main/java/org/tinytim/utils/Feature.java =================================================================== --- tinytim/trunk/src/main/java/org/tinytim/utils/Feature.java 2009-09-28 14:15:42 UTC (rev 358) +++ tinytim/trunk/src/main/java/org/tinytim/utils/Feature.java 2009-10-09 11:54:46 UTC (rev 359) @@ -34,6 +34,12 @@ private static final String _FEATURE_BASE = "http://tmapi.org/features/"; /** + * An implementation which supports this feature uses associations + * to model tmdm:type-instance relationships. + */ + public static final String TYPE_INSTANCE_ASSOCS= _FEATURE_BASE + "type-instance-associations"; + + /** * An implementation which supports this feature can process locator * addresses in URI notation as defined by RFC 2396. * This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lh...@us...> - 2009-11-04 16:58:52
|
Revision: 360 http://tinytim.svn.sourceforge.net/tinytim/?rev=360&view=rev Author: lheuer Date: 2009-11-04 16:58:30 +0000 (Wed, 04 Nov 2009) Log Message: ----------- Switch to Ontopia's Compact*Set, removed trove Modified Paths: -------------- tinytim/trunk/README.txt tinytim/trunk/build.xml tinytim/trunk/src/main/java/org/tinytim/internal/utils/CollectionFactory.java tinytim/trunk/src/main/java/org/tinytim/internal/utils/CopyUtils.java tinytim/trunk/src/test/java/org/tinytim/core/AllTests.java Added Paths: ----------- tinytim/trunk/lib/tmapi-2.0RC1-tests.jar tinytim/trunk/lib/tmapi-2.0RC1.jar tinytim/trunk/src/main/java/org/tinytim/internal/utils/CompactHashSet.java tinytim/trunk/src/main/java/org/tinytim/internal/utils/CompactIdentityHashSet.java tinytim/trunk/src/main/java/org/tinytim/internal/utils/OntopiaCollectionFactory.java tinytim/trunk/src/main/java/org/tinytim/mio/CXTMTopicMapWriter.java tinytim/trunk/src/main/java/org/tinytim/mio/XMLC14NWriter.java Removed Paths: ------------- tinytim/trunk/lib/LICENSE.trove.txt tinytim/trunk/lib/tmapi-2.0b1-tests.jar tinytim/trunk/lib/tmapi-2.0b1.jar tinytim/trunk/lib/trove-2.1.0.jar tinytim/trunk/src/main/java/org/tinytim/internal/utils/JavaCollectionFactory.java tinytim/trunk/src/main/java/org/tinytim/internal/utils/TroveCollectionFactory.java Modified: tinytim/trunk/README.txt =================================================================== --- tinytim/trunk/README.txt 2009-10-09 11:54:46 UTC (rev 359) +++ tinytim/trunk/README.txt 2009-11-04 16:58:30 UTC (rev 360) @@ -12,10 +12,9 @@ Installation ------------ No real installation needed, simply put the ``tinytim-2.0.0a6.jar`` and -``tmapi-2.0a2.jar`` into your classpath. That's all. :) -Optionally, you can put the ``trove-<VERSION>.jar`` into your classpath which -makes tinyTiM slightly more memory efficient and faster. +``tmapi-2*.jar`` into your classpath. That's all. :) + Mailing List ------------ If you have questions or suggestions, use our mailinglist Modified: tinytim/trunk/build.xml =================================================================== --- tinytim/trunk/build.xml 2009-10-09 11:54:46 UTC (rev 359) +++ tinytim/trunk/build.xml 2009-11-04 16:58:30 UTC (rev 360) @@ -11,10 +11,9 @@ <property name="dir.coverage" value="${basedir}/coverage"/> <property name="lib.junit" value="${dir.lib}/junit-4.5.jar"/> - <property name="lib.trove" value="${dir.lib}/trove-2.1.0.jar"/> <property name="lib.mio" value="${dir.lib}/semagia-mio-0.9.5.jar"/> - <property name="lib.tmapi" value="${dir.lib}/tmapi-2.0b1.jar"/> - <property name="lib.tmapi.tests" value="${dir.lib}/tmapi-2.0b1-tests.jar"/> + <property name="lib.tmapi" value="${dir.lib}/tmapi-2.0RC1.jar"/> + <property name="lib.tmapi.tests" value="${dir.lib}/tmapi-2.0RC1-tests.jar"/> <property name="lib.emma" value="${dir.lib}/emma.jar"/> <property name="lib.emma.task" value="${dir.lib}/emma_ant.jar"/> @@ -68,7 +67,6 @@ <pathelement location="${lib.mio}"/> <pathelement location="${lib.tmapi}"/> <pathelement location="${lib.tmapi.tests}"/> - <pathelement location="${lib.trove}"/> </path> </target> @@ -103,7 +101,6 @@ <pathelement location="${lib.mio}"/> <pathelement location="${lib.tmapi}"/> <pathelement location="${lib.tmapi.tests}"/> - <pathelement location="${lib.trove}"/> </classpath> <src path="${dir.test}"/> </javac> @@ -134,7 +131,6 @@ <pathelement location="${lib.mio}"/> <pathelement location="${lib.tmapi}"/> <pathelement location="${lib.tmapi.tests}"/> - <pathelement location="${lib.trove}"/> </classpath> <src path="${dir.test}"/> </javac> @@ -158,7 +154,6 @@ target="1.5"> <classpath> <pathelement location="${lib.tmapi}"/> - <pathelement location="${lib.trove}"/> <pathelement location="${lib.mio}"/> </classpath> <src path="${dir.src}"/> @@ -253,7 +248,6 @@ <include name="trove*"/> <include name="LICENSE.tmapi*"/> <include name="LICENSE.junit*"/> - <include name="LICENSE.trove*"/> </fileset> </copy> Deleted: tinytim/trunk/lib/LICENSE.trove.txt =================================================================== --- tinytim/trunk/lib/LICENSE.trove.txt 2009-10-09 11:54:46 UTC (rev 359) +++ tinytim/trunk/lib/LICENSE.trove.txt 2009-11-04 16:58:30 UTC (rev 360) @@ -1,528 +0,0 @@ -The Trove library is licensed under the Lesser GNU Public License, -which is included with the distribution in a file called LICENSE.txt. - -Other license arrangements are possible, for a fee: contact -e...@us... for terms/pricing. - -The PrimeFinder and HashFunctions classes in Trove are subject to the -following license restrictions: - -Copyright (c) 1999 CERN - European Organization for Nuclear Research. - -Permission to use, copy, modify, distribute and sell this software and -its documentation for any purpose is hereby granted without fee, -provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in -supporting documentation. CERN makes no representations about the -suitability of this software for any purpose. It is provided "as is" -without expressed or implied warranty. - - - -Content of Trove's LICENSE.txt: - - - GNU LESSER GENERAL PUBLIC LICENSE - Version 2.1, February 1999 - - Copyright (C) 1991, 1999 Free Software Foundation, Inc. - 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - -[This is the first released version of the Lesser GPL. It also counts - as the successor of the GNU Library Public License, version 2, hence - the version number 2.1.] - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -Licenses are intended to guarantee your freedom to share and change -free software--to make sure the software is free for all its users. - - This license, the Lesser General Public License, applies to some -specially designated software packages--typically libraries--of the -Free Software Foundation and other authors who decide to use it. You -can use it too, but we suggest you first think carefully about whether -this license or the ordinary General Public License is the better -strategy to use in any particular case, based on the explanations below. - - When we speak of free software, we are referring to freedom of use, -not price. Our General Public Licenses are designed to make sure that -you have the freedom to distribute copies of free software (and charge -for this service if you wish); that you receive source code or can get -it if you want it; that you can change the software and use pieces of -it in new free programs; and that you are informed that you can do -these things. - - To protect your rights, we need to make restrictions that forbid -distributors to deny you these rights or to ask you to surrender these -rights. These restrictions translate to certain responsibilities for -you if you distribute copies of the library or if you modify it. - - For example, if you distribute copies of the library, whether gratis -or for a fee, you must give the recipients all the rights that we gave -you. You must make sure that they, too, receive or can get the source -code. If you link other code with the library, you must provide -complete object files to the recipients, so that they can relink them -with the library after making changes to the library and recompiling -it. And you must show them these terms so they know their rights. - - We protect your rights with a two-step method: (1) we copyright the -library, and (2) we offer you this license, which gives you legal -permission to copy, distribute and/or modify the library. - - To protect each distributor, we want to make it very clear that -there is no warranty for the free library. Also, if the library is -modified by someone else and passed on, the recipients should know -that what they have is not the original version, so that the original -author's reputation will not be affected by problems that might be -introduced by others. - - Finally, software patents pose a constant threat to the existence of -any free program. We wish to make sure that a company cannot -effectively restrict the users of a free program by obtaining a -restrictive license from a patent holder. Therefore, we insist that -any patent license obtained for a version of the library must be -consistent with the full freedom of use specified in this license. - - Most GNU software, including some libraries, is covered by the -ordinary GNU General Public License. This license, the GNU Lesser -General Public License, applies to certain designated libraries, and -is quite different from the ordinary General Public License. We use -this license for certain libraries in order to permit linking those -libraries into non-free programs. - - When a program is linked with a library, whether statically or using -a shared library, the combination of the two is legally speaking a -combined work, a derivative of the original library. The ordinary -General Public License therefore permits such linking only if the -entire combination fits its criteria of freedom. The Lesser General -Public License permits more lax criteria for linking other code with -the library. - - We call this license the "Lesser" General Public License because it -does Less to protect the user's freedom than the ordinary General -Public License. It also provides other free software developers Less -of an advantage over competing non-free programs. These disadvantages -are the reason we use the ordinary General Public License for many -libraries. However, the Lesser license provides advantages in certain -special circumstances. - - For example, on rare occasions, there may be a special need to -encourage the widest possible use of a certain library, so that it becomes -a de-facto standard. To achieve this, non-free programs must be -allowed to use the library. A more frequent case is that a free -library does the same job as widely used non-free libraries. In this -case, there is little to gain by limiting the free library to free -software only, so we use the Lesser General Public License. - - In other cases, permission to use a particular library in non-free -programs enables a greater number of people to use a large body of -free software. For example, permission to use the GNU C Library in -non-free programs enables many more people to use the whole GNU -operating system, as well as its variant, the GNU/Linux operating -system. - - Although the Lesser General Public License is Less protective of the -users' freedom, it does ensure that the user of a program that is -linked with the Library has the freedom and the wherewithal to run -that program using a modified version of the Library. - - The precise terms and conditions for copying, distribution and -modification follow. Pay close attention to the difference between a -"work based on the library" and a "work that uses the library". The -former contains code derived from the library, whereas the latter must -be combined with the library in order to run. - - GNU LESSER GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License Agreement applies to any software library or other -program which contains a notice placed by the copyright holder or -other authorized party saying it may be distributed under the terms of -this Lesser General Public License (also called "this License"). -Each licensee is addressed as "you". - - A "library" means a collection of software functions and/or data -prepared so as to be conveniently linked with application programs -(which use some of those functions and data) to form executables. - - The "Library", below, refers to any such software library or work -which has been distributed under these terms. A "work based on the -Library" means either the Library or any derivative work under -copyright law: that is to say, a work containing the Library or a -portion of it, either verbatim or with modifications and/or translated -straightforwardly into another language. (Hereinafter, translation is -included without limitation in the term "modification".) - - "Source code" for a work means the preferred form of the work for -making modifications to it. For a library, complete source code means -all the source code for all modules it contains, plus any associated -interface definition files, plus the scripts used to control compilation -and installation of the library. - - Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running a program using the Library is not restricted, and output from -such a program is covered only if its contents constitute a work based -on the Library (independent of the use of the Library in a tool for -writing it). Whether that is true depends on what the Library does -and what the program that uses the Library does. - - 1. You may copy and distribute verbatim copies of the Library's -complete source code as you receive it, in any medium, provided that -you conspicuously and appropriately publish on each copy an -appropriate copyright notice and disclaimer of warranty; keep intact -all the notices that refer to this License and to the absence of any -warranty; and distribute a copy of this License along with the -Library. - - You may charge a fee for the physical act of transferring a copy, -and you may at your option offer warranty protection in exchange for a -fee. - - 2. You may modify your copy or copies of the Library or any portion -of it, thus forming a work based on the Library, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) The modified work must itself be a software library. - - b) You must cause the files modified to carry prominent notices - stating that you changed the files and the date of any change. - - c) You must cause the whole of the work to be licensed at no - charge to all third parties under the terms of this License. - - d) If a facility in the modified Library refers to a function or a - table of data to be supplied by an application program that uses - the facility, other than as an argument passed when the facility - is invoked, then you must make a good faith effort to ensure that, - in the event an application does not supply such function or - table, the facility still operates, and performs whatever part of - its purpose remains meaningful. - - (For example, a function in a library to compute square roots has - a purpose that is entirely well-defined independent of the - application. Therefore, Subsection 2d requires that any - application-supplied function or table used by this function must - be optional: if the application does not supply it, the square - root function must still compute square roots.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Library, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Library, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote -it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Library. - -In addition, mere aggregation of another work not based on the Library -with the Library (or with a work based on the Library) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may opt to apply the terms of the ordinary GNU General Public -License instead of this License to a given copy of the Library. To do -this, you must alter all the notices that refer to this License, so -that they refer to the ordinary GNU General Public License, version 2, -instead of to this License. (If a newer version than version 2 of the -ordinary GNU General Public License has appeared, then you can specify -that version instead if you wish.) Do not make any other change in -these notices. - - Once this change is made in a given copy, it is irreversible for -that copy, so the ordinary GNU General Public License applies to all -subsequent copies and derivative works made from that copy. - - This option is useful when you wish to copy part of the code of -the Library into a program that is not a library. - - 4. You may copy and distribute the Library (or a portion or -derivative of it, under Section 2) in object code or executable form -under the terms of Sections 1 and 2 above provided that you accompany -it with the complete corresponding machine-readable source code, which -must be distributed under the terms of Sections 1 and 2 above on a -medium customarily used for software interchange. - - If distribution of object code is made by offering access to copy -from a designated place, then offering equivalent access to copy the -source code from the same place satisfies the requirement to -distribute the source code, even though third parties are not -compelled to copy the source along with the object code. - - 5. A program that contains no derivative of any portion of the -Library, but is designed to work with the Library by being compiled or -linked with it, is called a "work that uses the Library". Such a -work, in isolation, is not a derivative work of the Library, and -therefore falls outside the scope of this License. - - However, linking a "work that uses the Library" with the Library -creates an executable that is a derivative of the Library (because it -contains portions of the Library), rather than a "work that uses the -library". The executable is therefore covered by this License. -Section 6 states terms for distribution of such executables. - - When a "work that uses the Library" uses material from a header file -that is part of the Library, the object code for the work may be a -derivative work of the Library even though the source code is not. -Whether this is true is especially significant if the work can be -linked without the Library, or if the work is itself a library. The -threshold for this to be true is not precisely defined by law. - - If such an object file uses only numerical parameters, data -structure layouts and accessors, and small macros and small inline -functions (ten lines or less in length), then the use of the object -file is unrestricted, regardless of whether it is legally a derivative -work. (Executables containing this object code plus portions of the -Library will still fall under Section 6.) - - Otherwise, if the work is a derivative of the Library, you may -distribute the object code for the work under the terms of Section 6. -Any executables containing that work also fall under Section 6, -whether or not they are linked directly with the Library itself. - - 6. As an exception to the Sections above, you may also combine or -link a "work that uses the Library" with the Library to produce a -work containing portions of the Library, and distribute that work -under terms of your choice, provided that the terms permit -modification of the work for the customer's own use and reverse -engineering for debugging such modifications. - - You must give prominent notice with each copy of the work that the -Library is used in it and that the Library and its use are covered by -this License. You must supply a copy of this License. If the work -during execution displays copyright notices, you must include the -copyright notice for the Library among them, as well as a reference -directing the user to the copy of this License. Also, you must do one -of these things: - - a) Accompany the work with the complete corresponding - machine-readable source code for the Library including whatever - changes were used in the work (which must be distributed under - Sections 1 and 2 above); and, if the work is an executable linked - with the Library, with the complete machine-readable "work that - uses the Library", as object code and/or source code, so that the - user can modify the Library and then relink to produce a modified - executable containing the modified Library. (It is understood - that the user who changes the contents of definitions files in the - Library will not necessarily be able to recompile the application - to use the modified definitions.) - - b) Use a suitable shared library mechanism for linking with the - Library. A suitable mechanism is one that (1) uses at run time a - copy of the library already present on the user's computer system, - rather than copying library functions into the executable, and (2) - will operate properly with a modified version of the library, if - the user installs one, as long as the modified version is - interface-compatible with the version that the work was made with. - - c) Accompany the work with a written offer, valid for at - least three years, to give the same user the materials - specified in Subsection 6a, above, for a charge no more - than the cost of performing this distribution. - - d) If distribution of the work is made by offering access to copy - from a designated place, offer equivalent access to copy the above - specified materials from the same place. - - e) Verify that the user has already received a copy of these - materials or that you have already sent this user a copy. - - For an executable, the required form of the "work that uses the -Library" must include any data and utility programs needed for -reproducing the executable from it. However, as a special exception, -the materials to be distributed need not include anything that is -normally distributed (in either source or binary form) with the major -components (compiler, kernel, and so on) of the operating system on -which the executable runs, unless that component itself accompanies -the executable. - - It may happen that this requirement contradicts the license -restrictions of other proprietary libraries that do not normally -accompany the operating system. Such a contradiction means you cannot -use both them and the Library together in an executable that you -distribute. - - 7. You may place library facilities that are a work based on the -Library side-by-side in a single library together with other library -facilities not covered by this License, and distribute such a combined -library, provided that the separate distribution of the work based on -the Library and of the other library facilities is otherwise -permitted, and provided that you do these two things: - - a) Accompany the combined library with a copy of the same work - based on the Library, uncombined with any other library - facilities. This must be distributed under the terms of the - Sections above. - - b) Give prominent notice with the combined library of the fact - that part of it is a work based on the Library, and explaining - where to find the accompanying uncombined form of the same work. - - 8. You may not copy, modify, sublicense, link with, or distribute -the Library except as expressly provided under this License. Any -attempt otherwise to copy, modify, sublicense, link with, or -distribute the Library is void, and will automatically terminate your -rights under this License. However, parties who have received copies, -or rights, from you under this License will not have their licenses -terminated so long as such parties remain in full compliance. - - 9. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Library or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Library (or any work based on the -Library), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Library or works based on it. - - 10. Each time you redistribute the Library (or any work based on the -Library), the recipient automatically receives a license from the -original licensor to copy, distribute, link with or modify the Library -subject to these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties with -this License. - - 11. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Library at all. For example, if a patent -license would not permit royalty-free redistribution of the Library by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Library. - -If any portion of this section is held invalid or unenforceable under any -particular circumstance, the balance of the section is intended to apply, -and the section as a whole is intended to apply in other circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 12. If the distribution and/or use of the Library is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Library under this License may add -an explicit geographical distribution limitation excluding those countries, -so that distribution is permitted only in or among countries not thus -excluded. In such case, this License incorporates the limitation as if -written in the body of this License. - - 13. The Free Software Foundation may publish revised and/or new -versions of the Lesser General Public License from time to time. -Such new versions will be similar in spirit to the present version, -but may differ in detail to address new problems or concerns. - -Each version is given a distinguishing version number. If the Library -specifies a version number of this License which applies to it and -"any later version", you have the option of following the terms and -conditions either of that version or of any later version published by -the Free Software Foundation. If the Library does not specify a -license version number, you may choose any version ever published by -the Free Software Foundation. - - 14. If you wish to incorporate parts of the Library into other free -programs whose distribution conditions are incompatible with these, -write to the author to ask for permission. For software which is -copyrighted by the Free Software Foundation, write to the Free -Software Foundation; we sometimes make exceptions for this. Our -decision will be guided by the two goals of preserving the free status -of all derivatives of our free software and of promoting the sharing -and reuse of software generally. - - NO WARRANTY - - 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO -WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. -EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR -OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY -KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE -LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME -THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN -WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY -AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU -FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR -CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE -LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING -RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A -FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF -SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Libraries - - If you develop a new library, and you want it to be of the greatest -possible use to the public, we recommend making it free software that -everyone can redistribute and change. You can do so by permitting -redistribution under these terms (or, alternatively, under the terms of the -ordinary General Public License). - - To apply these terms, attach the following notices to the library. It is -safest to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least the -"copyright" line and a pointer to where the full notice is found. - - <one line to give the library's name and a brief idea of what it does.> - Copyright (C) <year> <name of author> - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -Also add information on how to contact you by electronic and paper mail. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the library, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the - library `Frob' (a library for tweaking knobs) written by James Random Hacker. - - <signature of Ty Coon>, 1 April 1990 - Ty Coon, President of Vice - -That's all there is to it! - - Added: tinytim/trunk/lib/tmapi-2.0RC1-tests.jar =================================================================== (Binary files differ) Property changes on: tinytim/trunk/lib/tmapi-2.0RC1-tests.jar ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: tinytim/trunk/lib/tmapi-2.0RC1.jar =================================================================== (Binary files differ) Property changes on: tinytim/trunk/lib/tmapi-2.0RC1.jar ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Deleted: tinytim/trunk/lib/tmapi-2.0b1-tests.jar =================================================================== (Binary files differ) Deleted: tinytim/trunk/lib/tmapi-2.0b1.jar =================================================================== (Binary files differ) Deleted: tinytim/trunk/lib/trove-2.1.0.jar =================================================================== (Binary files differ) Modified: tinytim/trunk/src/main/java/org/tinytim/internal/utils/CollectionFactory.java =================================================================== --- tinytim/trunk/src/main/java/org/tinytim/internal/utils/CollectionFactory.java 2009-10-09 11:54:46 UTC (rev 359) +++ tinytim/trunk/src/main/java/org/tinytim/internal/utils/CollectionFactory.java 2009-11-04 16:58:30 UTC (rev 360) @@ -31,22 +31,8 @@ */ public final class CollectionFactory { - private static final String _COLL_FACTORY_TROVE = "org.tinytim.internal.utils.TroveCollectionFactory"; + private static final ICollectionFactory _COLL_FACTORY = new OntopiaCollectionFactory(); - private static final ICollectionFactory _COLL_FACTORY; - - static { - ICollectionFactory collFactory; - try { - Class.forName("gnu.trove.THashSet"); - collFactory = (ICollectionFactory) Class.forName(_COLL_FACTORY_TROVE).newInstance(); - } - catch (Exception ex) { - collFactory = new JavaCollectionFactory(); - } - _COLL_FACTORY = collFactory; - } - private CollectionFactory() { // noop. } Added: tinytim/trunk/src/main/java/org/tinytim/internal/utils/CompactHashSet.java =================================================================== --- tinytim/trunk/src/main/java/org/tinytim/internal/utils/CompactHashSet.java (rev 0) +++ tinytim/trunk/src/main/java/org/tinytim/internal/utils/CompactHashSet.java 2009-11-04 16:58:30 UTC (rev 360) @@ -0,0 +1,361 @@ + +// $Id$ + +package org.tinytim.internal.utils; + +// WARNING: If you do any changes to this class, make sure that you +// update CompactIdentityHashSet.java, UniqueSet.java and +// SoftHashMapIndex.java accordingly. + +import java.util.Collection; +import java.util.ConcurrentModificationException; +import java.util.Iterator; +import java.util.NoSuchElementException; + +/** + * INTERNAL: Implements the Set interface more compactly than + * java.util.HashSet by using a closed hashtable. + */ +class CompactHashSet<E> extends java.util.AbstractSet<E> { + + protected final static int INITIAL_SIZE = 3; + protected final static double LOAD_FACTOR = 0.75; + + /** + * This object is used to represent null, should clients add that to the set. + */ + protected final static Object nullObject = new Object(); + /** + * When an object is deleted this object is put into the hashtable + * in its place, so that other objects with the same key + * (collisions) further down the hashtable are not lost after we + * delete an object in the collision chain. + */ + protected final static Object deletedObject = new Object(); + protected int elements; + protected int freecells; + protected Object[] objects; + protected int modCount; + + /** + * Constructs a new, empty set. + */ + public CompactHashSet() { + objects = new Object[INITIAL_SIZE]; + elements = 0; + freecells = objects.length; + modCount = 0; + } + + /** + * Constructs a new, empty set. + */ + public CompactHashSet(int size) { + // NOTE: If array size is 0, we get a + // "java.lang.ArithmeticException: / by zero" in add(Object). + objects = new Object[(size==0 ? 1 : size)]; + elements = 0; + freecells = objects.length; + modCount = 0; + } + + /** + * Constructs a new set containing the elements in the specified + * collection. + * + * @param c the collection whose elements are to be placed into this set. + */ + public CompactHashSet(Collection c) { + this(c.size()); + addAll(c); + } + + // ===== SET IMPLEMENTATION ============================================= + + /** + * Returns an iterator over the elements in this set. The elements + * are returned in no particular order. + * + * @return an Iterator over the elements in this set. + * @see ConcurrentModificationException + */ + public Iterator iterator() { + return new CompactHashIterator(); + } + + /** + * Returns the number of elements in this set (its cardinality). + */ + public int size() { + return elements; + } + + /** + * Returns <tt>true</tt> if this set contains no elements. + */ + public boolean isEmpty() { + return elements == 0; + } + + /** + * Returns <tt>true</tt> if this set contains the specified element. + * + * @param o element whose presence in this set is to be tested. + * @return <tt>true</tt> if this set contains the specified element. + */ + public boolean contains(Object o) { + if (o == null) o = nullObject; + + int hash = o.hashCode(); + int index = (hash & 0x7FFFFFFF) % objects.length; + int offset = 1; + + // search for the object (continue while !null and !this object) + while(objects[index] != null && + !(objects[index].hashCode() == hash && + objects[index].equals(o))) { + index = ((index + offset) & 0x7FFFFFFF) % objects.length; + offset = offset*2 + 1; + + if (offset == -1) + offset = 2; + } + + return objects[index] != null; + } + + /** + * Adds the specified element to this set if it is not already + * present. + * + * @param o element to be added to this set. + * @return <tt>true</tt> if the set did not already contain the specified + * element. + */ + public boolean add(Object o) { + if (o == null) o = nullObject; + + int hash = o.hashCode(); + int index = (hash & 0x7FFFFFFF) % objects.length; + int offset = 1; + int deletedix = -1; + + // search for the object (continue while !null and !this object) + while(objects[index] != null && + !(objects[index].hashCode() == hash && + objects[index].equals(o))) { + + // if there's a deleted object here we can put this object here, + // provided it's not in here somewhere else already + if (objects[index] == deletedObject) + deletedix = index; + + index = ((index + offset) & 0x7FFFFFFF) % objects.length; + offset = offset*2 + 1; + + if (offset == -1) + offset = 2; + } + + if (objects[index] == null) { // wasn't present already + if (deletedix != -1) // reusing a deleted cell + index = deletedix; + else + freecells--; + + modCount++; + elements++; + objects[index] = o; + + // rehash with same capacity + if (1 - (freecells / (double) objects.length) > LOAD_FACTOR) { + rehash(objects.length); + // rehash with increased capacity + if (1 - (freecells / (double) objects.length) > LOAD_FACTOR) { + rehash(objects.length*2 + 1); + } + } + return true; + } else // was there already + return false; + } + + /** + * Removes the specified element from the set. + */ + public boolean remove(Object o) { + if (o == null) o = nullObject; + + int hash = o.hashCode(); + int index = (hash & 0x7FFFFFFF) % objects.length; + int offset = 1; + + // search for the object (continue while !null and !this object) + while(objects[index] != null && + !(objects[index].hashCode() == hash && + objects[index].equals(o))) { + index = ((index + offset) & 0x7FFFFFFF) % objects.length; + offset = offset*2 + 1; + + if (offset == -1) + offset = 2; + } + + // we found the right position, now do the removal + if (objects[index] != null) { + // we found the object + objects[index] = deletedObject; + modCount++; + elements--; + return true; + } else + // we did not find the object + return false; + } + + /** + * Removes all of the elements from this set. + */ + public void clear() { + elements = 0; + for (int ix = 0; ix < objects.length; ix++) + objects[ix] = null; + freecells = objects.length; + modCount++; + } + + public Object[] toArray() { + Object[] result = new Object[elements]; + Object[] objects = this.objects; + int pos = 0; + for (int i = 0; i < objects.length; i++) + if (objects[i] != null && objects[i] != deletedObject) { + if (objects[i] == nullObject) + result[pos++] = null; + else + result[pos++] = objects[i]; + } + return result; + } + + public Object[] toArray(Object a[]) { + int size = elements; + if (a.length < size) + a = (Object[])java.lang.reflect.Array.newInstance( + a.getClass().getComponentType(), size); + Object[] objects = this.objects; + int pos = 0; + for (int i = 0; i < objects.length; i++) + if (objects[i] != null && objects[i] != deletedObject) { + if (objects[i] == nullObject) + a[pos++] = null; + else + a[pos++] = objects[i]; + } + return a; + } + + // ===== INTERNAL METHODS =============================================== + + /** + * INTERNAL: Used for debugging only. + */ + public void dump() { + System.out.println("Size: " + objects.length); + System.out.println("Elements: " + elements); + System.out.println("Free cells: " + freecells); + System.out.println(); + for (int ix = 0; ix < objects.length; ix++) + System.out.println("[" + ix + "]: " + objects[ix]); + } + + /** + * INTERNAL: Rehashes the hashset to a bigger size. + */ + protected void rehash(int newCapacity) { + int oldCapacity = objects.length; + Object[] newObjects = new Object[newCapacity]; + + for (int ix = 0; ix < oldCapacity; ix++) { + Object o = objects[ix]; + if (o == null || o == deletedObject) + continue; + + int hash = o.hashCode(); + int index = (hash & 0x7FFFFFFF) % newCapacity; + int offset = 1; + + // search for the object + while(newObjects[index] != null) { // no need to test for duplicates + index = ((index + offset) & 0x7FFFFFFF) % newCapacity; + offset = offset*2 + 1; + + if (offset == -1) + offset = 2; + } + + newObjects[index] = o; + } + + objects = newObjects; + freecells = objects.length - elements; + } + + // ===== ITERATOR IMPLEMENTATON ========================================= + + private class CompactHashIterator implements Iterator { + private int index; + private int lastReturned = -1; + + /** + * The modCount value that the iterator believes that the backing + * CompactHashSet should have. If this expectation is violated, + * the iterator has detected concurrent modification. + */ + private int expectedModCount; + + public CompactHashIterator() { + for (index = 0; index < objects.length && + (objects[index] == null || + objects[index] == deletedObject); index++) + ; + expectedModCount = modCount; + } + + public boolean hasNext() { + return index < objects.length; + } + + public Object next() { + if (modCount != expectedModCount) + throw new ConcurrentModificationException(); + if (index >= objects.length) { + lastReturned = -2; + throw new NoSuchElementException(); + } + + lastReturned = index; + for (index += 1; index < objects.length && + (objects[index] == null || + objects[index] == deletedObject); index++) + ; + if (objects[lastReturned] == nullObject) + return null; + else + return objects[lastReturned]; + } + + public void remove() { + if (modCount != expectedModCount) + throw new ConcurrentModificationException(); + if (lastReturned == -1 || lastReturned == -2) + throw new IllegalStateException(); + // delete object + if (objects[lastReturned] != null && objects[lastReturned] != deletedObject) { + objects[lastReturned] = deletedObject; + elements--; + } + } + } + +} Property changes on: tinytim/trunk/src/main/java/org/tinytim/internal/utils/CompactHashSet.java ___________________________________________________________________ Added: svn:keywords + Rev Date Id Added: svn:eol-style + native Added: tinytim/trunk/src/main/java/org/tinytim/internal/utils/CompactIdentityHashSet.java =================================================================== --- tinytim/trunk/src/main/java/org/tinytim/internal/utils/CompactIdentityHashSet.java (rev 0) +++ tinytim/trunk/src/main/java/org/tinytim/internal/utils/CompactIdentityHashSet.java 2009-11-04 16:58:30 UTC (rev 360) @@ -0,0 +1,172 @@ + +// $Id$ + +package org.tinytim.internal.utils; + +// WARNING: This class is a direct copy of the CompactHashSet.java +// class, but with two changes. The while(...) calls has been changes +// to the new semantics and the use of hashCode() minimized. These +// changes should be repeated every time the CompactHashSet.java +// changes. + +import java.util.Collection; + +/** + * INTERNAL: This class is a specialization of the CompactHashSet + * class, and uses the == operator to compare objects. + */ +class CompactIdentityHashSet<E> extends CompactHashSet<E> { + + public CompactIdentityHashSet() { + } + + public CompactIdentityHashSet(int size) { + super(size); + } + + public CompactIdentityHashSet(Collection coll) { + super(coll); + } + + // ===== SET IMPLEMENTATION ================================================ + + /** + * Returns <tt>true</tt> if this set contains the specified element. + * + * @param o element whose presence in this set is to be tested. + * @return <tt>true</tt> if this set contains the specified element. + */ + public boolean contains(Object o) { + if (o == null) o = nullObject; + + int index = (System.identityHashCode(o) & 0x7FFFFFFF) % objects.length; + int offset = 1; + + // search for the object (continue while !null and !this object) + while(objects[index] != null && objects[index] != o) { + index = ((index + offset) & 0x7FFFFFFF) % objects.length; + offset = offset*2 + 1; + + if (offset == -1) + offset = 2; + } + + return objects[index] != null; + } + + /** + * Adds the specified element to this set if it is not already + * present. + * + * @param o element to be added to this set. + * @return <tt>true</tt> if the set did not already contain the specified + * element. + */ + public boolean add(Object o) { + if (o == null) o = nullObject; + + int index = (System.identityHashCode(o) & 0x7FFFFFFF) % objects.length; + int offset = 1; + int deletedix = -1; + + // search for the object (continue while !null and !this object) + while(objects[index] != null && objects[index] != o) { + + // if there's a deleted object here we can put this object here, + // provided it's not in here somewhere else already + if (objects[index] == deletedObject) + deletedix = index; + + index = ((index + offset) & 0x7FFFFFFF) % objects.length; + offset = offset*2 + 1; + + if (offset == -1) + offset = 2; + } + + if (objects[index] == null) { // wasn't present already + if (deletedix != -1) // reusing a deleted cell + index = deletedix; + else + freecells--; + + modCount++; + elements++; + objects[index] = o; + + // rehash with same capacity + if (1 - (freecells / (double) objects.length) > LOAD_FACTOR) { + rehash(objects.length); + // rehash with increased capacity + if (1 - (freecells / (double) objects.length) > LOAD_FACTOR) { + rehash(objects.length*2 + 1); + } + } + return true; + } else // was there already + return false; + } + + /** + * Removes the specified element from the set. + */ + public boolean remove(Object o) { + if (o == null) o = nullObject; + + int index = (System.identityHashCode(o) & 0x7FFFFFFF) % objects.length; + int offset = 1; + + // search for the object (continue while !null and !this object) + while(objects[index] != null && objects[index] != o) { + index = ((index + offset) & 0x7FFFFFFF) % objects.length; + offset = offset*2 + 1; + + if (offset == -1) + offset = 2; + } + + // we found the right position, now do the removal + if (objects[index] != null) { + // we found the object + objects[index] = deletedObject; + modCount++; + elements--; + return true; + } else + // we did not find the object + return false; + } + + // ===== INTERNAL METHODS ================================================== + + /** + * INTERNAL: Rehashes the hashset to a bigger size. + */ + protected void rehash(int newCapacity) { + int oldCapacity = objects.length; + Object[] newObjects = new Object[newCapacity]; + + for (int ix = 0; ix < oldCapacity; ix++) { + Object o = objects[ix]; + if (o == null || o == deletedObject) + continue; + + int index = (System.identityHashCode(o) & 0x7FFFFFFF) % newCapacity; + int offset = 1; + + // search for the object + while(newObjects[index] != null) { // no need to test for duplicates + index = ((index + offset) & 0x7FFFFFFF) % newCapacity; + offset = offset*2 + 1; + + if (offset == -1) + offset = 2; + } + + newObjects[index] = o; + } + + objects = newObjects; + freecells = objects.length - elements; + } +} Property changes on: tinytim/trunk/src/main/java/org/tinytim/internal/utils/CompactIdentityHashSet.java ___________________________________________________________________ Added: svn:keywords + Rev Date Id Added: svn:eol-style + native Modified: tinytim/trunk/src/main/java/org/tinytim/internal/utils/CopyUtils.java =================================================================== --- tinytim/trunk/src/main/java/org/tinytim/internal/utils/CopyUtils.java 2009-10-09 11:54:46 UTC (rev 359) +++ tinytim/trunk/src/main/java/org/tinytim/internal/utils/CopyUtils.java 2009-11-04 16:58:30 UTC (rev 360) @@ -57,14 +57,14 @@ * @param source The topic map to take the topics and associations from. * @param target The topic map which should receive the topics and associations. */ - public static void copy(TopicMap source, TopicMap target) { + public static void copy(final TopicMap source, final TopicMap target) { _copy(source, (ITopicMap) target); } /** * @see #copy(TopicMap, TopicMap) */ - private static void _copy(TopicMap source, ITopicMap target) { + private static void _copy(final TopicMap source, final ITopicMap target) { if (source == null || target == null) { throw new IllegalArgumentException("Neither the source topic map nor the target topic map must be null"); } @@ -127,8 +127,8 @@ * @param mergeMap The map which holds the merge mappings. * @return The newly created topic in the target topic map. */ - private static ITopic _copyTopic(Topic topic, ITopicMap target, - Map<Topic, Topic> mergeMap) { + private static ITopic _copyTopic(final Topic topic, final ITopicMap target, + final Map<Topic, Topic> mergeMap) { ITopic targetTopic = target.createEmptyTopic(); _copyIdentities(topic, targetTopic); _copyTypes(topic, targetTopic, mergeMap); @@ -143,7 +143,7 @@ * @param topic The topic to take the identities from. * @param targetTopic The topic which gets the identities. */ - private static void _copyIdentities(Topic topic, Topic targetTopic) { + private static void _copyIdentities(final Topic topic, final Topic targetTopic) { for(Locator sid: topic.getSubjectIdentifiers()) { targetTopic.addSubjectIdentifier(sid); } @@ -160,8 +160,8 @@ * @param targetTopic The topic which receives the types. * @param mergeMap The map which holds the merge mappings. */ - private static void _copyTypes(Topic topic, Topic targetTopic, - Map<Topic, Topic> mergeMap) { + private static void _copyTypes(final Topic topic, final Topic targetTopic, + final Map<Topic, Topic> mergeMap) { for (Topic type: topic.getTypes()) { Topic targetType = mergeMap.get(type); if (targetType == null) { @@ -179,8 +179,9 @@ * @param targetTopic The target topic which gets the charateristics. * @param mergeMap The map which holds the merge mappings. */ - private static void _copyCharacteristics(Topic topic, ITopic targetTopic, - Map<Topic, Topic> mergeMap) { + private static void _copyCharacteristics(final Topic topic, + final ITopic targetTopic, + final Map<Topic, Topic> mergeMap) { IIntObjectMap<Reifiable> sigs = CollectionFactory.createIntObjectMap(); for (Occurrence occ: targetTopic.getOccurrences()) { sigs.put(SignatureGenerator.generateSignature(occ), occ); @@ -229,9 +230,9 @@ * @param target The target name which receives the variants. * @param mergeMap The map which holds the merge mappings. */ - private static void _copyVariants(Name source, IName target, - Map<Topic, Topic> mergeMap) { - IIntObjectMap<Variant> sigs = CollectionFactory.createIntObjectMap(); + private static void _copyVariants(final Name source, final IName target, + final Map<Topic, Topic> mergeMap) { + final IIntObjectMap<Variant> sigs = CollectionFactory.createIntObjectMap(); for (Variant variant: target.getVariants()) { sigs.put(SignatureGenerator.generateSignature(variant), variant); } @@ -258,13 +259,14 @@ * @param target The target Topic Maps construct. * @param mergeMap The map which holds the merge mappings. */ - private static void _copyReifier(Reifiable source, Reifiable target, - Map<Topic, Topic> mergeMap) { - Topic sourceReifier = source.getReifier(); + private static void _copyReifier(final Reifiable source, + final Reifiable target, + final Map<Topic, Topic> mergeMap) { + final Topic sourceReifier = source.getReifier(); if (sourceReifier == null) { return; } - Topic reifier = mergeMap.containsKey(sourceReifier) ? mergeMap.get(sourceReifier) + final Topic reifier = mergeMap.containsKey(sourceReifier) ? mergeMap.get(sourceReifier) : _copyTopic(sourceReifier, (ITopicMap) target.getTopicMap(), mergeMap); target.setReifier(reifier); } @@ -276,10 +278,10 @@ * @param target The Topic Maps construct which receives the type. * @param mergeMap The map which holds the merge mappings. */ - private static ITopic _copyType(Typed source, TopicMap tm, - Map<Topic, Topic> mergeMap) { - Topic sourceType = source.getType(); - return mergeMap.containsKey(sourceType) ? (ITopic) mergeMap.get(sourceType) + private static ITopic _copyType(final Typed source, final TopicMap tm, + final Map<Topic, Topic> mergeMap) { + final Topic sourceType = source.getType(); + return mergeMap.containsKey(sourceType) ? (ITopic) mergeMap.get(sourceType) : _copyTopic(sourceType, (ITopicMap) tm, mergeMap); } @@ -291,9 +293,9 @@ * @param target The target which receives the scope. * @param mergeMap The map which holds the merge mappings. */ - private static IScope _copyScope(Scoped source, ITopicMap tm, - Map<Topic, Topic> mergeMap) { - Set<Topic> themes = CollectionFactory.createIdentitySet(source.getScope().size()); + private static IScope _copyScope(final Scoped source, final ITopicMap tm, + final Map<Topic, Topic> mergeMap) { + final Set<Topic> themes = CollectionFactory.createIdentitySet(source.getScope().size()); Topic theme = null; for (Topic sourceTheme: source.getScope()) { theme = mergeMap.containsKey(sourceTheme) ? mergeMap.get(sourceTheme) @@ -309,7 +311,8 @@ * @param source The source Topic Maps construct. * @param target The target Topic Maps construct. */ - private static void _copyItemIdentifiers(Construct source, Construct target) { + private static void _copyItemIdentifiers(final Construct source, + final Construct target) { for(Locator iid: source.getItemIdentifiers()) { target.addItemIdentifier(iid); } @@ -323,10 +326,10 @@ * @param target The topic map which receives the associations. * @param mergeMap The map which holds the merge mappings. */ - private static void _copyAssociations(TopicMap source, - ITopicMap target, Map<Topic, Topic> mergeMap) { - Set<Association> assocs = target.getAssociations(); - IIntObjectMap<Association> sigs = CollectionFactory.createIntObjectMap(assocs.size()); + private static void _copyAssociations(final TopicMap source, + final ITopicMap target, final Map<Topic, Topic> mergeMap) { + final Set<Association> assocs = target.getAssociations(); + final IIntObjectMap<Association> sigs = CollectionFactory.createIntObjectMap(assocs.size()); for (Association assoc: assocs) { sigs.put(SignatureGenerator.generateSignature(assoc), assoc); } @@ -364,8 +367,9 @@ * @param target The target topic. * @param mergeMap The map which holds the merge mappings. */ - private static void _addMerge(Topic source, Topic target, Map<Topic, Topic> mergeMap) { - Topic prevTarget = mergeMap.get(source); + private static void _addMerge(final Topic source, final Topic target, + final Map<Topic, Topic> mergeMap) { + final Topic prevTarget = mergeMap.get(source); if (prevTarget != null) { if (!prevTarget.equals(target)) { MergeUtils.merge(target, prevTarget); Deleted: tinytim/trunk/src/main/java/org/tinytim/internal/utils/JavaCollectionFactory.java =================================================================== --- tinytim/trunk/src/main/java/org/tinytim/internal/utils/JavaCollectionFactory.java 2009-10-09 11:54:46 UTC (rev 359) +++ tinytim/trunk/src/main/java/org/tinytim/internal/utils/JavaCollectionFactory.java 2009-11-04 16:58:30 UTC (rev 360) @@ -1,216 +0,0 @@ -/* - * Copyright 2008 Lars Heuer (heuer[at]semagia.com) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distrib... [truncated message content] |
From: <lh...@us...> - 2010-01-11 14:49:26
|
Revision: 362 http://tinytim.svn.sourceforge.net/tinytim/?rev=362&view=rev Author: lheuer Date: 2010-01-11 12:42:35 +0000 (Mon, 11 Jan 2010) Log Message: ----------- Fixes issue #2926983 Modified Paths: -------------- tinytim/trunk/CHANGES.txt tinytim/trunk/src/main/java/org/tinytim/internal/utils/CopyUtils.java Modified: tinytim/trunk/CHANGES.txt =================================================================== --- tinytim/trunk/CHANGES.txt 2009-11-04 18:29:23 UTC (rev 361) +++ tinytim/trunk/CHANGES.txt 2010-01-11 12:42:35 UTC (rev 362) @@ -2,12 +2,16 @@ Changes Log =========== -2.0.0 a6 (xx.yy.2009) +2.0.0 a6 (2010-01-xx) --------------------- * Added support to convert XTM 1.0 class-instance relationships to TMDM type-instance relationships * Added support to convert XTM 1.0 PSIs to TMDM PSIs +Bugfixes: +--------- +* Bug #2926983 -- Merging of associations fails + reported by Sven Krosse 2.0.0 a5 (23.07.2009) Modified: tinytim/trunk/src/main/java/org/tinytim/internal/utils/CopyUtils.java =================================================================== --- tinytim/trunk/src/main/java/org/tinytim/internal/utils/CopyUtils.java 2009-11-04 18:29:23 UTC (rev 361) +++ tinytim/trunk/src/main/java/org/tinytim/internal/utils/CopyUtils.java 2010-01-11 12:42:35 UTC (rev 362) @@ -1,5 +1,5 @@ /* - * Copyright 2008 Lars Heuer (heuer[at]semagia.com) + * Copyright 2008 - 2010 Lars Heuer (heuer[at]semagia.com) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -336,12 +336,20 @@ Association existing = null; ITopic type = null; IScope scope = null; + ITopic roleType = null; + ITopic player = null; + Topic sourcePlayer = null; for (Association assoc: source.getAssociations()) { type = _copyType(assoc, target, mergeMap); scope = _copyScope(assoc, target, mergeMap); Association targetAssoc = target.createAssociation(type, scope); for (Role role: assoc.getRoles()) { - Role targetRole = targetAssoc.createRole(role.getType(), role.getPlayer()); + roleType = _copyType(role, target, mergeMap); + sourcePlayer = role.getPlayer(); + player = mergeMap.containsKey(sourcePlayer) + ? (ITopic) mergeMap.get(sourcePlayer) + : _copyTopic(sourcePlayer, target, mergeMap); + Role targetRole = targetAssoc.createRole(roleType, player); _copyItemIdentifiers(role, targetRole); _copyReifier(role, targetRole, mergeMap); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lh...@us...> - 2010-01-13 14:57:44
|
Revision: 363 http://tinytim.svn.sourceforge.net/tinytim/?rev=363&view=rev Author: lheuer Date: 2010-01-13 14:57:37 +0000 (Wed, 13 Jan 2010) Log Message: ----------- Fixes issue #2931353. Modified Paths: -------------- tinytim/trunk/CHANGES.txt tinytim/trunk/src/main/java/org/tinytim/internal/utils/CompactHashSet.java Modified: tinytim/trunk/CHANGES.txt =================================================================== --- tinytim/trunk/CHANGES.txt 2010-01-11 12:42:35 UTC (rev 362) +++ tinytim/trunk/CHANGES.txt 2010-01-13 14:57:37 UTC (rev 363) @@ -7,6 +7,9 @@ * Added support to convert XTM 1.0 class-instance relationships to TMDM type-instance relationships * Added support to convert XTM 1.0 PSIs to TMDM PSIs +* Moved to Ontopia's Compact(Hash|Identity)Set instead relying + on Java's default implementations +* Removed support for trove's collections Bugfixes: --------- Modified: tinytim/trunk/src/main/java/org/tinytim/internal/utils/CompactHashSet.java =================================================================== --- tinytim/trunk/src/main/java/org/tinytim/internal/utils/CompactHashSet.java 2010-01-11 12:42:35 UTC (rev 362) +++ tinytim/trunk/src/main/java/org/tinytim/internal/utils/CompactHashSet.java 2010-01-13 14:57:37 UTC (rev 363) @@ -329,13 +329,14 @@ public Object next() { if (modCount != expectedModCount) throw new ConcurrentModificationException(); - if (index >= objects.length) { + int length = objects.length; + if (index >= length) { lastReturned = -2; throw new NoSuchElementException(); } lastReturned = index; - for (index += 1; index < objects.length && + for (index += 1; index < length && (objects[index] == null || objects[index] == deletedObject); index++) ; @@ -354,6 +355,8 @@ if (objects[lastReturned] != null && objects[lastReturned] != deletedObject) { objects[lastReturned] = deletedObject; elements--; + modCount++; + expectedModCount = modCount; // this is expected; we made the change } } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lh...@us...> - 2010-01-15 18:23:52
|
Revision: 364 http://tinytim.svn.sourceforge.net/tinytim/?rev=364&view=rev Author: lheuer Date: 2010-01-15 18:23:39 +0000 (Fri, 15 Jan 2010) Log Message: ----------- Update to new TMAPI release Modified Paths: -------------- tinytim/trunk/build.xml Added Paths: ----------- tinytim/trunk/lib/tmapi-2.0RC2-tests.jar tinytim/trunk/lib/tmapi-2.0RC2.jar Removed Paths: ------------- tinytim/trunk/lib/tmapi-2.0RC1-tests.jar tinytim/trunk/lib/tmapi-2.0RC1.jar Modified: tinytim/trunk/build.xml =================================================================== --- tinytim/trunk/build.xml 2010-01-13 14:57:37 UTC (rev 363) +++ tinytim/trunk/build.xml 2010-01-15 18:23:39 UTC (rev 364) @@ -12,8 +12,8 @@ <property name="lib.junit" value="${dir.lib}/junit-4.5.jar"/> <property name="lib.mio" value="${dir.lib}/semagia-mio-0.9.5.jar"/> - <property name="lib.tmapi" value="${dir.lib}/tmapi-2.0RC1.jar"/> - <property name="lib.tmapi.tests" value="${dir.lib}/tmapi-2.0RC1-tests.jar"/> + <property name="lib.tmapi" value="${dir.lib}/tmapi-2.0RC2.jar"/> + <property name="lib.tmapi.tests" value="${dir.lib}/tmapi-2.0RC2-tests.jar"/> <property name="lib.emma" value="${dir.lib}/emma.jar"/> <property name="lib.emma.task" value="${dir.lib}/emma_ant.jar"/> Deleted: tinytim/trunk/lib/tmapi-2.0RC1-tests.jar =================================================================== (Binary files differ) Deleted: tinytim/trunk/lib/tmapi-2.0RC1.jar =================================================================== (Binary files differ) Added: tinytim/trunk/lib/tmapi-2.0RC2-tests.jar =================================================================== (Binary files differ) Property changes on: tinytim/trunk/lib/tmapi-2.0RC2-tests.jar ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: tinytim/trunk/lib/tmapi-2.0RC2.jar =================================================================== (Binary files differ) Property changes on: tinytim/trunk/lib/tmapi-2.0RC2.jar ___________________________________________________________________ Added: svn:mime-type + application/octet-stream This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lh...@us...> - 2010-02-06 14:00:07
|
Revision: 365 http://tinytim.svn.sourceforge.net/tinytim/?rev=365&view=rev Author: lheuer Date: 2010-02-06 13:59:51 +0000 (Sat, 06 Feb 2010) Log Message: ----------- Updated TMAPI Modified Paths: -------------- tinytim/trunk/build.xml Added Paths: ----------- tinytim/trunk/lib/tmapi-2.0-tests.jar tinytim/trunk/lib/tmapi-2.0.jar Removed Paths: ------------- tinytim/trunk/lib/tmapi-2.0RC2-tests.jar tinytim/trunk/lib/tmapi-2.0RC2.jar Modified: tinytim/trunk/build.xml =================================================================== --- tinytim/trunk/build.xml 2010-01-15 18:23:39 UTC (rev 364) +++ tinytim/trunk/build.xml 2010-02-06 13:59:51 UTC (rev 365) @@ -12,8 +12,8 @@ <property name="lib.junit" value="${dir.lib}/junit-4.5.jar"/> <property name="lib.mio" value="${dir.lib}/semagia-mio-0.9.5.jar"/> - <property name="lib.tmapi" value="${dir.lib}/tmapi-2.0RC2.jar"/> - <property name="lib.tmapi.tests" value="${dir.lib}/tmapi-2.0RC2-tests.jar"/> + <property name="lib.tmapi" value="${dir.lib}/tmapi-2.0.jar"/> + <property name="lib.tmapi.tests" value="${dir.lib}/tmapi-2.0-tests.jar"/> <property name="lib.emma" value="${dir.lib}/emma.jar"/> <property name="lib.emma.task" value="${dir.lib}/emma_ant.jar"/> Added: tinytim/trunk/lib/tmapi-2.0-tests.jar =================================================================== (Binary files differ) Property changes on: tinytim/trunk/lib/tmapi-2.0-tests.jar ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: tinytim/trunk/lib/tmapi-2.0.jar =================================================================== (Binary files differ) Property changes on: tinytim/trunk/lib/tmapi-2.0.jar ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Deleted: tinytim/trunk/lib/tmapi-2.0RC2-tests.jar =================================================================== (Binary files differ) Deleted: tinytim/trunk/lib/tmapi-2.0RC2.jar =================================================================== (Binary files differ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lh...@us...> - 2010-02-25 01:09:12
|
Revision: 366 http://tinytim.svn.sourceforge.net/tinytim/?rev=366&view=rev Author: lheuer Date: 2010-02-25 00:16:55 +0000 (Thu, 25 Feb 2010) Log Message: ----------- Import OSGi TMAPI Bundle Modified Paths: -------------- tinytim/trunk/build.properties tinytim/trunk/build.xml Modified: tinytim/trunk/build.properties =================================================================== --- tinytim/trunk/build.properties 2010-02-06 13:59:51 UTC (rev 365) +++ tinytim/trunk/build.properties 2010-02-25 00:16:55 UTC (rev 366) @@ -1,5 +1,6 @@ version=2.0.0 -version_suffix=a6 +# If a suffix given, it MUST start with '.' +version_suffix=.a6 #release_type= debug=off optimize=on Modified: tinytim/trunk/build.xml =================================================================== --- tinytim/trunk/build.xml 2010-02-06 13:59:51 UTC (rev 365) +++ tinytim/trunk/build.xml 2010-02-25 00:16:55 UTC (rev 366) @@ -1,272 +1,285 @@ -<?xml version="1.0" encoding="utf-8"?> -<project name="tinyTiM" default="jar" basedir="."> - <property file="build.properties"/> - <tstamp/> - <property name="release_type" value="-snapshot-${DSTAMP}${TSTAMP}"/> - - <property name="dir.src" value="${basedir}/src/main/java"/> - <property name="dir.test" value="${basedir}/src/test/java"/> - <property name="dir.lib" value="${basedir}/lib"/> - <property name="dir.res" value="${basedir}/src/main/resources"/> - <property name="dir.coverage" value="${basedir}/coverage"/> - - <property name="lib.junit" value="${dir.lib}/junit-4.5.jar"/> - <property name="lib.mio" value="${dir.lib}/semagia-mio-0.9.5.jar"/> - <property name="lib.tmapi" value="${dir.lib}/tmapi-2.0.jar"/> - <property name="lib.tmapi.tests" value="${dir.lib}/tmapi-2.0-tests.jar"/> - <property name="lib.emma" value="${dir.lib}/emma.jar"/> - <property name="lib.emma.task" value="${dir.lib}/emma_ant.jar"/> - - <!-- directory that contains emma.jar and emma_ant.jar: --> - <property name="dir.emma" value="${dir.lib}" /> - - <!-- path element used by EMMA taskdef below: --> - <path id="emma.lib" > - <pathelement location="${dir.emma}/emma.jar" /> - <pathelement location="${dir.emma}/emma_ant.jar" /> - </path> - - <!-- this loads <emma> and <emmajava> custom tasks: --> - <taskdef resource="emma_ant.properties" classpathref="emma.lib" /> - - <target name="help"> - <echo message="--------------------"/> - <echo message="tinyTiM - Build file"/> - <echo message="--------------------"/> - <echo message=""/> - <echo message="Available targets:"/> - <echo message=""/> - <echo message=" jar Creates the jar"/> - <echo message=" testjar Creates the jar with the tests"/> - <echo message=" doc Creates the API documentation"/> - <echo message=" coverage Creates a coverage report"/> - <echo message=" release Creates the jar and a distributable file"/> - </target> - - <target name="init"> - <property name="dist.version" value="${version}${version_suffix}${release_type}"/> - <property name="dist.name" value="tinytim-${dist.version}"/> - - <property name="tinytim.jar" value="${dist.name}.jar"/> - <property name="tinytim-test.jar" value="${dist.name}-tests.jar"/> - <property name="tinytim.tar" value="${dist.name}.tar"/> - <property name="tinytim.tar.gz" value="${tinytim.tar}.gz"/> - <property name="tinytim.zip" value="${dist.name}.zip"/> - - <property name="dir.build" value="${basedir}/build"/> - <property name="dir.dist.root" value="${dir.build}/dist"/> - <property name="dir.dist" value="${dir.dist.root}/${dist.name}"/> - <property name="dir.build.classes" value="${dir.build}/classes"/> - <property name="dir.build.tests" value="${dir.build}/tests"/> - <property name="dir.javadocs" value="${dir.dist}/docs/api"/> - - <path id="run.classpath" > - <pathelement location="${dir.build.classes}" /> - <pathelement location="${dir.build.tests}" /> - <pathelement location="${lib.junit}"/> - <pathelement location="${lib.mio}"/> - <pathelement location="${lib.tmapi}"/> - <pathelement location="${lib.tmapi.tests}"/> - </path> - </target> - - <!-- =================================================================== --> - <!-- Clean targets --> - <!-- =================================================================== --> - <target name="clean" depends="init"> - <delete dir="${dir.build}"/> - <delete dir="${dir.javadocs}"/> - </target> - - <!-- =================================================================== --> - <!-- Prepares the build directory --> - <!-- =================================================================== --> - <target name="prepare" depends="init"> - <mkdir dir="${dir.build}"/> - <mkdir dir="${dir.build.classes}"/> - </target> - - <!-- =================================================================== --> - <!-- Coverage Tests --> - <!-- =================================================================== --> - <target name="coverage" depends="compile"> - <mkdir dir="${dir.build.tests}"/> - <javac destdir="${dir.build.tests}" - debug="${debug}" - optimize="${optimize}" - target="1.5"> - <classpath> - <pathelement location="${dir.build.classes}"/> - <pathelement location="${lib.junit}"/> - <pathelement location="${lib.mio}"/> - <pathelement location="${lib.tmapi}"/> - <pathelement location="${lib.tmapi.tests}"/> - </classpath> - <src path="${dir.test}"/> - </javac> - <mkdir dir="${dir.coverage}"/> - <emmajava libclasspathref="emma.lib" - sourcepath="${dir.src}" - fullmetadata="yes" - classname="org.tinytim.core.AllTests" - classpathref="run.classpath" - > - <filter includes="org.tinytim.*" excludes="org.tinytim.*Test*, org.tinytim.*$*" /> - <html outfile="${dir.coverage}/index.html" /> - </emmajava> - </target> - - <!-- =================================================================== --> - <!-- Tests --> - <!-- =================================================================== --> - <target name="test" depends="compile"> - <mkdir dir="${dir.build.tests}"/> - <javac destdir="${dir.build.tests}" - debug="${debug}" - optimize="${optimize}" - target="1.5"> - <classpath> - <pathelement location="${dir.build.classes}"/> - <pathelement location="${lib.junit}"/> - <pathelement location="${lib.mio}"/> - <pathelement location="${lib.tmapi}"/> - <pathelement location="${lib.tmapi.tests}"/> - </classpath> - <src path="${dir.test}"/> - </javac> - <junit printsummary="true" showoutput="false" - errorProperty="test.failed" failureProperty="test.failed" - fork="true"> - <classpath refid="run.classpath"/> - <formatter type="brief" usefile="false"/> - <test name="org.tinytim.core.AllTests"/> - </junit> - <fail message="Tests failed. Check test output." if="test.failed"/> - </target> - - <!-- =================================================================== --> - <!-- Compile source files --> - <!-- =================================================================== --> - <target name="compile" depends="clean, prepare"> - <replace file="${dir.src}/org/tinytim/Version.java" token="@RELEASE@" value="${dist.version}"/> - <javac destdir="${dir.build.classes}" - debug="${debug}" - target="1.5"> - <classpath> - <pathelement location="${lib.tmapi}"/> - <pathelement location="${lib.mio}"/> - </classpath> - <src path="${dir.src}"/> - </javac> - <replace file="${dir.src}/org/tinytim/Version.java" token="${dist.version}" value="@RELEASE@"/> - </target> - - <!-- =================================================================== --> - <!-- Creates the Java Docs --> - <!-- =================================================================== --> - <target name="doc" depends="init"> - <mkdir dir="${dir.javadocs}"/> - <javadoc destdir="${dir.javadocs}" - packagenames="org.tinytim.*" - author="true" - version="true" - use="true" - splitindex="true" - noindex="false" - windowtitle="tinyTiM API v${dist.version}" - doctitle="tinyTiM API v${dist.version}"> - <fileset dir="${dir.src}"> - <exclude name="org/tinytim/core/**"/> - <exclude name="org/tinytim/index/**"/> - <exclude name="org/tinytim/internal/**"/> - <exclude name="org/tinytim/utils/Property.*"/> - </fileset> -<!-- - <doclet name="net.gleamynode.apiviz.APIviz" - path="${dir.lib}/apiviz-1.2.4.GA.jar"> - </doclet> ---> - <link href="http://www.tmapi.org/2.0/api/"/> - </javadoc> - </target> - - <!-- =================================================================== --> - <!-- Creates the jar --> - <!-- =================================================================== --> - <target name="jar" depends="compile"> - <jar destfile="${dir.build}/${tinytim.jar}"> - <fileset dir="${dir.build.classes}"> - <include name="**/*.*"/> - </fileset> - <fileset dir="${dir.res}"> - <include name="**/*.*"/> - </fileset> - <manifest> - <attribute name="Implementation-Title" value="tinyTiM"/> - <attribute name="Implementation-Version" value="${dist.version}"/> - <attribute name="Implementation-URL" value="http://tinytim.sourceforge.net/"/> - </manifest> - </jar> - </target> - - <!-- =================================================================== --> - <!-- Creates the test jar --> - <!-- =================================================================== --> - <target name="testjar" depends="compile, test"> - <jar destfile="${dir.build}/${tinytim-test.jar}"> - <fileset dir="${dir.build.tests}"> - <include name="**/*.*"/> - </fileset> - <manifest> - <attribute name="Implementation-Title" value="tinyTiM Tests"/> - <attribute name="Implementation-Version" value="${dist.version}"/> - <attribute name="Implementation-URL" value="http://tinytim.sourceforge.net/"/> - </manifest> - </jar> - </target> - - <!-- =================================================================== --> - <!-- Prepares a distribution --> - <!-- =================================================================== --> - <target name="dist" depends="jar, testjar, doc"> - <mkdir dir="${dir.dist}"/> - - <copy todir="${dir.dist}" file="${dir.build}/${tinytim.jar}"/> - <copy todir="${dir.dist}" file="${dir.build}/${tinytim-test.jar}"/> - - <copy todir="${dir.dist}/src"> - <fileset dir="${dir.src}"/> - </copy> - <replace file="${dir.dist}/src/org/tinytim/Version.java" token="@RELEASE@" value="${dist.version}"/> - <copy todir="${dir.dist}/test"> - <fileset dir="${dir.test}"/> - </copy> - <copy todir="${dir.dist}/lib"> - <fileset dir="${dir.lib}"> - <include name="tmapi*"/> - <include name="junit*"/> - <include name="trove*"/> - <include name="LICENSE.tmapi*"/> - <include name="LICENSE.junit*"/> - </fileset> - </copy> - - <copy todir="${dir.dist}" file="CHANGES.txt"/> - <copy todir="${dir.dist}" file="LICENSE.txt"/> - <copy todir="${dir.dist}" file="README.txt"/> - </target> - - <!-- =================================================================== --> - <!-- Creates the distribution files (.zip and .tar.gz) --> - <!-- --> - <!-- Won't create the distribution files if a test fails --> - <!-- =================================================================== --> - <target name="release" depends="jar, test, dist"> - <tar destfile="${dir.dist.root}/${tinytim.tar}" - basedir="${dir.dist.root}"/> - <gzip src="${dir.dist.root}/${tinytim.tar}" - destfile="${dir.build}/${tinytim.tar.gz}" /> - <delete file="${dir.dist.root}/${tinytim.tar}" /> - <zip destfile="${dir.build}/${tinytim.zip}" basedir="${dir.dist.root}"/> - </target> -</project> +<?xml version="1.0" encoding="utf-8"?> +<project name="tinyTiM" default="jar" basedir="."> + <property file="build.properties"/> + <tstamp/> + <property name="release_type" value="-snapshot-${DSTAMP}${TSTAMP}"/> + + <property name="dir.src" value="${basedir}/src/main/java"/> + <property name="dir.test" value="${basedir}/src/test/java"/> + <property name="dir.lib" value="${basedir}/lib"/> + <property name="dir.res" value="${basedir}/src/main/resources"/> + <property name="dir.coverage" value="${basedir}/coverage"/> + + <property name="lib.junit" value="${dir.lib}/junit-4.5.jar"/> + <property name="lib.trove" value="${dir.lib}/trove-2.1.0.jar"/> + <property name="lib.mio" value="${dir.lib}/semagia-mio-0.9.5.jar"/> + <property name="lib.tmapi" value="${dir.lib}/tmapi-2.0.jar"/> + <property name="lib.tmapi.tests" value="${dir.lib}/tmapi-2.0b1-tests.jar"/> + <property name="lib.emma" value="${dir.lib}/emma.jar"/> + <property name="lib.emma.task" value="${dir.lib}/emma_ant.jar"/> + + <!-- directory that contains emma.jar and emma_ant.jar: --> + <property name="dir.emma" value="${dir.lib}" /> + + <!-- path element used by EMMA taskdef below: --> + <path id="emma.lib" > + <pathelement location="${dir.emma}/emma.jar" /> + <pathelement location="${dir.emma}/emma_ant.jar" /> + </path> + + <!-- this loads <emma> and <emmajava> custom tasks: --> + <taskdef resource="emma_ant.properties" classpathref="emma.lib" /> + + <target name="help"> + <echo message="--------------------"/> + <echo message="tinyTiM - Build file"/> + <echo message="--------------------"/> + <echo message=""/> + <echo message="Available targets:"/> + <echo message=""/> + <echo message=" jar Creates the jar"/> + <echo message=" testjar Creates the jar with the tests"/> + <echo message=" doc Creates the API documentation"/> + <echo message=" coverage Creates a coverage report"/> + <echo message=" release Creates the jar and a distributable file"/> + </target> + + <target name="init"> + <property name="dist.version" value="${version}${version_suffix}${release_type}"/> + <property name="dist.name" value="tinytim-${dist.version}"/> + + <property name="tinytim.jar" value="${dist.name}.jar"/> + <property name="tinytim-test.jar" value="${dist.name}-tests.jar"/> + <property name="tinytim.tar" value="${dist.name}.tar"/> + <property name="tinytim.tar.gz" value="${tinytim.tar}.gz"/> + <property name="tinytim.zip" value="${dist.name}.zip"/> + + <property name="dir.build" value="${basedir}/build"/> + <property name="dir.dist.root" value="${dir.build}/dist"/> + <property name="dir.dist" value="${dir.dist.root}/${dist.name}"/> + <property name="dir.build.classes" value="${dir.build}/classes"/> + <property name="dir.build.tests" value="${dir.build}/tests"/> + <property name="dir.javadocs" value="${dir.dist}/docs/api"/> + + <path id="run.classpath" > + <pathelement location="${dir.build.classes}" /> + <pathelement location="${dir.build.tests}" /> + <pathelement location="${lib.junit}"/> + <pathelement location="${lib.mio}"/> + <pathelement location="${lib.tmapi}"/> + <pathelement location="${lib.tmapi.tests}"/> + <pathelement location="${lib.trove}"/> + </path> + </target> + + <!-- =================================================================== --> + <!-- Clean targets --> + <!-- =================================================================== --> + <target name="clean" depends="init"> + <delete dir="${dir.build}"/> + <delete dir="${dir.javadocs}"/> + </target> + + <!-- =================================================================== --> + <!-- Prepares the build directory --> + <!-- =================================================================== --> + <target name="prepare" depends="init"> + <mkdir dir="${dir.build}"/> + <mkdir dir="${dir.build.classes}"/> + </target> + + <!-- =================================================================== --> + <!-- Coverage Tests --> + <!-- =================================================================== --> + <target name="coverage" depends="compile"> + <mkdir dir="${dir.build.tests}"/> + <javac destdir="${dir.build.tests}" + debug="${debug}" + optimize="${optimize}" + target="1.5"> + <classpath> + <pathelement location="${dir.build.classes}"/> + <pathelement location="${lib.junit}"/> + <pathelement location="${lib.mio}"/> + <pathelement location="${lib.tmapi}"/> + <pathelement location="${lib.tmapi.tests}"/> + <pathelement location="${lib.trove}"/> + </classpath> + <src path="${dir.test}"/> + </javac> + <mkdir dir="${dir.coverage}"/> + <emmajava libclasspathref="emma.lib" + sourcepath="${dir.src}" + fullmetadata="yes" + classname="org.tinytim.core.AllTests" + classpathref="run.classpath" + > + <filter includes="org.tinytim.*" excludes="org.tinytim.*Test*, org.tinytim.*$*" /> + <html outfile="${dir.coverage}/index.html" /> + </emmajava> + </target> + + <!-- =================================================================== --> + <!-- Tests --> + <!-- =================================================================== --> + <target name="test" depends="compile"> + <mkdir dir="${dir.build.tests}"/> + <javac destdir="${dir.build.tests}" + debug="${debug}" + optimize="${optimize}" + target="1.5"> + <classpath> + <pathelement location="${dir.build.classes}"/> + <pathelement location="${lib.junit}"/> + <pathelement location="${lib.mio}"/> + <pathelement location="${lib.tmapi}"/> + <pathelement location="${lib.tmapi.tests}"/> + <pathelement location="${lib.trove}"/> + </classpath> + <src path="${dir.test}"/> + </javac> + <junit printsummary="true" showoutput="false" + errorProperty="test.failed" failureProperty="test.failed" + fork="true"> + <classpath refid="run.classpath"/> + <formatter type="brief" usefile="false"/> + <test name="org.tinytim.core.AllTests"/> + </junit> + <fail message="Tests failed. Check test output." if="test.failed"/> + </target> + + <!-- =================================================================== --> + <!-- Compile source files --> + <!-- =================================================================== --> + <target name="compile" depends="clean, prepare"> + <replace file="${dir.src}/org/tinytim/Version.java" token="@RELEASE@" value="${dist.version}"/> + <javac destdir="${dir.build.classes}" + debug="${debug}" + target="1.5"> + <classpath> + <pathelement location="${lib.tmapi}"/> + <pathelement location="${lib.trove}"/> + <pathelement location="${lib.mio}"/> + </classpath> + <src path="${dir.src}"/> + </javac> + <replace file="${dir.src}/org/tinytim/Version.java" token="${dist.version}" value="@RELEASE@"/> + </target> + + <!-- =================================================================== --> + <!-- Creates the Java Docs --> + <!-- =================================================================== --> + <target name="doc" depends="init"> + <mkdir dir="${dir.javadocs}"/> + <javadoc destdir="${dir.javadocs}" + packagenames="org.tinytim.*" + author="true" + version="true" + use="true" + splitindex="true" + noindex="false" + windowtitle="tinyTiM API v${dist.version}" + doctitle="tinyTiM API v${dist.version}"> + <fileset dir="${dir.src}"> + <exclude name="org/tinytim/core/**"/> + <exclude name="org/tinytim/index/**"/> + <exclude name="org/tinytim/internal/**"/> + <exclude name="org/tinytim/utils/Property.*"/> + </fileset> +<!-- + <doclet name="net.gleamynode.apiviz.APIviz" + path="${dir.lib}/apiviz-1.2.4.GA.jar"> + </doclet> +--> + <link href="http://www.tmapi.org/2.0/api/"/> + </javadoc> + </target> + + <!-- =================================================================== --> + <!-- Creates the jar --> + <!-- =================================================================== --> + <target name="jar" depends="compile"> + <jar destfile="${dir.build}/${tinytim.jar}"> + <fileset dir="${dir.build.classes}"> + <include name="**/*.*"/> + </fileset> + <fileset dir="${dir.res}"> + <include name="**/*.*"/> + </fileset> + <manifest> + <attribute name="Implementation-Title" value="tinyTiM"/> + <attribute name="Implementation-Version" value="${dist.version}"/> + <attribute name="Implementation-URL" value="http://tinytim.sourceforge.net/"/> + <attribute name="Import-Package" value="org.osgi.framework,org.tmapi.core,org.tmapi.index"/> + <attribute name="Export-Package" value="org.tinytim.core"/> + <attribute name="Bundle-Name" value="tinyTiM"/> + <attribute name="Bundle-SymbolicName" value="org.tinytim;version=${dist.version}"/> + <attribute name="Bundle-Vendor" value="tinyTiM project"/> + <attribute name="Fragment-Host" value="org.tmapi.core"/> + <attribute name="Bundle-Version" value="${dist.version}"/> + </manifest> + </jar> + </target> + + <!-- =================================================================== --> + <!-- Creates the test jar --> + <!-- =================================================================== --> + <target name="testjar" depends="compile, test"> + <jar destfile="${dir.build}/${tinytim-test.jar}"> + <fileset dir="${dir.build.tests}"> + <include name="**/*.*"/> + </fileset> + <manifest> + <attribute name="Implementation-Title" value="tinyTiM Tests"/> + <attribute name="Implementation-Version" value="${dist.version}"/> + <attribute name="Implementation-URL" value="http://tinytim.sourceforge.net/"/> + </manifest> + </jar> + </target> + + <!-- =================================================================== --> + <!-- Prepares a distribution --> + <!-- =================================================================== --> + <target name="dist" depends="jar, testjar, doc"> + <mkdir dir="${dir.dist}"/> + + <copy todir="${dir.dist}" file="${dir.build}/${tinytim.jar}"/> + <copy todir="${dir.dist}" file="${dir.build}/${tinytim-test.jar}"/> + + <copy todir="${dir.dist}/src"> + <fileset dir="${dir.src}"/> + </copy> + <replace file="${dir.dist}/src/org/tinytim/Version.java" token="@RELEASE@" value="${dist.version}"/> + <copy todir="${dir.dist}/test"> + <fileset dir="${dir.test}"/> + </copy> + <copy todir="${dir.dist}/lib"> + <fileset dir="${dir.lib}"> + <include name="tmapi*"/> + <include name="junit*"/> + <include name="trove*"/> + <include name="LICENSE.tmapi*"/> + <include name="LICENSE.junit*"/> + <include name="LICENSE.trove*"/> + </fileset> + </copy> + + <copy todir="${dir.dist}" file="CHANGES.txt"/> + <copy todir="${dir.dist}" file="LICENSE.txt"/> + <copy todir="${dir.dist}" file="README.txt"/> + </target> + + <!-- =================================================================== --> + <!-- Creates the distribution files (.zip and .tar.gz) --> + <!-- --> + <!-- Won't create the distribution files if a test fails --> + <!-- =================================================================== --> + <target name="release" depends="jar, test, dist"> + <tar destfile="${dir.dist.root}/${tinytim.tar}" + basedir="${dir.dist.root}"/> + <gzip src="${dir.dist.root}/${tinytim.tar}" + destfile="${dir.build}/${tinytim.tar.gz}" /> + <delete file="${dir.dist.root}/${tinytim.tar}" /> + <zip destfile="${dir.build}/${tinytim.zip}" basedir="${dir.dist.root}"/> + </target> +</project> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lh...@us...> - 2010-02-27 14:22:20
|
Revision: 368 http://tinytim.svn.sourceforge.net/tinytim/?rev=368&view=rev Author: lheuer Date: 2010-02-27 14:22:08 +0000 (Sat, 27 Feb 2010) Log Message: ----------- - Updated OSGi headers - Updated JUnit Modified Paths: -------------- tinytim/trunk/CHANGES.txt tinytim/trunk/build.xml Added Paths: ----------- tinytim/trunk/lib/junit-4.8.1.jar Removed Paths: ------------- tinytim/trunk/lib/junit-4.5.jar Modified: tinytim/trunk/CHANGES.txt =================================================================== --- tinytim/trunk/CHANGES.txt 2010-02-25 12:15:58 UTC (rev 367) +++ tinytim/trunk/CHANGES.txt 2010-02-27 14:22:08 UTC (rev 368) @@ -2,8 +2,9 @@ Changes Log =========== -2.0.0 a6 (2010-01-xx) +2.0.0 a6 (2010-02-xx) --------------------- +* Added OSGi headers to the MANIFEST * Added support to convert XTM 1.0 class-instance relationships to TMDM type-instance relationships * Added support to convert XTM 1.0 PSIs to TMDM PSIs Modified: tinytim/trunk/build.xml =================================================================== --- tinytim/trunk/build.xml 2010-02-25 12:15:58 UTC (rev 367) +++ tinytim/trunk/build.xml 2010-02-27 14:22:08 UTC (rev 368) @@ -1,284 +1,276 @@ -<?xml version="1.0" encoding="utf-8"?> -<project name="tinyTiM" default="jar" basedir="."> - <property file="build.properties"/> - <tstamp/> - <property name="release_type" value="-snapshot-${DSTAMP}${TSTAMP}"/> - - <property name="dir.src" value="${basedir}/src/main/java"/> - <property name="dir.test" value="${basedir}/src/test/java"/> - <property name="dir.lib" value="${basedir}/lib"/> - <property name="dir.res" value="${basedir}/src/main/resources"/> - <property name="dir.coverage" value="${basedir}/coverage"/> - - <property name="lib.junit" value="${dir.lib}/junit-4.5.jar"/> - <property name="lib.trove" value="${dir.lib}/trove-2.1.0.jar"/> - <property name="lib.mio" value="${dir.lib}/semagia-mio-0.9.5.jar"/> - <property name="lib.tmapi" value="${dir.lib}/tmapi-2.0.jar"/> - <property name="lib.tmapi.tests" value="${dir.lib}/tmapi-2.0b1-tests.jar"/> - <property name="lib.emma" value="${dir.lib}/emma.jar"/> - <property name="lib.emma.task" value="${dir.lib}/emma_ant.jar"/> - - <!-- directory that contains emma.jar and emma_ant.jar: --> - <property name="dir.emma" value="${dir.lib}" /> - - <!-- path element used by EMMA taskdef below: --> - <path id="emma.lib" > - <pathelement location="${dir.emma}/emma.jar" /> - <pathelement location="${dir.emma}/emma_ant.jar" /> - </path> - - <!-- this loads <emma> and <emmajava> custom tasks: --> - <taskdef resource="emma_ant.properties" classpathref="emma.lib" /> - - <target name="help"> - <echo message="--------------------"/> - <echo message="tinyTiM - Build file"/> - <echo message="--------------------"/> - <echo message=""/> - <echo message="Available targets:"/> - <echo message=""/> - <echo message=" jar Creates the jar"/> - <echo message=" testjar Creates the jar with the tests"/> - <echo message=" doc Creates the API documentation"/> - <echo message=" coverage Creates a coverage report"/> - <echo message=" release Creates the jar and a distributable file"/> - </target> - - <target name="init"> - <property name="dist.version" value="${version}${version_suffix}${release_type}"/> - <property name="dist.name" value="tinytim-${dist.version}"/> - - <property name="tinytim.jar" value="${dist.name}.jar"/> - <property name="tinytim-test.jar" value="${dist.name}-tests.jar"/> - <property name="tinytim.tar" value="${dist.name}.tar"/> - <property name="tinytim.tar.gz" value="${tinytim.tar}.gz"/> - <property name="tinytim.zip" value="${dist.name}.zip"/> - - <property name="dir.build" value="${basedir}/build"/> - <property name="dir.dist.root" value="${dir.build}/dist"/> - <property name="dir.dist" value="${dir.dist.root}/${dist.name}"/> - <property name="dir.build.classes" value="${dir.build}/classes"/> - <property name="dir.build.tests" value="${dir.build}/tests"/> - <property name="dir.javadocs" value="${dir.dist}/docs/api"/> - - <path id="run.classpath" > - <pathelement location="${dir.build.classes}" /> - <pathelement location="${dir.build.tests}" /> - <pathelement location="${lib.junit}"/> - <pathelement location="${lib.mio}"/> - <pathelement location="${lib.tmapi}"/> - <pathelement location="${lib.tmapi.tests}"/> - <pathelement location="${lib.trove}"/> - </path> - </target> - - <!-- =================================================================== --> - <!-- Clean targets --> - <!-- =================================================================== --> - <target name="clean" depends="init"> - <delete dir="${dir.build}"/> - <delete dir="${dir.javadocs}"/> - </target> - - <!-- =================================================================== --> - <!-- Prepares the build directory --> - <!-- =================================================================== --> - <target name="prepare" depends="init"> - <mkdir dir="${dir.build}"/> - <mkdir dir="${dir.build.classes}"/> - </target> - - <!-- =================================================================== --> - <!-- Coverage Tests --> - <!-- =================================================================== --> - <target name="coverage" depends="compile"> - <mkdir dir="${dir.build.tests}"/> - <javac destdir="${dir.build.tests}" - debug="${debug}" - optimize="${optimize}" - target="1.5"> - <classpath> - <pathelement location="${dir.build.classes}"/> - <pathelement location="${lib.junit}"/> - <pathelement location="${lib.mio}"/> - <pathelement location="${lib.tmapi}"/> - <pathelement location="${lib.tmapi.tests}"/> - <pathelement location="${lib.trove}"/> - </classpath> - <src path="${dir.test}"/> - </javac> - <mkdir dir="${dir.coverage}"/> - <emmajava libclasspathref="emma.lib" - sourcepath="${dir.src}" - fullmetadata="yes" - classname="org.tinytim.core.AllTests" - classpathref="run.classpath" - > - <filter includes="org.tinytim.*" excludes="org.tinytim.*Test*, org.tinytim.*$*" /> - <html outfile="${dir.coverage}/index.html" /> - </emmajava> - </target> - - <!-- =================================================================== --> - <!-- Tests --> - <!-- =================================================================== --> - <target name="test" depends="compile"> - <mkdir dir="${dir.build.tests}"/> - <javac destdir="${dir.build.tests}" - debug="${debug}" - optimize="${optimize}" - target="1.5"> - <classpath> - <pathelement location="${dir.build.classes}"/> - <pathelement location="${lib.junit}"/> - <pathelement location="${lib.mio}"/> - <pathelement location="${lib.tmapi}"/> - <pathelement location="${lib.tmapi.tests}"/> - <pathelement location="${lib.trove}"/> - </classpath> - <src path="${dir.test}"/> - </javac> - <junit printsummary="true" showoutput="false" - errorProperty="test.failed" failureProperty="test.failed" - fork="true"> - <classpath refid="run.classpath"/> - <formatter type="brief" usefile="false"/> - <test name="org.tinytim.core.AllTests"/> - </junit> - <fail message="Tests failed. Check test output." if="test.failed"/> - </target> - - <!-- =================================================================== --> - <!-- Compile source files --> - <!-- =================================================================== --> - <target name="compile" depends="clean, prepare"> - <replace file="${dir.src}/org/tinytim/Version.java" token="@RELEASE@" value="${dist.version}"/> - <javac destdir="${dir.build.classes}" - debug="${debug}" - target="1.5"> - <classpath> - <pathelement location="${lib.tmapi}"/> - <pathelement location="${lib.trove}"/> - <pathelement location="${lib.mio}"/> - </classpath> - <src path="${dir.src}"/> - </javac> - <replace file="${dir.src}/org/tinytim/Version.java" token="${dist.version}" value="@RELEASE@"/> - </target> - - <!-- =================================================================== --> - <!-- Creates the Java Docs --> - <!-- =================================================================== --> - <target name="doc" depends="init"> - <mkdir dir="${dir.javadocs}"/> - <javadoc destdir="${dir.javadocs}" - packagenames="org.tinytim.*" - author="true" - version="true" - use="true" - splitindex="true" - noindex="false" - windowtitle="tinyTiM API v${dist.version}" - doctitle="tinyTiM API v${dist.version}"> - <fileset dir="${dir.src}"> - <exclude name="org/tinytim/core/**"/> - <exclude name="org/tinytim/index/**"/> - <exclude name="org/tinytim/internal/**"/> - <exclude name="org/tinytim/utils/Property.*"/> - </fileset> -<!-- - <doclet name="net.gleamynode.apiviz.APIviz" - path="${dir.lib}/apiviz-1.2.4.GA.jar"> - </doclet> ---> - <link href="http://www.tmapi.org/2.0/api/"/> - </javadoc> - </target> - - <!-- =================================================================== --> - <!-- Creates the jar --> - <!-- =================================================================== --> - <target name="jar" depends="compile"> - <jar destfile="${dir.build}/${tinytim.jar}"> - <fileset dir="${dir.build.classes}"> - <include name="**/*.*"/> - </fileset> - <fileset dir="${dir.res}"> - <include name="**/*.*"/> - </fileset> - <manifest> - <attribute name="Implementation-Title" value="tinyTiM"/> - <attribute name="Implementation-Version" value="${dist.version}"/> - <attribute name="Implementation-URL" value="http://tinytim.sourceforge.net/"/> - <attribute name="Import-Package" value="org.osgi.framework,org.tmapi.core,org.tmapi.index,com.semagia.mio"/> - <attribute name="Export-Package" value="org.tinytim.core"/> - <attribute name="Bundle-Name" value="tinyTiM"/> - <attribute name="Bundle-SymbolicName" value="org.tinytim;version=${dist.version}"/> - <attribute name="Bundle-Vendor" value="tinyTiM project"/> - <attribute name="Bundle-Version" value="${dist.version}"/> - </manifest> - </jar> - </target> - - <!-- =================================================================== --> - <!-- Creates the test jar --> - <!-- =================================================================== --> - <target name="testjar" depends="compile, test"> - <jar destfile="${dir.build}/${tinytim-test.jar}"> - <fileset dir="${dir.build.tests}"> - <include name="**/*.*"/> - </fileset> - <manifest> - <attribute name="Implementation-Title" value="tinyTiM Tests"/> - <attribute name="Implementation-Version" value="${dist.version}"/> - <attribute name="Implementation-URL" value="http://tinytim.sourceforge.net/"/> - </manifest> - </jar> - </target> - - <!-- =================================================================== --> - <!-- Prepares a distribution --> - <!-- =================================================================== --> - <target name="dist" depends="jar, testjar, doc"> - <mkdir dir="${dir.dist}"/> - - <copy todir="${dir.dist}" file="${dir.build}/${tinytim.jar}"/> - <copy todir="${dir.dist}" file="${dir.build}/${tinytim-test.jar}"/> - - <copy todir="${dir.dist}/src"> - <fileset dir="${dir.src}"/> - </copy> - <replace file="${dir.dist}/src/org/tinytim/Version.java" token="@RELEASE@" value="${dist.version}"/> - <copy todir="${dir.dist}/test"> - <fileset dir="${dir.test}"/> - </copy> - <copy todir="${dir.dist}/lib"> - <fileset dir="${dir.lib}"> - <include name="tmapi*"/> - <include name="junit*"/> - <include name="trove*"/> - <include name="LICENSE.tmapi*"/> - <include name="LICENSE.junit*"/> - <include name="LICENSE.trove*"/> - </fileset> - </copy> - - <copy todir="${dir.dist}" file="CHANGES.txt"/> - <copy todir="${dir.dist}" file="LICENSE.txt"/> - <copy todir="${dir.dist}" file="README.txt"/> - </target> - - <!-- =================================================================== --> - <!-- Creates the distribution files (.zip and .tar.gz) --> - <!-- --> - <!-- Won't create the distribution files if a test fails --> - <!-- =================================================================== --> - <target name="release" depends="jar, test, dist"> - <tar destfile="${dir.dist.root}/${tinytim.tar}" - basedir="${dir.dist.root}"/> - <gzip src="${dir.dist.root}/${tinytim.tar}" - destfile="${dir.build}/${tinytim.tar.gz}" /> - <delete file="${dir.dist.root}/${tinytim.tar}" /> - <zip destfile="${dir.build}/${tinytim.zip}" basedir="${dir.dist.root}"/> - </target> -</project> +<?xml version="1.0" encoding="utf-8"?> +<project name="tinyTiM" default="jar" basedir="."> + <property file="build.properties"/> + <tstamp/> + <property name="release_type" value="-snapshot-${DSTAMP}${TSTAMP}"/> + + <property name="dir.src" value="${basedir}/src/main/java"/> + <property name="dir.test" value="${basedir}/src/test/java"/> + <property name="dir.lib" value="${basedir}/lib"/> + <property name="dir.res" value="${basedir}/src/main/resources"/> + <property name="dir.coverage" value="${basedir}/coverage"/> + + <property name="lib.junit" value="${dir.lib}/junit-4.8.1.jar"/> + <property name="lib.mio" value="${dir.lib}/semagia-mio-0.9.5.jar"/> + <property name="lib.tmapi" value="${dir.lib}/tmapi-2.0.jar"/> + <property name="lib.tmapi.tests" value="${dir.lib}/tmapi-2.0-tests.jar"/> + <property name="lib.emma" value="${dir.lib}/emma.jar"/> + <property name="lib.emma.task" value="${dir.lib}/emma_ant.jar"/> + + <!-- directory that contains emma.jar and emma_ant.jar: --> + <property name="dir.emma" value="${dir.lib}" /> + + <!-- path element used by EMMA taskdef below: --> + <path id="emma.lib" > + <pathelement location="${dir.emma}/emma.jar" /> + <pathelement location="${dir.emma}/emma_ant.jar" /> + </path> + + <!-- this loads <emma> and <emmajava> custom tasks: --> + <taskdef resource="emma_ant.properties" classpathref="emma.lib" /> + + <target name="help"> + <echo message="--------------------"/> + <echo message="tinyTiM - Build file"/> + <echo message="--------------------"/> + <echo message=""/> + <echo message="Available targets:"/> + <echo message=""/> + <echo message=" jar Creates the jar"/> + <echo message=" testjar Creates the jar with the tests"/> + <echo message=" doc Creates the API documentation"/> + <echo message=" coverage Creates a coverage report"/> + <echo message=" release Creates the jar and a distributable file"/> + </target> + + <target name="init"> + <property name="dist.version" value="${version}${version_suffix}${release_type}"/> + <property name="dist.name" value="tinytim-${dist.version}"/> + + <property name="tinytim.jar" value="${dist.name}.jar"/> + <property name="tinytim-test.jar" value="${dist.name}-tests.jar"/> + <property name="tinytim.tar" value="${dist.name}.tar"/> + <property name="tinytim.tar.gz" value="${tinytim.tar}.gz"/> + <property name="tinytim.zip" value="${dist.name}.zip"/> + + <property name="dir.build" value="${basedir}/build"/> + <property name="dir.dist.root" value="${dir.build}/dist"/> + <property name="dir.dist" value="${dir.dist.root}/${dist.name}"/> + <property name="dir.build.classes" value="${dir.build}/classes"/> + <property name="dir.build.tests" value="${dir.build}/tests"/> + <property name="dir.javadocs" value="${dir.dist}/docs/api"/> + + <path id="run.classpath" > + <pathelement location="${dir.build.classes}" /> + <pathelement location="${dir.build.tests}" /> + <pathelement location="${lib.junit}"/> + <pathelement location="${lib.mio}"/> + <pathelement location="${lib.tmapi}"/> + <pathelement location="${lib.tmapi.tests}"/> + </path> + </target> + + <!-- =================================================================== --> + <!-- Clean targets --> + <!-- =================================================================== --> + <target name="clean" depends="init"> + <delete dir="${dir.build}"/> + <delete dir="${dir.javadocs}"/> + </target> + + <!-- =================================================================== --> + <!-- Prepares the build directory --> + <!-- =================================================================== --> + <target name="prepare" depends="init"> + <mkdir dir="${dir.build}"/> + <mkdir dir="${dir.build.classes}"/> + </target> + + <!-- =================================================================== --> + <!-- Coverage Tests --> + <!-- =================================================================== --> + <target name="coverage" depends="compile"> + <mkdir dir="${dir.build.tests}"/> + <javac destdir="${dir.build.tests}" + debug="${debug}" + optimize="${optimize}" + target="1.5"> + <classpath> + <pathelement location="${dir.build.classes}"/> + <pathelement location="${lib.junit}"/> + <pathelement location="${lib.mio}"/> + <pathelement location="${lib.tmapi}"/> + <pathelement location="${lib.tmapi.tests}"/> + </classpath> + <src path="${dir.test}"/> + </javac> + <mkdir dir="${dir.coverage}"/> + <emmajava libclasspathref="emma.lib" + sourcepath="${dir.src}" + fullmetadata="yes" + classname="org.tinytim.core.AllTests" + classpathref="run.classpath" + > + <filter includes="org.tinytim.*" excludes="org.tinytim.*Test*, org.tinytim.*$*" /> + <html outfile="${dir.coverage}/index.html" /> + </emmajava> + </target> + + <!-- =================================================================== --> + <!-- Tests --> + <!-- =================================================================== --> + <target name="test" depends="compile"> + <mkdir dir="${dir.build.tests}"/> + <javac destdir="${dir.build.tests}" + debug="${debug}" + optimize="${optimize}" + target="1.5"> + <classpath> + <pathelement location="${dir.build.classes}"/> + <pathelement location="${lib.junit}"/> + <pathelement location="${lib.mio}"/> + <pathelement location="${lib.tmapi}"/> + <pathelement location="${lib.tmapi.tests}"/> + </classpath> + <src path="${dir.test}"/> + </javac> + <junit printsummary="true" showoutput="false" + errorProperty="test.failed" failureProperty="test.failed" + fork="true"> + <classpath refid="run.classpath"/> + <formatter type="brief" usefile="false"/> + <test name="org.tinytim.core.AllTests"/> + </junit> + <fail message="Tests failed. Check test output." if="test.failed"/> + </target> + + <!-- =================================================================== --> + <!-- Compile source files --> + <!-- =================================================================== --> + <target name="compile" depends="clean, prepare"> + <replace file="${dir.src}/org/tinytim/Version.java" token="@RELEASE@" value="${dist.version}"/> + <javac destdir="${dir.build.classes}" + debug="${debug}" + target="1.5"> + <classpath> + <pathelement location="${lib.tmapi}"/> + <pathelement location="${lib.mio}"/> + </classpath> + <src path="${dir.src}"/> + </javac> + <replace file="${dir.src}/org/tinytim/Version.java" token="${dist.version}" value="@RELEASE@"/> + </target> + + <!-- =================================================================== --> + <!-- Creates the Java Docs --> + <!-- =================================================================== --> + <target name="doc" depends="init"> + <mkdir dir="${dir.javadocs}"/> + <javadoc destdir="${dir.javadocs}" + packagenames="org.tinytim.*" + author="true" + version="true" + use="true" + splitindex="true" + noindex="false" + windowtitle="tinyTiM API v${dist.version}" + doctitle="tinyTiM API v${dist.version}"> + <fileset dir="${dir.src}"> + <exclude name="org/tinytim/core/**"/> + <exclude name="org/tinytim/index/**"/> + <exclude name="org/tinytim/internal/**"/> + <exclude name="org/tinytim/utils/Property.*"/> + </fileset> +<!-- + <doclet name="net.gleamynode.apiviz.APIviz" + path="${dir.lib}/apiviz-1.2.4.GA.jar"> + </doclet> +--> + <link href="http://www.tmapi.org/2.0/api/"/> + </javadoc> + </target> + + <!-- =================================================================== --> + <!-- Creates the jar --> + <!-- =================================================================== --> + <target name="jar" depends="compile"> + <jar destfile="${dir.build}/${tinytim.jar}"> + <fileset dir="${dir.build.classes}"> + <include name="**/*.*"/> + </fileset> + <fileset dir="${dir.res}"> + <include name="**/*.*"/> + </fileset> + <manifest> + <attribute name="Implementation-Title" value="tinyTiM"/> + <attribute name="Implementation-Version" value="${dist.version}"/> + <attribute name="Implementation-URL" value="http://tinytim.sourceforge.net/"/> + <attribute name="Import-Package" value="org.tmapi.core,org.tmapi.index"/> + <attribute name="Bundle-Name" value="tinyTiM"/> + <attribute name="Bundle-SymbolicName" value="org.tinytim;version=${dist.version}"/> + <attribute name="Bundle-Vendor" value="tinyTiM project"/> + <attribute name="Bundle-Version" value="${dist.version}"/> + </manifest> + </jar> + </target> + + <!-- =================================================================== --> + <!-- Creates the test jar --> + <!-- =================================================================== --> + <target name="testjar" depends="compile, test"> + <jar destfile="${dir.build}/${tinytim-test.jar}"> + <fileset dir="${dir.build.tests}"> + <include name="**/*.*"/> + </fileset> + <manifest> + <attribute name="Implementation-Title" value="tinyTiM Tests"/> + <attribute name="Implementation-Version" value="${dist.version}"/> + <attribute name="Implementation-URL" value="http://tinytim.sourceforge.net/"/> + </manifest> + </jar> + </target> + + <!-- =================================================================== --> + <!-- Prepares a distribution --> + <!-- =================================================================== --> + <target name="dist" depends="jar, testjar, doc"> + <mkdir dir="${dir.dist}"/> + + <copy todir="${dir.dist}" file="${dir.build}/${tinytim.jar}"/> + <copy todir="${dir.dist}" file="${dir.build}/${tinytim-test.jar}"/> + + <copy todir="${dir.dist}/src"> + <fileset dir="${dir.src}"/> + </copy> + <replace file="${dir.dist}/src/org/tinytim/Version.java" token="@RELEASE@" value="${dist.version}"/> + <copy todir="${dir.dist}/test"> + <fileset dir="${dir.test}"/> + </copy> + <copy todir="${dir.dist}/lib"> + <fileset dir="${dir.lib}"> + <include name="tmapi*"/> + <include name="junit*"/> + <include name="LICENSE.tmapi*"/> + <include name="LICENSE.junit*"/> + </fileset> + </copy> + + <copy todir="${dir.dist}" file="CHANGES.txt"/> + <copy todir="${dir.dist}" file="LICENSE.txt"/> + <copy todir="${dir.dist}" file="README.txt"/> + </target> + + <!-- =================================================================== --> + <!-- Creates the distribution files (.zip and .tar.gz) --> + <!-- --> + <!-- Won't create the distribution files if a test fails --> + <!-- =================================================================== --> + <target name="release" depends="jar, test, dist"> + <tar destfile="${dir.dist.root}/${tinytim.tar}" + basedir="${dir.dist.root}"/> + <gzip src="${dir.dist.root}/${tinytim.tar}" + destfile="${dir.build}/${tinytim.tar.gz}" /> + <delete file="${dir.dist.root}/${tinytim.tar}" /> + <zip destfile="${dir.build}/${tinytim.zip}" basedir="${dir.dist.root}"/> + </target> +</project> Deleted: tinytim/trunk/lib/junit-4.5.jar =================================================================== (Binary files differ) Added: tinytim/trunk/lib/junit-4.8.1.jar =================================================================== (Binary files differ) Property changes on: tinytim/trunk/lib/junit-4.8.1.jar ___________________________________________________________________ Added: svn:mime-type + application/octet-stream This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lh...@us...> - 2010-03-01 14:33:14
|
Revision: 372 http://tinytim.svn.sourceforge.net/tinytim/?rev=372&view=rev Author: lheuer Date: 2010-03-01 14:33:04 +0000 (Mon, 01 Mar 2010) Log Message: ----------- Fixed LocatorImpl.equals() reported by Uta Schulze Modified Paths: -------------- tinytim/trunk/CHANGES.txt tinytim/trunk/src/main/java/org/tinytim/core/value/LocatorImpl.java Modified: tinytim/trunk/CHANGES.txt =================================================================== --- tinytim/trunk/CHANGES.txt 2010-02-28 10:07:46 UTC (rev 371) +++ tinytim/trunk/CHANGES.txt 2010-03-01 14:33:04 UTC (rev 372) @@ -2,8 +2,10 @@ Changes Log =========== -2.0.0 a6 (2010-02-xx) +2.0.0 a6 (2010-03-xx) --------------------- +* Fixed LocatorImpl (the impl. of "equals" was different + from the TMAPI 2.0 specs) reported by Uta Schulze * Added OSGi headers to the MANIFEST * Added support to convert XTM 1.0 class-instance relationships to TMDM type-instance relationships Modified: tinytim/trunk/src/main/java/org/tinytim/core/value/LocatorImpl.java =================================================================== --- tinytim/trunk/src/main/java/org/tinytim/core/value/LocatorImpl.java 2010-02-28 10:07:46 UTC (rev 371) +++ tinytim/trunk/src/main/java/org/tinytim/core/value/LocatorImpl.java 2010-03-01 14:33:04 UTC (rev 372) @@ -151,7 +151,7 @@ */ @Override public boolean equals(Object obj) { - return this == obj || (obj instanceof LocatorImpl && _reference.equals(((LocatorImpl) obj)._reference)); + return this == obj || (obj instanceof Locator && _reference.equals(((Locator) obj).getReference())); } /* (non-Javadoc) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lh...@us...> - 2010-03-01 22:41:17
|
Revision: 374 http://tinytim.svn.sourceforge.net/tinytim/?rev=374&view=rev Author: lheuer Date: 2010-03-01 22:41:11 +0000 (Mon, 01 Mar 2010) Log Message: ----------- - Updated TMAPI - First attempt to create Maven-friendly tinyTiM builds Modified Paths: -------------- tinytim/trunk/build.xml Added Paths: ----------- tinytim/trunk/lib/tmapi-2.0.1.snapshot.jar tinytim/trunk/lib/tmapi-tests-2.0.1.snapshot.jar Removed Paths: ------------- tinytim/trunk/lib/tmapi-2.0-tests.jar tinytim/trunk/lib/tmapi-2.0.jar Modified: tinytim/trunk/build.xml =================================================================== --- tinytim/trunk/build.xml 2010-03-01 19:39:00 UTC (rev 373) +++ tinytim/trunk/build.xml 2010-03-01 22:41:11 UTC (rev 374) @@ -12,8 +12,8 @@ <property name="lib.junit" value="${dir.lib}/junit-4.8.1.jar"/> <property name="lib.mio" value="${dir.lib}/semagia-mio-0.9.5.jar"/> - <property name="lib.tmapi" value="${dir.lib}/tmapi-2.0.jar"/> - <property name="lib.tmapi.tests" value="${dir.lib}/tmapi-2.0-tests.jar"/> + <property name="lib.tmapi" value="${dir.lib}/tmapi-2.0.1.snapshot.jar"/> + <property name="lib.tmapi.tests" value="${dir.lib}/tmapi-tests-2.0.1.snapshot.jar"/> <property name="lib.emma" value="${dir.lib}/emma.jar"/> <property name="lib.emma.task" value="${dir.lib}/emma_ant.jar"/> @@ -48,10 +48,12 @@ <property name="dist.name" value="tinytim-${dist.version}"/> <property name="tinytim.jar" value="${dist.name}.jar"/> - <property name="tinytim-test.jar" value="${dist.name}-tests.jar"/> + <property name="tinytim-test.jar" value="tinytim-tests-${dist.version}.jar"/> <property name="tinytim.tar" value="${dist.name}.tar"/> <property name="tinytim.tar.gz" value="${tinytim.tar}.gz"/> <property name="tinytim.zip" value="${dist.name}.zip"/> + <property name="tinytim.pom" value="${dist.name}.pom"/> + <property name="tinytim-test.pom" value="tinytim-tests-${dist.version}.pom"/> <property name="dir.build" value="${basedir}/build"/> <property name="dir.dist.root" value="${dir.build}/dist"/> @@ -215,6 +217,12 @@ <attribute name="Bundle-Version" value="${dist.version}"/> </manifest> </jar> + <checksum file="${dir.build}/${tinytim.jar}" algorithm="sha1"/> + <antcall target="pom"> + <param name="pom-file" value="${tinytim.pom}"/> + <param name="artifact" value="tinytim"/> + </antcall> + <checksum file="${dir.build}/${tinytim.pom}" algorithm="sha1"/> </target> <!-- =================================================================== --> @@ -231,8 +239,25 @@ <attribute name="Implementation-URL" value="http://tinytim.sourceforge.net/"/> </manifest> </jar> + <checksum file="${dir.build}/${tinytim-test.jar}" algorithm="sha1"/> + <antcall target="pom"> + <param name="pom-file" value="${tinytim-test.pom}"/> + <param name="artifact" value="tinytim-test"/> + </antcall> + <checksum file="${dir.build}/${tinytim-test.pom}" algorithm="sha1"/> </target> + <target name="pom"> + <echoxml file="${dir.build}/${pom-file}" namespacePolicy="elementsOnly"> + <project xmlns="http://maven.apache.org/POM/4.0.0"> + <modelVersion>4.0.0</modelVersion> + <groupId>org.tmapi</groupId> + <artifactId>${artifact}</artifactId> + <version>${dist.version}</version> + </project> + </echoxml> + </target> + <!-- =================================================================== --> <!-- Prepares a distribution --> <!-- =================================================================== --> Deleted: tinytim/trunk/lib/tmapi-2.0-tests.jar =================================================================== (Binary files differ) Added: tinytim/trunk/lib/tmapi-2.0.1.snapshot.jar =================================================================== (Binary files differ) Property changes on: tinytim/trunk/lib/tmapi-2.0.1.snapshot.jar ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Deleted: tinytim/trunk/lib/tmapi-2.0.jar =================================================================== (Binary files differ) Added: tinytim/trunk/lib/tmapi-tests-2.0.1.snapshot.jar =================================================================== (Binary files differ) Property changes on: tinytim/trunk/lib/tmapi-tests-2.0.1.snapshot.jar ___________________________________________________________________ Added: svn:mime-type + application/octet-stream This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |