code
stringlengths
63
466k
code_sememe
stringlengths
141
3.79M
token_type
stringlengths
274
1.23M
public void clientResolved (Name username, ClientObject clobj) { // we'll be keeping this bad boy _clobj = clobj; // if our connection was closed while we were resolving our client object, then just // abandon ship if (getConnection() == null) { log.info("Session ended before client object could be resolved " + this + "."); endSession(); return; } // Dump our secret into the client local for easy access clobj.getLocal(ClientLocal.class).secret = getSecret(); // finish up our regular business sessionWillStart(); sendBootstrap(); // let the client manager know that we're operational _clmgr.clientSessionDidStart(this); }
class class_name[name] begin[{] method[clientResolved, return_type[void], modifier[public], parameter[username, clobj]] begin[{] assign[member[._clobj], member[.clobj]] if[binary_operation[call[.getConnection, parameter[]], ==, literal[null]]] begin[{] call[log.info, parameter[binary_operation[binary_operation[literal["Session ended before client object could be resolved "], +, THIS[]], +, literal["."]]]] call[.endSession, parameter[]] return[None] else begin[{] None end[}] assign[call[clobj.getLocal, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ClientLocal, sub_type=None))]], call[.getSecret, parameter[]]] call[.sessionWillStart, parameter[]] call[.sendBootstrap, parameter[]] call[_clmgr.clientSessionDidStart, parameter[THIS[]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[clientResolved] operator[SEP] identifier[Name] identifier[username] , identifier[ClientObject] identifier[clobj] operator[SEP] { identifier[_clobj] operator[=] identifier[clobj] operator[SEP] Keyword[if] operator[SEP] identifier[getConnection] operator[SEP] operator[SEP] operator[==] Other[null] operator[SEP] { identifier[log] operator[SEP] identifier[info] operator[SEP] literal[String] operator[+] Keyword[this] operator[+] literal[String] operator[SEP] operator[SEP] identifier[endSession] operator[SEP] operator[SEP] operator[SEP] Keyword[return] operator[SEP] } identifier[clobj] operator[SEP] identifier[getLocal] operator[SEP] identifier[ClientLocal] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[secret] operator[=] identifier[getSecret] operator[SEP] operator[SEP] operator[SEP] identifier[sessionWillStart] operator[SEP] operator[SEP] operator[SEP] identifier[sendBootstrap] operator[SEP] operator[SEP] operator[SEP] identifier[_clmgr] operator[SEP] identifier[clientSessionDidStart] operator[SEP] Keyword[this] operator[SEP] operator[SEP] }
private ConfigurationContext getManagerContext(final CacheManager mgr) { ConfigurationContext ctx = manager2defaultConfig.get(mgr); if (ctx != null) { return ctx; } synchronized (this) { ctx = manager2defaultConfig.get(mgr); if (ctx != null) { return ctx; } if (mgr.isDefaultManager()) { ctx = classLoader2config.get(mgr.getClassLoader()); } if (ctx == null) { ctx = createContext(mgr.getClassLoader(), mgr.getName(), getFileName(mgr)); } Map<CacheManager, ConfigurationContext> m2 = new HashMap<CacheManager, ConfigurationContext>(manager2defaultConfig); m2.put(mgr, ctx); manager2defaultConfig = m2; return ctx; } }
class class_name[name] begin[{] method[getManagerContext, return_type[type[ConfigurationContext]], modifier[private], parameter[mgr]] begin[{] local_variable[type[ConfigurationContext], ctx] if[binary_operation[member[.ctx], !=, literal[null]]] begin[{] return[member[.ctx]] else begin[{] None end[}] SYNCHRONIZED[THIS[]] BEGIN[{] assign[member[.ctx], call[manager2defaultConfig.get, parameter[member[.mgr]]]] if[binary_operation[member[.ctx], !=, literal[null]]] begin[{] return[member[.ctx]] else begin[{] None end[}] if[call[mgr.isDefaultManager, parameter[]]] begin[{] assign[member[.ctx], call[classLoader2config.get, parameter[call[mgr.getClassLoader, parameter[]]]]] else begin[{] None end[}] if[binary_operation[member[.ctx], ==, literal[null]]] begin[{] assign[member[.ctx], call[.createContext, parameter[call[mgr.getClassLoader, parameter[]], call[mgr.getName, parameter[]], call[.getFileName, parameter[member[.mgr]]]]]] else begin[{] None end[}] local_variable[type[Map], m2] call[m2.put, parameter[member[.mgr], member[.ctx]]] assign[member[.manager2defaultConfig], member[.m2]] return[member[.ctx]] END[}] end[}] END[}]
Keyword[private] identifier[ConfigurationContext] identifier[getManagerContext] operator[SEP] Keyword[final] identifier[CacheManager] identifier[mgr] operator[SEP] { identifier[ConfigurationContext] identifier[ctx] operator[=] identifier[manager2defaultConfig] operator[SEP] identifier[get] operator[SEP] identifier[mgr] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[ctx] operator[!=] Other[null] operator[SEP] { Keyword[return] identifier[ctx] operator[SEP] } Keyword[synchronized] operator[SEP] Keyword[this] operator[SEP] { identifier[ctx] operator[=] identifier[manager2defaultConfig] operator[SEP] identifier[get] operator[SEP] identifier[mgr] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[ctx] operator[!=] Other[null] operator[SEP] { Keyword[return] identifier[ctx] operator[SEP] } Keyword[if] operator[SEP] identifier[mgr] operator[SEP] identifier[isDefaultManager] operator[SEP] operator[SEP] operator[SEP] { identifier[ctx] operator[=] identifier[classLoader2config] operator[SEP] identifier[get] operator[SEP] identifier[mgr] operator[SEP] identifier[getClassLoader] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[ctx] operator[==] Other[null] operator[SEP] { identifier[ctx] operator[=] identifier[createContext] operator[SEP] identifier[mgr] operator[SEP] identifier[getClassLoader] operator[SEP] operator[SEP] , identifier[mgr] operator[SEP] identifier[getName] operator[SEP] operator[SEP] , identifier[getFileName] operator[SEP] identifier[mgr] operator[SEP] operator[SEP] operator[SEP] } identifier[Map] operator[<] identifier[CacheManager] , identifier[ConfigurationContext] operator[>] identifier[m2] operator[=] Keyword[new] identifier[HashMap] operator[<] identifier[CacheManager] , identifier[ConfigurationContext] operator[>] operator[SEP] identifier[manager2defaultConfig] operator[SEP] operator[SEP] identifier[m2] operator[SEP] identifier[put] operator[SEP] identifier[mgr] , identifier[ctx] operator[SEP] operator[SEP] identifier[manager2defaultConfig] operator[=] identifier[m2] operator[SEP] Keyword[return] identifier[ctx] operator[SEP] } }
public static <K, V> Map<K, V> zip(K[] keys, V[] values, boolean isOrder) { if (isEmpty(keys) || isEmpty(values)) { return null; } final int size = Math.min(keys.length, values.length); final Map<K, V> map = CollectionUtil.newHashMap(size, isOrder); for (int i = 0; i < size; i++) { map.put(keys[i], values[i]); } return map; }
class class_name[name] begin[{] method[zip, return_type[type[Map]], modifier[public static], parameter[keys, values, isOrder]] begin[{] if[binary_operation[call[.isEmpty, parameter[member[.keys]]], ||, call[.isEmpty, parameter[member[.values]]]]] begin[{] return[literal[null]] else begin[{] None end[}] local_variable[type[int], size] local_variable[type[Map], map] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=keys, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), MemberReference(member=values, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])], member=put, postfix_operators=[], prefix_operators=[], qualifier=map, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=size, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) return[member[.map]] end[}] END[}]
Keyword[public] Keyword[static] operator[<] identifier[K] , identifier[V] operator[>] identifier[Map] operator[<] identifier[K] , identifier[V] operator[>] identifier[zip] operator[SEP] identifier[K] operator[SEP] operator[SEP] identifier[keys] , identifier[V] operator[SEP] operator[SEP] identifier[values] , Keyword[boolean] identifier[isOrder] operator[SEP] { Keyword[if] operator[SEP] identifier[isEmpty] operator[SEP] identifier[keys] operator[SEP] operator[||] identifier[isEmpty] operator[SEP] identifier[values] operator[SEP] operator[SEP] { Keyword[return] Other[null] operator[SEP] } Keyword[final] Keyword[int] identifier[size] operator[=] identifier[Math] operator[SEP] identifier[min] operator[SEP] identifier[keys] operator[SEP] identifier[length] , identifier[values] operator[SEP] identifier[length] operator[SEP] operator[SEP] Keyword[final] identifier[Map] operator[<] identifier[K] , identifier[V] operator[>] identifier[map] operator[=] identifier[CollectionUtil] operator[SEP] identifier[newHashMap] operator[SEP] identifier[size] , identifier[isOrder] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[size] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[map] operator[SEP] identifier[put] operator[SEP] identifier[keys] operator[SEP] identifier[i] operator[SEP] , identifier[values] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[map] operator[SEP] }
public Rational getPropertyAsRational(String name) { long cPtr = VideoJNI.Configurable_getPropertyAsRational(swigCPtr, this, name); return (cPtr == 0) ? null : new Rational(cPtr, false); }
class class_name[name] begin[{] method[getPropertyAsRational, return_type[type[Rational]], modifier[public], parameter[name]] begin[{] local_variable[type[long], cPtr] return[TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=cPtr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator===), if_false=ClassCreator(arguments=[MemberReference(member=cPtr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Rational, sub_type=None)), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null))] end[}] END[}]
Keyword[public] identifier[Rational] identifier[getPropertyAsRational] operator[SEP] identifier[String] identifier[name] operator[SEP] { Keyword[long] identifier[cPtr] operator[=] identifier[VideoJNI] operator[SEP] identifier[Configurable_getPropertyAsRational] operator[SEP] identifier[swigCPtr] , Keyword[this] , identifier[name] operator[SEP] operator[SEP] Keyword[return] operator[SEP] identifier[cPtr] operator[==] Other[0] operator[SEP] operator[?] Other[null] operator[:] Keyword[new] identifier[Rational] operator[SEP] identifier[cPtr] , literal[boolean] operator[SEP] operator[SEP] }
public static Geometry longestLine(Geometry geomA, Geometry geomB) { Coordinate[] coords = new MaxDistanceOp(geomA, geomB).getCoordinatesDistance(); if(coords!=null){ return geomA.getFactory().createLineString(coords); } return null; }
class class_name[name] begin[{] method[longestLine, return_type[type[Geometry]], modifier[public static], parameter[geomA, geomB]] begin[{] local_variable[type[Coordinate], coords] if[binary_operation[member[.coords], !=, literal[null]]] begin[{] return[call[geomA.getFactory, parameter[]]] else begin[{] None end[}] return[literal[null]] end[}] END[}]
Keyword[public] Keyword[static] identifier[Geometry] identifier[longestLine] operator[SEP] identifier[Geometry] identifier[geomA] , identifier[Geometry] identifier[geomB] operator[SEP] { identifier[Coordinate] operator[SEP] operator[SEP] identifier[coords] operator[=] Keyword[new] identifier[MaxDistanceOp] operator[SEP] identifier[geomA] , identifier[geomB] operator[SEP] operator[SEP] identifier[getCoordinatesDistance] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[coords] operator[!=] Other[null] operator[SEP] { Keyword[return] identifier[geomA] operator[SEP] identifier[getFactory] operator[SEP] operator[SEP] operator[SEP] identifier[createLineString] operator[SEP] identifier[coords] operator[SEP] operator[SEP] } Keyword[return] Other[null] operator[SEP] }
Type instantiatePolymorphicSignatureInstance(Env<AttrContext> env, MethodSymbol spMethod, // sig. poly. method or null if none Resolve.MethodResolutionContext resolveContext, List<Type> argtypes) { final Type restype; //The return type for a polymorphic signature call is computed from //the enclosing tree E, as follows: if E is a cast, then use the //target type of the cast expression as a return type; if E is an //expression statement, the return type is 'void' - otherwise the //return type is simply 'Object'. A correctness check ensures that //env.next refers to the lexically enclosing environment in which //the polymorphic signature call environment is nested. switch (env.next.tree.getTag()) { case TYPECAST: JCTypeCast castTree = (JCTypeCast)env.next.tree; restype = (TreeInfo.skipParens(castTree.expr) == env.tree) ? castTree.clazz.type : syms.objectType; break; case EXEC: JCTree.JCExpressionStatement execTree = (JCTree.JCExpressionStatement)env.next.tree; restype = (TreeInfo.skipParens(execTree.expr) == env.tree) ? syms.voidType : syms.objectType; break; default: restype = syms.objectType; } List<Type> paramtypes = Type.map(argtypes, new ImplicitArgType(spMethod, resolveContext.step)); List<Type> exType = spMethod != null ? spMethod.getThrownTypes() : List.of(syms.throwableType); // make it throw all exceptions MethodType mtype = new MethodType(paramtypes, restype, exType, syms.methodClass); return mtype; }
class class_name[name] begin[{] method[instantiatePolymorphicSignatureInstance, return_type[type[Type]], modifier[default], parameter[env, spMethod, resolveContext, argtypes]] begin[{] local_variable[type[Type], restype] SwitchStatement(cases=[SwitchStatementCase(case=['TYPECAST'], statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MemberReference(member=tree, postfix_operators=[], prefix_operators=[], qualifier=env.next, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=JCTypeCast, sub_type=None)), name=castTree)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=JCTypeCast, sub_type=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=restype, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=TernaryExpression(condition=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=expr, postfix_operators=[], prefix_operators=[], qualifier=castTree, selectors=[])], member=skipParens, postfix_operators=[], prefix_operators=[], qualifier=TreeInfo, selectors=[], type_arguments=None), operandr=MemberReference(member=tree, postfix_operators=[], prefix_operators=[], qualifier=env, selectors=[]), operator===), if_false=MemberReference(member=objectType, postfix_operators=[], prefix_operators=[], qualifier=syms, selectors=[]), if_true=MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=castTree.clazz, selectors=[]))), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=['EXEC'], statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MemberReference(member=tree, postfix_operators=[], prefix_operators=[], qualifier=env.next, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=JCTree, sub_type=ReferenceType(arguments=None, dimensions=None, name=JCExpressionStatement, sub_type=None))), name=execTree)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=JCTree, sub_type=ReferenceType(arguments=None, dimensions=None, name=JCExpressionStatement, sub_type=None))), StatementExpression(expression=Assignment(expressionl=MemberReference(member=restype, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=TernaryExpression(condition=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=expr, postfix_operators=[], prefix_operators=[], qualifier=execTree, selectors=[])], member=skipParens, postfix_operators=[], prefix_operators=[], qualifier=TreeInfo, selectors=[], type_arguments=None), operandr=MemberReference(member=tree, postfix_operators=[], prefix_operators=[], qualifier=env, selectors=[]), operator===), if_false=MemberReference(member=objectType, postfix_operators=[], prefix_operators=[], qualifier=syms, selectors=[]), if_true=MemberReference(member=voidType, postfix_operators=[], prefix_operators=[], qualifier=syms, selectors=[]))), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=restype, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=objectType, postfix_operators=[], prefix_operators=[], qualifier=syms, selectors=[])), label=None)])], expression=MethodInvocation(arguments=[], member=getTag, postfix_operators=[], prefix_operators=[], qualifier=env.next.tree, selectors=[], type_arguments=None), label=None) local_variable[type[List], paramtypes] local_variable[type[List], exType] local_variable[type[MethodType], mtype] return[member[.mtype]] end[}] END[}]
identifier[Type] identifier[instantiatePolymorphicSignatureInstance] operator[SEP] identifier[Env] operator[<] identifier[AttrContext] operator[>] identifier[env] , identifier[MethodSymbol] identifier[spMethod] , identifier[Resolve] operator[SEP] identifier[MethodResolutionContext] identifier[resolveContext] , identifier[List] operator[<] identifier[Type] operator[>] identifier[argtypes] operator[SEP] { Keyword[final] identifier[Type] identifier[restype] operator[SEP] Keyword[switch] operator[SEP] identifier[env] operator[SEP] identifier[next] operator[SEP] identifier[tree] operator[SEP] identifier[getTag] operator[SEP] operator[SEP] operator[SEP] { Keyword[case] identifier[TYPECAST] operator[:] identifier[JCTypeCast] identifier[castTree] operator[=] operator[SEP] identifier[JCTypeCast] operator[SEP] identifier[env] operator[SEP] identifier[next] operator[SEP] identifier[tree] operator[SEP] identifier[restype] operator[=] operator[SEP] identifier[TreeInfo] operator[SEP] identifier[skipParens] operator[SEP] identifier[castTree] operator[SEP] identifier[expr] operator[SEP] operator[==] identifier[env] operator[SEP] identifier[tree] operator[SEP] operator[?] identifier[castTree] operator[SEP] identifier[clazz] operator[SEP] identifier[type] operator[:] identifier[syms] operator[SEP] identifier[objectType] operator[SEP] Keyword[break] operator[SEP] Keyword[case] identifier[EXEC] operator[:] identifier[JCTree] operator[SEP] identifier[JCExpressionStatement] identifier[execTree] operator[=] operator[SEP] identifier[JCTree] operator[SEP] identifier[JCExpressionStatement] operator[SEP] identifier[env] operator[SEP] identifier[next] operator[SEP] identifier[tree] operator[SEP] identifier[restype] operator[=] operator[SEP] identifier[TreeInfo] operator[SEP] identifier[skipParens] operator[SEP] identifier[execTree] operator[SEP] identifier[expr] operator[SEP] operator[==] identifier[env] operator[SEP] identifier[tree] operator[SEP] operator[?] identifier[syms] operator[SEP] identifier[voidType] operator[:] identifier[syms] operator[SEP] identifier[objectType] operator[SEP] Keyword[break] operator[SEP] Keyword[default] operator[:] identifier[restype] operator[=] identifier[syms] operator[SEP] identifier[objectType] operator[SEP] } identifier[List] operator[<] identifier[Type] operator[>] identifier[paramtypes] operator[=] identifier[Type] operator[SEP] identifier[map] operator[SEP] identifier[argtypes] , Keyword[new] identifier[ImplicitArgType] operator[SEP] identifier[spMethod] , identifier[resolveContext] operator[SEP] identifier[step] operator[SEP] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[Type] operator[>] identifier[exType] operator[=] identifier[spMethod] operator[!=] Other[null] operator[?] identifier[spMethod] operator[SEP] identifier[getThrownTypes] operator[SEP] operator[SEP] operator[:] identifier[List] operator[SEP] identifier[of] operator[SEP] identifier[syms] operator[SEP] identifier[throwableType] operator[SEP] operator[SEP] identifier[MethodType] identifier[mtype] operator[=] Keyword[new] identifier[MethodType] operator[SEP] identifier[paramtypes] , identifier[restype] , identifier[exType] , identifier[syms] operator[SEP] identifier[methodClass] operator[SEP] operator[SEP] Keyword[return] identifier[mtype] operator[SEP] }
@SafeVarargs public final ServerListenerBuilder addStoppedCallbacks(Consumer<? super Server>... consumers) { return addStoppedCallbacks(Arrays.asList(consumers)); }
class class_name[name] begin[{] method[addStoppedCallbacks, return_type[type[ServerListenerBuilder]], modifier[final public], parameter[consumers]] begin[{] return[call[.addStoppedCallbacks, parameter[call[Arrays.asList, parameter[member[.consumers]]]]]] end[}] END[}]
annotation[@] identifier[SafeVarargs] Keyword[public] Keyword[final] identifier[ServerListenerBuilder] identifier[addStoppedCallbacks] operator[SEP] identifier[Consumer] operator[<] operator[?] Keyword[super] identifier[Server] operator[>] operator[...] identifier[consumers] operator[SEP] { Keyword[return] identifier[addStoppedCallbacks] operator[SEP] identifier[Arrays] operator[SEP] identifier[asList] operator[SEP] identifier[consumers] operator[SEP] operator[SEP] operator[SEP] }
public static SparseBitmap and(SparseBitmap... bitmaps) { if (bitmaps.length == 0) return new SparseBitmap(); else if (bitmaps.length == 1) return bitmaps[0]; else if (bitmaps.length == 2) return bitmaps[0].and(bitmaps[1]); // for "and" a priority queue is not needed, but // overhead ought to be small PriorityQueue<SparseBitmap> pq = new PriorityQueue<SparseBitmap>( bitmaps.length, smallfirst); for (SparseBitmap x : bitmaps) pq.add(x); while (pq.size() > 1) { SparseBitmap x1 = pq.poll(); SparseBitmap x2 = pq.poll(); pq.add(x1.and(x2)); } return pq.poll(); }
class class_name[name] begin[{] method[and, return_type[type[SparseBitmap]], modifier[public static], parameter[bitmaps]] begin[{] if[binary_operation[member[bitmaps.length], ==, literal[0]]] begin[{] return[ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=SparseBitmap, sub_type=None))] else begin[{] if[binary_operation[member[bitmaps.length], ==, literal[1]]] begin[{] return[member[.bitmaps]] else begin[{] if[binary_operation[member[bitmaps.length], ==, literal[2]]] begin[{] return[member[.bitmaps]] else begin[{] None end[}] end[}] end[}] local_variable[type[PriorityQueue], pq] ForStatement(body=StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=x, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=pq, selectors=[], type_arguments=None), label=None), control=EnhancedForControl(iterable=MemberReference(member=bitmaps, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=x)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=SparseBitmap, sub_type=None))), label=None) while[binary_operation[call[pq.size, parameter[]], >, literal[1]]] begin[{] local_variable[type[SparseBitmap], x1] local_variable[type[SparseBitmap], x2] call[pq.add, parameter[call[x1.and, parameter[member[.x2]]]]] end[}] return[call[pq.poll, parameter[]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[SparseBitmap] identifier[and] operator[SEP] identifier[SparseBitmap] operator[...] identifier[bitmaps] operator[SEP] { Keyword[if] operator[SEP] identifier[bitmaps] operator[SEP] identifier[length] operator[==] Other[0] operator[SEP] Keyword[return] Keyword[new] identifier[SparseBitmap] operator[SEP] operator[SEP] operator[SEP] Keyword[else] Keyword[if] operator[SEP] identifier[bitmaps] operator[SEP] identifier[length] operator[==] Other[1] operator[SEP] Keyword[return] identifier[bitmaps] operator[SEP] Other[0] operator[SEP] operator[SEP] Keyword[else] Keyword[if] operator[SEP] identifier[bitmaps] operator[SEP] identifier[length] operator[==] Other[2] operator[SEP] Keyword[return] identifier[bitmaps] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[and] operator[SEP] identifier[bitmaps] operator[SEP] Other[1] operator[SEP] operator[SEP] operator[SEP] identifier[PriorityQueue] operator[<] identifier[SparseBitmap] operator[>] identifier[pq] operator[=] Keyword[new] identifier[PriorityQueue] operator[<] identifier[SparseBitmap] operator[>] operator[SEP] identifier[bitmaps] operator[SEP] identifier[length] , identifier[smallfirst] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[SparseBitmap] identifier[x] operator[:] identifier[bitmaps] operator[SEP] identifier[pq] operator[SEP] identifier[add] operator[SEP] identifier[x] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[pq] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[>] Other[1] operator[SEP] { identifier[SparseBitmap] identifier[x1] operator[=] identifier[pq] operator[SEP] identifier[poll] operator[SEP] operator[SEP] operator[SEP] identifier[SparseBitmap] identifier[x2] operator[=] identifier[pq] operator[SEP] identifier[poll] operator[SEP] operator[SEP] operator[SEP] identifier[pq] operator[SEP] identifier[add] operator[SEP] identifier[x1] operator[SEP] identifier[and] operator[SEP] identifier[x2] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[pq] operator[SEP] identifier[poll] operator[SEP] operator[SEP] operator[SEP] }
public FactoryCache getFactoryCache() { FactoryCache cache = new FactoryCache(); cache.put(JAVAFX_COLLECTIONS_PACKAGE + "ObservableList", fxCollection(List.class, "observableList")); cache.put(JAVAFX_COLLECTIONS_PACKAGE + "ObservableMap", fxCollection(Map.class, "observableMap")); cache.put(JAVAFX_COLLECTIONS_PACKAGE + "ObservableSet", fxCollection(Set.class, "observableSet")); cache.put(JAVAFX_PROPERTY_PACKAGE + "BooleanProperty", fxProperty("SimpleBooleanProperty", boolean.class)); cache.put(JAVAFX_PROPERTY_PACKAGE + "DoubleProperty", fxProperty("SimpleDoubleProperty", double.class)); cache.put(JAVAFX_PROPERTY_PACKAGE + "FloatProperty", fxProperty("SimpleFloatProperty", float.class)); cache.put(JAVAFX_PROPERTY_PACKAGE + "IntegerProperty", fxProperty("SimpleIntegerProperty", int.class)); cache.put(JAVAFX_PROPERTY_PACKAGE + "ListProperty", fxProperty("SimpleListProperty", classForName(JAVAFX_COLLECTIONS_PACKAGE + "ObservableList"))); cache.put(JAVAFX_PROPERTY_PACKAGE + "LongProperty", fxProperty("SimpleLongProperty", long.class)); cache.put(JAVAFX_PROPERTY_PACKAGE + "MapProperty", fxProperty("SimpleMapProperty", classForName(JAVAFX_COLLECTIONS_PACKAGE + "ObservableMap"))); cache.put(JAVAFX_PROPERTY_PACKAGE + "ObjectProperty", fxProperty("SimpleObjectProperty", Object.class)); cache.put(JAVAFX_PROPERTY_PACKAGE + "SetProperty", fxProperty("SimpleSetProperty", classForName(JAVAFX_COLLECTIONS_PACKAGE + "ObservableSet"))); cache.put(JAVAFX_PROPERTY_PACKAGE + "StringProperty", fxProperty("SimpleStringProperty", String.class)); return cache; }
class class_name[name] begin[{] method[getFactoryCache, return_type[type[FactoryCache]], modifier[public], parameter[]] begin[{] local_variable[type[FactoryCache], cache] call[cache.put, parameter[binary_operation[member[.JAVAFX_COLLECTIONS_PACKAGE], +, literal["ObservableList"]], call[.fxCollection, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=List, sub_type=None)), literal["observableList"]]]]] call[cache.put, parameter[binary_operation[member[.JAVAFX_COLLECTIONS_PACKAGE], +, literal["ObservableMap"]], call[.fxCollection, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Map, sub_type=None)), literal["observableMap"]]]]] call[cache.put, parameter[binary_operation[member[.JAVAFX_COLLECTIONS_PACKAGE], +, literal["ObservableSet"]], call[.fxCollection, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Set, sub_type=None)), literal["observableSet"]]]]] call[cache.put, parameter[binary_operation[member[.JAVAFX_PROPERTY_PACKAGE], +, literal["BooleanProperty"]], call[.fxProperty, parameter[literal["SimpleBooleanProperty"], ClassReference(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=[], name=boolean))]]]] call[cache.put, parameter[binary_operation[member[.JAVAFX_PROPERTY_PACKAGE], +, literal["DoubleProperty"]], call[.fxProperty, parameter[literal["SimpleDoubleProperty"], ClassReference(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=[], name=double))]]]] call[cache.put, parameter[binary_operation[member[.JAVAFX_PROPERTY_PACKAGE], +, literal["FloatProperty"]], call[.fxProperty, parameter[literal["SimpleFloatProperty"], ClassReference(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=[], name=float))]]]] call[cache.put, parameter[binary_operation[member[.JAVAFX_PROPERTY_PACKAGE], +, literal["IntegerProperty"]], call[.fxProperty, parameter[literal["SimpleIntegerProperty"], ClassReference(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=[], name=int))]]]] call[cache.put, parameter[binary_operation[member[.JAVAFX_PROPERTY_PACKAGE], +, literal["ListProperty"]], call[.fxProperty, parameter[literal["SimpleListProperty"], call[.classForName, parameter[binary_operation[member[.JAVAFX_COLLECTIONS_PACKAGE], +, literal["ObservableList"]]]]]]]] call[cache.put, parameter[binary_operation[member[.JAVAFX_PROPERTY_PACKAGE], +, literal["LongProperty"]], call[.fxProperty, parameter[literal["SimpleLongProperty"], ClassReference(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=[], name=long))]]]] call[cache.put, parameter[binary_operation[member[.JAVAFX_PROPERTY_PACKAGE], +, literal["MapProperty"]], call[.fxProperty, parameter[literal["SimpleMapProperty"], call[.classForName, parameter[binary_operation[member[.JAVAFX_COLLECTIONS_PACKAGE], +, literal["ObservableMap"]]]]]]]] call[cache.put, parameter[binary_operation[member[.JAVAFX_PROPERTY_PACKAGE], +, literal["ObjectProperty"]], call[.fxProperty, parameter[literal["SimpleObjectProperty"], ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Object, sub_type=None))]]]] call[cache.put, parameter[binary_operation[member[.JAVAFX_PROPERTY_PACKAGE], +, literal["SetProperty"]], call[.fxProperty, parameter[literal["SimpleSetProperty"], call[.classForName, parameter[binary_operation[member[.JAVAFX_COLLECTIONS_PACKAGE], +, literal["ObservableSet"]]]]]]]] call[cache.put, parameter[binary_operation[member[.JAVAFX_PROPERTY_PACKAGE], +, literal["StringProperty"]], call[.fxProperty, parameter[literal["SimpleStringProperty"], ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=String, sub_type=None))]]]] return[member[.cache]] end[}] END[}]
Keyword[public] identifier[FactoryCache] identifier[getFactoryCache] operator[SEP] operator[SEP] { identifier[FactoryCache] identifier[cache] operator[=] Keyword[new] identifier[FactoryCache] operator[SEP] operator[SEP] operator[SEP] identifier[cache] operator[SEP] identifier[put] operator[SEP] identifier[JAVAFX_COLLECTIONS_PACKAGE] operator[+] literal[String] , identifier[fxCollection] operator[SEP] identifier[List] operator[SEP] Keyword[class] , literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[cache] operator[SEP] identifier[put] operator[SEP] identifier[JAVAFX_COLLECTIONS_PACKAGE] operator[+] literal[String] , identifier[fxCollection] operator[SEP] identifier[Map] operator[SEP] Keyword[class] , literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[cache] operator[SEP] identifier[put] operator[SEP] identifier[JAVAFX_COLLECTIONS_PACKAGE] operator[+] literal[String] , identifier[fxCollection] operator[SEP] identifier[Set] operator[SEP] Keyword[class] , literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[cache] operator[SEP] identifier[put] operator[SEP] identifier[JAVAFX_PROPERTY_PACKAGE] operator[+] literal[String] , identifier[fxProperty] operator[SEP] literal[String] , Keyword[boolean] operator[SEP] Keyword[class] operator[SEP] operator[SEP] operator[SEP] identifier[cache] operator[SEP] identifier[put] operator[SEP] identifier[JAVAFX_PROPERTY_PACKAGE] operator[+] literal[String] , identifier[fxProperty] operator[SEP] literal[String] , Keyword[double] operator[SEP] Keyword[class] operator[SEP] operator[SEP] operator[SEP] identifier[cache] operator[SEP] identifier[put] operator[SEP] identifier[JAVAFX_PROPERTY_PACKAGE] operator[+] literal[String] , identifier[fxProperty] operator[SEP] literal[String] , Keyword[float] operator[SEP] Keyword[class] operator[SEP] operator[SEP] operator[SEP] identifier[cache] operator[SEP] identifier[put] operator[SEP] identifier[JAVAFX_PROPERTY_PACKAGE] operator[+] literal[String] , identifier[fxProperty] operator[SEP] literal[String] , Keyword[int] operator[SEP] Keyword[class] operator[SEP] operator[SEP] operator[SEP] identifier[cache] operator[SEP] identifier[put] operator[SEP] identifier[JAVAFX_PROPERTY_PACKAGE] operator[+] literal[String] , identifier[fxProperty] operator[SEP] literal[String] , identifier[classForName] operator[SEP] identifier[JAVAFX_COLLECTIONS_PACKAGE] operator[+] literal[String] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[cache] operator[SEP] identifier[put] operator[SEP] identifier[JAVAFX_PROPERTY_PACKAGE] operator[+] literal[String] , identifier[fxProperty] operator[SEP] literal[String] , Keyword[long] operator[SEP] Keyword[class] operator[SEP] operator[SEP] operator[SEP] identifier[cache] operator[SEP] identifier[put] operator[SEP] identifier[JAVAFX_PROPERTY_PACKAGE] operator[+] literal[String] , identifier[fxProperty] operator[SEP] literal[String] , identifier[classForName] operator[SEP] identifier[JAVAFX_COLLECTIONS_PACKAGE] operator[+] literal[String] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[cache] operator[SEP] identifier[put] operator[SEP] identifier[JAVAFX_PROPERTY_PACKAGE] operator[+] literal[String] , identifier[fxProperty] operator[SEP] literal[String] , identifier[Object] operator[SEP] Keyword[class] operator[SEP] operator[SEP] operator[SEP] identifier[cache] operator[SEP] identifier[put] operator[SEP] identifier[JAVAFX_PROPERTY_PACKAGE] operator[+] literal[String] , identifier[fxProperty] operator[SEP] literal[String] , identifier[classForName] operator[SEP] identifier[JAVAFX_COLLECTIONS_PACKAGE] operator[+] literal[String] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[cache] operator[SEP] identifier[put] operator[SEP] identifier[JAVAFX_PROPERTY_PACKAGE] operator[+] literal[String] , identifier[fxProperty] operator[SEP] literal[String] , identifier[String] operator[SEP] Keyword[class] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[cache] operator[SEP] }
public final Object f(Object... args) { return dfd != null && (cache == CacheType.ALL || cache == CacheType.RESOLVED && dfd.promise().isResolved() || cache == CacheType.REJECTED && dfd.promise().isRejected()) ? dfd.promise() : new PromiseFunction() { public void f(Deferred dfd) { FunctionDeferred.this.resolve = resolve; FunctionDeferred.this.reject = reject; FunctionDeferred.this.dfd = dfd; FunctionDeferred.this.f(dfd); } }; }
class class_name[name] begin[{] method[f, return_type[type[Object]], modifier[final public], parameter[args]] begin[{] return[TernaryExpression(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=dfd, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), operandr=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=cache, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=ALL, postfix_operators=[], prefix_operators=[], qualifier=CacheType, selectors=[]), operator===), operandr=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=cache, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=RESOLVED, postfix_operators=[], prefix_operators=[], qualifier=CacheType, selectors=[]), operator===), operandr=MethodInvocation(arguments=[], member=promise, postfix_operators=[], prefix_operators=[], qualifier=dfd, selectors=[MethodInvocation(arguments=[], member=isResolved, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operator=&&), operator=||), operandr=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=cache, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=REJECTED, postfix_operators=[], prefix_operators=[], qualifier=CacheType, selectors=[]), operator===), operandr=MethodInvocation(arguments=[], member=promise, postfix_operators=[], prefix_operators=[], qualifier=dfd, selectors=[MethodInvocation(arguments=[], member=isRejected, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operator=&&), operator=||), operator=&&), if_false=ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[], body=[StatementExpression(expression=Assignment(expressionl=This(postfix_operators=[], prefix_operators=[], qualifier=FunctionDeferred, selectors=[MemberReference(member=resolve, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), type==, value=MemberReference(member=resolve, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), StatementExpression(expression=Assignment(expressionl=This(postfix_operators=[], prefix_operators=[], qualifier=FunctionDeferred, selectors=[MemberReference(member=reject, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), type==, value=MemberReference(member=reject, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), StatementExpression(expression=Assignment(expressionl=This(postfix_operators=[], prefix_operators=[], qualifier=FunctionDeferred, selectors=[MemberReference(member=dfd, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), type==, value=MemberReference(member=dfd, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), StatementExpression(expression=This(postfix_operators=[], prefix_operators=[], qualifier=FunctionDeferred, selectors=[MethodInvocation(arguments=[MemberReference(member=dfd, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=f, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None)], documentation=None, modifiers={'public'}, name=f, parameters=[FormalParameter(annotations=[], modifiers=set(), name=dfd, type=ReferenceType(arguments=None, dimensions=[], name=Deferred, sub_type=None), varargs=False)], return_type=None, throws=None, type_parameters=None)], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=PromiseFunction, sub_type=None)), if_true=MethodInvocation(arguments=[], member=promise, postfix_operators=[], prefix_operators=[], qualifier=dfd, selectors=[], type_arguments=None))] end[}] END[}]
Keyword[public] Keyword[final] identifier[Object] identifier[f] operator[SEP] identifier[Object] operator[...] identifier[args] operator[SEP] { Keyword[return] identifier[dfd] operator[!=] Other[null] operator[&&] operator[SEP] identifier[cache] operator[==] identifier[CacheType] operator[SEP] identifier[ALL] operator[||] identifier[cache] operator[==] identifier[CacheType] operator[SEP] identifier[RESOLVED] operator[&&] identifier[dfd] operator[SEP] identifier[promise] operator[SEP] operator[SEP] operator[SEP] identifier[isResolved] operator[SEP] operator[SEP] operator[||] identifier[cache] operator[==] identifier[CacheType] operator[SEP] identifier[REJECTED] operator[&&] identifier[dfd] operator[SEP] identifier[promise] operator[SEP] operator[SEP] operator[SEP] identifier[isRejected] operator[SEP] operator[SEP] operator[SEP] operator[?] identifier[dfd] operator[SEP] identifier[promise] operator[SEP] operator[SEP] operator[:] Keyword[new] identifier[PromiseFunction] operator[SEP] operator[SEP] { Keyword[public] Keyword[void] identifier[f] operator[SEP] identifier[Deferred] identifier[dfd] operator[SEP] { identifier[FunctionDeferred] operator[SEP] Keyword[this] operator[SEP] identifier[resolve] operator[=] identifier[resolve] operator[SEP] identifier[FunctionDeferred] operator[SEP] Keyword[this] operator[SEP] identifier[reject] operator[=] identifier[reject] operator[SEP] identifier[FunctionDeferred] operator[SEP] Keyword[this] operator[SEP] identifier[dfd] operator[=] identifier[dfd] operator[SEP] identifier[FunctionDeferred] operator[SEP] Keyword[this] operator[SEP] identifier[f] operator[SEP] identifier[dfd] operator[SEP] operator[SEP] } } operator[SEP] }
public void write(WeightedGraph<? extends WeightedEdge> g, File gexfFile, Indexer<String> vertexLabels) throws IOException { DocumentBuilderFactory dbfac = DocumentBuilderFactory.newInstance(); DocumentBuilder docBuilder = null; try { docBuilder = dbfac.newDocumentBuilder(); } catch (ParserConfigurationException pce) { throw new IOError(new IOException(pce)); } Document doc = docBuilder.newDocument(); Element root = doc.createElement("gexf"); root.setAttribute("xmlns","http://www.gexf.net/1.2draft"); root.setAttribute("xmlns:viz", "http://www.gexf.net/1.2draft/viz"); root.setAttribute("xmlns:xsi", "http://www.w3.org/2001/XMLSchema-instance"); root.setAttribute("version","1.2"); root.setAttribute("xsi:schemaLocation","http://www.gexf.net/1.2draft http://www.gexf.net/1.2draft/gexf.xsd"); doc.appendChild(root); Element graph = doc.createElement("graph"); graph.setAttribute("defaultedgetype","undirected"); root.appendChild(graph); Element nodes = doc.createElement("nodes"); graph.appendChild(nodes); Element edges = doc.createElement("edges"); graph.appendChild(edges); IntIterator vIter = g.vertices().iterator(); while (vIter.hasNext()) { int vertex = vIter.next(); Element node = doc.createElement("node"); String vLabel = (vertexLabels == null) ? String.valueOf(vertex) : vertexLabels.lookup(vertex); if (vLabel == null) vLabel = String.valueOf(vertex); node.setAttribute("id", vLabel); node.setAttribute("label", vLabel); nodes.appendChild(node); } int edgeId = 0; for (WeightedEdge e : g.edges()) { Element edge = doc.createElement("edge"); edges.appendChild(edge); edge.setAttribute("id", "" + (edgeId++)); String sourceLabel = (vertexLabels == null) ? String.valueOf(e.from()) : vertexLabels.lookup(e.from()); if (sourceLabel == null) sourceLabel = String.valueOf(e.from()); String targetLabel = (vertexLabels == null) ? String.valueOf(e.to()) : vertexLabels.lookup(e.to()); if (targetLabel == null) targetLabel = String.valueOf(e.to()); edge.setAttribute("source", sourceLabel); edge.setAttribute("target", targetLabel); edge.setAttribute("weight", String.valueOf(e.weight())); } // Set up a transformer try { TransformerFactory transfac = TransformerFactory.newInstance(); Transformer trans = transfac.newTransformer(); trans.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, "yes"); trans.setOutputProperty(OutputKeys.INDENT, "yes"); trans.setOutputProperty( "{http://xml.apache.org/xslt}indent-amount", "2"); // Create string from xml tree BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream(gexfFile)); StreamResult result = new StreamResult(bos); DOMSource source = new DOMSource(doc); trans.transform(source, result); bos.close(); } catch (TransformerException te) { throw new IOError(new IOException(te)); } }
class class_name[name] begin[{] method[write, return_type[void], modifier[public], parameter[g, gexfFile, vertexLabels]] begin[{] local_variable[type[DocumentBuilderFactory], dbfac] local_variable[type[DocumentBuilder], docBuilder] TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=docBuilder, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=newDocumentBuilder, postfix_operators=[], prefix_operators=[], qualifier=dbfac, selectors=[], type_arguments=None)), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[ClassCreator(arguments=[MemberReference(member=pce, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IOException, sub_type=None))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IOError, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=pce, types=['ParserConfigurationException']))], finally_block=None, label=None, resources=None) local_variable[type[Document], doc] local_variable[type[Element], root] call[root.setAttribute, parameter[literal["xmlns"], literal["http://www.gexf.net/1.2draft"]]] call[root.setAttribute, parameter[literal["xmlns:viz"], literal["http://www.gexf.net/1.2draft/viz"]]] call[root.setAttribute, parameter[literal["xmlns:xsi"], literal["http://www.w3.org/2001/XMLSchema-instance"]]] call[root.setAttribute, parameter[literal["version"], literal["1.2"]]] call[root.setAttribute, parameter[literal["xsi:schemaLocation"], literal["http://www.gexf.net/1.2draft http://www.gexf.net/1.2draft/gexf.xsd"]]] call[doc.appendChild, parameter[member[.root]]] local_variable[type[Element], graph] call[graph.setAttribute, parameter[literal["defaultedgetype"], literal["undirected"]]] call[root.appendChild, parameter[member[.graph]]] local_variable[type[Element], nodes] call[graph.appendChild, parameter[member[.nodes]]] local_variable[type[Element], edges] call[graph.appendChild, parameter[member[.edges]]] local_variable[type[IntIterator], vIter] while[call[vIter.hasNext, parameter[]]] begin[{] local_variable[type[int], vertex] local_variable[type[Element], node] local_variable[type[String], vLabel] if[binary_operation[member[.vLabel], ==, literal[null]]] begin[{] assign[member[.vLabel], call[String.valueOf, parameter[member[.vertex]]]] else begin[{] None end[}] call[node.setAttribute, parameter[literal["id"], member[.vLabel]]] call[node.setAttribute, parameter[literal["label"], member[.vLabel]]] call[nodes.appendChild, parameter[member[.node]]] end[}] local_variable[type[int], edgeId] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="edge")], member=createElement, postfix_operators=[], prefix_operators=[], qualifier=doc, selectors=[], type_arguments=None), name=edge)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Element, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=edge, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=appendChild, postfix_operators=[], prefix_operators=[], qualifier=edges, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="id"), BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=""), operandr=MemberReference(member=edgeId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], member=setAttribute, postfix_operators=[], prefix_operators=[], qualifier=edge, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=vertexLabels, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), if_false=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=from, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None)], member=lookup, postfix_operators=[], prefix_operators=[], qualifier=vertexLabels, selectors=[], type_arguments=None), if_true=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=from, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None)], member=valueOf, postfix_operators=[], prefix_operators=[], qualifier=String, selectors=[], type_arguments=None)), name=sourceLabel)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=sourceLabel, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), else_statement=None, label=None, then_statement=StatementExpression(expression=Assignment(expressionl=MemberReference(member=sourceLabel, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=from, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None)], member=valueOf, postfix_operators=[], prefix_operators=[], qualifier=String, selectors=[], type_arguments=None)), label=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=vertexLabels, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), if_false=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=to, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None)], member=lookup, postfix_operators=[], prefix_operators=[], qualifier=vertexLabels, selectors=[], type_arguments=None), if_true=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=to, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None)], member=valueOf, postfix_operators=[], prefix_operators=[], qualifier=String, selectors=[], type_arguments=None)), name=targetLabel)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=targetLabel, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), else_statement=None, label=None, then_statement=StatementExpression(expression=Assignment(expressionl=MemberReference(member=targetLabel, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=to, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None)], member=valueOf, postfix_operators=[], prefix_operators=[], qualifier=String, selectors=[], type_arguments=None)), label=None)), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="source"), MemberReference(member=sourceLabel, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setAttribute, postfix_operators=[], prefix_operators=[], qualifier=edge, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="target"), MemberReference(member=targetLabel, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setAttribute, postfix_operators=[], prefix_operators=[], qualifier=edge, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="weight"), MethodInvocation(arguments=[MethodInvocation(arguments=[], member=weight, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None)], member=valueOf, postfix_operators=[], prefix_operators=[], qualifier=String, selectors=[], type_arguments=None)], member=setAttribute, postfix_operators=[], prefix_operators=[], qualifier=edge, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=edges, postfix_operators=[], prefix_operators=[], qualifier=g, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=e)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=WeightedEdge, sub_type=None))), label=None) TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=newInstance, postfix_operators=[], prefix_operators=[], qualifier=TransformerFactory, selectors=[], type_arguments=None), name=transfac)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=TransformerFactory, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=newTransformer, postfix_operators=[], prefix_operators=[], qualifier=transfac, selectors=[], type_arguments=None), name=trans)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Transformer, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=OMIT_XML_DECLARATION, postfix_operators=[], prefix_operators=[], qualifier=OutputKeys, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="yes")], member=setOutputProperty, postfix_operators=[], prefix_operators=[], qualifier=trans, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=INDENT, postfix_operators=[], prefix_operators=[], qualifier=OutputKeys, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="yes")], member=setOutputProperty, postfix_operators=[], prefix_operators=[], qualifier=trans, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="{http://xml.apache.org/xslt}indent-amount"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="2")], member=setOutputProperty, postfix_operators=[], prefix_operators=[], qualifier=trans, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[ClassCreator(arguments=[MemberReference(member=gexfFile, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=FileOutputStream, sub_type=None))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=BufferedOutputStream, sub_type=None)), name=bos)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=BufferedOutputStream, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MemberReference(member=bos, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=StreamResult, sub_type=None)), name=result)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=StreamResult, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MemberReference(member=doc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=DOMSource, sub_type=None)), name=source)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=DOMSource, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=source, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=result, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=transform, postfix_operators=[], prefix_operators=[], qualifier=trans, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=close, postfix_operators=[], prefix_operators=[], qualifier=bos, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[ClassCreator(arguments=[MemberReference(member=te, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IOException, sub_type=None))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IOError, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=te, types=['TransformerException']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[public] Keyword[void] identifier[write] operator[SEP] identifier[WeightedGraph] operator[<] operator[?] Keyword[extends] identifier[WeightedEdge] operator[>] identifier[g] , identifier[File] identifier[gexfFile] , identifier[Indexer] operator[<] identifier[String] operator[>] identifier[vertexLabels] operator[SEP] Keyword[throws] identifier[IOException] { identifier[DocumentBuilderFactory] identifier[dbfac] operator[=] identifier[DocumentBuilderFactory] operator[SEP] identifier[newInstance] operator[SEP] operator[SEP] operator[SEP] identifier[DocumentBuilder] identifier[docBuilder] operator[=] Other[null] operator[SEP] Keyword[try] { identifier[docBuilder] operator[=] identifier[dbfac] operator[SEP] identifier[newDocumentBuilder] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[ParserConfigurationException] identifier[pce] operator[SEP] { Keyword[throw] Keyword[new] identifier[IOError] operator[SEP] Keyword[new] identifier[IOException] operator[SEP] identifier[pce] operator[SEP] operator[SEP] operator[SEP] } identifier[Document] identifier[doc] operator[=] identifier[docBuilder] operator[SEP] identifier[newDocument] operator[SEP] operator[SEP] operator[SEP] identifier[Element] identifier[root] operator[=] identifier[doc] operator[SEP] identifier[createElement] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[root] operator[SEP] identifier[setAttribute] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] identifier[root] operator[SEP] identifier[setAttribute] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] identifier[root] operator[SEP] identifier[setAttribute] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] identifier[root] operator[SEP] identifier[setAttribute] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] identifier[root] operator[SEP] identifier[setAttribute] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] identifier[doc] operator[SEP] identifier[appendChild] operator[SEP] identifier[root] operator[SEP] operator[SEP] identifier[Element] identifier[graph] operator[=] identifier[doc] operator[SEP] identifier[createElement] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[graph] operator[SEP] identifier[setAttribute] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] identifier[root] operator[SEP] identifier[appendChild] operator[SEP] identifier[graph] operator[SEP] operator[SEP] identifier[Element] identifier[nodes] operator[=] identifier[doc] operator[SEP] identifier[createElement] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[graph] operator[SEP] identifier[appendChild] operator[SEP] identifier[nodes] operator[SEP] operator[SEP] identifier[Element] identifier[edges] operator[=] identifier[doc] operator[SEP] identifier[createElement] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[graph] operator[SEP] identifier[appendChild] operator[SEP] identifier[edges] operator[SEP] operator[SEP] identifier[IntIterator] identifier[vIter] operator[=] identifier[g] operator[SEP] identifier[vertices] operator[SEP] operator[SEP] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[vIter] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] { Keyword[int] identifier[vertex] operator[=] identifier[vIter] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] identifier[Element] identifier[node] operator[=] identifier[doc] operator[SEP] identifier[createElement] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[String] identifier[vLabel] operator[=] operator[SEP] identifier[vertexLabels] operator[==] Other[null] operator[SEP] operator[?] identifier[String] operator[SEP] identifier[valueOf] operator[SEP] identifier[vertex] operator[SEP] operator[:] identifier[vertexLabels] operator[SEP] identifier[lookup] operator[SEP] identifier[vertex] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[vLabel] operator[==] Other[null] operator[SEP] identifier[vLabel] operator[=] identifier[String] operator[SEP] identifier[valueOf] operator[SEP] identifier[vertex] operator[SEP] operator[SEP] identifier[node] operator[SEP] identifier[setAttribute] operator[SEP] literal[String] , identifier[vLabel] operator[SEP] operator[SEP] identifier[node] operator[SEP] identifier[setAttribute] operator[SEP] literal[String] , identifier[vLabel] operator[SEP] operator[SEP] identifier[nodes] operator[SEP] identifier[appendChild] operator[SEP] identifier[node] operator[SEP] operator[SEP] } Keyword[int] identifier[edgeId] operator[=] Other[0] operator[SEP] Keyword[for] operator[SEP] identifier[WeightedEdge] identifier[e] operator[:] identifier[g] operator[SEP] identifier[edges] operator[SEP] operator[SEP] operator[SEP] { identifier[Element] identifier[edge] operator[=] identifier[doc] operator[SEP] identifier[createElement] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[edges] operator[SEP] identifier[appendChild] operator[SEP] identifier[edge] operator[SEP] operator[SEP] identifier[edge] operator[SEP] identifier[setAttribute] operator[SEP] literal[String] , literal[String] operator[+] operator[SEP] identifier[edgeId] operator[++] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[sourceLabel] operator[=] operator[SEP] identifier[vertexLabels] operator[==] Other[null] operator[SEP] operator[?] identifier[String] operator[SEP] identifier[valueOf] operator[SEP] identifier[e] operator[SEP] identifier[from] operator[SEP] operator[SEP] operator[SEP] operator[:] identifier[vertexLabels] operator[SEP] identifier[lookup] operator[SEP] identifier[e] operator[SEP] identifier[from] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[sourceLabel] operator[==] Other[null] operator[SEP] identifier[sourceLabel] operator[=] identifier[String] operator[SEP] identifier[valueOf] operator[SEP] identifier[e] operator[SEP] identifier[from] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[targetLabel] operator[=] operator[SEP] identifier[vertexLabels] operator[==] Other[null] operator[SEP] operator[?] identifier[String] operator[SEP] identifier[valueOf] operator[SEP] identifier[e] operator[SEP] identifier[to] operator[SEP] operator[SEP] operator[SEP] operator[:] identifier[vertexLabels] operator[SEP] identifier[lookup] operator[SEP] identifier[e] operator[SEP] identifier[to] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[targetLabel] operator[==] Other[null] operator[SEP] identifier[targetLabel] operator[=] identifier[String] operator[SEP] identifier[valueOf] operator[SEP] identifier[e] operator[SEP] identifier[to] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[edge] operator[SEP] identifier[setAttribute] operator[SEP] literal[String] , identifier[sourceLabel] operator[SEP] operator[SEP] identifier[edge] operator[SEP] identifier[setAttribute] operator[SEP] literal[String] , identifier[targetLabel] operator[SEP] operator[SEP] identifier[edge] operator[SEP] identifier[setAttribute] operator[SEP] literal[String] , identifier[String] operator[SEP] identifier[valueOf] operator[SEP] identifier[e] operator[SEP] identifier[weight] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[try] { identifier[TransformerFactory] identifier[transfac] operator[=] identifier[TransformerFactory] operator[SEP] identifier[newInstance] operator[SEP] operator[SEP] operator[SEP] identifier[Transformer] identifier[trans] operator[=] identifier[transfac] operator[SEP] identifier[newTransformer] operator[SEP] operator[SEP] operator[SEP] identifier[trans] operator[SEP] identifier[setOutputProperty] operator[SEP] identifier[OutputKeys] operator[SEP] identifier[OMIT_XML_DECLARATION] , literal[String] operator[SEP] operator[SEP] identifier[trans] operator[SEP] identifier[setOutputProperty] operator[SEP] identifier[OutputKeys] operator[SEP] identifier[INDENT] , literal[String] operator[SEP] operator[SEP] identifier[trans] operator[SEP] identifier[setOutputProperty] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] identifier[BufferedOutputStream] identifier[bos] operator[=] Keyword[new] identifier[BufferedOutputStream] operator[SEP] Keyword[new] identifier[FileOutputStream] operator[SEP] identifier[gexfFile] operator[SEP] operator[SEP] operator[SEP] identifier[StreamResult] identifier[result] operator[=] Keyword[new] identifier[StreamResult] operator[SEP] identifier[bos] operator[SEP] operator[SEP] identifier[DOMSource] identifier[source] operator[=] Keyword[new] identifier[DOMSource] operator[SEP] identifier[doc] operator[SEP] operator[SEP] identifier[trans] operator[SEP] identifier[transform] operator[SEP] identifier[source] , identifier[result] operator[SEP] operator[SEP] identifier[bos] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[TransformerException] identifier[te] operator[SEP] { Keyword[throw] Keyword[new] identifier[IOError] operator[SEP] Keyword[new] identifier[IOException] operator[SEP] identifier[te] operator[SEP] operator[SEP] operator[SEP] } }
@PUT @Path("/{pushAppID}/reset") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) public Response resetMasterSecret(@PathParam("pushAppID") String pushApplicationID) { //PushApplication pushApp = pushAppService.findByPushApplicationIDForDeveloper(pushApplicationID, extractUsername(request)); PushApplication pushApp = getSearch().findByPushApplicationIDForDeveloper(pushApplicationID); if (pushApp != null) { // generate the new 'masterSecret' and apply it: String newMasterSecret = UUID.randomUUID().toString(); pushApp.setMasterSecret(newMasterSecret); logger.info("Invoke service to change master secret of a push application '{}'", pushApp.getPushApplicationID()); pushAppService.updatePushApplication(pushApp); return Response.ok(pushApp).build(); } return Response.status(Status.NOT_FOUND).entity("Could not find requested PushApplicationEntity").build(); }
class class_name[name] begin[{] method[resetMasterSecret, return_type[type[Response]], modifier[public], parameter[pushApplicationID]] begin[{] local_variable[type[PushApplication], pushApp] if[binary_operation[member[.pushApp], !=, literal[null]]] begin[{] local_variable[type[String], newMasterSecret] call[pushApp.setMasterSecret, parameter[member[.newMasterSecret]]] call[logger.info, parameter[literal["Invoke service to change master secret of a push application '{}'"], call[pushApp.getPushApplicationID, parameter[]]]] call[pushAppService.updatePushApplication, parameter[member[.pushApp]]] return[call[Response.ok, parameter[member[.pushApp]]]] else begin[{] None end[}] return[call[Response.status, parameter[member[Status.NOT_FOUND]]]] end[}] END[}]
annotation[@] identifier[PUT] annotation[@] identifier[Path] operator[SEP] literal[String] operator[SEP] annotation[@] identifier[Consumes] operator[SEP] identifier[MediaType] operator[SEP] identifier[APPLICATION_JSON] operator[SEP] annotation[@] identifier[Produces] operator[SEP] identifier[MediaType] operator[SEP] identifier[APPLICATION_JSON] operator[SEP] Keyword[public] identifier[Response] identifier[resetMasterSecret] operator[SEP] annotation[@] identifier[PathParam] operator[SEP] literal[String] operator[SEP] identifier[String] identifier[pushApplicationID] operator[SEP] { identifier[PushApplication] identifier[pushApp] operator[=] identifier[getSearch] operator[SEP] operator[SEP] operator[SEP] identifier[findByPushApplicationIDForDeveloper] operator[SEP] identifier[pushApplicationID] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[pushApp] operator[!=] Other[null] operator[SEP] { identifier[String] identifier[newMasterSecret] operator[=] identifier[UUID] operator[SEP] identifier[randomUUID] operator[SEP] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] identifier[pushApp] operator[SEP] identifier[setMasterSecret] operator[SEP] identifier[newMasterSecret] operator[SEP] operator[SEP] identifier[logger] operator[SEP] identifier[info] operator[SEP] literal[String] , identifier[pushApp] operator[SEP] identifier[getPushApplicationID] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[pushAppService] operator[SEP] identifier[updatePushApplication] operator[SEP] identifier[pushApp] operator[SEP] operator[SEP] Keyword[return] identifier[Response] operator[SEP] identifier[ok] operator[SEP] identifier[pushApp] operator[SEP] operator[SEP] identifier[build] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[Response] operator[SEP] identifier[status] operator[SEP] identifier[Status] operator[SEP] identifier[NOT_FOUND] operator[SEP] operator[SEP] identifier[entity] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[build] operator[SEP] operator[SEP] operator[SEP] }
public static Builder addToSet(String field, Object value) { return new Builder().addToSet(field, value); }
class class_name[name] begin[{] method[addToSet, return_type[type[Builder]], modifier[public static], parameter[field, value]] begin[{] return[ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MemberReference(member=field, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addToSet, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=Builder, sub_type=None))] end[}] END[}]
Keyword[public] Keyword[static] identifier[Builder] identifier[addToSet] operator[SEP] identifier[String] identifier[field] , identifier[Object] identifier[value] operator[SEP] { Keyword[return] Keyword[new] identifier[Builder] operator[SEP] operator[SEP] operator[SEP] identifier[addToSet] operator[SEP] identifier[field] , identifier[value] operator[SEP] operator[SEP] }
@Override public long getLastKnownTick() { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) { SibTr.entry(this, tc, "getLastKnownTick"); SibTr.exit(tc, "getLastKnownTick", Long.valueOf(unknownHorizon)); } return unknownHorizon; }
class class_name[name] begin[{] method[getLastKnownTick, return_type[type[long]], modifier[public], parameter[]] begin[{] if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{] call[SibTr.entry, parameter[THIS[], member[.tc], literal["getLastKnownTick"]]] call[SibTr.exit, parameter[member[.tc], literal["getLastKnownTick"], call[Long.valueOf, parameter[member[.unknownHorizon]]]]] else begin[{] None end[}] return[member[.unknownHorizon]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[long] identifier[getLastKnownTick] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] { identifier[SibTr] operator[SEP] identifier[entry] operator[SEP] Keyword[this] , identifier[tc] , literal[String] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[exit] operator[SEP] identifier[tc] , literal[String] , identifier[Long] operator[SEP] identifier[valueOf] operator[SEP] identifier[unknownHorizon] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[unknownHorizon] operator[SEP] }
@XmlElementDecl(namespace = "http://www.w3.org/1998/Math/MathML", name = "arccoth") public JAXBElement<ElementaryFunctionsType> createArccoth(ElementaryFunctionsType value) { return new JAXBElement<ElementaryFunctionsType>(_Arccoth_QNAME, ElementaryFunctionsType.class, null, value); }
class class_name[name] begin[{] method[createArccoth, return_type[type[JAXBElement]], modifier[public], parameter[value]] begin[{] return[ClassCreator(arguments=[MemberReference(member=_Arccoth_QNAME, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ElementaryFunctionsType, sub_type=None)), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=ElementaryFunctionsType, sub_type=None))], dimensions=None, name=JAXBElement, sub_type=None))] end[}] END[}]
annotation[@] identifier[XmlElementDecl] operator[SEP] identifier[namespace] operator[=] literal[String] , identifier[name] operator[=] literal[String] operator[SEP] Keyword[public] identifier[JAXBElement] operator[<] identifier[ElementaryFunctionsType] operator[>] identifier[createArccoth] operator[SEP] identifier[ElementaryFunctionsType] identifier[value] operator[SEP] { Keyword[return] Keyword[new] identifier[JAXBElement] operator[<] identifier[ElementaryFunctionsType] operator[>] operator[SEP] identifier[_Arccoth_QNAME] , identifier[ElementaryFunctionsType] operator[SEP] Keyword[class] , Other[null] , identifier[value] operator[SEP] operator[SEP] }
private static JQL buildJQLSelect(final SQLiteModelMethod method, final JQL result, final Map<JQLDynamicStatementType, String> dynamicReplace, String preparedJql) { final Class<? extends Annotation> annotation = BindSqlSelect.class; final SQLiteDaoDefinition dao = method.getParent(); if (StringUtils.hasText(preparedJql)) { result.value = preparedJql; // In SELECT SQL only where statement can contains bind parameter JQLChecker.getInstance().analyze(method, result, new JqlBaseListener() { @Override public void enterBind_dynamic_sql(Bind_dynamic_sqlContext ctx) { JQLDynamicStatementType dynamicType = JQLDynamicStatementType.valueOf(ctx.bind_parameter_name().getText().toUpperCase()); int start = ctx.getStart().getStartIndex() - 1; int stop = ctx.getStop().getStopIndex() + 1; String dynamicWhere = result.value.substring(start, stop); dynamicReplace.put(dynamicType, dynamicWhere); } }); JQLChecker.getInstance().replaceVariableStatements(method, preparedJql, new JQLReplaceVariableStatementListenerImpl() { @Override public String onWhere(String statement) { result.annotatedWhere = true; result.staticWhereConditions = true; return null; } @Override public String onOrderBy(String statement) { result.annotatedOrderBy = true; result.staticOrderBy = true; return null; } @Override public String onOffset(String statement) { result.annotatedOffset = true; return null; } @Override public String onLimit(String statement) { result.annotatedLimit = true; return null; } @Override public String onHaving(String statement) { result.annotatedHaving = true; return null; } @Override public String onGroup(String statement) { result.annotatedGroupBy = true; return null; } }); forEachParameter(method, new OnMethodParameterListener() { @Override public void onMethodParameter(VariableElement methodParam) { if (methodParam.getAnnotation(BindSqlDynamicOrderBy.class) != null) { String orderDynamicName = methodParam.getSimpleName().toString(); result.paramOrderBy = orderDynamicName; // CONSTRAINT: @BindSqlOrderBy can be used only on // String // parameter type AssertKripton.assertTrueOrInvalidTypeForAnnotationMethodParameterException(TypeUtility.isEquals(TypeUtility.typeName(String.class), TypeUtility.typeName(methodParam)), method.getParent().getElement(), method.getElement(), methodParam, BindSqlDynamicOrderBy.class); } } }); } else { // extract some informaction from method and bean // use annotation's attribute value and exclude and bean definition // to // define field list final Set<String> fields = extractFieldsFromAnnotation(method, BindSqlSelect.class, true); boolean distinct = AnnotationUtility.extractAsBoolean(method.getElement(), annotation, AnnotationAttributeType.DISTINCT); String annotatedGroupBy = AnnotationUtility.extractAsString(method.getElement(), annotation, AnnotationAttributeType.GROUP_BY); String annotatedHaving = AnnotationUtility.extractAsString(method.getElement(), annotation, AnnotationAttributeType.HAVING); StringBuilder builder = new StringBuilder(); builder.append(SELECT_KEYWORD + " "); // if (distinct) { builder.append(DISTINCT_KEYWORD + " "); } // recreate fields builder.append(forEachFields(fields, new OnFieldListener() { @Override public String onField(String item) { return item; } })); // entity name builder.append(" " + FROM_KEYWORD + " " + dao.getEntitySimplyClassName()); // where builder.append(defineWhereStatement(method, result, annotation, dynamicReplace)); // group by if (StringUtils.hasText(annotatedGroupBy)) { result.annotatedGroupBy = true; builder.append(" " + GROUP_BY_KEYWORD + " " + annotatedGroupBy); } // having if (StringUtils.hasText(annotatedHaving)) { result.annotatedHaving = true; builder.append(" " + HAVING_KEYWORD + " " + annotatedHaving); } // order by builder.append(defineOrderByStatement(method, result, annotation, dynamicReplace)); // limit builder.append(defineLimitStatement(method, result, annotation, dynamicReplace)); result.value = builder.toString(); } result.value = JQLChecker.getInstance().replace(method, result.value, new JQLReplacerListenerImpl(method, true) { @Override public String onBindParameter(String bindParameterName, boolean inStatement) { if (inStatement) { TypeName typeName = method.findParameterType(method.findParameterNameByAlias(bindParameterName)); AssertKripton.assertTrueOrInvalidMethodSignException(typeName != null && (TypeUtility.isArray(typeName) || TypeUtility.isCollection(typeName)), method, "'in' condition need an array or collection parameter"); String dynamicSpread = bindParameterName; dynamicReplace.put(JQLDynamicStatementType.DYNAMIC_SPREAD, dynamicSpread); result.spreadParams.add(dynamicSpread); // return // "#{"+JQLDynamicStatementType.DYNAMIC_SPREAD+"}"; return null; } return null; } }); if (method.isPagedLiveData()) { // if is a paged live data, it must have pagination dynamicReplace.put(JQLDynamicStatementType.DYNAMIC_PAGE_OFFSET, ""); dynamicReplace.put(JQLDynamicStatementType.DYNAMIC_PAGE_SIZE, ""); } result.operationType = JQLType.SELECT; result.dynamicReplace = dynamicReplace; return result; }
class class_name[name] begin[{] method[buildJQLSelect, return_type[type[JQL]], modifier[private static], parameter[method, result, dynamicReplace, preparedJql]] begin[{] local_variable[type[Class], annotation] local_variable[type[SQLiteDaoDefinition], dao] if[call[StringUtils.hasText, parameter[member[.preparedJql]]]] begin[{] assign[member[result.value], member[.preparedJql]] call[JQLChecker.getInstance, parameter[]] call[JQLChecker.getInstance, parameter[]] call[.forEachParameter, parameter[member[.method], ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=BindSqlDynamicOrderBy, sub_type=None))], member=getAnnotation, postfix_operators=[], prefix_operators=[], qualifier=methodParam, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getSimpleName, postfix_operators=[], prefix_operators=[], qualifier=methodParam, selectors=[MethodInvocation(arguments=[], member=toString, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=orderDynamicName)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=paramOrderBy, postfix_operators=[], prefix_operators=[], qualifier=result, selectors=[]), type==, value=MemberReference(member=orderDynamicName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MethodInvocation(arguments=[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=String, sub_type=None))], member=typeName, postfix_operators=[], prefix_operators=[], qualifier=TypeUtility, selectors=[], type_arguments=None), MethodInvocation(arguments=[MemberReference(member=methodParam, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=typeName, postfix_operators=[], prefix_operators=[], qualifier=TypeUtility, selectors=[], type_arguments=None)], member=isEquals, postfix_operators=[], prefix_operators=[], qualifier=TypeUtility, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getParent, postfix_operators=[], prefix_operators=[], qualifier=method, selectors=[MethodInvocation(arguments=[], member=getElement, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), MethodInvocation(arguments=[], member=getElement, postfix_operators=[], prefix_operators=[], qualifier=method, selectors=[], type_arguments=None), MemberReference(member=methodParam, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=BindSqlDynamicOrderBy, sub_type=None))], member=assertTrueOrInvalidTypeForAnnotationMethodParameterException, postfix_operators=[], prefix_operators=[], qualifier=AssertKripton, selectors=[], type_arguments=None), label=None)]))], documentation=None, modifiers={'public'}, name=onMethodParameter, parameters=[FormalParameter(annotations=[], modifiers=set(), name=methodParam, type=ReferenceType(arguments=None, dimensions=[], name=VariableElement, sub_type=None), varargs=False)], return_type=None, throws=None, type_parameters=None)], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=OnMethodParameterListener, sub_type=None))]] else begin[{] local_variable[type[Set], fields] local_variable[type[boolean], distinct] local_variable[type[String], annotatedGroupBy] local_variable[type[String], annotatedHaving] local_variable[type[StringBuilder], builder] call[builder.append, parameter[binary_operation[member[.SELECT_KEYWORD], +, literal[" "]]]] if[member[.distinct]] begin[{] call[builder.append, parameter[binary_operation[member[.DISTINCT_KEYWORD], +, literal[" "]]]] else begin[{] None end[}] call[builder.append, parameter[call[.forEachFields, parameter[member[.fields], ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[ReturnStatement(expression=MemberReference(member=item, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], documentation=None, modifiers={'public'}, name=onField, parameters=[FormalParameter(annotations=[], modifiers=set(), name=item, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None), varargs=False)], return_type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None), throws=None, type_parameters=None)], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=OnFieldListener, sub_type=None))]]]] call[builder.append, parameter[binary_operation[binary_operation[binary_operation[literal[" "], +, member[.FROM_KEYWORD]], +, literal[" "]], +, call[dao.getEntitySimplyClassName, parameter[]]]]] call[builder.append, parameter[call[.defineWhereStatement, parameter[member[.method], member[.result], member[.annotation], member[.dynamicReplace]]]]] if[call[StringUtils.hasText, parameter[member[.annotatedGroupBy]]]] begin[{] assign[member[result.annotatedGroupBy], literal[true]] call[builder.append, parameter[binary_operation[binary_operation[binary_operation[literal[" "], +, member[.GROUP_BY_KEYWORD]], +, literal[" "]], +, member[.annotatedGroupBy]]]] else begin[{] None end[}] if[call[StringUtils.hasText, parameter[member[.annotatedHaving]]]] begin[{] assign[member[result.annotatedHaving], literal[true]] call[builder.append, parameter[binary_operation[binary_operation[binary_operation[literal[" "], +, member[.HAVING_KEYWORD]], +, literal[" "]], +, member[.annotatedHaving]]]] else begin[{] None end[}] call[builder.append, parameter[call[.defineOrderByStatement, parameter[member[.method], member[.result], member[.annotation], member[.dynamicReplace]]]]] call[builder.append, parameter[call[.defineLimitStatement, parameter[member[.method], member[.result], member[.annotation], member[.dynamicReplace]]]]] assign[member[result.value], call[builder.toString, parameter[]]] end[}] assign[member[result.value], call[JQLChecker.getInstance, parameter[]]] if[call[method.isPagedLiveData, parameter[]]] begin[{] call[dynamicReplace.put, parameter[member[JQLDynamicStatementType.DYNAMIC_PAGE_OFFSET], literal[""]]] call[dynamicReplace.put, parameter[member[JQLDynamicStatementType.DYNAMIC_PAGE_SIZE], literal[""]]] else begin[{] None end[}] assign[member[result.operationType], member[JQLType.SELECT]] assign[member[result.dynamicReplace], member[.dynamicReplace]] return[member[.result]] end[}] END[}]
Keyword[private] Keyword[static] identifier[JQL] identifier[buildJQLSelect] operator[SEP] Keyword[final] identifier[SQLiteModelMethod] identifier[method] , Keyword[final] identifier[JQL] identifier[result] , Keyword[final] identifier[Map] operator[<] identifier[JQLDynamicStatementType] , identifier[String] operator[>] identifier[dynamicReplace] , identifier[String] identifier[preparedJql] operator[SEP] { Keyword[final] identifier[Class] operator[<] operator[?] Keyword[extends] identifier[Annotation] operator[>] identifier[annotation] operator[=] identifier[BindSqlSelect] operator[SEP] Keyword[class] operator[SEP] Keyword[final] identifier[SQLiteDaoDefinition] identifier[dao] operator[=] identifier[method] operator[SEP] identifier[getParent] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[StringUtils] operator[SEP] identifier[hasText] operator[SEP] identifier[preparedJql] operator[SEP] operator[SEP] { identifier[result] operator[SEP] identifier[value] operator[=] identifier[preparedJql] operator[SEP] identifier[JQLChecker] operator[SEP] identifier[getInstance] operator[SEP] operator[SEP] operator[SEP] identifier[analyze] operator[SEP] identifier[method] , identifier[result] , Keyword[new] identifier[JqlBaseListener] operator[SEP] operator[SEP] { annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[enterBind_dynamic_sql] operator[SEP] identifier[Bind_dynamic_sqlContext] identifier[ctx] operator[SEP] { identifier[JQLDynamicStatementType] identifier[dynamicType] operator[=] identifier[JQLDynamicStatementType] operator[SEP] identifier[valueOf] operator[SEP] identifier[ctx] operator[SEP] identifier[bind_parameter_name] operator[SEP] operator[SEP] operator[SEP] identifier[getText] operator[SEP] operator[SEP] operator[SEP] identifier[toUpperCase] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[start] operator[=] identifier[ctx] operator[SEP] identifier[getStart] operator[SEP] operator[SEP] operator[SEP] identifier[getStartIndex] operator[SEP] operator[SEP] operator[-] Other[1] operator[SEP] Keyword[int] identifier[stop] operator[=] identifier[ctx] operator[SEP] identifier[getStop] operator[SEP] operator[SEP] operator[SEP] identifier[getStopIndex] operator[SEP] operator[SEP] operator[+] Other[1] operator[SEP] identifier[String] identifier[dynamicWhere] operator[=] identifier[result] operator[SEP] identifier[value] operator[SEP] identifier[substring] operator[SEP] identifier[start] , identifier[stop] operator[SEP] operator[SEP] identifier[dynamicReplace] operator[SEP] identifier[put] operator[SEP] identifier[dynamicType] , identifier[dynamicWhere] operator[SEP] operator[SEP] } } operator[SEP] operator[SEP] identifier[JQLChecker] operator[SEP] identifier[getInstance] operator[SEP] operator[SEP] operator[SEP] identifier[replaceVariableStatements] operator[SEP] identifier[method] , identifier[preparedJql] , Keyword[new] identifier[JQLReplaceVariableStatementListenerImpl] operator[SEP] operator[SEP] { annotation[@] identifier[Override] Keyword[public] identifier[String] identifier[onWhere] operator[SEP] identifier[String] identifier[statement] operator[SEP] { identifier[result] operator[SEP] identifier[annotatedWhere] operator[=] literal[boolean] operator[SEP] identifier[result] operator[SEP] identifier[staticWhereConditions] operator[=] literal[boolean] operator[SEP] Keyword[return] Other[null] operator[SEP] } annotation[@] identifier[Override] Keyword[public] identifier[String] identifier[onOrderBy] operator[SEP] identifier[String] identifier[statement] operator[SEP] { identifier[result] operator[SEP] identifier[annotatedOrderBy] operator[=] literal[boolean] operator[SEP] identifier[result] operator[SEP] identifier[staticOrderBy] operator[=] literal[boolean] operator[SEP] Keyword[return] Other[null] operator[SEP] } annotation[@] identifier[Override] Keyword[public] identifier[String] identifier[onOffset] operator[SEP] identifier[String] identifier[statement] operator[SEP] { identifier[result] operator[SEP] identifier[annotatedOffset] operator[=] literal[boolean] operator[SEP] Keyword[return] Other[null] operator[SEP] } annotation[@] identifier[Override] Keyword[public] identifier[String] identifier[onLimit] operator[SEP] identifier[String] identifier[statement] operator[SEP] { identifier[result] operator[SEP] identifier[annotatedLimit] operator[=] literal[boolean] operator[SEP] Keyword[return] Other[null] operator[SEP] } annotation[@] identifier[Override] Keyword[public] identifier[String] identifier[onHaving] operator[SEP] identifier[String] identifier[statement] operator[SEP] { identifier[result] operator[SEP] identifier[annotatedHaving] operator[=] literal[boolean] operator[SEP] Keyword[return] Other[null] operator[SEP] } annotation[@] identifier[Override] Keyword[public] identifier[String] identifier[onGroup] operator[SEP] identifier[String] identifier[statement] operator[SEP] { identifier[result] operator[SEP] identifier[annotatedGroupBy] operator[=] literal[boolean] operator[SEP] Keyword[return] Other[null] operator[SEP] } } operator[SEP] operator[SEP] identifier[forEachParameter] operator[SEP] identifier[method] , Keyword[new] identifier[OnMethodParameterListener] operator[SEP] operator[SEP] { annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[onMethodParameter] operator[SEP] identifier[VariableElement] identifier[methodParam] operator[SEP] { Keyword[if] operator[SEP] identifier[methodParam] operator[SEP] identifier[getAnnotation] operator[SEP] identifier[BindSqlDynamicOrderBy] operator[SEP] Keyword[class] operator[SEP] operator[!=] Other[null] operator[SEP] { identifier[String] identifier[orderDynamicName] operator[=] identifier[methodParam] operator[SEP] identifier[getSimpleName] operator[SEP] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] identifier[result] operator[SEP] identifier[paramOrderBy] operator[=] identifier[orderDynamicName] operator[SEP] identifier[AssertKripton] operator[SEP] identifier[assertTrueOrInvalidTypeForAnnotationMethodParameterException] operator[SEP] identifier[TypeUtility] operator[SEP] identifier[isEquals] operator[SEP] identifier[TypeUtility] operator[SEP] identifier[typeName] operator[SEP] identifier[String] operator[SEP] Keyword[class] operator[SEP] , identifier[TypeUtility] operator[SEP] identifier[typeName] operator[SEP] identifier[methodParam] operator[SEP] operator[SEP] , identifier[method] operator[SEP] identifier[getParent] operator[SEP] operator[SEP] operator[SEP] identifier[getElement] operator[SEP] operator[SEP] , identifier[method] operator[SEP] identifier[getElement] operator[SEP] operator[SEP] , identifier[methodParam] , identifier[BindSqlDynamicOrderBy] operator[SEP] Keyword[class] operator[SEP] operator[SEP] } } } operator[SEP] operator[SEP] } Keyword[else] { Keyword[final] identifier[Set] operator[<] identifier[String] operator[>] identifier[fields] operator[=] identifier[extractFieldsFromAnnotation] operator[SEP] identifier[method] , identifier[BindSqlSelect] operator[SEP] Keyword[class] , literal[boolean] operator[SEP] operator[SEP] Keyword[boolean] identifier[distinct] operator[=] identifier[AnnotationUtility] operator[SEP] identifier[extractAsBoolean] operator[SEP] identifier[method] operator[SEP] identifier[getElement] operator[SEP] operator[SEP] , identifier[annotation] , identifier[AnnotationAttributeType] operator[SEP] identifier[DISTINCT] operator[SEP] operator[SEP] identifier[String] identifier[annotatedGroupBy] operator[=] identifier[AnnotationUtility] operator[SEP] identifier[extractAsString] operator[SEP] identifier[method] operator[SEP] identifier[getElement] operator[SEP] operator[SEP] , identifier[annotation] , identifier[AnnotationAttributeType] operator[SEP] identifier[GROUP_BY] operator[SEP] operator[SEP] identifier[String] identifier[annotatedHaving] operator[=] identifier[AnnotationUtility] operator[SEP] identifier[extractAsString] operator[SEP] identifier[method] operator[SEP] identifier[getElement] operator[SEP] operator[SEP] , identifier[annotation] , identifier[AnnotationAttributeType] operator[SEP] identifier[HAVING] operator[SEP] operator[SEP] identifier[StringBuilder] identifier[builder] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] operator[SEP] operator[SEP] identifier[builder] operator[SEP] identifier[append] operator[SEP] identifier[SELECT_KEYWORD] operator[+] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[distinct] operator[SEP] { identifier[builder] operator[SEP] identifier[append] operator[SEP] identifier[DISTINCT_KEYWORD] operator[+] literal[String] operator[SEP] operator[SEP] } identifier[builder] operator[SEP] identifier[append] operator[SEP] identifier[forEachFields] operator[SEP] identifier[fields] , Keyword[new] identifier[OnFieldListener] operator[SEP] operator[SEP] { annotation[@] identifier[Override] Keyword[public] identifier[String] identifier[onField] operator[SEP] identifier[String] identifier[item] operator[SEP] { Keyword[return] identifier[item] operator[SEP] } } operator[SEP] operator[SEP] operator[SEP] identifier[builder] operator[SEP] identifier[append] operator[SEP] literal[String] operator[+] identifier[FROM_KEYWORD] operator[+] literal[String] operator[+] identifier[dao] operator[SEP] identifier[getEntitySimplyClassName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[builder] operator[SEP] identifier[append] operator[SEP] identifier[defineWhereStatement] operator[SEP] identifier[method] , identifier[result] , identifier[annotation] , identifier[dynamicReplace] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[StringUtils] operator[SEP] identifier[hasText] operator[SEP] identifier[annotatedGroupBy] operator[SEP] operator[SEP] { identifier[result] operator[SEP] identifier[annotatedGroupBy] operator[=] literal[boolean] operator[SEP] identifier[builder] operator[SEP] identifier[append] operator[SEP] literal[String] operator[+] identifier[GROUP_BY_KEYWORD] operator[+] literal[String] operator[+] identifier[annotatedGroupBy] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[StringUtils] operator[SEP] identifier[hasText] operator[SEP] identifier[annotatedHaving] operator[SEP] operator[SEP] { identifier[result] operator[SEP] identifier[annotatedHaving] operator[=] literal[boolean] operator[SEP] identifier[builder] operator[SEP] identifier[append] operator[SEP] literal[String] operator[+] identifier[HAVING_KEYWORD] operator[+] literal[String] operator[+] identifier[annotatedHaving] operator[SEP] operator[SEP] } identifier[builder] operator[SEP] identifier[append] operator[SEP] identifier[defineOrderByStatement] operator[SEP] identifier[method] , identifier[result] , identifier[annotation] , identifier[dynamicReplace] operator[SEP] operator[SEP] operator[SEP] identifier[builder] operator[SEP] identifier[append] operator[SEP] identifier[defineLimitStatement] operator[SEP] identifier[method] , identifier[result] , identifier[annotation] , identifier[dynamicReplace] operator[SEP] operator[SEP] operator[SEP] identifier[result] operator[SEP] identifier[value] operator[=] identifier[builder] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] } identifier[result] operator[SEP] identifier[value] operator[=] identifier[JQLChecker] operator[SEP] identifier[getInstance] operator[SEP] operator[SEP] operator[SEP] identifier[replace] operator[SEP] identifier[method] , identifier[result] operator[SEP] identifier[value] , Keyword[new] identifier[JQLReplacerListenerImpl] operator[SEP] identifier[method] , literal[boolean] operator[SEP] { annotation[@] identifier[Override] Keyword[public] identifier[String] identifier[onBindParameter] operator[SEP] identifier[String] identifier[bindParameterName] , Keyword[boolean] identifier[inStatement] operator[SEP] { Keyword[if] operator[SEP] identifier[inStatement] operator[SEP] { identifier[TypeName] identifier[typeName] operator[=] identifier[method] operator[SEP] identifier[findParameterType] operator[SEP] identifier[method] operator[SEP] identifier[findParameterNameByAlias] operator[SEP] identifier[bindParameterName] operator[SEP] operator[SEP] operator[SEP] identifier[AssertKripton] operator[SEP] identifier[assertTrueOrInvalidMethodSignException] operator[SEP] identifier[typeName] operator[!=] Other[null] operator[&&] operator[SEP] identifier[TypeUtility] operator[SEP] identifier[isArray] operator[SEP] identifier[typeName] operator[SEP] operator[||] identifier[TypeUtility] operator[SEP] identifier[isCollection] operator[SEP] identifier[typeName] operator[SEP] operator[SEP] , identifier[method] , literal[String] operator[SEP] operator[SEP] identifier[String] identifier[dynamicSpread] operator[=] identifier[bindParameterName] operator[SEP] identifier[dynamicReplace] operator[SEP] identifier[put] operator[SEP] identifier[JQLDynamicStatementType] operator[SEP] identifier[DYNAMIC_SPREAD] , identifier[dynamicSpread] operator[SEP] operator[SEP] identifier[result] operator[SEP] identifier[spreadParams] operator[SEP] identifier[add] operator[SEP] identifier[dynamicSpread] operator[SEP] operator[SEP] Keyword[return] Other[null] operator[SEP] } Keyword[return] Other[null] operator[SEP] } } operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[method] operator[SEP] identifier[isPagedLiveData] operator[SEP] operator[SEP] operator[SEP] { identifier[dynamicReplace] operator[SEP] identifier[put] operator[SEP] identifier[JQLDynamicStatementType] operator[SEP] identifier[DYNAMIC_PAGE_OFFSET] , literal[String] operator[SEP] operator[SEP] identifier[dynamicReplace] operator[SEP] identifier[put] operator[SEP] identifier[JQLDynamicStatementType] operator[SEP] identifier[DYNAMIC_PAGE_SIZE] , literal[String] operator[SEP] operator[SEP] } identifier[result] operator[SEP] identifier[operationType] operator[=] identifier[JQLType] operator[SEP] identifier[SELECT] operator[SEP] identifier[result] operator[SEP] identifier[dynamicReplace] operator[=] identifier[dynamicReplace] operator[SEP] Keyword[return] identifier[result] operator[SEP] }
public static CPRuleUserSegmentRel findByCommerceUserSegmentEntryId_Last( long commerceUserSegmentEntryId, OrderByComparator<CPRuleUserSegmentRel> orderByComparator) throws com.liferay.commerce.product.exception.NoSuchCPRuleUserSegmentRelException { return getPersistence() .findByCommerceUserSegmentEntryId_Last(commerceUserSegmentEntryId, orderByComparator); }
class class_name[name] begin[{] method[findByCommerceUserSegmentEntryId_Last, return_type[type[CPRuleUserSegmentRel]], modifier[public static], parameter[commerceUserSegmentEntryId, orderByComparator]] begin[{] return[call[.getPersistence, parameter[]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[CPRuleUserSegmentRel] identifier[findByCommerceUserSegmentEntryId_Last] operator[SEP] Keyword[long] identifier[commerceUserSegmentEntryId] , identifier[OrderByComparator] operator[<] identifier[CPRuleUserSegmentRel] operator[>] identifier[orderByComparator] operator[SEP] Keyword[throws] identifier[com] operator[SEP] identifier[liferay] operator[SEP] identifier[commerce] operator[SEP] identifier[product] operator[SEP] identifier[exception] operator[SEP] identifier[NoSuchCPRuleUserSegmentRelException] { Keyword[return] identifier[getPersistence] operator[SEP] operator[SEP] operator[SEP] identifier[findByCommerceUserSegmentEntryId_Last] operator[SEP] identifier[commerceUserSegmentEntryId] , identifier[orderByComparator] operator[SEP] operator[SEP] }
public String toHexString() { byte[] bytes = this.data.array(); char[] hex = new char[this.data.remaining() * 2]; for (int i = this.data.position(); i < this.data.remaining(); i++) { int b = bytes[i] & 0xFF; hex[i * 2] = HEX_CHARS[b >>> 4]; hex[i * 2 + 1] = HEX_CHARS[b & 0x0F]; } return new String(hex); }
class class_name[name] begin[{] method[toHexString, return_type[type[String]], modifier[public], parameter[]] begin[{] local_variable[type[byte], bytes] local_variable[type[char], hex] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=MemberReference(member=bytes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0xFF), operator=&), name=b)], modifiers=set(), type=BasicType(dimensions=[], name=int)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=hex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2), operator=*))]), type==, value=MemberReference(member=HEX_CHARS, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=BinaryOperation(operandl=MemberReference(member=b, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=4), operator=>>>))])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=hex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2), operator=*), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+))]), type==, value=MemberReference(member=HEX_CHARS, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=BinaryOperation(operandl=MemberReference(member=b, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0x0F), operator=&))])), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=data, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[], member=remaining, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=data, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[], member=position, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) return[ClassCreator(arguments=[MemberReference(member=hex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=String, sub_type=None))] end[}] END[}]
Keyword[public] identifier[String] identifier[toHexString] operator[SEP] operator[SEP] { Keyword[byte] operator[SEP] operator[SEP] identifier[bytes] operator[=] Keyword[this] operator[SEP] identifier[data] operator[SEP] identifier[array] operator[SEP] operator[SEP] operator[SEP] Keyword[char] operator[SEP] operator[SEP] identifier[hex] operator[=] Keyword[new] Keyword[char] operator[SEP] Keyword[this] operator[SEP] identifier[data] operator[SEP] identifier[remaining] operator[SEP] operator[SEP] operator[*] Other[2] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Keyword[this] operator[SEP] identifier[data] operator[SEP] identifier[position] operator[SEP] operator[SEP] operator[SEP] identifier[i] operator[<] Keyword[this] operator[SEP] identifier[data] operator[SEP] identifier[remaining] operator[SEP] operator[SEP] operator[SEP] identifier[i] operator[++] operator[SEP] { Keyword[int] identifier[b] operator[=] identifier[bytes] operator[SEP] identifier[i] operator[SEP] operator[&] literal[Integer] operator[SEP] identifier[hex] operator[SEP] identifier[i] operator[*] Other[2] operator[SEP] operator[=] identifier[HEX_CHARS] operator[SEP] identifier[b] operator[>] operator[>] operator[>] Other[4] operator[SEP] operator[SEP] identifier[hex] operator[SEP] identifier[i] operator[*] Other[2] operator[+] Other[1] operator[SEP] operator[=] identifier[HEX_CHARS] operator[SEP] identifier[b] operator[&] literal[Integer] operator[SEP] operator[SEP] } Keyword[return] Keyword[new] identifier[String] operator[SEP] identifier[hex] operator[SEP] operator[SEP] }
public TimeZoneRule[] getSimpleTimeZoneRulesNear(long date) { AnnualTimeZoneRule[] annualRules = null; TimeZoneRule initialRule = null; // Get the next transition TimeZoneTransition tr = getNextTransition(date, false); if (tr != null) { String initialName = tr.getFrom().getName(); int initialRaw = tr.getFrom().getRawOffset(); int initialDst = tr.getFrom().getDSTSavings(); // Check if the next transition is either DST->STD or STD->DST and // within roughly 1 year from the specified date long nextTransitionTime = tr.getTime(); if (((tr.getFrom().getDSTSavings() == 0 && tr.getTo().getDSTSavings() != 0) || (tr.getFrom().getDSTSavings() != 0 && tr.getTo().getDSTSavings() == 0)) && date + MILLIS_PER_YEAR > nextTransitionTime) { annualRules = new AnnualTimeZoneRule[2]; // Get local wall time for the transition time int dtfields[] = Grego.timeToFields(nextTransitionTime + tr.getFrom().getRawOffset() + tr.getFrom().getDSTSavings(), null); int weekInMonth = Grego.getDayOfWeekInMonth(dtfields[0], dtfields[1], dtfields[2]); // Create DOW rule DateTimeRule dtr = new DateTimeRule(dtfields[1], weekInMonth, dtfields[3], dtfields[5], DateTimeRule.WALL_TIME); AnnualTimeZoneRule secondRule = null; // Note: SimpleTimeZone does not support raw offset change. // So we always use raw offset of the given time for the rule, // even raw offset is changed. This will result that the result // zone to return wrong offset after the transition. // When we encounter such case, we do not inspect next next // transition for another rule. annualRules[0] = new AnnualTimeZoneRule(tr.getTo().getName(), initialRaw, tr.getTo().getDSTSavings(), dtr, dtfields[0], AnnualTimeZoneRule.MAX_YEAR); if (tr.getTo().getRawOffset() == initialRaw) { // Get the next next transition tr = getNextTransition(nextTransitionTime, false); if (tr != null) { // Check if the next next transition is either DST->STD or STD->DST // and within roughly 1 year from the next transition if (((tr.getFrom().getDSTSavings() == 0 && tr.getTo().getDSTSavings() != 0) || (tr.getFrom().getDSTSavings() != 0 && tr.getTo().getDSTSavings() == 0)) && nextTransitionTime + MILLIS_PER_YEAR > tr.getTime()) { // Generate another DOW rule dtfields = Grego.timeToFields(tr.getTime() + tr.getFrom().getRawOffset() + tr.getFrom().getDSTSavings(), dtfields); weekInMonth = Grego.getDayOfWeekInMonth(dtfields[0], dtfields[1], dtfields[2]); dtr = new DateTimeRule(dtfields[1], weekInMonth, dtfields[3], dtfields[5], DateTimeRule.WALL_TIME); secondRule = new AnnualTimeZoneRule(tr.getTo().getName(), tr.getTo().getRawOffset(), tr.getTo().getDSTSavings(), dtr, dtfields[0] - 1, AnnualTimeZoneRule.MAX_YEAR); // Make sure this rule can be applied to the specified date Date d = secondRule.getPreviousStart(date, tr.getFrom().getRawOffset(), tr.getFrom().getDSTSavings(), true); if (d != null && d.getTime() <= date && initialRaw == tr.getTo().getRawOffset() && initialDst == tr.getTo().getDSTSavings()) { // We can use this rule as the second transition rule annualRules[1] = secondRule; } } } } if (annualRules[1] == null) { // Try previous transition tr = getPreviousTransition(date, true); if (tr != null) { // Check if the previous transition is either DST->STD or STD->DST. // The actual transition time does not matter here. if ((tr.getFrom().getDSTSavings() == 0 && tr.getTo().getDSTSavings() != 0) || (tr.getFrom().getDSTSavings() != 0 && tr.getTo().getDSTSavings() == 0)) { // Generate another DOW rule dtfields = Grego.timeToFields(tr.getTime() + tr.getFrom().getRawOffset() + tr.getFrom().getDSTSavings(), dtfields); weekInMonth = Grego.getDayOfWeekInMonth(dtfields[0], dtfields[1], dtfields[2]); dtr = new DateTimeRule(dtfields[1], weekInMonth, dtfields[3], dtfields[5], DateTimeRule.WALL_TIME); // second rule raw/dst offsets should match raw/dst offsets // at the given time secondRule = new AnnualTimeZoneRule( tr.getTo().getName(), initialRaw, initialDst, dtr, annualRules[0].getStartYear() - 1, AnnualTimeZoneRule.MAX_YEAR); // Check if this rule start after the first rule after the // specified date Date d = secondRule.getNextStart(date, tr.getFrom().getRawOffset(), tr.getFrom().getDSTSavings(), false); if (d.getTime() > nextTransitionTime) { // We can use this rule as the second transition rule annualRules[1] = secondRule; } } } } if (annualRules[1] == null) { // Cannot generate a good pair of AnnualTimeZoneRule annualRules = null; } else { // The initial rule should represent the rule before the previous transition initialName = annualRules[0].getName(); initialRaw = annualRules[0].getRawOffset(); initialDst = annualRules[0].getDSTSavings(); } } initialRule = new InitialTimeZoneRule(initialName, initialRaw, initialDst); } else { // Try the previous one tr = getPreviousTransition(date, true); if (tr != null) { initialRule = new InitialTimeZoneRule(tr.getTo().getName(), tr.getTo().getRawOffset(), tr.getTo().getDSTSavings()); } else { // No transitions in the past. Just use the current offsets int[] offsets = new int[2]; getOffset(date, false, offsets); initialRule = new InitialTimeZoneRule(getID(), offsets[0], offsets[1]); } } TimeZoneRule[] result = null; if (annualRules == null) { result = new TimeZoneRule[1]; result[0] = initialRule; } else { result = new TimeZoneRule[3]; result[0] = initialRule; result[1] = annualRules[0]; result[2] = annualRules[1]; } return result; }
class class_name[name] begin[{] method[getSimpleTimeZoneRulesNear, return_type[type[TimeZoneRule]], modifier[public], parameter[date]] begin[{] local_variable[type[AnnualTimeZoneRule], annualRules] local_variable[type[TimeZoneRule], initialRule] local_variable[type[TimeZoneTransition], tr] if[binary_operation[member[.tr], !=, literal[null]]] begin[{] local_variable[type[String], initialName] local_variable[type[int], initialRaw] local_variable[type[int], initialDst] local_variable[type[long], nextTransitionTime] if[binary_operation[binary_operation[binary_operation[binary_operation[call[tr.getFrom, parameter[]], ==, literal[0]], &&, binary_operation[call[tr.getTo, parameter[]], !=, literal[0]]], ||, binary_operation[binary_operation[call[tr.getFrom, parameter[]], !=, literal[0]], &&, binary_operation[call[tr.getTo, parameter[]], ==, literal[0]]]], &&, binary_operation[binary_operation[member[.date], +, member[.MILLIS_PER_YEAR]], >, member[.nextTransitionTime]]]] begin[{] assign[member[.annualRules], ArrayCreator(dimensions=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2)], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=AnnualTimeZoneRule, sub_type=None))] local_variable[type[int], dtfields] local_variable[type[int], weekInMonth] local_variable[type[DateTimeRule], dtr] local_variable[type[AnnualTimeZoneRule], secondRule] assign[member[.annualRules], ClassCreator(arguments=[MethodInvocation(arguments=[], member=getTo, postfix_operators=[], prefix_operators=[], qualifier=tr, selectors=[MethodInvocation(arguments=[], member=getName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), MemberReference(member=initialRaw, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getTo, postfix_operators=[], prefix_operators=[], qualifier=tr, selectors=[MethodInvocation(arguments=[], member=getDSTSavings, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), MemberReference(member=dtr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=dtfields, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0))]), MemberReference(member=MAX_YEAR, postfix_operators=[], prefix_operators=[], qualifier=AnnualTimeZoneRule, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=AnnualTimeZoneRule, sub_type=None))] if[binary_operation[call[tr.getTo, parameter[]], ==, member[.initialRaw]]] begin[{] assign[member[.tr], call[.getNextTransition, parameter[member[.nextTransitionTime], literal[false]]]] if[binary_operation[member[.tr], !=, literal[null]]] begin[{] if[binary_operation[binary_operation[binary_operation[binary_operation[call[tr.getFrom, parameter[]], ==, literal[0]], &&, binary_operation[call[tr.getTo, parameter[]], !=, literal[0]]], ||, binary_operation[binary_operation[call[tr.getFrom, parameter[]], !=, literal[0]], &&, binary_operation[call[tr.getTo, parameter[]], ==, literal[0]]]], &&, binary_operation[binary_operation[member[.nextTransitionTime], +, member[.MILLIS_PER_YEAR]], >, call[tr.getTime, parameter[]]]]] begin[{] assign[member[.dtfields], call[Grego.timeToFields, parameter[binary_operation[binary_operation[call[tr.getTime, parameter[]], +, call[tr.getFrom, parameter[]]], +, call[tr.getFrom, parameter[]]], member[.dtfields]]]] assign[member[.weekInMonth], call[Grego.getDayOfWeekInMonth, parameter[member[.dtfields], member[.dtfields], member[.dtfields]]]] assign[member[.dtr], ClassCreator(arguments=[MemberReference(member=dtfields, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1))]), MemberReference(member=weekInMonth, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=dtfields, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=3))]), MemberReference(member=dtfields, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=5))]), MemberReference(member=WALL_TIME, postfix_operators=[], prefix_operators=[], qualifier=DateTimeRule, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=DateTimeRule, sub_type=None))] assign[member[.secondRule], ClassCreator(arguments=[MethodInvocation(arguments=[], member=getTo, postfix_operators=[], prefix_operators=[], qualifier=tr, selectors=[MethodInvocation(arguments=[], member=getName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), MethodInvocation(arguments=[], member=getTo, postfix_operators=[], prefix_operators=[], qualifier=tr, selectors=[MethodInvocation(arguments=[], member=getRawOffset, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), MethodInvocation(arguments=[], member=getTo, postfix_operators=[], prefix_operators=[], qualifier=tr, selectors=[MethodInvocation(arguments=[], member=getDSTSavings, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), MemberReference(member=dtr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=MemberReference(member=dtfields, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0))]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=-), MemberReference(member=MAX_YEAR, postfix_operators=[], prefix_operators=[], qualifier=AnnualTimeZoneRule, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=AnnualTimeZoneRule, sub_type=None))] local_variable[type[Date], d] if[binary_operation[binary_operation[binary_operation[binary_operation[member[.d], !=, literal[null]], &&, binary_operation[call[d.getTime, parameter[]], <=, member[.date]]], &&, binary_operation[member[.initialRaw], ==, call[tr.getTo, parameter[]]]], &&, binary_operation[member[.initialDst], ==, call[tr.getTo, parameter[]]]]] begin[{] assign[member[.annualRules], member[.secondRule]] else begin[{] None end[}] else begin[{] None end[}] else begin[{] None end[}] else begin[{] None end[}] if[binary_operation[member[.annualRules], ==, literal[null]]] begin[{] assign[member[.tr], call[.getPreviousTransition, parameter[member[.date], literal[true]]]] if[binary_operation[member[.tr], !=, literal[null]]] begin[{] if[binary_operation[binary_operation[binary_operation[call[tr.getFrom, parameter[]], ==, literal[0]], &&, binary_operation[call[tr.getTo, parameter[]], !=, literal[0]]], ||, binary_operation[binary_operation[call[tr.getFrom, parameter[]], !=, literal[0]], &&, binary_operation[call[tr.getTo, parameter[]], ==, literal[0]]]]] begin[{] assign[member[.dtfields], call[Grego.timeToFields, parameter[binary_operation[binary_operation[call[tr.getTime, parameter[]], +, call[tr.getFrom, parameter[]]], +, call[tr.getFrom, parameter[]]], member[.dtfields]]]] assign[member[.weekInMonth], call[Grego.getDayOfWeekInMonth, parameter[member[.dtfields], member[.dtfields], member[.dtfields]]]] assign[member[.dtr], ClassCreator(arguments=[MemberReference(member=dtfields, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1))]), MemberReference(member=weekInMonth, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=dtfields, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=3))]), MemberReference(member=dtfields, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=5))]), MemberReference(member=WALL_TIME, postfix_operators=[], prefix_operators=[], qualifier=DateTimeRule, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=DateTimeRule, sub_type=None))] assign[member[.secondRule], ClassCreator(arguments=[MethodInvocation(arguments=[], member=getTo, postfix_operators=[], prefix_operators=[], qualifier=tr, selectors=[MethodInvocation(arguments=[], member=getName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), MemberReference(member=initialRaw, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=initialDst, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=dtr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=MemberReference(member=annualRules, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)), MethodInvocation(arguments=[], member=getStartYear, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=-), MemberReference(member=MAX_YEAR, postfix_operators=[], prefix_operators=[], qualifier=AnnualTimeZoneRule, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=AnnualTimeZoneRule, sub_type=None))] local_variable[type[Date], d] if[binary_operation[call[d.getTime, parameter[]], >, member[.nextTransitionTime]]] begin[{] assign[member[.annualRules], member[.secondRule]] else begin[{] None end[}] else begin[{] None end[}] else begin[{] None end[}] else begin[{] None end[}] if[binary_operation[member[.annualRules], ==, literal[null]]] begin[{] assign[member[.annualRules], literal[null]] else begin[{] assign[member[.initialName], member[.annualRules]] assign[member[.initialRaw], member[.annualRules]] assign[member[.initialDst], member[.annualRules]] end[}] else begin[{] None end[}] assign[member[.initialRule], ClassCreator(arguments=[MemberReference(member=initialName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=initialRaw, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=initialDst, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=InitialTimeZoneRule, sub_type=None))] else begin[{] assign[member[.tr], call[.getPreviousTransition, parameter[member[.date], literal[true]]]] if[binary_operation[member[.tr], !=, literal[null]]] begin[{] assign[member[.initialRule], ClassCreator(arguments=[MethodInvocation(arguments=[], member=getTo, postfix_operators=[], prefix_operators=[], qualifier=tr, selectors=[MethodInvocation(arguments=[], member=getName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), MethodInvocation(arguments=[], member=getTo, postfix_operators=[], prefix_operators=[], qualifier=tr, selectors=[MethodInvocation(arguments=[], member=getRawOffset, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), MethodInvocation(arguments=[], member=getTo, postfix_operators=[], prefix_operators=[], qualifier=tr, selectors=[MethodInvocation(arguments=[], member=getDSTSavings, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=InitialTimeZoneRule, sub_type=None))] else begin[{] local_variable[type[int], offsets] call[.getOffset, parameter[member[.date], literal[false], member[.offsets]]] assign[member[.initialRule], ClassCreator(arguments=[MethodInvocation(arguments=[], member=getID, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), MemberReference(member=offsets, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0))]), MemberReference(member=offsets, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1))])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=InitialTimeZoneRule, sub_type=None))] end[}] end[}] local_variable[type[TimeZoneRule], result] if[binary_operation[member[.annualRules], ==, literal[null]]] begin[{] assign[member[.result], ArrayCreator(dimensions=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=TimeZoneRule, sub_type=None))] assign[member[.result], member[.initialRule]] else begin[{] assign[member[.result], ArrayCreator(dimensions=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=3)], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=TimeZoneRule, sub_type=None))] assign[member[.result], member[.initialRule]] assign[member[.result], member[.annualRules]] assign[member[.result], member[.annualRules]] end[}] return[member[.result]] end[}] END[}]
Keyword[public] identifier[TimeZoneRule] operator[SEP] operator[SEP] identifier[getSimpleTimeZoneRulesNear] operator[SEP] Keyword[long] identifier[date] operator[SEP] { identifier[AnnualTimeZoneRule] operator[SEP] operator[SEP] identifier[annualRules] operator[=] Other[null] operator[SEP] identifier[TimeZoneRule] identifier[initialRule] operator[=] Other[null] operator[SEP] identifier[TimeZoneTransition] identifier[tr] operator[=] identifier[getNextTransition] operator[SEP] identifier[date] , literal[boolean] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[tr] operator[!=] Other[null] operator[SEP] { identifier[String] identifier[initialName] operator[=] identifier[tr] operator[SEP] identifier[getFrom] operator[SEP] operator[SEP] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[initialRaw] operator[=] identifier[tr] operator[SEP] identifier[getFrom] operator[SEP] operator[SEP] operator[SEP] identifier[getRawOffset] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[initialDst] operator[=] identifier[tr] operator[SEP] identifier[getFrom] operator[SEP] operator[SEP] operator[SEP] identifier[getDSTSavings] operator[SEP] operator[SEP] operator[SEP] Keyword[long] identifier[nextTransitionTime] operator[=] identifier[tr] operator[SEP] identifier[getTime] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[SEP] operator[SEP] identifier[tr] operator[SEP] identifier[getFrom] operator[SEP] operator[SEP] operator[SEP] identifier[getDSTSavings] operator[SEP] operator[SEP] operator[==] Other[0] operator[&&] identifier[tr] operator[SEP] identifier[getTo] operator[SEP] operator[SEP] operator[SEP] identifier[getDSTSavings] operator[SEP] operator[SEP] operator[!=] Other[0] operator[SEP] operator[||] operator[SEP] identifier[tr] operator[SEP] identifier[getFrom] operator[SEP] operator[SEP] operator[SEP] identifier[getDSTSavings] operator[SEP] operator[SEP] operator[!=] Other[0] operator[&&] identifier[tr] operator[SEP] identifier[getTo] operator[SEP] operator[SEP] operator[SEP] identifier[getDSTSavings] operator[SEP] operator[SEP] operator[==] Other[0] operator[SEP] operator[SEP] operator[&&] identifier[date] operator[+] identifier[MILLIS_PER_YEAR] operator[>] identifier[nextTransitionTime] operator[SEP] { identifier[annualRules] operator[=] Keyword[new] identifier[AnnualTimeZoneRule] operator[SEP] Other[2] operator[SEP] operator[SEP] Keyword[int] identifier[dtfields] operator[SEP] operator[SEP] operator[=] identifier[Grego] operator[SEP] identifier[timeToFields] operator[SEP] identifier[nextTransitionTime] operator[+] identifier[tr] operator[SEP] identifier[getFrom] operator[SEP] operator[SEP] operator[SEP] identifier[getRawOffset] operator[SEP] operator[SEP] operator[+] identifier[tr] operator[SEP] identifier[getFrom] operator[SEP] operator[SEP] operator[SEP] identifier[getDSTSavings] operator[SEP] operator[SEP] , Other[null] operator[SEP] operator[SEP] Keyword[int] identifier[weekInMonth] operator[=] identifier[Grego] operator[SEP] identifier[getDayOfWeekInMonth] operator[SEP] identifier[dtfields] operator[SEP] Other[0] operator[SEP] , identifier[dtfields] operator[SEP] Other[1] operator[SEP] , identifier[dtfields] operator[SEP] Other[2] operator[SEP] operator[SEP] operator[SEP] identifier[DateTimeRule] identifier[dtr] operator[=] Keyword[new] identifier[DateTimeRule] operator[SEP] identifier[dtfields] operator[SEP] Other[1] operator[SEP] , identifier[weekInMonth] , identifier[dtfields] operator[SEP] Other[3] operator[SEP] , identifier[dtfields] operator[SEP] Other[5] operator[SEP] , identifier[DateTimeRule] operator[SEP] identifier[WALL_TIME] operator[SEP] operator[SEP] identifier[AnnualTimeZoneRule] identifier[secondRule] operator[=] Other[null] operator[SEP] identifier[annualRules] operator[SEP] Other[0] operator[SEP] operator[=] Keyword[new] identifier[AnnualTimeZoneRule] operator[SEP] identifier[tr] operator[SEP] identifier[getTo] operator[SEP] operator[SEP] operator[SEP] identifier[getName] operator[SEP] operator[SEP] , identifier[initialRaw] , identifier[tr] operator[SEP] identifier[getTo] operator[SEP] operator[SEP] operator[SEP] identifier[getDSTSavings] operator[SEP] operator[SEP] , identifier[dtr] , identifier[dtfields] operator[SEP] Other[0] operator[SEP] , identifier[AnnualTimeZoneRule] operator[SEP] identifier[MAX_YEAR] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[tr] operator[SEP] identifier[getTo] operator[SEP] operator[SEP] operator[SEP] identifier[getRawOffset] operator[SEP] operator[SEP] operator[==] identifier[initialRaw] operator[SEP] { identifier[tr] operator[=] identifier[getNextTransition] operator[SEP] identifier[nextTransitionTime] , literal[boolean] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[tr] operator[!=] Other[null] operator[SEP] { Keyword[if] operator[SEP] operator[SEP] operator[SEP] identifier[tr] operator[SEP] identifier[getFrom] operator[SEP] operator[SEP] operator[SEP] identifier[getDSTSavings] operator[SEP] operator[SEP] operator[==] Other[0] operator[&&] identifier[tr] operator[SEP] identifier[getTo] operator[SEP] operator[SEP] operator[SEP] identifier[getDSTSavings] operator[SEP] operator[SEP] operator[!=] Other[0] operator[SEP] operator[||] operator[SEP] identifier[tr] operator[SEP] identifier[getFrom] operator[SEP] operator[SEP] operator[SEP] identifier[getDSTSavings] operator[SEP] operator[SEP] operator[!=] Other[0] operator[&&] identifier[tr] operator[SEP] identifier[getTo] operator[SEP] operator[SEP] operator[SEP] identifier[getDSTSavings] operator[SEP] operator[SEP] operator[==] Other[0] operator[SEP] operator[SEP] operator[&&] identifier[nextTransitionTime] operator[+] identifier[MILLIS_PER_YEAR] operator[>] identifier[tr] operator[SEP] identifier[getTime] operator[SEP] operator[SEP] operator[SEP] { identifier[dtfields] operator[=] identifier[Grego] operator[SEP] identifier[timeToFields] operator[SEP] identifier[tr] operator[SEP] identifier[getTime] operator[SEP] operator[SEP] operator[+] identifier[tr] operator[SEP] identifier[getFrom] operator[SEP] operator[SEP] operator[SEP] identifier[getRawOffset] operator[SEP] operator[SEP] operator[+] identifier[tr] operator[SEP] identifier[getFrom] operator[SEP] operator[SEP] operator[SEP] identifier[getDSTSavings] operator[SEP] operator[SEP] , identifier[dtfields] operator[SEP] operator[SEP] identifier[weekInMonth] operator[=] identifier[Grego] operator[SEP] identifier[getDayOfWeekInMonth] operator[SEP] identifier[dtfields] operator[SEP] Other[0] operator[SEP] , identifier[dtfields] operator[SEP] Other[1] operator[SEP] , identifier[dtfields] operator[SEP] Other[2] operator[SEP] operator[SEP] operator[SEP] identifier[dtr] operator[=] Keyword[new] identifier[DateTimeRule] operator[SEP] identifier[dtfields] operator[SEP] Other[1] operator[SEP] , identifier[weekInMonth] , identifier[dtfields] operator[SEP] Other[3] operator[SEP] , identifier[dtfields] operator[SEP] Other[5] operator[SEP] , identifier[DateTimeRule] operator[SEP] identifier[WALL_TIME] operator[SEP] operator[SEP] identifier[secondRule] operator[=] Keyword[new] identifier[AnnualTimeZoneRule] operator[SEP] identifier[tr] operator[SEP] identifier[getTo] operator[SEP] operator[SEP] operator[SEP] identifier[getName] operator[SEP] operator[SEP] , identifier[tr] operator[SEP] identifier[getTo] operator[SEP] operator[SEP] operator[SEP] identifier[getRawOffset] operator[SEP] operator[SEP] , identifier[tr] operator[SEP] identifier[getTo] operator[SEP] operator[SEP] operator[SEP] identifier[getDSTSavings] operator[SEP] operator[SEP] , identifier[dtr] , identifier[dtfields] operator[SEP] Other[0] operator[SEP] operator[-] Other[1] , identifier[AnnualTimeZoneRule] operator[SEP] identifier[MAX_YEAR] operator[SEP] operator[SEP] identifier[Date] identifier[d] operator[=] identifier[secondRule] operator[SEP] identifier[getPreviousStart] operator[SEP] identifier[date] , identifier[tr] operator[SEP] identifier[getFrom] operator[SEP] operator[SEP] operator[SEP] identifier[getRawOffset] operator[SEP] operator[SEP] , identifier[tr] operator[SEP] identifier[getFrom] operator[SEP] operator[SEP] operator[SEP] identifier[getDSTSavings] operator[SEP] operator[SEP] , literal[boolean] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[d] operator[!=] Other[null] operator[&&] identifier[d] operator[SEP] identifier[getTime] operator[SEP] operator[SEP] operator[<=] identifier[date] operator[&&] identifier[initialRaw] operator[==] identifier[tr] operator[SEP] identifier[getTo] operator[SEP] operator[SEP] operator[SEP] identifier[getRawOffset] operator[SEP] operator[SEP] operator[&&] identifier[initialDst] operator[==] identifier[tr] operator[SEP] identifier[getTo] operator[SEP] operator[SEP] operator[SEP] identifier[getDSTSavings] operator[SEP] operator[SEP] operator[SEP] { identifier[annualRules] operator[SEP] Other[1] operator[SEP] operator[=] identifier[secondRule] operator[SEP] } } } } Keyword[if] operator[SEP] identifier[annualRules] operator[SEP] Other[1] operator[SEP] operator[==] Other[null] operator[SEP] { identifier[tr] operator[=] identifier[getPreviousTransition] operator[SEP] identifier[date] , literal[boolean] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[tr] operator[!=] Other[null] operator[SEP] { Keyword[if] operator[SEP] operator[SEP] identifier[tr] operator[SEP] identifier[getFrom] operator[SEP] operator[SEP] operator[SEP] identifier[getDSTSavings] operator[SEP] operator[SEP] operator[==] Other[0] operator[&&] identifier[tr] operator[SEP] identifier[getTo] operator[SEP] operator[SEP] operator[SEP] identifier[getDSTSavings] operator[SEP] operator[SEP] operator[!=] Other[0] operator[SEP] operator[||] operator[SEP] identifier[tr] operator[SEP] identifier[getFrom] operator[SEP] operator[SEP] operator[SEP] identifier[getDSTSavings] operator[SEP] operator[SEP] operator[!=] Other[0] operator[&&] identifier[tr] operator[SEP] identifier[getTo] operator[SEP] operator[SEP] operator[SEP] identifier[getDSTSavings] operator[SEP] operator[SEP] operator[==] Other[0] operator[SEP] operator[SEP] { identifier[dtfields] operator[=] identifier[Grego] operator[SEP] identifier[timeToFields] operator[SEP] identifier[tr] operator[SEP] identifier[getTime] operator[SEP] operator[SEP] operator[+] identifier[tr] operator[SEP] identifier[getFrom] operator[SEP] operator[SEP] operator[SEP] identifier[getRawOffset] operator[SEP] operator[SEP] operator[+] identifier[tr] operator[SEP] identifier[getFrom] operator[SEP] operator[SEP] operator[SEP] identifier[getDSTSavings] operator[SEP] operator[SEP] , identifier[dtfields] operator[SEP] operator[SEP] identifier[weekInMonth] operator[=] identifier[Grego] operator[SEP] identifier[getDayOfWeekInMonth] operator[SEP] identifier[dtfields] operator[SEP] Other[0] operator[SEP] , identifier[dtfields] operator[SEP] Other[1] operator[SEP] , identifier[dtfields] operator[SEP] Other[2] operator[SEP] operator[SEP] operator[SEP] identifier[dtr] operator[=] Keyword[new] identifier[DateTimeRule] operator[SEP] identifier[dtfields] operator[SEP] Other[1] operator[SEP] , identifier[weekInMonth] , identifier[dtfields] operator[SEP] Other[3] operator[SEP] , identifier[dtfields] operator[SEP] Other[5] operator[SEP] , identifier[DateTimeRule] operator[SEP] identifier[WALL_TIME] operator[SEP] operator[SEP] identifier[secondRule] operator[=] Keyword[new] identifier[AnnualTimeZoneRule] operator[SEP] identifier[tr] operator[SEP] identifier[getTo] operator[SEP] operator[SEP] operator[SEP] identifier[getName] operator[SEP] operator[SEP] , identifier[initialRaw] , identifier[initialDst] , identifier[dtr] , identifier[annualRules] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[getStartYear] operator[SEP] operator[SEP] operator[-] Other[1] , identifier[AnnualTimeZoneRule] operator[SEP] identifier[MAX_YEAR] operator[SEP] operator[SEP] identifier[Date] identifier[d] operator[=] identifier[secondRule] operator[SEP] identifier[getNextStart] operator[SEP] identifier[date] , identifier[tr] operator[SEP] identifier[getFrom] operator[SEP] operator[SEP] operator[SEP] identifier[getRawOffset] operator[SEP] operator[SEP] , identifier[tr] operator[SEP] identifier[getFrom] operator[SEP] operator[SEP] operator[SEP] identifier[getDSTSavings] operator[SEP] operator[SEP] , literal[boolean] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[d] operator[SEP] identifier[getTime] operator[SEP] operator[SEP] operator[>] identifier[nextTransitionTime] operator[SEP] { identifier[annualRules] operator[SEP] Other[1] operator[SEP] operator[=] identifier[secondRule] operator[SEP] } } } } Keyword[if] operator[SEP] identifier[annualRules] operator[SEP] Other[1] operator[SEP] operator[==] Other[null] operator[SEP] { identifier[annualRules] operator[=] Other[null] operator[SEP] } Keyword[else] { identifier[initialName] operator[=] identifier[annualRules] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] identifier[initialRaw] operator[=] identifier[annualRules] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[getRawOffset] operator[SEP] operator[SEP] operator[SEP] identifier[initialDst] operator[=] identifier[annualRules] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[getDSTSavings] operator[SEP] operator[SEP] operator[SEP] } } identifier[initialRule] operator[=] Keyword[new] identifier[InitialTimeZoneRule] operator[SEP] identifier[initialName] , identifier[initialRaw] , identifier[initialDst] operator[SEP] operator[SEP] } Keyword[else] { identifier[tr] operator[=] identifier[getPreviousTransition] operator[SEP] identifier[date] , literal[boolean] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[tr] operator[!=] Other[null] operator[SEP] { identifier[initialRule] operator[=] Keyword[new] identifier[InitialTimeZoneRule] operator[SEP] identifier[tr] operator[SEP] identifier[getTo] operator[SEP] operator[SEP] operator[SEP] identifier[getName] operator[SEP] operator[SEP] , identifier[tr] operator[SEP] identifier[getTo] operator[SEP] operator[SEP] operator[SEP] identifier[getRawOffset] operator[SEP] operator[SEP] , identifier[tr] operator[SEP] identifier[getTo] operator[SEP] operator[SEP] operator[SEP] identifier[getDSTSavings] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { Keyword[int] operator[SEP] operator[SEP] identifier[offsets] operator[=] Keyword[new] Keyword[int] operator[SEP] Other[2] operator[SEP] operator[SEP] identifier[getOffset] operator[SEP] identifier[date] , literal[boolean] , identifier[offsets] operator[SEP] operator[SEP] identifier[initialRule] operator[=] Keyword[new] identifier[InitialTimeZoneRule] operator[SEP] identifier[getID] operator[SEP] operator[SEP] , identifier[offsets] operator[SEP] Other[0] operator[SEP] , identifier[offsets] operator[SEP] Other[1] operator[SEP] operator[SEP] operator[SEP] } } identifier[TimeZoneRule] operator[SEP] operator[SEP] identifier[result] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[annualRules] operator[==] Other[null] operator[SEP] { identifier[result] operator[=] Keyword[new] identifier[TimeZoneRule] operator[SEP] Other[1] operator[SEP] operator[SEP] identifier[result] operator[SEP] Other[0] operator[SEP] operator[=] identifier[initialRule] operator[SEP] } Keyword[else] { identifier[result] operator[=] Keyword[new] identifier[TimeZoneRule] operator[SEP] Other[3] operator[SEP] operator[SEP] identifier[result] operator[SEP] Other[0] operator[SEP] operator[=] identifier[initialRule] operator[SEP] identifier[result] operator[SEP] Other[1] operator[SEP] operator[=] identifier[annualRules] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[result] operator[SEP] Other[2] operator[SEP] operator[=] identifier[annualRules] operator[SEP] Other[1] operator[SEP] operator[SEP] } Keyword[return] identifier[result] operator[SEP] }
private void dumpRecentInvalidateSets(PrintWriter out) { int size = recentInvalidateSets.values().size(); out.println("Metasave: Blocks " + pendingDeletionBlocksCount + " waiting deletion from " + size + " datanodes."); if (size == 0) { return; } for (Map.Entry<String, LightWeightHashSet<Block>> entry : recentInvalidateSets .entrySet()) { LightWeightHashSet<Block> blocks = entry.getValue(); if (blocks.size() > 0) { out.println(datanodeMap.get(entry.getKey()).getName() + blocks); } } }
class class_name[name] begin[{] method[dumpRecentInvalidateSets, return_type[void], modifier[private], parameter[out]] begin[{] local_variable[type[int], size] call[out.println, parameter[binary_operation[binary_operation[binary_operation[binary_operation[literal["Metasave: Blocks "], +, member[.pendingDeletionBlocksCount]], +, literal[" waiting deletion from "]], +, member[.size]], +, literal[" datanodes."]]]] if[binary_operation[member[.size], ==, literal[0]]] begin[{] return[None] else begin[{] None end[}] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[], type_arguments=None), name=blocks)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Block, sub_type=None))], dimensions=[], name=LightWeightHashSet, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=blocks, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getKey, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[], type_arguments=None)], member=get, postfix_operators=[], prefix_operators=[], qualifier=datanodeMap, selectors=[MethodInvocation(arguments=[], member=getName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operandr=MemberReference(member=blocks, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], member=println, postfix_operators=[], prefix_operators=[], qualifier=out, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=entrySet, postfix_operators=[], prefix_operators=[], qualifier=recentInvalidateSets, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=entry)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Map, sub_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Block, sub_type=None))], dimensions=[], name=LightWeightHashSet, sub_type=None))], dimensions=None, name=Entry, sub_type=None)))), label=None) end[}] END[}]
Keyword[private] Keyword[void] identifier[dumpRecentInvalidateSets] operator[SEP] identifier[PrintWriter] identifier[out] operator[SEP] { Keyword[int] identifier[size] operator[=] identifier[recentInvalidateSets] operator[SEP] identifier[values] operator[SEP] operator[SEP] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] identifier[out] operator[SEP] identifier[println] operator[SEP] literal[String] operator[+] identifier[pendingDeletionBlocksCount] operator[+] literal[String] operator[+] identifier[size] operator[+] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[size] operator[==] Other[0] operator[SEP] { Keyword[return] operator[SEP] } Keyword[for] operator[SEP] identifier[Map] operator[SEP] identifier[Entry] operator[<] identifier[String] , identifier[LightWeightHashSet] operator[<] identifier[Block] operator[>] operator[>] identifier[entry] operator[:] identifier[recentInvalidateSets] operator[SEP] identifier[entrySet] operator[SEP] operator[SEP] operator[SEP] { identifier[LightWeightHashSet] operator[<] identifier[Block] operator[>] identifier[blocks] operator[=] identifier[entry] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[blocks] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[>] Other[0] operator[SEP] { identifier[out] operator[SEP] identifier[println] operator[SEP] identifier[datanodeMap] operator[SEP] identifier[get] operator[SEP] identifier[entry] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[+] identifier[blocks] operator[SEP] operator[SEP] } } }
private Icon getSelectedIcon(AbstractButton b, Icon defaultIcon) { return getIcon(b, b.getSelectedIcon(), defaultIcon, SynthConstants.SELECTED); }
class class_name[name] begin[{] method[getSelectedIcon, return_type[type[Icon]], modifier[private], parameter[b, defaultIcon]] begin[{] return[call[.getIcon, parameter[member[.b], call[b.getSelectedIcon, parameter[]], member[.defaultIcon], member[SynthConstants.SELECTED]]]] end[}] END[}]
Keyword[private] identifier[Icon] identifier[getSelectedIcon] operator[SEP] identifier[AbstractButton] identifier[b] , identifier[Icon] identifier[defaultIcon] operator[SEP] { Keyword[return] identifier[getIcon] operator[SEP] identifier[b] , identifier[b] operator[SEP] identifier[getSelectedIcon] operator[SEP] operator[SEP] , identifier[defaultIcon] , identifier[SynthConstants] operator[SEP] identifier[SELECTED] operator[SEP] operator[SEP] }
static boolean isNameStartChar(final int codePoint) { return (codePoint == ':') || (codePoint >= 'A' && codePoint <= 'Z') || (codePoint == '_') || (codePoint >= 'a' && codePoint <= 'z') || (codePoint >= 0xC0 && codePoint <= 0xD6) || (codePoint >= 0xD8 && codePoint <= 0xF6) || (codePoint >= 0xF8 && codePoint <= 0x2FF) || (codePoint >= 0x370 && codePoint <= 0x37D) || (codePoint >= 0x37F && codePoint <= 0x1FFF) || (codePoint >= 0x200C && codePoint <= 0x200D) || (codePoint >= 0x2070 && codePoint <= 0x218F) || (codePoint >= 0x2C00 && codePoint <= 0x2FEF) || (codePoint >= 0x3001 && codePoint <= 0xD7FF) || (codePoint >= 0xF900 && codePoint <= 0xFDCF) || (codePoint >= 0xFDF0 && codePoint <= 0xFFFD) || (codePoint >= 0x10000 && codePoint <= 0xEFFFF); }
class class_name[name] begin[{] method[isNameStartChar, return_type[type[boolean]], modifier[static], parameter[codePoint]] begin[{] return[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[member[.codePoint], ==, literal[':']], ||, binary_operation[binary_operation[member[.codePoint], >=, literal['A']], &&, binary_operation[member[.codePoint], <=, literal['Z']]]], ||, binary_operation[member[.codePoint], ==, literal['_']]], ||, binary_operation[binary_operation[member[.codePoint], >=, literal['a']], &&, binary_operation[member[.codePoint], <=, literal['z']]]], ||, binary_operation[binary_operation[member[.codePoint], >=, literal[0xC0]], &&, binary_operation[member[.codePoint], <=, literal[0xD6]]]], ||, binary_operation[binary_operation[member[.codePoint], >=, literal[0xD8]], &&, binary_operation[member[.codePoint], <=, literal[0xF6]]]], ||, binary_operation[binary_operation[member[.codePoint], >=, literal[0xF8]], &&, binary_operation[member[.codePoint], <=, literal[0x2FF]]]], ||, binary_operation[binary_operation[member[.codePoint], >=, literal[0x370]], &&, binary_operation[member[.codePoint], <=, literal[0x37D]]]], ||, binary_operation[binary_operation[member[.codePoint], >=, literal[0x37F]], &&, binary_operation[member[.codePoint], <=, literal[0x1FFF]]]], ||, binary_operation[binary_operation[member[.codePoint], >=, literal[0x200C]], &&, binary_operation[member[.codePoint], <=, literal[0x200D]]]], ||, binary_operation[binary_operation[member[.codePoint], >=, literal[0x2070]], &&, binary_operation[member[.codePoint], <=, literal[0x218F]]]], ||, binary_operation[binary_operation[member[.codePoint], >=, literal[0x2C00]], &&, binary_operation[member[.codePoint], <=, literal[0x2FEF]]]], ||, binary_operation[binary_operation[member[.codePoint], >=, literal[0x3001]], &&, binary_operation[member[.codePoint], <=, literal[0xD7FF]]]], ||, binary_operation[binary_operation[member[.codePoint], >=, literal[0xF900]], &&, binary_operation[member[.codePoint], <=, literal[0xFDCF]]]], ||, binary_operation[binary_operation[member[.codePoint], >=, literal[0xFDF0]], &&, binary_operation[member[.codePoint], <=, literal[0xFFFD]]]], ||, binary_operation[binary_operation[member[.codePoint], >=, literal[0x10000]], &&, binary_operation[member[.codePoint], <=, literal[0xEFFFF]]]]] end[}] END[}]
Keyword[static] Keyword[boolean] identifier[isNameStartChar] operator[SEP] Keyword[final] Keyword[int] identifier[codePoint] operator[SEP] { Keyword[return] operator[SEP] identifier[codePoint] operator[==] literal[String] operator[SEP] operator[||] operator[SEP] identifier[codePoint] operator[>=] literal[String] operator[&&] identifier[codePoint] operator[<=] literal[String] operator[SEP] operator[||] operator[SEP] identifier[codePoint] operator[==] literal[String] operator[SEP] operator[||] operator[SEP] identifier[codePoint] operator[>=] literal[String] operator[&&] identifier[codePoint] operator[<=] literal[String] operator[SEP] operator[||] operator[SEP] identifier[codePoint] operator[>=] literal[Integer] operator[&&] identifier[codePoint] operator[<=] literal[Integer] operator[SEP] operator[||] operator[SEP] identifier[codePoint] operator[>=] literal[Integer] operator[&&] identifier[codePoint] operator[<=] literal[Integer] operator[SEP] operator[||] operator[SEP] identifier[codePoint] operator[>=] literal[Integer] operator[&&] identifier[codePoint] operator[<=] literal[Integer] operator[SEP] operator[||] operator[SEP] identifier[codePoint] operator[>=] literal[Integer] operator[&&] identifier[codePoint] operator[<=] literal[Integer] operator[SEP] operator[||] operator[SEP] identifier[codePoint] operator[>=] literal[Integer] operator[&&] identifier[codePoint] operator[<=] literal[Integer] operator[SEP] operator[||] operator[SEP] identifier[codePoint] operator[>=] literal[Integer] operator[&&] identifier[codePoint] operator[<=] literal[Integer] operator[SEP] operator[||] operator[SEP] identifier[codePoint] operator[>=] literal[Integer] operator[&&] identifier[codePoint] operator[<=] literal[Integer] operator[SEP] operator[||] operator[SEP] identifier[codePoint] operator[>=] literal[Integer] operator[&&] identifier[codePoint] operator[<=] literal[Integer] operator[SEP] operator[||] operator[SEP] identifier[codePoint] operator[>=] literal[Integer] operator[&&] identifier[codePoint] operator[<=] literal[Integer] operator[SEP] operator[||] operator[SEP] identifier[codePoint] operator[>=] literal[Integer] operator[&&] identifier[codePoint] operator[<=] literal[Integer] operator[SEP] operator[||] operator[SEP] identifier[codePoint] operator[>=] literal[Integer] operator[&&] identifier[codePoint] operator[<=] literal[Integer] operator[SEP] operator[||] operator[SEP] identifier[codePoint] operator[>=] literal[Integer] operator[&&] identifier[codePoint] operator[<=] literal[Integer] operator[SEP] operator[SEP] }
public static Image findImageById( String imageId, List<Image> images ) { Image result = null; for( Image img : images ) { if( img.getId().equals(imageId)) { result = img; break; } } return result; }
class class_name[name] begin[{] method[findImageById, return_type[type[Image]], modifier[public static], parameter[imageId, images]] begin[{] local_variable[type[Image], result] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[], member=getId, postfix_operators=[], prefix_operators=[], qualifier=img, selectors=[MethodInvocation(arguments=[MemberReference(member=imageId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equals, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=result, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=img, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), BreakStatement(goto=None, label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=images, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=img)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Image, sub_type=None))), label=None) return[member[.result]] end[}] END[}]
Keyword[public] Keyword[static] identifier[Image] identifier[findImageById] operator[SEP] identifier[String] identifier[imageId] , identifier[List] operator[<] identifier[Image] operator[>] identifier[images] operator[SEP] { identifier[Image] identifier[result] operator[=] Other[null] operator[SEP] Keyword[for] operator[SEP] identifier[Image] identifier[img] operator[:] identifier[images] operator[SEP] { Keyword[if] operator[SEP] identifier[img] operator[SEP] identifier[getId] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[imageId] operator[SEP] operator[SEP] { identifier[result] operator[=] identifier[img] operator[SEP] Keyword[break] operator[SEP] } } Keyword[return] identifier[result] operator[SEP] }
protected <T extends Controller> /*HttpBuilder*/void redirect(Class<T> controllerClass, Map<String, String> params){ String controllerPath = RouterHelper.getReverseRouteFast(controllerClass); String contextPath = context.contextPath(); String action = params.get("action") != null? params.get("action") : null; String id = params.get("id") != null? params.get("id") : null; params.remove("action"); params.remove("id");//TODO make a damn class to hold "action", "id", etc so we can have some type safety //MTD // String lang = language() != null ? "/" + language() : ""; String anchor = params.get("#") != null ? "#" + params.get("#") : ""; params.remove("#"); String uri = contextPath +/*injector .getInstance(DeploymentInfo.class) .translateIntoContextPath(*//*+ lang + */RouterHelper.generate(controllerPath, action, id, params) + anchor/*)*/; redirect(uri); }
class class_name[name] begin[{] method[redirect, return_type[void], modifier[protected], parameter[controllerClass, params]] begin[{] local_variable[type[String], controllerPath] local_variable[type[String], contextPath] local_variable[type[String], action] local_variable[type[String], id] call[params.remove, parameter[literal["action"]]] call[params.remove, parameter[literal["id"]]] local_variable[type[String], anchor] call[params.remove, parameter[literal["#"]]] local_variable[type[String], uri] call[.redirect, parameter[member[.uri]]] end[}] END[}]
Keyword[protected] operator[<] identifier[T] Keyword[extends] identifier[Controller] operator[>] Keyword[void] identifier[redirect] operator[SEP] identifier[Class] operator[<] identifier[T] operator[>] identifier[controllerClass] , identifier[Map] operator[<] identifier[String] , identifier[String] operator[>] identifier[params] operator[SEP] { identifier[String] identifier[controllerPath] operator[=] identifier[RouterHelper] operator[SEP] identifier[getReverseRouteFast] operator[SEP] identifier[controllerClass] operator[SEP] operator[SEP] identifier[String] identifier[contextPath] operator[=] identifier[context] operator[SEP] identifier[contextPath] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[action] operator[=] identifier[params] operator[SEP] identifier[get] operator[SEP] literal[String] operator[SEP] operator[!=] Other[null] operator[?] identifier[params] operator[SEP] identifier[get] operator[SEP] literal[String] operator[SEP] operator[:] Other[null] operator[SEP] identifier[String] identifier[id] operator[=] identifier[params] operator[SEP] identifier[get] operator[SEP] literal[String] operator[SEP] operator[!=] Other[null] operator[?] identifier[params] operator[SEP] identifier[get] operator[SEP] literal[String] operator[SEP] operator[:] Other[null] operator[SEP] identifier[params] operator[SEP] identifier[remove] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[params] operator[SEP] identifier[remove] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[String] identifier[anchor] operator[=] identifier[params] operator[SEP] identifier[get] operator[SEP] literal[String] operator[SEP] operator[!=] Other[null] operator[?] literal[String] operator[+] identifier[params] operator[SEP] identifier[get] operator[SEP] literal[String] operator[SEP] operator[:] literal[String] operator[SEP] identifier[params] operator[SEP] identifier[remove] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[String] identifier[uri] operator[=] identifier[contextPath] operator[+] identifier[RouterHelper] operator[SEP] identifier[generate] operator[SEP] identifier[controllerPath] , identifier[action] , identifier[id] , identifier[params] operator[SEP] operator[+] identifier[anchor] operator[SEP] identifier[redirect] operator[SEP] identifier[uri] operator[SEP] operator[SEP] }
private static long getNextPageOffset(final int offset, final int limit, final long total) { return hasFullNextPage(offset, limit, total) ? getNextFullPageOffset(offset, limit) : getLastPageOffset(total, limit); }
class class_name[name] begin[{] method[getNextPageOffset, return_type[type[long]], modifier[private static], parameter[offset, limit, total]] begin[{] return[TernaryExpression(condition=MethodInvocation(arguments=[MemberReference(member=offset, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=limit, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=total, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=hasFullNextPage, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), if_false=MethodInvocation(arguments=[MemberReference(member=total, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=limit, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getLastPageOffset, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), if_true=MethodInvocation(arguments=[MemberReference(member=offset, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=limit, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getNextFullPageOffset, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None))] end[}] END[}]
Keyword[private] Keyword[static] Keyword[long] identifier[getNextPageOffset] operator[SEP] Keyword[final] Keyword[int] identifier[offset] , Keyword[final] Keyword[int] identifier[limit] , Keyword[final] Keyword[long] identifier[total] operator[SEP] { Keyword[return] identifier[hasFullNextPage] operator[SEP] identifier[offset] , identifier[limit] , identifier[total] operator[SEP] operator[?] identifier[getNextFullPageOffset] operator[SEP] identifier[offset] , identifier[limit] operator[SEP] operator[:] identifier[getLastPageOffset] operator[SEP] identifier[total] , identifier[limit] operator[SEP] operator[SEP] }
private void checkMemoryRequirements(JobInProgress job) throws IOException { if (!perTaskMemoryConfigurationSetOnJT()) { LOG.debug("Per-Task memory configuration is not set on JT. " + "Not checking the job for invalid memory requirements."); return; } boolean invalidJob = false; String msg = ""; long maxMemForMapTask = job.getMemoryForMapTask(); long maxMemForReduceTask = job.getMemoryForReduceTask(); if (maxMemForMapTask == JobConf.DISABLED_MEMORY_LIMIT || maxMemForReduceTask == JobConf.DISABLED_MEMORY_LIMIT) { invalidJob = true; msg = "Invalid job requirements."; } if (maxMemForMapTask > limitMaxMemForMapTasks || maxMemForReduceTask > limitMaxMemForReduceTasks) { invalidJob = true; msg = "Exceeds the cluster's max-memory-limit."; } if (invalidJob) { StringBuilder jobStr = new StringBuilder().append(job.getJobID().toString()).append("(") .append(maxMemForMapTask).append(" memForMapTasks ").append( maxMemForReduceTask).append(" memForReduceTasks): "); LOG.warn(jobStr.toString() + msg); throw new IOException(jobStr.toString() + msg); } }
class class_name[name] begin[{] method[checkMemoryRequirements, return_type[void], modifier[private], parameter[job]] begin[{] if[call[.perTaskMemoryConfigurationSetOnJT, parameter[]]] begin[{] call[LOG.debug, parameter[binary_operation[literal["Per-Task memory configuration is not set on JT. "], +, literal["Not checking the job for invalid memory requirements."]]]] return[None] else begin[{] None end[}] local_variable[type[boolean], invalidJob] local_variable[type[String], msg] local_variable[type[long], maxMemForMapTask] local_variable[type[long], maxMemForReduceTask] if[binary_operation[binary_operation[member[.maxMemForMapTask], ==, member[JobConf.DISABLED_MEMORY_LIMIT]], ||, binary_operation[member[.maxMemForReduceTask], ==, member[JobConf.DISABLED_MEMORY_LIMIT]]]] begin[{] assign[member[.invalidJob], literal[true]] assign[member[.msg], literal["Invalid job requirements."]] else begin[{] None end[}] if[binary_operation[binary_operation[member[.maxMemForMapTask], >, member[.limitMaxMemForMapTasks]], ||, binary_operation[member[.maxMemForReduceTask], >, member[.limitMaxMemForReduceTasks]]]] begin[{] assign[member[.invalidJob], literal[true]] assign[member[.msg], literal["Exceeds the cluster's max-memory-limit."]] else begin[{] None end[}] if[member[.invalidJob]] begin[{] local_variable[type[StringBuilder], jobStr] call[LOG.warn, parameter[binary_operation[call[jobStr.toString, parameter[]], +, member[.msg]]]] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=jobStr, selectors=[], type_arguments=None), operandr=MemberReference(member=msg, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IOException, sub_type=None)), label=None) else begin[{] None end[}] end[}] END[}]
Keyword[private] Keyword[void] identifier[checkMemoryRequirements] operator[SEP] identifier[JobInProgress] identifier[job] operator[SEP] Keyword[throws] identifier[IOException] { Keyword[if] operator[SEP] operator[!] identifier[perTaskMemoryConfigurationSetOnJT] operator[SEP] operator[SEP] operator[SEP] { identifier[LOG] operator[SEP] identifier[debug] operator[SEP] literal[String] operator[+] literal[String] operator[SEP] operator[SEP] Keyword[return] operator[SEP] } Keyword[boolean] identifier[invalidJob] operator[=] literal[boolean] operator[SEP] identifier[String] identifier[msg] operator[=] literal[String] operator[SEP] Keyword[long] identifier[maxMemForMapTask] operator[=] identifier[job] operator[SEP] identifier[getMemoryForMapTask] operator[SEP] operator[SEP] operator[SEP] Keyword[long] identifier[maxMemForReduceTask] operator[=] identifier[job] operator[SEP] identifier[getMemoryForReduceTask] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[maxMemForMapTask] operator[==] identifier[JobConf] operator[SEP] identifier[DISABLED_MEMORY_LIMIT] operator[||] identifier[maxMemForReduceTask] operator[==] identifier[JobConf] operator[SEP] identifier[DISABLED_MEMORY_LIMIT] operator[SEP] { identifier[invalidJob] operator[=] literal[boolean] operator[SEP] identifier[msg] operator[=] literal[String] operator[SEP] } Keyword[if] operator[SEP] identifier[maxMemForMapTask] operator[>] identifier[limitMaxMemForMapTasks] operator[||] identifier[maxMemForReduceTask] operator[>] identifier[limitMaxMemForReduceTasks] operator[SEP] { identifier[invalidJob] operator[=] literal[boolean] operator[SEP] identifier[msg] operator[=] literal[String] operator[SEP] } Keyword[if] operator[SEP] identifier[invalidJob] operator[SEP] { identifier[StringBuilder] identifier[jobStr] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[job] operator[SEP] identifier[getJobID] operator[SEP] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[maxMemForMapTask] operator[SEP] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[maxMemForReduceTask] operator[SEP] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[LOG] operator[SEP] identifier[warn] operator[SEP] identifier[jobStr] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[+] identifier[msg] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[IOException] operator[SEP] identifier[jobStr] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[+] identifier[msg] operator[SEP] operator[SEP] } }
public void write(byte[] arr, int off, int len) throws IOException { if (len > buf.length - pos) { if (buf.length != getMaxPacketLength()) { growBuffer(len); } //max buffer size if (len > buf.length - pos) { if (mark != -1) { growBuffer(len); if (mark != -1) { flushBufferStopAtMark(); } } else { //not enough space in buffer, will stream : // fill buffer and flush until all data are snd int remainingLen = len; do { int lenToFillBuffer = Math.min(getMaxPacketLength() - pos, remainingLen); System.arraycopy(arr, off, buf, pos, lenToFillBuffer); remainingLen -= lenToFillBuffer; off += lenToFillBuffer; pos += lenToFillBuffer; if (remainingLen > 0) { flushBuffer(false); } else { break; } } while (true); return; } } } System.arraycopy(arr, off, buf, pos, len); pos += len; }
class class_name[name] begin[{] method[write, return_type[void], modifier[public], parameter[arr, off, len]] begin[{] if[binary_operation[member[.len], >, binary_operation[member[buf.length], -, member[.pos]]]] begin[{] if[binary_operation[member[buf.length], !=, call[.getMaxPacketLength, parameter[]]]] begin[{] call[.growBuffer, parameter[member[.len]]] else begin[{] None end[}] if[binary_operation[member[.len], >, binary_operation[member[buf.length], -, member[.pos]]]] begin[{] if[binary_operation[member[.mark], !=, literal[1]]] begin[{] call[.growBuffer, parameter[member[.len]]] if[binary_operation[member[.mark], !=, literal[1]]] begin[{] call[.flushBufferStopAtMark, parameter[]] else begin[{] None end[}] else begin[{] local_variable[type[int], remainingLen] do[literal[true]] begin[{] local_variable[type[int], lenToFillBuffer] call[System.arraycopy, parameter[member[.arr], member[.off], member[.buf], member[.pos], member[.lenToFillBuffer]]] assign[member[.remainingLen], member[.lenToFillBuffer]] assign[member[.off], member[.lenToFillBuffer]] assign[member[.pos], member[.lenToFillBuffer]] if[binary_operation[member[.remainingLen], >, literal[0]]] begin[{] call[.flushBuffer, parameter[literal[false]]] else begin[{] BreakStatement(goto=None, label=None) end[}] end[}] return[None] end[}] else begin[{] None end[}] else begin[{] None end[}] call[System.arraycopy, parameter[member[.arr], member[.off], member[.buf], member[.pos], member[.len]]] assign[member[.pos], member[.len]] end[}] END[}]
Keyword[public] Keyword[void] identifier[write] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] identifier[arr] , Keyword[int] identifier[off] , Keyword[int] identifier[len] operator[SEP] Keyword[throws] identifier[IOException] { Keyword[if] operator[SEP] identifier[len] operator[>] identifier[buf] operator[SEP] identifier[length] operator[-] identifier[pos] operator[SEP] { Keyword[if] operator[SEP] identifier[buf] operator[SEP] identifier[length] operator[!=] identifier[getMaxPacketLength] operator[SEP] operator[SEP] operator[SEP] { identifier[growBuffer] operator[SEP] identifier[len] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[len] operator[>] identifier[buf] operator[SEP] identifier[length] operator[-] identifier[pos] operator[SEP] { Keyword[if] operator[SEP] identifier[mark] operator[!=] operator[-] Other[1] operator[SEP] { identifier[growBuffer] operator[SEP] identifier[len] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[mark] operator[!=] operator[-] Other[1] operator[SEP] { identifier[flushBufferStopAtMark] operator[SEP] operator[SEP] operator[SEP] } } Keyword[else] { Keyword[int] identifier[remainingLen] operator[=] identifier[len] operator[SEP] Keyword[do] { Keyword[int] identifier[lenToFillBuffer] operator[=] identifier[Math] operator[SEP] identifier[min] operator[SEP] identifier[getMaxPacketLength] operator[SEP] operator[SEP] operator[-] identifier[pos] , identifier[remainingLen] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[arraycopy] operator[SEP] identifier[arr] , identifier[off] , identifier[buf] , identifier[pos] , identifier[lenToFillBuffer] operator[SEP] operator[SEP] identifier[remainingLen] operator[-=] identifier[lenToFillBuffer] operator[SEP] identifier[off] operator[+=] identifier[lenToFillBuffer] operator[SEP] identifier[pos] operator[+=] identifier[lenToFillBuffer] operator[SEP] Keyword[if] operator[SEP] identifier[remainingLen] operator[>] Other[0] operator[SEP] { identifier[flushBuffer] operator[SEP] literal[boolean] operator[SEP] operator[SEP] } Keyword[else] { Keyword[break] operator[SEP] } } Keyword[while] operator[SEP] literal[boolean] operator[SEP] operator[SEP] Keyword[return] operator[SEP] } } } identifier[System] operator[SEP] identifier[arraycopy] operator[SEP] identifier[arr] , identifier[off] , identifier[buf] , identifier[pos] , identifier[len] operator[SEP] operator[SEP] identifier[pos] operator[+=] identifier[len] operator[SEP] }
public static MultifactorAuthenticationTrustRecord newInstance(final String principal, final String geography, final String fingerprint) { val r = new MultifactorAuthenticationTrustRecord(); r.setRecordDate(LocalDateTime.now().truncatedTo(ChronoUnit.SECONDS)); r.setPrincipal(principal); r.setDeviceFingerprint(fingerprint); r.setName(principal.concat("-").concat(LocalDate.now().toString()).concat("-").concat(geography)); return r; }
class class_name[name] begin[{] method[newInstance, return_type[type[MultifactorAuthenticationTrustRecord]], modifier[public static], parameter[principal, geography, fingerprint]] begin[{] local_variable[type[val], r] call[r.setRecordDate, parameter[call[LocalDateTime.now, parameter[]]]] call[r.setPrincipal, parameter[member[.principal]]] call[r.setDeviceFingerprint, parameter[member[.fingerprint]]] call[r.setName, parameter[call[principal.concat, parameter[literal["-"]]]]] return[member[.r]] end[}] END[}]
Keyword[public] Keyword[static] identifier[MultifactorAuthenticationTrustRecord] identifier[newInstance] operator[SEP] Keyword[final] identifier[String] identifier[principal] , Keyword[final] identifier[String] identifier[geography] , Keyword[final] identifier[String] identifier[fingerprint] operator[SEP] { identifier[val] identifier[r] operator[=] Keyword[new] identifier[MultifactorAuthenticationTrustRecord] operator[SEP] operator[SEP] operator[SEP] identifier[r] operator[SEP] identifier[setRecordDate] operator[SEP] identifier[LocalDateTime] operator[SEP] identifier[now] operator[SEP] operator[SEP] operator[SEP] identifier[truncatedTo] operator[SEP] identifier[ChronoUnit] operator[SEP] identifier[SECONDS] operator[SEP] operator[SEP] operator[SEP] identifier[r] operator[SEP] identifier[setPrincipal] operator[SEP] identifier[principal] operator[SEP] operator[SEP] identifier[r] operator[SEP] identifier[setDeviceFingerprint] operator[SEP] identifier[fingerprint] operator[SEP] operator[SEP] identifier[r] operator[SEP] identifier[setName] operator[SEP] identifier[principal] operator[SEP] identifier[concat] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[concat] operator[SEP] identifier[LocalDate] operator[SEP] identifier[now] operator[SEP] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[concat] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[concat] operator[SEP] identifier[geography] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[r] operator[SEP] }
@XmlElementDecl(namespace = "http://www.opengis.net/citygml/vegetation/1.0", name = "SolitaryVegetationObject", substitutionHeadNamespace = "http://www.opengis.net/citygml/vegetation/1.0", substitutionHeadName = "_VegetationObject") public JAXBElement<SolitaryVegetationObjectType> createSolitaryVegetationObject(SolitaryVegetationObjectType value) { return new JAXBElement<SolitaryVegetationObjectType>(_SolitaryVegetationObject_QNAME, SolitaryVegetationObjectType.class, null, value); }
class class_name[name] begin[{] method[createSolitaryVegetationObject, return_type[type[JAXBElement]], modifier[public], parameter[value]] begin[{] return[ClassCreator(arguments=[MemberReference(member=_SolitaryVegetationObject_QNAME, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=SolitaryVegetationObjectType, sub_type=None)), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=SolitaryVegetationObjectType, sub_type=None))], dimensions=None, name=JAXBElement, sub_type=None))] end[}] END[}]
annotation[@] identifier[XmlElementDecl] operator[SEP] identifier[namespace] operator[=] literal[String] , identifier[name] operator[=] literal[String] , identifier[substitutionHeadNamespace] operator[=] literal[String] , identifier[substitutionHeadName] operator[=] literal[String] operator[SEP] Keyword[public] identifier[JAXBElement] operator[<] identifier[SolitaryVegetationObjectType] operator[>] identifier[createSolitaryVegetationObject] operator[SEP] identifier[SolitaryVegetationObjectType] identifier[value] operator[SEP] { Keyword[return] Keyword[new] identifier[JAXBElement] operator[<] identifier[SolitaryVegetationObjectType] operator[>] operator[SEP] identifier[_SolitaryVegetationObject_QNAME] , identifier[SolitaryVegetationObjectType] operator[SEP] Keyword[class] , Other[null] , identifier[value] operator[SEP] operator[SEP] }
public void parameterizeChannel(Channel channel, boolean globalDopChange, ExecutionMode exchangeMode, boolean breakPipeline) { // safety check. Fully replicated input must be preserved. if (channel.getSource().getGlobalProperties().isFullyReplicated() && !(this.partitioning == PartitioningProperty.FULL_REPLICATION || this.partitioning == PartitioningProperty.ANY_DISTRIBUTION)) { throw new CompilerException("Fully replicated input must be preserved " + "and may not be converted into another global property."); } // if we request nothing, then we need no special strategy. forward, if the number of instances remains // the same, randomly repartition otherwise if (isTrivial() || this.partitioning == PartitioningProperty.ANY_DISTRIBUTION) { ShipStrategyType shipStrategy = globalDopChange ? ShipStrategyType.PARTITION_RANDOM : ShipStrategyType.FORWARD; DataExchangeMode em = DataExchangeMode.select(exchangeMode, shipStrategy, breakPipeline); channel.setShipStrategy(shipStrategy, em); return; } final GlobalProperties inGlobals = channel.getSource().getGlobalProperties(); // if we have no global parallelism change, check if we have already compatible global properties if (!globalDopChange && isMetBy(inGlobals)) { DataExchangeMode em = DataExchangeMode.select(exchangeMode, ShipStrategyType.FORWARD, breakPipeline); channel.setShipStrategy(ShipStrategyType.FORWARD, em); return; } // if we fall through the conditions until here, we need to re-establish ShipStrategyType shipType; FieldList partitionKeys; boolean[] sortDirection; Partitioner<?> partitioner; switch (this.partitioning) { case FULL_REPLICATION: shipType = ShipStrategyType.BROADCAST; partitionKeys = null; sortDirection = null; partitioner = null; break; case ANY_PARTITIONING: case HASH_PARTITIONED: shipType = ShipStrategyType.PARTITION_HASH; partitionKeys = Utils.createOrderedFromSet(this.partitioningFields); sortDirection = null; partitioner = null; break; case RANGE_PARTITIONED: shipType = ShipStrategyType.PARTITION_RANGE; partitionKeys = this.ordering.getInvolvedIndexes(); sortDirection = this.ordering.getFieldSortDirections(); partitioner = null; if (this.dataDistribution != null) { channel.setDataDistribution(this.dataDistribution); } break; case FORCED_REBALANCED: shipType = ShipStrategyType.PARTITION_FORCED_REBALANCE; partitionKeys = null; sortDirection = null; partitioner = null; break; case CUSTOM_PARTITIONING: shipType = ShipStrategyType.PARTITION_CUSTOM; partitionKeys = Utils.createOrderedFromSet(this.partitioningFields); sortDirection = null; partitioner = this.customPartitioner; break; default: throw new CompilerException("Invalid partitioning to create through a data exchange: " + this.partitioning.name()); } DataExchangeMode exMode = DataExchangeMode.select(exchangeMode, shipType, breakPipeline); channel.setShipStrategy(shipType, partitionKeys, sortDirection, partitioner, exMode); }
class class_name[name] begin[{] method[parameterizeChannel, return_type[void], modifier[public], parameter[channel, globalDopChange, exchangeMode, breakPipeline]] begin[{] if[binary_operation[call[channel.getSource, parameter[]], &&, binary_operation[binary_operation[THIS[member[None.partitioning]], ==, member[PartitioningProperty.FULL_REPLICATION]], ||, binary_operation[THIS[member[None.partitioning]], ==, member[PartitioningProperty.ANY_DISTRIBUTION]]]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Fully replicated input must be preserved "), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="and may not be converted into another global property."), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=CompilerException, sub_type=None)), label=None) else begin[{] None end[}] if[binary_operation[call[.isTrivial, parameter[]], ||, binary_operation[THIS[member[None.partitioning]], ==, member[PartitioningProperty.ANY_DISTRIBUTION]]]] begin[{] local_variable[type[ShipStrategyType], shipStrategy] local_variable[type[DataExchangeMode], em] call[channel.setShipStrategy, parameter[member[.shipStrategy], member[.em]]] return[None] else begin[{] None end[}] local_variable[type[GlobalProperties], inGlobals] if[binary_operation[member[.globalDopChange], &&, call[.isMetBy, parameter[member[.inGlobals]]]]] begin[{] local_variable[type[DataExchangeMode], em] call[channel.setShipStrategy, parameter[member[ShipStrategyType.FORWARD], member[.em]]] return[None] else begin[{] None end[}] local_variable[type[ShipStrategyType], shipType] local_variable[type[FieldList], partitionKeys] local_variable[type[boolean], sortDirection] local_variable[type[Partitioner], partitioner] SwitchStatement(cases=[SwitchStatementCase(case=['FULL_REPLICATION'], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=shipType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=BROADCAST, postfix_operators=[], prefix_operators=[], qualifier=ShipStrategyType, selectors=[])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=partitionKeys, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=sortDirection, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=partitioner, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=['ANY_PARTITIONING', 'HASH_PARTITIONED'], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=shipType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=PARTITION_HASH, postfix_operators=[], prefix_operators=[], qualifier=ShipStrategyType, selectors=[])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=partitionKeys, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=partitioningFields, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)])], member=createOrderedFromSet, postfix_operators=[], prefix_operators=[], qualifier=Utils, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=sortDirection, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=partitioner, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=['RANGE_PARTITIONED'], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=shipType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=PARTITION_RANGE, postfix_operators=[], prefix_operators=[], qualifier=ShipStrategyType, selectors=[])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=partitionKeys, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=ordering, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[], member=getInvolvedIndexes, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=sortDirection, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=ordering, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[], member=getFieldSortDirections, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=partitioner, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)), label=None), IfStatement(condition=BinaryOperation(operandl=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=dataDistribution, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=dataDistribution, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)])], member=setDataDistribution, postfix_operators=[], prefix_operators=[], qualifier=channel, selectors=[], type_arguments=None), label=None)])), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=['FORCED_REBALANCED'], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=shipType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=PARTITION_FORCED_REBALANCE, postfix_operators=[], prefix_operators=[], qualifier=ShipStrategyType, selectors=[])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=partitionKeys, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=sortDirection, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=partitioner, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=['CUSTOM_PARTITIONING'], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=shipType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=PARTITION_CUSTOM, postfix_operators=[], prefix_operators=[], qualifier=ShipStrategyType, selectors=[])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=partitionKeys, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=partitioningFields, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)])], member=createOrderedFromSet, postfix_operators=[], prefix_operators=[], qualifier=Utils, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=sortDirection, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=partitioner, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=customPartitioner, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)])), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[], statements=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Invalid partitioning to create through a data exchange: "), operandr=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=partitioning, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[], member=name, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=CompilerException, sub_type=None)), label=None)])], expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=partitioning, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), label=None) local_variable[type[DataExchangeMode], exMode] call[channel.setShipStrategy, parameter[member[.shipType], member[.partitionKeys], member[.sortDirection], member[.partitioner], member[.exMode]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[parameterizeChannel] operator[SEP] identifier[Channel] identifier[channel] , Keyword[boolean] identifier[globalDopChange] , identifier[ExecutionMode] identifier[exchangeMode] , Keyword[boolean] identifier[breakPipeline] operator[SEP] { Keyword[if] operator[SEP] identifier[channel] operator[SEP] identifier[getSource] operator[SEP] operator[SEP] operator[SEP] identifier[getGlobalProperties] operator[SEP] operator[SEP] operator[SEP] identifier[isFullyReplicated] operator[SEP] operator[SEP] operator[&&] operator[!] operator[SEP] Keyword[this] operator[SEP] identifier[partitioning] operator[==] identifier[PartitioningProperty] operator[SEP] identifier[FULL_REPLICATION] operator[||] Keyword[this] operator[SEP] identifier[partitioning] operator[==] identifier[PartitioningProperty] operator[SEP] identifier[ANY_DISTRIBUTION] operator[SEP] operator[SEP] { Keyword[throw] Keyword[new] identifier[CompilerException] operator[SEP] literal[String] operator[+] literal[String] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[isTrivial] operator[SEP] operator[SEP] operator[||] Keyword[this] operator[SEP] identifier[partitioning] operator[==] identifier[PartitioningProperty] operator[SEP] identifier[ANY_DISTRIBUTION] operator[SEP] { identifier[ShipStrategyType] identifier[shipStrategy] operator[=] identifier[globalDopChange] operator[?] identifier[ShipStrategyType] operator[SEP] identifier[PARTITION_RANDOM] operator[:] identifier[ShipStrategyType] operator[SEP] identifier[FORWARD] operator[SEP] identifier[DataExchangeMode] identifier[em] operator[=] identifier[DataExchangeMode] operator[SEP] identifier[select] operator[SEP] identifier[exchangeMode] , identifier[shipStrategy] , identifier[breakPipeline] operator[SEP] operator[SEP] identifier[channel] operator[SEP] identifier[setShipStrategy] operator[SEP] identifier[shipStrategy] , identifier[em] operator[SEP] operator[SEP] Keyword[return] operator[SEP] } Keyword[final] identifier[GlobalProperties] identifier[inGlobals] operator[=] identifier[channel] operator[SEP] identifier[getSource] operator[SEP] operator[SEP] operator[SEP] identifier[getGlobalProperties] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[globalDopChange] operator[&&] identifier[isMetBy] operator[SEP] identifier[inGlobals] operator[SEP] operator[SEP] { identifier[DataExchangeMode] identifier[em] operator[=] identifier[DataExchangeMode] operator[SEP] identifier[select] operator[SEP] identifier[exchangeMode] , identifier[ShipStrategyType] operator[SEP] identifier[FORWARD] , identifier[breakPipeline] operator[SEP] operator[SEP] identifier[channel] operator[SEP] identifier[setShipStrategy] operator[SEP] identifier[ShipStrategyType] operator[SEP] identifier[FORWARD] , identifier[em] operator[SEP] operator[SEP] Keyword[return] operator[SEP] } identifier[ShipStrategyType] identifier[shipType] operator[SEP] identifier[FieldList] identifier[partitionKeys] operator[SEP] Keyword[boolean] operator[SEP] operator[SEP] identifier[sortDirection] operator[SEP] identifier[Partitioner] operator[<] operator[?] operator[>] identifier[partitioner] operator[SEP] Keyword[switch] operator[SEP] Keyword[this] operator[SEP] identifier[partitioning] operator[SEP] { Keyword[case] identifier[FULL_REPLICATION] operator[:] identifier[shipType] operator[=] identifier[ShipStrategyType] operator[SEP] identifier[BROADCAST] operator[SEP] identifier[partitionKeys] operator[=] Other[null] operator[SEP] identifier[sortDirection] operator[=] Other[null] operator[SEP] identifier[partitioner] operator[=] Other[null] operator[SEP] Keyword[break] operator[SEP] Keyword[case] identifier[ANY_PARTITIONING] operator[:] Keyword[case] identifier[HASH_PARTITIONED] operator[:] identifier[shipType] operator[=] identifier[ShipStrategyType] operator[SEP] identifier[PARTITION_HASH] operator[SEP] identifier[partitionKeys] operator[=] identifier[Utils] operator[SEP] identifier[createOrderedFromSet] operator[SEP] Keyword[this] operator[SEP] identifier[partitioningFields] operator[SEP] operator[SEP] identifier[sortDirection] operator[=] Other[null] operator[SEP] identifier[partitioner] operator[=] Other[null] operator[SEP] Keyword[break] operator[SEP] Keyword[case] identifier[RANGE_PARTITIONED] operator[:] identifier[shipType] operator[=] identifier[ShipStrategyType] operator[SEP] identifier[PARTITION_RANGE] operator[SEP] identifier[partitionKeys] operator[=] Keyword[this] operator[SEP] identifier[ordering] operator[SEP] identifier[getInvolvedIndexes] operator[SEP] operator[SEP] operator[SEP] identifier[sortDirection] operator[=] Keyword[this] operator[SEP] identifier[ordering] operator[SEP] identifier[getFieldSortDirections] operator[SEP] operator[SEP] operator[SEP] identifier[partitioner] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[dataDistribution] operator[!=] Other[null] operator[SEP] { identifier[channel] operator[SEP] identifier[setDataDistribution] operator[SEP] Keyword[this] operator[SEP] identifier[dataDistribution] operator[SEP] operator[SEP] } Keyword[break] operator[SEP] Keyword[case] identifier[FORCED_REBALANCED] operator[:] identifier[shipType] operator[=] identifier[ShipStrategyType] operator[SEP] identifier[PARTITION_FORCED_REBALANCE] operator[SEP] identifier[partitionKeys] operator[=] Other[null] operator[SEP] identifier[sortDirection] operator[=] Other[null] operator[SEP] identifier[partitioner] operator[=] Other[null] operator[SEP] Keyword[break] operator[SEP] Keyword[case] identifier[CUSTOM_PARTITIONING] operator[:] identifier[shipType] operator[=] identifier[ShipStrategyType] operator[SEP] identifier[PARTITION_CUSTOM] operator[SEP] identifier[partitionKeys] operator[=] identifier[Utils] operator[SEP] identifier[createOrderedFromSet] operator[SEP] Keyword[this] operator[SEP] identifier[partitioningFields] operator[SEP] operator[SEP] identifier[sortDirection] operator[=] Other[null] operator[SEP] identifier[partitioner] operator[=] Keyword[this] operator[SEP] identifier[customPartitioner] operator[SEP] Keyword[break] operator[SEP] Keyword[default] operator[:] Keyword[throw] Keyword[new] identifier[CompilerException] operator[SEP] literal[String] operator[+] Keyword[this] operator[SEP] identifier[partitioning] operator[SEP] identifier[name] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } identifier[DataExchangeMode] identifier[exMode] operator[=] identifier[DataExchangeMode] operator[SEP] identifier[select] operator[SEP] identifier[exchangeMode] , identifier[shipType] , identifier[breakPipeline] operator[SEP] operator[SEP] identifier[channel] operator[SEP] identifier[setShipStrategy] operator[SEP] identifier[shipType] , identifier[partitionKeys] , identifier[sortDirection] , identifier[partitioner] , identifier[exMode] operator[SEP] operator[SEP] }
public static KieServerControllerClient newRestClient(final String controllerUrl, final String login, final String password) { return new RestKieServerControllerClient(controllerUrl, login, password); }
class class_name[name] begin[{] method[newRestClient, return_type[type[KieServerControllerClient]], modifier[public static], parameter[controllerUrl, login, password]] begin[{] return[ClassCreator(arguments=[MemberReference(member=controllerUrl, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=login, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=password, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=RestKieServerControllerClient, sub_type=None))] end[}] END[}]
Keyword[public] Keyword[static] identifier[KieServerControllerClient] identifier[newRestClient] operator[SEP] Keyword[final] identifier[String] identifier[controllerUrl] , Keyword[final] identifier[String] identifier[login] , Keyword[final] identifier[String] identifier[password] operator[SEP] { Keyword[return] Keyword[new] identifier[RestKieServerControllerClient] operator[SEP] identifier[controllerUrl] , identifier[login] , identifier[password] operator[SEP] operator[SEP] }
private void zSetAllColumnEditorsAndRenderers(JTable table) { // These variables decide how many samples to look at in each column. int maxStartRowsToRead = 30; int maxBulkRowsToRead = 70; int maxFoundSamplesToExamine = 21; // Gather some variables that we will need.. TableModel model = table.getModel(); int columnCount = model.getColumnCount(); int rowCount = model.getRowCount(); // Do nothing if the table is empty. if (columnCount < 1 || rowCount < 1) { return; } // Calculate the increment for looping through the bulk rows. int bulkRowIncrement = Math.max(1, (rowCount / maxBulkRowsToRead)); // Loop through all the columns. columnLoop: for (int columnIndex = 0; columnIndex < columnCount; ++columnIndex) { TableColumn column = table.getColumnModel().getColumn(columnIndex); ArrayList<Class> nonNullTypes = new ArrayList<Class>(); // Loop through all the rows that should be sampled. rowLoop: for (int rowIndex = 0; (rowIndex < rowCount); rowIndex += ((rowIndex < maxStartRowsToRead) ? 1 : bulkRowIncrement)) { // Get the value in each row. Object value = model.getValueAt(rowIndex, columnIndex); if (value == null) { continue; } // Save any found non-null types. nonNullTypes.add(value.getClass()); // If we have already found "maxFoundSamplesToExamine" types, then use those // samples to determine the column type. if (nonNullTypes.size() >= maxFoundSamplesToExamine) { Class mostCommonType = InternalUtilities.getMostCommonElementInList(nonNullTypes); column.setCellRenderer(table.getDefaultRenderer(mostCommonType)); column.setCellEditor(table.getDefaultEditor(mostCommonType)); continue columnLoop; } } // End: rowLoop // There are no more rows to examine. // If we found any non-null types at all, then use those to choose the column type. if (nonNullTypes.size() > 0) { Class mostCommonType = InternalUtilities.getMostCommonElementInList(nonNullTypes); column.setCellRenderer(table.getDefaultRenderer(mostCommonType)); column.setCellEditor(table.getDefaultEditor(mostCommonType)); } else { // When no types are found in a column, we will use the generic editor. column.setCellRenderer(table.getDefaultRenderer(Object.class)); column.setCellEditor(table.getDefaultEditor(Object.class)); } } // End: columnLoop }
class class_name[name] begin[{] method[zSetAllColumnEditorsAndRenderers, return_type[void], modifier[private], parameter[table]] begin[{] local_variable[type[int], maxStartRowsToRead] local_variable[type[int], maxBulkRowsToRead] local_variable[type[int], maxFoundSamplesToExamine] local_variable[type[TableModel], model] local_variable[type[int], columnCount] local_variable[type[int], rowCount] if[binary_operation[binary_operation[member[.columnCount], <, literal[1]], ||, binary_operation[member[.rowCount], <, literal[1]]]] begin[{] return[None] else begin[{] None end[}] local_variable[type[int], bulkRowIncrement] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getColumnModel, postfix_operators=[], prefix_operators=[], qualifier=table, selectors=[MethodInvocation(arguments=[MemberReference(member=columnIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getColumn, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=column)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=TableColumn, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Class, sub_type=None))], dimensions=None, name=ArrayList, sub_type=None)), name=nonNullTypes)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Class, sub_type=None))], dimensions=[], name=ArrayList, sub_type=None)), ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=rowIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=columnIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getValueAt, postfix_operators=[], prefix_operators=[], qualifier=model, selectors=[], type_arguments=None), name=value)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ContinueStatement(goto=None, label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getClass, postfix_operators=[], prefix_operators=[], qualifier=value, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=nonNullTypes, selectors=[], type_arguments=None), label=None), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=nonNullTypes, selectors=[], type_arguments=None), operandr=MemberReference(member=maxFoundSamplesToExamine, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=>=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=nonNullTypes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getMostCommonElementInList, postfix_operators=[], prefix_operators=[], qualifier=InternalUtilities, selectors=[], type_arguments=None), name=mostCommonType)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Class, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=mostCommonType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getDefaultRenderer, postfix_operators=[], prefix_operators=[], qualifier=table, selectors=[], type_arguments=None)], member=setCellRenderer, postfix_operators=[], prefix_operators=[], qualifier=column, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=mostCommonType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getDefaultEditor, postfix_operators=[], prefix_operators=[], qualifier=table, selectors=[], type_arguments=None)], member=setCellEditor, postfix_operators=[], prefix_operators=[], qualifier=column, selectors=[], type_arguments=None), label=None), ContinueStatement(goto=columnLoop, label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=rowIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=rowCount, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=rowIndex)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[Assignment(expressionl=MemberReference(member=rowIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=rowIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=maxStartRowsToRead, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), if_false=MemberReference(member=bulkRowIncrement, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)))]), label=rowLoop), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=nonNullTypes, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Object, sub_type=None))], member=getDefaultRenderer, postfix_operators=[], prefix_operators=[], qualifier=table, selectors=[], type_arguments=None)], member=setCellRenderer, postfix_operators=[], prefix_operators=[], qualifier=column, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Object, sub_type=None))], member=getDefaultEditor, postfix_operators=[], prefix_operators=[], qualifier=table, selectors=[], type_arguments=None)], member=setCellEditor, postfix_operators=[], prefix_operators=[], qualifier=column, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=nonNullTypes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getMostCommonElementInList, postfix_operators=[], prefix_operators=[], qualifier=InternalUtilities, selectors=[], type_arguments=None), name=mostCommonType)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Class, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=mostCommonType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getDefaultRenderer, postfix_operators=[], prefix_operators=[], qualifier=table, selectors=[], type_arguments=None)], member=setCellRenderer, postfix_operators=[], prefix_operators=[], qualifier=column, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=mostCommonType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getDefaultEditor, postfix_operators=[], prefix_operators=[], qualifier=table, selectors=[], type_arguments=None)], member=setCellEditor, postfix_operators=[], prefix_operators=[], qualifier=column, selectors=[], type_arguments=None), label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=columnIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=columnCount, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=columnIndex)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=columnIndex, postfix_operators=[], prefix_operators=['++'], qualifier=, selectors=[])]), label=columnLoop) end[}] END[}]
Keyword[private] Keyword[void] identifier[zSetAllColumnEditorsAndRenderers] operator[SEP] identifier[JTable] identifier[table] operator[SEP] { Keyword[int] identifier[maxStartRowsToRead] operator[=] Other[30] operator[SEP] Keyword[int] identifier[maxBulkRowsToRead] operator[=] Other[70] operator[SEP] Keyword[int] identifier[maxFoundSamplesToExamine] operator[=] Other[21] operator[SEP] identifier[TableModel] identifier[model] operator[=] identifier[table] operator[SEP] identifier[getModel] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[columnCount] operator[=] identifier[model] operator[SEP] identifier[getColumnCount] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[rowCount] operator[=] identifier[model] operator[SEP] identifier[getRowCount] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[columnCount] operator[<] Other[1] operator[||] identifier[rowCount] operator[<] Other[1] operator[SEP] { Keyword[return] operator[SEP] } Keyword[int] identifier[bulkRowIncrement] operator[=] identifier[Math] operator[SEP] identifier[max] operator[SEP] Other[1] , operator[SEP] identifier[rowCount] operator[/] identifier[maxBulkRowsToRead] operator[SEP] operator[SEP] operator[SEP] identifier[columnLoop] operator[:] Keyword[for] operator[SEP] Keyword[int] identifier[columnIndex] operator[=] Other[0] operator[SEP] identifier[columnIndex] operator[<] identifier[columnCount] operator[SEP] operator[++] identifier[columnIndex] operator[SEP] { identifier[TableColumn] identifier[column] operator[=] identifier[table] operator[SEP] identifier[getColumnModel] operator[SEP] operator[SEP] operator[SEP] identifier[getColumn] operator[SEP] identifier[columnIndex] operator[SEP] operator[SEP] identifier[ArrayList] operator[<] identifier[Class] operator[>] identifier[nonNullTypes] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[Class] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[rowLoop] operator[:] Keyword[for] operator[SEP] Keyword[int] identifier[rowIndex] operator[=] Other[0] operator[SEP] operator[SEP] identifier[rowIndex] operator[<] identifier[rowCount] operator[SEP] operator[SEP] identifier[rowIndex] operator[+=] operator[SEP] operator[SEP] identifier[rowIndex] operator[<] identifier[maxStartRowsToRead] operator[SEP] operator[?] Other[1] operator[:] identifier[bulkRowIncrement] operator[SEP] operator[SEP] { identifier[Object] identifier[value] operator[=] identifier[model] operator[SEP] identifier[getValueAt] operator[SEP] identifier[rowIndex] , identifier[columnIndex] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[value] operator[==] Other[null] operator[SEP] { Keyword[continue] operator[SEP] } identifier[nonNullTypes] operator[SEP] identifier[add] operator[SEP] identifier[value] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[nonNullTypes] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[>=] identifier[maxFoundSamplesToExamine] operator[SEP] { identifier[Class] identifier[mostCommonType] operator[=] identifier[InternalUtilities] operator[SEP] identifier[getMostCommonElementInList] operator[SEP] identifier[nonNullTypes] operator[SEP] operator[SEP] identifier[column] operator[SEP] identifier[setCellRenderer] operator[SEP] identifier[table] operator[SEP] identifier[getDefaultRenderer] operator[SEP] identifier[mostCommonType] operator[SEP] operator[SEP] operator[SEP] identifier[column] operator[SEP] identifier[setCellEditor] operator[SEP] identifier[table] operator[SEP] identifier[getDefaultEditor] operator[SEP] identifier[mostCommonType] operator[SEP] operator[SEP] operator[SEP] Keyword[continue] identifier[columnLoop] operator[SEP] } } Keyword[if] operator[SEP] identifier[nonNullTypes] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[>] Other[0] operator[SEP] { identifier[Class] identifier[mostCommonType] operator[=] identifier[InternalUtilities] operator[SEP] identifier[getMostCommonElementInList] operator[SEP] identifier[nonNullTypes] operator[SEP] operator[SEP] identifier[column] operator[SEP] identifier[setCellRenderer] operator[SEP] identifier[table] operator[SEP] identifier[getDefaultRenderer] operator[SEP] identifier[mostCommonType] operator[SEP] operator[SEP] operator[SEP] identifier[column] operator[SEP] identifier[setCellEditor] operator[SEP] identifier[table] operator[SEP] identifier[getDefaultEditor] operator[SEP] identifier[mostCommonType] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { identifier[column] operator[SEP] identifier[setCellRenderer] operator[SEP] identifier[table] operator[SEP] identifier[getDefaultRenderer] operator[SEP] identifier[Object] operator[SEP] Keyword[class] operator[SEP] operator[SEP] operator[SEP] identifier[column] operator[SEP] identifier[setCellEditor] operator[SEP] identifier[table] operator[SEP] identifier[getDefaultEditor] operator[SEP] identifier[Object] operator[SEP] Keyword[class] operator[SEP] operator[SEP] operator[SEP] } } }
public void checkPermission(Permission perm, AddOnModel addOnModel) throws IzouPermissionException { try { rootPermission.checkPermission(perm, addOnModel); //its root return; } catch (IzouPermissionException ignored) { //its just not root } standardCheck.stream() .filter(permissionModule -> permissionModule.canCheckPermission(perm)) .forEach(permissionModule -> permissionModule.checkPermission(perm, addOnModel)); }
class class_name[name] begin[{] method[checkPermission, return_type[void], modifier[public], parameter[perm, addOnModel]] begin[{] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=perm, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=addOnModel, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=checkPermission, postfix_operators=[], prefix_operators=[], qualifier=rootPermission, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=None, label=None)], catches=[CatchClause(block=[], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ignored, types=['IzouPermissionException']))], finally_block=None, label=None, resources=None) call[standardCheck.stream, parameter[]] end[}] END[}]
Keyword[public] Keyword[void] identifier[checkPermission] operator[SEP] identifier[Permission] identifier[perm] , identifier[AddOnModel] identifier[addOnModel] operator[SEP] Keyword[throws] identifier[IzouPermissionException] { Keyword[try] { identifier[rootPermission] operator[SEP] identifier[checkPermission] operator[SEP] identifier[perm] , identifier[addOnModel] operator[SEP] operator[SEP] Keyword[return] operator[SEP] } Keyword[catch] operator[SEP] identifier[IzouPermissionException] identifier[ignored] operator[SEP] { } identifier[standardCheck] operator[SEP] identifier[stream] operator[SEP] operator[SEP] operator[SEP] identifier[filter] operator[SEP] identifier[permissionModule] operator[->] identifier[permissionModule] operator[SEP] identifier[canCheckPermission] operator[SEP] identifier[perm] operator[SEP] operator[SEP] operator[SEP] identifier[forEach] operator[SEP] identifier[permissionModule] operator[->] identifier[permissionModule] operator[SEP] identifier[checkPermission] operator[SEP] identifier[perm] , identifier[addOnModel] operator[SEP] operator[SEP] operator[SEP] }
@Override public int doEndTag() throws JspException { SQLExecutionTag parent = (SQLExecutionTag) findAncestorWithClass(this, SQLExecutionTag.class); if (parent == null) { throw new JspTagException( Resources.getMessage("SQL_PARAM_OUTSIDE_PARENT")); } Object paramValue = null; if (value != null) { paramValue = value; } else if (bodyContent != null) { paramValue = bodyContent.getString().trim(); if (((String) paramValue).trim().length() == 0) { paramValue = null; } } parent.addSQLParameter(paramValue); return EVAL_PAGE; }
class class_name[name] begin[{] method[doEndTag, return_type[type[int]], modifier[public], parameter[]] begin[{] local_variable[type[SQLExecutionTag], parent] if[binary_operation[member[.parent], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="SQL_PARAM_OUTSIDE_PARENT")], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=Resources, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=JspTagException, sub_type=None)), label=None) else begin[{] None end[}] local_variable[type[Object], paramValue] if[binary_operation[member[.value], !=, literal[null]]] begin[{] assign[member[.paramValue], member[.value]] else begin[{] if[binary_operation[member[.bodyContent], !=, literal[null]]] begin[{] assign[member[.paramValue], call[bodyContent.getString, parameter[]]] if[binary_operation[Cast(expression=MemberReference(member=paramValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), ==, literal[0]]] begin[{] assign[member[.paramValue], literal[null]] else begin[{] None end[}] else begin[{] None end[}] end[}] call[parent.addSQLParameter, parameter[member[.paramValue]]] return[member[.EVAL_PAGE]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[int] identifier[doEndTag] operator[SEP] operator[SEP] Keyword[throws] identifier[JspException] { identifier[SQLExecutionTag] identifier[parent] operator[=] operator[SEP] identifier[SQLExecutionTag] operator[SEP] identifier[findAncestorWithClass] operator[SEP] Keyword[this] , identifier[SQLExecutionTag] operator[SEP] Keyword[class] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[parent] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[JspTagException] operator[SEP] identifier[Resources] operator[SEP] identifier[getMessage] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] } identifier[Object] identifier[paramValue] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[value] operator[!=] Other[null] operator[SEP] { identifier[paramValue] operator[=] identifier[value] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[bodyContent] operator[!=] Other[null] operator[SEP] { identifier[paramValue] operator[=] identifier[bodyContent] operator[SEP] identifier[getString] operator[SEP] operator[SEP] operator[SEP] identifier[trim] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[SEP] operator[SEP] identifier[String] operator[SEP] identifier[paramValue] operator[SEP] operator[SEP] identifier[trim] operator[SEP] operator[SEP] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[==] Other[0] operator[SEP] { identifier[paramValue] operator[=] Other[null] operator[SEP] } } identifier[parent] operator[SEP] identifier[addSQLParameter] operator[SEP] identifier[paramValue] operator[SEP] operator[SEP] Keyword[return] identifier[EVAL_PAGE] operator[SEP] }
public final int parentItemPosition(int adapterPosition) { int itemCount = 0; for (int i = 0; i < parentItemCount(); i++) { itemCount += 1; if (isExpanded(i)) { int childCount = childItemCount(i); itemCount += childCount; } if (adapterPosition < itemCount) { return i; } } throw new IllegalStateException("The adapter position is not a parent type: " + adapterPosition); }
class class_name[name] begin[{] method[parentItemPosition, return_type[type[int]], modifier[final public], parameter[adapterPosition]] begin[{] local_variable[type[int], itemCount] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=itemCount, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)), label=None), IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isExpanded, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=childItemCount, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=childCount)], modifiers=set(), type=BasicType(dimensions=[], name=int)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=itemCount, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=MemberReference(member=childCount, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None)])), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=adapterPosition, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=itemCount, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=parentItemCount, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="The adapter position is not a parent type: "), operandr=MemberReference(member=adapterPosition, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalStateException, sub_type=None)), label=None) end[}] END[}]
Keyword[public] Keyword[final] Keyword[int] identifier[parentItemPosition] operator[SEP] Keyword[int] identifier[adapterPosition] operator[SEP] { Keyword[int] identifier[itemCount] operator[=] Other[0] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[parentItemCount] operator[SEP] operator[SEP] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[itemCount] operator[+=] Other[1] operator[SEP] Keyword[if] operator[SEP] identifier[isExpanded] operator[SEP] identifier[i] operator[SEP] operator[SEP] { Keyword[int] identifier[childCount] operator[=] identifier[childItemCount] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[itemCount] operator[+=] identifier[childCount] operator[SEP] } Keyword[if] operator[SEP] identifier[adapterPosition] operator[<] identifier[itemCount] operator[SEP] { Keyword[return] identifier[i] operator[SEP] } } Keyword[throw] Keyword[new] identifier[IllegalStateException] operator[SEP] literal[String] operator[+] identifier[adapterPosition] operator[SEP] operator[SEP] }
public static File createFile(String filePath) throws IOException { boolean isDirectory = filePath.endsWith("/") || filePath.endsWith("\\"); String formattedFilePath = formatFilePath(filePath); File f = new File(formattedFilePath); if (f.exists()) { return f; } if (isDirectory) { f.mkdirs(); } else { f.getParentFile().mkdirs(); f.createNewFile(); } if (f.exists()) { f.setExecutable(true, false); f.setReadable(true, false); f.setWritable(true, false); return f; } throw new IOException("Error creating file: " + f.getAbsolutePath()); }
class class_name[name] begin[{] method[createFile, return_type[type[File]], modifier[public static], parameter[filePath]] begin[{] local_variable[type[boolean], isDirectory] local_variable[type[String], formattedFilePath] local_variable[type[File], f] if[call[f.exists, parameter[]]] begin[{] return[member[.f]] else begin[{] None end[}] if[member[.isDirectory]] begin[{] call[f.mkdirs, parameter[]] else begin[{] call[f.getParentFile, parameter[]] call[f.createNewFile, parameter[]] end[}] if[call[f.exists, parameter[]]] begin[{] call[f.setExecutable, parameter[literal[true], literal[false]]] call[f.setReadable, parameter[literal[true], literal[false]]] call[f.setWritable, parameter[literal[true], literal[false]]] return[member[.f]] else begin[{] None end[}] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Error creating file: "), operandr=MethodInvocation(arguments=[], member=getAbsolutePath, postfix_operators=[], prefix_operators=[], qualifier=f, selectors=[], type_arguments=None), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IOException, sub_type=None)), label=None) end[}] END[}]
Keyword[public] Keyword[static] identifier[File] identifier[createFile] operator[SEP] identifier[String] identifier[filePath] operator[SEP] Keyword[throws] identifier[IOException] { Keyword[boolean] identifier[isDirectory] operator[=] identifier[filePath] operator[SEP] identifier[endsWith] operator[SEP] literal[String] operator[SEP] operator[||] identifier[filePath] operator[SEP] identifier[endsWith] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[String] identifier[formattedFilePath] operator[=] identifier[formatFilePath] operator[SEP] identifier[filePath] operator[SEP] operator[SEP] identifier[File] identifier[f] operator[=] Keyword[new] identifier[File] operator[SEP] identifier[formattedFilePath] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[f] operator[SEP] identifier[exists] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] identifier[f] operator[SEP] } Keyword[if] operator[SEP] identifier[isDirectory] operator[SEP] { identifier[f] operator[SEP] identifier[mkdirs] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { identifier[f] operator[SEP] identifier[getParentFile] operator[SEP] operator[SEP] operator[SEP] identifier[mkdirs] operator[SEP] operator[SEP] operator[SEP] identifier[f] operator[SEP] identifier[createNewFile] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[f] operator[SEP] identifier[exists] operator[SEP] operator[SEP] operator[SEP] { identifier[f] operator[SEP] identifier[setExecutable] operator[SEP] literal[boolean] , literal[boolean] operator[SEP] operator[SEP] identifier[f] operator[SEP] identifier[setReadable] operator[SEP] literal[boolean] , literal[boolean] operator[SEP] operator[SEP] identifier[f] operator[SEP] identifier[setWritable] operator[SEP] literal[boolean] , literal[boolean] operator[SEP] operator[SEP] Keyword[return] identifier[f] operator[SEP] } Keyword[throw] Keyword[new] identifier[IOException] operator[SEP] literal[String] operator[+] identifier[f] operator[SEP] identifier[getAbsolutePath] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
public static Function<Client<HttpRequest, HttpResponse>, HttpTracingClient> newDecorator( Tracing tracing, @Nullable String remoteServiceName) { ensureScopeUsesRequestContext(tracing); return delegate -> new HttpTracingClient(delegate, tracing, remoteServiceName); }
class class_name[name] begin[{] method[newDecorator, return_type[type[Function]], modifier[public static], parameter[tracing, remoteServiceName]] begin[{] call[.ensureScopeUsesRequestContext, parameter[member[.tracing]]] return[LambdaExpression(body=ClassCreator(arguments=[MemberReference(member=delegate, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=tracing, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=remoteServiceName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=HttpTracingClient, sub_type=None)), parameters=[MemberReference(member=delegate, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])])] end[}] END[}]
Keyword[public] Keyword[static] identifier[Function] operator[<] identifier[Client] operator[<] identifier[HttpRequest] , identifier[HttpResponse] operator[>] , identifier[HttpTracingClient] operator[>] identifier[newDecorator] operator[SEP] identifier[Tracing] identifier[tracing] , annotation[@] identifier[Nullable] identifier[String] identifier[remoteServiceName] operator[SEP] { identifier[ensureScopeUsesRequestContext] operator[SEP] identifier[tracing] operator[SEP] operator[SEP] Keyword[return] identifier[delegate] operator[->] Keyword[new] identifier[HttpTracingClient] operator[SEP] identifier[delegate] , identifier[tracing] , identifier[remoteServiceName] operator[SEP] operator[SEP] }
public EClass getIfcPropertyEnumeration() { if (ifcPropertyEnumerationEClass == null) { ifcPropertyEnumerationEClass = (EClass) EPackage.Registry.INSTANCE.getEPackage(Ifc2x3tc1Package.eNS_URI) .getEClassifiers().get(403); } return ifcPropertyEnumerationEClass; }
class class_name[name] begin[{] method[getIfcPropertyEnumeration, return_type[type[EClass]], modifier[public], parameter[]] begin[{] if[binary_operation[member[.ifcPropertyEnumerationEClass], ==, literal[null]]] begin[{] assign[member[.ifcPropertyEnumerationEClass], Cast(expression=MethodInvocation(arguments=[MemberReference(member=eNS_URI, postfix_operators=[], prefix_operators=[], qualifier=Ifc2x3tc1Package, selectors=[])], member=getEPackage, postfix_operators=[], prefix_operators=[], qualifier=EPackage.Registry.INSTANCE, selectors=[MethodInvocation(arguments=[], member=getEClassifiers, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=403)], member=get, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=EClass, sub_type=None))] else begin[{] None end[}] return[member[.ifcPropertyEnumerationEClass]] end[}] END[}]
Keyword[public] identifier[EClass] identifier[getIfcPropertyEnumeration] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[ifcPropertyEnumerationEClass] operator[==] Other[null] operator[SEP] { identifier[ifcPropertyEnumerationEClass] operator[=] operator[SEP] identifier[EClass] operator[SEP] identifier[EPackage] operator[SEP] identifier[Registry] operator[SEP] identifier[INSTANCE] operator[SEP] identifier[getEPackage] operator[SEP] identifier[Ifc2x3tc1Package] operator[SEP] identifier[eNS_URI] operator[SEP] operator[SEP] identifier[getEClassifiers] operator[SEP] operator[SEP] operator[SEP] identifier[get] operator[SEP] Other[403] operator[SEP] operator[SEP] } Keyword[return] identifier[ifcPropertyEnumerationEClass] operator[SEP] }
public static String expand(final CharSequence pattern) { requireNonNull(pattern, "Pattern"); final StringBuilder out = new StringBuilder(); for (int i = 0, n = pattern.length(); i < n; ++i) { if (pattern.charAt(i) == '\\') { ++i; if (i < pattern.length()) { out.append(pattern.charAt(i)); } } else if (pattern.charAt(i) == '-') { if (i <= 0 || i >= (pattern.length() - 1)) { throw new PatternSyntaxException( "Dangling range operator '-'", pattern.toString(), pattern.length() - 1 ); } final String range = expand( pattern.charAt(i - 1), pattern.charAt(i + 1) ); out.append(range); ++i; } else if (i + 1 == n || pattern.charAt(i + 1) != '-') { out.append(pattern.charAt(i)); } } return out.toString(); }
class class_name[name] begin[{] method[expand, return_type[type[String]], modifier[public static], parameter[pattern]] begin[{] call[.requireNonNull, parameter[member[.pattern], literal["Pattern"]]] local_variable[type[StringBuilder], out] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=charAt, postfix_operators=[], prefix_operators=[], qualifier=pattern, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='\\'), operator===), else_statement=IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=charAt, postfix_operators=[], prefix_operators=[], qualifier=pattern, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='-'), operator===), else_statement=IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+), operandr=MemberReference(member=n, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator===), operandr=BinaryOperation(operandl=MethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+)], member=charAt, postfix_operators=[], prefix_operators=[], qualifier=pattern, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='-'), operator=!=), operator=||), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=charAt, postfix_operators=[], prefix_operators=[], qualifier=pattern, selectors=[], type_arguments=None)], member=append, postfix_operators=[], prefix_operators=[], qualifier=out, selectors=[], type_arguments=None), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=<=), operandr=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=BinaryOperation(operandl=MethodInvocation(arguments=[], member=length, postfix_operators=[], prefix_operators=[], qualifier=pattern, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=-), operator=>=), operator=||), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Dangling range operator '-'"), MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=pattern, selectors=[], type_arguments=None), BinaryOperation(operandl=MethodInvocation(arguments=[], member=length, postfix_operators=[], prefix_operators=[], qualifier=pattern, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=-)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=PatternSyntaxException, sub_type=None)), label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=-)], member=charAt, postfix_operators=[], prefix_operators=[], qualifier=pattern, selectors=[], type_arguments=None), MethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+)], member=charAt, postfix_operators=[], prefix_operators=[], qualifier=pattern, selectors=[], type_arguments=None)], member=expand, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=range)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=range, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=append, postfix_operators=[], prefix_operators=[], qualifier=out, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MemberReference(member=i, postfix_operators=[], prefix_operators=['++'], qualifier=, selectors=[]), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MemberReference(member=i, postfix_operators=[], prefix_operators=['++'], qualifier=, selectors=[]), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=length, postfix_operators=[], prefix_operators=[], qualifier=pattern, selectors=[], type_arguments=None), operator=<), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=charAt, postfix_operators=[], prefix_operators=[], qualifier=pattern, selectors=[], type_arguments=None)], member=append, postfix_operators=[], prefix_operators=[], qualifier=out, selectors=[], type_arguments=None), label=None)]))]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=n, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i), VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=length, postfix_operators=[], prefix_operators=[], qualifier=pattern, selectors=[], type_arguments=None), name=n)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=[], prefix_operators=['++'], qualifier=, selectors=[])]), label=None) return[call[out.toString, parameter[]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[String] identifier[expand] operator[SEP] Keyword[final] identifier[CharSequence] identifier[pattern] operator[SEP] { identifier[requireNonNull] operator[SEP] identifier[pattern] , literal[String] operator[SEP] operator[SEP] Keyword[final] identifier[StringBuilder] identifier[out] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] , identifier[n] operator[=] identifier[pattern] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] identifier[i] operator[<] identifier[n] operator[SEP] operator[++] identifier[i] operator[SEP] { Keyword[if] operator[SEP] identifier[pattern] operator[SEP] identifier[charAt] operator[SEP] identifier[i] operator[SEP] operator[==] literal[String] operator[SEP] { operator[++] identifier[i] operator[SEP] Keyword[if] operator[SEP] identifier[i] operator[<] identifier[pattern] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] { identifier[out] operator[SEP] identifier[append] operator[SEP] identifier[pattern] operator[SEP] identifier[charAt] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[SEP] } } Keyword[else] Keyword[if] operator[SEP] identifier[pattern] operator[SEP] identifier[charAt] operator[SEP] identifier[i] operator[SEP] operator[==] literal[String] operator[SEP] { Keyword[if] operator[SEP] identifier[i] operator[<=] Other[0] operator[||] identifier[i] operator[>=] operator[SEP] identifier[pattern] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[-] Other[1] operator[SEP] operator[SEP] { Keyword[throw] Keyword[new] identifier[PatternSyntaxException] operator[SEP] literal[String] , identifier[pattern] operator[SEP] identifier[toString] operator[SEP] operator[SEP] , identifier[pattern] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[-] Other[1] operator[SEP] operator[SEP] } Keyword[final] identifier[String] identifier[range] operator[=] identifier[expand] operator[SEP] identifier[pattern] operator[SEP] identifier[charAt] operator[SEP] identifier[i] operator[-] Other[1] operator[SEP] , identifier[pattern] operator[SEP] identifier[charAt] operator[SEP] identifier[i] operator[+] Other[1] operator[SEP] operator[SEP] operator[SEP] identifier[out] operator[SEP] identifier[append] operator[SEP] identifier[range] operator[SEP] operator[SEP] operator[++] identifier[i] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[i] operator[+] Other[1] operator[==] identifier[n] operator[||] identifier[pattern] operator[SEP] identifier[charAt] operator[SEP] identifier[i] operator[+] Other[1] operator[SEP] operator[!=] literal[String] operator[SEP] { identifier[out] operator[SEP] identifier[append] operator[SEP] identifier[pattern] operator[SEP] identifier[charAt] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[SEP] } } Keyword[return] identifier[out] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] }
public void addConnectionEventListener( final ConnectionEventListener listener) { if (TraceComponent.isAnyTracingEnabled() && TRACE.isEntryEnabled()) { SibTr.entry(this, TRACE, "addConnectionEventListener", listener); } _eventListeners.add(listener); if (TraceComponent.isAnyTracingEnabled() && TRACE.isEntryEnabled()) { SibTr.exit(this, TRACE, "addConnectionEventListener"); } }
class class_name[name] begin[{] method[addConnectionEventListener, return_type[void], modifier[public], parameter[listener]] begin[{] if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[TRACE.isEntryEnabled, parameter[]]]] begin[{] call[SibTr.entry, parameter[THIS[], member[.TRACE], literal["addConnectionEventListener"], member[.listener]]] else begin[{] None end[}] call[_eventListeners.add, parameter[member[.listener]]] if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[TRACE.isEntryEnabled, parameter[]]]] begin[{] call[SibTr.exit, parameter[THIS[], member[.TRACE], literal["addConnectionEventListener"]]] else begin[{] None end[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[addConnectionEventListener] operator[SEP] Keyword[final] identifier[ConnectionEventListener] identifier[listener] operator[SEP] { Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[TRACE] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] { identifier[SibTr] operator[SEP] identifier[entry] operator[SEP] Keyword[this] , identifier[TRACE] , literal[String] , identifier[listener] operator[SEP] operator[SEP] } identifier[_eventListeners] operator[SEP] identifier[add] operator[SEP] identifier[listener] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[TRACE] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] { identifier[SibTr] operator[SEP] identifier[exit] operator[SEP] Keyword[this] , identifier[TRACE] , literal[String] operator[SEP] operator[SEP] } }
public static<A, B, C, Z> Function3<A, B, C, Z> lift(Func3<A, B, C, Z> f) { return bridge.lift(f); }
class class_name[name] begin[{] method[lift, return_type[type[Function3]], modifier[public static], parameter[f]] begin[{] return[call[bridge.lift, parameter[member[.f]]]] end[}] END[}]
Keyword[public] Keyword[static] operator[<] identifier[A] , identifier[B] , identifier[C] , identifier[Z] operator[>] identifier[Function3] operator[<] identifier[A] , identifier[B] , identifier[C] , identifier[Z] operator[>] identifier[lift] operator[SEP] identifier[Func3] operator[<] identifier[A] , identifier[B] , identifier[C] , identifier[Z] operator[>] identifier[f] operator[SEP] { Keyword[return] identifier[bridge] operator[SEP] identifier[lift] operator[SEP] identifier[f] operator[SEP] operator[SEP] }
public static Configuration merge(final Configuration... configurations) { return Tang.Factory.getTang().newConfigurationBuilder(configurations).build(); }
class class_name[name] begin[{] method[merge, return_type[type[Configuration]], modifier[public static], parameter[configurations]] begin[{] return[call[Tang.Factory.getTang, parameter[]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[Configuration] identifier[merge] operator[SEP] Keyword[final] identifier[Configuration] operator[...] identifier[configurations] operator[SEP] { Keyword[return] identifier[Tang] operator[SEP] identifier[Factory] operator[SEP] identifier[getTang] operator[SEP] operator[SEP] operator[SEP] identifier[newConfigurationBuilder] operator[SEP] identifier[configurations] operator[SEP] operator[SEP] identifier[build] operator[SEP] operator[SEP] operator[SEP] }
public static String dumpStack(final Throwable cause) { if (cause == null) { return "Throwable was null"; } final StringWriter sw = new StringWriter(); final PrintWriter s = new PrintWriter(sw); // This is very close to what Thread.dumpStack does. cause.printStackTrace(s); final String stack = sw.toString(); try { sw.close(); } catch (final IOException e) { LOG.warn("Could not close writer", e); } s.close(); return stack; }
class class_name[name] begin[{] method[dumpStack, return_type[type[String]], modifier[public static], parameter[cause]] begin[{] if[binary_operation[member[.cause], ==, literal[null]]] begin[{] return[literal["Throwable was null"]] else begin[{] None end[}] local_variable[type[StringWriter], sw] local_variable[type[PrintWriter], s] call[cause.printStackTrace, parameter[member[.s]]] local_variable[type[String], stack] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=close, postfix_operators=[], prefix_operators=[], qualifier=sw, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Could not close writer"), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=warn, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['IOException']))], finally_block=None, label=None, resources=None) call[s.close, parameter[]] return[member[.stack]] end[}] END[}]
Keyword[public] Keyword[static] identifier[String] identifier[dumpStack] operator[SEP] Keyword[final] identifier[Throwable] identifier[cause] operator[SEP] { Keyword[if] operator[SEP] identifier[cause] operator[==] Other[null] operator[SEP] { Keyword[return] literal[String] operator[SEP] } Keyword[final] identifier[StringWriter] identifier[sw] operator[=] Keyword[new] identifier[StringWriter] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[PrintWriter] identifier[s] operator[=] Keyword[new] identifier[PrintWriter] operator[SEP] identifier[sw] operator[SEP] operator[SEP] identifier[cause] operator[SEP] identifier[printStackTrace] operator[SEP] identifier[s] operator[SEP] operator[SEP] Keyword[final] identifier[String] identifier[stack] operator[=] identifier[sw] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] Keyword[try] { identifier[sw] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] Keyword[final] identifier[IOException] identifier[e] operator[SEP] { identifier[LOG] operator[SEP] identifier[warn] operator[SEP] literal[String] , identifier[e] operator[SEP] operator[SEP] } identifier[s] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[stack] operator[SEP] }
public static boolean isPassIdentifiedDownstream(AbstractBuild<?, ?> build) { ArtifactoryRedeployPublisher publisher = ActionableHelper.getPublisher(build.getProject(), ArtifactoryRedeployPublisher.class); if (publisher != null) { return publisher.isPassIdentifiedDownstream(); } ArtifactoryGradleConfigurator wrapper = ActionableHelper .getBuildWrapper((BuildableItemWithBuildWrappers) build.getProject(), ArtifactoryGradleConfigurator.class); return wrapper != null && wrapper.isPassIdentifiedDownstream(); }
class class_name[name] begin[{] method[isPassIdentifiedDownstream, return_type[type[boolean]], modifier[public static], parameter[build]] begin[{] local_variable[type[ArtifactoryRedeployPublisher], publisher] if[binary_operation[member[.publisher], !=, literal[null]]] begin[{] return[call[publisher.isPassIdentifiedDownstream, parameter[]]] else begin[{] None end[}] local_variable[type[ArtifactoryGradleConfigurator], wrapper] return[binary_operation[binary_operation[member[.wrapper], !=, literal[null]], &&, call[wrapper.isPassIdentifiedDownstream, parameter[]]]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[boolean] identifier[isPassIdentifiedDownstream] operator[SEP] identifier[AbstractBuild] operator[<] operator[?] , operator[?] operator[>] identifier[build] operator[SEP] { identifier[ArtifactoryRedeployPublisher] identifier[publisher] operator[=] identifier[ActionableHelper] operator[SEP] identifier[getPublisher] operator[SEP] identifier[build] operator[SEP] identifier[getProject] operator[SEP] operator[SEP] , identifier[ArtifactoryRedeployPublisher] operator[SEP] Keyword[class] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[publisher] operator[!=] Other[null] operator[SEP] { Keyword[return] identifier[publisher] operator[SEP] identifier[isPassIdentifiedDownstream] operator[SEP] operator[SEP] operator[SEP] } identifier[ArtifactoryGradleConfigurator] identifier[wrapper] operator[=] identifier[ActionableHelper] operator[SEP] identifier[getBuildWrapper] operator[SEP] operator[SEP] identifier[BuildableItemWithBuildWrappers] operator[SEP] identifier[build] operator[SEP] identifier[getProject] operator[SEP] operator[SEP] , identifier[ArtifactoryGradleConfigurator] operator[SEP] Keyword[class] operator[SEP] operator[SEP] Keyword[return] identifier[wrapper] operator[!=] Other[null] operator[&&] identifier[wrapper] operator[SEP] identifier[isPassIdentifiedDownstream] operator[SEP] operator[SEP] operator[SEP] }
public List<PatternRuleInfo> batchAddPatterns(UUID appId, String versionId, List<PatternRuleCreateObject> patterns) { return batchAddPatternsWithServiceResponseAsync(appId, versionId, patterns).toBlocking().single().body(); }
class class_name[name] begin[{] method[batchAddPatterns, return_type[type[List]], modifier[public], parameter[appId, versionId, patterns]] begin[{] return[call[.batchAddPatternsWithServiceResponseAsync, parameter[member[.appId], member[.versionId], member[.patterns]]]] end[}] END[}]
Keyword[public] identifier[List] operator[<] identifier[PatternRuleInfo] operator[>] identifier[batchAddPatterns] operator[SEP] identifier[UUID] identifier[appId] , identifier[String] identifier[versionId] , identifier[List] operator[<] identifier[PatternRuleCreateObject] operator[>] identifier[patterns] operator[SEP] { Keyword[return] identifier[batchAddPatternsWithServiceResponseAsync] operator[SEP] identifier[appId] , identifier[versionId] , identifier[patterns] operator[SEP] operator[SEP] identifier[toBlocking] operator[SEP] operator[SEP] operator[SEP] identifier[single] operator[SEP] operator[SEP] operator[SEP] identifier[body] operator[SEP] operator[SEP] operator[SEP] }
public void post(LaMailPostcard postcard) { assertPostOfficeWorks(postcard); reloadIfNeeds(); saveMemories(postcard); final Postcard nativePostcard = postcard.toNativePostcard(); postOffice.deliver(nativePostcard); }
class class_name[name] begin[{] method[post, return_type[void], modifier[public], parameter[postcard]] begin[{] call[.assertPostOfficeWorks, parameter[member[.postcard]]] call[.reloadIfNeeds, parameter[]] call[.saveMemories, parameter[member[.postcard]]] local_variable[type[Postcard], nativePostcard] call[postOffice.deliver, parameter[member[.nativePostcard]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[post] operator[SEP] identifier[LaMailPostcard] identifier[postcard] operator[SEP] { identifier[assertPostOfficeWorks] operator[SEP] identifier[postcard] operator[SEP] operator[SEP] identifier[reloadIfNeeds] operator[SEP] operator[SEP] operator[SEP] identifier[saveMemories] operator[SEP] identifier[postcard] operator[SEP] operator[SEP] Keyword[final] identifier[Postcard] identifier[nativePostcard] operator[=] identifier[postcard] operator[SEP] identifier[toNativePostcard] operator[SEP] operator[SEP] operator[SEP] identifier[postOffice] operator[SEP] identifier[deliver] operator[SEP] identifier[nativePostcard] operator[SEP] operator[SEP] }
@Override public final IResolvedTypes resolveTypes(final /* @Nullable */ EObject object, CancelIndicator monitor) { if (object == null || object.eIsProxy()) { return IResolvedTypes.NULL; } Resource resource = object.eResource(); validateResourceState(resource); if (resource instanceof JvmMemberInitializableResource) { ((JvmMemberInitializableResource) resource).ensureJvmMembersInitialized(); } return doResolveTypes(object, monitor); }
class class_name[name] begin[{] method[resolveTypes, return_type[type[IResolvedTypes]], modifier[final public], parameter[object, monitor]] begin[{] if[binary_operation[binary_operation[member[.object], ==, literal[null]], ||, call[object.eIsProxy, parameter[]]]] begin[{] return[member[IResolvedTypes.NULL]] else begin[{] None end[}] local_variable[type[Resource], resource] call[.validateResourceState, parameter[member[.resource]]] if[binary_operation[member[.resource], instanceof, type[JvmMemberInitializableResource]]] begin[{] Cast(expression=MemberReference(member=resource, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=JvmMemberInitializableResource, sub_type=None)) else begin[{] None end[}] return[call[.doResolveTypes, parameter[member[.object], member[.monitor]]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[final] identifier[IResolvedTypes] identifier[resolveTypes] operator[SEP] Keyword[final] identifier[EObject] identifier[object] , identifier[CancelIndicator] identifier[monitor] operator[SEP] { Keyword[if] operator[SEP] identifier[object] operator[==] Other[null] operator[||] identifier[object] operator[SEP] identifier[eIsProxy] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] identifier[IResolvedTypes] operator[SEP] identifier[NULL] operator[SEP] } identifier[Resource] identifier[resource] operator[=] identifier[object] operator[SEP] identifier[eResource] operator[SEP] operator[SEP] operator[SEP] identifier[validateResourceState] operator[SEP] identifier[resource] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[resource] Keyword[instanceof] identifier[JvmMemberInitializableResource] operator[SEP] { operator[SEP] operator[SEP] identifier[JvmMemberInitializableResource] operator[SEP] identifier[resource] operator[SEP] operator[SEP] identifier[ensureJvmMembersInitialized] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[doResolveTypes] operator[SEP] identifier[object] , identifier[monitor] operator[SEP] operator[SEP] }
public ElemTemplateElement appendChild(ElemTemplateElement newChild) { int type = ((ElemTemplateElement) newChild).getXSLToken(); switch (type) { case Constants.ELEMNAME_TEXTLITERALRESULT : break; default : error(XSLTErrorResources.ER_CANNOT_ADD, new Object[]{ newChild.getNodeName(), this.getNodeName() }); //"Can not add " +((ElemTemplateElement)newChild).m_elemName + //" to " + this.m_elemName); } return super.appendChild(newChild); }
class class_name[name] begin[{] method[appendChild, return_type[type[ElemTemplateElement]], modifier[public], parameter[newChild]] begin[{] local_variable[type[int], type] SwitchStatement(cases=[SwitchStatementCase(case=[MemberReference(member=ELEMNAME_TEXTLITERALRESULT, postfix_operators=[], prefix_operators=[], qualifier=Constants, selectors=[])], statements=[BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[], statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=ER_CANNOT_ADD, postfix_operators=[], prefix_operators=[], qualifier=XSLTErrorResources, selectors=[]), ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[MethodInvocation(arguments=[], member=getNodeName, postfix_operators=[], prefix_operators=[], qualifier=newChild, selectors=[], type_arguments=None), This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[], member=getNodeName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)])]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Object, sub_type=None))], member=error, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)])], expression=MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None) return[SuperMethodInvocation(arguments=[MemberReference(member=newChild, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=appendChild, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None)] end[}] END[}]
Keyword[public] identifier[ElemTemplateElement] identifier[appendChild] operator[SEP] identifier[ElemTemplateElement] identifier[newChild] operator[SEP] { Keyword[int] identifier[type] operator[=] operator[SEP] operator[SEP] identifier[ElemTemplateElement] operator[SEP] identifier[newChild] operator[SEP] operator[SEP] identifier[getXSLToken] operator[SEP] operator[SEP] operator[SEP] Keyword[switch] operator[SEP] identifier[type] operator[SEP] { Keyword[case] identifier[Constants] operator[SEP] identifier[ELEMNAME_TEXTLITERALRESULT] operator[:] Keyword[break] operator[SEP] Keyword[default] operator[:] identifier[error] operator[SEP] identifier[XSLTErrorResources] operator[SEP] identifier[ER_CANNOT_ADD] , Keyword[new] identifier[Object] operator[SEP] operator[SEP] { identifier[newChild] operator[SEP] identifier[getNodeName] operator[SEP] operator[SEP] , Keyword[this] operator[SEP] identifier[getNodeName] operator[SEP] operator[SEP] } operator[SEP] operator[SEP] } Keyword[return] Keyword[super] operator[SEP] identifier[appendChild] operator[SEP] identifier[newChild] operator[SEP] operator[SEP] }
protected String getI18n(final String aMessageKey, final Exception aException) { return StringUtils.normalizeWS(myBundle.get(aMessageKey, aException.getMessage())); }
class class_name[name] begin[{] method[getI18n, return_type[type[String]], modifier[protected], parameter[aMessageKey, aException]] begin[{] return[call[StringUtils.normalizeWS, parameter[call[myBundle.get, parameter[member[.aMessageKey], call[aException.getMessage, parameter[]]]]]]] end[}] END[}]
Keyword[protected] identifier[String] identifier[getI18n] operator[SEP] Keyword[final] identifier[String] identifier[aMessageKey] , Keyword[final] identifier[Exception] identifier[aException] operator[SEP] { Keyword[return] identifier[StringUtils] operator[SEP] identifier[normalizeWS] operator[SEP] identifier[myBundle] operator[SEP] identifier[get] operator[SEP] identifier[aMessageKey] , identifier[aException] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
public static <T> DecomposableMatchBuilder0<Optional<T>> some(MatchesExact<T> t) { List<Matcher<Object>> matchers = Lists.of(ArgumentMatchers.eq(t.t)); return new DecomposableMatchBuilder0<Optional<T>>(matchers, new OptionalFieldExtractor<>()); }
class class_name[name] begin[{] method[some, return_type[type[DecomposableMatchBuilder0]], modifier[public static], parameter[t]] begin[{] local_variable[type[List], matchers] return[ClassCreator(arguments=[MemberReference(member=matchers, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[], dimensions=None, name=OptionalFieldExtractor, sub_type=None))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=T, sub_type=None))], dimensions=[], name=Optional, sub_type=None))], dimensions=None, name=DecomposableMatchBuilder0, sub_type=None))] end[}] END[}]
Keyword[public] Keyword[static] operator[<] identifier[T] operator[>] identifier[DecomposableMatchBuilder0] operator[<] identifier[Optional] operator[<] identifier[T] operator[>] operator[>] identifier[some] operator[SEP] identifier[MatchesExact] operator[<] identifier[T] operator[>] identifier[t] operator[SEP] { identifier[List] operator[<] identifier[Matcher] operator[<] identifier[Object] operator[>] operator[>] identifier[matchers] operator[=] identifier[Lists] operator[SEP] identifier[of] operator[SEP] identifier[ArgumentMatchers] operator[SEP] identifier[eq] operator[SEP] identifier[t] operator[SEP] identifier[t] operator[SEP] operator[SEP] operator[SEP] Keyword[return] Keyword[new] identifier[DecomposableMatchBuilder0] operator[<] identifier[Optional] operator[<] identifier[T] operator[>] operator[>] operator[SEP] identifier[matchers] , Keyword[new] identifier[OptionalFieldExtractor] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
public static Map<String, Stock> get(String[] symbols, Interval interval) throws IOException { return YahooFinance.getQuotes(Utils.join(symbols, ","), HistQuotesRequest.DEFAULT_FROM, HistQuotesRequest.DEFAULT_TO, interval); }
class class_name[name] begin[{] method[get, return_type[type[Map]], modifier[public static], parameter[symbols, interval]] begin[{] return[call[YahooFinance.getQuotes, parameter[call[Utils.join, parameter[member[.symbols], literal[","]]], member[HistQuotesRequest.DEFAULT_FROM], member[HistQuotesRequest.DEFAULT_TO], member[.interval]]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[Map] operator[<] identifier[String] , identifier[Stock] operator[>] identifier[get] operator[SEP] identifier[String] operator[SEP] operator[SEP] identifier[symbols] , identifier[Interval] identifier[interval] operator[SEP] Keyword[throws] identifier[IOException] { Keyword[return] identifier[YahooFinance] operator[SEP] identifier[getQuotes] operator[SEP] identifier[Utils] operator[SEP] identifier[join] operator[SEP] identifier[symbols] , literal[String] operator[SEP] , identifier[HistQuotesRequest] operator[SEP] identifier[DEFAULT_FROM] , identifier[HistQuotesRequest] operator[SEP] identifier[DEFAULT_TO] , identifier[interval] operator[SEP] operator[SEP] }
public void marshall(DeleteOTAUpdateRequest deleteOTAUpdateRequest, ProtocolMarshaller protocolMarshaller) { if (deleteOTAUpdateRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(deleteOTAUpdateRequest.getOtaUpdateId(), OTAUPDATEID_BINDING); protocolMarshaller.marshall(deleteOTAUpdateRequest.getDeleteStream(), DELETESTREAM_BINDING); protocolMarshaller.marshall(deleteOTAUpdateRequest.getForceDeleteAWSJob(), FORCEDELETEAWSJOB_BINDING); } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } }
class class_name[name] begin[{] method[marshall, return_type[void], modifier[public], parameter[deleteOTAUpdateRequest, protocolMarshaller]] begin[{] if[binary_operation[member[.deleteOTAUpdateRequest], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Invalid argument passed to marshall(...)")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=SdkClientException, sub_type=None)), label=None) else begin[{] None end[}] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getOtaUpdateId, postfix_operators=[], prefix_operators=[], qualifier=deleteOTAUpdateRequest, selectors=[], type_arguments=None), MemberReference(member=OTAUPDATEID_BINDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=marshall, postfix_operators=[], prefix_operators=[], qualifier=protocolMarshaller, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getDeleteStream, postfix_operators=[], prefix_operators=[], qualifier=deleteOTAUpdateRequest, selectors=[], type_arguments=None), MemberReference(member=DELETESTREAM_BINDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=marshall, postfix_operators=[], prefix_operators=[], qualifier=protocolMarshaller, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getForceDeleteAWSJob, postfix_operators=[], prefix_operators=[], qualifier=deleteOTAUpdateRequest, selectors=[], type_arguments=None), MemberReference(member=FORCEDELETEAWSJOB_BINDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=marshall, postfix_operators=[], prefix_operators=[], qualifier=protocolMarshaller, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unable to marshall request to JSON: "), operandr=MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), operator=+), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=SdkClientException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[public] Keyword[void] identifier[marshall] operator[SEP] identifier[DeleteOTAUpdateRequest] identifier[deleteOTAUpdateRequest] , identifier[ProtocolMarshaller] identifier[protocolMarshaller] operator[SEP] { Keyword[if] operator[SEP] identifier[deleteOTAUpdateRequest] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[SdkClientException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[try] { identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[deleteOTAUpdateRequest] operator[SEP] identifier[getOtaUpdateId] operator[SEP] operator[SEP] , identifier[OTAUPDATEID_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[deleteOTAUpdateRequest] operator[SEP] identifier[getDeleteStream] operator[SEP] operator[SEP] , identifier[DELETESTREAM_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[deleteOTAUpdateRequest] operator[SEP] identifier[getForceDeleteAWSJob] operator[SEP] operator[SEP] , identifier[FORCEDELETEAWSJOB_BINDING] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[SdkClientException] operator[SEP] literal[String] operator[+] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP] } }
@Override @Transactional(enabled = false) public CommerceShipmentItem createCommerceShipmentItem( long commerceShipmentItemId) { return commerceShipmentItemPersistence.create(commerceShipmentItemId); }
class class_name[name] begin[{] method[createCommerceShipmentItem, return_type[type[CommerceShipmentItem]], modifier[public], parameter[commerceShipmentItemId]] begin[{] return[call[commerceShipmentItemPersistence.create, parameter[member[.commerceShipmentItemId]]]] end[}] END[}]
annotation[@] identifier[Override] annotation[@] identifier[Transactional] operator[SEP] identifier[enabled] operator[=] literal[boolean] operator[SEP] Keyword[public] identifier[CommerceShipmentItem] identifier[createCommerceShipmentItem] operator[SEP] Keyword[long] identifier[commerceShipmentItemId] operator[SEP] { Keyword[return] identifier[commerceShipmentItemPersistence] operator[SEP] identifier[create] operator[SEP] identifier[commerceShipmentItemId] operator[SEP] operator[SEP] }
protected static long getId4UUID(final UUID _typeUUID) throws CacheReloadException { long ret = 0; final Cache<UUID, Type> cache = InfinispanCache.get().<UUID, Type>getCache(Type.UUIDCACHE); if (cache.containsKey(_typeUUID)) { ret = cache.get(_typeUUID).getId(); } else { Connection con = null; try { con = Context.getConnection(); PreparedStatement stmt = null; try { stmt = con.prepareStatement(Type.SQL_UUID); stmt.setObject(1, _typeUUID.toString()); final ResultSet rs = stmt.executeQuery(); while (rs.next()) { ret = rs.getLong(1); } rs.close(); } finally { if (stmt != null) { stmt.close(); } } con.commit(); } catch (final SQLException e) { throw new CacheReloadException("could not read child type ids", e); } catch (final EFapsException e) { throw new CacheReloadException("could not read child type ids", e); } finally { try { if (con != null && !con.isClosed()) { con.close(); } } catch (final SQLException e) { throw new CacheReloadException("could not read child type ids", e); } } } return ret; }
class class_name[name] begin[{] method[getId4UUID, return_type[type[long]], modifier[static protected], parameter[_typeUUID]] begin[{] local_variable[type[long], ret] local_variable[type[Cache], cache] if[call[cache.containsKey, parameter[member[._typeUUID]]]] begin[{] assign[member[.ret], call[cache.get, parameter[member[._typeUUID]]]] else begin[{] local_variable[type[Connection], con] TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=con, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=getConnection, postfix_operators=[], prefix_operators=[], qualifier=Context, selectors=[], type_arguments=None)), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), name=stmt)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=PreparedStatement, sub_type=None)), TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=stmt, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=SQL_UUID, postfix_operators=[], prefix_operators=[], qualifier=Type, selectors=[])], member=prepareStatement, postfix_operators=[], prefix_operators=[], qualifier=con, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=_typeUUID, selectors=[], type_arguments=None)], member=setObject, postfix_operators=[], prefix_operators=[], qualifier=stmt, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=executeQuery, postfix_operators=[], prefix_operators=[], qualifier=stmt, selectors=[], type_arguments=None), name=rs)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=ResultSet, sub_type=None)), WhileStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=ret, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)], member=getLong, postfix_operators=[], prefix_operators=[], qualifier=rs, selectors=[], type_arguments=None)), label=None)]), condition=MethodInvocation(arguments=[], member=next, postfix_operators=[], prefix_operators=[], qualifier=rs, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=close, postfix_operators=[], prefix_operators=[], qualifier=rs, selectors=[], type_arguments=None), label=None)], catches=None, finally_block=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=stmt, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=close, postfix_operators=[], prefix_operators=[], qualifier=stmt, selectors=[], type_arguments=None), label=None)]))], label=None, resources=None), StatementExpression(expression=MethodInvocation(arguments=[], member=commit, postfix_operators=[], prefix_operators=[], qualifier=con, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="could not read child type ids"), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=CacheReloadException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['SQLException'])), CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="could not read child type ids"), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=CacheReloadException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['EFapsException']))], finally_block=[TryStatement(block=[IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=con, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), operandr=MethodInvocation(arguments=[], member=isClosed, postfix_operators=[], prefix_operators=['!'], qualifier=con, selectors=[], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=close, postfix_operators=[], prefix_operators=[], qualifier=con, selectors=[], type_arguments=None), label=None)]))], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="could not read child type ids"), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=CacheReloadException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['SQLException']))], finally_block=None, label=None, resources=None)], label=None, resources=None) end[}] return[member[.ret]] end[}] END[}]
Keyword[protected] Keyword[static] Keyword[long] identifier[getId4UUID] operator[SEP] Keyword[final] identifier[UUID] identifier[_typeUUID] operator[SEP] Keyword[throws] identifier[CacheReloadException] { Keyword[long] identifier[ret] operator[=] Other[0] operator[SEP] Keyword[final] identifier[Cache] operator[<] identifier[UUID] , identifier[Type] operator[>] identifier[cache] operator[=] identifier[InfinispanCache] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] operator[<] identifier[UUID] , identifier[Type] operator[>] identifier[getCache] operator[SEP] identifier[Type] operator[SEP] identifier[UUIDCACHE] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[cache] operator[SEP] identifier[containsKey] operator[SEP] identifier[_typeUUID] operator[SEP] operator[SEP] { identifier[ret] operator[=] identifier[cache] operator[SEP] identifier[get] operator[SEP] identifier[_typeUUID] operator[SEP] operator[SEP] identifier[getId] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { identifier[Connection] identifier[con] operator[=] Other[null] operator[SEP] Keyword[try] { identifier[con] operator[=] identifier[Context] operator[SEP] identifier[getConnection] operator[SEP] operator[SEP] operator[SEP] identifier[PreparedStatement] identifier[stmt] operator[=] Other[null] operator[SEP] Keyword[try] { identifier[stmt] operator[=] identifier[con] operator[SEP] identifier[prepareStatement] operator[SEP] identifier[Type] operator[SEP] identifier[SQL_UUID] operator[SEP] operator[SEP] identifier[stmt] operator[SEP] identifier[setObject] operator[SEP] Other[1] , identifier[_typeUUID] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[ResultSet] identifier[rs] operator[=] identifier[stmt] operator[SEP] identifier[executeQuery] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[rs] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] { identifier[ret] operator[=] identifier[rs] operator[SEP] identifier[getLong] operator[SEP] Other[1] operator[SEP] operator[SEP] } identifier[rs] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP] } Keyword[finally] { Keyword[if] operator[SEP] identifier[stmt] operator[!=] Other[null] operator[SEP] { identifier[stmt] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP] } } identifier[con] operator[SEP] identifier[commit] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] Keyword[final] identifier[SQLException] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[CacheReloadException] operator[SEP] literal[String] , identifier[e] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] Keyword[final] identifier[EFapsException] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[CacheReloadException] operator[SEP] literal[String] , identifier[e] operator[SEP] operator[SEP] } Keyword[finally] { Keyword[try] { Keyword[if] operator[SEP] identifier[con] operator[!=] Other[null] operator[&&] operator[!] identifier[con] operator[SEP] identifier[isClosed] operator[SEP] operator[SEP] operator[SEP] { identifier[con] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP] } } Keyword[catch] operator[SEP] Keyword[final] identifier[SQLException] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[CacheReloadException] operator[SEP] literal[String] , identifier[e] operator[SEP] operator[SEP] } } } Keyword[return] identifier[ret] operator[SEP] }
@Inline(value="$2.$3copyOf($1)", imported=ImmutableMap.class) public static <K, V> Map<K, V> immutableCopy(Map<? extends K, ? extends V> map) { return ImmutableMap.copyOf(map); }
class class_name[name] begin[{] method[immutableCopy, return_type[type[Map]], modifier[public static], parameter[map]] begin[{] return[call[ImmutableMap.copyOf, parameter[member[.map]]]] end[}] END[}]
annotation[@] identifier[Inline] operator[SEP] identifier[value] operator[=] literal[String] , identifier[imported] operator[=] identifier[ImmutableMap] operator[SEP] Keyword[class] operator[SEP] Keyword[public] Keyword[static] operator[<] identifier[K] , identifier[V] operator[>] identifier[Map] operator[<] identifier[K] , identifier[V] operator[>] identifier[immutableCopy] operator[SEP] identifier[Map] operator[<] operator[?] Keyword[extends] identifier[K] , operator[?] Keyword[extends] identifier[V] operator[>] identifier[map] operator[SEP] { Keyword[return] identifier[ImmutableMap] operator[SEP] identifier[copyOf] operator[SEP] identifier[map] operator[SEP] operator[SEP] }
@Deprecated public void setPrimaryKeys(String... primaryKeyFieldName) { setProp(ConfigurationKeys.EXTRACT_PRIMARY_KEY_FIELDS_KEY, Joiner.on(",").join(primaryKeyFieldName)); }
class class_name[name] begin[{] method[setPrimaryKeys, return_type[void], modifier[public], parameter[primaryKeyFieldName]] begin[{] call[.setProp, parameter[member[ConfigurationKeys.EXTRACT_PRIMARY_KEY_FIELDS_KEY], call[Joiner.on, parameter[literal[","]]]]] end[}] END[}]
annotation[@] identifier[Deprecated] Keyword[public] Keyword[void] identifier[setPrimaryKeys] operator[SEP] identifier[String] operator[...] identifier[primaryKeyFieldName] operator[SEP] { identifier[setProp] operator[SEP] identifier[ConfigurationKeys] operator[SEP] identifier[EXTRACT_PRIMARY_KEY_FIELDS_KEY] , identifier[Joiner] operator[SEP] identifier[on] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[join] operator[SEP] identifier[primaryKeyFieldName] operator[SEP] operator[SEP] operator[SEP] }
private List getLocales() { ArrayList ret = new ArrayList(); try { Iterator i = OpenCms.getLocaleManager().getAvailableLocales().iterator(); // loop through all local's and build the entries while (i.hasNext()) { Locale locale = (Locale)i.next(); String language = locale.getLanguage(); String displayLanguage = locale.getDisplayLanguage(); ret.add(new CmsSelectWidgetOption(language, false, displayLanguage)); } } catch (Exception e) { // not necessary } return ret; }
class class_name[name] begin[{] method[getLocales, return_type[type[List]], modifier[private], parameter[]] begin[{] local_variable[type[ArrayList], ret] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getLocaleManager, postfix_operators=[], prefix_operators=[], qualifier=OpenCms, selectors=[MethodInvocation(arguments=[], member=getAvailableLocales, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[], member=iterator, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=i)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Iterator, sub_type=None)), WhileStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MethodInvocation(arguments=[], member=next, postfix_operators=[], prefix_operators=[], qualifier=i, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=Locale, sub_type=None)), name=locale)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Locale, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getLanguage, postfix_operators=[], prefix_operators=[], qualifier=locale, selectors=[], type_arguments=None), name=language)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getDisplayLanguage, postfix_operators=[], prefix_operators=[], qualifier=locale, selectors=[], type_arguments=None), name=displayLanguage)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[ClassCreator(arguments=[MemberReference(member=language, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), MemberReference(member=displayLanguage, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=CmsSelectWidgetOption, sub_type=None))], member=add, postfix_operators=[], prefix_operators=[], qualifier=ret, selectors=[], type_arguments=None), label=None)]), condition=MethodInvocation(arguments=[], member=hasNext, postfix_operators=[], prefix_operators=[], qualifier=i, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None) return[member[.ret]] end[}] END[}]
Keyword[private] identifier[List] identifier[getLocales] operator[SEP] operator[SEP] { identifier[ArrayList] identifier[ret] operator[=] Keyword[new] identifier[ArrayList] operator[SEP] operator[SEP] operator[SEP] Keyword[try] { identifier[Iterator] identifier[i] operator[=] identifier[OpenCms] operator[SEP] identifier[getLocaleManager] operator[SEP] operator[SEP] operator[SEP] identifier[getAvailableLocales] operator[SEP] operator[SEP] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[i] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] { identifier[Locale] identifier[locale] operator[=] operator[SEP] identifier[Locale] operator[SEP] identifier[i] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[language] operator[=] identifier[locale] operator[SEP] identifier[getLanguage] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[displayLanguage] operator[=] identifier[locale] operator[SEP] identifier[getDisplayLanguage] operator[SEP] operator[SEP] operator[SEP] identifier[ret] operator[SEP] identifier[add] operator[SEP] Keyword[new] identifier[CmsSelectWidgetOption] operator[SEP] identifier[language] , literal[boolean] , identifier[displayLanguage] operator[SEP] operator[SEP] operator[SEP] } } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { } Keyword[return] identifier[ret] operator[SEP] }
@Nullable public static SegmentId tryParse(String dataSource, String segmentId) { List<SegmentId> possibleParsings = iteratePossibleParsingsWithDataSource(dataSource, segmentId); return possibleParsings.isEmpty() ? null : possibleParsings.get(0); }
class class_name[name] begin[{] method[tryParse, return_type[type[SegmentId]], modifier[public static], parameter[dataSource, segmentId]] begin[{] local_variable[type[List], possibleParsings] return[TernaryExpression(condition=MethodInvocation(arguments=[], member=isEmpty, postfix_operators=[], prefix_operators=[], qualifier=possibleParsings, selectors=[], type_arguments=None), if_false=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], member=get, postfix_operators=[], prefix_operators=[], qualifier=possibleParsings, selectors=[], type_arguments=None), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null))] end[}] END[}]
annotation[@] identifier[Nullable] Keyword[public] Keyword[static] identifier[SegmentId] identifier[tryParse] operator[SEP] identifier[String] identifier[dataSource] , identifier[String] identifier[segmentId] operator[SEP] { identifier[List] operator[<] identifier[SegmentId] operator[>] identifier[possibleParsings] operator[=] identifier[iteratePossibleParsingsWithDataSource] operator[SEP] identifier[dataSource] , identifier[segmentId] operator[SEP] operator[SEP] Keyword[return] identifier[possibleParsings] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[?] Other[null] operator[:] identifier[possibleParsings] operator[SEP] identifier[get] operator[SEP] Other[0] operator[SEP] operator[SEP] }
@ManyToOne( cascade = {CascadeType.PERSIST, CascadeType.ALL} ) @JoinColumn(name="REQUIREMENT_ID") public Requirement getRequirement() { return requirement; }
class class_name[name] begin[{] method[getRequirement, return_type[type[Requirement]], modifier[public], parameter[]] begin[{] return[member[.requirement]] end[}] END[}]
annotation[@] identifier[ManyToOne] operator[SEP] identifier[cascade] operator[=] { identifier[CascadeType] operator[SEP] identifier[PERSIST] , identifier[CascadeType] operator[SEP] identifier[ALL] } operator[SEP] annotation[@] identifier[JoinColumn] operator[SEP] identifier[name] operator[=] literal[String] operator[SEP] Keyword[public] identifier[Requirement] identifier[getRequirement] operator[SEP] operator[SEP] { Keyword[return] identifier[requirement] operator[SEP] }
public AABBd union(AABBd other, AABBd dest) { dest.minX = this.minX < other.minX ? this.minX : other.minX; dest.minY = this.minY < other.minY ? this.minY : other.minY; dest.minZ = this.minZ < other.minZ ? this.minZ : other.minZ; dest.maxX = this.maxX > other.maxX ? this.maxX : other.maxX; dest.maxY = this.maxY > other.maxY ? this.maxY : other.maxY; dest.maxZ = this.maxZ > other.maxZ ? this.maxZ : other.maxZ; return dest; }
class class_name[name] begin[{] method[union, return_type[type[AABBd]], modifier[public], parameter[other, dest]] begin[{] assign[member[dest.minX], TernaryExpression(condition=BinaryOperation(operandl=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=minX, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), operandr=MemberReference(member=minX, postfix_operators=[], prefix_operators=[], qualifier=other, selectors=[]), operator=<), if_false=MemberReference(member=minX, postfix_operators=[], prefix_operators=[], qualifier=other, selectors=[]), if_true=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=minX, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]))] assign[member[dest.minY], TernaryExpression(condition=BinaryOperation(operandl=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=minY, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), operandr=MemberReference(member=minY, postfix_operators=[], prefix_operators=[], qualifier=other, selectors=[]), operator=<), if_false=MemberReference(member=minY, postfix_operators=[], prefix_operators=[], qualifier=other, selectors=[]), if_true=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=minY, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]))] assign[member[dest.minZ], TernaryExpression(condition=BinaryOperation(operandl=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=minZ, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), operandr=MemberReference(member=minZ, postfix_operators=[], prefix_operators=[], qualifier=other, selectors=[]), operator=<), if_false=MemberReference(member=minZ, postfix_operators=[], prefix_operators=[], qualifier=other, selectors=[]), if_true=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=minZ, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]))] assign[member[dest.maxX], TernaryExpression(condition=BinaryOperation(operandl=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=maxX, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), operandr=MemberReference(member=maxX, postfix_operators=[], prefix_operators=[], qualifier=other, selectors=[]), operator=>), if_false=MemberReference(member=maxX, postfix_operators=[], prefix_operators=[], qualifier=other, selectors=[]), if_true=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=maxX, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]))] assign[member[dest.maxY], TernaryExpression(condition=BinaryOperation(operandl=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=maxY, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), operandr=MemberReference(member=maxY, postfix_operators=[], prefix_operators=[], qualifier=other, selectors=[]), operator=>), if_false=MemberReference(member=maxY, postfix_operators=[], prefix_operators=[], qualifier=other, selectors=[]), if_true=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=maxY, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]))] assign[member[dest.maxZ], TernaryExpression(condition=BinaryOperation(operandl=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=maxZ, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), operandr=MemberReference(member=maxZ, postfix_operators=[], prefix_operators=[], qualifier=other, selectors=[]), operator=>), if_false=MemberReference(member=maxZ, postfix_operators=[], prefix_operators=[], qualifier=other, selectors=[]), if_true=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=maxZ, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]))] return[member[.dest]] end[}] END[}]
Keyword[public] identifier[AABBd] identifier[union] operator[SEP] identifier[AABBd] identifier[other] , identifier[AABBd] identifier[dest] operator[SEP] { identifier[dest] operator[SEP] identifier[minX] operator[=] Keyword[this] operator[SEP] identifier[minX] operator[<] identifier[other] operator[SEP] identifier[minX] operator[?] Keyword[this] operator[SEP] identifier[minX] operator[:] identifier[other] operator[SEP] identifier[minX] operator[SEP] identifier[dest] operator[SEP] identifier[minY] operator[=] Keyword[this] operator[SEP] identifier[minY] operator[<] identifier[other] operator[SEP] identifier[minY] operator[?] Keyword[this] operator[SEP] identifier[minY] operator[:] identifier[other] operator[SEP] identifier[minY] operator[SEP] identifier[dest] operator[SEP] identifier[minZ] operator[=] Keyword[this] operator[SEP] identifier[minZ] operator[<] identifier[other] operator[SEP] identifier[minZ] operator[?] Keyword[this] operator[SEP] identifier[minZ] operator[:] identifier[other] operator[SEP] identifier[minZ] operator[SEP] identifier[dest] operator[SEP] identifier[maxX] operator[=] Keyword[this] operator[SEP] identifier[maxX] operator[>] identifier[other] operator[SEP] identifier[maxX] operator[?] Keyword[this] operator[SEP] identifier[maxX] operator[:] identifier[other] operator[SEP] identifier[maxX] operator[SEP] identifier[dest] operator[SEP] identifier[maxY] operator[=] Keyword[this] operator[SEP] identifier[maxY] operator[>] identifier[other] operator[SEP] identifier[maxY] operator[?] Keyword[this] operator[SEP] identifier[maxY] operator[:] identifier[other] operator[SEP] identifier[maxY] operator[SEP] identifier[dest] operator[SEP] identifier[maxZ] operator[=] Keyword[this] operator[SEP] identifier[maxZ] operator[>] identifier[other] operator[SEP] identifier[maxZ] operator[?] Keyword[this] operator[SEP] identifier[maxZ] operator[:] identifier[other] operator[SEP] identifier[maxZ] operator[SEP] Keyword[return] identifier[dest] operator[SEP] }
public static String getTagAttr(StringBuilder page, final String tag, final String attr) { String found = null; Pattern daPattern = TagMagix.getPattern(tag, attr); Matcher matcher = daPattern.matcher(page); int idx = 0; if (matcher.find(idx)) { found = matcher.group(1); found = trimAttrValue(found); } return found; }
class class_name[name] begin[{] method[getTagAttr, return_type[type[String]], modifier[public static], parameter[page, tag, attr]] begin[{] local_variable[type[String], found] local_variable[type[Pattern], daPattern] local_variable[type[Matcher], matcher] local_variable[type[int], idx] if[call[matcher.find, parameter[member[.idx]]]] begin[{] assign[member[.found], call[matcher.group, parameter[literal[1]]]] assign[member[.found], call[.trimAttrValue, parameter[member[.found]]]] else begin[{] None end[}] return[member[.found]] end[}] END[}]
Keyword[public] Keyword[static] identifier[String] identifier[getTagAttr] operator[SEP] identifier[StringBuilder] identifier[page] , Keyword[final] identifier[String] identifier[tag] , Keyword[final] identifier[String] identifier[attr] operator[SEP] { identifier[String] identifier[found] operator[=] Other[null] operator[SEP] identifier[Pattern] identifier[daPattern] operator[=] identifier[TagMagix] operator[SEP] identifier[getPattern] operator[SEP] identifier[tag] , identifier[attr] operator[SEP] operator[SEP] identifier[Matcher] identifier[matcher] operator[=] identifier[daPattern] operator[SEP] identifier[matcher] operator[SEP] identifier[page] operator[SEP] operator[SEP] Keyword[int] identifier[idx] operator[=] Other[0] operator[SEP] Keyword[if] operator[SEP] identifier[matcher] operator[SEP] identifier[find] operator[SEP] identifier[idx] operator[SEP] operator[SEP] { identifier[found] operator[=] identifier[matcher] operator[SEP] identifier[group] operator[SEP] Other[1] operator[SEP] operator[SEP] identifier[found] operator[=] identifier[trimAttrValue] operator[SEP] identifier[found] operator[SEP] operator[SEP] } Keyword[return] identifier[found] operator[SEP] }
public static String selectJavaDateTimeFormatFromMomentJSFormatOrDefault(Locale locale, String momentJSFormat, boolean withDate, boolean withTime) { if (momentJSFormat == null) { String dateFormat = ""; if (withDate) { dateFormat = ((SimpleDateFormat) DateFormat.getDateInstance(DateFormat.SHORT, locale)).toPattern(); } String timeFormat = ""; if (withTime) { timeFormat = ((SimpleDateFormat)DateFormat.getTimeInstance(DateFormat.MEDIUM, locale)).toPattern(); } // Since DateFormat.SHORT is silly, return a smart format if (dateFormat.equals("M/d/yy")) { dateFormat = "MM/dd/yyyy"; } else if (dateFormat.equals("d/M/yy")) { dateFormat = "dd/MM/yyyy"; } return (dateFormat + " " + timeFormat).trim(); } else { return LocaleUtils.momentToJavaFormat(momentJSFormat); } }
class class_name[name] begin[{] method[selectJavaDateTimeFormatFromMomentJSFormatOrDefault, return_type[type[String]], modifier[public static], parameter[locale, momentJSFormat, withDate, withTime]] begin[{] if[binary_operation[member[.momentJSFormat], ==, literal[null]]] begin[{] local_variable[type[String], dateFormat] if[member[.withDate]] begin[{] assign[member[.dateFormat], Cast(expression=MethodInvocation(arguments=[MemberReference(member=SHORT, postfix_operators=[], prefix_operators=[], qualifier=DateFormat, selectors=[]), MemberReference(member=locale, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getDateInstance, postfix_operators=[], prefix_operators=[], qualifier=DateFormat, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=SimpleDateFormat, sub_type=None))] else begin[{] None end[}] local_variable[type[String], timeFormat] if[member[.withTime]] begin[{] assign[member[.timeFormat], Cast(expression=MethodInvocation(arguments=[MemberReference(member=MEDIUM, postfix_operators=[], prefix_operators=[], qualifier=DateFormat, selectors=[]), MemberReference(member=locale, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getTimeInstance, postfix_operators=[], prefix_operators=[], qualifier=DateFormat, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=SimpleDateFormat, sub_type=None))] else begin[{] None end[}] if[call[dateFormat.equals, parameter[literal["M/d/yy"]]]] begin[{] assign[member[.dateFormat], literal["MM/dd/yyyy"]] else begin[{] if[call[dateFormat.equals, parameter[literal["d/M/yy"]]]] begin[{] assign[member[.dateFormat], literal["dd/MM/yyyy"]] else begin[{] None end[}] end[}] return[binary_operation[binary_operation[member[.dateFormat], +, literal[" "]], +, member[.timeFormat]]] else begin[{] return[call[LocaleUtils.momentToJavaFormat, parameter[member[.momentJSFormat]]]] end[}] end[}] END[}]
Keyword[public] Keyword[static] identifier[String] identifier[selectJavaDateTimeFormatFromMomentJSFormatOrDefault] operator[SEP] identifier[Locale] identifier[locale] , identifier[String] identifier[momentJSFormat] , Keyword[boolean] identifier[withDate] , Keyword[boolean] identifier[withTime] operator[SEP] { Keyword[if] operator[SEP] identifier[momentJSFormat] operator[==] Other[null] operator[SEP] { identifier[String] identifier[dateFormat] operator[=] literal[String] operator[SEP] Keyword[if] operator[SEP] identifier[withDate] operator[SEP] { identifier[dateFormat] operator[=] operator[SEP] operator[SEP] identifier[SimpleDateFormat] operator[SEP] identifier[DateFormat] operator[SEP] identifier[getDateInstance] operator[SEP] identifier[DateFormat] operator[SEP] identifier[SHORT] , identifier[locale] operator[SEP] operator[SEP] operator[SEP] identifier[toPattern] operator[SEP] operator[SEP] operator[SEP] } identifier[String] identifier[timeFormat] operator[=] literal[String] operator[SEP] Keyword[if] operator[SEP] identifier[withTime] operator[SEP] { identifier[timeFormat] operator[=] operator[SEP] operator[SEP] identifier[SimpleDateFormat] operator[SEP] identifier[DateFormat] operator[SEP] identifier[getTimeInstance] operator[SEP] identifier[DateFormat] operator[SEP] identifier[MEDIUM] , identifier[locale] operator[SEP] operator[SEP] operator[SEP] identifier[toPattern] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[dateFormat] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] { identifier[dateFormat] operator[=] literal[String] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[dateFormat] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] { identifier[dateFormat] operator[=] literal[String] operator[SEP] } Keyword[return] operator[SEP] identifier[dateFormat] operator[+] literal[String] operator[+] identifier[timeFormat] operator[SEP] operator[SEP] identifier[trim] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { Keyword[return] identifier[LocaleUtils] operator[SEP] identifier[momentToJavaFormat] operator[SEP] identifier[momentJSFormat] operator[SEP] operator[SEP] } }
public static <E> E argmin(Counter<E> c) { double min = Double.POSITIVE_INFINITY; E argmin = null; for (E key : c.keySet()) { double count = c.getCount(key); if (argmin == null || count < min) {// || (count == min && // tieBreaker.compare(key, argmin) < // 0)) { min = count; argmin = key; } } return argmin; }
class class_name[name] begin[{] method[argmin, return_type[type[E]], modifier[public static], parameter[c]] begin[{] local_variable[type[double], min] local_variable[type[E], argmin] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getCount, postfix_operators=[], prefix_operators=[], qualifier=c, selectors=[], type_arguments=None), name=count)], modifiers=set(), type=BasicType(dimensions=[], name=double)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=argmin, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), operandr=BinaryOperation(operandl=MemberReference(member=count, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=min, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), operator=||), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=min, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=count, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=argmin, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None)]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=keySet, postfix_operators=[], prefix_operators=[], qualifier=c, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=key)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=E, sub_type=None))), label=None) return[member[.argmin]] end[}] END[}]
Keyword[public] Keyword[static] operator[<] identifier[E] operator[>] identifier[E] identifier[argmin] operator[SEP] identifier[Counter] operator[<] identifier[E] operator[>] identifier[c] operator[SEP] { Keyword[double] identifier[min] operator[=] identifier[Double] operator[SEP] identifier[POSITIVE_INFINITY] operator[SEP] identifier[E] identifier[argmin] operator[=] Other[null] operator[SEP] Keyword[for] operator[SEP] identifier[E] identifier[key] operator[:] identifier[c] operator[SEP] identifier[keySet] operator[SEP] operator[SEP] operator[SEP] { Keyword[double] identifier[count] operator[=] identifier[c] operator[SEP] identifier[getCount] operator[SEP] identifier[key] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[argmin] operator[==] Other[null] operator[||] identifier[count] operator[<] identifier[min] operator[SEP] { identifier[min] operator[=] identifier[count] operator[SEP] identifier[argmin] operator[=] identifier[key] operator[SEP] } } Keyword[return] identifier[argmin] operator[SEP] }
public void init(Record record, BaseField fldDest, BaseField fldSource, Converter convCheckMark, boolean bMoveOnNew, boolean bMoveOnValid, boolean bMoveOnSelect, boolean bMoveOnAdd, boolean bMoveOnUpdate, String strSource, boolean bDontMoveNullSource) { m_fldDest = fldDest; m_fldSource = fldSource; m_convCheckMark = convCheckMark; m_strSource = strSource; m_bMoveOnNew = bMoveOnNew; m_bMoveOnValid = bMoveOnValid; m_bMoveOnSelect = bMoveOnSelect; m_bMoveOnAdd = bMoveOnAdd; m_bMoveOnUpdate = bMoveOnUpdate; m_bDontMoveNullSource = bDontMoveNullSource; super.init(record); }
class class_name[name] begin[{] method[init, return_type[void], modifier[public], parameter[record, fldDest, fldSource, convCheckMark, bMoveOnNew, bMoveOnValid, bMoveOnSelect, bMoveOnAdd, bMoveOnUpdate, strSource, bDontMoveNullSource]] begin[{] assign[member[.m_fldDest], member[.fldDest]] assign[member[.m_fldSource], member[.fldSource]] assign[member[.m_convCheckMark], member[.convCheckMark]] assign[member[.m_strSource], member[.strSource]] assign[member[.m_bMoveOnNew], member[.bMoveOnNew]] assign[member[.m_bMoveOnValid], member[.bMoveOnValid]] assign[member[.m_bMoveOnSelect], member[.bMoveOnSelect]] assign[member[.m_bMoveOnAdd], member[.bMoveOnAdd]] assign[member[.m_bMoveOnUpdate], member[.bMoveOnUpdate]] assign[member[.m_bDontMoveNullSource], member[.bDontMoveNullSource]] SuperMethodInvocation(arguments=[MemberReference(member=record, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=init, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None) end[}] END[}]
Keyword[public] Keyword[void] identifier[init] operator[SEP] identifier[Record] identifier[record] , identifier[BaseField] identifier[fldDest] , identifier[BaseField] identifier[fldSource] , identifier[Converter] identifier[convCheckMark] , Keyword[boolean] identifier[bMoveOnNew] , Keyword[boolean] identifier[bMoveOnValid] , Keyword[boolean] identifier[bMoveOnSelect] , Keyword[boolean] identifier[bMoveOnAdd] , Keyword[boolean] identifier[bMoveOnUpdate] , identifier[String] identifier[strSource] , Keyword[boolean] identifier[bDontMoveNullSource] operator[SEP] { identifier[m_fldDest] operator[=] identifier[fldDest] operator[SEP] identifier[m_fldSource] operator[=] identifier[fldSource] operator[SEP] identifier[m_convCheckMark] operator[=] identifier[convCheckMark] operator[SEP] identifier[m_strSource] operator[=] identifier[strSource] operator[SEP] identifier[m_bMoveOnNew] operator[=] identifier[bMoveOnNew] operator[SEP] identifier[m_bMoveOnValid] operator[=] identifier[bMoveOnValid] operator[SEP] identifier[m_bMoveOnSelect] operator[=] identifier[bMoveOnSelect] operator[SEP] identifier[m_bMoveOnAdd] operator[=] identifier[bMoveOnAdd] operator[SEP] identifier[m_bMoveOnUpdate] operator[=] identifier[bMoveOnUpdate] operator[SEP] identifier[m_bDontMoveNullSource] operator[=] identifier[bDontMoveNullSource] operator[SEP] Keyword[super] operator[SEP] identifier[init] operator[SEP] identifier[record] operator[SEP] operator[SEP] }
public void readLangs() { final ServletContext servletContext = AbstractServletListener.getServletContext(); @SuppressWarnings("unchecked") final Set<String> resourcePaths = servletContext.getResourcePaths("/plugins/" + dirName); for (final String resourcePath : resourcePaths) { if (resourcePath.contains("lang_") && resourcePath.endsWith(".properties")) { final String langFileName = StringUtils.substringAfter(resourcePath, "/plugins/" + dirName + "/"); final String key = langFileName.substring("lang_".length(), langFileName.lastIndexOf(".")); final Properties props = new Properties(); try { final File file = Latkes.getWebFile(resourcePath); props.load(new FileInputStream(file)); langs.put(key, props); } catch (final Exception e) { Logger.getLogger(getClass().getName()).log(Level.ERROR, "Get plugin[name=" + name + "]'s language configuration failed", e); } } } }
class class_name[name] begin[{] method[readLangs, return_type[void], modifier[public], parameter[]] begin[{] local_variable[type[ServletContext], servletContext] local_variable[type[Set], resourcePaths] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="lang_")], member=contains, postfix_operators=[], prefix_operators=[], qualifier=resourcePath, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=".properties")], member=endsWith, postfix_operators=[], prefix_operators=[], qualifier=resourcePath, selectors=[], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=resourcePath, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="/plugins/"), operandr=MemberReference(member=dirName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="/"), operator=+)], member=substringAfter, postfix_operators=[], prefix_operators=[], qualifier=StringUtils, selectors=[], type_arguments=None), name=langFileName)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[], member=length, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], value="lang_"), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=".")], member=lastIndexOf, postfix_operators=[], prefix_operators=[], qualifier=langFileName, selectors=[], type_arguments=None)], member=substring, postfix_operators=[], prefix_operators=[], qualifier=langFileName, selectors=[], type_arguments=None), name=key)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Properties, sub_type=None)), name=props)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=Properties, sub_type=None)), TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=resourcePath, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getWebFile, postfix_operators=[], prefix_operators=[], qualifier=Latkes, selectors=[], type_arguments=None), name=file)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=File, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[ClassCreator(arguments=[MemberReference(member=file, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=FileInputStream, sub_type=None))], member=load, postfix_operators=[], prefix_operators=[], qualifier=props, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=props, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=put, postfix_operators=[], prefix_operators=[], qualifier=langs, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getClass, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[], member=getName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=getLogger, postfix_operators=[], prefix_operators=[], qualifier=Logger, selectors=[MethodInvocation(arguments=[MemberReference(member=ERROR, postfix_operators=[], prefix_operators=[], qualifier=Level, selectors=[]), BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Get plugin[name="), operandr=MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="]'s language configuration failed"), operator=+), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=log, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=resourcePaths, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=resourcePath)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None) end[}] END[}]
Keyword[public] Keyword[void] identifier[readLangs] operator[SEP] operator[SEP] { Keyword[final] identifier[ServletContext] identifier[servletContext] operator[=] identifier[AbstractServletListener] operator[SEP] identifier[getServletContext] operator[SEP] operator[SEP] operator[SEP] annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] Keyword[final] identifier[Set] operator[<] identifier[String] operator[>] identifier[resourcePaths] operator[=] identifier[servletContext] operator[SEP] identifier[getResourcePaths] operator[SEP] literal[String] operator[+] identifier[dirName] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[final] identifier[String] identifier[resourcePath] operator[:] identifier[resourcePaths] operator[SEP] { Keyword[if] operator[SEP] identifier[resourcePath] operator[SEP] identifier[contains] operator[SEP] literal[String] operator[SEP] operator[&&] identifier[resourcePath] operator[SEP] identifier[endsWith] operator[SEP] literal[String] operator[SEP] operator[SEP] { Keyword[final] identifier[String] identifier[langFileName] operator[=] identifier[StringUtils] operator[SEP] identifier[substringAfter] operator[SEP] identifier[resourcePath] , literal[String] operator[+] identifier[dirName] operator[+] literal[String] operator[SEP] operator[SEP] Keyword[final] identifier[String] identifier[key] operator[=] identifier[langFileName] operator[SEP] identifier[substring] operator[SEP] literal[String] operator[SEP] identifier[length] operator[SEP] operator[SEP] , identifier[langFileName] operator[SEP] identifier[lastIndexOf] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[Properties] identifier[props] operator[=] Keyword[new] identifier[Properties] operator[SEP] operator[SEP] operator[SEP] Keyword[try] { Keyword[final] identifier[File] identifier[file] operator[=] identifier[Latkes] operator[SEP] identifier[getWebFile] operator[SEP] identifier[resourcePath] operator[SEP] operator[SEP] identifier[props] operator[SEP] identifier[load] operator[SEP] Keyword[new] identifier[FileInputStream] operator[SEP] identifier[file] operator[SEP] operator[SEP] operator[SEP] identifier[langs] operator[SEP] identifier[put] operator[SEP] identifier[key] , identifier[props] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] Keyword[final] identifier[Exception] identifier[e] operator[SEP] { identifier[Logger] operator[SEP] identifier[getLogger] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[log] operator[SEP] identifier[Level] operator[SEP] identifier[ERROR] , literal[String] operator[+] identifier[name] operator[+] literal[String] , identifier[e] operator[SEP] operator[SEP] } } } }
private static boolean isInChain(Group g) { ChemComp chemComp = g.getChemComp(); if (chemComp==null) { logger.warn("Warning: can't determine PolymerType for group "+g.getResidueNumber()+" ("+g.getPDBName()+"). Will consider it as non-nucleotide/non-protein type."); return false; } PolymerType polyType = chemComp.getPolymerType(); for (PolymerType protOnlyType: PolymerType.PROTEIN_ONLY) { if (polyType==protOnlyType) return true; } for (PolymerType protOnlyType: PolymerType.POLYNUCLEOTIDE_ONLY) { if (polyType==protOnlyType) return true; } return false; }
class class_name[name] begin[{] method[isInChain, return_type[type[boolean]], modifier[private static], parameter[g]] begin[{] local_variable[type[ChemComp], chemComp] if[binary_operation[member[.chemComp], ==, literal[null]]] begin[{] call[logger.warn, parameter[binary_operation[binary_operation[binary_operation[binary_operation[literal["Warning: can't determine PolymerType for group "], +, call[g.getResidueNumber, parameter[]]], +, literal[" ("]], +, call[g.getPDBName, parameter[]]], +, literal["). Will consider it as non-nucleotide/non-protein type."]]]] return[literal[false]] else begin[{] None end[}] local_variable[type[PolymerType], polyType] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=polyType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=protOnlyType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator===), else_statement=None, label=None, then_statement=ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true), label=None))]), control=EnhancedForControl(iterable=MemberReference(member=PROTEIN_ONLY, postfix_operators=[], prefix_operators=[], qualifier=PolymerType, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=protOnlyType)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=PolymerType, sub_type=None))), label=None) ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=polyType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=protOnlyType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator===), else_statement=None, label=None, then_statement=ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true), label=None))]), control=EnhancedForControl(iterable=MemberReference(member=POLYNUCLEOTIDE_ONLY, postfix_operators=[], prefix_operators=[], qualifier=PolymerType, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=protOnlyType)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=PolymerType, sub_type=None))), label=None) return[literal[false]] end[}] END[}]
Keyword[private] Keyword[static] Keyword[boolean] identifier[isInChain] operator[SEP] identifier[Group] identifier[g] operator[SEP] { identifier[ChemComp] identifier[chemComp] operator[=] identifier[g] operator[SEP] identifier[getChemComp] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[chemComp] operator[==] Other[null] operator[SEP] { identifier[logger] operator[SEP] identifier[warn] operator[SEP] literal[String] operator[+] identifier[g] operator[SEP] identifier[getResidueNumber] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[g] operator[SEP] identifier[getPDBName] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] Keyword[return] literal[boolean] operator[SEP] } identifier[PolymerType] identifier[polyType] operator[=] identifier[chemComp] operator[SEP] identifier[getPolymerType] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[PolymerType] identifier[protOnlyType] operator[:] identifier[PolymerType] operator[SEP] identifier[PROTEIN_ONLY] operator[SEP] { Keyword[if] operator[SEP] identifier[polyType] operator[==] identifier[protOnlyType] operator[SEP] Keyword[return] literal[boolean] operator[SEP] } Keyword[for] operator[SEP] identifier[PolymerType] identifier[protOnlyType] operator[:] identifier[PolymerType] operator[SEP] identifier[POLYNUCLEOTIDE_ONLY] operator[SEP] { Keyword[if] operator[SEP] identifier[polyType] operator[==] identifier[protOnlyType] operator[SEP] Keyword[return] literal[boolean] operator[SEP] } Keyword[return] literal[boolean] operator[SEP] }
void updateCss() { String formatterId = m_formatterSelect.getFormValueAsString(); CmsFormatterConfig formatter = m_elementBean.getFormatters().get(m_containerId).get(formatterId); Set<String> cssResources = formatter.getCssResources(); for (String cssResource : cssResources) { CmsDomUtil.ensureStyleSheetIncluded(cssResource); } if (formatter.hasInlineCss()) { ensureInlineCss(formatterId, formatter.getInlineCss()); } }
class class_name[name] begin[{] method[updateCss, return_type[void], modifier[default], parameter[]] begin[{] local_variable[type[String], formatterId] local_variable[type[CmsFormatterConfig], formatter] local_variable[type[Set], cssResources] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=cssResource, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=ensureStyleSheetIncluded, postfix_operators=[], prefix_operators=[], qualifier=CmsDomUtil, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=cssResources, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=cssResource)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None) if[call[formatter.hasInlineCss, parameter[]]] begin[{] call[.ensureInlineCss, parameter[member[.formatterId], call[formatter.getInlineCss, parameter[]]]] else begin[{] None end[}] end[}] END[}]
Keyword[void] identifier[updateCss] operator[SEP] operator[SEP] { identifier[String] identifier[formatterId] operator[=] identifier[m_formatterSelect] operator[SEP] identifier[getFormValueAsString] operator[SEP] operator[SEP] operator[SEP] identifier[CmsFormatterConfig] identifier[formatter] operator[=] identifier[m_elementBean] operator[SEP] identifier[getFormatters] operator[SEP] operator[SEP] operator[SEP] identifier[get] operator[SEP] identifier[m_containerId] operator[SEP] operator[SEP] identifier[get] operator[SEP] identifier[formatterId] operator[SEP] operator[SEP] identifier[Set] operator[<] identifier[String] operator[>] identifier[cssResources] operator[=] identifier[formatter] operator[SEP] identifier[getCssResources] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[String] identifier[cssResource] operator[:] identifier[cssResources] operator[SEP] { identifier[CmsDomUtil] operator[SEP] identifier[ensureStyleSheetIncluded] operator[SEP] identifier[cssResource] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[formatter] operator[SEP] identifier[hasInlineCss] operator[SEP] operator[SEP] operator[SEP] { identifier[ensureInlineCss] operator[SEP] identifier[formatterId] , identifier[formatter] operator[SEP] identifier[getInlineCss] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } }
private static void resumeRLS(RLSSuspendToken token) throws RLSInvalidSuspendTokenException { if (tc.isEntryEnabled()) Tr.entry(tc, "resumeRLS", token); synchronized(SUSPEND_LOCK) { try { _tokenManager.registerResume(token); } catch (RLSInvalidSuspendTokenException exc) { FFDCFilter.processException(exc, "com.ibm.ws.recoverylog.spi.RecoveryLogService.resume", "120"); if (tc.isEventEnabled()) Tr.event(tc, "Rethrow RLSInvalidSuspendTokenException - attempt to resume an invalid token", token); if (tc.isEntryEnabled()) Tr.exit(tc, "resumeRLS", exc); throw exc; } // Check if there are any outstanding suspends if (_tokenManager.isResumable()) { if (tc.isEventEnabled()) Tr.event(tc, "There are no outstanding suspends - resuming recovery log service"); Tr.info(tc, "CWRLS0002_RESUME_RLS", token); _isSuspended = false; // Notify all waiting threads that // normal service is resumed SUSPEND_LOCK.notifyAll(); } else { Tr.info(tc, "CWRLS0021_RESUME_ATTEMPT_RLS", token); if (tc.isEventEnabled()) Tr.event(tc, "There are still outstanding suspensions - recovery log service remains suspended"); } } if (tc.isEntryEnabled()) Tr.exit(tc, "resumeRLS"); }
class class_name[name] begin[{] method[resumeRLS, return_type[void], modifier[private static], parameter[token]] begin[{] if[call[tc.isEntryEnabled, parameter[]]] begin[{] call[Tr.entry, parameter[member[.tc], literal["resumeRLS"], member[.token]]] else begin[{] None end[}] SYNCHRONIZED[member[.SUSPEND_LOCK]] BEGIN[{] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=token, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=registerResume, postfix_operators=[], prefix_operators=[], qualifier=_tokenManager, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=exc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="com.ibm.ws.recoverylog.spi.RecoveryLogService.resume"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="120")], member=processException, postfix_operators=[], prefix_operators=[], qualifier=FFDCFilter, selectors=[], type_arguments=None), label=None), IfStatement(condition=MethodInvocation(arguments=[], member=isEventEnabled, postfix_operators=[], prefix_operators=[], qualifier=tc, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=tc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Rethrow RLSInvalidSuspendTokenException - attempt to resume an invalid token"), MemberReference(member=token, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=event, postfix_operators=[], prefix_operators=[], qualifier=Tr, selectors=[], type_arguments=None), label=None)), IfStatement(condition=MethodInvocation(arguments=[], member=isEntryEnabled, postfix_operators=[], prefix_operators=[], qualifier=tc, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=tc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="resumeRLS"), MemberReference(member=exc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=exit, postfix_operators=[], prefix_operators=[], qualifier=Tr, selectors=[], type_arguments=None), label=None)), ThrowStatement(expression=MemberReference(member=exc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=exc, types=['RLSInvalidSuspendTokenException']))], finally_block=None, label=None, resources=None) if[call[_tokenManager.isResumable, parameter[]]] begin[{] if[call[tc.isEventEnabled, parameter[]]] begin[{] call[Tr.event, parameter[member[.tc], literal["There are no outstanding suspends - resuming recovery log service"]]] else begin[{] None end[}] call[Tr.info, parameter[member[.tc], literal["CWRLS0002_RESUME_RLS"], member[.token]]] assign[member[._isSuspended], literal[false]] call[SUSPEND_LOCK.notifyAll, parameter[]] else begin[{] call[Tr.info, parameter[member[.tc], literal["CWRLS0021_RESUME_ATTEMPT_RLS"], member[.token]]] if[call[tc.isEventEnabled, parameter[]]] begin[{] call[Tr.event, parameter[member[.tc], literal["There are still outstanding suspensions - recovery log service remains suspended"]]] else begin[{] None end[}] end[}] END[}] if[call[tc.isEntryEnabled, parameter[]]] begin[{] call[Tr.exit, parameter[member[.tc], literal["resumeRLS"]]] else begin[{] None end[}] end[}] END[}]
Keyword[private] Keyword[static] Keyword[void] identifier[resumeRLS] operator[SEP] identifier[RLSSuspendToken] identifier[token] operator[SEP] Keyword[throws] identifier[RLSInvalidSuspendTokenException] { Keyword[if] operator[SEP] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[Tr] operator[SEP] identifier[entry] operator[SEP] identifier[tc] , literal[String] , identifier[token] operator[SEP] operator[SEP] Keyword[synchronized] operator[SEP] identifier[SUSPEND_LOCK] operator[SEP] { Keyword[try] { identifier[_tokenManager] operator[SEP] identifier[registerResume] operator[SEP] identifier[token] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[RLSInvalidSuspendTokenException] identifier[exc] operator[SEP] { identifier[FFDCFilter] operator[SEP] identifier[processException] operator[SEP] identifier[exc] , literal[String] , literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[tc] operator[SEP] identifier[isEventEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[Tr] operator[SEP] identifier[event] operator[SEP] identifier[tc] , literal[String] , identifier[token] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[Tr] operator[SEP] identifier[exit] operator[SEP] identifier[tc] , literal[String] , identifier[exc] operator[SEP] operator[SEP] Keyword[throw] identifier[exc] operator[SEP] } Keyword[if] operator[SEP] identifier[_tokenManager] operator[SEP] identifier[isResumable] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[tc] operator[SEP] identifier[isEventEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[Tr] operator[SEP] identifier[event] operator[SEP] identifier[tc] , literal[String] operator[SEP] operator[SEP] identifier[Tr] operator[SEP] identifier[info] operator[SEP] identifier[tc] , literal[String] , identifier[token] operator[SEP] operator[SEP] identifier[_isSuspended] operator[=] literal[boolean] operator[SEP] identifier[SUSPEND_LOCK] operator[SEP] identifier[notifyAll] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { identifier[Tr] operator[SEP] identifier[info] operator[SEP] identifier[tc] , literal[String] , identifier[token] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[tc] operator[SEP] identifier[isEventEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[Tr] operator[SEP] identifier[event] operator[SEP] identifier[tc] , literal[String] operator[SEP] operator[SEP] } } Keyword[if] operator[SEP] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[Tr] operator[SEP] identifier[exit] operator[SEP] identifier[tc] , literal[String] operator[SEP] operator[SEP] }
@Override public GetResourceShareInvitationsResult getResourceShareInvitations(GetResourceShareInvitationsRequest request) { request = beforeClientExecution(request); return executeGetResourceShareInvitations(request); }
class class_name[name] begin[{] method[getResourceShareInvitations, return_type[type[GetResourceShareInvitationsResult]], modifier[public], parameter[request]] begin[{] assign[member[.request], call[.beforeClientExecution, parameter[member[.request]]]] return[call[.executeGetResourceShareInvitations, parameter[member[.request]]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[GetResourceShareInvitationsResult] identifier[getResourceShareInvitations] operator[SEP] identifier[GetResourceShareInvitationsRequest] identifier[request] operator[SEP] { identifier[request] operator[=] identifier[beforeClientExecution] operator[SEP] identifier[request] operator[SEP] operator[SEP] Keyword[return] identifier[executeGetResourceShareInvitations] operator[SEP] identifier[request] operator[SEP] operator[SEP] }
public void setDataHome(String dir) { if (dir == null) { mDataHome = null; } else { setDataHomeFile(new File(dir)); } }
class class_name[name] begin[{] method[setDataHome, return_type[void], modifier[public], parameter[dir]] begin[{] if[binary_operation[member[.dir], ==, literal[null]]] begin[{] assign[member[.mDataHome], literal[null]] else begin[{] call[.setDataHomeFile, parameter[ClassCreator(arguments=[MemberReference(member=dir, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=File, sub_type=None))]] end[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[setDataHome] operator[SEP] identifier[String] identifier[dir] operator[SEP] { Keyword[if] operator[SEP] identifier[dir] operator[==] Other[null] operator[SEP] { identifier[mDataHome] operator[=] Other[null] operator[SEP] } Keyword[else] { identifier[setDataHomeFile] operator[SEP] Keyword[new] identifier[File] operator[SEP] identifier[dir] operator[SEP] operator[SEP] operator[SEP] } }
public Object remove(String key) { if (key==null) { Object oldValue=_nullValue; if (_nullEntry!=null) { _entrySet.remove(_nullEntry); _nullEntry=null; _nullValue=null; } return oldValue; } Node node = _root; int ni=-1; // look for best match charLoop: for (int i=0;i<key.length();i++) { char c=key.charAt(i); // Advance node if (ni==-1) { ni=0; node=(node._children==null)?null:node._children[c%_width]; } // While we have a node to try while (node!=null) { // If it is a matching node, goto next char if (node._char[ni]==c || _ignoreCase&&node._ochar[ni]==c) { ni++; if (ni==node._char.length) ni=-1; continue charLoop; } // No char match, so if mid node then no match at all. if (ni>0) return null; // try next in chain node=node._next; } return null; } if (ni>0) return null; if (node==null || node._key==null) return null; Object old = node._value; _entrySet.remove(node); node._value=null; node._key=null; return old; }
class class_name[name] begin[{] method[remove, return_type[type[Object]], modifier[public], parameter[key]] begin[{] if[binary_operation[member[.key], ==, literal[null]]] begin[{] local_variable[type[Object], oldValue] if[binary_operation[member[._nullEntry], !=, literal[null]]] begin[{] call[_entrySet.remove, parameter[member[._nullEntry]]] assign[member[._nullEntry], literal[null]] assign[member[._nullValue], literal[null]] else begin[{] None end[}] return[member[.oldValue]] else begin[{] None end[}] local_variable[type[Node], node] local_variable[type[int], ni] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=charAt, postfix_operators=[], prefix_operators=[], qualifier=key, selectors=[], type_arguments=None), name=c)], modifiers=set(), type=BasicType(dimensions=[], name=char)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=ni, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=['-'], qualifier=None, selectors=[], value=1), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=ni, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=node, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=_children, postfix_operators=[], prefix_operators=[], qualifier=node, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), if_false=MemberReference(member=_children, postfix_operators=[], prefix_operators=[], qualifier=node, selectors=[ArraySelector(index=BinaryOperation(operandl=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=_width, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=%))]), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null))), label=None)])), WhileStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=_char, postfix_operators=[], prefix_operators=[], qualifier=node, selectors=[ArraySelector(index=MemberReference(member=ni, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operandr=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator===), operandr=BinaryOperation(operandl=MemberReference(member=_ignoreCase, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=BinaryOperation(operandl=MemberReference(member=_ochar, postfix_operators=[], prefix_operators=[], qualifier=node, selectors=[ArraySelector(index=MemberReference(member=ni, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operandr=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator===), operator=&&), operator=||), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MemberReference(member=ni, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=ni, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=node._char, selectors=[]), operator===), else_statement=None, label=None, then_statement=StatementExpression(expression=Assignment(expressionl=MemberReference(member=ni, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=['-'], qualifier=None, selectors=[], value=1)), label=None)), ContinueStatement(goto=charLoop, label=None)])), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=ni, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>), else_statement=None, label=None, then_statement=ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), label=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=node, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=_next, postfix_operators=[], prefix_operators=[], qualifier=node, selectors=[])), label=None)]), condition=BinaryOperation(operandl=MemberReference(member=node, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), label=None), ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=length, postfix_operators=[], prefix_operators=[], qualifier=key, selectors=[], type_arguments=None), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=charLoop) if[binary_operation[member[.ni], >, literal[0]]] begin[{] return[literal[null]] else begin[{] None end[}] if[binary_operation[binary_operation[member[.node], ==, literal[null]], ||, binary_operation[member[node._key], ==, literal[null]]]] begin[{] return[literal[null]] else begin[{] None end[}] local_variable[type[Object], old] call[_entrySet.remove, parameter[member[.node]]] assign[member[node._value], literal[null]] assign[member[node._key], literal[null]] return[member[.old]] end[}] END[}]
Keyword[public] identifier[Object] identifier[remove] operator[SEP] identifier[String] identifier[key] operator[SEP] { Keyword[if] operator[SEP] identifier[key] operator[==] Other[null] operator[SEP] { identifier[Object] identifier[oldValue] operator[=] identifier[_nullValue] operator[SEP] Keyword[if] operator[SEP] identifier[_nullEntry] operator[!=] Other[null] operator[SEP] { identifier[_entrySet] operator[SEP] identifier[remove] operator[SEP] identifier[_nullEntry] operator[SEP] operator[SEP] identifier[_nullEntry] operator[=] Other[null] operator[SEP] identifier[_nullValue] operator[=] Other[null] operator[SEP] } Keyword[return] identifier[oldValue] operator[SEP] } identifier[Node] identifier[node] operator[=] identifier[_root] operator[SEP] Keyword[int] identifier[ni] operator[=] operator[-] Other[1] operator[SEP] identifier[charLoop] operator[:] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[key] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] identifier[i] operator[++] operator[SEP] { Keyword[char] identifier[c] operator[=] identifier[key] operator[SEP] identifier[charAt] operator[SEP] identifier[i] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[ni] operator[==] operator[-] Other[1] operator[SEP] { identifier[ni] operator[=] Other[0] operator[SEP] identifier[node] operator[=] operator[SEP] identifier[node] operator[SEP] identifier[_children] operator[==] Other[null] operator[SEP] operator[?] Other[null] operator[:] identifier[node] operator[SEP] identifier[_children] operator[SEP] identifier[c] operator[%] identifier[_width] operator[SEP] operator[SEP] } Keyword[while] operator[SEP] identifier[node] operator[!=] Other[null] operator[SEP] { Keyword[if] operator[SEP] identifier[node] operator[SEP] identifier[_char] operator[SEP] identifier[ni] operator[SEP] operator[==] identifier[c] operator[||] identifier[_ignoreCase] operator[&&] identifier[node] operator[SEP] identifier[_ochar] operator[SEP] identifier[ni] operator[SEP] operator[==] identifier[c] operator[SEP] { identifier[ni] operator[++] operator[SEP] Keyword[if] operator[SEP] identifier[ni] operator[==] identifier[node] operator[SEP] identifier[_char] operator[SEP] identifier[length] operator[SEP] identifier[ni] operator[=] operator[-] Other[1] operator[SEP] Keyword[continue] identifier[charLoop] operator[SEP] } Keyword[if] operator[SEP] identifier[ni] operator[>] Other[0] operator[SEP] Keyword[return] Other[null] operator[SEP] identifier[node] operator[=] identifier[node] operator[SEP] identifier[_next] operator[SEP] } Keyword[return] Other[null] operator[SEP] } Keyword[if] operator[SEP] identifier[ni] operator[>] Other[0] operator[SEP] Keyword[return] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[node] operator[==] Other[null] operator[||] identifier[node] operator[SEP] identifier[_key] operator[==] Other[null] operator[SEP] Keyword[return] Other[null] operator[SEP] identifier[Object] identifier[old] operator[=] identifier[node] operator[SEP] identifier[_value] operator[SEP] identifier[_entrySet] operator[SEP] identifier[remove] operator[SEP] identifier[node] operator[SEP] operator[SEP] identifier[node] operator[SEP] identifier[_value] operator[=] Other[null] operator[SEP] identifier[node] operator[SEP] identifier[_key] operator[=] Other[null] operator[SEP] Keyword[return] identifier[old] operator[SEP] }
private int getExtendedState(SynthContext ctx, Values v) { JComponent c = ctx.getComponent(); int xstate = 0; int mask = 1; // check for the SeaGlass.State client property // Performance NOTE: getClientProperty ends up inside a synchronized // block, so there is some potential for performance issues here, // however I'm not certain that there is one on a modern VM. Object property = c.getClientProperty("SeaGlass.State"); if (property != null) { String stateNames = property.toString(); String[] states = stateNames.split("\\+"); if (v.stateTypes == null) { // standard states only for (String stateStr : states) { State.StandardState s = State.getStandardState(stateStr); if (s != null) xstate |= s.getState(); } } else { // custom states for (State s : v.stateTypes) { if (contains(states, s.getName())) { xstate |= mask; } mask <<= 1; } } } else { // if there are no custom states defined, then simply return the // state that Synth reported if (v.stateTypes == null) return ctx.getComponentState(); // there are custom states on this values, so I'll have to iterate // over them all and return a custom extended state int state = ctx.getComponentState(); for (State s : v.stateTypes) { if (s.isInState(c, state)) { xstate |= mask; } mask <<= 1; } } return xstate; }
class class_name[name] begin[{] method[getExtendedState, return_type[type[int]], modifier[private], parameter[ctx, v]] begin[{] local_variable[type[JComponent], c] local_variable[type[int], xstate] local_variable[type[int], mask] local_variable[type[Object], property] if[binary_operation[member[.property], !=, literal[null]]] begin[{] local_variable[type[String], stateNames] local_variable[type[String], states] if[binary_operation[member[v.stateTypes], ==, literal[null]]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=stateStr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getStandardState, postfix_operators=[], prefix_operators=[], qualifier=State, selectors=[], type_arguments=None), name=s)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=State, sub_type=ReferenceType(arguments=None, dimensions=None, name=StandardState, sub_type=None))), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=s, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=StatementExpression(expression=Assignment(expressionl=MemberReference(member=xstate, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=|=, value=MethodInvocation(arguments=[], member=getState, postfix_operators=[], prefix_operators=[], qualifier=s, selectors=[], type_arguments=None)), label=None))]), control=EnhancedForControl(iterable=MemberReference(member=states, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=stateStr)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None) else begin[{] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=states, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=s, selectors=[], type_arguments=None)], member=contains, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=xstate, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=|=, value=MemberReference(member=mask, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None)])), StatementExpression(expression=Assignment(expressionl=MemberReference(member=mask, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=<<=, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=stateTypes, postfix_operators=[], prefix_operators=[], qualifier=v, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=s)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=State, sub_type=None))), label=None) end[}] else begin[{] if[binary_operation[member[v.stateTypes], ==, literal[null]]] begin[{] return[call[ctx.getComponentState, parameter[]]] else begin[{] None end[}] local_variable[type[int], state] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=state, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isInState, postfix_operators=[], prefix_operators=[], qualifier=s, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=xstate, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=|=, value=MemberReference(member=mask, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None)])), StatementExpression(expression=Assignment(expressionl=MemberReference(member=mask, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=<<=, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=stateTypes, postfix_operators=[], prefix_operators=[], qualifier=v, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=s)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=State, sub_type=None))), label=None) end[}] return[member[.xstate]] end[}] END[}]
Keyword[private] Keyword[int] identifier[getExtendedState] operator[SEP] identifier[SynthContext] identifier[ctx] , identifier[Values] identifier[v] operator[SEP] { identifier[JComponent] identifier[c] operator[=] identifier[ctx] operator[SEP] identifier[getComponent] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[xstate] operator[=] Other[0] operator[SEP] Keyword[int] identifier[mask] operator[=] Other[1] operator[SEP] identifier[Object] identifier[property] operator[=] identifier[c] operator[SEP] identifier[getClientProperty] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[property] operator[!=] Other[null] operator[SEP] { identifier[String] identifier[stateNames] operator[=] identifier[property] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] identifier[String] operator[SEP] operator[SEP] identifier[states] operator[=] identifier[stateNames] operator[SEP] identifier[split] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[v] operator[SEP] identifier[stateTypes] operator[==] Other[null] operator[SEP] { Keyword[for] operator[SEP] identifier[String] identifier[stateStr] operator[:] identifier[states] operator[SEP] { identifier[State] operator[SEP] identifier[StandardState] identifier[s] operator[=] identifier[State] operator[SEP] identifier[getStandardState] operator[SEP] identifier[stateStr] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[s] operator[!=] Other[null] operator[SEP] identifier[xstate] operator[|=] identifier[s] operator[SEP] identifier[getState] operator[SEP] operator[SEP] operator[SEP] } } Keyword[else] { Keyword[for] operator[SEP] identifier[State] identifier[s] operator[:] identifier[v] operator[SEP] identifier[stateTypes] operator[SEP] { Keyword[if] operator[SEP] identifier[contains] operator[SEP] identifier[states] , identifier[s] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { identifier[xstate] operator[|=] identifier[mask] operator[SEP] } identifier[mask] operator[<<=] Other[1] operator[SEP] } } } Keyword[else] { Keyword[if] operator[SEP] identifier[v] operator[SEP] identifier[stateTypes] operator[==] Other[null] operator[SEP] Keyword[return] identifier[ctx] operator[SEP] identifier[getComponentState] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[state] operator[=] identifier[ctx] operator[SEP] identifier[getComponentState] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[State] identifier[s] operator[:] identifier[v] operator[SEP] identifier[stateTypes] operator[SEP] { Keyword[if] operator[SEP] identifier[s] operator[SEP] identifier[isInState] operator[SEP] identifier[c] , identifier[state] operator[SEP] operator[SEP] { identifier[xstate] operator[|=] identifier[mask] operator[SEP] } identifier[mask] operator[<<=] Other[1] operator[SEP] } } Keyword[return] identifier[xstate] operator[SEP] }
void setupContext(JsonConvertOptions pOpts) { ObjectSerializationContext stackContext = new ObjectSerializationContext(pOpts); stackContextLocal.set(stackContext); }
class class_name[name] begin[{] method[setupContext, return_type[void], modifier[default], parameter[pOpts]] begin[{] local_variable[type[ObjectSerializationContext], stackContext] call[stackContextLocal.set, parameter[member[.stackContext]]] end[}] END[}]
Keyword[void] identifier[setupContext] operator[SEP] identifier[JsonConvertOptions] identifier[pOpts] operator[SEP] { identifier[ObjectSerializationContext] identifier[stackContext] operator[=] Keyword[new] identifier[ObjectSerializationContext] operator[SEP] identifier[pOpts] operator[SEP] operator[SEP] identifier[stackContextLocal] operator[SEP] identifier[set] operator[SEP] identifier[stackContext] operator[SEP] operator[SEP] }
@Override public Integer getOffset(Integer id, Integer type) { Integer result = null; Map<Integer, Integer> map = m_table.get(id); if (map != null && type != null) { result = map.get(type); } return (result); }
class class_name[name] begin[{] method[getOffset, return_type[type[Integer]], modifier[public], parameter[id, type]] begin[{] local_variable[type[Integer], result] local_variable[type[Map], map] if[binary_operation[binary_operation[member[.map], !=, literal[null]], &&, binary_operation[member[.type], !=, literal[null]]]] begin[{] assign[member[.result], call[map.get, parameter[member[.type]]]] else begin[{] None end[}] return[member[.result]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[Integer] identifier[getOffset] operator[SEP] identifier[Integer] identifier[id] , identifier[Integer] identifier[type] operator[SEP] { identifier[Integer] identifier[result] operator[=] Other[null] operator[SEP] identifier[Map] operator[<] identifier[Integer] , identifier[Integer] operator[>] identifier[map] operator[=] identifier[m_table] operator[SEP] identifier[get] operator[SEP] identifier[id] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[map] operator[!=] Other[null] operator[&&] identifier[type] operator[!=] Other[null] operator[SEP] { identifier[result] operator[=] identifier[map] operator[SEP] identifier[get] operator[SEP] identifier[type] operator[SEP] operator[SEP] } Keyword[return] operator[SEP] identifier[result] operator[SEP] operator[SEP] }
protected static WebcamDriver findDriver(List<String> names, List<Class<?>> classes) { for (String name : names) { LOG.info("Searching driver {}", name); Class<?> clazz = null; for (Class<?> c : classes) { if (c.getCanonicalName().equals(name)) { clazz = c; break; } } if (clazz == null) { try { clazz = Class.forName(name); } catch (ClassNotFoundException e) { LOG.trace("Class not found {}, fall thru", name); } } if (clazz == null) { LOG.debug("Driver {} not found", name); continue; } LOG.info("Webcam driver {} has been found", name); try { return (WebcamDriver) clazz.newInstance(); } catch (InstantiationException e) { throw new RuntimeException(e); } catch (IllegalAccessException e) { throw new RuntimeException(e); } } return null; }
class class_name[name] begin[{] method[findDriver, return_type[type[WebcamDriver]], modifier[static protected], parameter[names, classes]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Searching driver {}"), MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=info, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), name=clazz)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=?, type=None)], dimensions=[], name=Class, sub_type=None)), ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[], member=getCanonicalName, postfix_operators=[], prefix_operators=[], qualifier=c, selectors=[MethodInvocation(arguments=[MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equals, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=clazz, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), BreakStatement(goto=None, label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=classes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=c)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=?, type=None)], dimensions=[], name=Class, sub_type=None))), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=clazz, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=clazz, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=forName, postfix_operators=[], prefix_operators=[], qualifier=Class, selectors=[], type_arguments=None)), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Class not found {}, fall thru"), MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=trace, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['ClassNotFoundException']))], finally_block=None, label=None, resources=None)])), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=clazz, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Driver {} not found"), MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=debug, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), label=None), ContinueStatement(goto=None, label=None)])), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Webcam driver {} has been found"), MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=info, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), label=None), TryStatement(block=[ReturnStatement(expression=Cast(expression=MethodInvocation(arguments=[], member=newInstance, postfix_operators=[], prefix_operators=[], qualifier=clazz, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=WebcamDriver, sub_type=None)), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=RuntimeException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['InstantiationException'])), CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=RuntimeException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['IllegalAccessException']))], finally_block=None, label=None, resources=None)]), control=EnhancedForControl(iterable=MemberReference(member=names, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=name)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None) return[literal[null]] end[}] END[}]
Keyword[protected] Keyword[static] identifier[WebcamDriver] identifier[findDriver] operator[SEP] identifier[List] operator[<] identifier[String] operator[>] identifier[names] , identifier[List] operator[<] identifier[Class] operator[<] operator[?] operator[>] operator[>] identifier[classes] operator[SEP] { Keyword[for] operator[SEP] identifier[String] identifier[name] operator[:] identifier[names] operator[SEP] { identifier[LOG] operator[SEP] identifier[info] operator[SEP] literal[String] , identifier[name] operator[SEP] operator[SEP] identifier[Class] operator[<] operator[?] operator[>] identifier[clazz] operator[=] Other[null] operator[SEP] Keyword[for] operator[SEP] identifier[Class] operator[<] operator[?] operator[>] identifier[c] operator[:] identifier[classes] operator[SEP] { Keyword[if] operator[SEP] identifier[c] operator[SEP] identifier[getCanonicalName] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[name] operator[SEP] operator[SEP] { identifier[clazz] operator[=] identifier[c] operator[SEP] Keyword[break] operator[SEP] } } Keyword[if] operator[SEP] identifier[clazz] operator[==] Other[null] operator[SEP] { Keyword[try] { identifier[clazz] operator[=] identifier[Class] operator[SEP] identifier[forName] operator[SEP] identifier[name] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[ClassNotFoundException] identifier[e] operator[SEP] { identifier[LOG] operator[SEP] identifier[trace] operator[SEP] literal[String] , identifier[name] operator[SEP] operator[SEP] } } Keyword[if] operator[SEP] identifier[clazz] operator[==] Other[null] operator[SEP] { identifier[LOG] operator[SEP] identifier[debug] operator[SEP] literal[String] , identifier[name] operator[SEP] operator[SEP] Keyword[continue] operator[SEP] } identifier[LOG] operator[SEP] identifier[info] operator[SEP] literal[String] , identifier[name] operator[SEP] operator[SEP] Keyword[try] { Keyword[return] operator[SEP] identifier[WebcamDriver] operator[SEP] identifier[clazz] operator[SEP] identifier[newInstance] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[InstantiationException] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[RuntimeException] operator[SEP] identifier[e] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[IllegalAccessException] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[RuntimeException] operator[SEP] identifier[e] operator[SEP] operator[SEP] } } Keyword[return] Other[null] operator[SEP] }
public final DynamicRefTable GetDynamicRefTableForCookie(ApkAssetsCookie cookie) { for (final PackageGroup package_group : package_groups_) { for (final ApkAssetsCookie package_cookie : package_group.cookies_) { if (package_cookie == cookie) { return package_group.dynamic_ref_table; } } } return null; }
class class_name[name] begin[{] method[GetDynamicRefTableForCookie, return_type[type[DynamicRefTable]], modifier[final public], parameter[cookie]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=package_cookie, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=cookie, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=MemberReference(member=dynamic_ref_table, postfix_operators=[], prefix_operators=[], qualifier=package_group, selectors=[]), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=cookies_, postfix_operators=[], prefix_operators=[], qualifier=package_group, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=package_cookie)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=ApkAssetsCookie, sub_type=None))), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=package_groups_, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=package_group)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=PackageGroup, sub_type=None))), label=None) return[literal[null]] end[}] END[}]
Keyword[public] Keyword[final] identifier[DynamicRefTable] identifier[GetDynamicRefTableForCookie] operator[SEP] identifier[ApkAssetsCookie] identifier[cookie] operator[SEP] { Keyword[for] operator[SEP] Keyword[final] identifier[PackageGroup] identifier[package_group] operator[:] identifier[package_groups_] operator[SEP] { Keyword[for] operator[SEP] Keyword[final] identifier[ApkAssetsCookie] identifier[package_cookie] operator[:] identifier[package_group] operator[SEP] identifier[cookies_] operator[SEP] { Keyword[if] operator[SEP] identifier[package_cookie] operator[==] identifier[cookie] operator[SEP] { Keyword[return] identifier[package_group] operator[SEP] identifier[dynamic_ref_table] operator[SEP] } } } Keyword[return] Other[null] operator[SEP] }
public Branch withTags(java.util.Map<String, String> tags) { setTags(tags); return this; }
class class_name[name] begin[{] method[withTags, return_type[type[Branch]], modifier[public], parameter[tags]] begin[{] call[.setTags, parameter[member[.tags]]] return[THIS[]] end[}] END[}]
Keyword[public] identifier[Branch] identifier[withTags] operator[SEP] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[Map] operator[<] identifier[String] , identifier[String] operator[>] identifier[tags] operator[SEP] { identifier[setTags] operator[SEP] identifier[tags] operator[SEP] operator[SEP] Keyword[return] Keyword[this] operator[SEP] }
@Override public void toPDB(StringBuffer buf){ /*12 - 14 LString(3) "CYS" Residue name. 16 Character chainID1 Chain identifier. 18 - 21 Integer seqNum1 Residue sequence number. 22 AChar icode1 Insertion code. 26 - 28 LString(3) "CYS" Residue name. 30 Character chainID2 Chain identifier. 32 - 35 Integer seqNum2 Residue sequence number. 36 AChar icode2 Insertion code. 60 - 65 SymOP sym1 Symmetry oper for 1st resid 67 - 72 SymOP sym2 Symmetry oper for 2nd resid */ //01234567890123456789012345678901234567890123456789012345678901234567890123456789 //SSBOND 1 CYS 5 CYS 55 5PTI 67 //SSBOND 2 CYS 14 CYS 38 //SSBOND 3 CYS 30 CYS 51 buf.append("SSBOND "); buf.append(String.format("%3d", serNum)); buf.append(String.format(" CYS %s %4s%1s ", chainID1, resnum1, insCode1)); buf.append(String.format(" CYS %s %4s%1s ", chainID2, resnum2, insCode2)); }
class class_name[name] begin[{] method[toPDB, return_type[void], modifier[public], parameter[buf]] begin[{] call[buf.append, parameter[literal["SSBOND "]]] call[buf.append, parameter[call[String.format, parameter[literal["%3d"], member[.serNum]]]]] call[buf.append, parameter[call[String.format, parameter[literal[" CYS %s %4s%1s "], member[.chainID1], member[.resnum1], member[.insCode1]]]]] call[buf.append, parameter[call[String.format, parameter[literal[" CYS %s %4s%1s "], member[.chainID2], member[.resnum2], member[.insCode2]]]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[toPDB] operator[SEP] identifier[StringBuffer] identifier[buf] operator[SEP] { identifier[buf] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[buf] operator[SEP] identifier[append] operator[SEP] identifier[String] operator[SEP] identifier[format] operator[SEP] literal[String] , identifier[serNum] operator[SEP] operator[SEP] operator[SEP] identifier[buf] operator[SEP] identifier[append] operator[SEP] identifier[String] operator[SEP] identifier[format] operator[SEP] literal[String] , identifier[chainID1] , identifier[resnum1] , identifier[insCode1] operator[SEP] operator[SEP] operator[SEP] identifier[buf] operator[SEP] identifier[append] operator[SEP] identifier[String] operator[SEP] identifier[format] operator[SEP] literal[String] , identifier[chainID2] , identifier[resnum2] , identifier[insCode2] operator[SEP] operator[SEP] operator[SEP] }
public static String getCountry(final String localeString) { if (localeString.length() >= COUNTRY_END) { return localeString.substring(COUNTRY_START, COUNTRY_END); } return ""; }
class class_name[name] begin[{] method[getCountry, return_type[type[String]], modifier[public static], parameter[localeString]] begin[{] if[binary_operation[call[localeString.length, parameter[]], >=, member[.COUNTRY_END]]] begin[{] return[call[localeString.substring, parameter[member[.COUNTRY_START], member[.COUNTRY_END]]]] else begin[{] None end[}] return[literal[""]] end[}] END[}]
Keyword[public] Keyword[static] identifier[String] identifier[getCountry] operator[SEP] Keyword[final] identifier[String] identifier[localeString] operator[SEP] { Keyword[if] operator[SEP] identifier[localeString] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[>=] identifier[COUNTRY_END] operator[SEP] { Keyword[return] identifier[localeString] operator[SEP] identifier[substring] operator[SEP] identifier[COUNTRY_START] , identifier[COUNTRY_END] operator[SEP] operator[SEP] } Keyword[return] literal[String] operator[SEP] }
public void forceQuit() { synchronized (relatedTasks){ if (runningThread != null) { runningThread.interrupt(); runningThread = null; cancelTask(); postStop(); } } countDownLatch.countDown(); }
class class_name[name] begin[{] method[forceQuit, return_type[void], modifier[public], parameter[]] begin[{] SYNCHRONIZED[member[.relatedTasks]] BEGIN[{] if[binary_operation[member[.runningThread], !=, literal[null]]] begin[{] call[runningThread.interrupt, parameter[]] assign[member[.runningThread], literal[null]] call[.cancelTask, parameter[]] call[.postStop, parameter[]] else begin[{] None end[}] END[}] call[countDownLatch.countDown, parameter[]] end[}] END[}]
Keyword[public] Keyword[void] identifier[forceQuit] operator[SEP] operator[SEP] { Keyword[synchronized] operator[SEP] identifier[relatedTasks] operator[SEP] { Keyword[if] operator[SEP] identifier[runningThread] operator[!=] Other[null] operator[SEP] { identifier[runningThread] operator[SEP] identifier[interrupt] operator[SEP] operator[SEP] operator[SEP] identifier[runningThread] operator[=] Other[null] operator[SEP] identifier[cancelTask] operator[SEP] operator[SEP] operator[SEP] identifier[postStop] operator[SEP] operator[SEP] operator[SEP] } } identifier[countDownLatch] operator[SEP] identifier[countDown] operator[SEP] operator[SEP] operator[SEP] }
private static MemoryUsage getPermGenSpaceSize(MemoryUsage defaultValue) { if (permGenSpaceBean != null) return permGenSpaceBean.getUsage(); // create on the fly when the bean is not permanent MemoryPoolMXBean tmp = getPermGenSpaceBean(); if (tmp != null) return tmp.getUsage(); return defaultValue; }
class class_name[name] begin[{] method[getPermGenSpaceSize, return_type[type[MemoryUsage]], modifier[private static], parameter[defaultValue]] begin[{] if[binary_operation[member[.permGenSpaceBean], !=, literal[null]]] begin[{] return[call[permGenSpaceBean.getUsage, parameter[]]] else begin[{] None end[}] local_variable[type[MemoryPoolMXBean], tmp] if[binary_operation[member[.tmp], !=, literal[null]]] begin[{] return[call[tmp.getUsage, parameter[]]] else begin[{] None end[}] return[member[.defaultValue]] end[}] END[}]
Keyword[private] Keyword[static] identifier[MemoryUsage] identifier[getPermGenSpaceSize] operator[SEP] identifier[MemoryUsage] identifier[defaultValue] operator[SEP] { Keyword[if] operator[SEP] identifier[permGenSpaceBean] operator[!=] Other[null] operator[SEP] Keyword[return] identifier[permGenSpaceBean] operator[SEP] identifier[getUsage] operator[SEP] operator[SEP] operator[SEP] identifier[MemoryPoolMXBean] identifier[tmp] operator[=] identifier[getPermGenSpaceBean] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[tmp] operator[!=] Other[null] operator[SEP] Keyword[return] identifier[tmp] operator[SEP] identifier[getUsage] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[defaultValue] operator[SEP] }
public static com.liferay.commerce.wish.list.model.CommerceWishList fetchCommerceWishListByUuidAndGroupId( String uuid, long groupId) { return getService().fetchCommerceWishListByUuidAndGroupId(uuid, groupId); }
class class_name[name] begin[{] method[fetchCommerceWishListByUuidAndGroupId, return_type[type[com]], modifier[public static], parameter[uuid, groupId]] begin[{] return[call[.getService, parameter[]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[com] operator[SEP] identifier[liferay] operator[SEP] identifier[commerce] operator[SEP] identifier[wish] operator[SEP] identifier[list] operator[SEP] identifier[model] operator[SEP] identifier[CommerceWishList] identifier[fetchCommerceWishListByUuidAndGroupId] operator[SEP] identifier[String] identifier[uuid] , Keyword[long] identifier[groupId] operator[SEP] { Keyword[return] identifier[getService] operator[SEP] operator[SEP] operator[SEP] identifier[fetchCommerceWishListByUuidAndGroupId] operator[SEP] identifier[uuid] , identifier[groupId] operator[SEP] operator[SEP] }
@Override public void cacheResult( List<CommerceAccountOrganizationRel> commerceAccountOrganizationRels) { for (CommerceAccountOrganizationRel commerceAccountOrganizationRel : commerceAccountOrganizationRels) { if (entityCache.getResult( CommerceAccountOrganizationRelModelImpl.ENTITY_CACHE_ENABLED, CommerceAccountOrganizationRelImpl.class, commerceAccountOrganizationRel.getPrimaryKey()) == null) { cacheResult(commerceAccountOrganizationRel); } else { commerceAccountOrganizationRel.resetOriginalValues(); } } }
class class_name[name] begin[{] method[cacheResult, return_type[void], modifier[public], parameter[commerceAccountOrganizationRels]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=ENTITY_CACHE_ENABLED, postfix_operators=[], prefix_operators=[], qualifier=CommerceAccountOrganizationRelModelImpl, selectors=[]), ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=CommerceAccountOrganizationRelImpl, sub_type=None)), MethodInvocation(arguments=[], member=getPrimaryKey, postfix_operators=[], prefix_operators=[], qualifier=commerceAccountOrganizationRel, selectors=[], type_arguments=None)], member=getResult, postfix_operators=[], prefix_operators=[], qualifier=entityCache, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=resetOriginalValues, postfix_operators=[], prefix_operators=[], qualifier=commerceAccountOrganizationRel, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=commerceAccountOrganizationRel, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=cacheResult, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=commerceAccountOrganizationRels, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=commerceAccountOrganizationRel)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=CommerceAccountOrganizationRel, sub_type=None))), label=None) end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[cacheResult] operator[SEP] identifier[List] operator[<] identifier[CommerceAccountOrganizationRel] operator[>] identifier[commerceAccountOrganizationRels] operator[SEP] { Keyword[for] operator[SEP] identifier[CommerceAccountOrganizationRel] identifier[commerceAccountOrganizationRel] operator[:] identifier[commerceAccountOrganizationRels] operator[SEP] { Keyword[if] operator[SEP] identifier[entityCache] operator[SEP] identifier[getResult] operator[SEP] identifier[CommerceAccountOrganizationRelModelImpl] operator[SEP] identifier[ENTITY_CACHE_ENABLED] , identifier[CommerceAccountOrganizationRelImpl] operator[SEP] Keyword[class] , identifier[commerceAccountOrganizationRel] operator[SEP] identifier[getPrimaryKey] operator[SEP] operator[SEP] operator[SEP] operator[==] Other[null] operator[SEP] { identifier[cacheResult] operator[SEP] identifier[commerceAccountOrganizationRel] operator[SEP] operator[SEP] } Keyword[else] { identifier[commerceAccountOrganizationRel] operator[SEP] identifier[resetOriginalValues] operator[SEP] operator[SEP] operator[SEP] } } }
protected Map<String, String> validateAliases(CmsUUID uuid, Map<String, String> aliasPaths) throws CmsException { Locale locale = OpenCms.getWorkplaceManager().getWorkplaceLocale(m_cms); Set<String> seenPaths = new HashSet<String>(); Set<String> duplicatePaths = new HashSet<String>(); for (String path : aliasPaths.values()) { if (seenPaths.contains(path)) { duplicatePaths.add(path); } seenPaths.add(path); } Map<String, String> errorMessagesByPath = new HashMap<String, String>(); for (String path : duplicatePaths) { errorMessagesByPath.put(path, Messages.get().getBundle(locale).key(Messages.ERR_ALIAS_DUPLICATE_PATH_0)); } seenPaths.removeAll(duplicatePaths); for (String path : seenPaths) { String pathError = checkValidAliasPath(path, locale); if (pathError != null) { errorMessagesByPath.put(path, pathError); } else { errorMessagesByPath.put(path, null); if (m_cms.existsResource(path, CmsResourceFilter.ALL)) { errorMessagesByPath.put(path, Messages.get().getBundle(locale).key(Messages.ERR_ALIAS_IS_VFS_0)); } else { List<CmsAlias> aliases = OpenCms.getAliasManager().getAliasesForPath( m_cms, m_cms.getRequestContext().getSiteRoot(), path); for (CmsAlias alias : aliases) { CmsUUID otherStructureId = alias.getStructureId(); if (!otherStructureId.equals(uuid)) { try { CmsResource resource = m_cms.readResource(otherStructureId, CmsResourceFilter.ALL); errorMessagesByPath.put( path, Messages.get().getBundle(locale).key( Messages.ERR_ALIAS_ALREADY_USED_1, resource.getRootPath())); break; } catch (CmsVfsResourceNotFoundException e) { // this may happen if there are outdated entries in the database table errorMessagesByPath.put( path, Messages.get().getBundle(locale).key(Messages.ERR_ALIAS_ALREADY_USED_UNKNOWN_0)); break; } } } } } } Map<String, String> errorMessagesById = new HashMap<String, String>(); for (String key : aliasPaths.keySet()) { String path = aliasPaths.get(key); if (errorMessagesByPath.containsKey(path)) { String errorMessage = errorMessagesByPath.get(path); errorMessagesById.put(key, errorMessage); } } return errorMessagesById; }
class class_name[name] begin[{] method[validateAliases, return_type[type[Map]], modifier[protected], parameter[uuid, aliasPaths]] begin[{] local_variable[type[Locale], locale] local_variable[type[Set], seenPaths] local_variable[type[Set], duplicatePaths] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=path, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=contains, postfix_operators=[], prefix_operators=[], qualifier=seenPaths, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=path, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=duplicatePaths, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=path, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=seenPaths, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=values, postfix_operators=[], prefix_operators=[], qualifier=aliasPaths, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=path)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None) local_variable[type[Map], errorMessagesByPath] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=path, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=get, postfix_operators=[], prefix_operators=[], qualifier=Messages, selectors=[MethodInvocation(arguments=[MemberReference(member=locale, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getBundle, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MemberReference(member=ERR_ALIAS_DUPLICATE_PATH_0, postfix_operators=[], prefix_operators=[], qualifier=Messages, selectors=[])], member=key, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=put, postfix_operators=[], prefix_operators=[], qualifier=errorMessagesByPath, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=duplicatePaths, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=path)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None) call[seenPaths.removeAll, parameter[member[.duplicatePaths]]] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=path, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=locale, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=checkValidAliasPath, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=pathError)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=pathError, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=path, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)], member=put, postfix_operators=[], prefix_operators=[], qualifier=errorMessagesByPath, selectors=[], type_arguments=None), label=None), IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=path, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=ALL, postfix_operators=[], prefix_operators=[], qualifier=CmsResourceFilter, selectors=[])], member=existsResource, postfix_operators=[], prefix_operators=[], qualifier=m_cms, selectors=[], type_arguments=None), else_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getAliasManager, postfix_operators=[], prefix_operators=[], qualifier=OpenCms, selectors=[MethodInvocation(arguments=[MemberReference(member=m_cms, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getRequestContext, postfix_operators=[], prefix_operators=[], qualifier=m_cms, selectors=[MethodInvocation(arguments=[], member=getSiteRoot, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), MemberReference(member=path, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getAliasesForPath, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=aliases)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=CmsAlias, sub_type=None))], dimensions=[], name=List, sub_type=None)), ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getStructureId, postfix_operators=[], prefix_operators=[], qualifier=alias, selectors=[], type_arguments=None), name=otherStructureId)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=CmsUUID, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=uuid, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equals, postfix_operators=[], prefix_operators=['!'], qualifier=otherStructureId, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=otherStructureId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=ALL, postfix_operators=[], prefix_operators=[], qualifier=CmsResourceFilter, selectors=[])], member=readResource, postfix_operators=[], prefix_operators=[], qualifier=m_cms, selectors=[], type_arguments=None), name=resource)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=CmsResource, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=path, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=get, postfix_operators=[], prefix_operators=[], qualifier=Messages, selectors=[MethodInvocation(arguments=[MemberReference(member=locale, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getBundle, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MemberReference(member=ERR_ALIAS_ALREADY_USED_1, postfix_operators=[], prefix_operators=[], qualifier=Messages, selectors=[]), MethodInvocation(arguments=[], member=getRootPath, postfix_operators=[], prefix_operators=[], qualifier=resource, selectors=[], type_arguments=None)], member=key, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=put, postfix_operators=[], prefix_operators=[], qualifier=errorMessagesByPath, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=path, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=get, postfix_operators=[], prefix_operators=[], qualifier=Messages, selectors=[MethodInvocation(arguments=[MemberReference(member=locale, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getBundle, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MemberReference(member=ERR_ALIAS_ALREADY_USED_UNKNOWN_0, postfix_operators=[], prefix_operators=[], qualifier=Messages, selectors=[])], member=key, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=put, postfix_operators=[], prefix_operators=[], qualifier=errorMessagesByPath, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['CmsVfsResourceNotFoundException']))], finally_block=None, label=None, resources=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=aliases, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=alias)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=CmsAlias, sub_type=None))), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=path, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=get, postfix_operators=[], prefix_operators=[], qualifier=Messages, selectors=[MethodInvocation(arguments=[MemberReference(member=locale, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getBundle, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MemberReference(member=ERR_ALIAS_IS_VFS_0, postfix_operators=[], prefix_operators=[], qualifier=Messages, selectors=[])], member=key, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=put, postfix_operators=[], prefix_operators=[], qualifier=errorMessagesByPath, selectors=[], type_arguments=None), label=None)]))]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=path, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=pathError, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=put, postfix_operators=[], prefix_operators=[], qualifier=errorMessagesByPath, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=seenPaths, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=path)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None) local_variable[type[Map], errorMessagesById] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=aliasPaths, selectors=[], type_arguments=None), name=path)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=path, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=containsKey, postfix_operators=[], prefix_operators=[], qualifier=errorMessagesByPath, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=path, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=errorMessagesByPath, selectors=[], type_arguments=None), name=errorMessage)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=errorMessage, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=put, postfix_operators=[], prefix_operators=[], qualifier=errorMessagesById, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=keySet, postfix_operators=[], prefix_operators=[], qualifier=aliasPaths, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=key)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None) return[member[.errorMessagesById]] end[}] END[}]
Keyword[protected] identifier[Map] operator[<] identifier[String] , identifier[String] operator[>] identifier[validateAliases] operator[SEP] identifier[CmsUUID] identifier[uuid] , identifier[Map] operator[<] identifier[String] , identifier[String] operator[>] identifier[aliasPaths] operator[SEP] Keyword[throws] identifier[CmsException] { identifier[Locale] identifier[locale] operator[=] identifier[OpenCms] operator[SEP] identifier[getWorkplaceManager] operator[SEP] operator[SEP] operator[SEP] identifier[getWorkplaceLocale] operator[SEP] identifier[m_cms] operator[SEP] operator[SEP] identifier[Set] operator[<] identifier[String] operator[>] identifier[seenPaths] operator[=] Keyword[new] identifier[HashSet] operator[<] identifier[String] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[Set] operator[<] identifier[String] operator[>] identifier[duplicatePaths] operator[=] Keyword[new] identifier[HashSet] operator[<] identifier[String] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[String] identifier[path] operator[:] identifier[aliasPaths] operator[SEP] identifier[values] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[seenPaths] operator[SEP] identifier[contains] operator[SEP] identifier[path] operator[SEP] operator[SEP] { identifier[duplicatePaths] operator[SEP] identifier[add] operator[SEP] identifier[path] operator[SEP] operator[SEP] } identifier[seenPaths] operator[SEP] identifier[add] operator[SEP] identifier[path] operator[SEP] operator[SEP] } identifier[Map] operator[<] identifier[String] , identifier[String] operator[>] identifier[errorMessagesByPath] operator[=] Keyword[new] identifier[HashMap] operator[<] identifier[String] , identifier[String] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[String] identifier[path] operator[:] identifier[duplicatePaths] operator[SEP] { identifier[errorMessagesByPath] operator[SEP] identifier[put] operator[SEP] identifier[path] , identifier[Messages] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[getBundle] operator[SEP] identifier[locale] operator[SEP] operator[SEP] identifier[key] operator[SEP] identifier[Messages] operator[SEP] identifier[ERR_ALIAS_DUPLICATE_PATH_0] operator[SEP] operator[SEP] operator[SEP] } identifier[seenPaths] operator[SEP] identifier[removeAll] operator[SEP] identifier[duplicatePaths] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[String] identifier[path] operator[:] identifier[seenPaths] operator[SEP] { identifier[String] identifier[pathError] operator[=] identifier[checkValidAliasPath] operator[SEP] identifier[path] , identifier[locale] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[pathError] operator[!=] Other[null] operator[SEP] { identifier[errorMessagesByPath] operator[SEP] identifier[put] operator[SEP] identifier[path] , identifier[pathError] operator[SEP] operator[SEP] } Keyword[else] { identifier[errorMessagesByPath] operator[SEP] identifier[put] operator[SEP] identifier[path] , Other[null] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[m_cms] operator[SEP] identifier[existsResource] operator[SEP] identifier[path] , identifier[CmsResourceFilter] operator[SEP] identifier[ALL] operator[SEP] operator[SEP] { identifier[errorMessagesByPath] operator[SEP] identifier[put] operator[SEP] identifier[path] , identifier[Messages] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[getBundle] operator[SEP] identifier[locale] operator[SEP] operator[SEP] identifier[key] operator[SEP] identifier[Messages] operator[SEP] identifier[ERR_ALIAS_IS_VFS_0] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { identifier[List] operator[<] identifier[CmsAlias] operator[>] identifier[aliases] operator[=] identifier[OpenCms] operator[SEP] identifier[getAliasManager] operator[SEP] operator[SEP] operator[SEP] identifier[getAliasesForPath] operator[SEP] identifier[m_cms] , identifier[m_cms] operator[SEP] identifier[getRequestContext] operator[SEP] operator[SEP] operator[SEP] identifier[getSiteRoot] operator[SEP] operator[SEP] , identifier[path] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[CmsAlias] identifier[alias] operator[:] identifier[aliases] operator[SEP] { identifier[CmsUUID] identifier[otherStructureId] operator[=] identifier[alias] operator[SEP] identifier[getStructureId] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[otherStructureId] operator[SEP] identifier[equals] operator[SEP] identifier[uuid] operator[SEP] operator[SEP] { Keyword[try] { identifier[CmsResource] identifier[resource] operator[=] identifier[m_cms] operator[SEP] identifier[readResource] operator[SEP] identifier[otherStructureId] , identifier[CmsResourceFilter] operator[SEP] identifier[ALL] operator[SEP] operator[SEP] identifier[errorMessagesByPath] operator[SEP] identifier[put] operator[SEP] identifier[path] , identifier[Messages] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[getBundle] operator[SEP] identifier[locale] operator[SEP] operator[SEP] identifier[key] operator[SEP] identifier[Messages] operator[SEP] identifier[ERR_ALIAS_ALREADY_USED_1] , identifier[resource] operator[SEP] identifier[getRootPath] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[break] operator[SEP] } Keyword[catch] operator[SEP] identifier[CmsVfsResourceNotFoundException] identifier[e] operator[SEP] { identifier[errorMessagesByPath] operator[SEP] identifier[put] operator[SEP] identifier[path] , identifier[Messages] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[getBundle] operator[SEP] identifier[locale] operator[SEP] operator[SEP] identifier[key] operator[SEP] identifier[Messages] operator[SEP] identifier[ERR_ALIAS_ALREADY_USED_UNKNOWN_0] operator[SEP] operator[SEP] operator[SEP] Keyword[break] operator[SEP] } } } } } } identifier[Map] operator[<] identifier[String] , identifier[String] operator[>] identifier[errorMessagesById] operator[=] Keyword[new] identifier[HashMap] operator[<] identifier[String] , identifier[String] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[String] identifier[key] operator[:] identifier[aliasPaths] operator[SEP] identifier[keySet] operator[SEP] operator[SEP] operator[SEP] { identifier[String] identifier[path] operator[=] identifier[aliasPaths] operator[SEP] identifier[get] operator[SEP] identifier[key] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[errorMessagesByPath] operator[SEP] identifier[containsKey] operator[SEP] identifier[path] operator[SEP] operator[SEP] { identifier[String] identifier[errorMessage] operator[=] identifier[errorMessagesByPath] operator[SEP] identifier[get] operator[SEP] identifier[path] operator[SEP] operator[SEP] identifier[errorMessagesById] operator[SEP] identifier[put] operator[SEP] identifier[key] , identifier[errorMessage] operator[SEP] operator[SEP] } } Keyword[return] identifier[errorMessagesById] operator[SEP] }
protected void applyContext(AbstractListBinding binding, Map context) { if (context.containsKey(SELECTABLE_ITEMS_KEY)) { binding.setSelectableItems(decorate(context.get(SELECTABLE_ITEMS_KEY), selectableItems)); } else if (selectableItems != null) { binding.setSelectableItems(selectableItems); } if (context.containsKey(COMPARATOR_KEY)) { binding.setComparator((Comparator) decorate(context.get(COMPARATOR_KEY), comparator)); } else if (comparator != null) { binding.setComparator(comparator); } if (context.containsKey(FILTER_KEY)) { binding.setFilter((Constraint) decorate(context.get(FILTER_KEY), filter)); } else if (filter != null) { binding.setFilter(filter); } }
class class_name[name] begin[{] method[applyContext, return_type[void], modifier[protected], parameter[binding, context]] begin[{] if[call[context.containsKey, parameter[member[.SELECTABLE_ITEMS_KEY]]]] begin[{] call[binding.setSelectableItems, parameter[call[.decorate, parameter[call[context.get, parameter[member[.SELECTABLE_ITEMS_KEY]]], member[.selectableItems]]]]] else begin[{] if[binary_operation[member[.selectableItems], !=, literal[null]]] begin[{] call[binding.setSelectableItems, parameter[member[.selectableItems]]] else begin[{] None end[}] end[}] if[call[context.containsKey, parameter[member[.COMPARATOR_KEY]]]] begin[{] call[binding.setComparator, parameter[Cast(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=COMPARATOR_KEY, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=context, selectors=[], type_arguments=None), MemberReference(member=comparator, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=decorate, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=Comparator, sub_type=None))]] else begin[{] if[binary_operation[member[.comparator], !=, literal[null]]] begin[{] call[binding.setComparator, parameter[member[.comparator]]] else begin[{] None end[}] end[}] if[call[context.containsKey, parameter[member[.FILTER_KEY]]]] begin[{] call[binding.setFilter, parameter[Cast(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=FILTER_KEY, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=context, selectors=[], type_arguments=None), MemberReference(member=filter, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=decorate, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=Constraint, sub_type=None))]] else begin[{] if[binary_operation[member[.filter], !=, literal[null]]] begin[{] call[binding.setFilter, parameter[member[.filter]]] else begin[{] None end[}] end[}] end[}] END[}]
Keyword[protected] Keyword[void] identifier[applyContext] operator[SEP] identifier[AbstractListBinding] identifier[binding] , identifier[Map] identifier[context] operator[SEP] { Keyword[if] operator[SEP] identifier[context] operator[SEP] identifier[containsKey] operator[SEP] identifier[SELECTABLE_ITEMS_KEY] operator[SEP] operator[SEP] { identifier[binding] operator[SEP] identifier[setSelectableItems] operator[SEP] identifier[decorate] operator[SEP] identifier[context] operator[SEP] identifier[get] operator[SEP] identifier[SELECTABLE_ITEMS_KEY] operator[SEP] , identifier[selectableItems] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[selectableItems] operator[!=] Other[null] operator[SEP] { identifier[binding] operator[SEP] identifier[setSelectableItems] operator[SEP] identifier[selectableItems] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[context] operator[SEP] identifier[containsKey] operator[SEP] identifier[COMPARATOR_KEY] operator[SEP] operator[SEP] { identifier[binding] operator[SEP] identifier[setComparator] operator[SEP] operator[SEP] identifier[Comparator] operator[SEP] identifier[decorate] operator[SEP] identifier[context] operator[SEP] identifier[get] operator[SEP] identifier[COMPARATOR_KEY] operator[SEP] , identifier[comparator] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[comparator] operator[!=] Other[null] operator[SEP] { identifier[binding] operator[SEP] identifier[setComparator] operator[SEP] identifier[comparator] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[context] operator[SEP] identifier[containsKey] operator[SEP] identifier[FILTER_KEY] operator[SEP] operator[SEP] { identifier[binding] operator[SEP] identifier[setFilter] operator[SEP] operator[SEP] identifier[Constraint] operator[SEP] identifier[decorate] operator[SEP] identifier[context] operator[SEP] identifier[get] operator[SEP] identifier[FILTER_KEY] operator[SEP] , identifier[filter] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[filter] operator[!=] Other[null] operator[SEP] { identifier[binding] operator[SEP] identifier[setFilter] operator[SEP] identifier[filter] operator[SEP] operator[SEP] } }
public static <Vis extends ImageGray<Vis>, Depth extends ImageGray<Depth>> DepthVisualOdometry<Vis,Depth> depthDepthPnP(double inlierPixelTol, int thresholdAdd, int thresholdRetire , int ransacIterations , int refineIterations , boolean doublePass , DepthSparse3D<Depth> sparseDepth, PointTrackerTwoPass<Vis> tracker , Class<Vis> visualType , Class<Depth> depthType ) { // Range from sparse disparity ImagePixelTo3D pixelTo3D = new DepthSparse3D_to_PixelTo3D<>(sparseDepth); Estimate1ofPnP estimator = FactoryMultiView.pnp_1(EnumPNP.P3P_FINSTERWALDER,-1,2); final DistanceFromModelMultiView<Se3_F64,Point2D3D> distance = new PnPDistanceReprojectionSq(); ModelManagerSe3_F64 manager = new ModelManagerSe3_F64(); EstimatorToGenerator<Se3_F64,Point2D3D> generator = new EstimatorToGenerator<>(estimator); // 1/2 a pixel tolerance for RANSAC inliers double ransacTOL = inlierPixelTol * inlierPixelTol; ModelMatcher<Se3_F64, Point2D3D> motion = new Ransac<>(2323, manager, generator, distance, ransacIterations, ransacTOL); RefinePnP refine = null; if( refineIterations > 0 ) { refine = FactoryMultiView.pnpRefine(1e-12,refineIterations); } VisOdomPixelDepthPnP<Vis> alg = new VisOdomPixelDepthPnP<> (thresholdAdd, thresholdRetire, doublePass, motion, pixelTo3D, refine, tracker, null, null); return new VisOdomPixelDepthPnP_to_DepthVisualOdometry<> (sparseDepth, alg, distance, ImageType.single(visualType), depthType); }
class class_name[name] begin[{] method[depthDepthPnP, return_type[type[DepthVisualOdometry]], modifier[public static], parameter[inlierPixelTol, thresholdAdd, thresholdRetire, ransacIterations, refineIterations, doublePass, sparseDepth, tracker, visualType, depthType]] begin[{] local_variable[type[ImagePixelTo3D], pixelTo3D] local_variable[type[Estimate1ofPnP], estimator] local_variable[type[DistanceFromModelMultiView], distance] local_variable[type[ModelManagerSe3_F64], manager] local_variable[type[EstimatorToGenerator], generator] local_variable[type[double], ransacTOL] local_variable[type[ModelMatcher], motion] local_variable[type[RefinePnP], refine] if[binary_operation[member[.refineIterations], >, literal[0]]] begin[{] assign[member[.refine], call[FactoryMultiView.pnpRefine, parameter[literal[1e-12], member[.refineIterations]]]] else begin[{] None end[}] local_variable[type[VisOdomPixelDepthPnP], alg] return[ClassCreator(arguments=[MemberReference(member=sparseDepth, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=alg, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=distance, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[MemberReference(member=visualType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=single, postfix_operators=[], prefix_operators=[], qualifier=ImageType, selectors=[], type_arguments=None), MemberReference(member=depthType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[], dimensions=None, name=VisOdomPixelDepthPnP_to_DepthVisualOdometry, sub_type=None))] end[}] END[}]
Keyword[public] Keyword[static] operator[<] identifier[Vis] Keyword[extends] identifier[ImageGray] operator[<] identifier[Vis] operator[>] , identifier[Depth] Keyword[extends] identifier[ImageGray] operator[<] identifier[Depth] operator[>] operator[>] identifier[DepthVisualOdometry] operator[<] identifier[Vis] , identifier[Depth] operator[>] identifier[depthDepthPnP] operator[SEP] Keyword[double] identifier[inlierPixelTol] , Keyword[int] identifier[thresholdAdd] , Keyword[int] identifier[thresholdRetire] , Keyword[int] identifier[ransacIterations] , Keyword[int] identifier[refineIterations] , Keyword[boolean] identifier[doublePass] , identifier[DepthSparse3D] operator[<] identifier[Depth] operator[>] identifier[sparseDepth] , identifier[PointTrackerTwoPass] operator[<] identifier[Vis] operator[>] identifier[tracker] , identifier[Class] operator[<] identifier[Vis] operator[>] identifier[visualType] , identifier[Class] operator[<] identifier[Depth] operator[>] identifier[depthType] operator[SEP] { identifier[ImagePixelTo3D] identifier[pixelTo3D] operator[=] Keyword[new] identifier[DepthSparse3D_to_PixelTo3D] operator[<] operator[>] operator[SEP] identifier[sparseDepth] operator[SEP] operator[SEP] identifier[Estimate1ofPnP] identifier[estimator] operator[=] identifier[FactoryMultiView] operator[SEP] identifier[pnp_1] operator[SEP] identifier[EnumPNP] operator[SEP] identifier[P3P_FINSTERWALDER] , operator[-] Other[1] , Other[2] operator[SEP] operator[SEP] Keyword[final] identifier[DistanceFromModelMultiView] operator[<] identifier[Se3_F64] , identifier[Point2D3D] operator[>] identifier[distance] operator[=] Keyword[new] identifier[PnPDistanceReprojectionSq] operator[SEP] operator[SEP] operator[SEP] identifier[ModelManagerSe3_F64] identifier[manager] operator[=] Keyword[new] identifier[ModelManagerSe3_F64] operator[SEP] operator[SEP] operator[SEP] identifier[EstimatorToGenerator] operator[<] identifier[Se3_F64] , identifier[Point2D3D] operator[>] identifier[generator] operator[=] Keyword[new] identifier[EstimatorToGenerator] operator[<] operator[>] operator[SEP] identifier[estimator] operator[SEP] operator[SEP] Keyword[double] identifier[ransacTOL] operator[=] identifier[inlierPixelTol] operator[*] identifier[inlierPixelTol] operator[SEP] identifier[ModelMatcher] operator[<] identifier[Se3_F64] , identifier[Point2D3D] operator[>] identifier[motion] operator[=] Keyword[new] identifier[Ransac] operator[<] operator[>] operator[SEP] Other[2323] , identifier[manager] , identifier[generator] , identifier[distance] , identifier[ransacIterations] , identifier[ransacTOL] operator[SEP] operator[SEP] identifier[RefinePnP] identifier[refine] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[refineIterations] operator[>] Other[0] operator[SEP] { identifier[refine] operator[=] identifier[FactoryMultiView] operator[SEP] identifier[pnpRefine] operator[SEP] literal[Float] , identifier[refineIterations] operator[SEP] operator[SEP] } identifier[VisOdomPixelDepthPnP] operator[<] identifier[Vis] operator[>] identifier[alg] operator[=] Keyword[new] identifier[VisOdomPixelDepthPnP] operator[<] operator[>] operator[SEP] identifier[thresholdAdd] , identifier[thresholdRetire] , identifier[doublePass] , identifier[motion] , identifier[pixelTo3D] , identifier[refine] , identifier[tracker] , Other[null] , Other[null] operator[SEP] operator[SEP] Keyword[return] Keyword[new] identifier[VisOdomPixelDepthPnP_to_DepthVisualOdometry] operator[<] operator[>] operator[SEP] identifier[sparseDepth] , identifier[alg] , identifier[distance] , identifier[ImageType] operator[SEP] identifier[single] operator[SEP] identifier[visualType] operator[SEP] , identifier[depthType] operator[SEP] operator[SEP] }
public static DfPattern findSubstructure(IAtomContainer query) { if (query instanceof IQueryAtomContainer) return new DfPattern((IQueryAtomContainer) query); else return new DfPattern(QueryAtomContainer.create(query, ALIPHATIC_ELEMENT, AROMATIC_ELEMENT, SINGLE_OR_AROMATIC, ALIPHATIC_ORDER, STEREOCHEMISTRY)); }
class class_name[name] begin[{] method[findSubstructure, return_type[type[DfPattern]], modifier[public static], parameter[query]] begin[{] if[binary_operation[member[.query], instanceof, type[IQueryAtomContainer]]] begin[{] return[ClassCreator(arguments=[Cast(expression=MemberReference(member=query, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=IQueryAtomContainer, sub_type=None))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=DfPattern, sub_type=None))] else begin[{] return[ClassCreator(arguments=[MethodInvocation(arguments=[MemberReference(member=query, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=ALIPHATIC_ELEMENT, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=AROMATIC_ELEMENT, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=SINGLE_OR_AROMATIC, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=ALIPHATIC_ORDER, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=STEREOCHEMISTRY, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=create, postfix_operators=[], prefix_operators=[], qualifier=QueryAtomContainer, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=DfPattern, sub_type=None))] end[}] end[}] END[}]
Keyword[public] Keyword[static] identifier[DfPattern] identifier[findSubstructure] operator[SEP] identifier[IAtomContainer] identifier[query] operator[SEP] { Keyword[if] operator[SEP] identifier[query] Keyword[instanceof] identifier[IQueryAtomContainer] operator[SEP] Keyword[return] Keyword[new] identifier[DfPattern] operator[SEP] operator[SEP] identifier[IQueryAtomContainer] operator[SEP] identifier[query] operator[SEP] operator[SEP] Keyword[else] Keyword[return] Keyword[new] identifier[DfPattern] operator[SEP] identifier[QueryAtomContainer] operator[SEP] identifier[create] operator[SEP] identifier[query] , identifier[ALIPHATIC_ELEMENT] , identifier[AROMATIC_ELEMENT] , identifier[SINGLE_OR_AROMATIC] , identifier[ALIPHATIC_ORDER] , identifier[STEREOCHEMISTRY] operator[SEP] operator[SEP] operator[SEP] }
public static final void doubleToBytes( double d, byte[] data, int[] offset ) { long bits = Double.doubleToLongBits(d); longToBytes(bits, data, offset); }
class class_name[name] begin[{] method[doubleToBytes, return_type[void], modifier[final public static], parameter[d, data, offset]] begin[{] local_variable[type[long], bits] call[.longToBytes, parameter[member[.bits], member[.data], member[.offset]]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[final] Keyword[void] identifier[doubleToBytes] operator[SEP] Keyword[double] identifier[d] , Keyword[byte] operator[SEP] operator[SEP] identifier[data] , Keyword[int] operator[SEP] operator[SEP] identifier[offset] operator[SEP] { Keyword[long] identifier[bits] operator[=] identifier[Double] operator[SEP] identifier[doubleToLongBits] operator[SEP] identifier[d] operator[SEP] operator[SEP] identifier[longToBytes] operator[SEP] identifier[bits] , identifier[data] , identifier[offset] operator[SEP] operator[SEP] }
@Override protected MailResourcesHolder createResourceImpl() { //create authenticator Authenticator authenticator=null; if(this.password!=null) { authenticator=new MailAuthenticator(this.userName,this.password); } //create session Session session=Session.getInstance(this.mailConnectionProperties,authenticator); //create transport Transport transport=this.createTransport(session); //create holder MailResourcesHolder resource=new MailResourcesHolder(session,transport); return resource; }
class class_name[name] begin[{] method[createResourceImpl, return_type[type[MailResourcesHolder]], modifier[protected], parameter[]] begin[{] local_variable[type[Authenticator], authenticator] if[binary_operation[THIS[member[None.password]], !=, literal[null]]] begin[{] assign[member[.authenticator], ClassCreator(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=userName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=password, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=MailAuthenticator, sub_type=None))] else begin[{] None end[}] local_variable[type[Session], session] local_variable[type[Transport], transport] local_variable[type[MailResourcesHolder], resource] return[member[.resource]] end[}] END[}]
annotation[@] identifier[Override] Keyword[protected] identifier[MailResourcesHolder] identifier[createResourceImpl] operator[SEP] operator[SEP] { identifier[Authenticator] identifier[authenticator] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[password] operator[!=] Other[null] operator[SEP] { identifier[authenticator] operator[=] Keyword[new] identifier[MailAuthenticator] operator[SEP] Keyword[this] operator[SEP] identifier[userName] , Keyword[this] operator[SEP] identifier[password] operator[SEP] operator[SEP] } identifier[Session] identifier[session] operator[=] identifier[Session] operator[SEP] identifier[getInstance] operator[SEP] Keyword[this] operator[SEP] identifier[mailConnectionProperties] , identifier[authenticator] operator[SEP] operator[SEP] identifier[Transport] identifier[transport] operator[=] Keyword[this] operator[SEP] identifier[createTransport] operator[SEP] identifier[session] operator[SEP] operator[SEP] identifier[MailResourcesHolder] identifier[resource] operator[=] Keyword[new] identifier[MailResourcesHolder] operator[SEP] identifier[session] , identifier[transport] operator[SEP] operator[SEP] Keyword[return] identifier[resource] operator[SEP] }
private String scopesToString(Auth.UrlCodex urlCodex) { if (scopes == null || scopes.length == 0) { return ""; } StringBuilder sb = new StringBuilder(); boolean needsSeparator = false; for (String scope : scopes) { if (needsSeparator) { sb.append(scopeDelimiter); } needsSeparator = true; // Use the URL codex to encode each scope, if provided. sb.append(urlCodex == null ? scope : urlCodex.encode(scope)); } return sb.toString(); }
class class_name[name] begin[{] method[scopesToString, return_type[type[String]], modifier[private], parameter[urlCodex]] begin[{] if[binary_operation[binary_operation[member[.scopes], ==, literal[null]], ||, binary_operation[member[scopes.length], ==, literal[0]]]] begin[{] return[literal[""]] else begin[{] None end[}] local_variable[type[StringBuilder], sb] local_variable[type[boolean], needsSeparator] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MemberReference(member=needsSeparator, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=scopeDelimiter, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=append, postfix_operators=[], prefix_operators=[], qualifier=sb, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=Assignment(expressionl=MemberReference(member=needsSeparator, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)), label=None), StatementExpression(expression=MethodInvocation(arguments=[TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=urlCodex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), if_false=MethodInvocation(arguments=[MemberReference(member=scope, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=encode, postfix_operators=[], prefix_operators=[], qualifier=urlCodex, selectors=[], type_arguments=None), if_true=MemberReference(member=scope, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))], member=append, postfix_operators=[], prefix_operators=[], qualifier=sb, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=scopes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=scope)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None) return[call[sb.toString, parameter[]]] end[}] END[}]
Keyword[private] identifier[String] identifier[scopesToString] operator[SEP] identifier[Auth] operator[SEP] identifier[UrlCodex] identifier[urlCodex] operator[SEP] { Keyword[if] operator[SEP] identifier[scopes] operator[==] Other[null] operator[||] identifier[scopes] operator[SEP] identifier[length] operator[==] Other[0] operator[SEP] { Keyword[return] literal[String] operator[SEP] } identifier[StringBuilder] identifier[sb] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] operator[SEP] operator[SEP] Keyword[boolean] identifier[needsSeparator] operator[=] literal[boolean] operator[SEP] Keyword[for] operator[SEP] identifier[String] identifier[scope] operator[:] identifier[scopes] operator[SEP] { Keyword[if] operator[SEP] identifier[needsSeparator] operator[SEP] { identifier[sb] operator[SEP] identifier[append] operator[SEP] identifier[scopeDelimiter] operator[SEP] operator[SEP] } identifier[needsSeparator] operator[=] literal[boolean] operator[SEP] identifier[sb] operator[SEP] identifier[append] operator[SEP] identifier[urlCodex] operator[==] Other[null] operator[?] identifier[scope] operator[:] identifier[urlCodex] operator[SEP] identifier[encode] operator[SEP] identifier[scope] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[sb] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] }
public List<CharacterOrdersResponse> getCharactersCharacterIdOrders(Integer characterId, String datasource, String ifNoneMatch, String token) throws ApiException { ApiResponse<List<CharacterOrdersResponse>> resp = getCharactersCharacterIdOrdersWithHttpInfo(characterId, datasource, ifNoneMatch, token); return resp.getData(); }
class class_name[name] begin[{] method[getCharactersCharacterIdOrders, return_type[type[List]], modifier[public], parameter[characterId, datasource, ifNoneMatch, token]] begin[{] local_variable[type[ApiResponse], resp] return[call[resp.getData, parameter[]]] end[}] END[}]
Keyword[public] identifier[List] operator[<] identifier[CharacterOrdersResponse] operator[>] identifier[getCharactersCharacterIdOrders] operator[SEP] identifier[Integer] identifier[characterId] , identifier[String] identifier[datasource] , identifier[String] identifier[ifNoneMatch] , identifier[String] identifier[token] operator[SEP] Keyword[throws] identifier[ApiException] { identifier[ApiResponse] operator[<] identifier[List] operator[<] identifier[CharacterOrdersResponse] operator[>] operator[>] identifier[resp] operator[=] identifier[getCharactersCharacterIdOrdersWithHttpInfo] operator[SEP] identifier[characterId] , identifier[datasource] , identifier[ifNoneMatch] , identifier[token] operator[SEP] operator[SEP] Keyword[return] identifier[resp] operator[SEP] identifier[getData] operator[SEP] operator[SEP] operator[SEP] }
public static Iterable<BoxUser.Info> getAllEnterpriseUsers(final BoxAPIConnection api, final String filterTerm, final String... fields) { return getUsersInfoForType(api, filterTerm, null, null, fields); }
class class_name[name] begin[{] method[getAllEnterpriseUsers, return_type[type[Iterable]], modifier[public static], parameter[api, filterTerm, fields]] begin[{] return[call[.getUsersInfoForType, parameter[member[.api], member[.filterTerm], literal[null], literal[null], member[.fields]]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[Iterable] operator[<] identifier[BoxUser] operator[SEP] identifier[Info] operator[>] identifier[getAllEnterpriseUsers] operator[SEP] Keyword[final] identifier[BoxAPIConnection] identifier[api] , Keyword[final] identifier[String] identifier[filterTerm] , Keyword[final] identifier[String] operator[...] identifier[fields] operator[SEP] { Keyword[return] identifier[getUsersInfoForType] operator[SEP] identifier[api] , identifier[filterTerm] , Other[null] , Other[null] , identifier[fields] operator[SEP] operator[SEP] }
private static boolean isDate(String value) { try { new SimpleDateFormat("yyyyMMddHHmmss").parse(value); return true; } catch (ParseException e) { return false; } }
class class_name[name] begin[{] method[isDate, return_type[type[boolean]], modifier[private static], parameter[value]] begin[{] TryStatement(block=[StatementExpression(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="yyyyMMddHHmmss")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=parse, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=SimpleDateFormat, sub_type=None)), label=None), ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true), label=None)], catches=[CatchClause(block=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['ParseException']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[private] Keyword[static] Keyword[boolean] identifier[isDate] operator[SEP] identifier[String] identifier[value] operator[SEP] { Keyword[try] { Keyword[new] identifier[SimpleDateFormat] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[parse] operator[SEP] identifier[value] operator[SEP] operator[SEP] Keyword[return] literal[boolean] operator[SEP] } Keyword[catch] operator[SEP] identifier[ParseException] identifier[e] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } }
public static boolean isAFitInterpreter(SystemUnderDevelopment sud, String name) { try { Object target = sud.getFixture(name).getTarget(); if (target instanceof fit.Fixture && !target.getClass().equals(ActionFixture.class)) return true; } catch (Throwable t) { } return false; }
class class_name[name] begin[{] method[isAFitInterpreter, return_type[type[boolean]], modifier[public static], parameter[sud, name]] begin[{] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getFixture, postfix_operators=[], prefix_operators=[], qualifier=sud, selectors=[MethodInvocation(arguments=[], member=getTarget, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=target)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=target, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=fit, sub_type=ReferenceType(arguments=None, dimensions=None, name=Fixture, sub_type=None)), operator=instanceof), operandr=MethodInvocation(arguments=[], member=getClass, postfix_operators=[], prefix_operators=['!'], qualifier=target, selectors=[MethodInvocation(arguments=[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ActionFixture, sub_type=None))], member=equals, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true), label=None))], catches=[CatchClause(block=[], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=t, types=['Throwable']))], finally_block=None, label=None, resources=None) return[literal[false]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[boolean] identifier[isAFitInterpreter] operator[SEP] identifier[SystemUnderDevelopment] identifier[sud] , identifier[String] identifier[name] operator[SEP] { Keyword[try] { identifier[Object] identifier[target] operator[=] identifier[sud] operator[SEP] identifier[getFixture] operator[SEP] identifier[name] operator[SEP] operator[SEP] identifier[getTarget] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[target] Keyword[instanceof] identifier[fit] operator[SEP] identifier[Fixture] operator[&&] operator[!] identifier[target] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[ActionFixture] operator[SEP] Keyword[class] operator[SEP] operator[SEP] Keyword[return] literal[boolean] operator[SEP] } Keyword[catch] operator[SEP] identifier[Throwable] identifier[t] operator[SEP] { } Keyword[return] literal[boolean] operator[SEP] }
public static JCGLScalarType scalarTypeFromGL( final int type) { switch (type) { case GL30.GL_HALF_FLOAT: return JCGLScalarType.TYPE_HALF_FLOAT; case GL11.GL_BYTE: return JCGLScalarType.TYPE_BYTE; case GL11.GL_UNSIGNED_BYTE: return JCGLScalarType.TYPE_UNSIGNED_BYTE; case GL11.GL_SHORT: return JCGLScalarType.TYPE_SHORT; case GL11.GL_UNSIGNED_SHORT: return JCGLScalarType.TYPE_UNSIGNED_SHORT; case GL11.GL_INT: return JCGLScalarType.TYPE_INT; case GL11.GL_UNSIGNED_INT: return JCGLScalarType.TYPE_UNSIGNED_INT; case GL11.GL_FLOAT: return JCGLScalarType.TYPE_FLOAT; default: throw new UnreachableCodeException(); } }
class class_name[name] begin[{] method[scalarTypeFromGL, return_type[type[JCGLScalarType]], modifier[public static], parameter[type]] begin[{] SwitchStatement(cases=[SwitchStatementCase(case=[MemberReference(member=GL_HALF_FLOAT, postfix_operators=[], prefix_operators=[], qualifier=GL30, selectors=[])], statements=[ReturnStatement(expression=MemberReference(member=TYPE_HALF_FLOAT, postfix_operators=[], prefix_operators=[], qualifier=JCGLScalarType, selectors=[]), label=None)]), SwitchStatementCase(case=[MemberReference(member=GL_BYTE, postfix_operators=[], prefix_operators=[], qualifier=GL11, selectors=[])], statements=[ReturnStatement(expression=MemberReference(member=TYPE_BYTE, postfix_operators=[], prefix_operators=[], qualifier=JCGLScalarType, selectors=[]), label=None)]), SwitchStatementCase(case=[MemberReference(member=GL_UNSIGNED_BYTE, postfix_operators=[], prefix_operators=[], qualifier=GL11, selectors=[])], statements=[ReturnStatement(expression=MemberReference(member=TYPE_UNSIGNED_BYTE, postfix_operators=[], prefix_operators=[], qualifier=JCGLScalarType, selectors=[]), label=None)]), SwitchStatementCase(case=[MemberReference(member=GL_SHORT, postfix_operators=[], prefix_operators=[], qualifier=GL11, selectors=[])], statements=[ReturnStatement(expression=MemberReference(member=TYPE_SHORT, postfix_operators=[], prefix_operators=[], qualifier=JCGLScalarType, selectors=[]), label=None)]), SwitchStatementCase(case=[MemberReference(member=GL_UNSIGNED_SHORT, postfix_operators=[], prefix_operators=[], qualifier=GL11, selectors=[])], statements=[ReturnStatement(expression=MemberReference(member=TYPE_UNSIGNED_SHORT, postfix_operators=[], prefix_operators=[], qualifier=JCGLScalarType, selectors=[]), label=None)]), SwitchStatementCase(case=[MemberReference(member=GL_INT, postfix_operators=[], prefix_operators=[], qualifier=GL11, selectors=[])], statements=[ReturnStatement(expression=MemberReference(member=TYPE_INT, postfix_operators=[], prefix_operators=[], qualifier=JCGLScalarType, selectors=[]), label=None)]), SwitchStatementCase(case=[MemberReference(member=GL_UNSIGNED_INT, postfix_operators=[], prefix_operators=[], qualifier=GL11, selectors=[])], statements=[ReturnStatement(expression=MemberReference(member=TYPE_UNSIGNED_INT, postfix_operators=[], prefix_operators=[], qualifier=JCGLScalarType, selectors=[]), label=None)]), SwitchStatementCase(case=[MemberReference(member=GL_FLOAT, postfix_operators=[], prefix_operators=[], qualifier=GL11, selectors=[])], statements=[ReturnStatement(expression=MemberReference(member=TYPE_FLOAT, postfix_operators=[], prefix_operators=[], qualifier=JCGLScalarType, selectors=[]), label=None)]), SwitchStatementCase(case=[], statements=[ThrowStatement(expression=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=UnreachableCodeException, sub_type=None)), label=None)])], expression=MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None) end[}] END[}]
Keyword[public] Keyword[static] identifier[JCGLScalarType] identifier[scalarTypeFromGL] operator[SEP] Keyword[final] Keyword[int] identifier[type] operator[SEP] { Keyword[switch] operator[SEP] identifier[type] operator[SEP] { Keyword[case] identifier[GL30] operator[SEP] identifier[GL_HALF_FLOAT] operator[:] Keyword[return] identifier[JCGLScalarType] operator[SEP] identifier[TYPE_HALF_FLOAT] operator[SEP] Keyword[case] identifier[GL11] operator[SEP] identifier[GL_BYTE] operator[:] Keyword[return] identifier[JCGLScalarType] operator[SEP] identifier[TYPE_BYTE] operator[SEP] Keyword[case] identifier[GL11] operator[SEP] identifier[GL_UNSIGNED_BYTE] operator[:] Keyword[return] identifier[JCGLScalarType] operator[SEP] identifier[TYPE_UNSIGNED_BYTE] operator[SEP] Keyword[case] identifier[GL11] operator[SEP] identifier[GL_SHORT] operator[:] Keyword[return] identifier[JCGLScalarType] operator[SEP] identifier[TYPE_SHORT] operator[SEP] Keyword[case] identifier[GL11] operator[SEP] identifier[GL_UNSIGNED_SHORT] operator[:] Keyword[return] identifier[JCGLScalarType] operator[SEP] identifier[TYPE_UNSIGNED_SHORT] operator[SEP] Keyword[case] identifier[GL11] operator[SEP] identifier[GL_INT] operator[:] Keyword[return] identifier[JCGLScalarType] operator[SEP] identifier[TYPE_INT] operator[SEP] Keyword[case] identifier[GL11] operator[SEP] identifier[GL_UNSIGNED_INT] operator[:] Keyword[return] identifier[JCGLScalarType] operator[SEP] identifier[TYPE_UNSIGNED_INT] operator[SEP] Keyword[case] identifier[GL11] operator[SEP] identifier[GL_FLOAT] operator[:] Keyword[return] identifier[JCGLScalarType] operator[SEP] identifier[TYPE_FLOAT] operator[SEP] Keyword[default] operator[:] Keyword[throw] Keyword[new] identifier[UnreachableCodeException] operator[SEP] operator[SEP] operator[SEP] } }
private static String getMacUserShell() throws EnvironmentException { if( null != m_SHELL ) { return m_SHELL; } String[] args = { "nidump", "passwd", "/" }; return readShellFromPasswdFile( args ); }
class class_name[name] begin[{] method[getMacUserShell, return_type[type[String]], modifier[private static], parameter[]] begin[{] if[binary_operation[literal[null], !=, member[.m_SHELL]]] begin[{] return[member[.m_SHELL]] else begin[{] None end[}] local_variable[type[String], args] return[call[.readShellFromPasswdFile, parameter[member[.args]]]] end[}] END[}]
Keyword[private] Keyword[static] identifier[String] identifier[getMacUserShell] operator[SEP] operator[SEP] Keyword[throws] identifier[EnvironmentException] { Keyword[if] operator[SEP] Other[null] operator[!=] identifier[m_SHELL] operator[SEP] { Keyword[return] identifier[m_SHELL] operator[SEP] } identifier[String] operator[SEP] operator[SEP] identifier[args] operator[=] { literal[String] , literal[String] , literal[String] } operator[SEP] Keyword[return] identifier[readShellFromPasswdFile] operator[SEP] identifier[args] operator[SEP] operator[SEP] }
public static base_response delete(nitro_service client, nd6 resource) throws Exception { nd6 deleteresource = new nd6(); deleteresource.neighbor = resource.neighbor; deleteresource.vlan = resource.vlan; deleteresource.td = resource.td; return deleteresource.delete_resource(client); }
class class_name[name] begin[{] method[delete, return_type[type[base_response]], modifier[public static], parameter[client, resource]] begin[{] local_variable[type[nd6], deleteresource] assign[member[deleteresource.neighbor], member[resource.neighbor]] assign[member[deleteresource.vlan], member[resource.vlan]] assign[member[deleteresource.td], member[resource.td]] return[call[deleteresource.delete_resource, parameter[member[.client]]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[base_response] identifier[delete] operator[SEP] identifier[nitro_service] identifier[client] , identifier[nd6] identifier[resource] operator[SEP] Keyword[throws] identifier[Exception] { identifier[nd6] identifier[deleteresource] operator[=] Keyword[new] identifier[nd6] operator[SEP] operator[SEP] operator[SEP] identifier[deleteresource] operator[SEP] identifier[neighbor] operator[=] identifier[resource] operator[SEP] identifier[neighbor] operator[SEP] identifier[deleteresource] operator[SEP] identifier[vlan] operator[=] identifier[resource] operator[SEP] identifier[vlan] operator[SEP] identifier[deleteresource] operator[SEP] identifier[td] operator[=] identifier[resource] operator[SEP] identifier[td] operator[SEP] Keyword[return] identifier[deleteresource] operator[SEP] identifier[delete_resource] operator[SEP] identifier[client] operator[SEP] operator[SEP] }
public Observable<ServiceResponse<VnetGatewayInner>> getVnetGatewayWithServiceResponseAsync(String resourceGroupName, String name, String vnetName, String gatewayName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } if (name == null) { throw new IllegalArgumentException("Parameter name is required and cannot be null."); } if (vnetName == null) { throw new IllegalArgumentException("Parameter vnetName is required and cannot be null."); } if (gatewayName == null) { throw new IllegalArgumentException("Parameter gatewayName is required and cannot be null."); } if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } if (this.client.apiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); } return service.getVnetGateway(resourceGroupName, name, vnetName, gatewayName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<VnetGatewayInner>>>() { @Override public Observable<ServiceResponse<VnetGatewayInner>> call(Response<ResponseBody> response) { try { ServiceResponse<VnetGatewayInner> clientResponse = getVnetGatewayDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); } } }); }
class class_name[name] begin[{] method[getVnetGatewayWithServiceResponseAsync, return_type[type[Observable]], modifier[public], parameter[resourceGroupName, name, vnetName, gatewayName]] begin[{] if[binary_operation[member[.resourceGroupName], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Parameter resourceGroupName is required and cannot be null.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None) else begin[{] None end[}] if[binary_operation[member[.name], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Parameter name is required and cannot be null.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None) else begin[{] None end[}] if[binary_operation[member[.vnetName], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Parameter vnetName is required and cannot be null.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None) else begin[{] None end[}] if[binary_operation[member[.gatewayName], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Parameter gatewayName is required and cannot be null.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None) else begin[{] None end[}] if[binary_operation[THIS[member[None.client]call[None.subscriptionId, parameter[]]], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Parameter this.client.subscriptionId() is required and cannot be null.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None) else begin[{] None end[}] if[binary_operation[THIS[member[None.client]call[None.apiVersion, parameter[]]], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Parameter this.client.apiVersion() is required and cannot be null.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None) else begin[{] None end[}] return[call[service.getVnetGateway, parameter[member[.resourceGroupName], member[.name], member[.vnetName], member[.gatewayName], THIS[member[None.client]call[None.subscriptionId, parameter[]]], THIS[member[None.client]call[None.apiVersion, parameter[]]], THIS[member[None.client]call[None.acceptLanguage, parameter[]]], THIS[member[None.client]call[None.userAgent, parameter[]]]]]] end[}] END[}]
Keyword[public] identifier[Observable] operator[<] identifier[ServiceResponse] operator[<] identifier[VnetGatewayInner] operator[>] operator[>] identifier[getVnetGatewayWithServiceResponseAsync] operator[SEP] identifier[String] identifier[resourceGroupName] , identifier[String] identifier[name] , identifier[String] identifier[vnetName] , identifier[String] identifier[gatewayName] operator[SEP] { Keyword[if] operator[SEP] identifier[resourceGroupName] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[name] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[vnetName] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[gatewayName] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[client] operator[SEP] identifier[subscriptionId] operator[SEP] operator[SEP] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[client] operator[SEP] identifier[apiVersion] operator[SEP] operator[SEP] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[return] identifier[service] operator[SEP] identifier[getVnetGateway] operator[SEP] identifier[resourceGroupName] , identifier[name] , identifier[vnetName] , identifier[gatewayName] , Keyword[this] operator[SEP] identifier[client] operator[SEP] identifier[subscriptionId] operator[SEP] operator[SEP] , Keyword[this] operator[SEP] identifier[client] operator[SEP] identifier[apiVersion] operator[SEP] operator[SEP] , Keyword[this] operator[SEP] identifier[client] operator[SEP] identifier[acceptLanguage] operator[SEP] operator[SEP] , Keyword[this] operator[SEP] identifier[client] operator[SEP] identifier[userAgent] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[flatMap] operator[SEP] Keyword[new] identifier[Func1] operator[<] identifier[Response] operator[<] identifier[ResponseBody] operator[>] , identifier[Observable] operator[<] identifier[ServiceResponse] operator[<] identifier[VnetGatewayInner] operator[>] operator[>] operator[>] operator[SEP] operator[SEP] { annotation[@] identifier[Override] Keyword[public] identifier[Observable] operator[<] identifier[ServiceResponse] operator[<] identifier[VnetGatewayInner] operator[>] operator[>] identifier[call] operator[SEP] identifier[Response] operator[<] identifier[ResponseBody] operator[>] identifier[response] operator[SEP] { Keyword[try] { identifier[ServiceResponse] operator[<] identifier[VnetGatewayInner] operator[>] identifier[clientResponse] operator[=] identifier[getVnetGatewayDelegate] operator[SEP] identifier[response] operator[SEP] operator[SEP] Keyword[return] identifier[Observable] operator[SEP] identifier[just] operator[SEP] identifier[clientResponse] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Throwable] identifier[t] operator[SEP] { Keyword[return] identifier[Observable] operator[SEP] identifier[error] operator[SEP] identifier[t] operator[SEP] operator[SEP] } } } operator[SEP] operator[SEP] }
private List<MatrixQueryData.QName> splitMatrixKeysFromRaw(String raw) { LinkedList<MatrixQueryData.QName> result = new LinkedList<>(); String[] split = raw.split(","); for (String s : split) { String[] nameSplit = s.trim().split(":", 2); MatrixQueryData.QName qname = new MatrixQueryData.QName(); if (nameSplit.length == 2) { qname.namespace = nameSplit[0].trim(); qname.name = nameSplit[1].trim(); } else { qname.name = nameSplit[0].trim(); } result.add(qname); } return result; }
class class_name[name] begin[{] method[splitMatrixKeysFromRaw, return_type[type[List]], modifier[private], parameter[raw]] begin[{] local_variable[type[LinkedList], result] local_variable[type[String], split] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=trim, postfix_operators=[], prefix_operators=[], qualifier=s, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=":"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2)], member=split, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=nameSplit)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[None], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=MatrixQueryData, sub_type=ReferenceType(arguments=None, dimensions=None, name=QName, sub_type=None))), name=qname)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=MatrixQueryData, sub_type=ReferenceType(arguments=None, dimensions=None, name=QName, sub_type=None))), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=nameSplit, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2), operator===), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=qname, selectors=[]), type==, value=MemberReference(member=nameSplit, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)), MethodInvocation(arguments=[], member=trim, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)])), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=namespace, postfix_operators=[], prefix_operators=[], qualifier=qname, selectors=[]), type==, value=MemberReference(member=nameSplit, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)), MethodInvocation(arguments=[], member=trim, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=qname, selectors=[]), type==, value=MemberReference(member=nameSplit, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)), MethodInvocation(arguments=[], member=trim, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)])), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=qname, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=result, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=split, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=s)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None) return[member[.result]] end[}] END[}]
Keyword[private] identifier[List] operator[<] identifier[MatrixQueryData] operator[SEP] identifier[QName] operator[>] identifier[splitMatrixKeysFromRaw] operator[SEP] identifier[String] identifier[raw] operator[SEP] { identifier[LinkedList] operator[<] identifier[MatrixQueryData] operator[SEP] identifier[QName] operator[>] identifier[result] operator[=] Keyword[new] identifier[LinkedList] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[String] operator[SEP] operator[SEP] identifier[split] operator[=] identifier[raw] operator[SEP] identifier[split] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[String] identifier[s] operator[:] identifier[split] operator[SEP] { identifier[String] operator[SEP] operator[SEP] identifier[nameSplit] operator[=] identifier[s] operator[SEP] identifier[trim] operator[SEP] operator[SEP] operator[SEP] identifier[split] operator[SEP] literal[String] , Other[2] operator[SEP] operator[SEP] identifier[MatrixQueryData] operator[SEP] identifier[QName] identifier[qname] operator[=] Keyword[new] identifier[MatrixQueryData] operator[SEP] identifier[QName] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[nameSplit] operator[SEP] identifier[length] operator[==] Other[2] operator[SEP] { identifier[qname] operator[SEP] identifier[namespace] operator[=] identifier[nameSplit] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[trim] operator[SEP] operator[SEP] operator[SEP] identifier[qname] operator[SEP] identifier[name] operator[=] identifier[nameSplit] operator[SEP] Other[1] operator[SEP] operator[SEP] identifier[trim] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { identifier[qname] operator[SEP] identifier[name] operator[=] identifier[nameSplit] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[trim] operator[SEP] operator[SEP] operator[SEP] } identifier[result] operator[SEP] identifier[add] operator[SEP] identifier[qname] operator[SEP] operator[SEP] } Keyword[return] identifier[result] operator[SEP] }
public static void saveFile(File file, String content) throws IOException { saveFile(file, content, false); }
class class_name[name] begin[{] method[saveFile, return_type[void], modifier[public static], parameter[file, content]] begin[{] call[.saveFile, parameter[member[.file], member[.content], literal[false]]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[void] identifier[saveFile] operator[SEP] identifier[File] identifier[file] , identifier[String] identifier[content] operator[SEP] Keyword[throws] identifier[IOException] { identifier[saveFile] operator[SEP] identifier[file] , identifier[content] , literal[boolean] operator[SEP] operator[SEP] }