[ http://issues.apache.org/jira/browse/BEEHIVE-218?page=history ]
     
Kyle Marvin resolved BEEHIVE-218:
---------------------------------

     Assign To: James Song  (was: Kyle Marvin)
    Resolution: Fixed

This was actually an issue in the test itself.  You can use Beans.instantiate() 
or Controls.instantiate() to construct a control with formal type parameters 
declared as part of its interface.   The bound type parameters are not / should 
not be passed as part of the classname passed to Beans.instantiate... but you 
can still cast the result back to a bound variable of the appropriate type, and 
get the expected results/behavior/compile-time type checking.   Part of the 
issue here is that there is no reflective instantation support for generics, 
because there is really no generic type info at runtime due to its 
implementation via erasure.

I went ahead and checked in a modified version of the test case that does the 
right thing (w/ one other minor logic error fix too) as SVN revision 154225, 
and made both declarative and programmatic generic instantiation tests part of 
checkin tests as well.

> Java generics on controls:needs a programmatic instantiation model
> ------------------------------------------------------------------
>
>          Key: BEEHIVE-218
>          URL: http://issues.apache.org/jira/browse/BEEHIVE-218
>      Project: Beehive
>         Type: Bug
>   Components: Controls
>     Versions: V1Beta
>     Reporter: James Song
>     Assignee: James Song
>      Fix For: V1Beta

>
> A SimpleControl with a type parameter is checked-in by r149232.
> It is instantiated declaratively without any problem.
> When instantiating this control programmatically, a ClassNotFoundException is 
> thrown. This might be caused by  java.beans.Beans.instantiate not supporting 
> instantiating bean class with type parameter.
> For instantiating controls with type parameter, some instruction in 
> ControlProgramming.doc might be necessary.  

-- 
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
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira

Reply via email to