Skip to content

Commit

Permalink
Allow unparseable enums in COMPAT mode
Browse files Browse the repository at this point in the history
This issue made midPoint unavailable if such an enum was present
in system configuration object.
  • Loading branch information
mederly committed Sep 11, 2018
1 parent 13ac506 commit 9e6c439
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
Expand Up @@ -1233,7 +1233,8 @@ private <T> T unmarshalEnumFromPrimitive(PrimitiveXNode prim, Class<T> beanClass
}
}
if (javaEnumString == null) {
throw new SchemaException("Cannot find enum value for string '"+primValue+"' in "+beanClass);
pc.warnOrThrow(LOGGER, "Cannot find enum value for string '"+primValue+"' in "+beanClass);
return null;
}

@SuppressWarnings("unchecked")
Expand Down
Expand Up @@ -379,8 +379,11 @@ private <T> PrismPropertyValue<T> parsePropertyValue(@NotNull XNode node,
if (expression != null) {
PrismPropertyValue<T> ppv = new PrismPropertyValue<>(null, prismContext, null, null, expression);
return ppv;

}
} else {
// There's no point in returning PPV(null) as it would soon fail on internal PP check.
// We are probably recovering from an error in COMPAT mode here, so let's just skip this value.
return null;
}
}
PrismPropertyValue<T> ppv = new PrismPropertyValue<>(realValue);
ppv.setPrismContext(prismContext);
Expand Down
Expand Up @@ -1130,7 +1130,7 @@ public FullTextSearchConfigurationType getFullTextSearchConfiguration() {
@Override
public void postInit(OperationResult result) throws SchemaException {

LOGGER.info("Executing repository postInit method");
LOGGER.debug("Executing repository postInit method");

SystemConfigurationType systemConfiguration;
try {
Expand Down

0 comments on commit 9e6c439

Please sign in to comment.