Update of /cvsroot/tm4j/tm4j/src/org/tm4j/topicmap/tmdm/basic
In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv2936/src/org/tm4j/topicmap/tmdm/basic
Modified Files:
BasicTopic.java
Log Message:
Do not assume that BasicTopic.occurrences!=null. We allow BasicTopic.occurrences==null (meaning an empty set) for (memory and CPU) performance reasons.
Index: BasicTopic.java
===================================================================
RCS file: /cvsroot/tm4j/tm4j/src/org/tm4j/topicmap/tmdm/basic/BasicTopic.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** BasicTopic.java 23 Jan 2008 19:40:44 -0000 1.4
--- BasicTopic.java 23 Jan 2008 20:34:15 -0000 1.5
***************
*** 42,46 ****
Set<Locator> subjectLocators;
Set<Locator> subjectIdentifiers;
! Set<BasicOccurrence> occurrences;
/**
While rolesPlayed is specified in TMDM, it is redundant from a data completeness point of view.
--- 42,46 ----
Set<Locator> subjectLocators;
Set<Locator> subjectIdentifiers;
! Set<BasicOccurrence> occurrences;
/**
While rolesPlayed is specified in TMDM, it is redundant from a data completeness point of view.
***************
*** 187,190 ****
--- 187,194 ----
BasicOccurrence occurrence = new BasicOccurrence(this,type,datatype,value,scope);
+ if (topicNames==null) {
+ topicNames = createSet();
+ }
+
occurrences.add(occurrence);
***************
*** 195,198 ****
--- 199,204 ----
protected void internalRemove(BasicOccurrence occurrence) {
+ assert occurrences!=null;
+
boolean success = occurrences.remove(occurrence);
|