commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Adam R. B. Jack" <>
Subject [codec] base64Codec.decode and DecoderException
Date Tue, 25 May 2004 16:44:08 GMT

An interested compatibility issue has surfaced from this:

/usr/local/gump/public/workspace/ws-xmlrpc/src/java/org/apache/xmlrpc/Defaul exception org.apache.commons.codec.DecoderException
is never thrown in body of corresponding try statement
    [javac]         catch (DecoderException e) {
    [javac]         ^

This is the code:

 public Object createBase64(String cdata)
        try {
            return base64Codec.decode(cdata.getBytes());
        catch (DecoderException e) {
            //TODO: consider throwing an exception here?
            return new byte[0];

Now since exceptions are not part of the signature of methods, there is
probably no runtime issue here. If the exception is not going to be thrown
that is the same as it not actually being thrown, I guess. Still, there is a
compile time problem and if one removes the catch they can't compile against
older codec (assuming that was declared to throw it).

Can somebody provide the background information on this exception, from this
method, and when (releases) it might've been available and removed? If this
exception is never to be thrown again (and better, if it isn't thrown in
currently released code) then maybe we can just ask the ws-xmlrpc folks to

BTW: I don't think there is a way to turn off this compiler error, is there?
Would that be appropriate, even if possible?


Experience the Unwired Enterprise:
Try Sybase:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message