harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Stepan Mishura" <stepan.mish...@gmail.com>
Subject Re: [jira] Created: (HARMONY-315) javax.crypto.Cipher.getInstance doesn't match RI exception behaviour.
Date Mon, 10 Apr 2006 06:14:03 GMT
Hi Mark,

Basing on the bug description I assume that RI checks provider parameter
first. In all your examples this parameter is invalid. The spec. for method
javax.crypto.Cipher.getInstance(String transformation,
                                String provider)
says:
"Throws:
    NoSuchAlgorithmException - if transformation is null, empty, in an
invalid format, or not available from the specified provider.
    NoSuchProviderException - if the specified provider has not been
configured.
    NoSuchPaddingException - if transformation contains a padding scheme
that is not available.
    IllegalArgumentException - if the provider is null."

So IllegalArgumentException can be thrown only if the provider parameter is
null. But IMHO in case of empty string NoSuchProviderException should be
thrown.

What do you think?

Thanks,
Stepan

>From: Mark Hindess (JIRA)
>Sent: Friday, April 07, 2006 1:31 AM
>To: harmony-commits@incubator.apache.org
>Subject: [jira] Created: (HARMONY-315) javax.crypto.Cipher.getInstance
>doesn't match RI exception behaviour.
>
>javax.crypto.Cipher.getInstance doesn't match RI exception behaviour.
>---------------------------------------------------------------------
>
>         Key: HARMONY-315
>         URL: http://issues.apache.org/jira/browse/HARMONY-315
>     Project: Harmony
>        Type: Bug
>
>  Components: Classlib
>    Reporter: Mark Hindess
>    Priority: Trivial
>
>
>javax.crypto.getInstance methods doesn't match reference behaviour.  It
>throws NoSuchProvideExceptions when it should be throwing
>IllegalArgumentExceptions.  See log below for details.
>
>RI is Sun Microsystems Inc. 1.5.0_06
>Test is harmony classlib
>
>javax.crypto.Cipher.getInstance("",""):
>  RI throws java.lang.IllegalArgumentException: Missing provider
>  Test throws java.security.NoSuchProviderException: Provider  is not
>available
>
>javax.crypto.Cipher.getInstance("",(java.lang.String)null):
>  RI throws java.lang.IllegalArgumentException: Missing provider
>  Test throws java.security.NoSuchProviderException: Provider null is not
>available
>
>javax.crypto.Cipher.getInstance((java.lang.String)null,""):
>  RI throws java.lang.IllegalArgumentException: Missing provider
>  Test throws java.security.NoSuchProviderException: Provider  is not
>available
>
>javax.crypto.Cipher.getInstance((java.lang.String)null,(java.lang.String)nu
>ll):
>  RI throws java.lang.IllegalArgumentException: Missing provider
>  Test throws java.security.NoSuchProviderException: Provider null is not
>available
>
>
>--
>This message is automatically generated by JIRA.
>-
>If you think it was sent incorrectly contact one of the administrators:
>   http://issues.apache.org/jira/secure/Administrators.jspa
>-
>For more information on JIRA, see:
>   http://www.atlassian.com/software/jira


--
---------------------------------------------------------------------
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

Thanks,
Stepan Mishura
Intel Middleware Products Division

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message