Update of /cvsroot/tm4j/tm4j/src/org/tm4j/topicmap/tmdm/tm4j1
In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv14006/src/org/tm4j/topicmap/tmdm/tm4j1
Modified Files:
TopicImpl.java TopicMapImpl.java
Log Message:
We cannot force the callers of the TM4J 0.9.x API to use TopicImpl[] instead of Topic[]. Thus, we have to assume that, although we get a Topic[] array, it contains only TopicImpl objects..
Index: TopicImpl.java
===================================================================
RCS file: /cvsroot/tm4j/tm4j/src/org/tm4j/topicmap/tmdm/tm4j1/TopicImpl.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** TopicImpl.java 22 Jan 2008 20:52:46 -0000 1.4
--- TopicImpl.java 22 Jan 2008 20:58:11 -0000 1.5
***************
*** 353,362 ****
*/
public BaseName createName(String id, String nameString, Topic[] scope) throws DuplicateObjectIDException, PropertyVetoException {
! return createName(id,nameString,(TopicImpl[]) scope);
}
protected BaseName createName(String id, String nameString, TopicImpl[] scope) throws DuplicateObjectIDException, PropertyVetoException {
return getContainer().unmergedToExternal(getRepresentedObject().createTopicName(nameString,getContainer().convertToInternalScope(scope)));
}
// Get/Set/Add Occurrence
--- 353,365 ----
*/
public BaseName createName(String id, String nameString, Topic[] scope) throws DuplicateObjectIDException, PropertyVetoException {
! return getContainer().unmergedToExternal(getRepresentedObject().createTopicName(nameString,getContainer().convertToInternalScope(scope)));
! // return createName(id,nameString,(TopicImpl[]) scope);
}
+ /*
protected BaseName createName(String id, String nameString, TopicImpl[] scope) throws DuplicateObjectIDException, PropertyVetoException {
return getContainer().unmergedToExternal(getRepresentedObject().createTopicName(nameString,getContainer().convertToInternalScope(scope)));
}
+ */
// Get/Set/Add Occurrence
Index: TopicMapImpl.java
===================================================================
RCS file: /cvsroot/tm4j/tm4j/src/org/tm4j/topicmap/tmdm/tm4j1/TopicMapImpl.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** TopicMapImpl.java 22 Jan 2008 20:46:52 -0000 1.6
--- TopicMapImpl.java 22 Jan 2008 20:58:11 -0000 1.7
***************
*** 316,324 ****
}
protected BasicScope convertToInternalScope(Topic[] scope) {
return convertToInternalScope((TopicImpl[]) scope);
}
! protected BasicScope convertToInternalScope(TopicImpl[] scope) {
if ((scope==null)||(scope.length==0)) {
return null;
--- 316,326 ----
}
+ /*
protected BasicScope convertToInternalScope(Topic[] scope) {
return convertToInternalScope((TopicImpl[]) scope);
}
+ */
! protected BasicScope convertToInternalScope(Topic/*Impl*/[] scope) {
if ((scope==null)||(scope.length==0)) {
return null;
***************
*** 326,331 ****
BasicScope basicScope = new BasicScope();
! for (TopicImpl topic : scope) {
! basicScope.internalAddScopingTopic((BasicScopeable) getRepresentedObject(),(BasicTopic) topic.getRepresentedObject());
}
--- 328,333 ----
BasicScope basicScope = new BasicScope();
! for (Topic topic : scope) {
! basicScope.internalAddScopingTopic((BasicScopeable) getRepresentedObject(),(BasicTopic) ((TopicImpl) topic).getRepresentedObject());
}
|