if (throwables.size() > 0) {
throw throwables.keySet().iterator().next();
}
}
catch (TimeoutException e) {
problems.add(new ValidationProblem(IMarker.SEVERITY_ERROR, "Loading of resource '"
+ resource.getFile().getAbsolutePath() + "' took more than "
+ BeansCorePlugin.getDefault().getPreferenceStore()
.getInt(BeansCorePlugin.TIMEOUT_CONFIG_LOADING_PREFERENCE_ID) + "sec",
file, 1));
}
}
catch (Throwable e) {
int line = -1;
if (throwables.containsKey(e)) {
line = throwables.get(e);
}
// Skip SAXParseExceptions because they're already handled by the SAX ErrorHandler
if (e instanceof BeanDefinitionStoreException) {
if (e.getCause() != null) {
problems.add(new ValidationProblem(IMarker.SEVERITY_ERROR, String.format(
"Error occured processing XML '%s'. See Error Log for more details", e.getCause().getMessage()), file, line));
BeansCorePlugin.log(new Status(IStatus.INFO, BeansCorePlugin.PLUGIN_ID, String.format(
"Error occured processing '%s'", file.getFullPath()), e.getCause()));
}
else {
problems.add(new ValidationProblem(IMarker.SEVERITY_ERROR, e.getMessage(), file, line));
BeansCorePlugin.log(new Status(IStatus.INFO, BeansCorePlugin.PLUGIN_ID, String.format(
"Error occured processing '%s'", file.getFullPath()), e));
}
}
else if (!(e.getCause() instanceof SAXParseException)
&& !(e instanceof BeanDefinitionParsingException)) {
problems.add(new ValidationProblem(IMarker.SEVERITY_ERROR, e.getMessage(), file, line));
BeansCorePlugin.log(new Status(IStatus.INFO, BeansCorePlugin.PLUGIN_ID, String.format(
"Error occured processing '%s'", file.getFullPath()), e));
}
}
}