This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 98864

Summary: Need insync support for generic type properties
Product: obsolete Reporter: Winston Prakash <wjprakash>
Component: visualwebAssignee: _ deva <deva>
Status: VERIFIED FIXED    
Severity: blocker    
Priority: P2    
Version: 6.x   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter:
Bug Depends on:    
Bug Blocks: 98555    

Description Winston Prakash 2007-03-23 23:57:43 UTC
Insync must support generic type properties. This enhancement request has two parts

- Insync must create DesignBean for abstract (interface) type properties in the
design context

For Example
     private List myList;
     public List getMyList(){
        return myList
     }   

insync currently ignore this property and does not create any DesignBean as its
instance will be null.

- If the property is of generic type then insync should be able to give the
parameter type

  private List<String> myList;
  public List<String> getMyList(){
        return myList
  }   

insync should be able to give the parameter type of the property as "String"

The suggested solution

- Create an interface (mixin) called ParameterizedDesignBean

  public interface ParameterizedDesignBean{
     Type[] getTypeParameters();
  }

If the property is parameterized, then check if the DesignBean is of type
ParameterizedDesignBean, and then get the Type[] as
 
   if (designBean instanceof ParameterizedDesignBean){
     Class[] types = ((ParameterizedDesignBean)designBean).getTypeParameters();
   }

The Type must be compiled first and should be available in the classloader. But
now we have a problem, that the project need to be compiled, closed and opened. 

insync should avoid the above step and able to get the Type parametere of the
properties if the project is compiled.
Comment 1 _ deva 2007-05-16 01:09:24 UTC
Initial implementation is checked-in as follows
Checking in faces/HtmlBean.java;
/cvs/visualweb/insync/src/org/netbeans/modules/visualweb/insync/faces/HtmlBean.
java,v  <--  HtmlBean.java
new revision: 1.2; previous revision: 1.1
done
Checking in faces/FacesPageUnit.java;
/cvs/visualweb/insync/src/org/netbeans/modules/visualweb/insync/faces/FacesPage
Unit.java,v  <--  FacesPageUnit.java
new revision: 1.8; previous revision: 1.7
done
Checking in faces/MarkupBean.java;
/cvs/visualweb/insync/src/org/netbeans/modules/visualweb/insync/faces/MarkupBea
n.java,v  <--  MarkupBean.java
new revision: 1.3; previous revision: 1.2
done
Checking in faces/FacesBean.java;
/cvs/visualweb/insync/src/org/netbeans/modules/visualweb/insync/faces/FacesBean
.java,v  <--  FacesBean.java
new revision: 1.4; previous revision: 1.3
done
Checking in beans/Bean.java;
/cvs/visualweb/insync/src/org/netbeans/modules/visualweb/insync/beans/Bean.java
,v  <--  Bean.java
new revision: 1.9; previous revision: 1.8
done
Checking in beans/BeansUnit.java;
/cvs/visualweb/insync/src/org/netbeans/modules/visualweb/insync/beans/BeansUnit
.java,v  <--  BeansUnit.java
new revision: 1.9; previous revision: 1.8
done
Checking in live/LiveUnit.java;
/cvs/visualweb/insync/src/org/netbeans/modules/visualweb/insync/live/LiveUnit.j
ava,v  <--  LiveUnit.java
new revision: 1.5; previous revision: 1.4
done
RCS 
file: /cvs/visualweb/insync/src/org/netbeans/modules/visualweb/insync/live/Bean
sDesignBeanExt.java,v
done
Checking in live/BeansDesignBeanExt.java;
/cvs/visualweb/insync/src/org/netbeans/modules/visualweb/insync/live/BeansDesig
nBeanExt.java,v  <--  BeansDesignBeanExt.java
initial revision: 1.1
done
Checking in java/JavaClass.java;
/cvs/visualweb/insync/src/org/netbeans/modules/visualweb/insync/java/JavaClass.
java,v  <--  JavaClass.java
new revision: 1.9; previous revision: 1.8
done
Comment 2 Lark Fitzgerald 2007-08-29 18:40:14 UTC
Verified using:
Product Version: NetBeans 6 IDE Dev (Build 200708281200) 
System: Windows Vista version 6.0 running on x86; Cp1252; en_US (nb)
Java: 1.6.0_02; Java HotSpot(TM) Client VM 1.6.0_02-b06
Glassfish: 58c
Woodstock 4.1: 200708281412