213631 WSDL, XML and XSD file validation incorrectly reports success
diff --git a/plugins/org.eclipse.wst.validation.ui/vf2/org/eclipse/wst/validation/ui/internal/preferences/ValidationPropertyPage.java b/plugins/org.eclipse.wst.validation.ui/vf2/org/eclipse/wst/validation/ui/internal/preferences/ValidationPropertyPage.java
index 49bdd62..bf0414b 100644
--- a/plugins/org.eclipse.wst.validation.ui/vf2/org/eclipse/wst/validation/ui/internal/preferences/ValidationPropertyPage.java
+++ b/plugins/org.eclipse.wst.validation.ui/vf2/org/eclipse/wst/validation/ui/internal/preferences/ValidationPropertyPage.java
@@ -659,13 +659,15 @@
}
public boolean performOk() throws InvocationTargetException {
- if (!ValManager.getDefault().getGlobalPreferences().getOverride()){
+
+ addBuilder();
+ // [213631] this warning should only be shown if the user actually tried to override
+ // the validators
+ if (!ValManager.getDefault().getGlobalPreferences().getOverride() && _override.getSelection()){
MessageDialog.openWarning(_shell, ValUIMessages.Validation,
ValUIMessages.ProjectOverridesNotAllowed);
return false;
}
-
- addBuilder();
updateV1ProjectSettings();
getProjectPreferences().setSuspend(_suspend.getSelection());
getProjectPreferences().setOverride(_override.getSelection());
diff --git a/plugins/org.eclipse.wst.validation/vf2/org/eclipse/wst/validation/Validator.java b/plugins/org.eclipse.wst.validation/vf2/org/eclipse/wst/validation/Validator.java
index f3bf020..4ae6930 100644
--- a/plugins/org.eclipse.wst.validation/vf2/org/eclipse/wst/validation/Validator.java
+++ b/plugins/org.eclipse.wst.validation/vf2/org/eclipse/wst/validation/Validator.java
@@ -355,7 +355,9 @@
if (helper instanceof WorkbenchContext){
WorkbenchContext wc = (WorkbenchContext)helper;
List<String> files = new LinkedList<String>();
- files.add(resource.getProjectRelativePath().toString());
+ // [213631] The JSP validator expects full paths not relative paths, but the XML validator
+ // expects relative paths.
+ files.add(wc.getPortableName(resource));
wc.setValidationFileURIs(files);
}
ValidatorLauncher.getLauncher().start(helper, v, reporter);
diff --git a/plugins/org.eclipse.wst.validation/vf2/org/eclipse/wst/validation/internal/ValidatorExtensionReader.java b/plugins/org.eclipse.wst.validation/vf2/org/eclipse/wst/validation/internal/ValidatorExtensionReader.java
index c995623..9f4e0bb 100644
--- a/plugins/org.eclipse.wst.validation/vf2/org/eclipse/wst/validation/internal/ValidatorExtensionReader.java
+++ b/plugins/org.eclipse.wst.validation/vf2/org/eclipse/wst/validation/internal/ValidatorExtensionReader.java
@@ -61,7 +61,8 @@
for (IExtension ext : extensionPoint.getExtensions()){
for (IConfigurationElement validator : ext.getConfigurationElements()){
- list.add(processValidator(validator, ext.getUniqueIdentifier(), ext.getLabel(), deep));
+ Validator v = processValidator(validator, ext.getUniqueIdentifier(), ext.getLabel(), deep);
+ if (v != null)list.add(v);
}
}
Validator[] val = new Validator[list.size()];
@@ -78,7 +79,7 @@
* @param deep if true load all the configuration elements for each validator, if false
* do a shallow load, where only the validator class, id and name's are loaded.
*
- * @return a configured validator
+ * @return a configured validator or return null if there was an error.
*/
private Validator processValidator(IConfigurationElement validator, String id, String label, boolean deep) {
Validator.V2 v = null;
@@ -158,6 +159,7 @@
for (IExtension ext : extensionPoint.getExtensions()){
for (IConfigurationElement validator : ext.getConfigurationElements()){
Validator v = processValidator(validator, ext.getUniqueIdentifier(), ext.getLabel(), true);
+ if (v == null)continue;
Validator old = map.get(v.getId());
if (old == null || old.getVersion() < v.getVersion()){
//TODO we may be replacing user preferences, at some point we may want to do a real migration.