运行以下代码时:
def v1=[];
def p=[];
v.as('x')
.except(v1).sideEffect{v1.add(it)} // step 1
.outE('priority').inV // step 2
.except(p).sideEffect{p.add(it)} // step 3
.inE('priority').outV // step 4
.loop('x'){true} >> -1; // step 5
return [vertices:v1, priorities:p];
我收到此错误:
"exception": "java.lang.StackOverflowError",
"stacktrace": [
"java.lang.reflect.InvocationTargetException.(InvocationTargetException.java:72)",
"sun.reflect.GeneratedMethodAccessor259.invoke(Unknown Source)",
"sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)",
"java.lang.reflect.Method.invoke(Method.java:616)",
"org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90)",
"groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233)",
"org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:272)",
"groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:883)",
"groovy.lang.Closure.call(Closure.java:410)",
"org.codehaus.groovy.runtime.DefaultGroovyMethods.callClosureForMapEntry(DefaultGroovyMethods.java:3392)",
"org.codehaus.groovy.runtime.DefaultGroovyMethods.collect(DefaultGroovyMethods.java:2188)",
"org.codehaus.groovy.runtime.DefaultGroovyMethods.collect(DefaultGroovyMethods.java:2205)",
"org.codehaus.groovy.runtime.dgm$77.invoke(Unknown Source)",
还有更多堆栈跟踪。
请说明为什么会出现此错误。