Lines 465-476
Link Here
|
465 |
if (obj == null) |
465 |
if (obj == null) |
466 |
return null; |
466 |
return null; |
467 |
if (obj instanceof String) { |
467 |
if (obj instanceof String) { |
468 |
if ("".equals(obj)) |
|
|
469 |
return null; |
470 |
PropertyEditor editor = PropertyEditorManager.findEditor(type); |
468 |
PropertyEditor editor = PropertyEditorManager.findEditor(type); |
471 |
if (editor != null) { |
469 |
if (editor == null) { |
472 |
editor.setAsText((String) obj); |
470 |
if ("".equals(obj)) { |
473 |
return editor.getValue(); |
471 |
return null; |
|
|
472 |
} |
473 |
throw new ELException(MessageFactory.get("error.convert", obj, |
474 |
obj.getClass(), type)); |
475 |
} else { |
476 |
try { |
477 |
editor.setAsText((String) obj); |
478 |
return editor.getValue(); |
479 |
} catch (RuntimeException e) { |
480 |
if ("".equals(obj)) { |
481 |
return null; |
482 |
} |
483 |
throw new ELException(MessageFactory.get("error.convert", |
484 |
obj, obj.getClass(), type), e); |
485 |
} |
474 |
} |
486 |
} |
475 |
} |
487 |
} |
476 |
|
488 |
|