- if (sourceSubStatement.getPublicDefinition().getDeclaredRepresentationClass()
- .equals(MandatoryStatement.class)) {
- throw new InferenceException(
- String.format(
- "An augment cannot add node '%s' because it is mandatory and in module different from target",
- sourceCtx.rawStatementArgument()), sourceCtx.getStatementSourceReference());
- }
+ InferenceException.throwIf(MandatoryStatement.class.equals(
+ sourceSubStatement.getPublicDefinition().getDeclaredRepresentationClass()),
+ sourceCtx.getStatementSourceReference(),
+ "An augment cannot add node '%s' because it is mandatory and in module different from target",
+ sourceCtx.rawStatementArgument());