[ 
https://issues.apache.org/jira/browse/SOLR-2410?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13003690#comment-13003690
 ] 

Yonik Seeley commented on SOLR-2410:
------------------------------------

Thanks Dawid!

bq. 2) cast superclass's array to (Object[]) first, then cast to the concrete 
component type. Here:

I tried this, but couldn't get it to work:

{code}

class Example
{
   public static class A<T> {
       @SuppressWarnings("unchecked") // it is here for a reason :)
       public T[] array = (T[]) new Object [1];
   }

   public static void main(String [] args)
   {
       A<Integer> clazzA = new A<Integer>();
       System.out.println(((Integer[])((Object[])clazzA.array))[0]);
   }
}
{code}

> ConcurrentLRUCache can throw class cast exception
> -------------------------------------------------
>
>                 Key: SOLR-2410
>                 URL: https://issues.apache.org/jira/browse/SOLR-2410
>             Project: Solr
>          Issue Type: Bug
>    Affects Versions: 4.0
>            Reporter: Yonik Seeley
>             Fix For: 4.0
>
>
> ConcurrentLRUCache throws a class cast exception.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to