You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@santuario.apache.org by "Colm O hEigeartaigh (JIRA)" <ji...@apache.org> on 2010/12/07 13:06:11 UTC

[jira] Updated: (SANTUARIO-228) KeyResolver.registerAtStart() leads to ClassCastException

     [ https://issues.apache.org/jira/browse/SANTUARIO-228?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Colm O hEigeartaigh updated SANTUARIO-228:
------------------------------------------

    Fix Version/s: Java 1.4.4
         Assignee:     (was: XML Security Developers Mailing List)

> KeyResolver.registerAtStart() leads to ClassCastException
> ---------------------------------------------------------
>
>                 Key: SANTUARIO-228
>                 URL: https://issues.apache.org/jira/browse/SANTUARIO-228
>             Project: Santuario
>          Issue Type: Bug
>          Components: Java
>         Environment: Operating System: Windows NT
> Platform: PC
>            Reporter: Clement Pellerin
>             Fix For: Java 1.4.4
>
>         Attachments: diff2.txt
>
>
> Created an attachment (id=25627)
> source code patch
> KeyResolver.registerAtStart() adds a String to KeyResolver._resolverVector.
> In ResolverIterator.next(), we expect the items in _resolverVector to be KeyResolver instances and this causes a ClassCastException.
> To reproduce, run this code:
> KeyResolver.registerAtStart("org.apache.xml.security.test.encryption.BobKeyResolver");
> KeyResolverSpi resolver = (KeyResolverSpi)KeyResolver.iterator().next();
> The solution is to call new KeyResolver(className) just like KeyResolver.register().
> Unfortunately, we cannot add the throws clauses. For backwards compatibility,  we return an unchecked RuntimeException instead. We chose IllegalArgumentException.
> We also modify ResolverIterator.remove() to throw an UnsupportedOperationException.
> I did not add a junit for this bug because there is no way to remove a KeyResolver once it is registered. This would affect the subsequent tests.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.