You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@beehive.apache.org by "James Song (JIRA)" <be...@incubator.apache.org> on 2005/02/01 01:10:17 UTC

[jira] Created: (BEEHIVE-218) Java generics on controls:needs a programmatic instantiation model

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
 Assigned to: Kyle Marvin 
     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


[jira] Commented: (BEEHIVE-218) Java generics on controls:needs a programmatic instantiation model

Posted by "James Song (JIRA)" <be...@incubator.apache.org>.
     [ http://issues.apache.org/jira/browse/BEEHIVE-218?page=comments#action_58344 ]
     
James Song commented on BEEHIVE-218:
------------------------------------

To repro: ant detailed.tests from controls/test

> 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: Kyle Marvin
>      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


[jira] Resolved: (BEEHIVE-218) Java generics on controls:needs a programmatic instantiation model

Posted by "Kyle Marvin (JIRA)" <be...@incubator.apache.org>.
     [ 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


[jira] Closed: (BEEHIVE-218) Java generics on controls:needs a programmatic instantiation model

Posted by "James Song (JIRA)" <be...@incubator.apache.org>.
     [ http://issues.apache.org/jira/browse/BEEHIVE-218?page=all ]
     
James Song closed BEEHIVE-218:
------------------------------


Test had been updated and passing.

> 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
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira