Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Signed-off-by: Kai Kreuzer <[email protected]>
  • Loading branch information
kaikreuzer committed Apr 28, 2017
1 parent 7911cb2 commit 0aded11
Showing 1 changed file with 13 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -260,14 +260,19 @@ private String validateModel(String name, InputStream inputStream) throws IOExce
}

// Check for validation errors, but log them only
org.eclipse.emf.common.util.Diagnostic diagnostic = Diagnostician.INSTANCE
.validate(resource.getContents().get(0));
for (org.eclipse.emf.common.util.Diagnostic d : diagnostic.getChildren()) {
warnings.add(d.getMessage());
}
if (warnings.size() > 0) {
logger.info("Validation issues found in configuration model '{}', using it anyway:\n{}", name,
StringUtils.join(warnings, "\n"));
try {
org.eclipse.emf.common.util.Diagnostic diagnostic = Diagnostician.INSTANCE
.validate(resource.getContents().get(0));
for (org.eclipse.emf.common.util.Diagnostic d : diagnostic.getChildren()) {
warnings.add(d.getMessage());
}
if (warnings.size() > 0) {
logger.info("Validation issues found in configuration model '{}', using it anyway:\n{}", name,
StringUtils.join(warnings, "\n"));
}
} catch (NullPointerException e) {
// see https://github.com/eclipse/smarthome/issues/3335
logger.debug("Validation of '{}' skipped due to internal errors.", name);
}
}
} finally {
Expand Down

0 comments on commit 0aded11

Please sign in to comment.