On Aug 1, 2006, at 6:39 AM, [EMAIL PROTECTED] wrote:
Object attrValue = attr.getValue();
if (attrValue instanceof ComponentDefinition) {
retValue = (ComponentDefinition) attrValue;
- } else { // It must be a string
+ } else if (attrValue instanceof String) {
retValue = this.getDefinition((String) attr
.getValue());
}
@@ -239,12 +239,12 @@
*/
private ComponentDefinition getDefinitionByAttribute(
ComponentAttribute attr, Locale locale) {
- ComponentDefinition retValue;
+ ComponentDefinition retValue = null;
Object attrValue = attr.getValue();
if (attrValue instanceof ComponentDefinition) {
retValue = (ComponentDefinition) attrValue;
- } else { // It must be a string
+ } else if (attrValue instanceof String) {
retValue = this.getDefinition((String) attr
.getValue(), locale);
}
Thanks for doing this :-) It's nice to see someone else committing.
In the above code do you think it's ok to return null in the unlikely
event attrValue is not a String? Oe should we do an else that throws
an exception or something?
Greg
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]