// A YANG version 1 module or submodule must not import a YANG version 1.1 module by revision.
if (moduleVersion == YANG_1) {
substatementsOfType(Import).map[module].filterNull.filter[eResource !== null && !eIsProxy].filter [
yangVersion != moduleVersion
].forEach [
val message = '''Cannot import a version «yangVersion» submodule in a version «moduleVersion» module.''';
error(message, it, ABSTRACT_IMPORT__MODULE, BAD_IMPORT_YANG_VERSION);
];
}
When the error() is invoked to report Version consistency issues, it always comes up with the IllegalAgumentException. I think that's due to it is wrongly used.
at org.eclipse.xtext.validation.AbstractDeclarativeValidator.checkIsFromCurrentlyCheckedResource(AbstractDeclarativeValidator.java:571)
at org.eclipse.xtext.validation.AbstractDeclarativeValidator.acceptError(AbstractDeclarativeValidator.java:554)
at org.eclipse.xtext.validation.AbstractDeclarativeValidator.error(AbstractDeclarativeValidator.java:435)
at io.typefox.yang.validation.YangValidator.lambda$checkVersionConsistency$8(YangValidator.java:203)
at java.lang.Iterable.forEach(Iterable.java:75)
at io.typefox.yang.validation.YangValidator.checkVersionConsistency(YangValidator.java:205)
// A YANG version 1 module or submodule must not import a YANG version 1.1 module by revision.
if (moduleVersion == YANG_1) { substatementsOfType(Import).map[module].filterNull.filter[eResource !== null && !eIsProxy].filter [ yangVersion != moduleVersion ].forEach [ val message = '''Cannot import a version «yangVersion» submodule in a version «moduleVersion» module.'''; error(message, it, ABSTRACT_IMPORT__MODULE, BAD_IMPORT_YANG_VERSION); ]; } When the error() is invoked to report Version consistency issues, it always comes up with the IllegalAgumentException. I think that's due to it is wrongly used. at org.eclipse.xtext.validation.AbstractDeclarativeValidator.checkIsFromCurrentlyCheckedResource(AbstractDeclarativeValidator.java:571) at org.eclipse.xtext.validation.AbstractDeclarativeValidator.acceptError(AbstractDeclarativeValidator.java:554) at org.eclipse.xtext.validation.AbstractDeclarativeValidator.error(AbstractDeclarativeValidator.java:435) at io.typefox.yang.validation.YangValidator.lambda$checkVersionConsistency$8(YangValidator.java:203) at java.lang.Iterable.forEach(Iterable.java:75) at io.typefox.yang.validation.YangValidator.checkVersionConsistency(YangValidator.java:205)