Skip to content

Commit

Permalink
Fix erroneous "Trying to skip ..." messages
Browse files Browse the repository at this point in the history
  • Loading branch information
mederly committed Jun 14, 2019
1 parent 6bbe6dc commit f6a6a76
Showing 1 changed file with 12 additions and 6 deletions.
Expand Up @@ -210,14 +210,14 @@ private XNodeImpl marshalItemValue(@NotNull PrismValue itemValue, @Nullable Item
Collection<? extends QName> itemsToSkip) throws SchemaException {
XNodeImpl xnode;
if (definition == null && typeName == null && itemValue instanceof PrismPropertyValue) {
LOGGER.warn("Trying to skip marshalling items {} where not applicable: {}", itemsToSkip, itemValue);
return serializePropertyRawValue((PrismPropertyValue<?>) itemValue);
checkItemsToSkip(itemValue, itemsToSkip);
return serializePropertyRawValue((PrismPropertyValue<?>) itemValue);
} else if (itemValue instanceof PrismReferenceValue) {
LOGGER.warn("Trying to skip marshalling items {} where not applicable: {}", itemsToSkip, itemValue);
xnode = serializeReferenceValue((PrismReferenceValue)itemValue, (PrismReferenceDefinition) definition, ctx);
checkItemsToSkip(itemValue, itemsToSkip);
xnode = serializeReferenceValue((PrismReferenceValue)itemValue, (PrismReferenceDefinition) definition, ctx);
} else if (itemValue instanceof PrismPropertyValue<?>) {
LOGGER.warn("Trying to skip marshalling items {} where not applicable: {}", itemsToSkip, itemValue);
xnode = serializePropertyValue((PrismPropertyValue<?>)itemValue, (PrismPropertyDefinition) definition, typeName);
checkItemsToSkip(itemValue, itemsToSkip);
xnode = serializePropertyValue((PrismPropertyValue<?>)itemValue, (PrismPropertyDefinition) definition, typeName);
} else if (itemValue instanceof PrismContainerValue<?>) {
xnode = marshalContainerValue((PrismContainerValue<?>)itemValue, (PrismContainerDefinition) definition, ctx, itemsToSkip);
} else {
Expand All @@ -232,6 +232,12 @@ private XNodeImpl marshalItemValue(@NotNull PrismValue itemValue, @Nullable Item
return xnode;
}

private void checkItemsToSkip(@NotNull PrismValue itemValue, Collection<? extends QName> itemsToSkip) {
if (CollectionUtils.isNotEmpty(itemsToSkip)) {
LOGGER.warn("Trying to skip marshalling items {} where not applicable: {}", itemsToSkip, itemValue);
}
}

private boolean shouldPutTypeInExportMode(SerializationContext ctx, ItemDefinition definition) {
if (!SerializationContext.isSerializeForExport(ctx) || definition == null || !definition.isRuntimeSchema()) {
return false;
Expand Down

0 comments on commit f6a6a76

Please sign in to comment.