Felix Meschberger wrote:
Oh, I missed the point of Carsten's question.
:)


Of course this situation is interesting. I would say, neither of the methods throws. Just as Map.get(Object) does not throw on missing entries, the get(String) method of this map should not throw in this situation.

For get(String, Object defaultValue): I think failure to convert should be treated just like a missing value and the default should be returned. The situation should be logged, though (DEBUG ?).

For get(String, Class<T> type): Same here: If the value cannot be converted, this should be treated as a missing value and the error be logged.

I agree, not throwing seems to be the better way - especially for scripting as Tobi points out. Logging with level debug should be sufficient in these cases.

Carsten

--
Carsten Ziegeler
[EMAIL PROTECTED]

Reply via email to