Community
Participate
Working Groups
Created attachment 114269 [details] Patch to org.eclipse.pde.ds.core Using Eclipse 3.5M2 The component XML error reporting needs some work to make more domain specific to DS, and consequently, more easily understood by the user. Rather than reporting XML element/attribute value issues, it makes sense to talk in terms of referenced services, provided services, properties, etc. Some samples of how the messages now look: * An element of type 'provide' must define a 'interface' attribute value. * The referenced service 'abc' has a cardinality of 'n..m' that is illegal. * The referenced service 'abc' has a target of 'foo' that is not a well-formed LDAP filter. * A factory component cannot be immediate. * The component must be immediate when it does not provide any services and is not a factory component. * The Java type 'Component' in the attribute 'interface' cannot be found. * The properties file 'blah.properties' cannot be found. * The property 'age' must contain one or more values. * The property 'ports' cannot define both the single value '80' and an array of values. * The service 'java.lang.String' is already provided. While reviewing the error messages I discovered a hole in the validation where a <property> element's name attribute can be set to the value "", which equates to no name. The code today purely checks for null, which only catches the case where the name attribute has been omitted. See DSErrorReporter's validatePropertyElements method. I also found a case where a <property> with a type of "String" and a value of "" was being marked with a warning. This is the one exception to the rule that a <property> cannot have a value of any empty string. See DSErrorReporter's validatePropertyAttrValueAndBody method. Please see the attached patch that addresses issues with the DSErrorReporter and the Messages and message.properties. Nothing ground breaking here, but these changes should make problems easier for the user to understand and resolve.
Thanks!
done. > 20091005
Thanks again Simon. This definitely improves the usability.
Thanks for accepting this patch, Chris.