Daniel Rall wrote:
Why is that a problem? I was under the impression that this patch was to make XML-RPC work across different versions of Commons Codec. Do these Codec methods have different implementations with wildly different semantics?
The problem is that the methods have different signatures in terms of the exceptions they are throwing, at least with commons-codec 1.2:
public Object decode(Object arg) throws DecoderException; public Object decode(byte[]);
For commons-codec 1.1, it is required to catch the DecoderException. However, if the compiler believes that we are using decode(byte[]), then it will treat the try { ... } catch (DecoderException e) {} as an error, because that method isn't thrown in the try clause.
The cast to Object forces the use of decode(Object). In that case, the compiler's happy, because the DecoderException is thrown again.
Jochen