Skip to content

Commit

Permalink
Merge branch 'master' of github.com:Evolveum/midpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
semancik committed Jun 22, 2015
2 parents d201a05 + 44723c6 commit 5fb316f
Showing 1 changed file with 18 additions and 2 deletions.
Expand Up @@ -23,6 +23,9 @@

import com.evolveum.midpoint.prism.PrismConstants;
import com.evolveum.midpoint.util.JAXBUtil;
import com.evolveum.midpoint.util.logging.LoggingUtils;
import com.evolveum.midpoint.util.logging.Trace;
import com.evolveum.midpoint.util.logging.TraceManager;
import com.evolveum.prism.xml.ns._public.query_3.SearchFilterType;

import org.apache.commons.lang.StringUtils;
Expand Down Expand Up @@ -71,6 +74,8 @@

public class XNodeProcessor {

private static final Trace LOGGER = TraceManager.getTrace(XNodeProcessor.class);

public static final String ARTIFICIAL_OBJECT_NAME = "anObject";

private PrismContext prismContext;
Expand Down Expand Up @@ -462,7 +467,7 @@ public <T> T parsePrismPropertyRealValue(XNode xnode, PrismPropertyDefinition<T>
if (xnode instanceof PrimitiveXNode<?>) {
return parseAtomicValueFromPrimitive((PrimitiveXNode<T>) xnode, propertyDef, propertyDef.getTypeName());
} else if (xnode instanceof MapXNode) {
return parsePrismPropertyRealValueFromMap((MapXNode)xnode, null, propertyDef);
return parsePrismPropertyRealValueFromMap((MapXNode) xnode, null, propertyDef);
} else {
throw new IllegalArgumentException("Cannot parse property value from "+xnode);
}
Expand Down Expand Up @@ -506,12 +511,23 @@ private <T> T parseAtomicValueFromPrimitive(PrimitiveXNode<T> xprim, PrismProper
throw new SchemaException("Illegal value found in property "+xprim+". Allowed values are: "+ def.getAllowedValues());
} else {
// just skip the value
LOGGER.error("Skipping unknown value of type {}. Value: {}", typeName, xprim.getStringValue());
return null;
}
}

} else {
realValue = xprim.getParsedValue(typeName);
try {
realValue = xprim.getParsedValue(typeName);
} catch (SchemaException e) {
if (isStrict()) {
throw e;
} else {
// just skip the value
LoggingUtils.logException(LOGGER, "Couldn't parse primitive value of type {}. Value: {}", e, typeName, xprim.getStringValue());
return null;
}
}
}

if (realValue == null) {
Expand Down

0 comments on commit 5fb316f

Please sign in to comment.