Fixed long-standing bug from CopyComponentAdvisor which added
identifiers for non-STR.Component instances which has started causing
problems in team server products in version comparisons.
refs #7842
Change-Id: Iac3e604993ec579cd8feb443843af944a8fa01f3
(cherry picked from commit
c912edf13bf5a91b2f6dc855f54d8728aa0a64f5)
*******************************************************************************/
package org.simantics.modeling.mapping;
*******************************************************************************/
package org.simantics.modeling.mapping;
-import gnu.trove.map.hash.THashMap;
-
import org.simantics.Simantics;
import org.simantics.databoard.Bindings;
import org.simantics.Simantics;
import org.simantics.databoard.Bindings;
import org.simantics.project.IProject;
import org.simantics.structural.stubs.StructuralResource2;
import org.simantics.project.IProject;
import org.simantics.structural.stubs.StructuralResource2;
+import gnu.trove.map.hash.THashMap;
+
/**
* @author Tuukka Lehtonen
*/
/**
* @author Tuukka Lehtonen
*/
Resource targetContainer, Map<Object, Object> map) throws DatabaseException {
StructuralResource2 STR = StructuralResource2.getInstance(graph);
Resource copy = null;
Resource targetContainer, Map<Object, Object> map) throws DatabaseException {
StructuralResource2 STR = StructuralResource2.getInstance(graph);
Resource copy = null;
- if (graph.isInstanceOf(source, STR.Connection)) {
+ Set<Resource> types = graph.getTypes(source);
+ if (types.contains(STR.Connection)) {
// Configuration connections are not named, can't use TG copy for
// them at the moment.
copy = CopyAdvisorUtil.copy2(graph, source, null, map);
// Configuration connections are not named, can't use TG copy for
// them at the moment.
copy = CopyAdvisorUtil.copy2(graph, source, null, map);
if (graph.hasStatement(sourceContainer, L0.ConsistsOf, source))
graph.claim(targetContainer, L0.ConsistsOf, copy);
if (graph.hasStatement(sourceContainer, L0.ConsistsOf, source))
graph.claim(targetContainer, L0.ConsistsOf, copy);
- Layer0Utils.claimNewIdentifier(graph, copy, false);
+ if (types.contains(L0.TypeWithIdentifier))
+ Layer0Utils.claimNewIdentifier(graph, copy, false);
if (context.get(SynchronizationHints.NO_RENAME) == null)
renameComponent(context, graph, source, copy, sourceContainer, targetContainer);
return copy;
if (context.get(SynchronizationHints.NO_RENAME) == null)
renameComponent(context, graph, source, copy, sourceContainer, targetContainer);
return copy;