Skip to content

Commit

Permalink
Fixing the fix of ValueSet definitions that was supposed to fix the r…
Browse files Browse the repository at this point in the history
…ange problems but rather broken the domain
  • Loading branch information
semancik committed Apr 12, 2019
1 parent 8d9b82d commit 702d8ba
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
Expand Up @@ -939,11 +939,13 @@ private <IV extends PrismValue, ID extends ItemDefinition> Source<IV,ID> parseSo
throw new IllegalStateException("Unknown resolve result "+sourceObject);
}
}

ID sourceDefinition = (ID)typedSourceObject.getDefinition();

// apply domain
ValueSetDefinitionType domainSetType = sourceType.getSet();
if (domainSetType != null) {
ValueSetDefinition<IV,D> setDef = new ValueSetDefinition<>(domainSetType, outputDefinition, expressionProfile, variableName, "domain of "+variableName+" in "+getMappingContextDescription(), task, result);
ValueSetDefinition<IV,ID> setDef = new ValueSetDefinition<>(domainSetType, sourceDefinition, expressionProfile, variableName, "domain of "+variableName+" in "+getMappingContextDescription(), task, result);
setDef.init(expressionFactory);
setDef.setAdditionalVariables(variables);
try {
Expand Down Expand Up @@ -983,7 +985,7 @@ private <IV extends PrismValue, ID extends ItemDefinition> Source<IV,ID> parseSo
}
}

Source<IV,ID> source = new Source<>(itemOld, delta, itemNew, sourceQName, (ID)typedSourceObject.getDefinition());
Source<IV,ID> source = new Source<>(itemOld, delta, itemNew, sourceQName, sourceDefinition);
source.setResidualPath(residualPath);
source.setResolvePath(resolvePath);
source.setSubItemDeltas(subItemDeltas);
Expand Down
4 changes: 4 additions & 0 deletions repo/repo-common/pom.xml
Expand Up @@ -101,6 +101,10 @@
<groupId>commons-lang</groupId>
<artifactId>commons-lang</artifactId>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
Expand Down
Expand Up @@ -15,6 +15,8 @@
*/
package com.evolveum.midpoint.repo.common.expression;

import org.apache.commons.lang3.Validate;

import com.evolveum.midpoint.prism.ItemDefinition;
import com.evolveum.midpoint.prism.PrismPropertyDefinition;
import com.evolveum.midpoint.prism.PrismPropertyValue;
Expand Down Expand Up @@ -53,6 +55,7 @@ public class ValueSetDefinition<IV extends PrismValue, D extends ItemDefinition>
public ValueSetDefinition(ValueSetDefinitionType setDefinitionType, D itemDefinition, ExpressionProfile expressionProfile, String additionalVariableName, String shortDesc, Task task, OperationResult result) {
super();
this.setDefinitionType = setDefinitionType;
Validate.notNull(itemDefinition, "No item definition for value set in %s", shortDesc);
this.itemDefinition = itemDefinition;
this.expressionProfile = expressionProfile;
this.additionalVariableName = additionalVariableName;
Expand Down

0 comments on commit 702d8ba

Please sign in to comment.