Java compilation error on list comprehension in ac rule
The following ac rule:
rule template projects(ps : List) {
[p | p : Project in ps where !mayAccess(p)].length == 0
}Causes the following Java compilation error:
[javac] 1. ERROR in …/.servletapp/src-generated/webdsl/generated/functions/
projectacapp_topdef5_listCompr0_.java (at line 22)
[javac] java.util.List<webdsl.generated.domain.Project> thecollection0 = ps0;
[javac] ^^^
[javac] ps0 cannot be resolvedOn the following code:
Submitted by Sander Vermolen on 30 November 2010 at 16:50
@SuppressWarnings(“all”) public class projectacapp_topdef5_listCompr0_
{
public static java.util.List<webdsl.generated.domain.Project> projectacapp_topdef5_listCompr0_()
{
PrintWriter out = ThreadLocalOut.peek();
Environment env = ThreadLocalPage.get() != null ? ThreadLocalPage.get().envGlobalAndSession : null;
java.util.List<webdsl.generated.domain.Project> l0 = new java.util.ArrayList<webdsl.generated.domain.Project>();
l0 = new java.util.ArrayList<webdsl.generated.domain.Project>();
java.util.List<webdsl.generated.domain.Project> thecollection0 = ps0;
if(!org.webdsl.tools.Utils.equal(thecollection0, null))
{
java.util.ArrayList<webdsl.generated.domain.Project> lst28 = new java.util.ArrayList<webdsl.generated.domain.Project>(thecollection0);
int removedcount219 = 0;
Object[] array447 = lst28.toArray();
for(int i452 = 0; i452 < array447.length; i452++)
{
webdsl.generated.domain.Project p0 = (webdsl.generated.domain.Project)array447[i452];
if(!!webdsl.generated.functions.mayAccess_.mayAccess_(p0))
{
lst28.remove(i452 - removedcount219);
removedcount219++;
}
}
Object[] array448 = lst28.toArray();
for(int i453 = 0; i453 < array448.length; i453++)
{
webdsl.generated.domain.Project p0 = (webdsl.generated.domain.Project)array448[i453];
l0.add(p0);
}
}
else
{ }
return l0;
}
}
Log in to post comments