[rules-dev] Parameterized type

fanory sgohory at club-internet.fr
Mon Mar 12 15:41:31 EDT 2007


Hello,

I have a method on my business model that return a parameterized type:

public <P extends Profile> P getProfileValidAt(Class<P> profileClass, Calendar
validAt) {
    	List<P> history = getHistoryProfile(profileClass);
    	
    	for(P profile: history) {
    		if (profile.getValidFrom().compareTo(validAt)<=0 &&
profile.getValidTo().compareTo(validAt)>=0) {
    			return profile;
    		}
    	}
    	
    	return null;
    }

I use jbossrule 3.0.3.
I my drl files, i use this method but it doesn't work. I have a compilation
error on the rules. If i change parameterized type to a specific profile class,
it works. Do jbossrule accept parameterized type as return value type ?
Thanks in advance.




More information about the rules-dev mailing list