harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Boris Kuznetsov" <boris.v.kuznet...@gmail.com>
Subject Re: [classlib] Exception-throwing compatibility question
Date Tue, 04 Jul 2006 08:27:56 GMT
So, we should always follow RI?
Even when RI behavior is not consistent and contradicts the spec.?

Here is one example:

javax.crypto.EncryptedPrivateKeyInfo(algName, encryptedData) spec. states:
"NoSuchAlgorithmException - if the specified algName is not supported."

For code:
     new EncryptedPrivateKeyInfo(":/. ",new byte[598];
RI output is
java.security.NoSuchAlgorithmException: unrecognized algorithm name: 0
        at sun.security.x509.AlgorithmId.get(AlgorithmId.java:105)
        at javax.crypto.EncryptedPrivateKeyInfo.<init>(Ljava.lang.String;[B)V(Da
shoA12275:???)

But the following code produses NumberFormatException on RI
     new EncryptedPrivateKeyInfo(":/. ",new byte[598];

RI output:
java.lang.NumberFormatException: For input string: ":/"
        at java.lang.NumberFormatException.forInputString(NumberFormatException.
java:48)
        at java.lang.Integer.parseInt(Integer.java:447)
        at java.lang.Integer.valueOf(Integer.java:553)
        at sun.security.util.ObjectIdentifier.<init>(ObjectIdentifier.java:69)
        at sun.security.x509.AlgorithmId.algOID(AlgorithmId.java:312)
        at sun.security.x509.AlgorithmId.get(AlgorithmId.java:98)
        at javax.crypto.EncryptedPrivateKeyInfo.<init>(Ljava.lang.String;[B)V(Da
shoA12275:???)

On 7/3/06, Geir Magnusson Jr <geir@pobox.com> wrote:
> I think that the details should be considered in this, but I'd rather us
>  follow the RI (and log it as a difference from the spec) if we have
> some inkling that user code will be affected by it.
>
> geir
>
>
> Mikhail Loenko wrote:
> > Do I undersyand correctly that even when spec says e.g.
> > that Exception1 is thrown when parameter1 == 10 and RI
> > throws Exception2 then we follow RI ?
> >
> > Thanks,
> > Mikhail
> >
> > ---------------------------------------------------------------------
> > Terms of use : http://incubator.apache.org/harmony/mailing.html
> > To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
> > For additional commands, e-mail: harmony-dev-help@incubator.apache.org
> >
> >
> >
>
> ---------------------------------------------------------------------
> Terms of use : http://incubator.apache.org/harmony/mailing.html
> To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
> For additional commands, e-mail: harmony-dev-help@incubator.apache.org
>
>


-- 
Best regards,
Boris Kuznetsov
Intel Middleware Products Division

---------------------------------------------------------------------
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
For additional commands, e-mail: harmony-dev-help@incubator.apache.org


Mime
View raw message