When query optimization is enabled, java compilation fails for the following code:

list-params-local-redef-query-opt.app (will be added to test/succeed):

	application test
	
	entity Person{
	  name :: String (searchable)
	}
	
	page root(){
	  selectPersonFromList()
	  
	  //overrides global template
	  define personInContext( p : Person ){
	    output(p)
	  }  
	}
	
	define selectPersonFromList() {
	  var lst := (search Person matching "name").results();
	    
	  var groups := toGroups( lst )
	  for ( g : List<Person> in groups){
	    outputPersonList(g)
	  }
	}
	
	define outputPersonList( ps : List<Person> ) {
	  for ( p: Person in ps){
	      personInContext (p)
	  }
	}
	
	define span personInContext( p : Person ){
	  //to be overridden
	}
	
	function toGroups ( ps : List<Person>) : List<List<Person>> {
	  var a := List<Person>();
	  var b := List<List<Person>>();
	  
	  b.add(a);
	  return b;
	}

Errors:

/home/elmer/newLocation/test/succeed/.servletapp/build.xml:79: warning: 'includeantruntime' was not set, defaulting to build.sysclasspath=last; set to false for repeatable builds
Compiling 18 source files to /home/elmer/newLocation/test/succeed/.servletapp/WEB-INF/classes
/home/elmer/newLocation/test/succeed/.servletapp/src-generated/webdsl/generated/templates/selectPersonFromList_Template.java:146: prefetchFor(int,java.util.Collection<? extends org.webdsl.WebDSLEntity>) in utils.TemplateServlet cannot be applied to (int,java.util.ArrayList<java.util.List<webdsl.generated.domain.Person>>)
        ((TemplateServlet)env.getTemplate("personInContextPerson").newInstance()).prefetchFor(1, list1);
                                                                                 ^
/home/elmer/newLocation/test/succeed/.servletapp/src-generated/webdsl/generated/templates/selectPersonFromList_Template.java:224: prefetchFor(int,java.util.Collection<? extends org.webdsl.WebDSLEntity>) in utils.TemplateServlet cannot be applied to (int,java.util.ArrayList<java.util.List<webdsl.generated.domain.Person>>)
        ((TemplateServlet)env.getTemplate("personInContextPerson").newInstance()).prefetchFor(1, list2);
                                                                                 ^
/home/elmer/newLocation/test/succeed/.servletapp/src-generated/webdsl/generated/templates/selectPersonFromList_Template.java:305: prefetchFor(int,java.util.Collection<? extends org.webdsl.WebDSLEntity>) in utils.TemplateServlet cannot be applied to (int,java.util.ArrayList<java.util.List<webdsl.generated.domain.Person>>)
        ((TemplateServlet)env.getTemplate("personInContextPerson").newInstance()).prefetchFor(1, list4);
                                                                                 ^
/home/elmer/newLocation/test/succeed/.servletapp/src-generated/webdsl/generated/templates/selectPersonFromList_Template.java:403: prefetchFor(int,java.util.Collection<? extends org.webdsl.WebDSLEntity>) in utils.TemplateServlet cannot be applied to (int,java.util.ArrayList<java.util.List<webdsl.generated.domain.Person>>)
        ((TemplateServlet)env.getTemplate("personInContextPerson").newInstance()).prefetchFor(1, list3);
                                                                                 ^
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
4 errors
Submitted by Elmer van Chastelet on 10 December 2012 at 11:35

On 10 December 2012 at 12:30 Elmer van Chastelet tagged query-optimization

On 11 December 2012 at 09:46 Christoffer Gersen commented:

Fixed in r5556


On 11 December 2012 at 09:46 Christoffer Gersen closed this issue.

On 11 December 2012 at 09:46 Christoffer Gersen tagged 1.3.0

Log in to post comments